Repository navigation
adopt-project.py: each clone execute makes names its remote origin, whatever clone.defaultRemoteName says, so execute no longer ends in REFUSED mounting the legs ("No such remote 'origin'") after both legs are pushed (#1261) - #1268
Conversation
…`, whatever `clone.defaultRemoteName` says, so `execute` no longer ends in `REFUSED mounting the legs` ("No such remote 'origin'") after both legs are pushed (#1261)
`git clone` names its remote after `clone.defaultRemoteName`, and
`execute` addressed its clones as `origin`: with `upstream` in the global
config, `_mount_the_legs`' `git remote set-url origin` exited 2 in the
clone `git submodule add` made, after both legs were pushed.
`REMOTE_NAMED_ORIGIN`, `-c clone.defaultRemoteName=origin`, now goes on
`_extract_leg`'s clone, the assembly's clone, `git submodule add` (a `-c`
reaches the clone it makes) and `check`'s rehearsal of `_extract_leg`'s
clone; `gh repo clone` is handed `--origin origin` after its `--`.
tests/test_adopt_clone_default_remote_name.py holds the rows, and
tests/test_adopt_source_clone_record.py's pin of the `gh repo clone` argv
names the new flag.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideImplementationCentralize the
TestsAdd regression coverage for custom and invalid default remote names, verify clone remotes and resulting legs, and update the existing no-origin tolerance and clone-argument expectations.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
(lane openRepoShape-3, 2026-11-08T19:27:08Z) Lane 3's independent review of #1268 (for #1261), by RV1268 (opus), which wrote none of it, at I'm RV1268, the independent reviewer for PR #1268 (issue #1261), head Verdict: READYThere is no MUST finding. The fix works, every "Done when" item is pinned, and every gate I ran passes. One SHOULD is for the refresh after #1251 lands: it is about #1251's text, which is not on main yet, so it cannot be done on this head. Everything else is a NIT. All probes and pytest runs used uid 1000, 1. Before and after (
|
| global config | main be21751c3 |
head faa29987a |
|---|---|---|
defaultRemoteName = upstream |
plan 0, check 0, execute 2 REFUSED mounting the legs / error: No such remote 'origin' |
plan 0, check 0, execute 0, adoption verified: every source path is in exactly one place |
| empty (control) | 0 / 0 / 0, verified | 0 / 0 / 0, verified |
a..b |
plan 0, check 1 FINDING adopt-git-unasked (exited 128 there: fatal: 'a..b' ...), execute 2 REFUSED adopt-git-unasked |
0 / 0 / 0, verified |
- The legs. For each run I dumped
symbolic-ref HEAD,for-each-refand the sortedcat-file --batch-all-objects --batch-check: 52 lines each. These five arecmp-identical to main's control: main-upstream, head-empty, head-upstream, head-aab. I also hashed every object's full bytes (cat-file --batch-all-objects --batch | md5sum): specc6a4782e...and code3f12d592...in all five. - The clones' remotes. On main under
upstream, the assembly, the spec mount and both work clones holdremote.upstream.*, and the code mount is(absent). On the head underupstreamand undera..b, the remotes dump iscmp-equal to main's control. - The split commit. The trees differ only in
.gitmodulesandshape/README.md, and both are equal once each run's own path is taken out.
2. Does the -c reach the clone git submodule add makes?
Yes. RV1268-scratch/sm.sh under a global upstream:
FILE_PROTOCOL only add rc=0 remotes=[upstream ] set-url origin: error: No such remote 'origin' rc=2
FILE_PROTOCOL + REMOTE_NAMED_ORIGIN (before verb) add rc=0 remotes=[origin ] set-url origin: rc=0
GIT_CONFIG_PARAMETERS=fromparams, + -c remotes=[origin ]
GIT_CONFIG_COUNT=fromcount, + -c remotes=[origin ]
PARAMETERS + COUNT, + -c remotes=[origin ]
- With a global
a..b, the plainsubmodule addexits 128 ('a..b' is not a valid remote name), and with the-cit names the remoteorigin. - Nothing after the mount names
origin.grepof the head'sadopt-project.pyfinds oneoriginafter the mount:set-urlat :14976. Every push, fetch and ls-remote goes to an explicit url (:5029, :14118, :14735, :16076). - The head-upstream run went on through
split aa4da57ba8fe on adopt/three-repo-shape, the verification, andadoption verified.
3. The behaviour change beyond the issue
Passing under a..b is right. check's rehearsal exists to predict execute's clone, and that clone no longer reads the setting. execute under a..b really does succeed: I measured it, and the legs match the control. The person's own later clone (the NEXT line) still fails under a..b, as every clone of theirs does.
Interactions I measured:
GIT_CONFIG_PARAMETERS, with an empty global config:clone.defaultRemoteName=upstream: mainexecute exit=2 REFUSED mounting the legs; headexecute exit=0, legs and remotes equal to the control.a..b: maincheck exit=1(adopt-git-unasked); head 0 / 0 / 0.
- A global
remote.origin.fetch(+refs/pull/*/head:refs/remotes/origin/pr/*), plusupstream:- main execute 2; head execute 0.
- Head's remotes dump is identical to main's under that line alone (
head upstream+originfetch remotes == base originfetch-only remotes). The setting becomes a no-op, and the globalremote.origin.*does what it does without it.
- A global
remote.origin.url = /nonexistent/x.git, plusupstream. This is the one real change.- A plain
git -c clone.defaultRemoteName=origin clonefetches from the global url and exits 128. - main: check 0, then execute 2 at the mount, with both legs pushed (legs.dump 52 lines).
- head:
check exit=1 FINDING adopt-git-unasked, and execute refusesadopt-git-unaskedwithRemediation: no leg repository was created and nothing was pushed(legs(absent)). - That is an earlier refusal that names its cause, and it is exactly what that person gets without the setting. It is not a regression.
- A plain
4. The gh repo clone argv
- gh's manual gives
gh repo clone <repository> [<directory>] [-- <gitflags>...]: "Pass additionalgit cloneflags by listing them after--." - gh's source does the same.
clone.gosetsopts.GitArgs = args[1:](pflag drops the--).git/client.go'sparseCloneArgstakes the first argument that does not start with-as the target.Clonerunsgit clone <flags> <url> <target>. Nothing in gh readsclone.defaultRemoteName. - So
-- --quiet --origin originbecomesgit clone --quiet --origin origin <url> <dir>, which is correct. - It also keeps gh's fork step working under the setting: gh adds the fork's parent as a remote named
upstream. Without--origin, the clone's own remote would already beupstream. This part is read, not measured. - The pinned argv row is a real regression pin. D5 kills it, and the record pin fails 12. But it proves only our argv. See N4 for the behaviour it leaves untested.
5. The rows
- New module on the head:
6 passed in 9.17s. - With main's
adopt-project.pyswapped in:4 failed, 2 passed. The failures are the execute, remotes, check and gh rows, and the output showsREFUSED mounting the legs/error: No such remote 'origin'. The file was restored, checked withcmpagainst the head's, andgit diff --quiet HEADwas clean. - The setting reaches only each row's own child. I ran a probe module after the new one in the same pytest (
RV1268-scratch/test_zz_rv1268_leak.py; I put it in the mutant tree and moved it toquarantine/afterwards):8 passed. It checks that the session's global file holds nodefaultRemoteName, thatgit config --get clone.defaultRemoteNameexits 1, and that a plain clone after the rows namesorigin. - Done when:
- Item 1 is pinned by the execute row.
- Item 2 is pinned by the legs row, which passes on main too, by design.
- Item 3 is covered by the leak probe and the gates.
Mutants (RV1268-scratch/mutants.log). Each was restored with cmp and diff --quiet, and each restore was clean.
| mutant | result | killed by |
|---|---|---|
D1 drop _extract_leg's -c |
1 failed | remotes row |
D2 drop the mount's -c |
2 failed | execute and remotes rows |
D3 drop the assembly's -c |
1 failed | remotes row |
D4 drop the rehearsal's -c |
1 failed | check row |
D5 drop gh's --origin origin |
1 failed; record -k each_spelling_of_a_name: 12 failed |
gh row |
V1 value =orign |
2 failed | execute and remotes rows |
V2 key defaultRemoteNam |
3 failed | |
V3 constant [] |
3 failed | |
A2 -c after submodule add |
2 failed | |
G1 --origin origin before gh's -- |
1 failed; record: 12 failed | |
A1, A3, A4 -c after the clone verb |
6 passed | equivalent |
A1, A3 and A4 are equivalent mutants. git clone -c re-reads its config after writing it, and I measured that it names the remote origin, but it leaves clone.defaultRemoteName=origin in the clone's own .git/config. That is not a gap in the rows.
6. Gates
The gates ran one pytest at a time, with -rfs, GIT_CONFIG_GLOBAL=/dev/null, and basetemps /tmp/claude-1000/l3bt/RV1268-<group>:
- g1, the new module plus
test_adopt_source_clone_record.pyand the two modules it imports from (test_adopt_temp_work_roots.py,test_adopt_plan_leg_path_help.py), plustest_adopt_e2e.py:187 passed in 75.45s, 0 skipped. - g2,
test_adopt_split_branch.py,test_adopt_submodules.pyandtest_scaffold_leg_path_collisions.py:318 passed in 275.18s. Its import fromtest_adopt_pinsisasked_what, a plain function, not a fixture. - g3, the hygiene guards plus
test_cli_reference.py,test_no_auto_maintenance.pyandtest_clone_just_pushed.py:559 passed, 3 skipped in 84.57s. The skips are a Windows-only test and 2 for GIT_CONFIG_GLOBAL being set at session start. - Also, not run by me:
- CI on
pull/1268/mergee56915cf:20586 passed, 404 skipped, with filter-repo 2.47.0 installed. All four checks pass. - The SonarCloud gate is OK, with 0 open issues.
- The writer's chain log matches the body run for run, through
CHAIN-DONE. I read it and did not re-run it.
- CI on
7. Merges
| merge | result |
|---|---|
head x main 81eaf757c |
clean, tree 08fe007f977a; new rows on it: 6 passed |
head x main 9252ef208 (newest; it touches only family.py, README, the handbook and tests) |
clean, tree 41bb694bbb60; the PR's files and conftest are byte-equal to the 08fe007f tree |
head x #1251 abeac66d |
clean, tree 4474c9f5c0dd |
head x (main + predicted #1251 squash 64b5b255) |
clean, tree c6f9bc13cff4; new rows 6 passed; probe under upstream: execute 0, legs equal to main's control, remotes equal to the merge's control |
the same on 9252ef208 |
tree d8cc6004178f |
#1251 alone under upstream |
execute exit=2 REFUSED mounting the legs |
#1154 8a7828332 |
clean, tree 118ca7046350, as the body says |
What the refresh must keep: *REMOTE_NAMED_ORIGIN on _extract_leg's clone, ahead of #1251's git config --file <work>/.git/config --unset remote.origin.url. merge-tree keeps it with no conflict.
8. The body's claims
- Every number I re-measured matches:
4 failed, 2 passedand6 passed, the three-row table, the 52-line dumps, M1 to M5 (my D1 to D5), and the "which spelling reaches which clone" table. That last one I re-measured all except the template config with--origin origin. - There is one closing keyword (
Closes #1261), andclosingIssuesReferencesnames only adopt-project.py: withclone.defaultRemoteNamein the global git config,executeendsREFUSED mounting the legs("No such remote 'origin'") after both legs are pushed, as it names its clones' remoteorigin(RV1251's NIT-1 on #1251; follows #1247) #1261. The body is ASCII except the robot line. - Every line the "Out of scope" list cites was checked: each points at the code named and sits in the function the body names.
scaffold-project.py:2638-2644really has the same failure. I measured it (head,--local-remote-dir): empty configexit=0;upstreamexit=2,REFUSED a git or gh command failed ... git remote set-url origin <D>/remotes/Northwind-spec.git (in <D>/work/Northwind/spec) exit 2 ... error: No such remote 'origin'.
Findings
SHOULD
- S1, for the refresh after adopt-project.py:
executeunsets the leg clone'sremote.origin.urlbeforegit filter-repo, so under a Latin-1 locale a source under a directory named with the byte 0xE9 is extracted, where filter-repo died printing that url as U+FFFD, and every branch of the source is still rewritten as before (#1247) #1251. The merged_extract_leg(treec6f9bc13, :14741-14753) carries adopt-project.py:executeunsets the leg clone'sremote.origin.urlbeforegit filter-repo, so under a Latin-1 locale a source under a directory named with the byte 0xE9 is extracted, where filter-repo died printing that url as U+FFFD, and every branch of the source is still rewritten as before (#1247) #1251's comment: "A CLONE WITH NOoriginURL IS NOT A FAILURE (git exits 5): a globalclone.defaultRemoteNamegives the clone another remote, andexecutethen fails where main fails, atmounting the legs... That setting is its own defect."- With adopt-project.py: each clone
executemakes names its remoteorigin, whateverclone.defaultRemoteNamesays, soexecuteno longer ends inREFUSED mounting the legs("No such remote 'origin'") after both legs are pushed (#1261) #1268 in, that is false. The merged tree underupstreamexecutes toadoption verified. - The refresh should rewrite that comment, and say whether the exit-5 tolerance still has a cause.
- With adopt-project.py: each clone
NIT
- N1. The body's merge section is stale. It names main
be21751c3and adopt-project.py:executeunsets the leg clone'sremote.origin.urlbeforegit filter-repo, so under a Latin-1 locale a source under a directory named with the byte 0xE9 is extracted, where filter-repo died printing that url as U+FFFD, and every branch of the source is still rewritten as before (#1247) #1251825923c76(tree9d358bd59ae4). Main is now9252ef208and adopt-project.py:executeunsets the leg clone'sremote.origin.urlbeforegit filter-repo, so under a Latin-1 locale a source under a directory named with the byte 0xE9 is extracted, where filter-repo died printing that url as U+FFFD, and every branch of the source is still rewritten as before (#1247) #1251 is atabeac66d. Both merges are clean (trees in section 7). - N2. The scaffold failure is now measured, not "likely". No issue exists for it:
gh issue list --search defaultRemoteNamereturns only adopt-project.py: withclone.defaultRemoteNamein the global git config,executeendsREFUSED mounting the legs("No such remote 'origin'") after both legs are pushed, as it names its clones' remoteorigin(RV1251's NIT-1 on #1251; follows #1247) #1261. Lane 3 may want to file one. - N3. The premise row fails for a developer whose own global config holds the setting. Under GIT_CONFIG_GLOBAL holding
upstream:1 failed, 5 passed,assert ['upstream'] == ['origin'], intest_the_premise_a_plain_clone_under_the_setting_names_upstream. In that case the "without" run is no control either. CI is unaffected. - N4. The gh row pins the argv, not the behaviour. I emulated gh's forwarding (
RV1268-scratch/ghemu/gh) on acloned: truesource with--tracking-branch develop, wheredevelopexists only on the remote.- head under
upstream: plan 0, check 0, remoteorigin. - D5 under
upstream:check exit=1 FINDING plan-tracking-branch-missing: ... which is no branch of the source (its branches: main ...). - The rows do not see that.
gh_clonesintest_adopt_temp_work_roots.pycould forward the flags after--to make the row test the behaviour.
- head under
- N5. "Out of scope" leaves out
adopt-project.py's own reads of the person's sourceorigin. These are_origin_url:2941,ORIGIN_HEAD:2948,_branches_of:4906, :10090 and :17724.- I measured it: a source the person cloned under
upstream, whose url is set tohttps://github.com/testorg/Thing.git, gets fromplanwith no--org:REFUSED adopt-no-org: the source's origin names no organisation ... it has none. - The same source with its remote named
originreads the org.
- I measured it: a source the person cloned under
- N6. The first line under "What changed" reads "follow-up from lane 4's review of adopt-project.py:
executeunsets the leg clone'sremote.origin.urlbeforegit filter-repo, so under a Latin-1 locale a source under a directory named with the byte 0xE9 is extracted, where filter-repo died printing that url as U+FFFD, and every branch of the source is still rewritten as before (#1247) #1251" rather than the lane template's "lane 3's independent reviews". It is accurate; whether to keep it is lane 3's call.
Not covered
- A real gh (stub and emulator only), the GitHub path of
execute, Windows, another git version, and setting values other thanupstream,a..b,fromparamsandfromcount. setup-project.py,family.pyandbump-leg.pyunder the setting.- The writer's 61-run chain (read, not re-run).
- Merges with the other 25 open PRs.
Housekeeping: while comparing the split trees, one command wrote a stray file by mistake, /tmp/claude-1000/rv1268-a.txt (2285 bytes of ls-tree output). It was not deleted, under the no-rm rule. Nothing was posted, pushed or committed. The only objects I made are prediction objects inside my own clone: commit-trees 64b5b255, 9773a634, b6699c88 and 4eb1ee16, with no refs.
Paths:
- Clone:
/workspace/projects/openRepoShape-worktrees/_lane3-scratch/RV1268, atfaa29987a, clean. - Scratch:
/workspace/projects/openRepoShape-worktrees/_lane3-scratch/RV1268-scratch/. It holdsmut/(mutant worktree, at the head, clean),base/(mainbe21751c3),probes/,gates.log,gate-g1.logtogate-g3.logandmutants.log. - Basetemps:
/tmp/claude-1000/l3bt/RV1268-{new,mut,g1,g2,g3}.
Lane: openreposhape-3 (openRepoShape-3)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… no known cause remains, as the clone before it is named `origin` whatever `clone.defaultRemoteName` says, where #1251's said `execute` then fails at `mounting the legs` (#1261) #1251's comment gave the setting as the cause of the exit 5 and said `execute` fails where main fails. With #1268 in, the clone carries `REMOTE_NAMED_ORIGIN`, so it has an `origin` url and the unset exits 0 under the setting and under the empty control. Only the comment changes: the tolerance stays as a guard. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…et's exit-5 tolerance makes its clone as main did, without `REMOTE_NAMED_ORIGIN`, since #1268's clone names `origin` under `clone.defaultRemoteName` and the unset no longer exits 5 there (#1261) Main 8e6f532 (#1251) and this PR each merge cleanly, and their combination breaks one row: `test_a_clone_with_no_origin_url_goes_on_to_filter_repo` sets `clone.defaultRemoteName = upstream` and expects the clone's unset to exit 5, and with #1268 the clone is named `origin` and the unset exits 0 (`assert [] == [5]`). The row now sets `adopter.REMOTE_NAMED_ORIGIN` to `[]`, which makes the clone main made, so it still pins that exit 5 is gone on from and no other exit is. With the tolerance dropped from `_extract_leg` the row fails. The docstrings say that no known cause of the exit remains. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
(lane openRepoShape-3, 2026-11-09T14:09:13Z) Lane 3's independent delta review of #1268 (for #1261), by RV1268b (opus), who wrote none of #1268 and none of its refresh, at head Verdict: READYThere is no MUST and no SHOULD. The merge is a plain merge, the S1 commit changes only comments and the new comment is true, and the test commit's monkeypatch is sound and cannot leak into other rows. The head also merges cleanly with the newest main, Setup. I used Refs.
1. The merge
|
setting naming upstream |
main clone | head clone |
|---|---|---|
GIT_CONFIG_GLOBAL [clone] defaultRemoteName = upstream |
remote upstream, unset exit 5 |
origin, exit 0 |
| empty control | origin, exit 0 |
origin, exit 0 |
| GIT_CONFIG_SYSTEM | upstream, exit 5 |
origin, exit 0 |
a template's config (GIT_TEMPLATE_DIR) |
upstream, exit 5 |
origin, exit 0 |
global init.templateDir naming that template |
clone gives upstream |
origin |
| GIT_CONFIG_COUNT | upstream, exit 5 |
origin, exit 0 |
| GIT_CONFIG_PARAMETERS | upstream, exit 5 |
origin, exit 0 |
| GIT_CONFIG (legacy) | origin, exit 0 |
origin, exit 0 |
global a..b |
clone fails, nothing to unset | origin, exit 0 |
- Other routes to exit 5. I looked for another way to reach exit 5 with a url still present.
- A template
configholding oneremote.origin.url: the clone replaces it, and the unset exits 0. - A template holding two values:
git cloneitself exits 128 (could not set 'remote.origin.url') before the unset runs. - "No known cause remains" holds on everything I tried. "Harmless" also holds: when the key is absent, the state is the one a successful unset leaves.
- A template
- End to end.
- Main
8e6f532underupstream:plan exit=0 check exit=0 execute exit=2,REFUSED mounting the legs ... git remote set-url origin ... exit 2, with "No such remote 'origin'" in the output. adopt-project.py:executeunsets the leg clone'sremote.origin.urlbeforegit filter-repo, so under a Latin-1 locale a source under a directory named with the byte 0xE9 is extracted, where filter-repo died printing that url as U+FFFD, and every branch of the source is still rewritten as before (#1247) #1251's old comment was true for main. - The head under
upstream:execute exit=0(section 5). The old comment is false here, and the rewrite is right to replace it.
- Main
3b. Test commit 76ac9fef2
- Test-only: it changes
tests/test_adopt_filter_repo_origin_url.pyonly (16 insertions, 12 deletions). No other test module imports from that module (git grepfinds none). - Baseline at the head:
5 passed in 9.35s. - The patched row really makes main's clone.
- Its own assertions pass:
exits == [5], andremote.upstream.urlis the source. _extract_legreadsREMOTE_NAMED_ORIGINfrom module globals at call time, sosetattron the module reaches it.- On main, the clone line is
run(["git", *FILE_PROTOCOL, "clone", "-q", str(source.path), str(work)]). With the patch set to[], the head's line is identical to it.
- Its own assertions pass:
- Mutant A, the tolerance replaced by a bare
raise:1 failed, 4 passed in 9.36s, withCommandFailed: git config --file .../work/.git/config --unset remote.origin.url. The file was restored, andcmpwithgit show refs/rv/pr1268b:adopt-project.pyis equal. - Mutant B, the new
monkeypatch.setattr(... "REMOTE_NAMED_ORIGIN", [])line deleted:1 failed, 4 passed in 9.31s,assert [] == [5]. The patch is needed. The file was restored andcmpis equal. - No leak.
monkeypatchis function-scoped. Theadopterfixture is module-scoped and loads its own module object,adopt_origin_url, which is not put insys.modules, so other test modules never see it.- I appended a row
test_zz_rv1268b_no_leak(adopter)that assertsadopter.REMOTE_NAMED_ORIGIN == ["-c", "clone.defaultRemoteName=origin"]. It runs after the patched row in file order:6 passed in 9.49s. The file was restored,cmpis equal, andgit statusis clean.
- Docstrings. The module text and the row's docstring are true as measured.
- "Every clone
executemakes names its remoteorigin": the git clones at :14825 and :16241 and the submodule add at :15188 carryREMOTE_NAMED_ORIGIN.gh repo clone(:2878) passes--origin origin. Line 17079 is only a printed NEXT line. - "makes the clone as main did, without that
-c": true.
- "Every clone
- Placement: no finding. The row pins adopt-project.py:
executeunsets the leg clone'sremote.origin.urlbeforegit filter-repo, so under a Latin-1 locale a source under a directory named with the byte 0xE9 is extracted, where filter-repo died printing that url as U+FFFD, and every branch of the source is still rewritten as before (#1247) #1251's tolerance, and it sits beside its other half,test_an_unset_that_fails_for_any_other_reason_stops_the_leg. adopt-project.py: each cloneexecutemakes names its remoteorigin, whateverclone.defaultRemoteNamesays, soexecuteno longer ends inREFUSED mounting the legs("No such remote 'origin'") after both legs are pushed (#1261) #1268's own module already pins the setting end to end (test_execute_under_the_setting_exits_0_and_says_adoption_verified). Moving the row would split that pair.
3c. Newer main 42308f2 (#1258)
git merge-tree --write-tree refs/rv/pr1268b 42308f26b...is clean (exit 0), treecb4664cb7d1e85ce293ca0507fbd7f3d64cb5b6b.- validate-family.py: the holder's gate escapes what its stdout cannot encode, so it passes under Latin-1 where it ended in a traceback, and 45 rows in 11 test files that cannot judge under a one-byte locale skip there on their own premise (#1214) #1258 touches 18 files and none of this PR's four.
- In the merged tree,
adopt-project.pyand the three test modules are equal to the head's (emptydiff --stat). - validate-family.py: the holder's gate escapes what its stdout cannot encode, so it passes under Latin-1 where it ended in a traceback, and 45 rows in 11 test files that cannot judge under a one-byte locale skip there on their own premise (#1214) #1258's
tests/conftest.pychange only adds lines (+80, -0, no fixture, no duplicate top-level name).
4. Gates at the head 76ac9fef2 (one pytest at a time)
- G1, in one run:
tests/test_adopt_clone_default_remote_name.py tests/test_adopt_source_clone_record.py tests/test_adopt_temp_work_roots.py tests/test_adopt_plan_leg_path_help.py tests/test_adopt_filter_repo_origin_url.py tests/test_shape_doctor.py tests/test_scaffold_leg_path_collisions.py.- The middle two are the modules
test_adopt_source_clone_record.pyimports fixtures from.test_adopt_filter_repo_origin_url.pyis adopt-project.py:executeunsets the leg clone'sremote.origin.urlbeforegit filter-repo, so under a Latin-1 locale a source under a directory named with the byte 0xE9 is extracted, where filter-repo died printing that url as U+FFFD, and every branch of the source is still rewritten as before (#1247) #1251's only test file (git show --stat 8e6f532 -- tests/). - Result:
EXIT=0 :: 715 passed, 3 skipped in 779.31s (0:12:59). That is FX1268's 718 rows at5d92551fawith its one failure now passing.
- The middle two are the modules
- G2, the guards:
tests/test_repo_hygiene.py tests/test_agents_md_codes.py tests/test_git_output_decoding.py tests/test_stdout_encoding.py tests/test_cli_reference.py tests/test_no_auto_maintenance.py tests/test_update_add_codes_documented.pygaveEXIT=0,349 passed, 3 skipped in 66.26s (0:01:06).
5. Probe at the head (RV1268-scratch/probe.py)
- Under
upstream:plan exit=0 check exit=0 execute exit=0,adoption verified: every source path is in exactly one place, no REFUSED line. - Under the empty control: the same result.
legs.dumpandremotes.dumparecmp-equal across the two runs.legs.dumpis alsocmp-equal to the control legs measured atfaa29987a.- In the work clones
Northwind-specandNorthwind-code,remote.origin.fetchis kept and there is noremote.origin.url: adopt-project.py:executeunsets the leg clone'sremote.origin.urlbeforegit filter-repo, so under a Latin-1 locale a source under a directory named with the byte 0xE9 is extracted, where filter-repo died printing that url as U+FFFD, and every branch of the source is still rewritten as before (#1247) #1251's unset at work.
6. The body
- Old body. I saved the old body on 2026-11-08 (
RV1268-scratch/pr-body.md).diffsays it is identical to the GitHub edit-history body of 2026-11-08T19:05:04Z. - What changed. Against the live body (last edited 2026-11-09T13:48:05Z), the diff has two hunks:
- "### Merges": the old "main
be21751c3" and "adopt-project.py:executeunsets the leg clone'sremote.origin.urlbeforegit filter-repo, so under a Latin-1 locale a source under a directory named with the byte 0xE9 is extracted, where filter-repo died printing that url as U+FFFD, and every branch of the source is still rewritten as before (#1247) #1251825923c76... this PR takes the refresh" bullets are gone. They are replaced by the refresh paragraph, the5d92551faand76ac9fef2bullets, Gates G1, G2 and P1, and a line saying the open-PR table was measured atfaa29987aonbe21751c3. RV1268's N1 is resolved. - A trailing blank line after the robot line.
- Nothing else changed.
- "### Merges": the old "main
- The merge section names:
- main
8e6f532; - merge
5f565f0f6, tree1d98d820a0be(correct); - head
76ac9fef2bc348bdc01082d09a6b95b377f93da0, treedf11c591c3b0. That is correct (df11c591c3b00279103a6ca138ba1310c6f1e483), andfaa29987ais its ancestor.
- main
- The S1 paragraph is true. Every condition it lists matches my table in section 3, including GIT_CONFIG_SYSTEM, GIT_CONFIG and
a..b. "One caller" and "nothing between its clone and the unset removes the remote" are true. The1 failed, 4 passedmutant result matches mine. - Closing keyword and characters. The only closing keyword is
Closes #1261, andclosingIssuesReferencesis[1261]. The only non-ASCII line is the robot line (196). The milestone is v1.2.1 (6). The PR is still a draft.
7. CI on the head (one reading, 2026-11-09T13:55:18Z)
Run 42628586959 is pull_request on 76ac9fef2bc348bdc01082d09a6b95b377f93da0:
- SonarCloud Code Analysis: pass
- package: pass
- tests-git-bash: pass (2m59s)
- tests: pending
I did not wait for tests.
Findings
MUST: none. SHOULD: none.
NIT
- N1b. "Gates at the head" gives G1 at
5d92551fa, with only the changed module re-run at the head. That is accurate and disclosed. Lane 3 may add this review's G1 at the head:715 passed, 3 skipped in 779.31s. - N2b. The merge paragraph says "In the merged
_extract_leg" but cites:14864for the unset. That is the head's line. In merge commit5f565f0f6, therun([is at :14860 and--unsetat :14861; the:14825it also cites is the same in both. Cosmetic. - N3b. The new comment lists the sources the
-coutranks as "the global file, a template'sconfig,GIT_CONFIG_COUNTandGIT_CONFIG_PARAMETERS". It does not name the system file, though GIT_CONFIG_SYSTEM namingupstreamalso gives exit 5 on main's clone, and the body names it. The comment is not wrong: the system file ranks below the global one, and the-coutranks it (measured). - Information, not a finding. Main has moved to
42308f2(validate-family.py: the holder's gate escapes what its stdout cannot encode, so it passes under Latin-1 where it ended in a traceback, and 45 rows in 11 test files that cannot judge under a one-byte locale skip there on their own premise (#1214) #1258) since the refresh. The merge is clean and touches no file of this PR (section 3c). The body does not name it yet. The landing's update-branch head will need its owntestsrun as usual.
RV1268's N2 to N6 are about the fix, not the delta, and stand as RV1268 wrote them.
Not covered
- The
testsCI job, which was still running. - A pytest run on the
42308f2merge tree (only merge-tree and file comparisons). - The other open PRs against the new head.
- Windows, any git version other than 2.43.0, and a real gh.
Housekeeping. One command wrote a stray copy of the head's adopt-project.py outside my scratch: /tmp/claude-1000/rv1268b-head-adopt.py (1013845 bytes, cmp-equal to git show refs/rv/pr1268b:adopt-project.py). Under the no-rm rule I did not delete it. Nothing was pushed, commented, approved or committed. The refs I made are refs/rv/main and refs/rv/pr1268b, both in my own clone. Both mutated files were restored, cmp is equal, and git status in mut is clean.
Paths
- Clone:
/workspace/projects/openRepoShape-worktrees/_lane3-scratch/RV1268, atfaa29987a, clean. - Scratch:
/workspace/projects/openRepoShape-worktrees/_lane3-scratch/RV1268-scratch/mut/is now at the head76ac9fef2, clean.base/is now at main8e6f532, clean.b/holds this review's files:g1.log,g1.log.out,g2.log.out,m5.sh,rank.sh,tm.sh,mutb.py,toks.py,pt.sh,body-new.md,body-old-gh.md, probe runsp-head-upstream/,p-head-empty/andp-main8e6-upstream/, and the measurement foldersm5/,rank/,tm/andtmpl/.
- Basetemps:
/tmp/claude-1000/l3bt/RV1268b-{m,g1,g2}.
Lane: openreposhape-3 (openRepoShape-3)
…: a kept `GNUmakefile/` is a directory GNU make stops at, `python3 scripts/bootstrap.py` names `python` on Windows, and the template says what to run where `make` reads another file (#1207) **#1132, the parts that hold on main: the assembly-root template says what to run where GNU make reads a kept `GNUmakefile` or `makefile` first; a kept DIRECTORY of either name is named as one GNU make stops at, in the `CONTRACTS_DIR` line and in `execute`'s NEXT; every sentence that names `python3 scripts/bootstrap.py` for a person to run names `python` on Windows too; and two follow-up texts no longer say more than is true (RV1105b's NIT-2 and NIT-3a).** This PR was built on main `961640c6`. Lane 4's #1121 (#1047) landed as `0ed3e57f8` at 21:37Z, and this round merged it in (`6fa1edd56`): NEXT now words a kept file (#1121's) and a kept directory (this PR's) through one lookup and one clause. #1105 landed as `12122952b` on 2026-11-08, and this PR merges it in (see "Main merge after #1105"). The items that live only in #1105's code, and the parts of #1121's that this merge does not do, are in their own issue, #1240 (see "Left"). Item 5 is #1206. Lane 4's #1105 (#1048) landed as `12122952b` at 16:45Z. This round merges main into the branch with `git merge origin/main`, never a rebase, and does it twice: - main `46fe6ac19` as merge `7b0192bde`; - then NIT-A in its own commit, `e5e077940`; - then main `9729315f1` as merge `01e93b6d1`, the head. Lane 1's #1123 had landed meanwhile, and one of its rows meets this PR's directory line (see "The second merge, after #1123"). The first merge conflicted in `scripts/shape_materialize.py` only: 3 hunks, all in `collision_follow_up`, as "Landing order" said. `adopt-project.py` and `templates/assembly-root/AGENTS-shape.md` merged with no conflict. Both sides' behaviour stays: #1105's second `GNU_MAKE_READS`, its `_predict_collisions` lookup and its collision line, and this PR's `_make_reads_first`, `_make_reads_first_clause` and NEXT. None of #1240's unification is done here (one tuple, one lookup). ### The three hunks | hunk | this PR (`6fa1edd56`) | main (`46fe6ac19`, #1105) | resolution | |---|---|---|---| | 1. The docstring's NIT-4 sentence | "This said "both callers say it", and `execute` calls it nowhere" | "`Materialized.follow_ups()` would say this of them, and nothing calls it" | **Main's.** Both sides rewrote the same sentence for the same finding. Main's also names `Materialized.follow_ups()`, which #1240's item G changes. So this PR no longer touches that sentence, and the last `scripts/shape_materialize.py` bullet under "What changed" is #1105's text now. | | 2. The docstring's Makefile paragraphs | the `BOOTSTRAP_COMMAND` sentence and NIT-2's tail | the heading "WHERE `make` READS THE MERGED FILE", and the "BUT GNU MAKE READS" paragraph | **Both.** Main's heading and both paragraphs. This PR's sentences on `BOOTSTRAP_COMMAND` and on NIT-2's tail go in the first paragraph, and one new sentence goes in the second: "Both name that command as `BOOTSTRAP_COMMAND` does, `python` on Windows as well (#1132)." | | 3. The returns | two `return`s, each one sentence | `arrive`, `joint`, `meanwhile` and `until` set per branch, then one pair of `return`s | **#1105's structure, with a per-branch `then` in place of `until`.** With no `reads_first`, the line is this PR's, byte for byte. With one, it is #1105's, byte for byte, except that the command a person runs is `BOOTSTRAP_COMMAND`, both in `meanwhile` and in "and then ... runs it". | - **Hunks 1 and 2 carry no code.** In the merged file they sit at lines 1022-1023 and 1032-1070, inside `collision_follow_up`'s docstring (lines 1014-1084). - **The rendered lines.** I loaded the function from `6fa1edd56`, from main, and from the merge, and rendered each `reads_first` (none, `GNUmakefile`, `makefile`) with and without `scripts/bootstrap.py` aside. - With no `reads_first`, the merge equals `6fa1edd56` (2 of 2). - With one, it equals main with " (`python` on Windows)" after `python3 scripts/bootstrap.py` in those two places (4 of 4). For a root that keeps `Makefile` and `GNUmakefile`, the line now ends "...; until then `python3 scripts/bootstrap.py` (`python` on Windows) is what the shape's `make bootstrap` runs". - **NIT-2's tail where `make` reads another file** stays #1105's own: "neither `make bootstrap` nor `python3 scripts/bootstrap.py` runs the shape's bootstrap until then, and then `python3 scripts/bootstrap.py` (`python` on Windows) runs it". #1105's review fixed that branch for the same finding, so it needs nothing more. - **Of #1240's list,** this round does item C for #1105's collision line, as #1240 asks a resolution to say. So the "with `python3`" part of "Left"'s second bullet is done. Item B, the kept directory, stays: #1105's lookup asks `_root_keeps`, so a root that keeps `Makefile` and `GNUmakefile/` is told GNU make "reads the source's `GNUmakefile`". Mutant U3 below shows that no row pins this line for a directory. ### #1105's test pins `tests/test_adopt_collision_make_reads.py` is #1105's file, and it pins the texts this PR changes, as "Landing order" expected. - **Four pins move.** `MERGE_IS_ENOUGH` and `BOTH_MERGES` (no `reads_first`) move to this PR's words. `MEANWHILE` and `SCRIPT_MERGED` (with one) move to `python` on Windows. All four go through a new `COMMAND`. - **One comment changes.** The comment on the `Makefile+scripts` row now says what NIT-2's tail says. - **Measured:** before the move, the six adopt and pin files gave 11 failed and 242 passed, and the 11 are exactly the rows that use those four pins. After the move, 253 passed. - **On main's code:** main `46fe6ac19`'s four production files (`adopt-project.py`, `scripts/shape_materialize.py`, `templates/assembly-root/AGENTS-shape.md` and `README.md`) were swapped into the mutant worktree at `e5e077940`. 64 of the three files' 106 rows fail: - in this file, exactly those 11 rows, and the other 20 pass; - in the new file, 34 of 35, as before (NIT-4's row passes); - in `tests/test_adopt_next_make_reads_first.py`, 19 of 40, as before. The four files were then restored, each matched the head by sha256 (4 of 4), and the tree was clean. ### NIT-A `tests/test_adopt_next_make_reads_first.py:64` called #480's NOTE "unchanged", but the merge of #1121 moved that pin to `python` on Windows. The comment now says the NOTE "names `python` on Windows too since #1132". The change is a comment only, in its own commit. ### The second merge, after #1123 Lane 1's #1118 and #1123 landed while the first merge was being gated: `9ec0dc79c` at 17:30Z and `9729315f1` at 17:47Z. Both merge with `e5e077940` with no conflict in the text. The predicted merge with `9ec0dc79c` passed (gate P below). The predicted merge with `9729315f1` failed 1 row of 254 (gate P2): - **The row:** #1123 adds `test_a_name_only_a_disk_that_ignores_case_takes_for_makefile[makefile-directory]` to `tests/test_adopt_make_reads_first.py`. For a kept DIRECTORY `makefile/`, it expects the `CONTRACTS_DIR` line a kept `makefile` FILE gets ("only once `makefile` does"). #1123's own message says that line is not true for a directory, and that the row works as a crash guard for `twins` in `_makefile_follow_up`. This PR changes exactly that line: a kept directory is one GNU make stops at. - **The fix, in the merge `01e93b6d1`:** the row now expects `SHAPES + written_as("makefile")`, as #1123 wrote it, which is the part that guards `twins`. This PR's directory clause follows, through a new `stops_at` helper beside `reads`. The comment above `ANSWERED` and the row's docstring now say so. Nothing else changes in the merge. - **Mutants on the row.** Each ran alone in the mutant worktree at `01e93b6d1` against `tests/test_adopt_make_reads_first.py` (34 rows). Each was restored with `git checkout` and matched by sha256 (`adopt-project.py` `3c2cb5f5bea5`), and the tree was clean after each. | id | mutant | rows failing | result | |---|---|---|---| | D1 | `_make_reads_first` drops a directory's `/`, so the line is the one #1123's row pinned | 1 of 34, the row | killed | | D2 | #1123's R10: `twins` reads the entry with its slash | 1 of 34, the row, with `IndexError` | killed | ### Mutants on the resolution H3a-H3g and U1-U3b are the first merge's. All ran in the mutant worktree at `e5e077940`. - **Method:** each mutant was applied alone, then restored with `git checkout`. Each restore matched by sha256 (`shape_materialize.py` `b18f09d7c396`, `adopt-project.py` `2055a81acdc6`), and the tree was clean after each. - **Rows:** H3a-H3g, U3 and U3b ran against 93 rows: `tests/test_adopt_collision_make_reads.py` (31), the new file (35) and `tests/test_adopt_e2e.py` (27). U1 ran against the new file, `tests/test_adopt_make_reads_first.py` (33) and `tests/test_adopt_collision_make_reads.py`, 99 rows. U2 ran against the new file and `tests/test_adopt_next_make_reads_first.py` (40), 75 rows. - **Unmutated,** every row passes (gate A below). | id | mutant | rows failing | result | |---|---|---|---| | H3a | hunk 3, no `reads_first`: `meanwhile` back to main's plain `python3` | 4 of 93 | killed | | H3b | hunk 3, no `reads_first`: the script tail back to main's "before both merges are made" | 4 of 93 | killed | | H3c | hunk 3, with `reads_first`: `meanwhile` without `BOOTSTRAP_COMMAND` (main's) | 5 of 93 | killed | | H3d | hunk 3, with `reads_first`: "and then ... runs it" without `BOOTSTRAP_COMMAND` (main's) | 3 of 93 | killed | | H3e | hunk 3, with `reads_first`: this PR's tail in place of #1105's | 3 of 93 | killed | | H3f | hunk 3: `reads_first` ignored, so the resolution is this PR's side whole | 15 of 93 | killed | | H3g | hunk 3, with `reads_first`: #1105's `joint` ("; and") lost | 3 of 93 | killed | | U1 | `_makefile_follow_up` drops `_make_reads_first` (`first = None`) | 31 of 99 | killed | | U2 | `_next_steps` drops `_make_reads_first` (`first = None`) | 35 of 75 | killed | | U3 | `_predict_collisions` asks `_make_reads_first` in place of #1105's lookup | 0 of 93 | **survived** | | U3b | `_predict_collisions` passes no `reads_first`, so #1105's lookup is lost in the merge | 15 of 93 | killed | - **H3c and H3d** are killed only by rows that use the moved `MEANWHILE` and `SCRIPT_MERGED`. Those pins are what hold `BOOTSTRAP_COMMAND` in #1105's branch. - **U3 survives,** and that is #1240's item B. For a kept file, both lookups give the same name. They differ only for a kept directory, where `_make_reads_first` adds the `/`, and no row runs `_predict_collisions` on a root that keeps `Makefile` and `GNUmakefile/`. A row now would pin the line #1240 is to correct, so this round adds none. ### Runs Each run went through the lane's runner, with git-filter-repo 2.47.0 (CI's pin) on PATH, on a commit with a clean tree. | run | git | files | passed | failed | skipped | |---|---|---|---|---|---| | gate A2 | 2.43.0 | `01e93b6d1`, the head: the 12 files below | 1096 | 0 | 3: the PowerShell rows (`test_shape_doctor.py:10516`), which run only on a Windows host | | gate B2 | 2.47.1 | `01e93b6d1`: the same 12 files | 1096 | 0 | 3: the same | | gate A | 2.43.0 | `e5e077940`, after the first merge: the 12 files below | 1095 | 0 | 3: the same | | gate B | 2.47.1 | `e5e077940`: the same 12 files | 1095 | 0 | 3: the same | | gate P | 2.43.0 | the predicted merge of `e5e077940` with main `9ec0dc79c` (#1118; tree `ba3f3c1f3`, a local commit object, not pushed): the six adopt and pin files, plus #1118's `tests/test_adopt_root_shape_paths.py` and `tests/test_adopt_symlink_target_bytes.py` | 509 | 0 | 0 | | gate P2 | 2.43.0 | the predicted merge of `e5e077940` with main `9729315f1` (#1123; tree `0eb290ae2`, a local commit object): the six adopt and pin files | 253 | 1: #1123's `makefile-directory` row, which the second merge moves | 0 | | gate P4 | 2.43.0 | the predicted merge of `01e93b6d1` with main `801a7d6d0` (#1106; tree `25bc27d39`, a local commit object): the six adopt and pin files, plus #1106's `tests/test_adopt_one_byte_locale.py` and `tests/test_adopt_unenterable_source_and_locale.py` | 277 | 0 | 0 | The files are the six adopt and pin files (`tests/test_adopt_collision_make_reads.py`, `tests/test_pinned_copy_text.py`, the new file, `tests/test_adopt_next_make_reads_first.py`, `tests/test_adopt_e2e.py` and `tests/test_adopt_make_reads_first.py`, 253 rows), plus `tests/test_shape_doctor.py` and `tests/test_scaffold_leg_path_collisions.py`, which adopt changes need, plus the hygiene five (`test_path_guard_hygiene.py`, `test_repo_hygiene.py`, `test_agents_md_codes.py`, `test_cli_reference.py` and `test_pinned_copy_text.py`). That is 1098 rows in one run at `e5e077940`, and 1099 at `01e93b6d1`, where #1123 adds one row. All of this was measured on main `961640c68` with GNU make 4.3, offline. | item | on main | |---|---| | 1, the template | `AGENTS-shape.md` (the "Work from here" paragraph and the five-commands table) and `README.md` (Get started, and the parking steps) give `make bootstrap` with no caveat. With the template's own `Makefile` beside a plain `GNUmakefile` or `makefile`, `make -n bootstrap` exits 2, `No rule to make target 'bootstrap'`. | | 2, a kept directory | With `GNUmakefile/` or `makefile/` beside `Makefile`, `make bootstrap` exits 2 with `make: *** GNUmakefile: Is a directory. Stop.`, or the same with `makefile`. It does this for every target, and for each directory alone too. Main's `CONTRACTS_DIR` line says "`make` there exports `CONTRACTS_DIR` only once `GNUmakefile` does". NEXT prints `make bootstrap` for a root that keeps only `GNUmakefile/`. Beside a kept `Makefile`, it prints #480's NOTE that the targets "arrive only once the follow-up merges the two". Rendered by the lane's `probe_texts.py` on main. | | 3, `python3` | The template's `scripts/bootstrap.py` says `python3 scripts/bootstrap.py (python on Windows)`. #480's NOTE and the Makefile collision follow-up's "until then" name `python3` alone. | | NIT-2 | The no-`reads_first` script-aside tail says "neither `make bootstrap` nor `python3 scripts/bootstrap.py` runs the shape's bootstrap before both merges are made". In a root that keeps its own `Makefile` and `scripts/bootstrap.py`, merging the script alone makes `python3 scripts/bootstrap.py` print the shape's `SHAPE-BOOT`, while `make bootstrap` still exits 2. Measured again by a row below. | | NIT-3a | `_predict_collisions` says the wording comes from "the same function `execute` reports its actual collisions through", and `collision_follow_up` says "Both callers say it". `execute` never calls `collision_follow_up`: it carries the plan's stored `follow_ups:` into the split message. | `adopt-project.py`: - **`_make_reads_first(surviving)`** gives the first of `GNUmakefile` and `makefile` the root keeps. It reads `GNU_MAKE_READS`' order, asks the way `_root_keeps` asks, and adds a `/` for a DIRECTORY. **`_make_reads_first_clause`** words the clause. For a file, the words are main's, byte for byte. For a directory, it says: "GNU make at the root stops at the source's directory `GNUmakefile/`, the first of `GNUmakefile`, `makefile` and `Makefile` it finds (`GNUmakefile: Is a directory.`), so ... only once the root keeps no directory of that name". - **`_makefile_follow_up`** (the `CONTRACTS_DIR` line) asks both. A kept file's line is unchanged: `tests/test_adopt_make_reads_first.py` passes as it is. - **`_next_steps`** takes `surviving=`, the plan's root paths, which `cmd_execute` passes as `paths_for["root"]`, as #1121 does. - Where a kept DIRECTORY stops make, the command is `python3 scripts/bootstrap.py`. The NOTE says GNU make stops there. Beside a kept `Makefile`, it also says the targets run there once the follow-up merges the two, and only once the directory is gone. Where the script went aside too, alone or with the `Makefile`, the NOTE names that command after the merges. - Since the merge of #1121, a kept FILE goes through the same lookup and the same clause. For a file the clause gives #1121's words byte for byte, and its NOTEs end in `BOOTSTRAP_COMMAND` too. - **`BOOTSTRAP_COMMAND`** is in every NOTE: #480's, #1121's and the directory's. Each command line a person pastes stays `python3 scripts/bootstrap.py`. - **`_predict_collisions`' docstring** says what the plan stores and what `execute` carries (NIT-3a). `scripts/shape_materialize.py`: - **`BOOTSTRAP_COMMAND`** = "`python3 scripts/bootstrap.py` (`python` on Windows)", as the template's script names it. - **The Makefile collision follow-up** says "until then `python3 scripts/bootstrap.py` (`python` on Windows) is what `make bootstrap` runs". - **Where the script went aside too,** the follow-up says "so `python3 scripts/bootstrap.py` (`python` on Windows) runs the shape's bootstrap once the script is merged, and `make bootstrap` once both merges are made" (NIT-2). - **The docstring's "Both callers say it"** paragraph says what is true (NIT-3a's twin, #1105's review NIT-4). #1105 made the same fix, and the merge keeps main's text (see "Main merge after #1105"). `templates/assembly-root/`: - **`AGENTS-shape.md`:** the "Work from here" paragraph adds "; where the root keeps a `GNUmakefile` or a `makefile`, which GNU make reads before `Makefile`, run `python3 scripts/bootstrap.py` (`python` on Windows), which is what the shape's `make bootstrap` runs." A sentence after the five-commands table says they are the shape's Makefile's targets, which `make` at the root reaches only where the file it reads first holds them, or includes a Makefile that does. - **`README.md`:** one sentence after Get started covers `make bootstrap` "here and below". A second says `make park` and `make resume` below work there only where that file holds them, or includes a Makefile that does. - **This is a template byte change, so every project re-pins.** No digest of either file is stored in this repository. `tests/` was grepped for every changed line, and only this PR's own rows pin them (see "Template pins"). Tests: - **`tests/test_adopt_e2e.py`:** two pins move to the new words, at :312 (the "until then" sentence) and at :447-450 (NIT-2's tail). - **`tests/test_adopt_next_make_reads_first.py`** (#1121's): the merge moves three pins, `OWN_MAKEFILE_NOTE`, `RUNS` and `script_aside`, to `python` on Windows. #480's NOTE merged with no textual conflict, so without them its rows fail. - **The new file `tests/test_adopt_make_bootstrap_followups.py`** has 35 rows: - the template's sentences, held to its `Makefile` (`PYTHON ?= python3`, `bootstrap:` runs `$(PYTHON) scripts/bootstrap.py`) and to `scripts/bootstrap.py`'s own words; - `make -n bootstrap` against the template's `Makefile` beside each kept name, each row asserting the `AGENTS-shape.md` caveat that measurement backs; - `_make_reads_first` (10 roots); - the `CONTRACTS_DIR` line for 4 directory roots; - NEXT for a directory, beside a kept `Makefile` (both names), after both merges, and after the script's merge alone; - #480's NOTE, called both as main's signature allows and with `surviving=`; - the collision follow-up's two sentences; - NIT-2 measured with the template's `Makefile` and stand-in scripts, and tied to the follow-up's new tail; - three real adoptions of a source holding `GNUmakefile/rules.mk`. One is kept by a `--path-policy` rule, so `plan` writes the line, `check` prints it and the split message carries it. One is answered `root`. In both, NEXT is asserted, `make -n bootstrap` in the pasted clone exits 2 with `GNUmakefile: Is a directory.`, and the printed command exits 0. In the third, the question is answered `code`: NEXT names `make bootstrap`, and that command runs in the pasted clone. ### This round (#1207's review, issuecomment-6374516382) | finding | what changed | |---|---| | SHOULD-1 | A row pins NEXT where only `scripts/bootstrap.py` went aside beside a kept `GNUmakefile/` (`test_next_after_the_script_merge_names_python3_where_make_stops`). It fails under the review's mutant X1. | | SHOULD-2 | The "Left" list is one issue, #1240. | | SHOULD-3 | "Landing order", below. #1121 landed while this round ran, and is merged and resolved here. | | NIT-1 | `AGENTS-shape.md`'s sentence after the table loses "(above)": nothing above names a Makefile that includes another. | | NIT-2 | `README.md` names `make park` and `make resume`. | | NIT-3 | Beside a kept `Makefile`, the directory NOTE names the merge as well as the directory. Its row is parametrized over `GNUmakefile/` and `makefile/`. | | NIT-4 | An adoption sends `GNUmakefile/` to the code leg, and NEXT names `make bootstrap`. It fails under the review's mutant X6. | | NIT-5 | The notes for the squash message at landing, below. | Measured at the merge head `6fa1edd56`, in a scratch worktree: - main `0ed3e57f8`'s bytes of the four production files (`adopt-project.py`, `scripts/shape_materialize.py`, `templates/assembly-root/AGENTS-shape.md`, `templates/assembly-root/README.md`) were checked out over the head; - the new file (35 rows) and `tests/test_adopt_next_make_reads_first.py` (40 rows) ran through the lane's runner; - the four files were restored with `git checkout`, and each matched the head by sha256 (`c94bd19b`, `12555f39`, `8660bafb`, `b3f9409b`). | file | fail on main | pass on main | |---|---|---| | the new file | 34 | 1: `test_an_adoption_sending_a_gnumakefile_directory_to_a_leg` | | `tests/test_adopt_next_make_reads_first.py` | 19 | 21 | Main now has #1121, so its `_next_steps` takes `surviving=`. The NEXT rows for a kept directory therefore fail on their words, not on a `TypeError`. Main reads `GNUmakefile/` as a file: "then run `python3 scripts/bootstrap.py`; GNU make at the root reads the source's `GNUmakefile`, ...". This is the case for the SHOULD-1 row, the after-the-merges row, both directory rows, and NIT-3's `makefile/` row. The new file's other rows fail on main for these reasons: - the template rows: main's `AGENTS-shape.md` and `README.md` lack the sentences; - `_make_reads_first`: main has no such helper; - the `CONTRACTS_DIR` line: "only once `GNUmakefile` does"; - the NOTE and collision rows: plain `python3`, and NIT-2's old tail; - the two adoptions that keep the directory. The one new row that passes on main is NIT-4's. It sends `GNUmakefile/` to the code leg, and there main's NEXT is already `make bootstrap`. It guards what main has: under the review's mutant X6, which hands NEXT every leg's paths, it is the row that fails. The 19 rows of #1121's file that fail on main are exactly the rows that use the three pins this merge moved (`OWN_MAKEFILE_NOTE`, `RUNS`, `script_aside`). The 21 that pass use none of them. Earlier heads, on main `961640c68` and with the same method: `1c7ca5c6d` failed 29 of 35 rows, and `8b499842f` failed 34 of 35 (the new file plus the three `tests/test_adopt_e2e.py` rows the mutants use). **This round**, at `75c90b6db`, in a scratch worktree. Each mutant was applied alone and restored, and each file's sha256 was checked against the commit (4/4 every time). Each ran against 95 rows: the new file (35), `tests/test_adopt_e2e.py` (27) and `tests/test_adopt_make_reads_first.py` (33). Unmutated, all 95 pass. | id | mutant | rows failing (of 95) | result | |---|---|---|---| | X1 | the review's: the script-only NOTE names `make bootstrap` after the merge (`if stops and makefile`) | 1 | killed | | X6 | the review's: `cmd_execute` passes every leg's paths | 1 | killed | | N1 | NIT-3 undone: beside a kept `Makefile`, no merge named | 2 | killed | | N2 | the merge named where the script went aside too | 1 | killed | | N3 | the merge named where no `Makefile` was kept | 4 | killed | | T1 | NIT-1 undone: "(above)" back | 1 | killed | | T2 | NIT-2 undone: README's `make park` / `make resume` sentence removed | 1 | killed | The merge with #1121 rewrote the clause code that N1-N3 mutate (`stopped` became `reads`, and the merge condition gained `stops`). The mutants were not run again at `6fa1edd56`. **Earlier,** 18 mutants at `1c7ca5c6d` against 43 rows, each applied alone in a scratch worktree and restored with its sha256 checked: | id | mutant | rows failing (of 43) | result | |---|---|---|---| | M1 | `_make_reads_first` drops the `/` of a directory | 14 | killed | | M2 | the clause's directory branch never taken | 10 | killed | | M3 | NEXT ignores a kept directory (`stops = None`) | 6 | killed | | M4 | NEXT's command stays `make bootstrap` for a directory | 4 | killed | | M5 | `cmd_execute` passes `surviving=()` | 2 (the two adoptions) | killed | | M6 | `BOOTSTRAP_COMMAND` without `(python on Windows)` | 12 | killed | | M7 | NIT-2's tail back to "neither ... before both merges are made" | 2 | killed | | M8 | `AGENTS-shape.md`'s "Work from here" caveat removed | 1 | killed | | M9 | the sentence after the five-commands table removed | 1 | killed | | M10 | `README.md`'s sentence removed | 1 | killed | | M11 | #480's NOTE back to plain `python3` | 1 | killed | | M12 | the collision follow-up's "until then" back to plain `python3` | 2 | killed | | M13 | after the merges, NEXT says `make bootstrap` where a directory stops make | 1 | killed | | M14 | the lookup takes the LAST kept name (`reversed`) | 4 | killed | | M15 | the directory NOTE's lead ignores a kept `Makefile` | 1 | killed | | M16 | the lookup folds case (`fold=True`) | 4 | killed | | M17 | the clause drops GNU make's own words (`GNUmakefile: Is a directory.`) | 10 | killed | | M18 | the file clause says `does` whatever `has` is | 0 | **survived** | M18 was equivalent before the merge: the file clause's only caller was the `CONTRACTS_DIR` line. Since the merge, #1121's NOTE calls it with `has them`, and `tests/test_adopt_next_make_reads_first.py` pins that wording. M18 was not run again. Each run went through the lane's runner: `gh` stubbed first on PATH with a bogus token, `GIT_SSH_COMMAND=false`, `GIT_CONFIG_GLOBAL=/dev/null`, `EMAIL` set, `-p no:cacheprovider`, and `tmp_path_retention_policy=failed`. Each run is on a commit, with a clean tree. | run | commit | git | files | passed | failed | |---|---|---|---|---|---| | gate M | `6fa1edd56`, the merge | 2.43.0 | the new file, `test_adopt_next_make_reads_first.py`, `test_adopt_e2e.py`, `test_adopt_make_reads_first.py`, `test_path_guard_hygiene.py`, `test_repo_hygiene.py`, `test_agents_md_codes.py`, `test_cli_reference.py`, `test_pinned_copy_text.py`, `test_scaffold_leg_path_collisions.py` | 618 | 0 | | gate N | `6fa1edd56` | 2.47.1 | the new file and `test_adopt_next_make_reads_first.py` (75), then `test_adopt_e2e.py` (27), run one after the other | 102 | 0 | | gate H | `6fa1edd56` | 2.47.1 | the hygiene five | 379 | 0 | | gate A2 | `75c90b6db` | 2.43.0 | the new file, `test_adopt_e2e.py`, the hygiene five (`test_path_guard_hygiene.py`, `test_repo_hygiene.py`, `test_agents_md_codes.py`, `test_cli_reference.py`, `test_pinned_copy_text.py`), `test_adopt_make_reads_first.py`, `test_adopt_contracts_dir.py`, `test_adopt_printed_sentences.py`, and the template's readers: `test_scaffold_e2e.py`, `test_scaffold_free_text_values.py`, `test_free_plan_hint.py`, `test_template_quoted_values.py`, `test_template_values_single_pass.py`, `test_template_text_placeholders.py`, `test_bootstrap_placement_texts.py`, `test_park_resume_targets.py`, `test_update_shape_hardlink.py` | 1128 | 0 | | gate A | `1c7ca5c6d` | 2.43.0 | 17 files (the new file, `test_adopt_e2e.py`, the hygiene five, `test_scaffold_leg_path_collisions.py`, `test_adopt_make_reads_first.py`, `test_adopt_contracts_dir.py`, `test_adopt_printed_sentences.py`, `test_adopt_attributes_eol_block.py`, `test_adopt_leg_path_collisions.py`, `test_scaffold_e2e.py`, `test_bootstrap_placement_texts.py`, `test_park_resume_targets.py`, `test_template_text_placeholders.py`) | 966 | 0 | | gate B | `1c7ca5c6d` | 2.47.1 | the new file, `test_adopt_e2e.py`, `test_path_guard_hygiene.py`, `test_repo_hygiene.py` | 209 | 0 | | doctor | `1c7ca5c6d` | 2.43.0 | `test_shape_doctor.py`, `test_scaffold_leg_path_collisions.py` | 549 (3 skipped: the PowerShell rows, which run only on a Windows host) | 0 | `tests/` was grepped for every line this PR changes in `templates/assembly-root/` ("They are the shape", "reads first holds", "includes a Makefile that", "(above)", "here and below", "Where this root keeps", "it is what the shape", "before `Makefile`", "`python` on Windows"). Only `tests/test_adopt_make_bootstrap_followups.py` pins them. Four other files read the README as a whole, and each passes in gate A2: - `test_scaffold_free_text_values.py` counts its lines against the template; - `test_free_plan_hint.py` looks for "Free plan" and `--repo`; - `test_template_quoted_values.py` and `test_template_values_single_pass.py` render it. `git merge-tree --write-tree` of the head `01e93b6d1`, on git 2.43.0, at 18:11Z. - **Main** `9729315f1`, fetched again at 18:11Z, is the main this round merged last. The merge-tree is clean, and its tree is the head's own, `f6488542f`. - **Main moved to `801a7d6d0`** at 18:14Z, when lane 3's #1106 landed (`adopt-project.py` and two locale test files). The merge with it is clean, tree `25bc27d39`, and gate P4 passed on it. It was not merged in: it touches none of the code this round resolves, and landing refreshes the branch anyway. - **The open PRs:** one `gh pr list --state open --limit 100 --json number,headRefName,headRefOid,files` read at 18:11Z returned 51 open PRs. 26 of them touch one of this PR's paths. That includes `tests/test_adopt_collision_make_reads.py` and `tests/test_adopt_make_reads_first.py`, which this PR now changes. 25 merge cleanly: #1106, #1120, #1122, #1125, #1141, #1143, #1153, #1154, #1170, #1171, #1177, #1178, #1186, #1189, #1194, #1198, #1210, #1225, #1244, #1249, #1251, #1252, #1253, #1265 and #1268. #1106 has landed since (above). - **Lane 1's #1189** (`472944b5d`, read fresh at 18:11Z) edits three test files that this round changes too: `tests/test_adopt_next_make_reads_first.py`, `tests/test_adopt_collision_make_reads.py` and `tests/test_adopt_make_reads_first.py`. The merge is clean, tree `7fd030b29`. #1189's hunks are in the imports, in the clone rows' parameter lists and docstrings, and in a new refusal row, away from the moved pins, the `makefile-directory` row and NIT-A's comment. On that predicted merge, a local commit object, the three shared files pass on git 2.43.0: `tests/test_adopt_make_reads_first.py` and `tests/test_adopt_collision_make_reads.py` give 62 passed, and `tests/test_adopt_next_make_reads_first.py` gives 38 passed. There are fewer rows than at this head because #1189 leaves out the clone rows that keep case twins. - **#1237** (`b557859fd`) conflicts in `tests/test_adopt_check_throwaway_repos.py`, a file this PR does not change. Main conflicts with #1237 in that file too, while `6fa1edd56` did not, so the conflict is main's, carried in by the merge. - **Main moved again after the round** (rv1207e, at 19:25Z): lane 1's #1143 landed as `81eaf757c` (`adopt-project.py`) and lane 4's #1117 as `9252ef208` (README, the handbook and `scripts/family.py`). The head merges clean with both (trees `e40373967` and `279f8c6ce`), and rv1207e's gate P passed on the predicted merge with `9252ef208` (359 passed). At 19:22Z, 48 PRs were open, 24 touch this PR's files, and 23 merge clean; #1237's conflict is main's, as above. - **No longer on the list:** #1105, #1121, #1118 and #1123 are on main. Since `6fa1edd56`, #1104, #1160, #1169, #1180, #1190 and #1223 landed too. The conflicts are the same in every order, measured offline both ways round and with predicted squashes: - **#1121:** 4 hunks, 84 lines, in `adopt-project.py`'s `_next_steps` and `cmd_execute`'s comment. - **#1105:** 3 hunks, 65 lines, in `scripts/shape_materialize.py`'s `collision_follow_up`: its docstring's NIT-4 sentence, its paragraph on the Makefile's merge, and its two `return`s. - #1121 and #1105 merge with each other cleanly, and so do #1104 and this PR. So the order decides only who resolves them. **Both have landed**, and lane 5 resolved both on this branch: - **#1121** (merge `6fa1edd56`). The resolution is one lookup and one clause, `BOOTSTRAP_COMMAND` in #1121's NOTEs, and #1121's three test pins moved. - **#1105** (merge `7b0192bde`, see "Main merge after #1105"). The resolution keeps #1105's `reads_first` branch and runs `BOOTSTRAP_COMMAND` through it. NIT-2's tail is this PR's where `make` reads the merged `Makefile`, and #1105's where `make` reads another file. Four of #1105's test pins moved: `MERGE_IS_ENOUGH`, `BOTH_MERGES`, `MEANWHILE` and `SCRIPT_MERGED`. Main was merged in once more after lane 1's #1123 (merge `01e93b6d1`): one of #1123's rows pinned the line this PR changes for a kept `makefile/` directory, and it moved (see "The second merge, after #1123"). No other PR has to land first now. `6fa1edd56` was re-checked READY (rv1207b, rv1207c and rv1207d, issuecomment-6722602375). The head, `01e93b6d1`, needs a check of its delta since then: the two merges' resolutions, the four moved pins in #1105's file, #1123's moved row, and NIT-A. #1240 tracks what this PR leaves: - #1132's item 4 (one `GNU_MAKE_READS`, one lookup); - #1105's collision line, for a kept directory (its `python3` part is done here: see "Main merge after #1105"); - #1121's file NOTE beside a kept `Makefile`, which does not name the merge (as this PR's directory NOTE now does); - #1105's second review's NIT-1, NIT-3b, NIT-3c, NIT-4 and NIT-5; - `_make_reads_first_clause`'s `has` argument, now live; - rv1207e's NIT-1: the docstring sentence "With none, the Makefile's follow-up is what it was, byte for byte" (`scripts/shape_materialize.py` about :1067), kept from #1105, is no longer true, since this PR changes the line with no `reads_first`. It sits beside #1240's items F and G, which reword the same docstring. The local branch `fix/1132-template-bootstrap-stacked` (`9eb5cce0b`, never pushed and never tested) is a model of the end state on #1105 + #1121 + main. - **Item 5,** follow-ups that go stale after a hand edit of the plan, is its own issue, filed as #1206. It also holds the three related cases this work found: - a kept `makefile/` directory gets "until the two are merged"; - a directory kept only through deeper entries is not seen by `_root_keeps`; - a kept `Makefile/` directory is treated as a Makefile. - **This PR's `answered-root` row meets item 5 too.** `plan` asks about `GNUmakefile/`, and its stored `CONTRACTS_DIR` line, written before the answer, names no directory. The row asserts what NEXT and `make` do there, and not that line. - **Not measured:** a disk that ignores case, and GNU make other than 4.3. Review: rv1207b and rv1207c, lane 5's independent opus reviewers, and rv1207d, lane 5's independent sonnet reviewer, none of which wrote #1207: READY at `6fa1edd5` (issuecomment-6722602375). Then rv1207e, lane 5's independent opus reviewer, which wrote none of it: READY at `01e93b6d`, H0 of this landing, after the main merges past #1105 and #1123 (issuecomment-6726033282), with no MUST or SHOULD; its three NITs are answered in the body. CI (Brett Heap's ruling 27 and his fast-refresh ruling of 2026-10-15T22:48:35Z): H0 01e93b6 passed tests, tests-git-bash and SonarCloud; the head c9be952 is a clean update-branch merge of main 9cb156a, with tests-git-bash and SonarCloud green; and the local gate passed on its predicted squash tree 0a01d35 over main 9cb156a: the adopt_collision_make_reads, adopt_e2e, adopt_make_bootstrap_followups, adopt_make_reads_first, adopt_next_make_reads_first, repo_hygiene, agents_md_codes, cli_reference sets, 333 passed. Landed on Brett Heap's word of 2026-10-23T13:10:26Z, relayed to every lane by lane 3 (#473 issuecomment-6365697123): "merge v1.2.1 PRs once reviewed and green". Closes #1132 Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
|
Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 4 days and 14 hours by commenting |
…mits Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…n origin that #1268 hands every gh repo clone (#1129) #1194's rows were written before main's #1268 (2202af1, for #1261), which made `Source.clone` hand `gh repo clone` `--origin origin` after `--quiet`, so that the clone names its remote `origin` whatever `clone.defaultRemoteName` says. The logging `gh` the rows use keeps the argv it was given, and `cloned_by_gh` still spelled the old one, so at the predicted squash of #1194 over main 106f92f 14 rows failed (6 of `test_plan_asks_gh_for_a_name_github_can_hold`, 4 of `test_a_recorded_name_github_can_hold_is_cloned_again`, 4 of `test_check_and_execute_read_a_source_name_as_plan_reads_it`), each at `-- --quiet` against `-- --quiet --origin origin`. `cloned_by_gh` now spells main's call, as #1268 changed the exact pin in `tests/test_adopt_source_clone_record.py`. No row's intent changes: each still checks that `gh` is asked once, or not at all, for the name it was given. `adopt-project.py` and every other file are as the merge left them. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… repository over 100, so `plan --source <50 b's>/Thing` never asks `gh` for a name GitHub cannot hold, no remedy offers `--org <50 b's>`, and `check` and `execute` never clone such a record again (#1129) (#1194) Lane 4's W1129 for #1129, RV1122's NIT-1 on #1122 (#1122 issuecomment-6319493639). RV1194 reviewed it READY at `900f77af` (#1194 issuecomment-6365280794). **It was stacked on #1122,** which landed as `ebb8716`. RS1194 then restacked it onto `main` with three merges (#1122's final head, its squash, then `main`), which carry exactly the reviewed change (#1194 issuecomment-6751617746). "Why stacked" below says why it was stacked. **A fix round followed #1268.** Since #1268, `Source.clone` hands `gh repo clone` `-- --quiet --origin origin`. So FX1194 merged `main` (`106f92ff`) and changed only the rows' helper `cloned_by_gh` to expect that line (+4 -2, #1194 issuecomment-6769522297). RVD1194b reviewed the round READY at `ddc21fb5`: the reviewed change's lines are byte-equal, and the 14 rows fail before the fix and pass after it (#1194 issuecomment-6772772773). ## What `adopt-project.py`, `_github_name`: an owner of more than `GITHUB_OWNER_MAX` (39) characters, or a repository of more than `GITHUB_NAME_MAX` (100), counted once the trailing `.git` is dropped, names no `owner/repo`. The file already imports both limits from `shape_materialize`. ```python if len(owner) > GITHUB_OWNER_MAX or len(repo) > GITHUB_NAME_MAX: return None ``` Every reader of `_github_name` now gives the same answer for such a spelling: | Reader | Used by | Before | Now | |---|---|---|---| | `_source_spec` | `plan`, `check` and `execute` `--source` | taken as GitHub's name: `gh repo clone` asked, or `source-ambiguous` beside a directory of that spelling | a path: read in place where it is one, `source-unresolvable` ("neither a path that exists nor an `org/repo` name") where it is not | | `_repository_in_url` | a url `--source`, `github.com/...` too | `gh repo clone` asked | `source-unresolvable`, "names no `owner/repo` on github.com", before any `stat` | | `_recorded_repository` | `check` and `execute`, a plan's clone gone (`cloned: true`) | "is cloned again from GitHub", `gh repo clone` asked | `source-unresolvable`, "the plan's `source.repository`, ..., names no `owner/repo` on github.com" | | `_held_repository` | `check` and `execute`, a source with no `origin` | held to the record: `plan-not-the-source`, remedy `--org <40 c's>` | holds the plan to nothing, as a record that names no `owner/repo` does | | `_source_there` | beside a directory this user cannot search | #1122: no url | unchanged: no url (the name is None now) | `_refuse_another_repository`'s remedy (`adopt-not-the-source`) is reached only after `_source_spec`, so it never offers `--org <a name GitHub cannot hold>` for an `org/repo` `--source` now. **#1122's guard in `_source_there` is redundant, and is folded in.** `_source_there` is called only by `_source_spec` and `_repository_in_url`, and both take `name` from `_github_name`. So a name past the limits now arrives as None, and the `name is None` branch gives the same refusal #1122's guard gave. The guard is gone, `if name is None:` is back, and the docstring says the limits are asked in `_github_name`. The merge with `main` and with #1122 is clean (see "Merges"). **Why stacked.** The textual merge with #1122 is clean, but the two do not hold together as they stand. A `github.com/` spelling past the limits is now refused by `_repository_in_url` before any `stat`, so four of #1122's rows, which expected `source-unreadable` from `_source_there`, fail on the combination: - `[bare-github-url]`; - `[www-github-url]`; - `[bare-github-url-owner-one-over-EIO]`; - `[bare-github-url-owner-one-over-EACCES]`. This PR moves those three params out of #1122's `_source_there` tests, with a comment pointing to the new file. There they assert the new answer (`source-unresolvable`, no url), with the control at the limit kept: two readings and the url. No refusal code is new or changed, and no help text or `docs/cli.md` sentence changes: `--source`'s help already says `source-unresolvable` refuses "one that is neither a path that exists nor an `org/repo`". ## Behaviour that changes besides the refusal - **A directory here spelled `<40 c's>/Thing`** (or `testorg/<101 r's>`) is read in place, and the plan is written, recording that directory and no repository. Before, it was `source-ambiguous`, which named a GitHub repository that cannot exist. At the limit, it is still `source-ambiguous`. - **A plan whose source has no `origin`, and whose `source.repository` records `<40 c's>/Thing`,** is held to nothing. `check` says `plan ok`, and `execute` goes on. Before, it was held to that record, and the remedy said `--org <40 c's>`, which `execute` then refuses as `adopt-org-too-long`. A record at the limit still holds the plan. - **`github.com/<300 a's>/Thing` beside a `./github.com`** is `source-unresolvable`, "names no `owner/repo` on github.com". #1122 made it `source-unreadable`, "whether a repository is there cannot be told". Both offer no url. ## Before and after Probed with a `gh` first on PATH that logs each call and refuses it (exit 4), and with: - `GH_TOKEN=bogus`, an empty `GH_CONFIG_DIR`; - `GIT_SSH_COMMAND=false`, `GIT_CONFIG_GLOBAL` an empty file, `GIT_CONFIG_NOSYSTEM=1`; - uid 1000, Python 3.12.3, run in an empty directory. Each row is `plan --source <it> --project <repo> --org <owner>`, except where `--org` is said. `main` `961640c6` gave the same answers as #1122's head on every row. | `--source` | #1122 head `c01c4d73` | this head | |---|---|---| | `<50 b's>/Thing`, `--org <50 b's>` (the issue's) | `gh repo clone <50 b's>/Thing` (1 call), `source-unclonable` | `source-unresolvable`, 0 calls | | `<50 b's>/Thing`, `--org testorg` (the issue's) | `adopt-not-the-source`, remedy `--project Thing --org <50 b's>`, 0 calls | `source-unresolvable`, no `--org` offered, 0 calls | | `<40 c's>/Thing` | 1 call | `source-unresolvable`, 0 calls | | `testorg/<101 r's>`, and with `.git` | 1 call each | `source-unresolvable`, 0 calls | | `<40 c's>/<101 r's>` | 1 call | `source-unresolvable`, 0 calls | | `https://github.com/<40 c's>/Thing`, `github.com/<40 c's>/Thing` | 1 call each | `source-unresolvable` ("names no `owner/repo` on github.com"), 0 calls | | `<39 c's>/Thing`, `testorg/<100 r's>`, `testorg/<100 r's>.git` (controls) | 1 call each (`.git` dropped) | the same | | `<39 c's>/Thing`, `--org testorg` (control) | `adopt-not-the-source`, remedy `--org <39 c's>` | the same | ## Tests The landing gate's environment throughout: - `/usr/bin/python3 -m pytest -p no:cacheprovider`, Python 3.12.3; - a stub `gh` first on PATH, `GH_TOKEN=bogus`, an empty `GH_CONFIG_DIR`; - `GIT_CONFIG_GLOBAL` set to an empty file, `GIT_CONFIG_NOSYSTEM=1`; - the test author and committer variables, and `EMAIL`; - `GIT_SSH_COMMAND`, `GIT_ALLOW_PROTOCOL` and the `LANES_*` variables unset. **New file `tests/test_adopt_source_github_limits.py`, 48 rows,** ASCII only. It skips on Windows: the logging `gh` is a `/bin/sh` script, and the moved rows need a POSIX `File name too long`. Each child puts the logging `gh` ahead of the suite's guard, and every `execute` gets `--local-remote-dir`. | Test | Rows | What it asserts | #1122 head | main | this head | |---|---|---|---|---|---| | `test_plan_asks_gh_for_a_name_github_can_hold` (control) | 6 | owner 39, repository 100, 100 + `.git`, both at, a url and a bare url: `gh` logged exactly `repo clone <name> <work>/source-readonly/<repo> -- --quiet --origin origin`, once | 6 pass | 6 pass | 6 pass | | `test_plan_never_asks_gh_for_a_name_github_cannot_hold` | 9 | owner 40 and 50, repository 101 and 101 + `.git`, both over, and four url spellings: the `gh` log empty, exit 2, the `source-unresolvable` line, no plan, no work directory | 9 fail at the `gh` log (`cloning ...`) | 9 fail, the same | 9 pass | | `test_a_github_url_past_the_limits_is_refused_before_any_stat` (moved from #1122) | 4 | `[www.]github.com/<300 a's>/Thing` with a real `File name too long`; `github.com/<40 a's>/Thing` with `stat` refused (EIO, EACCES): `source-unresolvable`, no url; control at 39, both readings and the url | 4 fail at the code (`source-unreadable`, "cannot be told") | 4 fail, the same | 4 pass | | `test_no_remedy_offers_an_org_github_cannot_hold` | 3 | `--org testorg` with owner 40, 50, both over: no `--org <owner>`, no `adopt-not-the-source`; control at 39 offers `--org <39 c's>` | 3 fail at `--org <owner>` offered | 3 fail, the same | 3 pass | | `test_a_directory_github_cannot_name_is_read_in_place` | 2 | `./<40 c's>/Thing`, `./testorg/<101 r's>` repositories here: exit 0, recorded in place, no repository, 0 `gh` calls; control at the limit is `source-ambiguous` | 2 fail at the exit (`source-ambiguous`) | 2 fail, the same | 2 pass | | `test_a_recorded_name_github_can_hold_is_cloned_again` (control) | 4 | `check`, `execute`: the NOTE and 1 `gh` call | 4 pass | 4 pass | 4 pass | | `test_a_recorded_name_github_cannot_hold_is_never_cloned_again` | 6 | `check`, `execute`; owner 40, repository 101, both: the `gh` log empty, the `source-unresolvable` line, no "cloned again" | 6 fail at the `gh` log (the NOTE, "cloned again") | 6 fail, the same | 6 pass | | `test_check_and_execute_read_a_source_name_as_plan_reads_it` | 10 | `check`, `execute` with `--source`: 4 controls at the limits (1 `gh` call), 6 past them (0 calls, `source-unresolvable`) | 6 fail at the `gh` log; 4 pass | the same | 10 pass | | `test_a_record_github_cannot_hold_offers_no_org` | 4 | `check`, `execute` (no `--yes`); a source with no `origin`, record owner 40 and 50: no `--org <owner>`, no `plan-not-the-source`; `plan ok` / `adopt-unconfirmed`; control at 39 keeps `plan-not-the-source` and `--org <39 c's>` | 4 fail at `--org <owner>` offered | 4 fail, the same | 4 pass | Totals for the 48 rows: - **#1122's head:** 34 failed, 14 passed; - **main:** 34 failed, 14 passed; - **this head:** 48 passed. Every row that is not a control fails on both bases, at the assertion that names the defect, not at a setup step. The 14 controls pass on all three. **#1122's file** `tests/test_adopt_unsearchable_source.py`: 40 rows at this head, from 44. Three params moved out: the two url rows, and the url row's EIO and EACCES variants. Before the move, those four rows failed at this head (`source-unresolvable` against `source-unreadable`), and the other 40 passed. ## Mutants Each was applied to this head's `adopt-project.py` (sha256 `d494ba0e...`) by exact substitution of the new guard line, and run against this file, `test_adopt_unsearchable_source.py` and `test_adopt_unenterable_source_and_locale.py` (101 tests). After each one the file was restored from its saved bytes and its sha256 checked. Unmutated, all 101 pass. All 8 were killed. | Mutant | Killed by | |---|---| | M1: owner limit one lower (`> GITHUB_OWNER_MAX - 1`) | 24: the owner-39 controls (plan, `--source`, the recorded clone, the remedy, the directory, the held record, the moved rows' controls), and #1122's 5 owner controls at 39 | | M2: owner limit one higher (`+ 1`) | 15: every owner-40 row (plan, url, `--source`, the recorded clone, the remedy, the directory, the held record, the 2 moved EIO/EACCES rows), and #1122's 2 `owner-one-over` rows | | M3: repository limit one lower (`- 1`) | 15: the repository-100 controls, and #1122's 5 repository controls at 100 | | M4: repository limit one higher (`+ 1`) | 11: every repository-101 row, and #1122's 2 `repository-one-over` rows | | M5: owner limit removed | 25 | | M6: repository limit removed | 15 | | M7: both limits removed (no guard anywhere, since #1122's is folded in) | 46: every refused row here, and 12 of #1122's | | M8: the repository counted with its `.git` (`len(segments[1])`) | 1: `test_plan_asks_gh_for_a_name_github_can_hold[repository-100-dot-git]` | ## Gate Run on the scratch merge `w1129-gate` at `ca06ad25a`: a merge of `main` `961640c6` and this head `900f77af`. Its tree, `90fbea0e`, is the one `git merge-tree --write-tree origin/main HEAD` gives, and `main` has not moved since. The environment is the one under "Tests"; targeted files only, never the full suite. Every run ended with rc=0. **Test files, 23:** | File | Passed | Skipped | |---|---|---| | `test_adopt_source_github_limits` (new) | 48 | 0 | | `test_adopt_unsearchable_source` | 40 | 0 | | `test_adopt_unenterable_source_and_locale` | 13 | 0 | | `test_adopt_check_plan_name` | 45 | 0 | | `test_adopt_source_clone_record` | 100 | 0 | | `test_adopt_template_values` | 78 | 0 | | `test_adopt_work_dir_refusal` | 53 | 0 | | `test_windows_paths` | 46 | 0 | | `test_adopt_clone_claimed` | 42 | 0 | | `test_adopt_late_failure` | 88 | 0 | | `test_adopt_plan_flag_refusals_first` | 89 | 0 | | `test_adopt_temp_work_roots` | 9 | 0 | | `test_adopt_origin_repository` | 30 | 0 | | `test_adopt_plan` | 66 | 1 | | `test_adopt_project_is_the_source` | 23 | 0 | | `test_adopt_relative_submodule_url` | 34 | 0 | | `test_adopt_split_branch` | 47 | 0 | | `test_adopt_values_as_typed` | 40 | 0 | | `test_adopt_plan_escapes` | 59 | 0 | | `test_path_guard_hygiene` | 49 | 0 | | `test_repo_hygiene` | 101 | 0 | | `test_scaffold_leg_path_collisions` | 104 | 0 | | `test_github_name_limits` | 64 | 0 | | **Total** | **1268** | **1** | **`tests/test_shape_doctor.py`, all 448 collected ids, in 8 shards of 56** (the shard lists together hold every collected id exactly once; every `adopt-project.py` change is gated with it): | Shard | Ids | Passed | Skipped | |---|---|---|---| | d01 | 56 | 56 | 0 | | d02 | 56 | 56 | 0 | | d03 | 56 | 55 | 1 | | d04 | 56 | 55 | 1 | | d05 | 56 | 55 | 1 | | d06 | 56 | 56 | 0 | | d07 | 56 | 56 | 0 | | d08 | 56 | 56 | 0 | | **Total** | **448** | **445** | **3** | **Totals: 1713 passed, 4 skipped, 0 failed, 0 errors.** The skips are the host's: three `test_shape_doctor.py` rows that print the PowerShell line and need `powershell.exe` on a Windows host, and one `test_adopt_plan.py` row that needs `SHAPE_MEDXEHR_CLONE`, a read-only clone of MedxSoft/MedxEHR. The gate paused after d02 for disk space and ran d03 to d08 later, on the same scratch merge, whose head did not change. ## Merges `git merge-tree --write-tree`, this head `900f77af` against each of these; all are clean (rc=0, no conflict): | Against | Head | Tree | |---|---|---| | `main` | `961640c6` | `90fbea0e` | | #1122, the base | `c01c4d73` | `e2cea9b3` (this head's own tree) | | #1186 | `07486a49` | `78702414` | | #1180 | `6cd96b8b` | `eff9e4db` | | #1178 | `c4beba19` | `b79abc31` | | #1177 | `5208e874` | `91156ae6` | | #1171 | `8162b874` | `87e2ce31` | | #1170 | `24ee133a` | `f001382d` | | #1169 | `25805102` | `b58ed451` | | #1154 | `8a782833` | `2e67c977` | | #1153 | `ff33ba12` | `070c39b2` | | #1143 | `7af5fabc` | `7237b405` | | #1141 | `7a2711d0` | `c0bcaf88` | | #1125 | `9549006f` | `c16ff99a` | | #1123 | `5c3908f8` | `aba16ad4` | | #1121 | `1c517375` | `6e1f5cb9` | | #1120 | `c55e55e3` | `845f0ab5` | | #1119 | `bba168bd` | `ab6af7c8` | | #1118 | `2307036a` | `1d53a9d9` | | #1106 | `504a1dd6` | `60cd4c67` | | #1105 | `b28f40de` | `b5f065ec` | | #1189 | `8684af86` | `352b9e86` | | #1190 | `00f959c6` | `6335ed44` | These are the open PRs that touch `adopt-project.py`, and #1122 also touches `tests/test_adopt_unsearchable_source.py`. #1189 and #1190 opened, and #1169 and #1171 moved, after the first run of these; the four were merged again at the heads shown, just before the push, and the other heads were read again and had not moved. The merge with #1122 is clean as text, and see "Why stacked" for what it does not settle. ## Out of scope - **The origin url has its own reader.** A local source whose `origin` is `https://github.com/<40 c's>/Thing` is read by `url_repository` in `scripts/repo_shape.py`, a pinned script that shares the reading with `shape-doctor.py`, and not by `_github_name`. It still records that name, and `--org testorg` would be told `--org <40 c's>`. I read this in the code and did not measure it. - **Owner characters.** `_github_name` takes owner characters GitHub gives no owner: `.`, a trailing `-`, and `--`. `_` is let by on purpose, for GitHub Enterprise Managed Users (#863's `GITHUB_OWNER_CHARACTERS`). The brief limited this change to the two lengths. - **The refusal's wording.** `source-unresolvable` for a spelling past the limits says "neither a path that exists nor an `org/repo` name", which is true now, but does not say which limit it broke. Closes #1129 Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Opus 5.5 <[email protected]>



What changed
A v1.2.1 follow-up from lane 4's review of #1251 (#1261). It lands under Brett Heap's v1.2.1 merge word (2026-10-23T13:10:26Z) once reviewed and green.
git clonenames the remote it makes afterclone.defaultRemoteName, andexecuteaddressed its clones asorigin. Withupstreamin the person's global git config,execute --local-remote-dirended inREFUSED mounting the legs, exit 2, after both legs were made and pushed. Each cloneexecutemakes now names its remoteorigin, whatever the person's config holds. No flag or command is added.adopt-project.pygainsREMOTE_NAMED_ORIGIN = ["-c", "clone.defaultRemoteName=origin"]besideFILE_PROTOCOL, and four git calls carry it:_extract_leg'sgit cloneof the source.git filter-repoaddresses that clone'soriginby name: it removesoriginand makes eachorigin/*a branch. Underupstreamit did neither (measured: both work clones keptremote.upstream.*). adopt-project.py:executeunsets the leg clone'sremote.origin.urlbeforegit filter-repo, so under a Latin-1 locale a source under a directory named with the byte 0xE9 is extracted, where filter-repo died printing that url as U+FFFD, and every branch of the source is still rewritten as before (#1247) #1251'sgit config --unset remote.origin.urladdresses it too._mount_the_legs'git submodule add. A-con it reaches the clone it makes (measured below), whichgit remote set-url origin <leg url>andgit submodule syncthen address. This is the command that failed.git clone --template=in_commit_the_split. Nothing later in the run addresses this clone's remote by name: mutant M3 below still endsadoption verified. It is covered so that every cloneexecutemakes names its remote as it does without the setting. The row that compares each clone's remotes with a run without the setting kills M3.check's rehearsal of_extract_leg's clone (_split_clone_asked). Its docstring says it is asked "withFILE_PROTOCOL, asexecutegives each of its clones". Without the same-c, aclone.defaultRemoteNamegit refuses (a..b) would fail the rehearsal, andcheck, whereexecute's clones no longer read the setting.Source.clone, thecloned: truepath, runsgh repo clone <org/repo> <dir> -- --quiet --origin origin. gh runs git itself, so no-cof ours reaches its clone.--originis agit cloneflag, which gh passes on after its--as it passes--quiet. With it, the clone that_default_branch(refs/remotes/origin/HEAD) and_branches_of(refs/remotes/origin/) read names its remoteorigin. This was not measured against a real gh: the argv is pinned with a stub gh that logs and refuses.-con the git calls and not--origin:git submodule addtakes no--origin, so the mount needs the-cin any case. The-cthen gives the three git calls one spelling. On git 2.43.0, under a globalupstream, it outranks every other scope measured (below).Measured:
plan,check,execute --local-remote-dirThe standard source is
tests/conftest.py'smake_source_repo(directoryThing, projectNorthwind), withtest_adopt_e2e.py's three answers. It was made once, and each run adopts a copy of it. git 2.43.0, Python 3.12.3, git-filter-repo 2.47.0 (CI's pin, in a venv), with a stubgh(exit 97) first on PATH.GIT_CONFIG_GLOBALnames a scratch file holding the setting, or an empty file for the control.be21751c3faa29987adefaultRemoteName = upstreamplan ok), execute 2:REFUSED mounting the legsadoption verified: every source path is in exactly one placeadoption verified: ...adoption verified: ...defaultRemoteName = a..badopt-git-unasked, execute 2REFUSED adopt-git-unaskedbefore any legadoption verified: ...The end of main's
executeunderupstream(paths shortened):And main's
checkundera..b:FINDING adopt-git-unasked: ... the split's git clone of the source exited 128 there: fatal: 'a..b' is not a valid remote name.git symbolic-ref HEAD,git for-each-refand the sortedgit cat-file --batch-all-objects --batch-check(52 lines). The dumps arecmp-identical across main's control, main underupstream(pushed before the refusal), and this PR underupstream, the control anda..b.git config --get-regexp '^(remote|branch)\.'for each repository in--work-dir). On main underupstream, the assembly, the spec mount and both work clones heldremote.upstream.*andbranch.*.remote upstream. With this PR they match the control byte for byte once each run's base path is taken out: the assembly and both mountsorigin, and the work clones none, since filter-repo removesorigin.origin. The onlyoriginthe post-mount code names is_mount_the_legs'set-url.git submodule syncreads each mount's remote from its branch._push_the_legand the split's push go to explicit urls, andgh pr createandgh repo editname their repository. The run with this PR went through the split's commit, its push and the verification underupstream, toadoption verified.Measured: which spelling reaches which clone (git 2.43.0, global
upstream)git cloneupstreamgit clone --origin originorigingit -c clone.defaultRemoteName=origin cloneorigingit submodule add --force -q <repo> <path>(withFILE_PROTOCOLonly)upstream; thengit remote set-url originexits 2git -c clone.defaultRemoteName=origin submodule add ...origin; thenset-url originexits 0configholdingdefaultRemoteName = fromtemplatefromtemplate;originwith the-c, and with--origin originGIT_CONFIG_COUNTnamingfromcount, plus the-coriginGIT_CONFIG_PARAMETERSnamingfromparams, plus the-corigina..b: plain, with the-c, with--origin originfatal: 'a..b' is not a valid remote name;origin;originRows
tests/test_adopt_clone_default_remote_name.pyis new.test_adopt_e2e.py's module adoption makes a source of its own, and a source made twice is two histories, so the byte comparison needs both runs on copies of one source. Each row gives the setting to its own child only, in aGIT_CONFIG_GLOBALof its own: the session's file, then the setting.test_the_premise_a_plain_clone_under_the_setting_names_upstreamtest_execute_under_the_setting_exits_0_and_says_adoption_verified: fails on main withREFUSED mounting the legs.test_the_legs_are_the_bytes_a_run_without_the_setting_pushes: passes on main as well, since both legs were pushed before the mount refused.test_each_clone_execute_makes_has_the_remotes_it_has_without_ittest_check_passes_under_a_default_remote_name_git_refusestest_gh_repo_clone_is_handed_origin_for_the_remotes_name: a stub gh, first on PATH, logs one argument per line and exits 97.On main (adopt-project.py at main's bytes):
4 failed, 2 passed(the premise and the legs rows pass). With this PR:6 passed.tests/test_adopt_source_clone_record.py: its exact pin of thegh repo cloneargv gains"--origin", "origin".Mutants
Each part was dropped in turn from this PR's
adopt-project.py, the new module was run, and the file was restored, each restore checked withcmpandgit diff --quiet HEAD._extract_leg's clonetest_each_clone_execute_makes_has_the_remotes_it_has_without_itgit submodule addtest_execute_under_the_setting_exits_0_and_says_adoption_verified(error: No such remote 'origin'), and the remotes rowcheck's rehearsaltest_check_passes_under_a_default_remote_name_git_refusesgh repo clone's--origin origintest_adopt_source_clone_record.py -k each_spelling_of_a_name: 12 failedtest_gh_repo_clone_is_handed_origin_for_the_remotes_nameTests run
Each pytest was run one at a time as
/usr/bin/python3 -m pytest -q -p no:cacheprovider -rs(-rfsfor the chain), with a stubgh(exit 97) first on PATH, then a folder holding only a link to the venv'sgit-filter-repo2.47.0, and withGH_TOKEN=bogus, an emptyGH_CONFIG_DIR,GIT_SSH_COMMAND=false,GIT_CONFIG_GLOBALan empty scratch file and[email protected]. Headfaa29987a. The new rows and the mutants first ran at391886b01, whoseadopt-project.pydiffers from this head's in comments only, and the new rows ran again atf741b30f8, which has this head's tree.tests/test_adopt_clone_default_remote_name.py:6 passed in 14.75s(and4 failed, 2 passedwithadopt-project.pyat main's bytes).tests/test_repo_hygiene.py tests/test_agents_md_codes.py tests/test_git_output_decoding.py tests/test_stdout_encoding.py tests/test_readme_sections.py tests/test_path_guard_hygiene.py, plustests/test_cli_reference.py(no help text moved),tests/test_no_auto_maintenance.py(it scans every test file forGIT_CONFIG_COUNT) andtests/test_clone_just_pushed.py(the one test that already namedclone.defaultRemoteName):559 passed, 3 skipped in 128.74s.execute(git grep -lof"execute",'execute'orEXECUTE, kept where the module also namesADOPToradopt-project: 61 modules),tests/test_shape_doctor.pyandtests/test_scaffold_leg_path_collisions.py. Each was run as one pytest, the modules that exercise the changed calls first: runs 1 to 3 together with every test module the module imports from, and runs 4 on with each it imports a fixture from (the pairing in which a module-scoped fixture can run twice):tests/test_adopt_source_clone_record.pytests/test_adopt_plan_leg_path_help.pytests/test_adopt_temp_work_roots.py:154 passed in 61.75s (0:01:01) EXIT=0tests/test_adopt_check_throwaway_repos.pytests/test_adopt_nested_attributes.pytests/test_adopt_relative_submodule_url.pytests/test_adopt_root_symlinks.py:466 passed, 4 skipped in 838.78s (0:13:58) EXIT=0tests/test_adopt_e2e.py:27 passed in 29.84s EXIT=0tests/test_adopt_clone_template.py:31 passed in 39.94s EXIT=0tests/test_adopt_mount_ignored.py:26 passed in 28.43s EXIT=0tests/test_adopt_clone_claimed.pytests/test_adopt_source_clone_record.pytests/test_adopt_temp_work_roots.py:151 passed in 90.43s (0:01:30) EXIT=0tests/test_adopt_late_failure.py:88 passed in 47.19s EXIT=0tests/test_adopt_history_gitlinks.py:45 passed in 66.50s (0:01:06) EXIT=0tests/test_adopt_verify.py:31 passed in 32.85s EXIT=0tests/test_adopt_split_branch.py:47 passed in 123.27s (0:02:03) EXIT=0tests/test_adopt_partial_clone_source.py:38 passed in 30.68s EXIT=0tests/test_adopt_filter_repo_failure.py:11 passed in 10.13s EXIT=0tests/test_adopt_relative_submodule_url.py:34 passed in 140.84s (0:02:20) EXIT=0tests/test_adopt_execute_refusals.py:181 passed in 279.10s (0:04:39) EXIT=0tests/test_adopt_submodules.py:167 passed in 227.35s (0:03:47) EXIT=0tests/test_scaffold_leg_path_collisions.py:104 passed in 6.32s EXIT=0tests/test_shape_doctor.py:446 passed, 3 skipped in 780.19s (0:13:00) EXIT=0CHAIN-DONEat 18:50Z on 2026-11-08). Each run is one pytest, and every one exits 0; four were not run again because each of their files had already run inside an earlier run:tests/test_adopt_branch_names.py:29 passed in 41.13stests/test_adopt_c_locale_bytes.py:17 passed in 42.81stests/test_adopt_contracts_dir.py:34 passed in 23.07stests/test_adopt_empty_symlinks.py:53 passed in 85.43s (0:01:25)tests/test_adopt_entry_paths.py:79 passed in 74.69s (0:01:14)tests/test_adopt_eol_block_through_links.py:13 passed, 2 skipped in 24.79stests/test_adopt_git_reads.py:37 passed in 46.77stests/test_adopt_git_rm_bytes.py:4 passed in 8.78stests/test_adopt_github_exits.py:23 passed in 56.35stests/test_adopt_gitmodules_values.py:187 passed in 145.84s (0:02:25)tests/test_adopt_ignored_shape_files.py:37 passed in 39.49stests/test_adopt_leg_keys.py:44 passed in 41.24stests/test_adopt_leg_path_collisions.py:95 passed in 61.55s (0:01:01)tests/test_adopt_leg_paths.py:351 passed in 86.79s (0:01:26)tests/test_adopt_manifest_values.py:82 passed in 104.78s (0:01:44)tests/test_adopt_nested_attributes.py:75 passed in 84.13s (0:01:24)tests/test_adopt_next_make_reads_first.py:40 passed in 42.07stests/test_adopt_pins.py:152 passed in 179.49s (0:02:59)tests/test_adopt_plan_value_order.py:20 passed in 22.91stests/test_adopt_plan_yaml_quoting.py:540 passed in 194.48s (0:03:14)tests/test_adopt_printed_sentences.py:54 passed in 38.78stests/test_adopt_root_manifest.py:27 passed in 15.86stests/test_adopt_root_shape_paths.py:121 passed in 87.24s (0:01:27)tests/test_adopt_root_symlinks.py: not run again (every file already ran in an earlier run)tests/test_adopt_shape_pin_and_work_dir.py(with 1 module it imports):226 passed, 3 skipped in 344.55s (0:05:44)tests/test_adopt_single_repository_record.py:39 passed in 19.17stests/test_adopt_spec_only.py:14 passed in 17.11stests/test_adopt_spelled_names.py:27 passed in 8.25stests/test_adopt_temp_work_roots.py: not run again (every file already ran in an earlier run)tests/test_adopt_template_values.py:78 passed in 64.28s (0:01:04)tests/test_adopt_tracking_branch.py:17 passed in 19.74stests/test_adopt_unenterable_source_and_locale.py(with 1 module it imports):40 passed in 16.90stests/test_adopt_unsearchable_source.py: not run again (every file already ran in an earlier run)tests/test_adopt_values_as_typed.py:40 passed in 30.52stests/test_adopt_work_dir_refusal.py(with 1 module it imports):259 passed, 3 skipped in 347.04s (0:05:47)tests/test_answered_paths_per_leg.py(with 1 module it imports):465 passed, 3 skipped in 720.53s (0:12:00)tests/test_doctor_recorded_answers.py(with 1 module it imports):475 passed, 3 skipped in 752.61s (0:12:32)tests/test_github_limits_init_check_org.py(with 2 modules it imports):264 passed in 65.52s (0:01:05)tests/test_github_name_limits.py: not run again (every file already ran in an earlier run)tests/test_leg_path_yaml_scalars.py:199 passed, 8 skipped in 30.66stests/test_ruleset_hint_tracking_branch.py:23 passed in 34.77stests/test_template_text_placeholders.py:142 passed in 71.49s (0:01:11)tests/test_template_values_single_pass.py:192 passed in 14.34stests/test_update_shape_merged_away.py(with 2 modules it imports):494 passed, 3 skipped in 706.68s (0:11:46)Merges
Refreshed over main
8e6f532, which holds #1251 (the squash of #1251, for #1247). Merge commit5f565f0f6(git merge --no-ff origin/main): clean, no conflicted path, tree1d98d820a0be. In the merged_extract_leg, this PR's clone keepsREMOTE_NAMED_ORIGIN(adopt-project.py:14825) ahead of #1251'sgit config --file <work>/.git/config --unset remote.origin.url(:14864). Two commits follow the merge, and the head is76ac9fef2bc348bdc01082d09a6b95b377f93da0(treedf11c591c3b0, a fast-forward offaa29987a):5d92551fa, the review's SHOULD: adopt-project.py:executeunsets the leg clone'sremote.origin.urlbeforegit filter-repo, so under a Latin-1 locale a source under a directory named with the byte 0xE9 is extracted, where filter-repo died printing that url as U+FFFD, and every branch of the source is still rewritten as before (#1247) #1251's comment in_extract_legsaid a globalclone.defaultRemoteNamegives the clone another remote, so the unset exits 5 andexecutethen fails atmounting the legs. With this PR that is false: underupstreamthe merged tree executes toadoption verified. The comment is rewritten and no code moves. It now says that exit 5 is tolerated and that no known cause remains. What was measured (git 2.43.0, the standard source,GIT_CONFIG_GLOBALholdingdefaultRemoteName = upstreamor empty): the clone as main made it, with no-c, has remoteupstreamand the unset exits 5 under the setting (remoteorigin, exit 0, under the control); the clone this PR makes has remoteoriginand the unset exits 0 under the setting, the control,GIT_CONFIG_COUNT,GIT_CONFIG_PARAMETERS,GIT_CONFIG_SYSTEM,GIT_CONFIGand a templateconfignamingupstream, and undera..b._extract_leghas one caller, and nothing between itsgit cloneand the unset removes the remote, so no other path reaches the unset withoutremote.origin.url. The tolerance stays as a guard.76ac9fef2, a semantic conflict between the two PRs that no merge sees: adopt-project.py:executeunsets the leg clone'sremote.origin.urlbeforegit filter-repo, so under a Latin-1 locale a source under a directory named with the byte 0xE9 is extracted, where filter-repo died printing that url as U+FFFD, and every branch of the source is still rewritten as before (#1247) #1251's rowtest_a_clone_with_no_origin_url_goes_on_to_filter_reposets the globalupstreamand expects the unset to exit 5, and with this PR it exits 0 (assert [] == [5]). The row now setsREMOTE_NAMED_ORIGINto[], which makes the clone as main did, so it still pins that exit 5 is gone on from and no other exit is. With the tolerance dropped from_extract_leg, that row fails (1 failed, 4 passed). Its docstrings say that no known cause remains. No code changed.Gates at the head (each pytest one at a time, the environment of "Tests run" above,
GIT_CONFIG_GLOBAL=/dev/null):5d92551fa: this PR's two test modules, adopt-project.py:executeunsets the leg clone'sremote.origin.urlbeforegit filter-repo, so under a Latin-1 locale a source under a directory named with the byte 0xE9 is extracted, where filter-repo died printing that url as U+FFFD, and every branch of the source is still rewritten as before (#1247) #1251'stests/test_adopt_filter_repo_origin_url.py,tests/test_shape_doctor.py,tests/test_scaffold_leg_path_collisions.py, andtests/test_adopt_temp_work_roots.pyandtests/test_adopt_plan_leg_path_help.py(the modulestest_adopt_source_clone_record.pyimports from):1 failed, 714 passed, 3 skipped in 769.83s (0:12:49). The one failure is the row above.76ac9fef2changes only that module: it ran again,5 passed in 9.85s.tests/test_repo_hygiene.py tests/test_agents_md_codes.py tests/test_git_output_decoding.py tests/test_stdout_encoding.py tests/test_cli_reference.py tests/test_no_auto_maintenance.py tests/test_update_add_codes_documented.py:349 passed, 3 skipped in 63.79s (0:01:03).execute --local-remote-diron a copy of one standard source) on the merged tree: underupstreamand under the empty control, plan 0, check 0, execute 0 andadoption verified: every source path is in exactly one place, and the legs' dump and the clones' remotes arecmp-identical across the two.Measured at
faa29987a, on mainbe21751c3, before the refresh (not repeated at the new head, except where the review re-merged):git merge-tree --write-tree(git 2.43.0) of this PR's headfaa29987awith main, and with each of the 27 open PRs that touch any of its files. That set came from onegh pr list --state open --limit 200 --json number,headRefOid,filescall, which listed 50 open PRs, and each PR touchesadopt-project.py.plan written toandcloning <repository> (read only) intoname the caller's--outand--work-dirwith_shown, as the other lines of the report name a path, so a bidi control, a line feed or a tab in either no longer reaches the terminal as it was typed (#1115) #11548a7828332: clean, tree118ca7046350. An earlier head of this branch had a comment beside theprintline that adopt-project.py:plan written toandcloning <repository> (read only) intoname the caller's--outand--work-dirwith_shown, as the other lines of the report name a path, so a bidi control, a line feed or a tab in either no longer reaches the terminal as it was typed (#1115) #1154 rewrites inSource.clone, and conflicted there. That comment moved intoREMOTE_NAMED_ORIGIN's.git rm -fand writes the twins the root keeps back from the index, so on a disk that ignores caseexecutekeeps a set the plan splits across repositories or drops (#1183) #1237b557859fd: conflicts intests/test_adopt_check_throwaway_repos.py, which this PR does not touch.git merge-tree origin/mainwith adopt-project.py: the mount removes a path a case twin is at or under withgit rm -fand writes the twins the root keeps back from the index, so on a disk that ignores caseexecutekeeps a set the plan splits across repositories or drops (#1183) #1237 conflicts on the same path, so the conflict is between adopt-project.py: the mount removes a path a case twin is at or under withgit rm -fand writes the twins the root keeps back from the index, so on a disk that ignores caseexecutekeeps a set the plan splits across repositories or drops (#1183) #1237 and main.ad70474d2f501e19c0fb0, 125240b030cbfcc3440e34c57, 12493146c3ca5f2b8a69add6b, 122573c9f57e81bc2db9b1756, 1210791106c2be921a684eac1, 12076fa1edd56225062290ee7, 1198d38e4e36d4e504b380946, 1194900f77af9f2ad66f823f4, 11897d2f651e74f07177d74f7, 118607486a4985538a35fbb33, 1178c4beba1930cda14cffc49, 11775208e874e9ccb989ef0ef, 11718162b874ead8cb54ab27a, 117024ee133aaf6b8cf6b3969, 1153ff33ba12a9c689b3aa45e, 11437af5fabc318fdb587c528, 11410b8fb3205b7cab1fbcbd0, 11259549006fe8dfc89c1c82a, 11235c3908f8dc7ed59e06065, 1122c01c4d73da691d81bef4c, 1120c55e55e330a37f6f00895, 11182307036ab689cbddc0d5f, 1106bd97901ff70599644591b, 1105b28f40de0df254512c3fa.Out of scope
Read, not probed: these are clones other tools make and then address as
origin. Each is a possible follow-up, and none is changed here.scaffold-project.py:2638-2644(_build_assembly_root) runsgit -c protocol.file.allow=always submodule add --force -q <work clone> <path>, thengit remote set-url origin <url>inassembly/<path>. This is the shape of the failing mount here, soscaffold-project.py(andsetup-project.py/setup.sh, which drive it) can likely meet the same refusal.setup-project.py:3345-3350(clone_and_bootstrap) runsgit clone -q [--no-local] --recurse-submodules <assembly url> <clone>.origin_recorded_in(setup-project.py:2417, used at :2491) then readsremote.origin.urlfrom<clone>/.git/config, and reads none under the setting.bootstrap.pythen runs in that clone; its own reads were not surveyed.scripts/family.py:7288mounts a member withgit submodule add -q --force -- <url> <path>. The member'soriginis then addressed by_has_origin(:8879,git remote get-url origin, whose exit 2 is read as "no origin"),_on_a_remote_branch(:8780,refs/remotes/origin/),_origin_tag_reaches(:8930,ls-remote --tags origin) andcmd_bump(:9458, a fetch fromorigin).scripts/bump-leg.pymakes no clone. It reads a leg'srefs/remotes/origin/(:1094-1101) and fetchesorigin(:1503, used at :1520) in a leg that the person's or bootstrap's clone made, which under the setting has noorigin.setup-project.py:962clones the shape into a temporary checkout, and nooriginuse follows.scripts/family.py:6635and:7389andupdate-shape.py:711make--bareclones, and nooriginuse of those follows.update-shape.py'srefs/remotes/origin/reads (:5497, :5604, :5910) are of the person's own project clone.scaffold-project.py:2147,:2518,:2653andscripts/family.py:3324nameoriginthemselves withgit remote add originin repositories made bygit init.Closes #1261
Lane: openreposhape-3 (openRepoShape-3)
🤖 Generated with Claude Code
Summary by Sourcery
Make all repositories created during project adoption use the
originremote name regardless of user Git configuration.Bug Fixes:
origin, preventing execution failures when users configure a different default remote name.Enhancements:
originremote behavior.Tests:
clone.defaultRemoteNamesettings, clone remote consistency, successful end-to-end adoption, and GitHub CLI clone arguments.