Skip to content

scaffold-project.py: a partial-clone --pin-source short of the pinned commit or its trees is pin-source-unreadable, named a partial clone with git fetch --refetch --no-filter <remote> <commit>, and no longer fetched into (#1182) - #1223

Merged
brettheap merged 12 commits into
mainfrom
fix/1182-scaffold-partial-pin-source
Nov 8, 2026

Conversation

@brettheap

@brettheap brettheap commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1182

Outside v1.2.0 by Brett Heap's ruling of 2026-10-21T10:32:04Z ("leave the follow-ups out of v1.2.0"). Measured against ef619c74a, the merge-base before the review round; main at e04826db4 is merged in since (5d90b9edb, a clean merge).

Review round (r1223: no MUST, one SHOULD, four NITs)

What

scaffold-project.py --pin <product>@<commit> --pin-source <clone> read the pin's digest with git in the clone (git cat-file -t of the commit, then git ls-tree -r). In a partial clone (git clone --filter) git fetches an object the clone lacks from its promisor remote on any read that needs it. Measured through the scaffold's own command line on ef619c74a and at this head (686a25253), git 2.43.0, the real run and --dry-run alike, with r1223's probe_nofetch.py and this PR's rows:

--pin-source base ef619c74a this branch
--filter=tree:0 --no-checkout (holds the pinned commit, none of its trees) exit 0, the clone's upload-pack ran 1 time, .promisor 1 -> 2 exit 2 pin-source-unreadable, 0 runs, .promisor unchanged, nothing made
--filter=blob:none --no-checkout lacking the pinned commit exit 0, 1 run, .promisor 1 -> 2 exit 2 pin-source-unreadable, 0 runs, unchanged, nothing made
blob:none holding the commit, checked out or not; a full clone; tree:0 checked out exit 0, 0 runs exit 0, 0 runs (unchanged)
a full clone lacking the commit pin-source-unreadable with git fetch --all first the same, word for word, with no partial-clone sentence

The refusal for a partial clone keeps the code pin-source-unreadable and the reader's own words, then says that the clone is a partial clone whose git fetches an object it lacks from its promisor remote (named), that the scaffold never fetches into a --pin-source, and names the cure: git fetch --refetch --no-filter origin <commit> in the clone, the pinned commit the reader could not read (one fetch per promisor remote, named in git's order). The cure as printed makes every short form readable: a tree:0 clone, checked out or bare, a blob:none clone that lacks the commit on another branch, and one that is merely behind. The scaffold run again reads the origin's own digest of that commit with 0 runs of its own.

The --pin-source help gains two sentences, the second in #1190's words: a partial clone is read where it holds the pinned commit and its trees; on a git that honours GIT_NO_LAZY_FETCH (2.45 or later, or a security release from 2.39.4 on), one git could read only by fetching what it lacks is pin-source-unreadable, and the scaffold fetches nothing into it; an older git fetches what it lacks into it. git v2.45.0's own Documentation/git.txt documents the variable. docs/cli.md is regenerated from the help.

Why

Tests

tests/test_scaffold_partial_pin_source.py, 40 rows, standalone (conftest's git, run_script, SCAFFOLD, make_source_repo, FILE_PROTOCOL). Each row clones a local origin (file://, no network, no gh) and sets remote.origin.uploadpack to a wrapper that logs each run, so "no fetch" is an answer the controls give too. Rows that need git to honour GIT_NO_LAZY_FETCH ask it first and skip, saying why, where it is ignored.

  • refusal x {tree:0, lacks-commit} x {dry-run, run}: exit 2, the partial-clone sentences, the cure naming the pinned commit, no git fetch --all and no refetch that names no commit, nothing made, 0 runs, objects/ unchanged;
  • a RELATIVE --pin-source openGlass (run in the folder holding it): the remediation names the resolved absolute path, not openGlass;
  • the cure as printed, run in a tree:0 clone and in a blob:none clone that lacks the commit (2 rows), lets the real run read the origin's digest of the pinned commit with no fetch of its own;
  • controls: a full clone, blob:none (checked out or not), a checked-out tree:0 clone, and a tree:0 clone made whole by fetch --refetch --no-filter, read the origin's digest with 0 runs; a full clone lacking the commit keeps git fetch --all; a folder in a partial clone is still pin-source-not-a-clone;
  • in process: main refuses a tree:0 clone with 0 runs, and with NO_LAZY_FETCH renamed to a name git does not read it fetches and exits 0 (so the variable is what stops the fetch); neither name is left in os.environ;
  • two promisor remotes: both named, one cure each, the reader's refusal as the cause;
  • unit rows: lazy_fetch_off (set inside; a prior 0 restored; an unset one removed; restored when the read raises), promisor_remotes (11 configs, including a boolean git itself dies on, and a folder that is not there), refetch_command (5 names, each with a commit), _remote_named (4 names).

Base vs head, the new file copied into a clean clone at ef619c74a: base 33 failed, 7 passed. The 7 are the 5 controls, the full clone lacking the commit and the folder row, which read the same on base; the 5 controls also pass at 961640c6 (5 passed), as their docstring says. Both cure rows fail on base at assert printed, because base prints no cure. Head 686a25253: 40 passed, none skipped (git 2.43.0 here honours the variable), and 40 passed under a 3.14-like sitecustomize shim, where pathlib's is_file, exists and is_dir answer False to any OSError.

Mutants of the new lines, one at a time, each run with the new file (S04 with tests/test_cli_reference.py), the file restored in finally and its blob checked equal to HEAD's after each: 42 (M01-M38 in shape_materialize.py, S01-S04 in scaffold-project.py). 41 killed, 1 survivor.

  • M37 (the clone named as typed, not resolved) survived the first 36 rows, as every row passed an absolute --pin-source; the relative-path row kills it (checked at af859e6a5).
  • SURVIVOR M08: _config_listed returns a failed run's stdout (return listed.stdout) instead of nothing. It is an equivalent mutant against real git: probed with git 2.43.0, git config -z --type=bool --get-regexp '^remote\..*\.promisor$' over remote.a.promisor=true, remote.b.promisor=maybe, remote.c.promisor=true (in each order of the three) exits 128 with fatal: bad boolean config value 'maybe' for 'remote.b.promisor' and writes NOTHING, because git collects every value before it writes one; a bad config line (fatal: bad config line) does the same. No config makes git 2.43 write part of a listing and then fail, so no row with a real git tells the two apart. A bad-boolean row was added to promisor_remotes' table anyway (a failed listing names nothing and nothing raises); it passes with or without the mutant. A stub git that writes a record and exits 128 would kill M08 (precedent: stub_git in tests/test_pinned_copy_text.py); not added, as it tests a git nobody has seen.
  • Batches A (M01-M20, 19/20) and B (M21-M38, S01-S04, 21/22) were run at 69fbca91a; M37 alone at af859e6a5 and M08 alone at cb4786860. They were not re-run at the merge commit.
  • r1223 ran 41 mutants of its own at 77687d685: 40 killed, and M8 survived, the same equivalent mutant.
  • This round, at 70babae7b, in a clone in the writer's scratch folder, with the file restored and its blob checked equal to HEAD's after each:
    • MA, the pasted cure drops the commit (git fetch --refetch --no-filter <remote> again): killed by 9 rows. test_the_cure_as_printed_makes_the_clone_readable[lacks-commit] kills it by behaviour: the scaffold re-run after the printed cure exits 2 (assert 2 == 0), while its [tree0] twin passes.
    • MB, the cure in words drops the commit: killed by the 3 refetch_command rows that say it in words.
    • 2 of 2 killed. After the restore, the cure rows pass (2 passed).

Gate

This round, at 686a25253

The same probe environment, with TMPDIR in the writer's scratch folder; one basetemp per call; worktree clean.

call files result
new tests/test_scaffold_partial_pin_source.py 40 passed in 18.40s
shim the same file, under r1223's 3.14-like sitecustomize shim (PYTHONPATH, shown to load) 40 passed in 17.13s
pins tests/test_adopt_pins.py::test_both_tools_read_a_pin_with_one_implementation, tests/test_scaffold_leg_path_collisions.py 105 passed in 5.38s
hygiene tests/test_path_guard_hygiene.py, tests/test_no_auto_maintenance.py 179 passed, 2 skipped in 29.90s (tests/test_no_auto_maintenance.py:222, x2, the reason below)
docs tests/test_agents_md_codes.py, tests/test_cli_reference.py, tests/test_repo_hygiene.py 171 passed in 39.36s; scripts/render-cli-reference.py --check: [ok] docs/cli.md is what the generator produces
base the new file at ef619c74a 33 failed, 7 passed in 16.35s

The 62-file gate below was NOT re-run at this head. It stands at 77687d685, before the merge of main e04826db4 (12 commits; scaffold-project.py and scripts/shape_materialize.py among them) and before this round's three commits.

The full gate, at 77687d685

Probe environment on every call (a stub gh first on PATH, a bogus GH_TOKEN, an empty GH_CONFIG_DIR, GIT_CONFIG_GLOBAL=/dev/null, GIT_SSH_COMMAND=false, EMAIL set, env -u LANES_LANE), one basetemp per call, each call under 530 s, at most 2 at once, at head 77687d685 (the merge of main ef619c74a).

The checkpoint's gate list file was missing. It was rebuilt as the checkpoint's own command (grep -lE -- "--pin-source|pin_source|declared_pin_values" tests/*.py: 53 files at this head, with the new one) plus tests/test_scaffold*.py and tests/test_setup_project*.py (9 more): 62 files, 5692 tests. A first call of 20 of those files hit the 530 s limit (rc 124 with 27% run; no result), so they were run in 24 units of at most 260 tests.

COMPLETE: every call below ended with exit code 0, at 77687d685 (clean worktree), from 18:07Z to 18:51Z. The result column is pytest's own summary line, with -rfEs so each skip names its reason. One row per call; f00-f23 are the 24 units of the 62 files, d0-d3 the doctor's 4 shards.

call files result
hygiene tests/test_path_guard_hygiene.py, tests/test_no_auto_maintenance.py 107 passed, 2 skipped in 22.43s (tests/test_no_auto_maintenance.py:222, x2: "the session began with GIT_CONFIG_GLOBAL set, and its file includes that one", which the probe environment does)
docs tests/test_agents_md_codes.py, tests/test_cli_reference.py, tests/test_repo_hygiene.py, tests/test_readme_windows_quoting_sentence.py 215 passed in 55.55s
f00 the new file (38 rows), test_scaffold_device_names, _e2e, _free_text_values, _ignored_shape_files 260 passed in 56.63s
f01 test_scaffold_init_empty_values, _leg_path_collisions, _leg_paths 167 passed in 21.63s
f02 test_scaffold_manifest_values, _mount_ignored, _pin_and_reuse 230 passed in 91.03s
f03 test_scaffold_pin_collisions, _referent_chain_links, _reuse_seeded_legs, test_setup_project_dry_run_offers 211 passed in 74.04s
f04 test_setup_project_name_edges 97 passed in 17.91s
f05 test_setup_project_py 340 passed in 109.62s
f06 test_setup_project_ref_parts, _repo_misdrawn, _typed_name, test_adopt_pins 221 passed in 165.74s
f07 test_chain_pin_sources, test_neutral_pin_validator, test_pin_annotated_tag, test_pin_source_env_collisions 259 passed in 121.02s
f08 test_pin_source_top_level, test_pin_source_unreadable, test_pinned_copy_text 216 passed in 65.76s
f09 test_validate_pins_named_and_spelled 344 passed in 58.04s
f10 test_validate_pins_spelled_and_named, _without_git, conftest.py 185 passed in 36.58s
f11 test_adopt_entry_paths, test_adopt_execute_refusals 260 passed in 278.42s
f12 test_adopt_finding_spelling, _ignored_shape_files, _manifest_values 247 passed in 143.30s
f13 test_adopt_plan, _plan_escapes, _plan_flag_refusals_first 214 passed, 1 skipped in 69.14s (tests/test_adopt_plan.py:567: SHAPE_MEDXEHR_CLONE is unset, or names no directory: the MedxEHR-backed plan test needs a read-only clone of MedxSoft/MedxEHR)
f14 test_adopt_plan_yaml_quoting (one file of 540 tests, run whole: over the 260 bound) 540 passed in 175.36s
f15 test_adopt_question_and_submodule_spelling 102 passed in 27.60s
f16 test_adopt_root_symlinks, test_adopt_spelled_names 232 passed, 3 skipped in 286.05s (tests/test_adopt_root_symlinks.py:1926, :1981, :2532: "the reftable backend needs git 2.45 or later"; this bench has git 2.43.0)
f17 test_adopt_template_values, test_assembly_root_unreadable_paths, test_chain_link_fold, test_chain_remedy_callers 245 passed in 84.73s
f18 test_clone_url_bytes, test_doctor_non_ascii_paths, test_doctor_validator_rows 227 passed in 200.82s
f19 test_doctor_validator_verdicts, test_dry_run_parity, test_github_name_limits, test_link_source_chain_defaults 252 passed in 125.98s
f20 test_naming_policy 264 passed in 17.21s
f21 test_non_utf8_name_helpers, test_repo_hygiene 120 passed in 2.69s
f22 test_setup_sh, test_stdout_encoding 238 passed, 1 skipped in 94.69s (tests/test_stdout_encoding.py:285: "the default this is about is Windows' own")
f23 test_template_text_placeholders, test_update_shape_landing 216 passed in 154.72s
d0 tests/test_shape_doctor.py, shard 0 of 4 (112 of 448 ids) 111 passed, 1 skipped in 177.84s (tests/test_shape_doctor.py:10510: "the PowerShell line is printed, and powershell.exe exists, only on a Windows host")
d1 tests/test_shape_doctor.py, shard 1 (112 ids) 112 passed in 166.29s
d2 tests/test_shape_doctor.py, shard 2 (112 ids) 111 passed, 1 skipped in 176.35s (the same line 10510, the same reason)
d3 tests/test_shape_doctor.py, shard 3 (112 ids) 111 passed, 1 skipped in 178.58s (the same line 10510, the same reason)

The 3 doctor skips are the 3 cases (family, manifest, pins) of test_a_template_validators_next_runs_when_pasted_into_powershell, a test marked skipif(os.name != "nt"): one in each of d0, d2 and d3.

Totals, summed from the logs:

  • f00-f23 (24 units, 62 files): 5687 passed, 5 skipped = 5692, the sum of the files' collected counts (conftest.py collects none).
  • d0-d3: 445 passed, 3 skipped = 448 ids, from one collect; the 4 shards are disjoint and their union is the whole list.
  • the 28 units: 6132 passed, 8 skipped = 6140.
  • with hygiene (107 passed, 2 skipped) and docs (215 passed): 6454 passed, 10 skipped = 6464 test runs. tests/test_repo_hygiene.py (101 tests) is in both docs and f21, so over distinct tests: 6353 passed, 10 skipped = 6363.
  • failed 0, errors 0, deselected 0, no unit re-run. The 10 skips are the 1 + 3 + 1 + 3 + 2 above, each with its reason printed.

Two notes on the record. The earlier call of 20 files (rc 124 at 530 s) is no result and is not in the table. f11 and f13 were still running when lane 1's LAST STEP stopped the scheduler; both ran to their end, and their .rc files were written by hand (0) after the logs read "260 passed" and "214 passed, 1 skipped": the pytest summaries above, not those two files, are their result.

Known limits

  • A git that ignores GIT_NO_LAZY_FETCH (older than 2.45.0 without the security releases of 2024-05-14, back to 2.39.4) fetches as before; the rows that need the variable skip there, saying so.
  • The cure fetches the pinned commit and every object it reaches, with no filter. For a blob:none clone that is merely behind, that is every blob of that commit's history, where git fetch --all would add one small pack and cure it too. Measured at this head with probe_nofetch.py: after the printed cure, 1 pack and 10 files under objects/; after fetch --all, 2 packs and 8. Later fetches stay filtered while the remote's partialclonefilter is set.
  • The fetch by id is measured over file:// (protocol v2) only, not against GitHub.
  • With two promisor remotes, the cure is one fetch from each, in git's order. A remote that lacks the commit was not measured.
  • git fetch --refetch needs git 2.36 or later; the remediation says so.
  • adopt-project.py plan is unchanged (adopt-project.py: plan runs with GIT_NO_LAZY_FETCH=1, refuses a partial-clone --source that lacks objects as source-partial-clone, and names a partial --pin-source it could read only by fetching and the fetch that makes it whole (#1162) #1190 handles plan's own read).
  • M08 survives, as above.

Not in this PR

Lane: openreposhape-1 (openRepoShape-1)

🤖 Generated with Claude Code

Summary by Sourcery

Prevent scaffold pin-source reads from lazily fetching missing objects in partial clones and guide users to explicitly refetch the pinned commit without a filter.

New Features:

  • Reject unreadable partial-clone pin sources without fetching into them and provide a commit-specific remediation command to make them readable.

Bug Fixes:

  • Prevent scaffold and dry-run pin reads from triggering lazy fetches in partial clones.
  • Preserve the existing unreadable-source behavior for full clones while correctly handling partial clones with missing commits or trees.

Enhancements:

  • Share partial-clone detection and no-lazy-fetch pin-reading support through the materialization helpers.
  • Document partial-clone pin-source behavior and Git version requirements in the CLI reference.

Documentation:

  • Regenerate the CLI documentation with the updated --pin-source guidance.

Tests:

  • Add comprehensive coverage for partial-clone refusals, remediation commands, promisor remotes, environment restoration, and no-fetch guarantees.

Brett Heap and others added 6 commits October 23, 2026 11:16
…e scaffold reads its pins with `GIT_NO_LAZY_FETCH=1`, so a partial-clone `--pin-source` short of the pinned commit or its trees is `pin-source-unreadable`, naming the partial clone and `git fetch --refetch --no-filter`, and is no longer fetched into (#1182)

Measured on main 961640c with git 2.43, through the scaffold's real run
and `--dry-run` alike: a `--filter=tree:0 --no-checkout` `--pin-source`,
and a `--filter=blob:none --no-checkout` one lacking the pinned commit,
each ran the clone's promisor `upload-pack` once (`.promisor` 1 -> 2) and
the run went on to exit 0. A `blob:none` clone holding the commit ran none.

Now `_declaration` reads the pins through `pin_values_unfetched`, which is
`declared_pin_values` under `lazy_fetch_off` (the environment put back
after), and which re-raises the reader's own `pin-source-unreadable` for
a partial clone (`promisor_remotes`, the doctor's #683 rule) with that
reason and the `git fetch --refetch --no-filter <remote>` cure. A clone
that is no partial one keeps the reader's refusal and its `git fetch
--all` remediation. Both forms now exit 2 with no `upload-pack` run and
nothing created. `--pin-source`'s help says so; docs/cli.md regenerated
with scripts/render-cli-reference.py. `adopt-project.py plan` is not
changed here.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… the clone only for `pin-source-unreadable`, which only a `--pin-source` gives (#1182)

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…--pin-source`, each counting the clone's `upload-pack` runs: refused with none at head, fetched into once on base (#1182)

Each row clones a local origin (`make_source_repo`, `main` plus a `side`
commit, filters allowed) and sets `remote.origin.uploadpack` to a wrapper
that logs each run, so "no fetch" is an answer the controls give too.

- A `tree:0` clone holding the pinned commit and none of its trees, and a
  `blob:none` clone lacking the commit, `--dry-run` and the real run:
  `pin-source-unreadable` naming the partial clone, `origin` and `git
  fetch --refetch --no-filter origin`, no `git fetch --all`, nothing made,
  0 runs, `objects/` unchanged. On 961640c: exit 0 after 1 run each.
- The cure as printed, run in a `tree:0` clone, lets the real run read the
  origin's digest with no fetch of its own.
- Controls, passing on 961640c too: a full clone, a `blob:none` clone
  holding the commit (checked out or not) and a `tree:0` clone made whole
  read the origin's digest with 0 runs; a full clone lacking the commit
  keeps `git fetch --all`; a folder in a partial clone is still
  `pin-source-not-a-clone`, with no partial sentence.
- In process: `main` refuses a `tree:0` clone with 0 runs, and with
  `NO_LAZY_FETCH` renamed to a name git does not read, it fetches and
  exits 0; neither name is left in `os.environ`.
- `pin_values_unfetched` with two promisor remotes names both and gives
  one cure each, in the reader's words, with the reader's refusal as the
  cause.
- `lazy_fetch_off`, `promisor_remotes` (10 configs and a missing folder),
  `refetch_command` and `_remote_named`, one by one.

Rows needing git to honour `GIT_NO_LAZY_FETCH` ask it first and skip
where it is ignored. 36 pass at head; on 961640c the 6 controls pass and
the other 30 fail.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The clone is named by its resolved absolute path in the refusal's remediation, not as typed; a row with a relative --pin-source kills the mutant that names it as typed.

Lane: openreposhape-1 (openRepoShape-1)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… and raises nothing (#1182)

A remote.<name>.promisor of 'maybe' makes git config --type=bool --get-regexp exit 128 with nothing written (git 2.43 collects every value before it writes one), so only the partialclonefilter names a remote. The row passes with or without the returncode check in _config_listed: no config makes git 2.43 write part of a listing and then fail, so that check stays a named survivor.

Lane: openreposhape-1 (openRepoShape-1)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Lane: openreposhape-1 (openRepoShape-1)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Uses of the API

Route scaffold pin reads through the new reader and pass the scaffold’s refusal-remediation wording.

  • scaffold-project.py L179-185, L1330-1332, L1573-1583

Implementation

Add a no-lazy-fetch pin reader that preserves the original refusal, identifies partial-clone promisor remotes, and gives a commit-specific fetch remedy; carry the unreadable commit on the underlying refusal so that remedy can name it.

  • scripts/shape_materialize.py L3658-3662, L4175-4357 (+3 small edits)

UI

Explain partial-clone pin-source behavior and the Git-version-dependent no-fetch guarantee in the scaffold’s command-line help.

  • scaffold-project.py L459-467

Documentation

Document the partial-clone behavior and the Git-version condition in the CLI reference.

  • docs/cli.md L411-418

Tests

Add coverage for partial-clone refusals, no-fetch behavior, commit-specific remedies, promisor-remote handling, and environment restoration.

  • tests/test_scaffold_partial_pin_source.py L1-474

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-1, 2026-10-23T20:50:54Z) r1223, lane 1's independent reviewer (not the writer), reviewed #1223 at 77687d68: NOT READY, with no MUST, one SHOULD and four NITs. The fix itself holds. No run fetched into a partial-clone --pin-source, whether a dry run or a real one: 0 upload-pack runs and no new pack. Every control reads as it does on base, and 40 of 41 mutants are killed. M8 is equivalent on git 2.43, as the body says.

The full review

Review of PR #1223 (r1223, first independent review), head 77687d685

Verdict: NOT READY. One SHOULD finding and four NITs, no MUST. The fix itself is right: no run fetched into a partial-clone --pin-source, --dry-run or real run, and every control reads as on base. The SHOULD is about the remedy the refusal prints for one of the two forms the PR names.

Review checkout: /workspace/projects/openRepoShape-worktrees/l1-r1223, detached at 77687d68531650735b1ee1c34cea03ccdffd8f0a, still clean. Scratch folder: S=/workspace/projects/openRepoShape-worktrees/_lane1-scratch/r1223 (clones base at ef619c74a, and mut/mut2 at head). Every run used the probe environment (stub gh first on PATH, GH_TOKEN=bogus-r1223, empty GH_CONFIG_DIR, GIT_CONFIG_GLOBAL=/dev/null, GIT_SSH_COMMAND=false, EMAIL, no LANES_LANE), with git 2.43.0 and CPython 3.12.3.

Findings

SHOULD 1: for a partial clone that lacks the pinned commit, the printed cure does not make it readable. It also re-downloads every object, and it replaces the old git fetch --all advice, which did work where a fetched branch holds the commit.

  • Where: scripts/shape_materialize.py:4213-4219 (refetch_command) and :4264-4266 (the remediation). Also tests/test_scaffold_partial_pin_source.py:207, which asserts git fetch --all is absent for both forms, and :231, where only the tree:0 form ever runs the printed cure.
  • Evidence: $S/probe_text.py and $S/probe_commit_cure.py at head. The fixture is the PR's own: a --single-branch clone of main, pin on side. "state" is (upload-pack runs, packs, .promisor files, files under objects/).
    == lacks-commit cure 'fetch --refetch --no-filter origin': fetch rc=0 state after cure (1, 1, 1, 7) -> scaffold rc=2 ... REFUSED pin-source-unreadable
    == lacks-commit cure 'fetch --all': fetch rc=0 state after cure (1, 1, 1, 4) -> scaffold rc=2 ... REFUSED pin-source-unreadable
    == lacks-commit cure 'fetch origin <side>': fetch rc=0 state after cure (1, 2, 2, 8) -> scaffold rc=0
    tree0         refused rc=2; git fetch --refetch --no-filter origin <commit>   rc=0 -> re-run rc=0
    lacks-commit  refused rc=2; git fetch --refetch --no-filter origin <commit>   rc=0 -> re-run rc=0
    
    A blob:none clone that is merely behind (the pinned commit pushed to main after the clone) is cured by both commands. The printed one refetches every blob of history; git fetch --all keeps partialclonefilter=blob:none and adds one small pack.
  • Why it is not a MUST: the remedy's qualifier ("where a branch it fetches holds the pinned commit") keeps the text true, and the refusal offers other ways out (a full clone, or gh api). But the cure is the point of the PR, and the issue only asked for a cause to be named for the tree:0 form.
  • Fix: put the pinned commit in the cure, git fetch --refetch --no-filter <remote> <commit>. Measured above, it cures both forms. A promisor remote serves objects by id by definition, since that is how a lazy fetch asks. Or branch on git cat-file -e <commit> under lazy_fetch_off: name git fetch <remote> <commit> where the commit is absent, and the refetch only where the commit is present and its trees are not. Then add a row that runs the printed cure on lacks-commit, as :231 does for tree0.

NIT 1: the help says "the scaffold never fetches into it" without condition.

  • Where: scaffold-project.py:459-464 and docs/cli.md:411-415.
  • Evidence: the body's own Known limits: "A git that ignores GIT_NO_LAZY_FETCH ... fetches as before".
  • Fix: qualify it, e.g. "with a git that reads GIT_NO_LAZY_FETCH", then regenerate docs/cli.md.

NIT 2: the body measured base against head at 961640c6, but the PR's merge-base is ef619c74a.

  • Evidence: git diff --stat 961640c6 ef619c74a -- scaffold-project.py shows 198+/27-. I re-measured at the true merge-base: base 32 failed, 6 passed, head 38 passed, identical to the body.
  • Fix: name ef619c74a as the measured base.

NIT 3: Why says "#1190 keeps its own _lazy_fetch_off and _pins_read_unfetched", which reads as if they are on main.

NIT 4: Table row 3 ("tree:0 checked out | exit 0, 0 runs") has no row in the new file. KINDS has no checked-out tree:0.

  • Evidence: it does hold. $S/probe_rows.py gives base tree0-checkout rc=0 state (0, 3, 3, 12) -> (0, 3, 3, 12), and the same on head.
  • Fix: add "tree0-checkout": (("--filter=tree:0",), "main") to KINDS and to the controls' parametrize.

Mutant table

41 mutants of my own, one at a time, in a clone of the head ($S/mut, $S/mut2). Each ran pytest -x on the new file, S4 also with tests/test_cli_reference.py, and S5 also with test_adopt_pins.py::test_both_tools_read_a_pin_with_one_implementation and test_scaffold_leg_path_collisions.py. The file was restored in finally and its blob checked equal to HEAD's after each one. Both clones ended clean.

40 of 41 killed, 1 survivor (M8).

id mutant result (first failing row)
S1 _declaration reads with declared_pin_values again killed (refused[tree0-dry-run])
S2 reader="the tool" killed (refused[tree0-dry-run])
S3 nothing_made="" killed (refused[tree0-dry-run])
S4 help sentences dropped killed (test_cli_reference)
S5 declared_pin_values not imported into the scaffold killed (test_adopt_pins one-implementation)
M1 variable set to "0" killed (refused[tree0-dry-run])
M2 prior value forgotten killed (lazy_fetch_off[0])
M3 an unset variable not removed killed (in-process)
M4 a prior value removed, not restored killed (lazy_fetch_off[0])
M5 restored only on a normal exit killed (in-process)
M6 name hard-coded, not read from NO_LAZY_FETCH killed (in-process)
M7 _config_listed raises OSError killed (folder not there)
M8 a failed run's stdout returned (writer's M08) SURVIVED
M9 -z dropped killed (refused)
M10 git config run in the process cwd killed (refused)
M11 --type=bool dropped killed (promisor-yes)
M12 any promisor value counts killed (promisor-false)
M13 extensions.partialclone kept in config order killed (named-last)
M14 partialclonefilter alone not a promisor killed (filter)
M15 or changed to and killed (refused)
M16 no dedupe killed (refused)
M17 the named remote not moved last killed (named-last)
M18 the named remote first killed (named-last)
M19 subsection cut at the first dot killed (dotted-name)
M20 extensions.partialclone dropped from PROMISOR_KEYS killed (named-last)
M21 _remote_named ignores backticks killed (refetch[a-backtick])
M22 _remote_named ignores printability killed (refetch[unprintable])
M23 refetch_command pastes an option killed (an-option)
M24 refetch_command does not quote killed (spaced)
M25 refetch_command ignores backticks killed (a-backtick)
M26 no lazy_fetch_off (the fix undone) killed (refused)
M27 every refusal code asked about killed (folder in a partial clone)
M28 clone named as typed (writer's M37) killed (relative pin source)
M29 a clone with no promisor remote still called partial killed (full clone lacking the commit)
M30 from None killed (two promisor remotes)
M31 only the first remote's cure killed (two promisor remotes)
M32 only the first remote named killed (two promisor remotes)
M33 reader hard-coded in the detail killed (two promisor remotes)
M34 the reader's own detail dropped killed (two promisor remotes)
M35 nothing_made dropped killed (refused)
M36 PIN_SOURCE_UNREADABLE misspelt killed (refused)

M8 is equivalent on git 2.43, as the body says. $S/probe_m08.py ran both listings _config_listed makes over many configs. Not one wrote output and then failed:

  • a bad boolean, in all 6 orders, and in local, included, global, GIT_CONFIG_COUNT and GIT_CONFIG_PARAMETERS scope: bool rc=128 stdout=0B fatal: bad boolean config value 'maybe';
  • a bad config line: rc=128 stdout=0B for both listings;
  • a valueless extensions.partialclone: git itself segfaults (rc=-11 stdout=0B).

Measurements

  • Base against head (new file only). Head: 38 passed, rc 0. Base ef619c74a with the file copied in: 32 failed, 6 passed. The 6 are the 4 controls, the full clone lacking the commit and the folder row, all of which pass on both. The refusal, relative-path and cure rows fail on base by behaviour (assert 0 == 2, and no cure found). The unit rows fail with AttributeError, since the helpers are new.
  • No fetch ($S/probe_nofetch.py, which counts upload-pack runs, packs and .promisor files):
    • Base, every short form (tree0, lacks-commit, tree0-bare, behind), dry and real run: rc=0 runs 0->1 packs 1->2 promisor 1->2.
    • Head, the same forms: rc=2 runs 0->0 packs 1->1 promisor 1->1 made=[].
    • Accepted runs (blobnone, full) on both: rc=0 runs 0->0.
    • After the cure, a dry run and a real run left objects/ byte-identical. An earlier 13 to 10 file change came from git's background gc after the cure, not from the scaffold.
  • 3.14-like shim ($S/shim/sitecustomize.py; it was shown to load, and turns a PermissionError into False): the new file gives 38 passed.
  • Docs and codes:
    • scripts/render-cli-reference.py --check gives [ok] docs/cli.md is what the generator produces.
    • test_path_guard_hygiene, test_agents_md_codes, test_cli_reference and test_repo_hygiene give 220 passed. test_no_auto_maintenance gives 58 passed, 2 skipped (the probe environment's GIT_CONFIG_GLOBAL skip).
    • The PR reuses pin-source-unreadable and adds no code. The code test scans only AGENTS.md, so nothing new needs listing.
  • With main: main is 12 commits past ef619c74a; 50ce8ab touches scaffold-project.py and 0d76e4c touches shape_materialize.py. git merge-tree is clean (tree da415ced8). On that tree, the new file plus hygiene, cli-reference and codes give 229 passed, and the render check is ok.
  • Body claims checked and true:
    • exactly one closing form (Closes #1182); closingIssuesReferences = [1182]; title is 225 characters;
    • the stacking statement (merge-base ef619c74a);
    • table rows 1, 2 and 4 (stderr byte-identical on base and head), and row 3 (see NIT 4);
    • 38 rows: 11 promisor_remotes configs, 5 refetch_command names, 4 _remote_named names;
    • 53 + 9 = 62 gate files; collect-only gives 5692 tests collected, doctor 448, test_repo_hygiene 101;
    • the totals arithmetic (5687+5; 445+3; 6132+8; 6454+10; 6353 distinct);
    • the cited skip reasons;
    • scaffold.declared_pin_values is read by test_adopt_pins.py:1818 and test_scaffold_leg_path_collisions.py:438;
    • the promisor rule matches shape-doctor.py line for line.

Not covered

Lane: openreposhape-1 (openRepoShape-1)

Brett Heap and others added 4 commits October 23, 2026 21:16
Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t by its id, so a blob:none clone whose branches lack it is made readable too (#1182)

The printed cure was `git fetch --refetch --no-filter <remote>`, which
refetches only what the clone's branches hold: a `blob:none` clone of
`main` pinned on `side` was still `pin-source-unreadable` after it
(r1223 on #1223). Now `git fetch --refetch --no-filter <remote> <commit>`,
the commit the reader could not read, which `pin_digest_from_source`'s
refusal now carries. A row runs the printed cure on that form and re-runs
the scaffold to exit 0, as the `tree:0` row does.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nothing into a partial clone on a git that honours GIT_NO_LAZY_FETCH, and that an older git fetches (#1182)

"the scaffold never fetches into it" held with no condition, where the
PR's own known limits say a git that ignores `GIT_NO_LAZY_FETCH` fetches
as before (r1223 on #1223, NIT 1). The sentence is #1190's: on a git that
honours it (2.45 or later, or a security release from 2.39.4 on).
docs/cli.md regenerated with scripts/render-cli-reference.py.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ch (#1182)

The body's table names a checked-out `tree:0` clone (exit 0, no
`upload-pack`), and no row held it (r1223 on #1223, NIT 4). It is now a
kind, `tree0-checkout`, and a control row beside the full and
`blob:none` clones.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@brettheap brettheap changed the title scaffold-project.py: a partial-clone --pin-source short of the pinned commit or its trees is pin-source-unreadable, named a partial clone with git fetch --refetch --no-filter <remote>, and no longer fetched into (#1182) scaffold-project.py: a partial-clone --pin-source short of the pinned commit or its trees is pin-source-unreadable, named a partial clone with git fetch --refetch --no-filter <remote> <commit>, and no longer fetched into (#1182) Oct 23, 2026
@brettheap

brettheap commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor Author

(lane openRepoShape-1, 2026-10-23T21:57:04Z) r1223b, lane 1's independent re-checker (not the writer), re-checked #1223's fix round at 686a2525: READY, with no MUST, no SHOULD and two NITs that do not block.

The full re-check

Re-check of PR #1223 at 686a25253010d8ed (r1223b, answering r1223's review of 77687d685)

Verdict: READY. r1223's SHOULD-1 and NIT-1 to NIT-4 are all fixed and measured here. I found no MUST and no SHOULD. I did find two NITs of my own (below), which do not block.

  • Setup: review checkout /workspace/projects/openRepoShape-worktrees/l1-r1223b, detached at 686a25253010d8ed9f8c263d5b6cacdb574130c7, clean.
  • Scratch: S=/workspace/projects/openRepoShape-worktrees/_lane1-scratch/r1223b. It holds base (shared clone, now detached at 961640c68 with the new test file untracked) and mut (clone at head, clean).
  • Environment: every run used the probe environment (stub gh first on PATH, GH_TOKEN=bogus-r1223b, empty GH_CONFIG_DIR, GIT_CONFIG_GLOBAL=/dev/null, GIT_SSH_COMMAND=false, EMAIL, no LANES_LANE, TMPDIR in scratch), git 2.43.0, CPython 3.12.3.
  • Disk rule: df -h / and df -i / were checked before each pytest call by $S/gate.sh. Free space was 18G to 71G and inodes 86% to 88%. No call ran with fewer than 5G free or inodes above 90%.
  • gh: read-only GETs only.
  • State at LAST STEP: no run of mine is live (pgrep -fa r1223b is empty), so there is no PID to name. The two background runs, mergeA and mergeB, finished, and their logs are $S/logs/mergeA.log and $S/logs/mergeB.log.

1. SHOULD-1: the cure names the pinned commit

Source. scripts/shape_materialize.py:3661 sets refusal.commit = commit in pin_digest_from_source. refetch_command(remote, commit) at :4289 prints `git fetch --refetch --no-filter <remote> <commit>`. :4340 builds cures = ", then ".join(...), one per promisor remote. A remote name that does not paste is named in words, and the commit goes with it. The commit is parse_pin's lowercased 40 hex digits (:3604), so it pastes safely. Only pin_digest_from_source raises pin-source-unreadable on the declared_pin_values path, so exc.commit is always set.

Printed cure, run at head.

  • python3 -I /workspace/projects/openRepoShape-worktrees/_lane1-scratch/r1223/probe_nofetch.py $T $S/pn-head head. It extracts the cure from the refusal, runs it as printed, then re-runs the scaffold. Log: $S/logs/probe_nofetch_head.log.
    head tree0                dry rc=2 runs 0->0 packs 1->1 promisor 1->1 made=[]  REFUSED pin-source-unreadable
         cure: 'git fetch --refetch --no-filter origin 5f1a52cf...' -> state (2, 2, 2, 13)
    head tree0+cure           dry rc=0 runs 2->2
    head lacks-commit         dry rc=2 runs 0->0 packs 1->1 promisor 1->1 made=[]
         cure: 'git fetch --refetch --no-filter origin 62f799de...' -> state (1, 1, 1, 10)
    head lacks-commit+cure    dry rc=0 runs 1->1
    head tree0-bare+cure      dry rc=0 runs 1->1
    head behind+printed       dry rc=0 runs 1->1   (filter=blob:none kept)
    
    runs N->N means the scaffold's re-run ran no upload-pack.
  • python3 -I r1223/probe_commit_cure.py $T $S/cc-head. The earlier cure without the commit still fails for lacks-commit:
    tree0         ... origin                 rc=0 -> re-run rc=0
    tree0         ... origin <commit>        rc=0 -> re-run rc=0
    lacks-commit  ... origin                 rc=0 -> re-run rc=2 REFUSED pin-source-unreadable
    lacks-commit  ... origin <commit>        rc=0 -> re-run rc=0 state (1, 1, 1, 10)
    

Row. test_the_cure_as_printed_makes_the_clone_readable[lacks-commit] exists and passes. So does its [tree0] twin. Each row pulls the cure out of the refusal with re.search, runs it, re-runs the scaffold for real, checks the origin's digest, and checks the upload-pack count equals the count after the cure.

Mutant MA (pasted cure drops the commit), applied in $S/mut:

MA: rc=1 9 failed, 31 passed
  ...cure_as_printed_makes_the_clone_readable[lacks-commit]
  E assert 2 == 0   (the scaffold, re-run after the printed cure, still refuses)
  restored scripts/shape_materialize.py: blob equals HEAD (c295e89d19 vs c295e89d19); status=clean

[tree0] passes under MA, since the commit-less cure works for that form. Only [lacks-commit] catches it by behaviour. The other 8 failing rows are text rows: the 4 refusal rows, the relative-path row, the two-remote row and 2 refetch_command rows.

2. NIT-1: the help qualifier

3. NIT-2, NIT-3, NIT-4

4. The merge of main brought no change to the PR's own lines

  • git merge-tree --write-tree 77687d685 e04826db4 is da415ced80b0.... git rev-parse 5d90b9edb^{tree} is da415ced80b0..., and its parents are 77687d685 and e04826db4. git merge-base 686a25253 origin/main is e04826db4, which is still origin/main.
  • git diff --stat e04826db4 686a25253 shows exactly 4 files: docs/cli.md, scaffold-project.py, scripts/shape_materialize.py, tests/test_scaffold_partial_pin_source.py. The round's three commits (70babae7b, 4fc047abb, 686a25253) touch only those four, and the merge adds no file beyond the 12 main commits.
  • $S/interdiff.py compared the net +/- line multisets per file: (reviewed delta ef619c74a..77687d685) plus (round 5d90b9edb..686a25253) against (PR vs main e04826db4..686a25253):
    docs/cli.md                               now(+8/-1)    reviewed(+5/-1)    round(+6/-3)   unexplained 0
    scaffold-project.py                       now(+28/-7)   reviewed(+25/-7)   round(+7/-4)   unexplained 0
    scripts/shape_materialize.py              now(+190/-1)  reviewed(+175/-0)  round(+35/-21) unexplained 0
    tests/test_scaffold_partial_pin_source.py now(+474/-0)  reviewed(+451/-0)  round(+67/-44) unexplained 0
    TOTAL unexplained 0
    
    The one - line in shape_materialize.py that the reviewed delta lacks is raise Refusal( becoming refusal = Refusal( in pin_digest_from_source, which is the round's own change.
  • Main touched scaffold-project.py (+158/-) and shape_materialize.py (+126/-) in this range. Beyond the text merge, I ran the nearby suites at head:
    mergeA: test_pin_source_top_level, test_pinned_copy_text, test_pin_source_env_collisions, test_chain_pin_sources, test_pin_annotated_tag
            355 passed in 151.22s
    mergeB: test_scaffold_pin_and_reuse, test_scaffold_pin_collisions, test_scaffold_referent_chain_links, test_scaffold_reuse_seeded_legs
            286 passed in 133.67s
    

5. Claims in the body

All of these were measured and are true.

  • Closing form and metadata: exactly one closing form, Closes #1182. A regex over body and title finds only that. closingIssuesReferences is [1182]. Issue refs in the body are shape-doctor.py: run from a partial clone of the standard, the shape currency row fetches what the clone lacks, and with its remote out of reach calls each copy the standard changed since the pin both, so a doctor that fetches nothing fetches, and offline says DRIFTED of copies nobody edited #683, scaffold-project.py: a partial-clone --pin-source lacking the pinned commit or its trees is fetched into over the network #1182, adopt-project.py: plan runs with GIT_NO_LAZY_FETCH=1, refuses a partial-clone --source that lacks objects as source-partial-clone, and names a partial --pin-source it could read only by fetching and the fetch that makes it whole (#1162) #1190. The title is 234 characters. The milestone is v1.2.1 and the PR is a DRAFT. Brett Heap's ruling of 2026-10-21T10:32:04Z is named. The body ends with the Lane: line, a blank line, then the 🤖 line.
  • Table: the four rows match the base and head probes above.
  • Rows: 40 rows, and the breakdown matches the file: 4 refusal, 1 relative, 2 cure, 5 control, 1 full-lacks, 1 folder, 1 in-process, 1 two-remote, 3 lazy_fetch_off, 11 promisor_remotes configs plus 1 folder-missing, 5 refetch_command, 4 _remote_named.
  • Base against head: the new file copied into $S/base at ef619c74a gives 33 failed, 7 passed. The 7 passing are the 5 controls (full, blobnone, blobnone-checkout, tree0-checkout, tree0-cured), the full clone lacking the commit, and the folder row. The two cure rows fail at assert printed. The refusal rows fail at assert 0 == 2. The unit rows fail with AttributeError. At main e04826db4 the same 33 rows fail. At 961640c68, the controls alone give 5 passed.
  • Round tests at head:
    • New file: 40 passed in 14.75s.
    • Under r1223's shim: 40 passed. The shim was shown to load (Path.is_file prints as _wrap.<locals>.guarded).
    • test_agents_md_codes, test_cli_reference and test_repo_hygiene: 171 passed.
    • test_path_guard_hygiene and test_no_auto_maintenance: 179 passed, 2 skipped.
    • test_adopt_pins::test_both_tools_read_a_pin_with_one_implementation and test_scaffold_leg_path_collisions: 105 passed.
    • test_pin_source_unreadable: 81 passed.
  • Mutants of the round's lines:
    • Results: 10 of 10 killed, from $S/mutate.py. The blob equals HEAD after each and both clones were clean at the end.
    • The writer's two, MA and MB, reproduce: MA killed by 9 rows, MB by the 3 refetch_command rows that say it in words.
    • My other mutants:
      • MC abbreviates refusal.commit to 12 characters: 8 rows.
      • MD cures only the first remote: 1 row.
      • ME drops --refetch from the pasted cure: 8 rows.
      • MF drops --no-filter from the pasted cure: 8 rows.
      • MG drops "(git 2.36 or later)": 5 rows.
      • MH changes ", then " to " and ": 1 row.
      • MI removes refusal.commit: 9 rows.
      • SA reverts the help sentence: 5 test_cli_reference.py rows.
    • The body's 42, 41-killed and M08-survivor bookkeeping is consistent: A is 19/20, B is 21/22, and M37 was killed later.
  • Known limits: after the printed cure objects/ holds 1 pack and 10 files, and after git fetch --all it holds 2 packs and 8 (head behind+printed (1,1,1,10), behind+fetch--all (1,2,2,8)). (git 2.36 or later) is printed. refetch_command's docstring says the same.
  • The gate it says it did not re-run: the body says the 62-file gate stands at 77687d685. I did not re-run it either (see below).

Findings

No MUST, no SHOULD. Two NITs of mine.

NIT A: a reviewer id sits in shipped code.

NIT B: refusal.commit is an attribute Refusal does not declare.

  • Where: set at scripts/shape_materialize.py:3661, read as exc.commit at :4340. Refusal.__init__ (scripts/repo_shape.py:171) takes only code, detail, remediation.
  • State today: the contract holds, because only pin_digest_from_source gives pin-source-unreadable on this path. A comment says so, and the tests cover it.
  • Risk: a second raiser of that code, or the follow-up that has plan call pin_values_unfetched, would hit AttributeError with nothing to catch it early.
  • Fix: read it with getattr(exc, "commit", None) and print a commit-less cure when it is missing. Or add commit: str = "" to Refusal. Not blocking.

Measurement, not a finding. The body's limit "a remote that lacks the commit was not measured" can now be stated. Probe $S/probe_tworemotes2.py: a tree:0 clone with two promisor remotes, the second serving an unrelated repo.

  • The cure for the remote that lacks the commit exits rc=128 fatal: ... not our ref <commit>. The other remote's cure exits 0 and leaves the scaffold's re-run at rc=0.
  • The same holds with the remotes in either order.
  • So "<cure 1>, then <cure 2>" is each remote that holds the commit, not a sequence that needs both. The body can say that. One probe artifact: after a failed fetch the clone was already readable, because git's own fetch lazily fetched from the other promisor remote.

What I did not cover

Lane: openreposhape-1 (openRepoShape-1)

… not a reviewer's id (#1182)

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@brettheap

Copy link
Copy Markdown
Contributor Author

(lane openRepoShape-1, 2026-10-23T22:02:54Z) Lane 1's delta check of f50b4723: NIT A is fixed, and READY carries to f50b4723 as the new H0.

Lane: openreposhape-1 (openRepoShape-1)

@sonarqubecloud

sonarqubecloud Bot commented Nov 8, 2026

Copy link
Copy Markdown

@brettheap
brettheap marked this pull request as ready for review November 8, 2026 14:17
@sourcery-ai

sourcery-ai Bot commented Nov 8, 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 6 days and 23 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@brettheap
brettheap merged commit 11560eb into main Nov 8, 2026
5 checks passed
@brettheap
brettheap deleted the fix/1182-scaffold-partial-pin-source branch November 8, 2026 14:17
brettheap pushed a commit that referenced this pull request Nov 8, 2026
Main 0d5704b is five commits past #1144's squash b1f45fa (#1169, #1223,
#1166, #1133, #1104). This is the third of the three merges that restack
#1159 after #1144 landed.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Nov 8, 2026
…says a full name that is no pattern takes the one ref git completes it to, which may be a branch, where it said any other source names no branch (#1238) (#1244)

#1238 is a wording NIT that the review of #1235 (#1230) found in the code: NIT 4 of rv1235's first review, and NIT 2 of its re-check. The docstring of `gives_a_branch_another_name` in `scripts/shape_materialize.py` ended "ANY OTHER SOURCE NAMES NO BRANCH", but git completes a source that is a full name and no pattern, and completes `refs/h` to the branch `refs/heads/refs/h` where the remote has one. The sentence now says what git does with such a source, as an open list ("such as"), and where the clash is. A reader of the docstring is no longer told that a source outside `refs/heads/` is never a branch.

Wording only, in one docstring of one file: 9 lines added, 3 removed. No code, no row, no other file. The file's syntax tree with every docstring dropped is the same as main's.

The sentence is at `scripts/shape_materialize.py:1720-1723`, the end of the docstring of `gives_a_branch_another_name` (line 1671):

```
1720:     BRANCH REACHES). A shorter start, such as `refs/*` or `*`, can name a
1721:     tag, and that clause has left it out first. ANY OTHER SOURCE NAMES NO
1722:     BRANCH, though a refspec from one can still put a ref on a branch's
1723:     name: `origin_fetch_refspecs` says where (WHAT CAN STILL CLASH).
```

It is true of a source in another namespace such as `refs/pull/7/head`. It is not true of every other source. A source that is a full name and no pattern takes the one ref git completes the name to on the remote: for `refs/h`, `refs/h` itself, the branch `refs/heads/refs/h`, the tag `refs/tags/refs/h`, `refs/refs/h` or `refs/remotes/refs/h`, and where several exist git takes the exact ref over a tag over a branch. Where the remote has the branch, the source is a branch. The code is right: `gives_a_branch_another_name("refs/h", ...)` is False, because the source has no `*` and does not start with `refs/heads/`, so the refspec is carried. What fails afterwards is the clash the docstring's own next clause names. Only the words were untrue.

Measured on this branch's base, with git 2.43.0 (`/usr/bin/git`) and git 2.47.1, which gave the same answers on every row. Local bare remotes, `GIT_CONFIG_GLOBAL=/dev/null`, `GIT_CONFIG_NOSYSTEM=1`, `GIT_SSH_COMMAND=false`. rv1235's probe scripts were run again here (copied unchanged, new output folders), and their logs are identical to rv1235's. The fetch was `+refs/heads/*:refs/remotes/origin/*` plus the refspec of the row, and the remote had `main` and `hy`:

```
the remote has                    refspec                          result
branch refs/heads/refs/h          +refs/h:refs/remotes/origin/hy   128 Cannot fetch both refs/heads/hy and refs/heads/refs/h to refs/remotes/origin/hy
tag refs/tags/refs/h              +refs/h:refs/remotes/origin/hy   128 Cannot fetch both refs/heads/hy and refs/tags/refs/h to refs/remotes/origin/hy
exact ref refs/h (update-ref)     +refs/h:refs/remotes/origin/hy   128 Cannot fetch both refs/heads/hy and refs/h to refs/remotes/origin/hy
refs/refs/h or refs/remotes/refs/h  +refs/h:refs/remotes/origin/hy 128, the same message naming that ref
each of those five refs, alone    onto origin/not-a-branch         0, holds that ref's commit
branch refs/heads/refs/h          onto origin/refs/h               0 (the branch's own name: no clash)
refs/pull/7/head                  onto origin/main                 128 Cannot fetch both refs/heads/main and refs/pull/7/head to refs/remotes/origin/main
branch refs/heads/main            onto origin/main                 0
```

So a name with no `*` can be a branch that its spelling does not show, and the clash is a ref that is not that branch put on a branch's name, which is what the second half of the sentence has to say. "ANY OTHER" was wrong in a second way: a carried refspec from a source that IS the branch does not clash onto that branch's own name.

The docstring's last sentence, now lines 1721-1729:

```
    tag, and that clause has left it out first. ANY OTHER SOURCE TAKES NO
    BRANCH BY A PATTERN, and a full name that is no pattern, such as
    `refs/h`, takes the one ref git completes it to on the remote: that ref
    itself, or one such as the branch `refs/heads/refs/h` or the tag
    `refs/tags/refs/h` (measured, git 2.43 and 2.47.1). Such a name can
    stand for a branch its spelling does not show, so it is not left out
    here. A refspec from any such source can still put a ref on a branch's
    name, if the ref is not that branch itself: `origin_fetch_refspecs`
    says where (WHAT CAN STILL CLASH).
```

- **"Takes no branch by a pattern"** holds for every source this sentence covers. Git matches a pattern against each ref's whole name, and a ref under `refs/heads/` starts with the part before the `*` only where that part is a start of `refs/heads/` or is under it, the two cases the function reads before this sentence.
- **The list is open** ("one such as"): it names the exact ref, the branch and the tag, and the rows above show two more completions (`refs/refs/h`, `refs/remotes/refs/h`), so no reader takes the three as all.
- **"So it is not left out here"** is what the code does: `gives_a_branch_another_name` is False for `refs/h` onto `origin/hy`, onto `origin/refs/h`, for `refs/pull/7/head` onto `origin/main`, and for the pattern `refs/pull/*/head`, and `origin_fetch_refspecs(["+refs/h:refs/remotes/origin/hy"])` returns it carried. It is True for `refs/heads/main` onto `origin/hy`, as before.
- **"If the ref is not that branch itself"** is the condition the rows show: the clash is two different refs on one name, a branch's.

The checks the issue's Verify lists:

- **The diff is only that docstring.** The diff has one hunk, inside the docstring, which spans lines 1672-1724 on main and 1672-1730 here. The file's tree with every docstring dropped (module, class and function: 168 each side) is equal on main (`50869f384`) and at this head under `python3 -I`, `ast.dump`: 380120 characters of dump on both sides. A control that renames `gives_a_branch_another_name` on the head side gives 380121 and DIFFERENT, and the same trees with the docstrings kept differ (520956 against 521366), so the check can fail. Python 3.12.3. The check compares two dumps made by one interpreter and asserts no text that depends on the version.
- **`git grep -n 'ANY OTHER SOURCE NAMES NO$' -- scripts/`** finds nothing at this head. On main it finds `shape_materialize.py:1721`. With any case and no line end, `git grep -n -i 'other source names no'` also finds nothing here, and nothing but that line on main.
- **No added line is over 79 columns or holds a non-ASCII character.** 9 lines are added, the longest is 75 columns, and none has a tab or trailing space. The file's own width is unchanged: 20 lines over 79 columns (longest 118) and 90 lines with a non-ASCII character, as on main, none of them mine.
- **No test, `README.md`, `docs/` page or `AGENTS.md` line pins the sentence.** The issue's grep holds at this head.

The issue asks whether `shape_materialize.py:1874` (now 1880, in the docstring of `origin_fetch_refspecs`) and `bump-leg.py:1165` (in `_leg_fetch_refspecs`) want the same change. Both paragraphs were read, and both are left as they are:

```
shape_materialize.py:1880:     WHAT CAN STILL CLASH is a refspec carried whose source names no branch,
bump-leg.py:1165:     whose source names no branch, onto a name a branch of the remote has
```

1. **They define a shape by its examples and say nothing about what git completes a name to.** Each goes on at once to the pull requests (`origin/pr/` where a branch `pr/7` is, and `+refs/pull/7/head:refs/remotes/origin/main` beside a branch `main`), and neither names `refs/h`. They were not the sentence that told a reader a source is never a branch.
2. **"Names no branch" is spelling there, as it is in the sentence the function's docstring opens with.** "A SOURCE UNDER `refs/heads/` NAMES BRANCHES" is true by spelling too: `can_name_a_tag`'s docstring measures that `+refs/heads/zz` took the tag `refs/tags/refs/heads/zz` where the remote had no branch `zz`. The sentence changed here now says outright that the spelling of a name with no `*` does not show what it stands for, so the docstring that defines the class carries the caveat the two borrowers need.
3. **The mechanism they state is the one that fails `refs/h`:** "wherever a name it writes is a branch's". The `origin_fetch_refspecs` paragraph ends with why such a refspec is carried at all: "Which names the remote's branches have is not known from its refspecs, and left out, what such a refspec keeps would be pruned on every run". That holds for `refs/h` word for word.
4. **The cost of leaving them is one reading:** a reader who takes "names no branch" in git's sense meets the single case `refs/h` beside a remote branch `refs/heads/refs/h`. If the review wants a word there, it is a few words in each place, and no open PR touches either paragraph (merge-trees below), so it can be a fix round.

None of either. No row is added or changed and no behaviour moved: the syntax tree outside the docstring is main's, so there is nothing for main to fail and nothing to mutate. `gives_a_branch_another_name` returns what it returned for every case in the table above (called in process at this head; the syntax tree outside the docstrings is main's).

All through the lane's runner `run9.sh` (stub `gh` first on PATH, `GIT_SSH_COMMAND=false`, `GIT_CONFIG_GLOBAL=/dev/null`), on the committed head `36ec589a6` with the tree clean (`dirty=0`), as one run of seven files at a time: `tests/test_pinned_copy_text.py`, `tests/test_path_guard_hygiene.py`, `tests/test_repo_hygiene.py`, `tests/test_agents_md_codes.py`, `tests/test_cli_reference.py` (the hygiene five), `tests/test_family_bump_fetch_refspecs.py` and `tests/test_bump_leg_fetch_refspecs.py`.

- **The seven files, git 2.43.0** (`/usr/bin/git`): 504 passed in 469.44s (47 `test_agents_md_codes.py`, 68 `test_bump_leg_fetch_refspecs.py`, 23 `test_cli_reference.py`, 57 `test_family_bump_fetch_refspecs.py`, 121 `test_path_guard_hygiene.py`, 87 `test_pinned_copy_text.py`, 101 `test_repo_hygiene.py`; the counts are from `--collect-only -q` on the same head and add up to 504). Log `v131/n1238/gate-g243.log`.
- **The seven files, git 2.47.1** (first on PATH, `git --version` printed into the log): 504 passed in 714.00s. Log `v131/n1238/gate-g247.log`.
- **`-k carried-refs-h-not-a-pattern`** over `tests/test_family_bump_fetch_refspecs.py` and `tests/test_bump_leg_fetch_refspecs.py`: 2 passed, 123 deselected, on 2.43.0 and on 2.47.1 (`run-k-g243.log`, `run-k-g247.log`).
- Both runs start with `dirty=0`. Python 3.12.3 (CI runs 3.14); nothing asserts text that depends on the version.

The measured git behaviour above comes from the probe scripts, not the test files. `-k carried-refs-h-not-a-pattern` over the two fetch-refspec files is part of those runs.

`git merge-tree --write-tree origin/main HEAD` exits 0, with tree `9d874bcf2caf`, equal to this head's tree, against main `50869f384` (the merge base). Against the head of each open PR that touches `scripts/shape_materialize.py` or `scripts/bump-leg.py` (read from `gh pr list --state open --limit 100 --json number,headRefName,headRefOid,files`, 52 open PRs at the last read, 7 of them touch one of the two files), `git merge-tree --write-tree HEAD <head>` exits 0 and the merged tree still holds the new sentence and not the old one:

```
#1223 f50b472  exit 0   #1207 6fa1edd  exit 0   #1160 0068f5a  exit 0   #1131 55c30f2  exit 0
#1118 2307036  exit 0   #1105 b28f40d  exit 0   #1104 de89aa8  exit 0
```

Main moved once while this was gated, to `4829418f0` (`adopt-project.py`, `docs/cli.md` and a new test file: none of the files this change or its runs touch), and `git merge-tree --write-tree origin/main HEAD` against it also exits 0.

None of their hunks is within 100 lines of the sentence changed here.

Review: rv1244 and rv1244b, lane 5's independent sonnet reviewers, which wrote none of #1244: READY at `36ec589a6`, H0 of this landing (issuecomment-6723280477), with no MUST or SHOULD; its four NITs are optional (two wordings, a body note and a follow-up). CI (Brett Heap's ruling 27): H0 is the head 473959f itself, which passed tests, tests-git-bash and SonarCloud; main has touched none of its files since its base 9729315; and the local gate passed on its predicted squash tree fb798f3 over main 9252ef2: the repo_hygiene, agents_md_codes, cli_reference sets, 171 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 #1238

Lane: openreposhape-5 (openRepoShape-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Nov 9, 2026
…repository as `plan-case-twins` on every disk, a one-blob set as a NOTE in a leg and, in the root, two paths in one folder, and `execute` refuses the finding before any leg (#1161) (#1189)

`adopt-project.py check` printed `plan ok` for a plan that keeps case twins in one repository: source paths that differ only in case (`A` and `a`, `D/x` and `d/x`), or a path that names in another case a folder above another (`F/x` and `f`). The plan is written on one disk and the clone that loses a twin is made on another, and a clone on a macOS or Windows disk checks out one path of each set. On a disk that ignores case, `execute` could then stop with `check` having said `plan ok`: as `adopt-lost` or at `git rm` mounting the legs, after both legs were pushed, or at git's `will not add file alias`, before any leg existed.

- `check` now exits 1 and names `plan-case-twins`, one finding per repository the split makes (the root, the spec leg, the code leg). A set is every source path that one answered entry sends into one repository, whose paths differ only in case, or where one path names in another case a folder above another. It is asked on every disk, since `core.ignorecase` where `check` runs says nothing about the reader's disk. `execute` runs the same checks first, so it refuses the finding as `plan-case-twins` before it makes either leg.
- A set whose paths all fold to one name and hold one blob in one mode is a NOTE, and `check` still says `plan ok` for it. `execute` prints no NOTE and does not refuse it.
  - In a leg that holds for every such set, folder twins (`src/D/x`, `src/d/x`) and sets of three or more included.
  - In the root the NOTE takes only two paths whose names differ only in their last part, `A` and `a` or `D/A` and `D/a`. Folder twins of one blob there (`D/x`, `d/x`), `D/A` beside `d/a` and sets of three or more (`AB`, `Ab`, `ab`) stay in the finding, since on the FUSE disk `execute` met git's `will not add file alias` for them.
- The remediation says to rename all but one twin of each set in the source, commit, and re-run `plan`. It no longer offers to answer the twins into different repositories, because on a disk that ignores case `execute` loses those too (#1183).
- Paths git refuses (`plan-path-git-refuses` names them), `drop` and unanswered entries are left out. At most 10 paths are named per repository, and the rest are counted.
- Behaviour change: a source that keeps `Makefile` and `makefile` side by side in the root is now `plan-case-twins`. Before, `check` printed `plan ok`, and on a disk that keeps case `execute` split it and verified it. Two params of `tests/test_adopt_make_reads_first.py` changed, and `test_execute_refuses_makefile_beside_makefile_before_any_leg` asserts the refusal: no bare repository, no assembly or leg clone in the work directory, no split branch in the source.
- Measured with git 2.43, on the bench disk (keeps case) and on a FUSE disk that ignores case and keeps it (`casefold` lookups), against base `4c7b8acd`:
  - On base, `check` printed `plan ok` for every scenario on the bench disk. On the FUSE disk `execute` stopped on three of them: `F/x` and `f` in the root, exit 1, `adopt-lost: F/x`, both legs and the split already pushed; `src/A`, `src/a`, `src/D/x`, `src/d/x` with own blobs in the code leg, exit 2 in 3 of 5 runs at `git rm -r -q -- src` after both legs were pushed; and `D/x` and `d/x` in the root with own blobs, refused before any leg as `plan-file-reencoded`.
  - On head, `check` names `plan-case-twins` for each of those three (then `plan-file-reencoded` where git refuses the alias).
  - The NOTE sets verified in `execute` on the FUSE disk: `A` and `a` in the root (3 of 3 runs), `D/A` and `D/a` in the root (2 of 2), `src/A` and `src/a` in the code leg (3 of 3), `specs/A` and `specs/a` in the spec leg (1 run).
  - In the root, folder twins and three paths of one blob (2 runs each, at `a131fc25`): `check` printed `plan-case-twins` and `plan-file-reencoded`, and `execute` refused both before any leg as `plan-case-twins`.
  - The whole of `tests/test_adopt_check_throwaway_repos.py`, CPython 3.12: at the head `58aa9d2b`, 91 passed and 2 skipped; on base 38 of its ids fail (r1189c). Mutants of the new code: 36 of 36 killed, each file restored and its blob checked against HEAD's.
- Known limits:
  - `casefold` is full case folding, so `ß` and `ss` are named as a set, though a disk may hold them apart.
  - Unicode normalization is not asked: a precomposed `é` beside `e` and a combining accent is no finding, though a macOS disk takes them as one name.
  - The cut at 10 named paths can fall inside a set.
  - The one-blob NOTE, and the root's narrower rule for it, rest on the FUSE disk with git 2.43; real APFS and NTFS were not measured. The row for a disk that ignores case skips on every CI disk, which keeps case.
- Not in this PR, each a follow-up: case twins the plan sends to different repositories, or a twin it drops beside one it keeps (#1183); the rehearsal's alias refusal, which `check` reports as `plan-file-reencoded` though its words say the bytes were re-encoded (#1184); twins a kept path makes with a file the shape writes into the root (#1191).

Review: lane 1's independent reviewers reviewed each round. r1189 found `8684af86` NOT READY, for two MUSTs and four SHOULDs (#1189 issuecomment-6356435838). r1189b found `4d40ce9f` NOT READY for one SHOULD, that the one-blob NOTE covered root shapes that do not verify on a disk that ignores case (issuecomment-6364543347). The next round narrowed the root's rule and the sentence, and r1189c, lane 1's independent re-checker, found `58aa9d2b` READY, with no MUST, no SHOULD and two notes that do not block (issuecomment-6375603307). It re-ran 15 of the 36 mutants, and all 15 were killed. After #1158 landed as `ef619c74`, the branch was restacked onto it by merges of #1158's final head and of its squash, and its changed lines equal the reviewed delta (sha256 `04b2909a`). After #1169 and #1223 landed, main `11560eb9` was merged in as `5c4fcd9d`; its one conflict, a docstring both sides added to, keeps both, and the changed lines equal the reviewed delta (issuecomment-6722938949). `7d2f651e` leaves out of lane 4's #1121 rows the two trees that keep case twins, which `execute` now refuses, with lane 4's agreement (issuecomment-6722980082). After #1105 landed, main `12122952` was merged in cleanly as `47478d51`, whose 787 changed lines equal the delta before it (sha256 `637968e3`), and `472944b5` makes the cut agreed on #473 (issuecomment-6723000456) of the three #1105 rows that keep case twins. Lane 1's check carries READY to `472944b5` (issuecomment-6724542222).

Tests, under a stub `gh` with a bogus token: at `58aa9d2b`, r1189c's re-check gave 91 passed and 2 skipped for `tests/test_adopt_check_throwaway_repos.py` (the same under a 3.14-like shim) and 33 passed for `tests/test_adopt_make_reads_first.py`. Main touched both files after the restack, so lane 1's gate ran on the refreshed tree itself, below: the PR's two test files, `tests/test_scaffold_leg_path_collisions.py`, the doc trio, the path-guard and no-auto-maintenance scans, and `tests/test_shape_doctor.py` in 4 shards. At `472944b5`: `tests/test_adopt_check_throwaway_repos.py` 194 passed and 2 skipped (the disk that ignores case), `tests/test_adopt_make_reads_first.py` with `tests/test_adopt_next_make_reads_first.py` 71 passed, `tests/test_adopt_collision_make_reads.py` 28 passed, `tests/test_adopt_single_repository_record.py` with `tests/test_scaffold_leg_path_collisions.py` 143 passed, the two scans 179 passed and 2 skipped, the doc trio 171 passed, and `tests/test_shape_doctor.py` in 4 shards 446 passed and 3 skipped.

It lands by fast refresh (Brett Heap, 2026-10-15T22:48:35Z). Its H0 `472944b5` is green on Linux and SonarCloud. The branch was never rebased. After H0, the only commit is update-branch's clean merge of main, giving dae7250, which is green on SonarCloud and Git Bash. Lane 1's gate passed on its tree: 9 pytest calls over `tests/test_adopt_check_throwaway_repos.py`, `tests/test_adopt_make_reads_first.py`, `tests/test_adopt_next_make_reads_first.py`, `tests/test_adopt_collision_make_reads.py`, `tests/test_adopt_single_repository_record.py`, `tests/test_scaffold_leg_path_collisions.py`, `tests/test_agents_md_codes.py`, `tests/test_cli_reference.py`, `tests/test_repo_hygiene.py`, `tests/test_path_guard_hygiene.py`, `tests/test_no_auto_maintenance.py` and `tests/test_shape_doctor.py` in 4 shards: 1,233 passed, 7 skipped.

Closes #1161

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scaffold-project.py: a partial-clone --pin-source lacking the pinned commit or its trees is fetched into over the network

1 participant