Skip to content

adopt-project.py: without --local-remote-dir, check asks gh repo view about the two legs of another repository's plan, and its NOTE says execute asks again, where execute refuses plan-not-the-source first and asks nothing (follows #1210) #1232

Open

Description

@brettheap

(lane openRepoShape-4, 2026-10-23T21:28:50Z)

Found by: RV1210, lane 4's independent review of PR #1210 (for #1113) at 90eca414 (#1210 issuecomment-6374334825, #1210 (comment), posted 2026-10-23T20:42:14Z). It is NIT-2 of that review, "from before this PR": it holds on #1125's head as well as on #1210's. RV1210 graded #1210 NOT READY on one SHOULD (no row pins where the rule sits among the other findings), which is being fixed separately, and #1210 lands without this. This follows #1113 and #1210.

Line numbers are at 90eca4144 (#1210's head, on #1125's head 9549006fe; adopt-project.py sha256 4c8c1c9eb0c5), read from that commit for this issue and not run. #1125 and #1210 are open drafts, each on the one before it, and neither is on main, so this goes onto a branch after #1210 lands. The file is adopt-project.py, and the rows go in tests/test_adopt_plan_against_its_source.py, which #1210 adds.

What is wrong

check asks GitHub about two repositories that execute never asks about. Without --local-remote-dir, check on a plan for another repository (plan-not-the-source) still runs gh repo view otherorg/Thing-spec --json nameWithOwner, and the same for otherorg/Thing-code. It does so on both heads. Its NOTE then says "execute asks again before it makes either leg" (_leg_remote_answers, about :13332). But execute refuses plan-not-the-source first and asks nothing: no _repository_urls, no gh, no remote (cmd_execute, the _against_its_source call at about :15080, before _repository_urls).

The question is also the wrong one to ask. The remedy for plan-not-the-source is plan under the source's own name, which renames both legs. So the question is asked about two repositories the mended plan does not name. check already holds this view for four other findings: it skips the leg question when _held_findings returns a code in RENAMES_THE_LEGS (adopt-name-too-long, adopt-bad-project-name, adopt-org-too-long, adopt-bad-org), for exactly this reason (cmd_check, about :12390 to :12403, and the comment on RENAMES_THE_LEGS, about :13392).

Measured

By RV1210, on #1125's head and on #1210's, with a plan for another repository (org: otherorg) and no --local-remote-dir. The environment was the landing gate's: a stub gh first on PATH that logs its arguments and exits 97, GH_TOKEN=bogus, an empty GH_CONFIG_DIR, an empty global git config with GIT_CONFIG_NOSYSTEM=1, GIT_SSH_COMMAND=false and a proxy that goes nowhere. Each execute ran through a wrapper that stops it with exit 99 if it reaches _repository_urls without --local-remote-dir. It was not re-run for this issue.

  • check ran gh repo view otherorg/Thing-spec --json nameWithOwner and the same for otherorg/Thing-code, and its NOTE said execute asks again.
  • execute refused plan-not-the-source first. The wrapper never tripped, and no probe made a leg.
  • The stub's log held only check's gh repo view calls of this issue.

The code, as RV1210 reads it: cmd_check skips _leg_remote_findings only for RENAMES_THE_LEGS (about :12402), and _leg_remote_findings (about :13357) builds <org>/<name> for each leg from the plan's org: and asks gh for each when there is no --local-remote-dir.

What is to do

  • RV1210's fix (a follow-up): skip _leg_remote_findings when the rule yields plan-not-the-source, as check already skips it for RENAMES_THE_LEGS. cmd_check holds the rule's problems in unmended (about :12348), each with refusal.code, and PLAN_NOT_THE_SOURCE is the code (about :16440).
  • To settle: under --local-remote-dir. The skip RV1210 names is of _leg_remote_findings as a whole, which under --local-remote-dir asks the disk and not GitHub. The same argument holds there (the mended plan renames both legs), and execute asks nothing there either, but RV1210 measured only the case without --local-remote-dir, and the skip would also drop a leg-remote-exists finding that check lists beside plan-not-the-source today (not measured). Say which, and put a row on it.

Done when

See #1113, #1210, #1125, #798 and #871.

Lane: openreposhape-4 (openRepoShape-4)

Activity

  1. added this to the v1.2.1 milestone on Oct 23, 2026
  2. brettheap commented on Nov 10, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-3, session b30e8b49-f249-4668-adb1-1dbfa93c09e1@Eagle, 2026-11-10T01:58:56Z, for #1232

    Logged in lanes/log/openRepoShape-3.md at 4284dbdd6724312bab27048f6c0384665a17f942.

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

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#1232:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#1232"`, kept where the row or its body names `#1232`:
       none
    3. `git ls-remote --heads [email protected]:opensoft/openRepoShape` branches naming `1232` as a whole token:
       none
    
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