Skip to content

adopt-project.py: --source <org/repo> reads a directory of that name under the current one, a trailing / clones into source-readonly/ itself, and a recorded clone that is gone or emptied is refused for the wrong reason #652

Closed

Description

@brettheap

Lane: openreposhape-1 (openRepoShape-1)

plan --source <org/repo> should not read a directory of that name under the current one as the source. A trailing / should not make the clone land in source-readonly/ itself. A recorded clone that is gone or emptied should be refused for what it is. The plan should record whether plan made the clone (cloned:), and a clone no plan records should be removed.

From lane 1's triage of 2026-10-15, D3, approved by Brett Heap at 2026-10-16T11:21:17Z ("Approve all (Recommended)"). One pull request covers the lines below.

Parent: #457. Milestone: v1.1.0.

Lands after: #594, and D2's issue (#650, the --work-dir refusal and help text), which edits the same functions: _work_root, Plan.open_source, the head of cmd_check and the finally in main, as #594 leaves them. It is authored on D2's branch, or rebased once D2 lands.

Effort: M. Platform: all.

Lane openRepoShape-1 claims it at filing; see its CLAIMED comment.

Why this is P2.

The fix. The plan records whether plan made the clone (cloned:, L1-27's narrowing). That answers L1-22, L1-26 and L1-27 together. A clone no plan records is removed (L1-23, #526's own subject).

Lines

Rides along (backlog; tick it here if the same change covers it)

Each line above is a line of #457's checklist comment (issuecomment-6200110061). Tick it there too when this closes.

The lines as written on the tracking issue

[L1-22] A vanished local_path with no recorded repository goes to gh repo clone on POSIX and is refused source-unclonable, with a gh auth status hint; on Windows it is refused source-unresolvable, naming a --source nobody passed. _where_the_clone_is_gone could say the path is gone. Measured on 652b686 (POSIX); from the code (Windows). (Found in #594's writer and review.)

— #457, comment

[L1-24] Source.open tests Path(spec).exists() against the current directory, so org/repo is read as a local path when a directory of that name exists there, even for the re-clone whose NOTE says "is cloned again". From the code at 652b686. (Found in #594's writer and review.)

— #457, comment

[L1-26] A recorded clone that a cleaner emptied or half-cleaned, directory still there, is not treated as gone: check refuses git-failed rather than cloning again. macOS's temp cleaner can leave clones that way. Measured on 652b686. (Found in #594's review.)

— #457, comment

[L1-23] A clone no plan records stays in its temp directory: the fresh clone check or execute makes, each --source <org/repo> run, and a refused plan --source. Each check after the recorded clone is gone clones again and keeps 31 files where main left an empty source-readonly/. Measured on 652b686. (Found in #594's writer and review.)

— #457, comment

[L1-27] source.repository is read from origin on any host, so a moved non-GitHub local clone is re-cloned from github.com under that name; plan-stale keeps it safe. Narrowing: re-clone only a local_path this tool made, or record cloned: in the plan. Measured on 652b686. (Found in #594's review.)

— #457, comment

[L1-43] --source acme/Atlas/ with a trailing slash is compared as acme/Atlas/, and spec.split("/")[-1] is empty, so the clone target becomes source-readonly/ itself. From the code at 182389e; gh is needed to probe it. (Found in #591's writer and review.)

— #457, comment

Activity

  1. added this to the v1.1.0 milestone on Oct 16, 2026
  2. brettheap commented on Oct 16, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-1, session 300f8f46-004a-4e72-8587-4f192be2e108@Eagle, 2026-10-16T11:39:10Z, for #652

    Logged in lanes/log/openRepoShape-1.md at 89cde1d2db549e96d4d18c52b36e0843f7a97aa7.

    The three reads (lane-collision-protocol Rule 1):

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#652:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#652"`, kept where the row or its body names `#652`:
       none
    3. `git ls-remote --heads git@github.com:opensoft/openRepoShape` branches naming `652` as a whole token:
       none
    
  3. brettheap commented on Oct 16, 2026

    @brettheap
    ContributorAuthor

    (lane openRepoShape-4, 2026-10-16T14:10:49Z) For lane openRepoShape-1, which holds #652 (CLAIMED at 2026-10-16T11:39:10Z).

    One more line for #652, in the code its body already names. It comes from lane 4's checklist triage of 2026-10-16, approved by Brett Heap at 2026-10-16T13:36:07Z ("approve all triage recommendations"), and it is on the same Source.open path as L1-22, L1-24, L1-26 and L1-43.

    [L4-37] With --source org/repo, the adopt-not-the-source refusal comes only after gh repo clone, although the name is known before cloning. (was issuecomment-6157842287)

    — #457, comment

    If #652's pull request reorders Source.open, tick L4-37 on #457 (issuecomment-6157842287) when it lands. If it does not, L4-37 stays a line on #457.

    Lane: openreposhape-4 (openRepoShape-4)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions