Skip to content

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

Merged
brettheap merged 6 commits into
mainfrom
l3-1261-clone-default-remote-name
Nov 10, 2026

Conversation

@brettheap

@brettheap brettheap commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

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 clone names the remote it makes after clone.defaultRemoteName, and execute addressed its clones as origin. With upstream in the person's global git config, execute --local-remote-dir ended in REFUSED mounting the legs, exit 2, after both legs were made and pushed. Each clone execute makes now names its remote origin, whatever the person's config holds. No flag or command is added.

  • adopt-project.py gains REMOTE_NAMED_ORIGIN = ["-c", "clone.defaultRemoteName=origin"] beside FILE_PROTOCOL, and four git calls carry it:
  • Source.clone, the cloned: true path, runs gh repo clone <org/repo> <dir> -- --quiet --origin origin. gh runs git itself, so no -c of ours reaches its clone. --origin is a git clone flag, 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 remote origin. This was not measured against a real gh: the argv is pinned with a stub gh that logs and refuses.
  • Why -c on the git calls and not --origin: git submodule add takes no --origin, so the mount needs the -c in any case. The -c then gives the three git calls one spelling. On git 2.43.0, under a global upstream, it outranks every other scope measured (below).

Measured: plan, check, execute --local-remote-dir

The standard source is tests/conftest.py's make_source_repo (directory Thing, project Northwind), with test_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 stub gh (exit 97) first on PATH. GIT_CONFIG_GLOBAL names a scratch file holding the setting, or an empty file for the control.

global config main be21751c3 this PR faa29987a
defaultRemoteName = upstream plan 0, check 0 (plan ok), execute 2: REFUSED mounting the legs plan 0, check 0, execute 0, adoption verified: every source path is in exactly one place
empty (control) plan 0, check 0, execute 0, adoption verified: ... plan 0, check 0, execute 0, adoption verified: ...
defaultRemoteName = a..b plan 0, check 1 adopt-git-unasked, execute 2 REFUSED adopt-git-unasked before any leg plan 0, check 0, execute 0, adoption verified: ...

The end of main's execute under upstream (paths shortened):

  spec    5 path(s) -> 536e214ac536 (2 commits kept) -> .../remotes/Northwind-spec.git
  code    7 path(s) -> 48c2220e5939 (2 commits kept) -> .../remotes/Northwind-code.git
REFUSED mounting the legs. THE EXACT COMMAND WAS:
    git remote set-url origin .../remotes/Northwind-spec.git
    (in .../work/Northwind/spec)
    exit 2
--- output ---
error: No such remote 'origin'
--- end output ---
NOTHING has been rolled back: ... both legs are pushed. ...

And main's check under a..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.

  • The legs. For each pushed leg, a dump of git symbolic-ref HEAD, git for-each-ref and the sorted git cat-file --batch-all-objects --batch-check (52 lines). The dumps are cmp-identical across main's control, main under upstream (pushed before the refusal), and this PR under upstream, the control and a..b.
  • The clones' remotes (git config --get-regexp '^(remote|branch)\.' for each repository in --work-dir). On main under upstream, the assembly, the spec mount and both work clones held remote.upstream.* and branch.*.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 mounts origin, and the work clones none, since filter-repo removes origin.
  • After the mount. Nothing after the mount names origin. The only origin the post-mount code names is _mount_the_legs' set-url. git submodule sync reads each mount's remote from its branch. _push_the_leg and the split's push go to explicit urls, and gh pr create and gh repo edit name their repository. The run with this PR went through the split's commit, its push and the verification under upstream, to adoption verified.

Measured: which spelling reaches which clone (git 2.43.0, global upstream)

command remote it made
git clone upstream
git clone --origin origin origin
git -c clone.defaultRemoteName=origin clone origin
git submodule add --force -q <repo> <path> (with FILE_PROTOCOL only) upstream; then git remote set-url origin exits 2
git -c clone.defaultRemoteName=origin submodule add ... origin; then set-url origin exits 0
a template config holding defaultRemoteName = fromtemplate fromtemplate; origin with the -c, and with --origin origin
GIT_CONFIG_COUNT naming fromcount, plus the -c origin
GIT_CONFIG_PARAMETERS naming fromparams, plus the -c origin
a..b: plain, with the -c, with --origin origin fatal: 'a..b' is not a valid remote name; origin; origin

Rows

tests/test_adopt_clone_default_remote_name.py is 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 a GIT_CONFIG_GLOBAL of its own: the session's file, then the setting.

  • test_the_premise_a_plain_clone_under_the_setting_names_upstream
  • test_execute_under_the_setting_exits_0_and_says_adoption_verified: fails on main with REFUSED 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_it
  • test_check_passes_under_a_default_remote_name_git_refuses
  • test_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 the gh repo clone argv 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 with cmp and git diff --quiet HEAD.

mutant result failing row(s)
M1 _extract_leg's clone 1 failed, 5 passed test_each_clone_execute_makes_has_the_remotes_it_has_without_it
M2 the mount's git submodule add 2 failed, 4 passed test_execute_under_the_setting_exits_0_and_says_adoption_verified (error: No such remote 'origin'), and the remotes row
M3 the assembly's clone 1 failed, 5 passed the remotes row
M4 check's rehearsal 1 failed, 5 passed test_check_passes_under_a_default_remote_name_git_refuses
M5 gh repo clone's --origin origin 1 failed, 5 passed; test_adopt_source_clone_record.py -k each_spelling_of_a_name: 12 failed test_gh_repo_clone_is_handed_origin_for_the_remotes_name

Tests run

Each pytest was run one at a time as /usr/bin/python3 -m pytest -q -p no:cacheprovider -rs (-rfs for the chain), with a stub gh (exit 97) first on PATH, then a folder holding only a link to the venv's git-filter-repo 2.47.0, and with GH_TOKEN=bogus, an empty GH_CONFIG_DIR, GIT_SSH_COMMAND=false, GIT_CONFIG_GLOBAL an empty scratch file and [email protected]. Head faa29987a. The new rows and the mutants first ran at 391886b01, whose adopt-project.py differs from this head's in comments only, and the new rows ran again at f741b30f8, which has this head's tree.

  • tests/test_adopt_clone_default_remote_name.py: 6 passed in 14.75s (and 4 failed, 2 passed with adopt-project.py at main's bytes).
  • The docs and hygiene guards, with three more, in one run: 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, plus tests/test_cli_reference.py (no help text moved), tests/test_no_auto_maintenance.py (it scans every test file for GIT_CONFIG_COUNT) and tests/test_clone_just_pushed.py (the one test that already named clone.defaultRemoteName): 559 passed, 3 skipped in 128.74s.
  • The adoption modules whose tests run execute (git grep -l of "execute", 'execute' or EXECUTE, kept where the module also names ADOPT or adopt-project: 61 modules), tests/test_shape_doctor.py and tests/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.py tests/test_adopt_plan_leg_path_help.py tests/test_adopt_temp_work_roots.py: 154 passed in 61.75s (0:01:01) EXIT=0
    • tests/test_adopt_check_throwaway_repos.py tests/test_adopt_nested_attributes.py tests/test_adopt_relative_submodule_url.py tests/test_adopt_root_symlinks.py: 466 passed, 4 skipped in 838.78s (0:13:58) EXIT=0
    • tests/test_adopt_e2e.py: 27 passed in 29.84s EXIT=0
    • tests/test_adopt_clone_template.py: 31 passed in 39.94s EXIT=0
    • tests/test_adopt_mount_ignored.py: 26 passed in 28.43s EXIT=0
    • tests/test_adopt_clone_claimed.py tests/test_adopt_source_clone_record.py tests/test_adopt_temp_work_roots.py: 151 passed in 90.43s (0:01:30) EXIT=0
    • tests/test_adopt_late_failure.py: 88 passed in 47.19s EXIT=0
    • tests/test_adopt_history_gitlinks.py: 45 passed in 66.50s (0:01:06) EXIT=0
    • tests/test_adopt_verify.py: 31 passed in 32.85s EXIT=0
    • tests/test_adopt_split_branch.py: 47 passed in 123.27s (0:02:03) EXIT=0
    • tests/test_adopt_partial_clone_source.py: 38 passed in 30.68s EXIT=0
    • tests/test_adopt_filter_repo_failure.py: 11 passed in 10.13s EXIT=0
    • tests/test_adopt_relative_submodule_url.py: 34 passed in 140.84s (0:02:20) EXIT=0
    • tests/test_adopt_execute_refusals.py: 181 passed in 279.10s (0:04:39) EXIT=0
    • tests/test_adopt_submodules.py: 167 passed in 227.35s (0:03:47) EXIT=0
    • tests/test_scaffold_leg_path_collisions.py: 104 passed in 6.32s EXIT=0
    • tests/test_shape_doctor.py: 446 passed, 3 skipped in 780.19s (0:13:00) EXIT=0
  • The rest of the chain, runs 18 to 61, finished after this PR opened (CHAIN-DONE at 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:
    • run 18, tests/test_adopt_branch_names.py: 29 passed in 41.13s
    • run 19, tests/test_adopt_c_locale_bytes.py: 17 passed in 42.81s
    • run 20, tests/test_adopt_contracts_dir.py: 34 passed in 23.07s
    • run 21, tests/test_adopt_empty_symlinks.py: 53 passed in 85.43s (0:01:25)
    • run 22, tests/test_adopt_entry_paths.py: 79 passed in 74.69s (0:01:14)
    • run 23, tests/test_adopt_eol_block_through_links.py: 13 passed, 2 skipped in 24.79s
    • run 24, tests/test_adopt_git_reads.py: 37 passed in 46.77s
    • run 25, tests/test_adopt_git_rm_bytes.py: 4 passed in 8.78s
    • run 26, tests/test_adopt_github_exits.py: 23 passed in 56.35s
    • run 27, tests/test_adopt_gitmodules_values.py: 187 passed in 145.84s (0:02:25)
    • run 28, tests/test_adopt_ignored_shape_files.py: 37 passed in 39.49s
    • run 29, tests/test_adopt_leg_keys.py: 44 passed in 41.24s
    • run 30, tests/test_adopt_leg_path_collisions.py: 95 passed in 61.55s (0:01:01)
    • run 31, tests/test_adopt_leg_paths.py: 351 passed in 86.79s (0:01:26)
    • run 32, tests/test_adopt_manifest_values.py: 82 passed in 104.78s (0:01:44)
    • run 33, tests/test_adopt_nested_attributes.py: 75 passed in 84.13s (0:01:24)
    • run 34, tests/test_adopt_next_make_reads_first.py: 40 passed in 42.07s
    • run 35, tests/test_adopt_pins.py: 152 passed in 179.49s (0:02:59)
    • run 36, tests/test_adopt_plan_value_order.py: 20 passed in 22.91s
    • run 37, tests/test_adopt_plan_yaml_quoting.py: 540 passed in 194.48s (0:03:14)
    • run 38, tests/test_adopt_printed_sentences.py: 54 passed in 38.78s
    • run 39, tests/test_adopt_root_manifest.py: 27 passed in 15.86s
    • run 40, tests/test_adopt_root_shape_paths.py: 121 passed in 87.24s (0:01:27)
    • run 41, tests/test_adopt_root_symlinks.py: not run again (every file already ran in an earlier run)
    • run 42, tests/test_adopt_shape_pin_and_work_dir.py (with 1 module it imports): 226 passed, 3 skipped in 344.55s (0:05:44)
    • run 43, tests/test_adopt_single_repository_record.py: 39 passed in 19.17s
    • run 44, tests/test_adopt_spec_only.py: 14 passed in 17.11s
    • run 45, tests/test_adopt_spelled_names.py: 27 passed in 8.25s
    • run 46, tests/test_adopt_temp_work_roots.py: not run again (every file already ran in an earlier run)
    • run 47, tests/test_adopt_template_values.py: 78 passed in 64.28s (0:01:04)
    • run 48, tests/test_adopt_tracking_branch.py: 17 passed in 19.74s
    • run 49, tests/test_adopt_unenterable_source_and_locale.py (with 1 module it imports): 40 passed in 16.90s
    • run 50, tests/test_adopt_unsearchable_source.py: not run again (every file already ran in an earlier run)
    • run 51, tests/test_adopt_values_as_typed.py: 40 passed in 30.52s
    • run 52, tests/test_adopt_work_dir_refusal.py (with 1 module it imports): 259 passed, 3 skipped in 347.04s (0:05:47)
    • run 53, tests/test_answered_paths_per_leg.py (with 1 module it imports): 465 passed, 3 skipped in 720.53s (0:12:00)
    • run 54, tests/test_doctor_recorded_answers.py (with 1 module it imports): 475 passed, 3 skipped in 752.61s (0:12:32)
    • run 55, tests/test_github_limits_init_check_org.py (with 2 modules it imports): 264 passed in 65.52s (0:01:05)
    • run 56, tests/test_github_name_limits.py: not run again (every file already ran in an earlier run)
    • run 57, tests/test_leg_path_yaml_scalars.py: 199 passed, 8 skipped in 30.66s
    • run 58, tests/test_ruleset_hint_tracking_branch.py: 23 passed in 34.77s
    • run 59, tests/test_template_text_placeholders.py: 142 passed in 71.49s (0:01:11)
    • run 60, tests/test_template_values_single_pass.py: 192 passed in 14.34s
    • run 61, tests/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 commit 5f565f0f6 (git merge --no-ff origin/main): clean, no conflicted path, tree 1d98d820a0be. In the merged _extract_leg, this PR's clone keeps REMOTE_NAMED_ORIGIN (adopt-project.py:14825) ahead of #1251's git config --file <work>/.git/config --unset remote.origin.url (:14864). Two commits follow the merge, and the head is 76ac9fef2bc348bdc01082d09a6b95b377f93da0 (tree df11c591c3b0, a fast-forward of faa29987a):

Gates at the head (each pytest one at a time, the environment of "Tests run" above, GIT_CONFIG_GLOBAL=/dev/null):

Measured at faa29987a, on main be21751c3, 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 head faa29987a with main, and with each of the 27 open PRs that touch any of its files. That set came from one gh pr list --state open --limit 200 --json number,headRefOid,files call, which listed 50 open PRs, and each PR touches adopt-project.py.

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) runs git -c protocol.file.allow=always submodule add --force -q <work clone> <path>, then git remote set-url origin <url> in assembly/<path>. This is the shape of the failing mount here, so scaffold-project.py (and setup-project.py / setup.sh, which drive it) can likely meet the same refusal.
  • setup-project.py:3345-3350 (clone_and_bootstrap) runs git clone -q [--no-local] --recurse-submodules <assembly url> <clone>. origin_recorded_in (setup-project.py:2417, used at :2491) then reads remote.origin.url from <clone>/.git/config, and reads none under the setting. bootstrap.py then runs in that clone; its own reads were not surveyed.
  • scripts/family.py:7288 mounts a member with git submodule add -q --force -- <url> <path>. The member's origin is 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) and cmd_bump (:9458, a fetch from origin).
  • scripts/bump-leg.py makes no clone. It reads a leg's refs/remotes/origin/ (:1094-1101) and fetches origin (:1503, used at :1520) in a leg that the person's or bootstrap's clone made, which under the setting has no origin.
  • Found and not a follow-up:
    • setup-project.py:962 clones the shape into a temporary checkout, and no origin use follows.
    • scripts/family.py:6635 and :7389 and update-shape.py:711 make --bare clones, and no origin use of those follows.
    • update-shape.py's refs/remotes/origin/ reads (:5497, :5604, :5910) are of the person's own project clone.
    • scaffold-project.py:2147, :2518, :2653 and scripts/family.py:3324 name origin themselves with git remote add origin in repositories made by git init.

Closes #1261

Lane: openreposhape-3 (openRepoShape-3)

🤖 Generated with Claude Code

Summary by Sourcery

Make all repositories created during project adoption use the origin remote name regardless of user Git configuration.

Bug Fixes:

  • Ensure adopt-project clones consistently use the remote name origin, preventing execution failures when users configure a different default remote name.

Enhancements:

  • Align source cloning through GitHub CLI and validation rehearsals with the standardized origin remote behavior.

Tests:

  • Add coverage for custom and invalid clone.defaultRemoteName settings, clone remote consistency, successful end-to-end adoption, and GitHub CLI clone arguments.

…`, 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]>
@sourcery-ai

sourcery-ai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Implementation

Centralize the origin remote policy and apply it to every Git clone or submodule creation in adoption, including the rehearsal clone, while passing --origin origin through gh repo clone.

  • adopt-project.py L1152-1164, L12904-12914, L15733-15740 (+5 small edits)

Tests

Add 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.

  • tests/test_adopt_clone_default_remote_name.py L1-249
  • tests/test_adopt_filter_repo_origin_url.py L29-35, L338-346, L363
  • tests/test_adopt_source_clone_record.py L262-263

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@brettheap

Copy link
Copy Markdown
Contributor Author

(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 faa29987: READY. The report follows as the reviewer wrote it.

I'm RV1268, the independent reviewer for PR #1268 (issue #1261), head faa29987aad260bb1a0f28f1acb9de316684383a.

Verdict: READY

There 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, /usr/bin/git 2.43.0, the stub gh (exit 97) first on PATH, then a folder holding only a link to the venv's git-filter-repo 2.47.0. They also used GH_TOKEN=bogus, an empty GH_CONFIG_DIR, GIT_SSH_COMMAND=false and EMAIL=[email protected]. The wrapper is RV1268-scratch/envrun.sh. One standard source (make_source_repo, directory Thing, project Northwind) was made once, and each run adopted a copy of it.

1. Before and after (RV1268-scratch/probe.py)

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-ref and the sorted cat-file --batch-all-objects --batch-check: 52 lines each. These five are cmp-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): spec c6a4782e... and code 3f12d592... in all five.
  • The clones' remotes. On main under upstream, the assembly, the spec mount and both work clones hold remote.upstream.*, and the code mount is (absent). On the head under upstream and under a..b, the remotes dump is cmp-equal to main's control.
  • The split commit. The trees differ only in .gitmodules and shape/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 plain submodule add exits 128 ('a..b' is not a valid remote name), and with the -c it names the remote origin.
  • Nothing after the mount names origin. grep of the head's adopt-project.py finds one origin after the mount: set-url at :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, and adoption 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: main execute exit=2 REFUSED mounting the legs; head execute exit=0, legs and remotes equal to the control.
    • a..b: main check exit=1 (adopt-git-unasked); head 0 / 0 / 0.
  • A global remote.origin.fetch (+refs/pull/*/head:refs/remotes/origin/pr/*), plus upstream:
    • 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 global remote.origin.* does what it does without it.
  • A global remote.origin.url = /nonexistent/x.git, plus upstream. This is the one real change.
    • A plain git -c clone.defaultRemoteName=origin clone fetches 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 refuses adopt-git-unasked with Remediation: 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.

4. The gh repo clone argv

  • gh's manual gives gh repo clone <repository> [<directory>] [-- <gitflags>...]: "Pass additional git clone flags by listing them after --."
  • gh's source does the same. clone.go sets opts.GitArgs = args[1:] (pflag drops the --). git/client.go's parseCloneArgs takes the first argument that does not start with - as the target. Clone runs git clone <flags> <url> <target>. Nothing in gh reads clone.defaultRemoteName.
  • So -- --quiet --origin origin becomes git 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 be upstream. 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.py swapped in: 4 failed, 2 passed. The failures are the execute, remotes, check and gh rows, and the output shows REFUSED mounting the legs / error: No such remote 'origin'. The file was restored, checked with cmp against the head's, and git diff --quiet HEAD was 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 to quarantine/ afterwards): 8 passed. It checks that the session's global file holds no defaultRemoteName, that git config --get clone.defaultRemoteName exits 1, and that a plain clone after the rows names origin.
  • 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.py and the two modules it imports from (test_adopt_temp_work_roots.py, test_adopt_plan_leg_path_help.py), plus test_adopt_e2e.py: 187 passed in 75.45s, 0 skipped.
  • g2, test_adopt_split_branch.py, test_adopt_submodules.py and test_scaffold_leg_path_collisions.py: 318 passed in 275.18s. Its import from test_adopt_pins is asked_what, a plain function, not a fixture.
  • g3, the hygiene guards plus test_cli_reference.py, test_no_auto_maintenance.py and test_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/merge e56915cf: 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.

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

Findings

SHOULD

NIT

Not covered

  • A real gh (stub and emulator only), the GitHub path of execute, Windows, another git version, and setting values other than upstream, a..b, fromparams and fromcount.
  • setup-project.py, family.py and bump-leg.py under 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, at faa29987a, clean.
  • Scratch: /workspace/projects/openRepoShape-worktrees/_lane3-scratch/RV1268-scratch/. It holds mut/ (mutant worktree, at the head, clean), base/ (main be21751c3), probes/, gates.log, gate-g1.log to gate-g3.log and mutants.log.
  • Basetemps: /tmp/claude-1000/l3bt/RV1268-{new,mut,g1,g2,g3}.

Lane: openreposhape-3 (openRepoShape-3)

Brett Heap and others added 3 commits November 9, 2026 13:30
… 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]>
@brettheap

Copy link
Copy Markdown
Contributor Author

(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 76ac9fef2bc348bdc01082d09a6b95b377f93da0: READY.

Verdict: READY

There 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, 42308f2. The gates and the probe pass at the head. The three NITs below are optional. RV1268's verdict on the fix itself stands; I did not review the fix again.

Setup. I used /usr/bin/git 2.43.0 and filter-repo 2.47.0, with the stub gh (exit 97) first on PATH. Every run also had GH_TOKEN=bogus, an empty GH_CONFIG_DIR, GIT_SSH_COMMAND=false, EMAIL=[email protected] and an empty GIT_CONFIG_GLOBAL, except where a setting is named. The wrapper is RV1268-scratch/envrun.sh.

Refs.

  • Main is refs/rv/main = 42308f26b01aadd5baf2181cf881eece119d17c8, the same as gh api .../commits/main. 8e6f532 is its ancestor.
  • The head is refs/rv/pr1268b = 76ac9fef2..., fetched from GitHub. It matches headRefOid.

1. The merge 5f565f0f6

  • Its parents are faa29987a and 8e6f532.
  • Its tree, 1d98d820a0be4dbb7c0fd10030b47a86dbd456cd, equals git merge-tree --write-tree faa29987a 8e6f532 (exit 0). There are no hand edits.
  • Against 8e6f532, the merge differs only in this PR's files: adopt-project.py, tests/test_adopt_clone_default_remote_name.py and tests/test_adopt_source_clone_record.py (285 insertions, 18 deletions).

2. REMOTE_NAMED_ORIGIN is still ahead of #1251's unset (head adopt-project.py)

14825:    run(["git", *FILE_PROTOCOL, *REMOTE_NAMED_ORIGIN, "clone", "-q",
14826:         str(source.path), str(work)])
14827:    run(["git", "checkout", "-q", "-B", branch, source.commit], cwd=work)
...
14864:        run(["git", GIT_CONFIG, "--file", str(work / ".git" / "config"),
14865:             "--unset", "remote.origin.url"], cwd=work)
14866:    except CommandFailed as exc:
14867:        if exc.code != GIT_CONFIG_KEY_ABSENT:
14868:            raise

_extract_leg has one caller (:15686). Between the clone and the unset there is only checkout -B, which does not touch the remote.

3. S1 commit 5d92551fa: only comments change, and the new comment is true

  • Diff: 8 insertions and 4 deletions in adopt-project.py, all # lines at :14854-14861. The new lines are ASCII and at most 78 columns.
  • tokenize: the non-comment token streams of adopt-project.py at 5f565f0f6 and at 5d92551fa are 79643 79643 EQUAL. As a control, main 8e6f532 against the merge gives 79619 79643 DIFFERENT. The head's adopt-project.py is byte-equal to 5d92551fa's.
  • The comment's claims, measured. I ran _extract_leg's own two commands (the clone, then git config --file <w>/.git/config --unset remote.origin.url) on the standard source.
    • "main clone" is the clone without the -c, as main makes it. "head clone" adds -c clone.defaultRemoteName=origin.
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

3b. Test commit 76ac9fef2

  • Test-only: it changes tests/test_adopt_filter_repo_origin_url.py only (16 insertions, 12 deletions). No other test module imports from that module (git grep finds none).
  • Baseline at the head: 5 passed in 9.35s.
  • The patched row really makes main's clone.
    • Its own assertions pass: exits == [5], and remote.upstream.url is the source.
    • _extract_leg reads REMOTE_NAMED_ORIGIN from module globals at call time, so setattr on 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.
  • Mutant A, the tolerance replaced by a bare raise: 1 failed, 4 passed in 9.36s, with CommandFailed: git config --file .../work/.git/config --unset remote.origin.url. The file was restored, and cmp with git show refs/rv/pr1268b:adopt-project.py is 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 and cmp is equal.
  • No leak.
    • monkeypatch is function-scoped. The adopter fixture is module-scoped and loads its own module object, adopt_origin_url, which is not put in sys.modules, so other test modules never see it.
    • I appended a row test_zz_rv1268b_no_leak(adopter) that asserts adopter.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, cmp is equal, and git status is clean.
  • Docstrings. The module text and the row's docstring are true as measured.
    • "Every clone execute makes names its remote origin": the git clones at :14825 and :16241 and the submodule add at :15188 carry REMOTE_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.
  • Placement: no finding. The row pins adopt-project.py: execute unsets the leg clone's remote.origin.url before git 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 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'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)

4. Gates at the head 76ac9fef2 (one pytest at a time)

5. Probe at the head (RV1268-scratch/probe.py)

6. The body

  • Old body. I saved the old body on 2026-11-08 (RV1268-scratch/pr-body.md). diff says 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:
  • The merge section names:
    • main 8e6f532;
    • merge 5f565f0f6, tree 1d98d820a0be (correct);
    • head 76ac9fef2bc348bdc01082d09a6b95b377f93da0, tree df11c591c3b0. That is correct (df11c591c3b00279103a6ca138ba1310c6f1e483), and faa29987a is its ancestor.
  • 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. The 1 failed, 4 passed mutant result matches mine.
  • Closing keyword and characters. The only closing keyword is Closes #1261, and closingIssuesReferences is [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 :14864 for the unset. That is the head's line. In merge commit 5f565f0f6, the run([ is at :14860 and --unset at :14861; the :14825 it also cites is the same in both. Cosmetic.
  • N3b. The new comment lists the sources the -c outranks as "the global file, a template's config, GIT_CONFIG_COUNT and GIT_CONFIG_PARAMETERS". It does not name the system file, though GIT_CONFIG_SYSTEM naming upstream also 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 -c outranks 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 own tests run as usual.

RV1268's N2 to N6 are about the fix, not the delta, and stand as RV1268 wrote them.

Not covered

  • The tests CI job, which was still running.
  • A pytest run on the 42308f2 merge 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, at faa29987a, clean.
  • Scratch: /workspace/projects/openRepoShape-worktrees/_lane3-scratch/RV1268-scratch/
    • mut/ is now at the head 76ac9fef2, clean.
    • base/ is now at main 8e6f532, 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 runs p-head-upstream/, p-head-empty/ and p-main8e6-upstream/, and the measurement folders m5/, rank/, tm/ and tmpl/.
  • Basetemps: /tmp/claude-1000/l3bt/RV1268b-{m,g1,g2}.

Lane: openreposhape-3 (openRepoShape-3)

brettheap added a commit that referenced this pull request Nov 9, 2026
…: 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]>
@sonarqubecloud

Copy link
Copy Markdown

@brettheap
brettheap marked this pull request as ready for review November 10, 2026 07:10
@sourcery-ai

sourcery-ai Bot commented Nov 10, 2026

Copy link
Copy Markdown

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 @sourcery-ai review. Upgrade to get a review now.

@brettheap
brettheap merged commit 2202af1 into main Nov 10, 2026
5 checks passed
@brettheap
brettheap deleted the l3-1261-clone-default-remote-name branch November 10, 2026 07:10
brettheap pushed a commit that referenced this pull request Nov 10, 2026
brettheap pushed a commit that referenced this pull request Nov 10, 2026
…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]>
brettheap added a commit that referenced this pull request Nov 10, 2026
… 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant