Skip to content

adopt-project.py: check names the case twins the plan keeps in one 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

Merged
brettheap merged 24 commits into
mainfrom
fix/1161-check-names-case-twins
Nov 9, 2026

Conversation

@brettheap

@brettheap brettheap commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1161

Stacked on #1158 (head 4c7b8acd), which landed as ef619c74; this branch was restacked onto it by three merges:

The net diff is identical: git diff ef619c74 6a31aea7 is byte for byte git diff 4c7b8acd a131fc25 (sha256 04b2909a71bc, 3 files, 686 insertions, 27 deletions); at the head, 744 and 27. adopt-project.py and tests/test_adopt_check_throwaway_repos.py at ef619c74 are the blobs of 4c7b8acd, so "before" and "base" below, 4c7b8acd, are what main holds. It is outside v1.2.0 by Brett Heap's ruling of 2026-10-21T10:32:04Z ("leave the follow-ups out of v1.2.0").

Merge with main after #1105

47478d51 merges main at 12122952 (#1105's squash) into this branch at 7d2f651e, the head the next section ends at. Their merge-base is 11560eb9, #1223's squash, and main holds 8 commits since it: #1166, #1133, #1104, #1131, #1160, #1190, #1243 and #1105. Of them #1190 and #1105 change adopt-project.py (#1190 cmd_plan, _grouped_findings, _refuse_a_partial_clone_short and main; #1105 _predict_collisions), in lines this PR does not touch, and none changes a test file of this PR's. The merge was clean: git merge-tree --write-tree of main and 7d2f651e gave tree 73fffbb8, the merge's tree.

Merge with main after #1169 and #1223

5c4fcd9d merges main at 11560eb9 (#1223's squash) into this branch at 58aa9d2b, the head r1189c read. Their merge-base is ef619c74, #1158's squash, and main holds 20 commits since it: #1124, #1140, #1149, #1126, #1107, #1157, #1088, #1193, #1187, #1119, #1156, #1208, #1121, #1200, #1180, #1109, #1235, #1144, #1169 and #1223. Of them #1119, #1121, #1180 and #1169 change adopt-project.py, and #1119 and #1169 change tests/test_adopt_check_throwaway_repos.py.

What

Measured with git 2.43, on the bench disk (keeps case) and on a FUSE disk that ignores case and keeps it (casefold lookups), with the work dir and every repository on it.

Before (the tool at 4c7b8acd): on the bench disk check prints plan ok for every scenario below, and execute exits 0 and verifies each one it was run on. not measured means not run at 4c7b8acd; (bench disk only) means the base run of the row's test, exit 0 on the bench disk, and nothing on the disk that ignores case. On the disk that ignores case:

scenario check before execute before, disk that ignores case check after
A/a in the root, own blobs plan ok exit 0, verified FINDING plan-case-twins
A/a in the root, one blob plan ok exit 0, verified (1 run, r1189's) NOTE, plan ok; execute verified (3 of 3 runs: 1 at 4d40ce9f, 2 at a131fc25)
D/A/D/a in the root, one folder, one blob plan ok (bench disk only) not measured NOTE, plan ok; execute verified (2 of 2 runs, at a131fc25)
src/A/src/a, one blob, code leg plan ok exit 0, verified (2 of 2 runs) NOTE, plan ok; execute verified (3 of 3 runs)
specs/A/specs/a, one blob, spec leg plan ok not measured NOTE, plan ok; execute verified (1 run)
D/x/d/x in the root, own blobs plan ok in 2 of 4 fresh runs, else plan-file-reencoded ("will not add file alias 'D/x'") refused before any leg as plan-file-reencoded FINDING plan-case-twins (then plan-file-reencoded where git refuses the alias)
D/x/d/x in the root, one blob plan ok (bench disk only) not measured FINDING plan-case-twins and FINDING plan-file-reencoded (2 of 2 runs, at a131fc25); execute refused before any leg, as plan-case-twins (2 of 2)
AB/Ab/ab in the root, one blob plan ok (bench disk only) not measured the same: both findings, execute refused before any leg as plan-case-twins (2 of 2 runs, at a131fc25)
F/x/f in the root plan ok exit 1, adopt-lost: F/x, both legs and the split already pushed FINDING plan-case-twins
src/A, src/a, src/D/x, src/d/x, own blobs, code leg plan ok 5 runs, two outcomes: exit 0, verified, in 2 (the first round's); exit 2 in 3 (r1189's), refused mounting the legs at git rm -r -q -- src ("the following files have local modifications: src/A, src/D/x") after both legs were pushed FINDING plan-case-twins
A, D/x root; a, d/x code leg plan ok exit 1, adopt-lost for A and D/x, both legs and the split already pushed plan ok (Not in this PR, (a), #1183)
A root; a answered drop plan ok exit 1, adopt-lost: A, both legs and the split already pushed plan ok (Not in this PR, (a), #1183)
no twins (control) plan ok exit 0 plan ok

After: check exits 1 and names, one finding per repository the split makes (the root, the spec leg, the code leg), every set of source paths 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. A set whose paths all fold to one name and hold one blob in one mode is left out of the finding: a NOTE names it, and check still says plan ok for 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), two paths whose folders are twins too (D/A, 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 FINDING says why a clone on a macOS or Windows disk checks out one path of each set, and that execute could stop there before any leg exists, at git's will not add file alias, or after both legs are pushed, as adopt-lost or at git rm mounting the legs, so execute refuses them on every disk. Its 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: on a disk that ignores case execute loses those too (#1183). execute runs the same checks first, so it refuses such a plan before it makes either leg.

  • Behaviour change: every set of source paths that one answered entry sends into one repository is now refused by execute on every disk, and check names it plan-case-twins and exits 1, unless its paths fold to one name and hold one blob in one mode (the NOTE). In the root the NOTE takes only two paths whose names differ only in their last part, so folder twins and sets of three or more of one blob there are refused too. A source that keeps Makefile and makefile side by side in the root is one: before, check printed plan ok, and on a disk that keeps case execute split the source and verified it. A source that keeps only makefile is not, though the shape writes the root's Makefile beside it (Not in this PR, (c), adopt-project.py: check passes a kept path that is a case twin of a file the shape writes into the made root (makefile beside the shape's Makefile), so a clone of that root on a disk that ignores case keeps one of each pair (#1161) #1191). Two params of tests/test_adopt_make_reads_first.py held Makefile and makefile, [Makefile+makefile] and [all-three], and they changed:
    • test_plan_writes_the_line_and_check_prints_it, at those two params, now expects exit 1, the plan-case-twins finding naming Makefile and makefile, and the follow-up line check still prints (its other params still expect exit 0).
    • test_the_split_message_names_the_file_make_reads_in_the_clone no longer runs those two params, since execute refuses their source before any leg and there is no clone to run make in; the new test_execute_refuses_makefile_beside_makefile_before_any_leg, at the same two params, asserts that refusal as plan-case-twins: no bare repository, no assembly or leg clone in the work directory, no split branch in the source.
    • The alternative not taken is a NOTE, not a finding, on a disk that keeps case, where such a source does split and verify. The finding is asked on every disk for the reason Why gives first: the plan is written on one disk and the clone that loses a twin is made on another, so core.ignorecase where check runs says nothing about the reader's disk.

Why

  • Asked on every disk. The plan is written on one disk and the clone that loses a twin is made on another, so core.ignorecase where check runs says nothing about the reader's disk.
  • One repository at a time: the root (what the plan keeps), the spec leg and the code leg, and only the source's paths, each sent there by one answered entry. Not asked here, each a follow-up:
  • Two kinds of set: exact twins (whole paths equal under casefold), and a file against a folder (a path's casefold equals a folder above another path). D/x beside d/y is no finding: on any disk the two folders merge into one and no path is lost.
  • A set of one blob is a NOTE (r1189's SHOULD 5). Where every path of a set folds to ONE name and holds one blob in one mode, the one path a disk that ignores case checks out holds what each path holds; git warns the following paths have collided, and git status is clean (r1189). A file against a folder, two modes (100644 beside 100755), submodules (whose object is a commit, not a blob), or one path of another blob keep the set in the finding. check already prints NOTEs beside its findings (the pins' digests, the symlink probe, relative submodule urls), so the set is named in one, the first of the NOTEs _entry_findings returns. execute prints no NOTE and does not refuse it.
  • The root's NOTE is narrower than a leg's (r1189b, the second review, of 4d40ce9f: adopt-project.py: check names the case twins the plan keeps in one 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 issuecomment-6364543347, SHOULD 1). In the root it takes two paths whose names differ only in their last part, A and a or D/A and D/a, the shape that verified there in every run measured. Every other set of one blob there is the finding, with its rename remediation: on the FUSE disk D/x and d/x, and AB, Ab and ab, met git's will not add file alias, which the adopt-project.py check: a kept or moved file other than .gitattributes whose blob git add would re-encode passes, and execute ends adopt-lost or dies mounting the legs after both legs are pushed #654 rehearsal reports as plan-file-reencoded; and D/A beside d/a has folders that are twins too. Every such set measured in a leg verified. What execute did on the FUSE disk:
    • in the root, with the sets the NOTE takes, adoption verified in every run: files A and a, 4 runs (1 at 4c7b8acd, r1189's; 1 at 4d40ce9f; 2 at a131fc25); files D/A and D/a, 2 runs at a131fc25; for r1189b, 1 run of symlinks to one target (A, a) and 1 of executables (A, a);
    • in a leg, adoption verified in every run: in the code leg, files src/A and src/a, 5 runs (2 at 4c7b8acd, 3 with this check), and for r1189b 1 run each of symlinks to one target (src/A, src/a) and of folder twins (src/D/x, src/d/x), alone and beside folders that only merge; in the spec leg, files specs/A and specs/a, 1 run;
    • with the sets the root leaves to the finding: for r1189b, at 4d40ce9f, folder twins (D/x, d/x), alone and beside folders that only merge, met plan-file-reencoded in check (1 run each), and three paths (AB, Ab, ab) passed check and met it in execute, before any leg (1 run); at a131fc25, 2 runs each of folder twins and of three paths: check printed plan-case-twins and plan-file-reencoded, and execute refused both before any leg as plan-case-twins.
  • The remediation is a rename in the source, and nothing else (r1189's MUST 1). Answering the twins into different repositories, which it offered before, passes check and loses them on a disk that ignores case after both legs are pushed (r1189 on FUSE: check exit 0, execute exit 1, adopt-lost for A and D/x).
  • Paths git refuses are left out (plan-path-git-refuses already names them), and so are drop and unanswered entries: the code reads each entry's answer with _covering, as _PlannedRoot._keep does, and folds with casefold, as _KeptTree does. An unanswered twin is named by plan-unresolved alone, with no twins remediation.
  • Sets are named set by set, at most 10 paths per repository, the rest counted, by the file's _named_and_counted, in the finding and in the NOTE alike.
  • Nothing to register in the docs: no doc lists check's plan-* codes (AGENTS.md names none; docs/cli.md is --help, which takes the docstring's first line only). The module docstring's check paragraph and _entry_findings' docstring name the new check and the NOTE.

Tests

  • Base (4c7b8acd) against head, whole of tests/test_adopt_check_throwaway_repos.py, CPython 3.12:
    • at a131fc25: base 34 failed, 52 passed, 2 skipped; head 86 passed, 2 skipped. The 34 are the 29 that failed at 4d40ce9f (base 29 failed, 52 passed, 2 skipped; head 81 passed, 2 skipped) and the 5 rows a131fc25 added;
    • at the head, 58aa9d2b: 91 passed, 2 skipped. Its 5 new ids, with the 8 rows of test_a_set_of_one_blob_is_a_note_and_not_the_finding that were there, were run at base alone, 13 ids: 12 failed, 1 passed (the execute row, which passes at base, where check has no NOTE for execute to refuse). The whole file was not run at base at 58aa9d2b; by addition, 38 of its ids fail there.
  • Under a 3.14-like sitecustomize shim the file was run only at 4d40ce9f: the same 29 fail on base (the shim loaded in 192 processes) and head passed 81, 2 skipped (193 processes). Not made, for the rounds since: the shim run at a131fc25 and at 58aa9d2b; the prev run, the tool at 4d40ce9f against this head's tests; and the prevw run, the same with the tests' twins_kept sentence set back to "would", which would have told the rows of the root rule from the sentence's.
  • The rows that fail on base and pass on head, 34 at a131fc25 and 4 more at 58aa9d2b:
    • test_check_names_each_twin_git_refuses_and_each_set_it_holds (tests/test_adopt_check_throwaway_repos.py: rows pin that refused_paths holds each case twin under its own name and blob, or names it, with core.ignorecase true or false, and that check names the twins git refuses and none it holds (#1033) #1158's row, renamed: it now also expects the twins finding for A/a, D/x/d/x, F/x/f);
    • test_check_names_the_case_twins_the_plan_keeps_in_one_repository, 14 params: file-twins, folder-twins, a-folder-and-a-file, a-file-and-a-folder, three-twins-none-in-lower-case, twins-in-the-spec-leg, non-ascii-twins-in-the-code-leg, two-sets-in-the-code-leg-set-by-set, a-set-in-each-repository, ten-named-and-the-rest-counted, and, for r1189's SHOULD 6, a-file-and-a-folder-in-the-code-leg (src/E, src/e/x), a-file-and-a-folder-two-levels-above (f, F/G/x), sharp-s-folded-as-ss (src/straße, src/STRASSE, known limit 1) and one-set-of-four; each also asserts the whole remediation line, which offers no answer into different repositories, and no NOTE;
    • test_twins_come_before_coverage_and_name_executes_refusal (r1189's SHOULD 6): beside a path no entry covers, check lists plan-case-twins then plan-uncovered, and execute's refusal code is plan-case-twins;
    • test_a_set_of_one_blob_is_a_note_and_not_the_finding, 10 params (r1189's SHOULD 5, and r1189b's SHOULD 1): A/a of one blob is the NOTE and plan ok, exit 0; of two blobs, the finding, exit 1; three paths of one blob in the code leg, the NOTE; F/x/f of one blob, the finding; and, in the root, folder twins of one blob (D/x, d/x) and three paths of one blob (AB, Ab, ab) are the finding, and two paths in one folder (D/A, D/a) are the NOTE; folder twins of one blob are the NOTE in the code leg (src/D/x, src/d/x) and in the spec leg (specs/D/x, specs/d/x); and a file against a folder of one blob and one last name in the code leg (src/F/f, src/f) is the finding;
    • test_only_one_blob_in_one_mode_is_left_to_the_note, 8 params, _case_twin_findings asked itself: one blob in two modes, submodules at one commit, and one of three paths in another blob are the finding; symlinks to one target are the NOTE; one repository can hold a set of each; two NOTE sets are named set by set; STRASSE and straße of one blob are one name for the NOTE, as casefold folds them; and, in the root, D/A beside d/a of one blob is the finding, as their folders are twins too. At base they fail because the function is not there;
    • test_every_path_of_a_leg_set_is_asked_its_mode, 2 params, the same call over the code leg: src/AB, src/Ab and src/ab of one blob, the last an executable or a symlink, hold two modes, so the finding and no NOTE, whichever path differs;
    • test_the_one_blob_note_is_the_first_of_the_entries_notes: _entry_findings lists the twins' NOTE before the pins';
    • test_execute_refuses_case_twins_before_any_leg.
  • Against the tool at an earlier head of this PR, 8684af86, with the test file of e4f8cc51, the 10 rows of test_a_set_of_one_blob_is_a_note_and_not_the_finding and test_only_one_blob_in_one_mode_is_left_to_the_note then in it fail: check named A/a of one blob in the root, and three paths of one blob in the code leg, as plan-case-twins, where they are now the NOTE; the two finding rows fail on the sentence NIT 7 changed; the 6 direct calls fail as the function returned no NOTEs.
  • Controls that pass on both: test_paths_no_one_repository_holds_as_one_name_are_no_finding (4 params: twins in different repositories, a twin dropped, D/x beside d/y, no twins), and test_a_twin_still_unanswered_is_named_by_plan_unresolved_alone. Its docstring now says the first two are lost on a disk that ignores case (adopt-project.py: on a disk that ignores case, execute loses a case twin the plan keeps in the root when its twin goes to a leg #1183), not held apart. test_execute_takes_sets_of_one_blob_past_checks_findings passes on both too: it runs cmd_execute in the process on a plan keeping A and a in the root and src/A and src/a in the code leg (plan ok), and sees it go on past check's findings to the next step, where a sentinel stops it before any leg exists (no remotes directory); at base there is no NOTE for execute to refuse. test_on_a_disk_that_ignores_case_check_names_the_twins_too skips unless git init in the work dir writes core.ignorecase=true. On the FUSE disk it passes at 4d40ce9f, beside test_on_a_disk_that_ignores_case_each_twin_is_held_or_named (2 passed); r1189 saw it fail at base.
  • Mutants of the new code, run in a clone, restored after each with its blob checked against HEAD's: 36 of 36 killed. 31 were killed at a131fc25, in one chain, and the 5 that survived there at 58aa9d2b; every blob was restored.
    • The 36: r1189b's 26, re-anchored for a131fc25 (r1189's five survivors at 8684af86, killed by the SHOULD 6 rows: m01 (casefold as lower) by sharp-s-folded-as-ss, m03 (the top level only) by a-file-and-a-folder-in-the-code-leg, m04 (the immediate parent only) by a-file-and-a-folder-two-levels-above, m11 (the finding listed last) by the coverage row, m15 (len(twins) // 2) by one-set-of-four; and b01-b21: the NOTE's conditions, its text, its place among the NOTEs, the remediation, the sentence and execute's refusal; b21 is now on the sentence's could); and this round's 10 for the root rule and the sentence (f01-f10): the root's shape not asked; two paths only; one folder only; every repository, not the root alone; the top level only; the folders folded; last parts that differ; three paths taken; the spec leg treated as the root; the sentence back to "would".
    • The 5 that survived at a131fc25, all killed at 58aa9d2b:
      • b17 (execute refusing the NOTE) and f09 (the spec leg treated as the root), expected, by test_execute_takes_sets_of_one_blob_past_checks_findings and by the row folder-twins-of-one-blob-in-the-spec-leg;
      • b06 (the blob and mode of the first two paths only), by test_every_path_of_a_leg_set_is_asked_its_mode;
      • b02 (the one-name test always true) and b18 (only the last part folded), which were not expected, are not equivalent: in a leg a set that does not fold to one name reaches _one_blob_twins, src/F/f beside src/f of one blob, a file against a folder, and the row a-folder-and-a-file-of-one-blob-in-the-code-leg kills both. In the root they are unreachable, as the test for two paths in one folder returns first.
    • Before the root rule, at 4d40ce9f and 6e3ebfa6: 32 of 32 killed, r1189's 17 (m01-m17) and the NOTE's own 15 (n01-n15). n15 survived at 6e3ebfa6 and is killed at 4d40ce9f by sharp-s-and-ss-of-one-blob; n13 survives without test_the_one_blob_note_is_the_first_of_the_entries_notes, which is why that row exists. Those 32 were not run again at this head, nor were the first round's 23, of the code as it was then.
  • The gate, call by call, each with df -h /workspace first and one basetemp, CPython 3.12. The tool's code has not changed since a131fc25 but for a comment (e45e1225), so the runs made at a131fc25 stand for it (they ran before the restack, which brought in files of main's that this PR does not touch; the make-reads-first file ran again after it, at 6a31aea7); two calls were run again at the head:
    • at 58aa9d2b: test_path_guard_hygiene, test_agents_md_codes, test_cli_reference, test_repo_hygiene, test_no_auto_maintenance: 278 passed, 2 skipped (the session began with GIT_CONFIG_GLOBAL set). At a131fc25 it was 277 passed, 2 skipped; the one more is tests/test_repo_hygiene.py::test_the_one_line_install_is_the_same_everywhere[docs/release-notes/v1.2.0.md], a file the restack brought in from main;
    • at 58aa9d2b: tests/test_adopt_check_throwaway_repos.py, whole file: 91 passed, 2 skipped;
    • at 6a31aea7, after the restack: that file with tests/test_adopt_make_reads_first.py: 119 passed, 2 skipped (86 + 33);
    • at a131fc25: tests/test_adopt_make_reads_first.py, whole file: 33 passed; tests/test_scaffold_leg_path_collisions.py: 104 passed; tests/test_shape_doctor.py in 4 shards: 111 passed, 1 skipped; 112 passed; 111 passed, 1 skipped; 111 passed, 1 skipped. The skips are the PowerShell row, which runs only on a Windows host;
    • From the first round, at a43edbdc (test_adopt_make_reads_first at 8684af86): g2 test_adopt_root_shape_paths 121 passed, test_adopt_root_symlinks 205 passed, 3 skipped (reftable needs git 2.45); g3 test_adopt_contracts_dir, test_adopt_plan_leg_path_help, test_adopt_device_names, test_adopt_finding_spelling, test_adopt_check_plan_name, test_adopt_printed_sentences, test_adopt_leg_paths: 702 passed; test_adopt_execute_refusals 181 passed; test_adopt_pins and test_adopt_source_clone_record 250 passed; test_adopt_answered_legs, test_adopt_leg_path_collisions, test_adopt_manifest_values, test_adopt_mount_ignored, test_adopt_relative_submodule_url, test_adopt_root_manifest 104, 108 and 61 passed; test_adopt_plan_yaml_quoting, test_adopt_submodule_url_answers 562 passed, test_adopt_symlink_target_bytes 130 passed. Not re-run: the rounds since change only what plan-case-twins says, its remediation, and which sets of one blob are a NOTE. Those files met no set of twins at a43edbdc (they passed with the finding live there), so they meet neither the finding nor the NOTE now.

Known limits

  1. casefold is full case folding, so ß and ss are named as a set, though a disk may hold them apart (row sharp-s-folded-as-ss).
  2. 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.
  3. At most 10 paths are named per repository and the rest counted, in the finding and in the NOTE, and the cut can fall inside a set.
  4. The one-blob NOTE, and the root's narrower rule for it, rest on the FUSE disk (casefold lookups) with git 2.43, 2 runs each for the sets this round added. Real APFS and NTFS were not measured.
  5. The row for a disk that ignores case skips on every CI disk, which keeps case. The bench measured it on the FUSE disk, and under a global core.ignorecase=true, where folder twins (D/x, d/x) give plan-case-twins, then plan-file-reencoded (3 of 3 runs). A and a there give plan-case-twins alone (r1189).

Not in this PR

Lane: openreposhape-1 (openRepoShape-1)

🤖 Generated with Claude Code

Summary by Sourcery

Reject adoption plans that keep unsafe case-colliding paths in the same repository and report the required source renames before execution.

New Features:

  • Detect case-colliding source paths kept in the same planned repository and report them as plan-case-twins findings or safe one-blob notes.
  • Refuse execution of plans containing unsafe case twins before creating any repository legs.

Bug Fixes:

  • Prevent adoption plans from proceeding when case-insensitive filesystems could lose or merge source paths.

Enhancements:

  • Apply repository-specific handling for case-twin sets, including file-versus-folder collisions and root-specific safe-note rules.
  • Update make-related adoption tests to account for early refusal of sources containing Makefile and makefile together.

Tests:

  • Add coverage for case-twin detection, safe one-blob notes, remediation messages, ordering, filesystem behavior, and pre-leg execution refusal.
  • Adjust collision and make-read integration tests to exclude scenarios that are now rejected before cloning.

Brett Heap and others added 7 commits October 22, 2026 12:35
…hs` holds each case twin under its own name with its own blob, or names it, with `core.ignorecase` true (#1033)

`refused_paths` (#910, #1031) writes its own index with `update-index -z
--index-info` and no row said what that index makes of case twins where
`core.ignorecase` is true, the default on a disk that ignores case.
Measured with git 2.43: git holds both twins of a path it takes (a file,
a folder, a folder beside a file), each with its own blob, and leaves out
both twins of a path it refuses, which `plan-path-git-refuses` names.

- `with_paths` gains `own_blobs`, so a twin held with its sibling's blob
  would show;
- ten rows ask `refused_paths` in a rehearsal whose own config holds
  `core.ignorecase` true or false (the control), and read the index with
  `git ls-files -s`;
- one row asks a disk that ignores case itself, and skips where `git init`
  wrote no `core.ignorecase=true` (every CI disk, Linux since #597);
- one `check` row, under a global `core.ignorecase=true`, pins that
  `plan-path-git-refuses` names the four twins git refuses and none of the
  six it holds, and that `plan` asks about each twin by name.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s by its mode beside the one it holds (a symlink `.GITMODULES` and the file `.gitmodules`), a file beside a folder, three twins and a non-ASCII pair (#1033)

Round 1 review of #1158:
- `with_paths` and `with_twins` take `links`, written as mode 120000, and
  `test_a_twin_git_refuses_by_its_mode_is_named_beside_the_one_it_holds` asks
  `refused_paths` for the pair with `core.ignorecase` true and false: git
  refuses the symlink and holds the file, so an answer that folds the index's
  paths into one case now fails (hand mutant HM4 was not equivalent).
- `CASE_TWINS` gains `a-file-and-a-folder`, `three-twins` and
  `non-ascii-twins` (spelled with escapes, so the file stays ASCII).
- The `check` row's docstring no longer says no finding refuses twins of each
  other: under a global `core.ignorecase=true` the #654 rehearsal refuses
  `D/x` and `d/x`, and the row does not see it because the rehearsal asks
  nothing of a source that holds a path git refuses.
- The disk row's skip text no longer names the per-run work directory.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…NS` and the `check` row's docstring name the twins they hold, and the held-or-named row's docstring says each twin, not both (#1033)

Round 2 re-check of #1158, two comment NITs, no code change:
- The comment above `ALL_TWINS` and the `check` row's docstring said they
  held "every twin above". They hold the twins of `file-twins`,
  `folder-twins` and `a-folder-and-a-file` and the two refused sets, and not
  the twins of `a-file-and-a-folder`, `three-twins` and `non-ascii-twins`.
  Both now say so. `ALL_TWINS` itself is unchanged.
- `test_each_case_twin_is_held_with_its_own_blob_or_named` said "both twins"
  of a path git takes, and `three-twins` holds three. It says "each twin".

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…repository, `A` and `a`, `D/x` and `d/x`, `f` and `F/x`, as `plan-case-twins` on every disk, and `execute` refuses them before any leg (#1161)

A disk that ignores case holds each such set as one name. Measured with
git 2.43 at 4c7b8ac, on such a disk, `check` printed `plan ok` for every
set; `execute` lost `F/x` after both legs were pushed, and was refused at
folder twins as `plan-file-reencoded` in 2 of 4 fresh sources.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… for each set the plan keeps in the root, the spec leg or the code leg, its absence for twins in different repositories, a dropped twin and folders that only merge, and `execute`'s refusal before any leg; #1158's row names the six twins it holds; `with_paths` merges into a folder HEAD holds (#1161)

`with_paths` wrote a second `src` or `specs` tree beside HEAD's (git
fsck: duplicateEntries); it now merges a new path into the folder HEAD
already holds.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…o path in lower case, so a fold of the set's names that skips `casefold` is seen, and the unresolved twin's row says no twins remediation is printed (#1161)

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e` and `makefile` side by side expect `check`'s `plan-case-twins` and exit 1, and `execute` is asked to refuse that source before any leg, so they no longer run `make` in a clone (#1161)

`test_plan_writes_the_line_and_check_prints_it`, at `[Makefile+makefile]` and `[all-three]`: `check` exits 1 and prints the one `plan-case-twins` finding naming `Makefile` and `makefile`, beside the follow-up line it still prints. The other params still expect exit 0.

`test_the_split_message_names_the_file_make_reads_in_the_clone` drops those two params: `execute` now refuses their source before any leg exists, so there is no clone to run `make` in. `test_execute_refuses_makefile_beside_makefile_before_any_leg`, at the same two params, asserts the refusal as `plan-case-twins`: no bare repository, no assembly or leg clone in the work directory, no split branch in the source. Where `check` run on a disk that keeps case once passed this source and `execute` split and verified it, both now refuse it on every disk, as for any other set of case twins.

Measured on CPython 3.12 and under a 3.14-like shim, the whole file: 4c7b8ac 4 failed, 29 passed; head 33 passed. The 4 are the two changed `check` params and the two refusal params.

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

Implementation

Add case-twin detection to check, including the one-blob NOTE and remediation, and make the finding part of the checks that execute refuses before creating either leg.

  • adopt-project.py L117-125, L9750-9923, L10089-10098 (+4 small edits)

Tests

Exercise case-twin findings and NOTE behavior across repositories, path shapes, modes, and answers, and verify finding order and pre-leg refusal by execute.

  • tests/test_adopt_check_throwaway_repos.py L55-63, L214-226, L534-975 (+3 small edits)

Update make-read tests to expect plan-case-twins for Makefile/makefile and avoid real-adoption clone assertions for plans that are now refused.

  • tests/test_adopt_make_reads_first.py L25-31, L137-159, L278-312 (+4 small edits)
  • tests/test_adopt_next_make_reads_first.py L46-47, L275-276, L292-299

Exclude case-twin trees from collision tests that require a completed adoption, leaving the new refusal test as their coverage.

  • tests/test_adopt_collision_make_reads.py L309-316, L384-392 (+3 small edits)

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-23T03:09:10Z) Independent review r1189 of #1189 (Closes #1161) at 8684af86: NOT READY, for two MUSTs and four SHOULDs. The review stopped at LAST STEP, and the parts it did not cover are named at the end.

r1189 review of PR #1189 (Closes #1161), head 8684af86: NOT READY (for the parts covered)

The grouping code is correct on every shape I probed, and base against head reproduces the body's counts. Two things block it: the remediation sends people into a plan that loses a twin after both legs are pushed, and the PR's central "every set" claim is false for files the shape itself writes.

LAST STEP came after my last check had finished; I started no new runs after it. The review checkout l1-r1189 is clean at 8684af860, the mutant clone is clean, and none of my runs is still going.

Setup:

  • Scratch: /workspace/projects/openRepoShape-worktrees/_lane1-scratch/r1189 (logs in runs/, FUSE bench in fuse/, mutants.py), with the probe environment in penv.sh.
  • fuse/ holds the writer's cifuse.py, run from my own copy: a disk that ignores case and keeps it, in a private namespace. Below it is called "FUSE"; the disk that keeps case is "the bench disk".

What holds

  • Base against head, both changed test files:

    Run Base 4c7b8acd Head 8684af86
    CPython 3.12 16 failed, 81 passed, 2 skipped 97 passed, 2 skipped
    3.14-like shim the same 16 failed (shim loaded in 222 processes) 97 passed, 2 skipped (226 processes)

    The 16 are exactly the body's 12 throwaway-repos rows plus 4 make rows. The controls (a-twin-dropped, D/x beside d/y, twins in different repositories, no twins, and the unanswered twin) pass on both.

  • The skip-guarded row runs on FUSE. test_on_a_disk_that_ignores_case_check_names_the_twins_too passes at head and fails at base (assert [] == ['FINDING pla...adopt-lost.']`). tests/test_adopt_check_throwaway_repos.py: rows pin that refused_paths holds each case twin under its own name and blob, or names it, with core.ignorecase true or false, and that check names the twins git refuses and none it holds (#1033) #1158's FUSE row passes at both.

  • D/x beside d/y is rightly no finding. With the head tool on FUSE, check says plan ok and execute says "adoption verified" for D/x+d/y, D/x+d/y+d/z, D/E/x+d/e/y+d/E/z, and src/D/x+src/d/y in the code leg. Base's dirmerge run also verified.

  • The body's "before" table at base on FUSE matches, apart from one row (SHOULD 4):

    • A/a and the one-blob A/a: verified.
    • D/x/d/x: plan-file-reencoded, "will not add file alias 'D/x'".
    • F/x/f: adopt-lost: F/x.
    • The across-repositories scenario: adopt-lost for A and D/x.
    • The control: verified.
  • The grouping function (_case_twin_sets, called directly):

    • src/E+src/e/x, f+F/G/x, a/B+A/b/c and F+f/x+f/X are each grouped as one set.
    • D/x+d/y gives no set.
    • Known limit 1 holds (straße/STRASSE is a set) and so does known limit 2 (NFC beside NFD é gives []).
  • The every-disk ruling has precedent. Head refuses a kept Code/x or Spec against the legs' mounts as plan-leg-path-collides "once case is ignored", on the bench disk. The shape-pin twin row (test_adopt_shape_pin_and_work_dir.py:123-130) does the same. So the body's reason holds as policy; it is applied unevenly (MUST 2, SHOULD 5).

  • Body bookkeeping checks out:

MUST

1. The remediation's second option loses a twin after both legs are pushed, on the very disks the finding is about.

  • Where: adopt-project.py:9289-9291, in CASE_TWINS_REMEDIATION: "Or answer the twins of each set into different repositories ... and run check again."
  • Evidence: fuse/run.sh <head tool> head2 across on FUSE (runs/fuse-head2.txt):
    check exit 0
        plan ok
    execute exit 1
        FINDING adopt-lost: `A` (f70f10e4db19) is in no leg, not in the root tree, and not listed as drop
        FINDING adopt-lost: `D/x` (ad304eab5bbc) is in no leg, not in the root tree, and not listed as drop
       | NOTHING has been rolled back: `<fuse>/head2-across/remotes/Northwind-spec.git` and `...-code.git` exist, and both legs are pushed.
    
    The same plan on the bench disk gives check exit 0 and execute exit 0, "adoption verified".
  • Fix: drop that sentence, or confine it to execute run on a disk that keeps case and name follow-up (a). The better fix is to implement (a) here: where the work directory's git init writes core.ignorecase=true, name every twin set of the source commit, whatever its repositories or a drop.

2. False claim: the body's After paragraph says check "names, for each repository the split makes, every set of paths it would hold that differ only in case". The Behaviour-change bullet leans on it.

SHOULD

3. A dropped twin is lost too.

  • Where:
    • adopt-project.py:9272-9273 ("one the plan drops lands nowhere");
    • the control tests/test_adopt_check_throwaway_repos.py:602 (a-twin-dropped);
    • the body's Why and its follow-up (a), which names only twins in different repositories.
  • Evidence, dropped scenario (A kept in the root, a answered drop) on FUSE, at head and at base:
    check exit 0 / plan ok
    execute exit 1
        FINDING adopt-lost: `A` (f70f10e4db19) is in no leg, not in the root tree, and not listed as drop
    
    Both legs and the split were already pushed.
  • Fix: put the dropped twin into follow-up (a)'s text, and reword the comment.

4. The table row "the twins under src/, code leg | plan ok | exit 0, verified" is not what I measured. The code comment adopt-project.py:9263-9264 ("twins in one leg, were adopted") repeats it.

  • Evidence: base tool on FUSE, 3 of 3 runs (runs/fuse-base.txt, runs/fuse-base-leg.txt):
    execute exit 2
        REFUSED mounting the legs. THE EXACT COMMAND WAS:
        git --literal-pathspecs rm -r -q -- src
        exit 1
    error: the following files have local modifications:
        src/A
    NOTHING has been rolled back: ... both legs are pushed.
    
    The writer's 2 runs (w1161/probe/ci-r5/back/leg, runs/bench1-leg) did verify.
  • Fix: state both outcomes with their counts. This strengthens the case for refusing twins in a leg.

5. Sets whose paths hold one blob are refused on every disk though nothing is lost anywhere (known limit 4; my judgment, as the brief asked).

  • Evidence:
    • Base on FUSE, samebytes: execute exit 0, "adoption verified". Head refuses it as plan-case-twins.
    • Cloning onto FUSE a repository holding A and a (fuse/clone1.sh):
      • one blob: git warns "the following paths have collided", and git status --short is empty;
      • two blobs (control): M A.
  • Fix: leave exact-twin sets whose paths share one mode and one blob out of the finding, or make them a NOTE. Keep sets with different blobs and file-against-folder sets.

6. My mutants: 17 run, 12 killed, 5 survived. Each survivor was confirmed against both whole test files (97 passed, 2 skipped each). The file was restored after every mutant, and its blob equals HEAD's (runs/mutants*.txt).

  • The survivors:
    • m03: file-against-folder asked at the top level only;
    • m04: asked of the immediate parent only;
    • m01: casefold replaced by lower;
    • m11: the finding listed after every other entry finding, which changes execute's refusal code when another finding exists;
    • m15: len(twins) // 2 in place of len(sets).
  • Where: the TWINS_KEPT rows, tests/test_adopt_check_throwaway_repos.py:529-570. No row holds a nested or deep file-against-folder set.
  • Fix: add these rows:
    • src/E+src/e/x in the code leg;
    • f+F/G/x;
    • straße+STRASSE (pins known limit 1);
    • twins plus an uncovered path, asserting the order and execute's code;
    • one set of four paths.

NIT

7. The finding's sentence describes what execute did before this PR.

  • Where: adopt-project.py:9343-9346, "execute run there can stop before any leg exists ... or after both legs are pushed, as adopt-lost".
  • It is printed inside execute's own refusal, which says no leg was made, and execute now refuses first.
  • Fix: "...would stop there..., so execute refuses them on every disk".

8. Known limit 5's "(3 of 3 runs: plan-case-twins, then plan-file-reencoded)" belongs to folder twins, not to the row.

  • The row's source is A/a, and on FUSE it passes with one finding.
  • Under a global core.ignorecase=true, A/a gives plan-case-twins alone. D/x/d/x gives plan-case-twins then plan-file-reencoded.
  • Fix: attribute it to folder twins.

Not covered

  • I did not re-run the body's gate (g1-g11, test_shape_doctor in 4 shards, test_scaffold_leg_path_collisions); I read the writer's logs only.
  • I did not run the adopt test files the gate leaves out. My static scan found no source-path twins in them.
  • CI tests was still running at 03:01:51Z; Sonar, package and tests-git-bash passed.
  • I did not measure the _Unasked fallback, where refused=[] and twins of paths git refuses would be named too.
  • The FUSE disk stands in for macOS and Windows. Real APFS and NTFS were not measured.

Lane: openreposhape-1 (openRepoShape-1)

Brett Heap and others added 4 commits October 23, 2026 07:52
…ths hold one blob in one mode to a NOTE, its remediation no longer offers to answer the twins into different repositories, and its sentence says `execute` refuses them on every disk (#1161)

r1189's review of #1189, as lane 1 ruled:
- MUST 1: CASE_TWINS_REMEDIATION drops "Or answer the twins of each set
  into different repositories ... and run `check` again": on a disk that
  ignores case `execute` loses twins in different repositories after both
  legs are pushed (#1183). A comment says why the option is gone.
- MUST 2: the section comment says the finding asks each set of SOURCE
  paths, each sent by one answered entry, and not a kept path that is a
  twin of a file the shape writes into the root (#1191).
- SHOULD 3: the comment no longer says a dropped twin lands nowhere; twins
  in different repositories and a dropped twin are lost too (#1183).
- SHOULD 4: the comment gives both measured outcomes for twins in the code
  leg: adopted in 2 runs, stopped at `git rm -r` in 3.
- SHOULD 5: `_one_blob_twins` leaves a set whose paths fold to one name and
  hold one blob in one mode (not a submodule) out of the finding, and
  `check` names it in a NOTE, the first of `_entry_findings`' NOTEs. On a
  disk that ignores case `execute` verified such a set in 8 of 8 runs (2 in
  the root, 5 in the code leg, 1 in the spec leg). A file against a folder
  stays the finding.
- NIT 7: the finding says `execute` would stop there, before any leg or
  after both are pushed, so it refuses them on every disk.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…folder below the top level and two levels up, `ß` folded as `ss`, one set of four, `plan-case-twins` before `plan-uncovered` and as `execute`'s code, the whole remediation, and a set of one blob in one mode as a NOTE (#1161)

r1189's review of #1189:
- SHOULD 6, rows that kill its surviving mutants: `src/E` with `src/e/x`
  in the code leg (m03), `f` with `F/G/x` (m04), `src/straße` with
  `src/STRASSE`, which pins known limit 1 (m01), the twins beside a path
  no entry covers, asserting the order of the findings and `execute`'s
  refusal code (m11), and one set of four paths (m15).
- MUST 1: the `TWINS_KEPT` row asserts the whole remediation line, which
  offers no answer into different repositories.
- SHOULD 5: `A` and `a` with one blob are a NOTE, `check` exits 0; with two
  blobs they are the finding; three paths of one blob in the code leg are a
  NOTE; `F/x` and `f` of one blob stay the finding. `_case_twin_findings`
  asked itself: one blob in two modes, submodules at one commit and one of
  three paths in another blob are the finding; symlinks to one target are
  a NOTE; a repository can hold a set of each, and two NOTE sets are named
  set by set.
- SHOULD 3: the controls' docstring says twins in different repositories
  and a dropped twin are lost too on a disk that ignores case (#1183).
- NIT 7: `twins_kept` holds the finding's new sentence.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ndings` lists the one-blob twins' NOTE before the pins' NOTEs, as its docstring says (#1161)

The order the docstring states had no row: moving `twin_notes` after the
other NOTEs passed every row before this one.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…and `straße` of one blob are one name for the NOTE, folded with `casefold` as their set was (#1161)

f1189's mutant n15 (`lower` in place of `casefold` in `_one_blob_twins`)
passed every row before this one: no row held a one-blob set that only
full case folding makes one name.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@brettheap brettheap changed the title adopt-project.py: check names the case twins the plan keeps in one repository (A and a, D/x and d/x, f and F/x) as plan-case-twins on every disk, and execute refuses them before any leg (#1161) adopt-project.py: check names the case twins the plan keeps in one repository (A and a, D/x and d/x, f and F/x) as plan-case-twins on every disk, a set of one blob as a NOTE, and execute refuses the finding before any leg (#1161) Oct 23, 2026
@brettheap

Copy link
Copy Markdown
Contributor Author

(lane openRepoShape-1, 2026-10-23T12:09:42Z) Independent re-review r1189b of #1189 at 4d40ce9f: NOT READY, for one SHOULD. All eight of r1189's findings are fixed. The one-blob NOTE also covers root shapes that do not verify on a disk that ignores case.

Lane 1's ruling for the next round: in the root, the NOTE keeps only two paths that differ in their last part. Folder twins and sets of 3 or more stay the finding. The legs keep the NOTE. NITs 2 and 3 are taken. The review stopped at lane 1's STOP; the parts it did not cover are named at the end.

r1189b: re-review of PR #1189 (Closes #1161), head 4d40ce9f: NOT READY (for the parts covered)

I stopped at lane 1's STOP. All my runs are killed by TERM (PIDs 503221, 503225-503227, 510366), and nothing of mine is still running. No pytest call ever started: the gate pair was still waiting for a test slot, with 6 other pytest processes in the container. The review checkout l1-r1189 is clean at 4d40ce9fda, and both mutant clones are clean.

All eight of r1189's findings are fixed as claimed. One new gap holds the PR: the NOTE covers more than its evidence does.

SHOULD

1. The one-blob NOTE covers shapes that do not verify on a disk that ignores case, and the body says check "still says plan ok" for all of them.

  • Where:

    • adopt-project.py:9334-9342 (_one_blob_twins);
    • the comment at :9285-9290;
    • the body's After paragraph: "a NOTE names it, and check still says plan ok for it".
  • The gap: the evidence is 8 runs of 2-path file twins (A/a) only. The NOTE also takes folder twins (D/x/d/x) and sets of 3 or more paths. In the root, on the FUSE disk, those meet git's file-alias refusal instead.

  • Evidence: the head tool on my copy of r1189's FUSE bench, 1 run each (r1189b/runs/fuse-h1.txt):

    scenario (one blob) check execute
    samefolders: D/x, d/x in the root exit 1: FINDING plan-file-reencoded ("will not add file alias 'D/x' ('d/x' already exists in index)"), plus the NOTE exit 2, refused before any leg
    samemerge: the above plus D/y, d/z the same as samefolders the same as samefolders
    samethree: AB, Ab, ab in the root exit 0, NOTE, plan ok exit 2: REFUSED plan-file-reencoded ("will not add file alias 'Ab' ('ab' already exists in index)"), "no leg repository was created"
    samefolderleg, samemergeleg (code leg); samesymleg, samesymroot (symlinks to one target); sameexec (both 100755) NOTE, plan ok exit 0, adoption verified
  • What it means:

  • Not measured: whether a run gets past both rehearsals and stops after the legs are pushed. If one does, this becomes a MUST. Repeating the three root shapes was my next step when STOP came; r1189b/fuse/loop.sh is ready for it.

  • Fix, either of:

NIT

2. "execute would stop there" claims too much for file twins in the root.

  • Where: adopt-project.py:9389.
  • The body's own row 13 says A/a with their own blobs went "exit 0, verified" on FUSE.
  • Fix: "could stop" (r1189 proposed "would").

3. Body row 17 (D/x/d/x in the root) does not say "own blobs". With one blob, the "after" column is now the NOTE, plus plan-file-reencoded on FUSE.

  • Fix: add "own blobs".

r1189's findings: each fixed as claimed (checked statically)

Bookkeeping: holds

Not covered

  • Base against head of the new rows, on 3.12 and under the shim: not run. They were killed while still waiting for a test slot; the shim is built at r1189b/shim/sitecustomize.py.
  • Mutants: 26 are written and every anchor is checked unique and compiling (r1189b/mutants.py): r1189's 5 survivors, plus 21 of mine. None was run.
    • b17, which makes execute refuse the NOTE, may survive: none of the rows I read runs execute on a one-blob set. This is unmeasured.
  • The gate (g1, the 4 test_shape_doctor shards, test_scaffold_leg_path_collisions) and the make_reads_first file at head: not re-run.
  • Repeat FUSE runs of the root shapes (SHOULD 1), and the _Unasked fallback: not run.
  • Real APFS and NTFS were not measured.

Scratch: /workspace/projects/openRepoShape-worktrees/_lane1-scratch/r1189b (logs in runs/, bench in fuse/).

Lane: openreposhape-1 (openRepoShape-1)

Brett Heap and others added 2 commits October 23, 2026 12:16
…nly a set of two paths of one blob whose names differ only in their last part, `A` and `a`, and keeps folder twins and sets of three or more of one blob as the finding; its sentence says `execute` could stop there (#1161)

r1189b's review of #1189, as lane 1 ruled:
- SHOULD 1 (the preferred fix): `_one_blob_twins` now takes the
  repository a set is kept in. In the root it answers yes only for two
  paths whose names differ only in their last part, the shape measured
  to verify there (`A`/`a` of files, of symlinks to one target, of
  executables). On r1189b's FUSE disk, folder twins of one blob in the
  root (`D/x`, `d/x`) met git's `will not add file alias` in `check`, and
  three paths of one blob (`AB`, `Ab`, `ab`) in `execute` alone, after
  `check` said `plan ok`: both are the finding again, with its rename
  remediation. In the legs the NOTE is as it was, since those runs
  verified. The section comment, the module docstring's `check`
  paragraph, `_case_twin_findings`' and `_entry_findings`' docstrings say
  so.
- NIT 2: the finding says `execute` "could stop there", as file twins in
  the root verified on that disk.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…folder twins and three paths of one blob are `plan-case-twins`, two paths of one blob in one folder are the NOTE, and folder twins of one blob in the code leg stay the NOTE (#1161)

r1189b's SHOULD 1, as lane 1 ruled: `test_a_set_of_one_blob_is_a_note_and_not_the_finding`
gains folder-twins-of-one-blob-in-the-root and three-of-one-blob-in-the-root
(the finding), two-of-one-blob-in-one-folder-of-the-root and
folder-twins-of-one-blob-in-the-code-leg (the NOTE), and
`test_only_one_blob_in_one_mode_is_left_to_the_note` gains
two-of-one-blob-in-folders-in-another-case (`D/A`, `d/a`: the finding).
`twins_kept` says "could stop", as the finding now does (NIT 2).

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Base automatically changed from fix/1033-ignorecase-case-twins-index to main October 23, 2026 15:40
Brett Heap and others added 2 commits October 23, 2026 18:03
… (restack step 1 of 3: #1158 landed as ef619c7)

Lane: openreposhape-1 (openRepoShape-1)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…stack step 2 of 3)

Its one file, tests/test_adopt_check_throwaway_repos.py, conflicted and takes this branch's side: the merge of #1158's final head 1e71152 already brought #1158's content, and this branch's net change to that file is #1189's own.

Lane: openreposhape-1 (openRepoShape-1)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brett Heap and others added 2 commits November 8, 2026 16:47
Main at 1212295, which holds lane 4's #1105 squash and tests/test_adopt_collision_make_reads.py.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e out the trees that keep case twins, which check names and execute refuses as plan-case-twins (#1161)

`test_the_sentences_are_true_of_what_make_does_in_the_clone` (#1105) ran a
real adoption at `[Makefile+makefile]` and `[all-three]`, and
`test_where_the_file_make_reads_includes_makefile_the_merge_alone_is_enough`
(#1105) at `[makefile]`: sources that keep `Makefile` and `makefile` side by
side in the root, each with its own blob. Since #1161 `check` names that set
of case twins as `plan-case-twins` and `execute` refuses it before any leg,
so there is no clone to run `make` in: at the merge 47478d5 all three failed
at `adopt_with_legs_mounted_away`'s `check` (`FINDING plan-case-twins: ...
`Makefile` and `makefile``, `assert 1 == 0`).

Both parametrizes now leave out the rows `keeps_twins` (from
`test_adopt_make_reads_first`) names, as 7d2f651 did in
`test_adopt_next_make_reads_first.py`, and each docstring says why, and that
`test_execute_refuses_makefile_beside_makefile_before_any_leg` pins the
refusal for those trees. Every other row is as it was: the clone test runs 5
of CLONES, the include test its `[GNUmakefile]` row, and the file's other
functions, which call `_predict_collisions` and `follow_ups_for` and run no
`check`, all their rows, `[Makefile+makefile]` and `[all-three]` among them.

Measured on CPython 3.12, the whole file: at 47478d5 3 failed, 28 passed;
with this change 28 passed, the same 28 node ids.

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

Copy link
Copy Markdown
Contributor Author

(lane openRepoShape-1, 2026-11-08T17:15:31Z) Lane 1's check of #1189 after #1105 landed: main is merged in, and the agreed cut of #1105's case-twin rows is 472944b5. #1189's own change is unchanged, and READY carries to 472944b5.

Lane: openreposhape-1 (openRepoShape-1)

@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 2026

Copy link
Copy Markdown

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

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

@brettheap
brettheap merged commit 9cb156a into main Nov 9, 2026
4 of 5 checks passed
@brettheap
brettheap deleted the fix/1161-check-names-case-twins branch November 9, 2026 21:22
brettheap pushed a commit that referenced this pull request Nov 9, 2026
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]>
brettheap pushed a commit that referenced this pull request Nov 9, 2026
's branch

The one conflict is the module docstring of
tests/test_adopt_check_throwaway_repos.py, where both sides add a
paragraph after #1161's: #1183's two and main's #1136. Both are kept,
each side's sentences unchanged: #1183's two right after #1161's,
whose "a disk that ignores case" their "such a disk" names, then
#1136's, as #1189's own merge kept #1161's right after #1033's.
adopt-project.py merged by itself.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap pushed a commit that referenced this pull request Nov 9, 2026
9cb156a, #1189's squash on main, holds the tree of its final head
dae7250, merged in the commit before. The branch's side is taken for
every path in `git diff --name-only 9cb156a^ 9cb156a`: adopt-project.py,
tests/test_adopt_check_throwaway_repos.py,
tests/test_adopt_collision_make_reads.py,
tests/test_adopt_make_reads_first.py and
tests/test_adopt_next_make_reads_first.py. `git ls-files -u` was empty
and `git write-tree` equals the parent's tree, ea81fe8.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap pushed a commit that referenced this pull request Nov 9, 2026
Main's three commits after #1189's squash 9cb156a (#1207, #1201 and
#1164) merge by themselves; #1207's adopt-project.py change meets none
of this branch's hunks.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Nov 10, 2026
…1138 row keeps in the root once as `plan-case-twins`, and still names each twin at the copy, above it, at the manifest and at a pin's file, and each bad link by its own finding (#1293)

Follow-up to #1189 and #1170. This mends main's red `tests` run after #1189 landed. It changes rows of one test file and no code.

## Cause

- #1170 (squash `40cb8086f`) added rows that keep a pair of case twins in the assembly root, where the shape writes, and count every finding `check` makes for them.
- #1189 (squash `9cb156a98`) made `check` name each set of case twins a plan keeps in one repository as `plan-case-twins`: one finding per repository, or a NOTE for a set of one blob (in the root, two paths in one folder). Its H0 `472944b5` was tested before #1170 landed, so the two changes first ran together on main.
- Main's push run on `9cb156a98` failed with 13 failed, 21142 passed and 405 skipped, all 13 in this file. The run on its parent `5c662f75` passed. #1273's `tests` run failed with the same 13 and no other (13 failed, 21186 passed, 405 skipped).
- Every failure is `assert 3 == 2`, or `3 == 1 + 1`: one finding MORE than the row counts, not one fewer. "The second finding is lost" and "the twin is not named" are the rows' own messages for a wrong count. Nothing was lost.

## The decision, row by row

I measured this at `370a23cd`. Each row's scenario was rebuilt with the file's own helpers (`planned_root`, `check_root`), and every finding was printed. In each row, every finding #1170 demands is made. The one extra line is `plan-case-twins` for the assembly root, naming exactly the row's pair. So each row should expect it, and the code stays.

| Row | `plan-case-twins` names | #1170's findings, still made at main |
|---|---|---|
| `test_a_named_link_leaves_out_its_own_finding_and_no_other[a-case-twin-of-the-readme-copy]` | `Shape/README.md` and `shape/README.md` | `plan-bad-symlink-target` for the link `shape/README.md`, once; `plan-root-blocks-shape-copy` for the file `Shape/README.md` once case is ignored |
| `...[a-case-twin-after-the-readme-copys-link]` | `shape/README.md` and `shape/readme.md` | `plan-bad-symlink-target` for `shape/README.md`, once; the copy's finding for the file `shape/readme.md` |
| `test_a_case_twin_beside_a_link_git_makes_at_the_copy_is_named_too[a-twin-before-the-link]` | `Shape/README.md` and `shape/README.md` | the copy's finding for the symlink `shape/README.md`, and one for the file `Shape/README.md` |
| `...[a-twin-after-the-link]` | `shape/README.md` and `shape/readme.md` | the copy's finding for the symlink `shape/README.md`, and one for the file `shape/readme.md` |
| `test_a_link_twin_at_the_copy_is_named_once_by_the_copys_finding[a-link-twin-after-a-file]` | `shape/README.md` and `shape/readme.md` | the copy's finding for the file `shape/README.md`, and one for the symlink `shape/readme.md`; no `plan-root-symlink` |
| `...[a-link-twin-after-a-link]` | `shape/README.md` and `shape/readme.md` | the copy's finding for each symlink; no `plan-root-symlink` |
| `test_each_file_twin_above_a_place_the_shape_writes_is_named[a-file-after-a-named-link-above-the-copy]` | `SHAPE` and `Shape` | `plan-bad-symlink-target` for `SHAPE`; the copy's finding, inside the file `Shape` once case is ignored |
| `...[a-file-after-a-named-link-above-the-shapes-scripts]` | `SCRIPTS` and `Scripts` | `plan-bad-symlink-target` for `SCRIPTS`; `plan-root-blocks-shape`, inside the file `Scripts` |
| `test_a_case_twin_after_a_submodule_at_the_copy_is_named` | `shape/README.md` and `shape/readme.md` | the copy's finding for the file `shape/readme.md`; `plan-submodule-root` for `shape/README.md` |
| `test_each_case_twin_at_the_manifest_is_named[a-file-twin-after-a-link-git-makes]` | `Project.yaml` and `project.yaml` | `plan-root-blocks-manifest` for the symlink `project.yaml`, and one for the file `Project.yaml` |
| `...[a-file-twin-after-a-named-link]` | `PROJECT.yaml` and `Project.yaml` | `plan-bad-symlink-target` for `PROJECT.yaml`, with the manifest's tail; the manifest's finding for the file `Project.yaml` |
| `...[a-named-link-after-a-file-twin]` | `PROJECT.yaml` and `Project.yaml` | `plan-bad-symlink-target` for `Project.yaml`, with the manifest's tail; the manifest's finding for the file `PROJECT.yaml` |
| `test_a_case_twin_after_a_named_link_at_a_pin_file_is_named` | `contracts/SHAPE-pin.yaml` and `contracts/Shape-pin.yaml` | `plan-bad-symlink-target` for `contracts/SHAPE-pin.yaml`; `plan-root-holds-pin` for the file `contracts/Shape-pin.yaml` |

## Why the rows, and not the code

- **A different fault.** `plan-case-twins` says that two source paths one repository keeps are one name on a disk that ignores case, and its fix is a rename in the source. The copy's, the shape's, the manifest's and the pin's findings say that a kept path stands where the shape writes, and their fix is to send it to a leg, `drop` it, or rename it. Neither finding implies the other:
  - `A` and `a` with their own blobs in the root are `plan-case-twins` and stand at no place of the shape's;
  - the control `a-link-twin-alone` is the copy's finding and keeps no pair.
- **Nothing #1170 demands is lost or doubled.** Each twin is still named by the finding of the place it stands at. Each bad link is still named once, by its own finding. No `plan-root-symlink` names a link at the copy, and #908's remediation is still said once, since `plan-case-twins`'s remediation is its own.
- **#1189's rules hold in these rows.** There is one `plan-case-twins` for the root, naming the pair in tree order. Two rows that passed keep two files of one blob above the copy and above `scripts/`, and get #1189's NOTE and no finding.
- **#1189 did the same for rows of other files that met its finding.** It changed two params of `tests/test_adopt_make_reads_first.py`, and left trees with twins out of `tests/test_adopt_collision_make_reads.py` and `tests/test_adopt_next_make_reads_first.py`. These rows are about case twins, so they keep the pair and expect the finding.

## What changes

- `apart_from_the_twins(result, *twins)` is new. It asserts one `plan-case-twins` finding for the assembly root that names the pair in tree order. Where the row keeps fewer than two such paths, it asserts that no such finding is made. It returns the other findings, which the row counts as before.
- The 7 tests that meet the pair call it, over 18 ids:
  - the 13 that failed;
  - 5 that passed and now also assert that no such finding is made. 3 keep no pair, and 2 keep two files of one blob, which #1189 makes a NOTE.
- The module docstring says so, and so does one row's docstring.

## Tests

The tests ran under a stub `gh` with a bogus token, an empty `GH_CONFIG_DIR`, `GIT_CONFIG_GLOBAL=/dev/null` and `GIT_SSH_COMMAND=false`, on CPython 3.12.

- `tests/test_adopt_symlink_target_bytes.py`:
  - at `370a23cd` (main), 13 failed and 137 passed, the 13 ids of the CI runs;
  - at `5c662f75` (before #1189), 150 passed;
  - at this head, 150 passed.
- Mutants of `adopt-project.py`, run against the 7 tests' 18 ids, each restored and its blob checked against HEAD's: 6 of 6 killed, with the unmutated control at 18 passed.
  - M1, the root asked for no set: 13 of 18 fail.
  - M2, the finding said twice: 13 fail.
  - M3, every set a NOTE: 13 fail.
  - M4, no set a NOTE: 2 fail, the two rows with two files of one blob. The new "no such finding" assertion kills it, and the rows' counts do as well (r1293).
  - M5, `_kept_there` keeping the first row at a place (#1170's regression): 7 fail, so #1170's counts still bite through the helper.
  - M6, the pair named in reverse: 13 fail.
- The gate at this head, call by call:
  - `tests/test_adopt_check_throwaway_repos.py`, `tests/test_adopt_collision_make_reads.py`, `tests/test_adopt_make_reads_first.py` and `tests/test_adopt_next_make_reads_first.py` (#1189's files): 294 passed, 2 skipped.
  - `tests/test_scaffold_leg_path_collisions.py`, `tests/test_path_guard_hygiene.py` and `tests/test_no_auto_maintenance.py`: 283 passed, 2 skipped.
  - `tests/test_agents_md_codes.py`, `tests/test_cli_reference.py` and `tests/test_repo_hygiene.py`: 171 passed.
  - #1170 changed no other test file (`git show --stat 40cb808`: `adopt-project.py` and this file). No other test file imports this one.
  - `adopt-project.py` is unchanged, so `tests/test_shape_doctor.py` was not run.

## The fallback, measured

`git revert --no-commit 9cb156a` on `370a23cd` applies cleanly: four files auto-merge and none conflicts. `tests/test_adopt_symlink_target_bytes.py` then gives 150 passed. No other file was run on that tree. A revert would take back #1189's `plan-case-twins`; this PR keeps both changes.

## Known limits

- `apart_from_the_twins` takes a pair, joined as `check` joins two paths ("`A` and `B`"). A row that keeps three twins would need the three-way join `check` prints.
- The rows assert the finding's head and the pair, not its place among the findings. `_entry_findings` puts it after the source's own findings, such as `plan-bad-symlink-target`, and before the findings about the answers.

## Not in this PR

- Any change to `adopt-project.py`.
- Twins a kept path makes with a file the shape writes into the root (#1191), and twins the plan sends to different repositories (#1183). Both are #1189's follow-ups.

This is outside v1.2.0, by Brett Heap's ruling at 2026-10-21T10:32:04Z.

It lands on its own green `tests` and SonarCloud run at `d3143d84` (its H0), with every lane's landings stopped while main was red (fast-refresh rule 5, Brett Heap 2026-10-15T22:48:35Z). Lane 1's gate passed on the tree it lands: 5 pytest calls over `tests/test_adopt_symlink_target_bytes.py`, `tests/test_adopt_check_throwaway_repos.py`, `tests/test_adopt_collision_make_reads.py`, `tests/test_adopt_make_reads_first.py`, `tests/test_adopt_next_make_reads_first.py`, `tests/test_scaffold_leg_path_collisions.py`, `tests/test_path_guard_hygiene.py`, `tests/test_no_auto_maintenance.py`, `tests/test_agents_md_codes.py`, `tests/test_cli_reference.py`, `tests/test_repo_hygiene.py`: 898 passed, 4 skipped.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Nov 10, 2026
…`family-holder-already-here` say the branch their lines run on, and that `add` line is `_cited`, so each runs as printed from the tracking branch (#1228) (#1264)

**#1228: every `add`, `bump` and `remove` line that a `family.py` remedy prints says the branch it runs on, whichever route reached the refusal. The dry runs of `add` and `bump` that end in `member-duplicate-id`, and the `family-holder-already-here` that `init` ends in, now say it as #1201 makes `member-unknown` and `member-already-present` say it, and that `add` line is `_cited`. rv1201's one surviving mutant of #1201's rows, R5, is killed.**

**Built on #1201 at `eac177af` (itself on #1117 at `219e57c2`). Both have landed, and this PR is restacked on `main`** (#1117 as `9252ef208`, #1201 as `8cf6477fe`; see "Restacked after #1201 landed"). Its change is two commits: `b54520cea` (5 files, 442 insertions and 57 deletions) and the review round's `43d2e8b26`, 5 files, 503 insertions and 64 deletions in all (`git diff --stat eac177a 43d2e8b`). Against main `370a23cd2`, the restacked head `54b9cb20a` gives the same 5 files, the same lines and the same patch-id. It answers lane 5's review of #1201 (issuecomment-6372152028): SHOULD-1's optional code fix, and NIT-1 to NIT-3.

At `eac177af9`, as rv1201 measured it (probes p6, p7, p9) and as this PR's rows show failing there (below), three printed lines were reached with no branch read, named none, and were refused `family-on-tracking-branch` when typed where a fresh clone stands:

- **(a) `add --dry-run`'s `member-duplicate-id`.** Under `--dry-run`, `cmd_add` skips `_checked_branch` and still asks `_checked_member_id`. Its remedy printed a `remove` line and a `bump` line and no branch.
- **(b) `bump --dry-run`'s `member-duplicate-id`.** `_bump_dry_run` asks `_checked_bumped_id` before anything reads the branch. Its remedy printed a `remove` line and no branch.
- **(c) `init`'s `family-holder-already-here`.** Its remedy printed `_add_command`'s line between plain backticks: no branch clause, and not through `_cited`, so under a folder named with a backtick the first span ended at the path's backtick (RV1117's N6 shape).

- **`scripts/family.py`, (a) and (b).** `_checked_member_id` and `_checked_bumped_id` take a keyword-only `dry_run`, false by default. `cmd_add` passes `args.dry_run`, and `_bump_dry_run` passes true. The real runs' calls (`_mount_and_pin`, and `cmd_bump`'s) are unchanged, and so are their words. Set, the remedy puts `_off_the_tracking_branch` before its line or lines and ends with `BRANCH_LEFT`, as `member-already-present` does. The clause names "`bump` and `remove` refuse" for (a), whose remedy names both lines, and "`remove` refuses" for (b). Its `switch -c` names `family/remove-<id>`, the branch the `remove` line's own refusal names, so the clause and the refusal after it agree.
- **`scripts/family.py`, (c).** The remedy now says the clause with `init`'s own `git -C <holder> switch -c family/add-<Project>`, then the `add` through `_cited`, then `BRANCH_LEFT`. The issue left the branch word to the owner. This PR takes `family/add-<Project>`, bare, as the NEXT STEPS block prints it: quoted, it would read as a value.
  - Two helpers carry it. `_add_branch_switch` spells that `switch -c` line, and NEXT STEPS now calls it too, with the same bytes as before. `_branch_clause` holds the clause's words around a `switch -c` line already spelled, and `_off_the_tracking_branch` now calls it.
  - The code comments at the two `member-duplicate-id` asks and `_off_the_tracking_branch`'s docstring now say that a dry run states the refusal before the branch is read, and a real run after it.
- **`tests/test_readme_windows_quoting_sentence.py`.** `NAMED` moves one host-quoter call from `_print_next_steps` to `_add_branch_switch`, and `FAMILY_LINES` moves the `switch -c` kind with it. README's sentence already lists `switch -c`, so README.md and `docs/handbook.html` are unchanged. The changed remedies' words appear in no doc. The release notes name `member-duplicate-id` as a code (v1.0.0) and the `family/add-<Project>` spelling (v1.1.0). AGENTS.md and `templates/family-root/` show `git -C <path> switch -c family/add-<Project>` as NEXT STEPS print it. None of that changes.
- **`tests/test_family_remedy_lines.py`.** The new rows type each line as printed from the tracking branch. Typed alone, each line is refused `family-on-tracking-branch`. Typed after the clause's `switch -c`, it exits 0, and the holder is clean and its gate green:
  - (a): `test_add_dry_runs_duplicate_id_lines_run_from_the_tracking_branch`, `[remove]` and `[bump]`;
  - (b): `test_bump_dry_runs_duplicate_id_remove_runs_from_the_tracking_branch`;
  - (c): `test_init_holder_already_heres_add_runs_as_printed_after_its_switch`, `[plain]` and ``[a`b]``.
  - **NIT-1:** `test_a_rows_name_with_a_space_is_one_word_in_both_lines` now asserts the `switch -c` line, `family/bump-irrs`, which is built from the row's `id:`. That kills R5, which builds it from the name and gets `family/bump-member`.
  - **NIT-2:** `typed()`'s docstring says that it asserts the interpreter's name and does not look it up on PATH.
- **`tests/test_family_bump_to_checks.py`.** Its two `member-duplicate-id` rows used to assert that both runs print the same words. They now pin the real run's words as at `eac177af9` and the dry run's with the clause (`both_refused`, `duplicate_id_refusal(dry_run=True)`).
- **`tests/test_family_dry_run.py`.** `duplicate-id` leaves the parametrized "same under `--dry-run`" row and gets a row of its own, `test_add_dry_runs_duplicate_id_names_the_branch_the_real_run_has_read`. It pins the same code, detail, stdout and exit for both runs, and the dry run's remedy as the real one with the clause added and `BRANCH_LEFT` at the end.
- **NIT-3 is left.** `member-already-present` still suggests `family/bump-<id>` for both of its lines. (a)'s clause likewise names one branch, `family/remove-<id>`, for both its `remove` and its `bump`. Either branch works for both verbs, since anything but the tracking branch does.

rv1264 (opus) found this PR READY at `b54520cea` with two NITs (issuecomment-6724775227). The round's commit, `43d2e8b26`, is the PR's second: 2 files, 67 insertions and 13 deletions (`git diff --stat b54520c 43d2e8b`), `scripts/family.py` and `tests/test_family_remedy_lines.py`. With both commits the change is 5 files, 503 insertions and 64 deletions (`git diff --stat eac177a 43d2e8b`). The Goal, `What held on #1201's head`, `What changed` and `Rows that fail on #1201's head` describe `b54520cea`, the first commit. Mutants, Runs, Merge-trees and one bullet of Limits are read again at `43d2e8b26`.

- **NIT-1: the fourth bare `"Remediation: "`.** SonarCloud reported it on this PR as python:S1192 (key `AaG7-FM2kL7yTWvgodeV`): the (c) hunk's `"Remediation: "` at `scripts/family.py:2530` was a fourth copy of that literal after #1201's three (`:1713`, `:6577`, `:9497`). `_landing` now builds the clause first, ``clause = _branch_clause(_add_branch_switch(into / family), "`add` refuses")``, and the third argument of the `Refusal` starts `f"Remediation: {clause}"`. #1201's three are untouched, and `grep -n '"Remediation: "' scripts/family.py` lists exactly those three. SonarCloud's analysis of `43d2e8b26` is not read here.
  - **The refusal's words are byte for byte what they were.** A probe (`probe/remedy.sh`) ran `init` over a family folder that already holds its holder, once with `b54520cea`'s `family.py` and once with this commit's, swapped into the same detached tree, from the same working directory and by the same script path, for a plain folder and for one named ``a`b``. The two refusal lines (the `REFUSED` line and the remediation) are identical under `cmp`: plain 1156 bytes, ``a`b`` 1148 bytes, each with exit 2 and an empty stdout. The swapped run printed one `WARNING ... DIRTY` line before them, which the swap itself caused (it dirtied that tree); the file was restored with its sha256 checked (`88ad8766f4e2...`) and `git status` clean.
  - **The rows that pin the text pass.** `test_init_holder_already_heres_add_runs_as_printed_after_its_switch[plain]` and ``[a`b]`` compare the remediation with the expected words and pass at `43d2e8b26` (gate A, below), on git 2.43.0 and 2.47.1.
- **NIT-2: M10a and M10b are killed.** They survived because every fixture row's `id:` is its name lowercased, so a branch built from the name is the same word. Two rows in `tests/test_family_remedy_lines.py`, after (a) and (b)'s dry-run rows, rename a row by hand to a valid name that is not its id, and assert the clause's `switch -c` line as printed:
  - `test_add_dry_runs_clause_branch_is_made_from_the_rows_id`: `IRRS` renamed `Orrs`. `add --dry-run` of `IRRS2` is refused `member-duplicate-id`, and the clause names `family/remove-irrs`, not `family/remove-orrs`.
  - `test_bump_dry_runs_clause_branch_is_made_from_the_other_rows_id`: `IRSS` renamed `Osss`. `bump --dry-run` of `IRRS` to the commit whose `project.yaml` records `irss` is refused the same way, and the clause names `family/remove-irss`, not `family/remove-osss`.
  - The hand edit of the row's `project:` line is a helper, `renamed_by_hand(holder, project, name)`, which the ``IR RS`` row (RV1201's NIT-1) now calls too, so it is written once. That row's asserts are unchanged.
  - **Each row fails on its mutant and passes at the head.** M10a alone fails the first row and only that row (`family/remove-orrs` against `family/remove-irrs`), and M10b alone fails the second row and only that row (`family/remove-osss` against `family/remove-irss`): 1 failed, 18 passed in each run of the file's 19 ids. `scripts/family.py` came back to sha256 `b7f0d8c5f2db...` after each, with `git status` clean.
  - **Both rows fail on #1201's production code.** With `eac177af9`'s `family.py` (sha256 `b8199379c23f...`) swapped in under this commit's tests, in the same detached tree: 2 failed, each on `[] == [the switch line]`, since #1201's dry runs print no clause. Restored (sha256 `b7f0d8c5f2db...`), `git status` clean.

#1201 landed as the squash `8cf6477fe`. Its final head was `d1ecf815`, a fast refresh of `24b6a0af`. #1117 had landed before it, as `9252ef208`, and #1201's head already carried #1117's final head, its squash and main (`85909e973`, `24b6a0af6`, `d1ecf8159`), so the first step of the restack plan this body named on 2026-11-08 was #1201's own. Once #1201's branch was deleted, GitHub retargeted this PR to `main`, where it was CONFLICTING. The restack is three merges on top of `43d2e8b26`, with no rebase, amend or force:

| step | merged | commit | result |
|---|---|---|---|
| 1 | #1201's final head `d1ecf815` | `5b5e652a9` | clean; tree `913e2e4b5`, as `git merge-tree` predicted |
| 2 | #1201's squash `8cf6477fe` | `db82ce1d4` | 21 blocks in 4 files, all #1201's own, each resolved to this branch's side; the tree stays `913e2e4b5` |
| 3 | main `370a23cd2` (#1164) | `54b9cb20a` | clean, no block to resolve; tree `245b4d057`, as `git merge-tree` predicted on git 2.43.0 and 2.47.1 |

- **Step 2's resolutions.** The 21 blocks are 7 in `scripts/family.py`, 2 in `tests/test_family_bump_to_checks.py`, 10 in `tests/test_family_remedy_lines.py` (add/add) and 2 in `tests/test_readme_windows_quoting_sentence.py`. All four are files of #1201's squash. Each block takes this branch's side, because that side already holds all of #1201: step 1 merged `d1ecf815`, and the squash's tree is `d1ecf815`'s tree (`4daf6ffbc` both). So the merge changed no file (`git diff 5b5e652 db82ce1` is empty). The blocks arise only because the squash has another history, so git meets #1201's lines from both parents.
- **Step 3.** Main was still the squash itself when steps 1 and 2 were made, so step 3 was first a no-op. #1164 (for #1110, lane 1's) landed after, as `370a23cd2`. It changes `scripts/family.py` (121 insertions, 19 deletions), `templates/family-root/scripts/siblings.py`, `tests/test_family_gitmodules_unreadable.py` (new) and `tests/test_path_guard_hygiene.py`. Git merged `scripts/family.py` by itself, and no block needed a resolution:
  - #1164's hunks are the `.gitmodules` readers (`_gitmodules_on_disk`, `_gitmodules_names`, `_sections_giving`, `_stages_as`), `PinRollback`, and two new constants. None is one of this PR's functions.
  - #1164 gives `_stages_as` a third argument, and nothing in this PR calls it.
  - `gitmodules-unreadable`'s remedy names no `add`, `bump` or `remove` line, so #1228's rule does not reach it.
  - Main's side arrives whole: `git diff db82ce1 54b9cb2` has #1164's own patch-id (`6e4840bd5eb9` stable, `f7efc1a3949e` verbatim, as `git diff 8cf6477 370a23c` has).
- **The diff is the reviewed one.** The PR's diff against main is rv1264b's reviewed change, `eac177af9..43d2e8b`, line for line:

| diff | files | lines | `git patch-id --stable` | `--verbatim` |
|---|---|---|---|---|
| reviewed, `git diff eac177a 43d2e8b` | 5 | +503/-64 | `1b6607fb4fb6` | `cd18d2c2923a` |
| restacked, `git diff 370a23c 54b9cb2` | 5 | +503/-64 | `1b6607fb4fb6` | `cd18d2c2923a` |

  - Per file, both ids match for each of the five: `scripts/family.py` `c7ba1df7d359`/`5493f2e74dc9`, `tests/test_family_bump_to_checks.py` `aae56e7a6cc6`/`1f54d542931a`, `tests/test_family_dry_run.py` `b616211c203d`/`9e7124f21c75`, `tests/test_family_remedy_lines.py` `1820a6895cf4`/`9f3e05c13738`, `tests/test_readme_windows_quoting_sentence.py` `dc8eb3e39264`/`1d81e0e45ca9`. The same ids come out of git 2.43.0 and 2.47.1.
  - The four test files have the same blobs on both sides of both diffs.
  - `scripts/family.py`'s pre-image is main's, so its hunks start later by the lines main added above them: 6 lines (#1166's `105b5daf9`, for #1139) up to `cmd_add`, and 89 from `_checked_bumped_id` on (46 more from #1098's `ac5f28d2a`, for #1086, 37 from #1164). With the `index` lines and the hunk line numbers masked, the two diffs are byte-identical (888 lines); unmasked, they differ in 34 lines, all `index` and `@@` lines.
  - No hunk differs, so no file's patch-id changed, and no resolution in the three merges touched this PR's lines.
- **The PR lists 12 commits now.** A squash does not carry its branch's commits by ancestry, so GitHub also lists #1117's and #1201's own commits (`10dc011c9`, `eac177af9`, `219e57c28`, `8cb9c729a`, `85909e973`, `24b6a0af6`, `d1ecf8159`) beside this PR's two and its three merges. Its diff is the 5 files above.

The commit's new and changed rows (73 ids: the 5 new `test_family_remedy_lines.py` ids and the NIT-1 row, the 2 `test_family_bump_to_checks.py` rows, `test_family_dry_run.py`'s new row and the 18 ids of its parametrized row, and the 46 ids of `test_readme_windows_quoting_sentence.py`) were run with `eac177af9`'s `scripts/family.py` (sha256 `b8199379c23f...`) swapped in under this commit's tests, in a second worktree. The file was restored after the run and its sha256 checked: `88ad8766f4e2...`, matching, with `git status` clean. Result: **9 failed, 64 passed**, every failure an `AssertionError` on the remedy text:

| row | on `eac177af9`'s `family.py` |
|---|---|
| (a) `[remove]`, `[bump]` | fail: the remedy ends "...not in the family." with no clause and no `BRANCH_LEFT` |
| (b) | fail, the same way |
| (c) `[plain]`, ``[a`b]`` | fail: the remedy ends "There is no --force." with no clause |
| `test_family_dry_run.py`'s new row | fail, as (a) |
| the 2 `test_family_bump_to_checks.py` rows | fail on the dry run's assert; the real run's assert just before it passes, so the real run's words are unchanged |
| `NAMED[scripts/family.py]` | fail: there is no `_add_branch_switch` |
| the NIT-1 row, the 18 parametrized ids, the other 45 sentence ids | pass, as they should: #1201 already builds the branch from the `id:` (the assert kills R5, below), and the rest pin unchanged behaviour |

Each was applied alone in the second worktree at `b54520cea` (clean), run through lane 5's runner, and restored, with the sha256 of every touched file checked and `git status` clean after each. The #1228 mutants ran against all 73 ids above (84 with the rest of `test_family_remedy_lines.py`); M8 also ran against `tests/test_git_bash_dialect.py` and `tests/test_family_switch_branch_exists.py`, which read NEXT STEPS.

| id | mutation | result |
|---|---|---|
| M1 | (a)'s clause dropped | killed, 3: (a) `[remove]`, `[bump]`, `test_family_dry_run.py`'s new row |
| M2 | (b)'s clause dropped | killed, 3: (b), the 2 `test_family_bump_to_checks.py` rows |
| M3 | (c)'s clause dropped | killed, 2: (c) `[plain]`, ``[a`b]`` |
| M4a | `dry_run` ignored in `add` (always false) | killed, 3, as M1 |
| M4b | `dry_run` ignored in `bump` (always false) | killed, 3, as M2 |
| M5 | (c) without `_cited`: the `add` between plain backticks | killed, 1: (c) ``[a`b]`` |
| M6 | (a)'s branch is `bump`'s, not `remove`'s | killed, 3, as M1 |
| M7 | (a) without `BRANCH_LEFT` | killed, 3, as M1 |
| M8 | (c)'s placeholder branch quoted for the shell | killed, 2: (c) both; the two NEXT STEPS files pass (the shell reads the quoted word the same) |
| M9 | (c) without `BRANCH_LEFT` | killed, 2: (c) both |
| M10a | (a)'s branch from the row's name, not its `id:` | **killed**, 1: `test_add_dry_runs_clause_branch_is_made_from_the_rows_id` (it survived at `b54520cea`, 84 passed) |
| M10b | (b)'s branch from the row's name, not its `id:` | **killed**, 1: `test_bump_dry_runs_clause_branch_is_made_from_the_other_rows_id` (it survived at `b54520cea`, 84 passed) |
| M11 | (a)'s `dry_run` inverted: the real run gets the clause | killed, 3, as M1 |
| M12 | (c)'s `switch -c` names `--into`, not the holder | killed, 2: (c) both |
| M14 | (a)'s clause names one verb, "`remove` refuses" | killed, 3, as M1 |
| M15 | `_branch_clause` prints its `switch -c` bare | killed, 11, across every clause row |
| M3b | NIT-1's `f"Remediation: {clause}"` without its clause | killed, 2: (c) `[plain]`, ``[a`b]`` |
| R1 | rv1201's: `_cited` always prints the command bare | killed, 15 of the file's 17 |
| R2 | rv1201's: the typed owner is the first path segment | killed, 6 |
| R3 | rv1201's: `_family_line` quotes for `sh` on every host | killed, `NAMED[scripts/family.py]` |
| R4 | rv1201's: `member-already-present` loses its clause | killed, 4 |
| R5 | rv1201's: `member-already-present`'s branch from the name | **killed** by NIT-1's assert, `test_a_rows_name_with_a_space_is_one_word_in_both_lines` (it survived at `eac177af9`) |
| R6 | rv1201's: `member-already-present` names the typed project | killed, 4 (3 in `test_family.py`) |
| R7 | rv1201's: README and the handbook drop `cd` from the sentence | killed, `test_the_kinds_of_family_lines_are_the_ones_the_sentence_lists` |

M1 to M9 are n1228's, and they cover the issue's list: the clause dropped from each of (a), (b) and (c), `dry_run` ignored, and `_cited` dropped from (c). M10a to M15 are the first commit's own, and M3b the second's. R1 to R7 are rv1201's again: R1 to R6 against `test_family_remedy_lines.py`, with R6 also against `test_family.py`'s spelling row, and R3 and R7 against the sentence file. `scripts/family.py` came back to sha256 `88ad8766f4e2...` after each run, README.md to `71d9fecafbd6...` and `docs/handbook.html` to `1d01f0823e60...` after R7, and `git status` was clean after the last one. At `43d2e8b26`, M10a, M10b and M3b each ran alone in the same detached tree, clean at that commit, over `tests/test_family_remedy_lines.py`'s 19 ids (1 failed and 18 passed, 1 failed and 18 passed, 2 failed and 17 passed), with `scripts/family.py` back to sha256 `b7f0d8c5f2db...` after each and `git status` clean after the last. The other rows' results are those of `b54520cea`, which rv1264 re-ran and matched.

### At the restacked head `54b9cb20a` (after #1201 landed)

All through lane 5's `run10.sh`, in the environment the next section names. Every `START` line reads `head=54b9cb20ac18be672fedad4f69e648f97a85e4e8` and `dirty=0`, on Python 3.12.3, with git-filter-repo 2.47.0 (CI's pin) on PATH. Each run held at most 100 ids, taken from a fresh collect at the head. The 2.47.1 runs put lane 5's git 2.47.1 first on PATH, and each log's first line reads `git version 2.47.1`.

- **The gate** (32 files, 1712 ids, 18 runs on each git):
  - this PR's four test files;
  - every file that names `family.py`'s remedy lines or the codes and functions this PR changes, and `test_windows_paths.py` for the family landing: `test_bump_remedies_family_root.py`, `test_remove_add_remedies_family_root.py`, `test_family.py`, `test_family_add_member_id.py`, `test_family_printed_quoting.py`, `test_family_init_landing.py`, `test_family_init_values.py`, `test_family_members_not_a_list.py`, `test_family_bump_to_a_tag.py`, `test_family_switch_branch_exists.py`, `test_family_tracking_branch.py`, `test_git_bash_dialect.py`, `test_branch_left_bump_leg_setup.py`, `test_bump_leg_paste_lines.py`, `test_dry_run_parity.py`, `test_windows_paths.py`, and the `test_validate_family_*` five (`branch_step`, `duplicates`, `remedies_typed`, `typed_states`, `unnamed_mounts`);
  - the hygiene five (`test_repo_hygiene.py`, `test_agents_md_codes.py`, `test_cli_reference.py`, `test_pinned_copy_text.py`, `test_path_guard_hygiene.py`) and `tests/test_no_auto_maintenance.py`;
  - and #1164's new `tests/test_family_gitmodules_unreadable.py`.
- **#1164's `family.py` files** (2 files, 106 ids, 2 runs on each git): `tests/test_family_py_unreadable.py` and `tests/test_family_bump_remove_rollback.py`. #1164's own gate ran them for the `family.py` code it changes, so main's side is shown to hold on the merged tree.

| run | git | result | logs |
|---|---|---|---|
| the gate, 1712 ids in 18 runs | 2.43.0 | **1691 passed, 21 skipped**, none failed (1056.2s in all) | `work/n1228g/logs/g243-gate-part-00.log` to `-17.log` |
| the gate, 1712 ids in 18 runs | 2.47.1 | **1691 passed, 21 skipped**, none failed (1047.2s in all) | `work/n1228g/logs/g2471-gate-part-00.log` to `-17.log` |
| #1164's two `family.py` files, 106 ids in 2 runs | 2.43.0 | **106 passed** (99.6s) | `work/n1228g/logs/g243-extra-part-00.log`, `-01.log` |
| #1164's two `family.py` files, 106 ids in 2 runs | 2.47.1 | **106 passed** (98.1s) | `work/n1228g/logs/g2471-extra-part-00.log`, `-01.log` |

- **The 21 skips are the same on both gits:**
  - 16 at `tests/test_family_init_values.py:229`: "this template quotes the placeholder: the run is fine, and test_a_quoted_value_is_held_as_typed runs it";
  - 3 at `tests/test_family_init_values.py:301`: "this template quotes `id:`: the derived id reads back";
  - 2 at `tests/test_no_auto_maintenance.py:222`: "the session began with GIT_CONFIG_GLOBAL set, and its file includes that one" (the runner sets `GIT_CONFIG_GLOBAL=/dev/null`).
- **No run failed, and none was run again.** `tests/test_family_dry_run.py::test_bump_dry_run_of_a_repair_to_the_pinned_commit_is_a_move[digest]`, which failed once before the restack (see Limits), passed on both gits. The full suite was not run.

### Before the restack (`b54520cea` and `43d2e8b26`)

All through lane 5's `run10.sh`: a `gh` stub first on PATH, `GH_TOKEN` bogus, an empty `GH_CONFIG_DIR`, a blank git identity, `GIT_SSH_COMMAND=false`, `GIT_CONFIG_GLOBAL=/dev/null`, `EMAIL` exported, and git-filter-repo 2.47.0 (CI's pin) on PATH. Every `START` line reads `head=b54520cea716b44df1a95139a46901a478d616fd` and `dirty=0`, with three exceptions. The swapped run and each mutant read `dirty=1`, the one file changed, except R7, which changes two and reads `dirty=2`. The predicted merge's run names its own head. Python 3.12. The second commit's runs, marked in the table, read `head=43d2e8b26...` and `dirty=0`, except the mutants' and the swapped runs, which read `dirty=1`, and the pre-commit run of the new rows, which read `head=b54520cea...` and `dirty=2`.

- **Gate A** (13 files): the issue's eight (`test_family_remedy_lines.py`, `test_readme_windows_quoting_sentence.py`, `test_remove_add_remedies_family_root.py`, `test_bump_remedies_family_root.py`, `test_family.py`, `test_family_add_member_id.py`, `test_family_bump_to_checks.py`, `test_family_printed_quoting.py`), `test_family_dry_run.py`, which this commit changes, and four of the hygiene five (`test_repo_hygiene.py`, `test_agents_md_codes.py`, `test_cli_reference.py`, `test_pinned_copy_text.py`). The fifth, `test_path_guard_hygiene.py`, is not at this head. #1201 sits on #1117's older head `10dc011c9`, whose base `6da757cbe` predates #1111. #1117's current head, `219e57c28`, has it from its merge of main. It runs on the predicted merge instead.
- **Gate B** (9 files), which name the changed functions and codes: `test_family_init_landing.py`, `test_git_bash_dialect.py`, `test_family_switch_branch_exists.py`, `test_family_tracking_branch.py`, `test_validate_family_branch_step.py`, `test_validate_family_remedies_typed.py`, `test_validate_family_duplicates.py`, `test_family_members_not_a_list.py`, `test_family_bump_to_a_tag.py`.

| run | git | result | log |
|---|---|---|---|
| the commit's new and changed rows (73 ids) | 2.43.0 | **73 passed** in 69.23s | `logs/rows.log` |
| the same 73 ids, `eac177af9`'s `family.py` swapped in | 2.43.0 | **9 failed, 64 passed** (above) | `logs/baserows.log` |
| gate A | 2.43.0 | 1 failed, 662 passed in 413.56s (the one failure is in Limits) | `logs/gateA243.log` |
| gate A again | 2.43.0 | **663 passed** in 509.19s | `logs/gateA243b.log` |
| gate A | 2.47.1 | **663 passed** in 421.81s | `logs/gateA247.log` |
| gate B | 2.43.0 | **389 passed** in 261.02s | `logs/gateB243.log` |
| gate B | 2.47.1 | **389 passed** in 340.68s | `logs/gateB247.log` |
| gate A, gate B and `test_path_guard_hygiene.py` (23 files) on the predicted merge, scratch commit `e22074def` (below), `head=e22074def...` | 2.43.0 | **1174 passed** in 790.16s | `logs/merged243.log` |
| the row that failed once, alone, 10 runs of its 2 ids | 2.43.0 | **20 of 20 passed** | `logs/rep-head243-*.log` |
| *The review round, `43d2e8b26`:* the two new rows and the ``IR RS`` row, before the commit (tree dirty) | 2.43.0 | **3 passed**, 16 deselected in 7.50s | `work/n1228e/logs/newrows-head.log` |
| the two new rows, `eac177af9`'s `family.py` swapped in | 2.43.0 | **2 failed**, 17 deselected | `work/n1228e/logs/newrows-on-eac177af9.log` |
| M10a, M10b, M3b, each alone, over `tests/test_family_remedy_lines.py` | 2.43.0 | 1 failed 18 passed; 1 failed 18 passed; 2 failed 17 passed | `work/n1228e/logs/mut-*.log` |
| gate A (13 files), the head | 2.43.0 | **665 passed in 379.55s** | `work/n1228e/logs/gateA243.log` |
| gate A (13 files), the head | 2.47.1 | **665 passed in 372.06s** | `work/n1228e/logs/gateA247.log` |
| gate A and `tests/test_path_guard_hygiene.py` (14 files) on the predicted restack, scratch commit `f168938c4`, `head=f168938c4...` | 2.43.0 | **787 passed in 401.58s** | `work/n1228e/logs/restack243.log` |
| `tests/test_family_init_landing.py`, the file of `family-holder-already-here`'s detail | 2.43.0 | **19 passed in 8.34s** | `work/n1228e/logs/init-landing243.log` |

The 2.47.1 runs put lane 5's git 2.47.1 first on PATH, and each log's first line reads `git version 2.47.1`. No run had a skip. The full suite was not run. Gate A of the second commit is 665 ids, the first commit's 663 and the two new rows; git-filter-repo 2.47.0 (CI's pin) was on PATH in every run. `tests/test_path_guard_hygiene.py` is still not at this head (see Gate A above), so gate B (the first commit's 9 files) was not run on the second commit, which the brief did not ask for. It changes `_landing`'s remedy and one test file only.

Read on 2026-11-09 at 23:00:17Z, after fetching main at `370a23cd2`, with every open PR's head read from `gh pr list` (38 open). Of them, one other touches this PR's five files: #1274 (`scripts/family.py`). The results are the same on git 2.43.0 and 2.47.1.

| `git merge-tree --write-tree <other> 54b9cb2` | exit | result |
|---|---|---|
| main, `370a23cd2` | 0 | clean, tree `245b4d057fef`: the restacked head's own tree, since main is its parent |
| #1274, `136b38d12` | 0 | clean, tree `907bfe588d05` (with main: clean, `cdbdd63151f0`) |

- **The other 36 open PRs merge with this head as they merge with main.** Each head was merged with `54b9cb20a` and with `370a23cd2`. 34 are clean both ways. #1209 conflicts both ways in `tests/test_adopt_plan_paths_spelled.py`, and #1237 in `adopt-project.py` and `tests/test_adopt_check_throwaway_repos.py`. Neither is one of this PR's files, so neither conflict is this PR's.
- **The restack plan this body named on 2026-11-08 is done.** #1117 landed as `9252ef208` and #1201 as `8cf6477fe`, and #1201's head had taken #1117's three merges. This branch took #1201's three ("Restacked after #1201 landed"). Read from `gh pr view` after the push, at 23:21:05Z: the base is `main`, GitHub gives the PR as MERGEABLE with 5 files and 12 commits, and `closingIssuesReferences` lists #1228 only.
- **Before the restack,** on 2026-11-08 at about 17:55Z, `43d2e8b26` merged cleanly with #1201's and #1117's heads, and conflicted with main and with #1164's head only in `docs/handbook.html`, the stack's conflict, which #1117's head mended (`work/n1228e/logs/merge-trees-2.log`). The predicted restack on main `9729315f1` (scratch commit `f168938c4`) was clean, and its gate passed (787 passed, in Runs).

- **The clause's branch is built from the row's `id:`, and two rows now tell it from the name** (mutants M10a and M10b, killed since `43d2e8b26`; see the review round). Every other fixture row's id is its project lowercased, so only a row renamed by hand tells them apart. The old gap was harmless in effect, as rv1201 found for R5: the clause's `switch -c` need only leave the tracking branch.
- **NIT-3 is left** (above). It is the same question as (a)'s one branch for two verbs.
- **The interpreter is asserted, not looked up** (NIT-2). The docstring says so. rv1201 typed the lines through bash, dash and zsh with `python3` from PATH, 12 of 12.
- **The clause says "a branch other than the tracking branch".** It is worded to be true on any branch, as #1201's is, since a dry run says the refusal before the branch is read. A person already off the tracking branch reads a clause that does not apply to them.
- **`init`'s `<Project>` stays a placeholder** in the clause's `switch -c`, as NEXT STEPS print it. `add`'s own refusal names the branch lowercased; any spelling works.
- **One row failed once, in code this commit does not touch.** In the first gate A on 2.43, `tests/test_family_dry_run.py::test_bump_dry_run_of_a_repair_to_the_pinned_commit_is_a_move[digest]` failed:
  - **What it saw.** The dry run said it would commit the repair. The real run then said `nothing to do: InkRouter/IRRS is already pinned at ab0fea7e32a2 and every fact agrees.` and exited 1.
  - **Where that is decided.** The real run's answer comes from `_nothing_to_record`, a `git diff --quiet HEAD` made after `write_lf` rewrites `family.yaml` in place. The row's hand edit keeps the file's size.
  - **The commit leaves that path alone.** It changes no code of `_nothing_to_record`, `_rewrite_members`, `force_stage` or `tree_digest`. Its only `tree_digest` lines are one sentence of `_bump_dry_run`'s docstring, rewrapped. The row has no duplicate id, so the `dry_run` flag in `_checked_bumped_id` never shows.
  - **Every other run passed it:** the second gate A on 2.43, gate A on 2.47.1, the predicted merge's run, and 20 of 20 runs alone.
  - **The cause is not found.** A probe of the plain race (a same-size, in-place rewrite right after `git add` and `git commit`, then `git diff --quiet HEAD`) missed none of 200 rewrites on 2.43.0 and none of 200 on 2.47.1. The failure's log is `logs/gateA243.log`, and the probe is `probe/racy.py`.
- **`tests/test_path_guard_hygiene.py` runs at the head now.** Before the restack it was not at the PR's head and ran on the predicted merges only (see Runs). This PR adds no file-system guard: its `family.py` hunks add no `is_file`, `is_dir`, `exists`, `is_symlink` or `os.path` call.
- **The runs are on the bench's Python 3.12; CI runs 3.14.** No test line this commit adds uses `ast.dump`, `repr(`, `sys.version` or `!r`. The 442 added lines are ASCII and at most 79 columns. None of the commit's new asserts joins conditions with `and` or `or`. The one such assert in `test_family_dry_run.py` (line 1431) is `eac177af9`'s line 1394, moved down.
- **Not run:** the full suite, a real Windows host, and macOS.
- **#1117 and #1201 have landed,** and the restack plan this body named is done ("Restacked after #1201 landed").

Review: rv1264, lane 5's independent opus reviewer, which wrote none of #1264: READY at `b54520ce` (issuecomment-6724775227), with no MUST or SHOULD and two NITs; the review round `43d2e8b2` fixes both. Then rv1264b, lane 5's independent sonnet reviewer, which wrote none of it: READY at `43d2e8b2` (issuecomment-6725329517); its NIT-A (the Goal paragraph) is corrected in the body. Then rv1264c, lane 5's independent sonnet reviewer, which wrote none of it: READY at `54b9cb20`, the restack onto main, with no MUST or SHOULD (issuecomment-6754554921); the PR's diff is the reviewed change by patch-id. `tests` at `54b9cb20` failed only on the 13 rows of tests/test_adopt_symlink_target_bytes.py that #1189 broke on main and #1293 fixed, so the head was refreshed onto the fixed main as `2c72492e` (a merge only), H0 of this landing once its own checks pass. CI (Brett Heap's ruling 27): H0 is the head 2c72492 itself, which passed tests, tests-git-bash and SonarCloud; main has touched none of its files since its base a20d4bd; and the local gate passed on its predicted squash tree 597f402 over main f981468: the family_bump_to_checks, family_dry_run, family_remedy_lines, readme_windows_quoting_sentence, validate_family_unreadable, path_guard_hygiene, pinned_copy_text, no_auto_maintenance, repo_hygiene, agents_md_codes, cli_reference sets, 653 passed, 2 skipped. 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 #1228

Lane: openreposhape-5 (openRepoShape-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Nov 10, 2026
…not text as `_read_as` says what the plan's reader read, "records `commit:` as the number 7", where it spelled it as Python does, `commit: 7` and `True`, so `check` and `execute` name it in the words the plan's other refusals use under the same `plan-pin-malformed` (#1114) (#1198)

This PR lands only after the v1.2.0 tag, on Brett's word.

## What

`_pin_row_problem` holds each of a pin's five fields (`product`, `repository`, `commit`, `tree_sha256`, `digest_source`) to text. A value that is not text it spelled with Python's `repr`: a number as `commit: 7`, a boolean as `True`, a list as `['a', 'b']` and a mapping as `{'k': 'v'}`. Every other refusal of a plan's value says what the reader read, with `_read_as`: "the number 7", "the boolean true", "a list of 2 item(s)", "a mapping of 1 key(s)". W1020 found the gap while working on #1020.

It says it that way now, field by field, in `adopt-project.py`'s `_pin_row_problem`, in the `not_text` branch only:

- one field: ``records `commit:` as the number 7, which is not text``
- two or more: ``records `commit:` as the number 7, `tree_sha256:` as the boolean true, which are not text``

What stays as it was:

- the code, `plan-pin-malformed`, the remedy, and the sentence's ending, `which is not text`;
- every text value's spelling, byte for byte (`commit: '7'`, which is not 40 hex);
- a null or a blank: it is "records no `commit:`" under the code it has always had, and no value is spelled there.

Every field takes the one site (`PIN_FIELDS`). The docstring and a comment say so. The change is 13 lines added and 4 removed in `adopt-project.py`.

## Behaviour change

A pin field that is a number, a boolean, a list or a mapping is named by what it was read as, where it was named as Python spells it. A text value, a null and a blank print as they did.

## Rows

`tests/test_adopt_pin_row_values.py` is new, ASCII only, with 45 rows. Each runs `check` and then `execute --yes`, with a stub `gh` first on PATH and `--local-remote-dir`, and asserts one finding, `execute` refusing with that same finding, an empty `gh` log, no remotes directory made and no Traceback.

| Group | Rows | On main's code | On this head |
| --- | --- | --- | --- |
| The matrix: 5 fields by number, boolean, list, mapping | 20 | 20 failed | 20 passed |
| The whole sentence: `commit: 7`, and a boolean `digest_source` | 2 | 2 failed | 2 passed |
| Edge forms: 0, false, 7.5, -3, 007, `[]`, `{}`, `[a]` | 8 | 8 failed | 8 passed |
| Two fields at once, a non-text commit beside bad text, entry 2 | 3 | 3 failed | 3 passed |
| Null and blank controls | 6 | 6 passed | 6 passed |
| Text controls (`commit: "7"` and `"true"`, another product, no owner, short digest, source by hand) | 6 | 6 passed | 6 passed |
| **All** | **45** | **33 failed, 12 passed** | **45 passed** |

Every one of the 33 failures is the finding text holding the repr spelling (``records `commit: 7` ``, `True`, `['a', 'b']`, `{'k': 'v'}`, `{}`, `[]`). There is no crash or other cause. The 12 that pass on main are the controls, which pin what must not change.

Two existing rows pinned the old spelling, and no others did. Each now expects the new one, and both pass on this head (2 passed):

- `tests/test_adopt_pins.py`, the `a-number-commit` row: `` `commit:` as the number 1234567 ``;
- `tests/test_adopt_plan_value_order.py`, the `not-text` row: `` `digest_source:` as the number 7 ``.

## Mutants

19 mutants of this head's `adopt-project.py`, all killed. Each was run against the new file (first failure with `-x`, or a whole run where the table says so), and each run was restored with its sha256 checked.

| Mutant | Result |
| --- | --- |
| M1: main's repr form put back | killed, 33 failed and 12 passed |
| M2: `!r` inside the new "as" form | killed, 33 failed and 12 passed |
| M3: `str()` in place of `_read_as` | killed |
| F-repr-product, F-repr-repository, F-repr-commit, F-repr-tree_sha256, F-repr-digest_source: repr put back for one field only | 5 of 5 killed, each by that field's own rows |
| M4: "is" in place of "as" | killed |
| M5: singular and plural swapped | killed |
| M6: only the first field named | killed |
| M7: `missing` takes any falsy value (an existing guard; the zero, false and empty rows pin it) | killed |
| M8: only a list and a mapping counted as not text | killed |
| M9: the ending without "how it was read" | killed |
| M10: the code `plan-pin-unrecorded` | killed |
| T1 to T4: the text branches unquoted (commit, product and repository, digest, source) | 4 of 4 killed |

## Gate

A scratch merge of this head `d38e4e36d` with main `961640c68`: commit `1ef3f0783`, tree `b12197610`, which is this head's own tree. Targeted files only, in the landing gate's environment (a stub `gh` first on PATH, `GH_TOKEN=bogus`, an empty `GH_CONFIG_DIR`, an empty global git config). The set is 47 test files: every one that names `plan-pin-malformed`, `plan-pin-unrecorded`, `_pin_row_problem`, `_read_pins` or `pins:`, the new file, and `test_path_guard_hygiene.py`, `test_repo_hygiene.py` and `test_scaffold_leg_path_collisions.py`; and `test_shape_doctor.py` (448 ids, each in exactly one shard, run from a script that reads each list into an array because 25 ids hold spaces). Every chunk exited 0, with 0 failed.

| Chunk | Files | Result |
| --- | --- | --- |
| f01 | `test_adopt_pins.py` | 150 passed |
| f02 | `test_adopt_plan_yaml_quoting.py`, `test_adopt_plan.py` | 606 passed, 1 skipped |
| f03 | `test_adopt_execute_refusals.py`, `test_adopt_pin_row_values.py`, `test_adopt_plan_escapes.py`, `test_adopt_plan_value_order.py`, `test_adopt_reencoded_files.py`, `test_adopt_root_symlinks.py`, `test_adopt_shape_pin_and_work_dir.py`, `test_adopt_template_values.py` | 661 passed, 3 skipped |
| f04 | `test_bump_remedies_family_root.py`, `test_chain_link_fold.py`, `test_chain_pin_sources.py`, `test_chain_remedy_callers.py`, `test_doctor_gitlink_repairs.py`, `test_doctor_recorded_answers.py`, `test_family_add_member_id.py`, `test_family_makefile_siblings.py` | 255 passed |
| f05 | `test_family_tracking_branch.py`, `test_legs_not_a_list.py`, `test_link_source_chain_defaults.py`, `test_manifest_validator.py`, `test_naming_policy.py`, `test_neutral_pin_entry_one_spelling.py`, `test_neutral_pin_validator.py`, `test_non_list_project_fields.py` | 757 passed |
| f06 | `test_path_guard_hygiene.py`, `test_pin_annotated_tag.py`, `test_pin_source_env_collisions.py`, `test_pinned_copy_text.py`, `test_reader_refusals_named.py`, `test_repo_hygiene.py`, `test_scaffold_e2e.py`, `test_scaffold_leg_path_collisions.py` | 599 passed |
| f07 | `test_scaffold_pin_and_reuse.py`, `test_scaffold_pin_collisions.py`, `test_scaffold_referent_chain_links.py`, `test_setup_project_py.py`, `test_template_text_placeholders.py`, `test_update_shape_add_ignored.py`, `test_update_shape_landing.py`, `test_validate_pins_named_and_spelled.py` | 1078 passed |
| f08 | `test_yaml_flow_brackets.py`, `test_yaml_flow_quotes.py`, `test_yaml_indicator_openers.py`, `test_yaml_reader_spaces.py` | 813 passed |
| d01 | `test_shape_doctor.py`, 56 ids | 56 passed |
| d02 | the same, 56 ids | 56 passed |
| d03 | the same, 56 ids | 56 passed |
| d04 | the same, 56 ids | 56 passed |
| d05 | the same, 56 ids | 56 passed |
| d06 | the same, 56 ids | 56 passed |
| d07 | the same, 56 ids | 56 passed |
| d08 | the same, 56 ids | 53 passed, 3 skipped |

The file chunks hold 4919 passed and 4 skipped (f02: `SHAPE_MEDXEHR_CLONE` is unset; f03: the reftable backend needs git 2.45). The doctor shards hold 445 passed and 3 skipped (d08: the PowerShell line is printed only on a Windows host). In all, **5364 passed, 7 skipped, 0 failed.**

**Run on the merge with #1125's head.** A scratch merge of this head with #1125's head `9549006fe`: commit `8a291d8b2`, tree `88530bb7`. The new file (45), `test_adopt_pins.py` (150), `test_adopt_plan_value_order.py` (40), `test_adopt_execute_refusals.py` (181) and `test_adopt_check_plan_name.py` (45): **461 passed.**

## Merge-trees

`git merge-tree --write-tree`, this head against each, all clean (exit 0), at the heads of 2026-10-23T08:20Z:

- `origin/main` `961640c68`;
- the 23 open PRs that touch `adopt-project.py`: #1194 `900f77af9`, #1190 `00f959c61`, #1189 `4d40ce9fd`, #1186 `07486a498`, #1180 `b316f4157`, #1178 `c4beba193`, #1177 `5208e874e`, #1171 `8162b874e`, #1170 `24ee133aa`, #1169 `258051022`, #1154 `8a7828332`, #1153 `ff33ba12a`, #1143 `7af5fabc3`, #1141 `7a2711d03`, #1125 `9549006fe`, #1123 `5c3908f8d`, #1122 `c01c4d73d`, #1121 `1c5173758`, #1120 `c55e55e33`, #1119 `bba168bdd`, #1118 `2307036ab`, #1106 `504a1dd65`, #1105 `b28f40de0`;
- #1126 `4c1f80cf4`, which touches `tests/test_adopt_pins.py`.

## This PR needs no #1125

#1125 (for #1020) makes `_read_pins` say an entry that is not a pin as `_read_as` says it. Its `adopt-project.py` hunks are at the `_read_pins` docstring and at the non-dict entry's `{row!r}` (about line 625 on main), and they do not touch `_pin_row_problem`. Its test hunks do not overlap the lines this change edits. The two are textually independent: this PR is based on main, not stacked, the merge-tree with #1125's head is clean, and the run above on the merge with its head passed.

An entry that is neither a name nor a mapping stays #1020's, in #1125.

## Not in this PR

The other `repr` in the pin rows are on a value that is text by then: the later branches of `_pin_row_problem` (spelled as before), a text product in an entry's name, and an entry that is a name. They are not gaps.

`docs/release-notes/v1.2.0.md` is left alone. Its lines 297 to 299 mention #901's pins wording, and the release owner may want a line there.

## Out of scope

Four other places in `adopt-project.py` put a plan value of any type into a refusal with `!r`, as the pin rows did: `plan-wrong-kind`, `plan-unsupported-mode`, `plan-bad-leg` and `plan-bad-id`. They are not pin rows, so this change leaves them. They were found by reading the code, not by running it. They are filed as #1199, with each site's line and what it would print.

Closes #1114

Lane: openreposhape-4 (openRepoShape-4)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Nov 10, 2026
…blems against its source, in the order a person mends them (another repository, a refused name, a moved source, an unanswered entry), so `check`'s first finding is `execute`'s refusal for each pair (#1113) (#1210)

**Stacked on #1125.** This PR's base is `fix/1020-bad-id-first-problem` (#1125's branch, head `9549006f`). It lands after #1125 and stays a draft until then. #1125 makes `check`'s first finding `execute`'s first refusal for a bad `id:` or `org:`. This PR extends that rule to the four pairs #1113 measured, which have neither.

**Fix round.** The first gate failed six rows of `tests/test_adopt_relative_submodule_url.py` that pinned `check`'s old order on a plan hand-edited into another organisation, the relative url before `plan-not-the-source`, a plan `execute` already refused `plan-not-the-source` first on #1125's head; they now expect `plan-not-the-source` first, and a new row asserts that both commands name it first.

## The rule and the order

One generator, `_against_its_source`, asks a plan's four problems against its source in one order, and both commands read it. `execute` refuses its first problem. `check` lists each one, in that order and in its own words, before the split branch and the entries.

The order is the one a person mends them in:
1. a plan for another repository (`plan-not-the-source`);
2. a name the naming policy refuses (`naming-unclassified`, or `naming-role-mismatch`);
3. a source that has moved on since `plan` (`plan-stale`);
4. an unanswered entry (`plan-unresolved`).

Why this order:
- **An unanswered entry last.** Each of the first three is mended by running `plan` again, as its remediation says, and a fresh plan takes back every answer given before. An answer given first would be lost.
- **Another repository first.** Nothing in such a plan is this source's own: it is mended by `plan` under the source's own name, or from the source it is about. And `execute` must ask the naming policy nothing about the plan's names, and no remote anything, before it refuses it (#499). `_against_its_source` is a generator, so `execute` asks nothing after the first problem, and that still holds.
- **A refused name before a moved source.** The name is mended by `plan` given another `--project`, or after the source is renamed on GitHub. That run reads the source as it is now, so it mends the moved source too. `plan` run again as it was, for the moved source, would leave the name to mend.
- **The least change to each command.** The order keeps `execute`'s order for the plan's names (#499, #716) and `check`'s order of a moved source before its entries. Only the pairs that disagreed change.

## Before and after

Measured on #1125's head `9549006f` and on this head, with a stub `gh` (exit 97), `GH_TOKEN=bogus`, an empty `GH_CONFIG_DIR`, `GIT_SSH_COMMAND=false`, a proxy that goes nowhere, an empty global git config and `--local-remote-dir`. No run made a leg. `check` exits 1 and `execute` exits 2 in every row.

| The plan holds | `check` before | `execute` before | both, here |
|---|---|---|---|
| a moved source and an unanswered entry (#1113) | `plan-stale` | `plan-unresolved` | `plan-stale` |
| another repository and an unanswered entry (#1113) | `plan-unresolved` | `plan-not-the-source` | `plan-not-the-source` |
| another repository and a moved source (#1113) | `plan-stale` | `plan-not-the-source` | `plan-not-the-source` |
| a refused name and an unanswered entry (#1113) | `plan-unresolved` | `naming-unclassified` | `naming-unclassified` |
| a refused name and a moved source (not in #1113's table) | `plan-stale` | `naming-unclassified` | `naming-unclassified` |
| all four | `plan-stale` | `plan-not-the-source` | `plan-not-the-source` |
| another repository and a refused name | `plan-not-the-source` | `plan-not-the-source` | `plan-not-the-source` (unchanged) |

The fifth row is not in #1113's table, but the two commands disagreed there too, and the same rule decides it.

The same probe, comparing each command's output before and after, with paths and hashes masked:
- A plan with one of the four problems: both commands print the same stderr and stdout before and after.
- Both commands' stdout is the same before and after in every row.
- `check`'s stderr in each pair row holds the same lines as before, reordered: the same findings and the same remediation lines.
- `execute`'s stderr changes in one row only, a moved source beside an unanswered entry: `REFUSED plan-stale`, in its own words, where it said `REFUSED plan-unresolved`.

No refusal's code or wording changes, and no code is added. Re-run on this head after the fix round, the probe gives the same: the 24 plans (these 11, and the 13 of the next section) each get one first problem from both commands, no run makes a leg, and the comparison with #1125's head is the one above, line for line.

## #1113's suspected case: a `--work-dir` that cannot be written

Measured on #1125's head and on this head, the two commands agree in every row, and nothing here changes it:
- **A bad `id:` or `org:` beside a `--work-dir` this user cannot write in** (`chmod 500`): `plan-bad-id` or `unsafe-value` to both. #1125's review round 1 (RV1125's SHOULD-1) made both commands ask the two before `_work_root`, which settled this case.
- **Each of the 11 plans above beside the same `--work-dir`:** `adopt-work-dir-unwritable` first to both.

## What changed, in `adopt-project.py`

- **`_against_its_source` and `_Unmended` (new).** `_against_its_source` is the rule. It asks:
  - `_refuse_a_plan_for_another_repository`;
  - `_check_names`, given the source only where the plan names no other repository, as `check` gave it (#716);
  - `_refuse_an_unrunnable_plan`.

  It yields each problem as an `_Unmended`: the `Refusal` `execute` refuses it with, and `check`'s FINDING lines and remediation for it, in `check`'s words as they were. `check` lists an unanswered entry with the entries, each by its path (`_leg_findings`), after the rule's problems.
- **`cmd_execute`.** It refuses the first problem, `next(_against_its_source(...))`. Before, it called `_refuse_a_plan_for_another_repository`, `_check_names` and `_refuse_an_unrunnable_plan` in turn.
- **`cmd_check`.** It lists the rule's findings right after the Triad advisory, where it listed a moved source. Another repository and the names are no longer listed after the entries. Three things are still asked where they were, and only where no name was refused:
  - the names' classification lines on stdout;
  - the findings about what the disk or GitHub will not hold (#863);
  - the leg question (#798).

  The remediation lines it prints after its findings follow the findings' order, so the rule's come first.
- **`_refuse_an_unrunnable_plan`.** It asks a moved source before an unanswered entry. Its docstring says why.
- **`_refuse_a_plan_for_another_repository`.** Unchanged. The rule calls it.

## Tests

`tests/test_adopt_plan_against_its_source.py` (new, ASCII only), 11 rows. Each runs `check` and then `execute --yes` on one hand-edited plan, both with the same `--local-remote-dir`, and asserts that no leg is made.
- **7 pair rows** (the six pairs and all four). Each asserts:
  - `check` exits 1 and `execute` exits 2;
  - both name first the same code, the rule's first;
  - `check` lists every problem the plan holds, in the rule's order.
- **4 controls**, one per code: the plan holds that problem alone, and both commands name it.
- **Against #1125's head `9549006f`:**
  - the 6 pair rows that disagreed fail, each because the two commands named different codes, for example `('plan-stale', 'plan-unresolved') != ('plan-stale', 'plan-stale')`;
  - the `another-and-name` guard row and the 4 controls pass.
- **Here:** 11 passed.

`tests/test_adopt_relative_submodule_url.py`, 6 rows changed and 1 new (the fix round):
- **The 6 rows** are `test_check_keeps_a_relative_url_its_github_leg_resolves_alike` for `[https]`, `[scp]`, `[scp-other-case]`, `[ssh-port]` and `[ssh-github-443]`, and `test_a_credential_in_the_source_remote_is_never_printed`.
  - Each hand-edits the plan's `org:` to `otherorg`, so the plan names `otherorg/Thing` and the source is `testorg/Thing`: a plan for another repository.
  - Each expected `check` to list the relative url first and `plan-not-the-source` after it, `check`'s old order. They now expect `plan-not-the-source` first. Their other assertions are unchanged; the credential is still printed nowhere.
- **The new row,** `test_check_names_another_repository_first_as_execute_refuses_it`, runs one such plan. It asserts that `check`, with and without `--local-remote-dir`, lists `plan-not-the-source` and then the url, that `execute` refuses `plan-not-the-source`, and that no leg is made.
- **Measured on #1125's head** for the six source remotes: `execute` already refused each such plan `plan-not-the-source`, and its output is the same on both heads. Only `check`'s order changed. No spelling of the source's `origin` reads as another repository: with `org:` left as the source's, `check` passes on both heads, as the rows assert.

Both files together, 46 rows:
- **Against #1125's head:** 13 failed, 33 passed. The 13 are the 6 pair rows above and the 7 relative-url rows, each on the order: `plan-not-the-source` where the url was expected first, or the url first in the new row.
- **Here:** 46 passed.

## Mutants

Each was applied to `adopt-project.py`, run against both files (46 rows), and restored, with its sha256 checked (`4c8c1c9e`, the same after each one). Unmutated, the 46 pass. M1-M6 are the first round's; M7 and M8 are the fix round's.

| Mutant | Killed by |
|---|---|
| M1, `execute`: `_refuse_an_unrunnable_plan` asks an unanswered entry before a moved source (pair 1) | 2: `moved-and-unanswered`, `all-four` |
| M2, `check`: lists another repository after the entries (pair 2) | 11: `another-and-unanswered`, `another-and-moved`, `another-and-name`, `all-four`, and the 7 relative-url rows |
| M3, `check`: lists a moved source before another repository (pair 3) | 3: `another-and-moved`, `name-and-moved`, `all-four` |
| M4, `check`: lists a refused name after the entries (pair 4) | 3: `name-and-unanswered`, `name-and-moved`, `all-four` |
| M5, `check`: lists a moved source before a refused name (pair 5) | 2: `name-and-moved`, `all-four` |
| M6, the rule: asks a refused name before another repository (both commands) | 2: `another-and-name`, `all-four` |
| M7, `execute`: asks `_refuse_what_check_finds` before the rule | 8: the pair rows but `another-and-name`, the `plan-stale` control, and the new relative-url row |
| M8, `check`: lists all the rule's problems after the entries | 14: the pair rows but `another-and-name`, the `plan-stale` control, and the 7 relative-url rows |

## Gate

Run on the scratch merge `743ebe176`: `origin/main` `961640c68` plus this head `90eca4144` (tree `d71d6f00a`, never pushed). It ran in the landing gate's own environment (a stub `gh`, `GH_TOKEN=bogus`, an empty global git config, `EMAIL` set, the `LANES_*` and `GIT_SSH_COMMAND` variables unset), one shard at a time, each started with at least 19G free. The ids were collected from that tree, 4405 + 448 = 4853, and each is in exactly one shard. The file list is the 46 test files W1113's gate named and four more, added in the fix round (50 in all): `test_adopt_c_locale_bytes.py` and `test_adopt_submodule_url_answers.py` (they import helpers and the module-scoped `adopter` fixture from the changed test file, so they sit in its shard, r03), `test_reader_refusals_named.py` (it hand-edits a plan's `org:` and checks `check`'s exact findings) and `test_github_name_limits.py`. Every shard exited 0.

| Shard | Result |
|---|---|
| r01 | 600 passed |
| r02 | 613 passed |
| r03 | 464 passed, 1 skipped (`test_adopt_plan.py::test_plan_on_medxehr_matches_the_rulings`) |
| r04 | 547 passed |
| r05 | 599 passed, 19 skipped (all in `test_family_init_values.py`) |
| r06 | 542 passed |
| r07 | 489 passed |
| r08 | 531 passed |
| d01 to d07 | 56 passed each (`test_shape_doctor.py`) |
| d08 | 53 passed, 3 skipped (`test_shape_doctor.py`) |

- **r01 to r08:** 4385 passed, 20 skipped (4405 ids).
- **d01 to d08:** 445 passed, 3 skipped (448 ids).
- **Total:** 4830 passed, 23 skipped, none failed, none errored.

Main has moved since this gate: `origin/main` is `ac5f28d2a` (#1188, #1130 and #1098 landed). They change `scaffold-project.py`, `scripts/family.py` and four test files. None of them is a file this PR changes, a module `adopt-project.py` imports, or one of the 50 gated test files, so the gate was not run again on that tip. The merge-trees below were.

## Merge-trees

`git merge-tree --write-tree`, run again on 2026-10-23 at 15:31Z against the current `origin/main`, every one clean:
- **`origin/main` `ac5f28d2a`:** clean, tree `1a65ab9bd`.
- **#1125 `9549006fe`:** clean. This branch is on it.
- **#1177 `5208e874e`** (`fix/1152-plan-and-remote-paths-spelled`, which edits a line of `_refuse_a_plan_for_another_repository`): clean, with this head and three-way on the scratch merge.
- **Every open PR that touches `adopt-project.py` or either test file, 25 of them, #1125 and #1177 among them:** clean, both with this head and three-way on the scratch merge of `ac5f28d2a` and this head, `98afb128a` (`git merge-tree --write-tree <that merge> <its head>`). Since the first run, #1207 is new, and #1119, #1189 and #1190 have moved; all four are clean. No open PR touches either test file. The list is in a code block, so that it does not mention each PR:

```
PR     head       with this head              on the scratch merge
#1105  b28f40d  clean (tree 32fce74c6)   clean (tree 490f555f9)
#1106  504a1dd  clean (tree 3abfa1b6a)   clean (tree db57682e9)
#1118  2307036  clean (tree 79a3888bf)   clean (tree 629f167ca)
#1119  195d993  clean (tree a2926127e)   clean (tree 6aec4c863)
#1120  c55e55e  clean (tree 6171a52f8)   clean (tree 0cb310664)
#1121  1c51737  clean (tree 3acb80467)   clean (tree 2771fbfd0)
#1122  c01c4d7  clean (tree af9a4c414)   clean (tree ef00f52f7)
#1123  5c3908f  clean (tree eb7cb34b3)   clean (tree 4c311748b)
#1125  9549006  clean (tree 239df6d)   clean (tree 1a65ab9bd)
#1141  7a2711d  clean (tree e1c8f7169)   clean (tree 3afeda790)
#1143  7af5fab  clean (tree 35cd165de)   clean (tree aae00cfc7)
#1153  ff33ba1  clean (tree 57da668e8)   clean (tree f91ce3d8d)
#1154  8a78283  clean (tree 28699ba0c)   clean (tree 3e6b1ae98)
#1169  1e958ca  clean (tree e3ef802be)   clean (tree f4566b2c4)
#1170  24ee133  clean (tree 94b9291c8)   clean (tree 848bb0ed0)
#1171  8162b87  clean (tree 65ca8196d)   clean (tree f15571ef3)
#1177  5208e87  clean (tree 08e3d6a62)   clean (tree 111f3c238)
#1178  c4beba1  clean (tree 646f02266)   clean (tree eae3b5996)
#1180  b316f41  clean (tree 25b3d4b6f)   clean (tree 85a559171)
#1186  07486a4  clean (tree d0fe77836)   clean (tree 849f0ef41)
#1189  a131fc2  clean (tree 5b1ab0620)   clean (tree 9851d22b7)
#1190  91a937e  clean (tree aa83fae05)   clean (tree 18101f50b)
#1194  900f77a  clean (tree 9d74efa35)   clean (tree 46317beae)
#1198  d38e4e3  clean (tree 87ca21b8c)   clean (tree 7fc45a875)
#1207  1c7ca5c  clean (tree 1dbab659d)   clean (tree 1e44c98f0)
```

## Left for a follow-up (outside #1113)

- **An unanswered entry beside an uncovered path still gives two first problems,** filed as #1197. `check` lists `plan-uncovered` first and `execute` refuses `plan-unresolved` first. Measured the same on #1125's head and on this head. `execute` refuses an unanswered entry before `_refuse_what_check_finds`, while `check` lists it in `_leg_findings`, after the paths and the coverage. Other entry findings ahead of it in `_entry_findings` are likely the same (`plan-unsafe-path` among them), and so is the taken split branch, but those were not measured.

Closes #1113

Lane: openreposhape-4 (openRepoShape-4)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Nov 10, 2026
…git` this user cannot read is pinned `source-unreadable` in `check` and `execute`, never `source-partial-clone`, with no `gh` call and no `upload-pack` run (#1262) (#1289)

Pin, in `tests/test_adopt_partial_clone_source.py`, that a partial clone whose recorded `.git` this user cannot read is refused `source-unreadable`, naming that `.git`, and never `source-partial-clone`, in `check` and `execute` alike, with no `gh` call, no `upload-pack` run and no remotes directory made. RD1141's NIT-1 on #1141 (for #1099) asked for it, and #1262 is that follow-up.

**This is a test gap only, and the behaviour is right.** The PR changes one file, `tests/test_adopt_partial_clone_source.py` (+117 -15). No production file, refusal code, remediation or doc changes. Milestone v1.2.1, as #1262.

`Plan._recorded_source` (reached through `open_source`) asks `_git_refused(path)` ahead of everything that reads the clone (`adopt-project.py:7064` at `4552efa6a`), in `check` and `execute` alike, and `_refuse_a_partial_clone_short` runs after the source is opened. #1141's 9 refused-by-name rows (`tests/test_adopt_unreadable_clone_git.py`) build a plain clone, and this file's rows build partial clones with a readable `.git`: no row built a partial clone whose `.git` is at mode 000. RD1141's probe (not in the repository) measured 16 such rows at `0b8fb320`, all `REFUSED source-unreadable` naming `<it>/.git`, none `source-partial-clone`, with 0 `gh` calls and 0 `upload-pack` runs. RD1141 measured why a reorder cannot flip that answer: through a `.git` at mode 000 `_promisor_remotes` is `[]` and `_objects_lacking` is `None`, where they are `['origin']` and 28 while it is readable, so the partial-clone rule's own questions see nothing there. What no row pinned is a change that left such a clone to that rule.

In `tests/test_adopt_partial_clone_source.py`, reusing `Source`, `made` and `planned_once`, and `needs_a_mode`, `recording_gh`, `at_mode_000`, `the_refusal` and `CURES` from the files that own them (functions only, no fixture is imported):

- `test_a_partial_clone_whose_recorded_git_is_unreadable_is_source_unreadable`: **16 rows**, `[nocheckout|checkout]-[check|execute]-[given|cloned]-[directory|file]`. Each makes a `--filter=blob:none` clone (with a checkout, and with `--no-checkout`; `source.lacking() > 0` is asserted), records it as the plan's `source.local_path` (`cloned` false, or `source.cloned: true` with a `source.repository`), makes its `.git` a directory or a `gitdir:` file (`git clone --separate-git-dir`), and puts that `.git` at mode 000 for the `with` (`at_mode_000`: the mode is asserted to bite and is given back in a `finally`). It skips as root and on Windows (`needs_a_mode`). It asserts:
  - exit 2 and `the_refusal(...)` in stderr: `REFUSED source-unreadable: the .git in the plan's source.local_path, <path>/.git: cannot be read (Permission denied), so ... cannot be told`, with the cure for a directory or for a file (`CURES[kind]`);
  - `source-partial-clone` in neither stream, and no `plan ok`;
  - the `gh` log from `recording_gh` empty (no `gh` call);
  - no remotes directory;
  - `source.untouched()`: no `upload-pack` ran, and `objects/` hashes as it did before.
- `test_the_same_partial_clones_with_a_readable_git_are_source_partial_clone`: **8 control rows**, `[nocheckout|checkout]-[given|cloned]-[directory|file]`, `check` only. The same clones with a readable `.git` are refused `source-partial-clone` with its cure, never `source-unreadable`, with no `gh` call and nothing fetched. They show the 16 rows read the `.git`'s mode and not a clone the rule would let by. They run as root and on Windows too.

The helpers, none of which changes an existing row: `Source` takes `apart` (the git directory beside a `.git` file); `objects_dir(path)` finds `objects/` through that file (a function of the path alone, because `tests/test_adopt_plan_partial_clone.py` calls `Source.store(SimpleNamespace(path=...))`); `check` and `execute` take an `env`; `recorded_as_a_clone` is the `cloned` edit `at_the_side_commit` made inline, made alone and called from there. `tests/test_adopt_plan_partial_clone.py` reuses `Source`, `made` and `planned_once`, and keeps its outcomes (run G below). No assert joins conditions with `and` or `or`.

The detached tree `n1262-mut` at main `4552efa6a`, this branch's test file, `adopt-project.py` and `docs/cli.md` (#1141's two production files) taken from `26cc80bd2^`, then restored and compared by sha256 (`adopt-project.py` `eb5f181b...` at the base, `a8f76e66...` before #1141). `-k "unreadable or readable_git"`, git 2.43.0: **16 failed, 8 passed.**

| rows | before #1141 | at the head |
|---|---|---|
| the 8 `given` rows (2 clones x 2 verbs x 2 kinds) | 8 fail: `REFUSED git-failed` (`git rev-parse --is-inside-git-dir` says not a git repository), no `gh` call | pass |
| the 8 `cloned` rows (the same 8) | 8 fail: `gh repo clone testorg/Elsewhere` asked, `REFUSED source-unclonable` | pass |
| the 8 control rows (readable `.git`) | pass | pass |

This is what RD1141 measured for the same 16 rows on main `b66d8f0cc`.

Each applied alone to `adopt-project.py` in `n1262-mut` at `4552efa6a`, the 24 rows run, and the file restored and compared by sha256 each time (script `mutate.py`; the control rows pass in every run).

| mutant | the change | rows failed |
|---|---|---|
| RD1141's MR4 | `refused = _git_refused(path) if there else None` becomes `refused = None` | **16 of 16** |
| the guard asked after the `cloned: false` branch has read the clone | the three guard lines moved below that branch, before `_not_a_whole_clone` | **8**: the 8 `given` rows (`git-failed` from `_top_level`); the `cloned` rows still reach the guard |
| extra: a `.git` file left unguarded | `a_file = False` in `_git_refused` | 8: every `file` row |
| extra: a recorded clone left unguarded | the guard asked only where `source.cloned` is not `true` | 8: every `cloned` row |

No survivor. The two named in #1262 are killed, and each axis of the 16 rows (directory or file, given or cloned) carries a mutant of its own.

Head `2e0d2d237`, Python 3.12.3, git-filter-repo 2.47.0 (`tools/venv247`), through `run10.sh` (a stub `gh` first on PATH that refuses and logs every call, `GH_TOKEN=bogus-l5`, an empty `GH_CONFIG_DIR`, `GIT_SSH_COMMAND=false`, `GIT_CONFIG_GLOBAL=/dev/null`), at most 100 tests a run, `-rs` alone. Each ran on git 2.43.0 and on git 2.47.1 (`tools/git247/bin/git`, `git --version` printed first in each log):

| run | files | rows | 2.43.0 | 2.47.1 |
|---|---|---|---|---|
| A | `test_adopt_partial_clone_source.py`, `test_adopt_unreadable_clone_git.py`, `test_adopt_unenterable_source_and_locale.py` | 93 | 93 passed | 93 passed |
| G | `test_adopt_partial_clone_source.py` and `test_adopt_plan_partial_clone.py` in one pytest (the second imports the first's fixtures) | 77 | 77 passed | 77 passed |
| B | `test_agents_md_codes.py`, `test_cli_reference.py` | 70 | 70 passed | 70 passed |
| C | `test_pinned_copy_text.py` | 87 | 87 passed | 87 passed |
| D | `test_no_auto_maintenance.py` | 60 | 58 passed, 2 skipped | 58 passed, 2 skipped |
| E1, E2 | `test_path_guard_hygiene.py` in two halves | 61 + 60 | all passed | all passed |
| F1, F2 | `test_repo_hygiene.py` in two halves | 51 + 50 | all passed | all passed |

The only skips, named: `tests/test_no_auto_maintenance.py:222` x2 on each git, "the session began with GIT_CONFIG_GLOBAL set, and its file includes that one". Run G first failed 10 rows on an earlier head `cd8b4f3fe` (a `git_dir` attribute `Source.store(SimpleNamespace(path=...))` does not have); `objects_dir` replaced it and every run above was repeated at `2e0d2d237`.

Pre-test of the merge: the predicted merge of the head into main `9cb156a98` (`85f8744b4`, a local commit never pushed), git 2.43.0: G 77 passed, and `test_adopt_unreadable_clone_git.py` with `test_adopt_unenterable_source_and_locale.py` 31 passed.

**Refreshed on 2026-11-10 at 12:19Z as `305021ef3`**: one merge of main `3add78e1c` into the reviewed head `2e0d2d237`, made by `gh pr update-branch`. The old head's `tests` run had failed only on #1189's 13 rows in `tests/test_adopt_symlink_target_bytes.py`, which #1293 fixed on main. A re-run would have tested the stale merge again. CI's `tests` runs on the refreshed head, and lane 5's pilot gates the predicted squash again at this PR's turn.

`git merge-tree --write-tree` at the refreshed head `305021ef3`, heads read fresh at 12:23Z (27 open PRs). No other open PR touches `tests/test_adopt_partial_clone_source.py` or `tests/test_adopt_plan_partial_clone.py`. Against the PR's base the head changes one file, `tests/test_adopt_partial_clone_source.py` (+117/-15).

| against | result |
|---|---|
| main `3add78e1c` | clean, tree `8327064c7`, the head's own tree (the head holds main) |
| #1210 (`791106c2b`, 16th) | clean, tree `00f6a02ac` |
| #1194 (`fix/1129-github-name-limits`, `906172b41`, 17th) | clean, tree `b0eac8e04` |
| #1209 (`fix/1196-paths-spelled-locale-and-env`, `13a2c58cb`) | add/add conflict in `tests/test_adopt_plan_paths_spelled.py`, a file this PR does not touch; the same conflict arises between #1209 and main alone |

The earlier rows (main `3ee5bb4d9` and `9cb156a98`, and #1282, which has landed as `b607223b4`) are superseded by this table (rv1289's NIT 1).

Review: rv1289, lane 5's independent opus reviewer, which wrote none of #1289: READY at `2e0d2d23`, with no MUST or SHOULD (issuecomment-6752563658); its NIT 1 (stale merge lines in the body) was taken by the coordinator at 12:24Z, and NIT 2 is optional. Refreshed on 2026-11-10 at 12:19Z as `305021ef` (one merge of main `3add78e1` into H0 `2e0d2d23`), because H0's `tests` failed only on #1189's 13 rows that #1293 fixed; `305021ef` is H0 of this landing once its checks pass. CI (Brett Heap's ruling 27): H0 is the head 305021e itself, which passed tests, tests-git-bash and SonarCloud; main has touched none of its files since its base 3add78e; and the local gate passed on its predicted squash tree 54e3742 over main 3ffe75b: the adopt_partial_clone_source, path_guard_hygiene, pinned_copy_text, no_auto_maintenance, repo_hygiene, agents_md_codes, cli_reference sets, 499 passed, 2 skipped. 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 #1262

Lane: openreposhape-5 (openRepoShape-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Nov 10, 2026
…cter a terminal acts on in the command, its directory and what it printed, as `_first_said` spells gh's, so `--local-remote-dir` no longer reaches the terminal raw there; a NOTE before `NEXT:` says when the source's path in its clone command holds a character a terminal does not show as itself; and rows pin six sites #1177's 148 left to chance (#1195) (#1225)

This PR was stacked on #1177, which landed as `8bcdb2c`. RS1225 then restacked it onto `main` with three merges (#1177's final head, its squash, then `main`), which carry exactly the reviewed change (#1225 issuecomment-6752574422).

## What

#1195 follows RV1177's review of #1177 (for #1152). It names two raw routes, N3 and N4, and six mutants, K1, K2, K4, K5, K6 and K7, that all 148 rows of #1177's `tests/test_adopt_plan_and_remote_paths_spelled.py` let through.

Three files change: `adopt-project.py`, that test file, and `tests/test_adopt_github_exits.py`.

### N3: a refused command no longer names `--local-remote-dir` raw

`CommandFailed.loudly` belongs to `scripts/shape_materialize.py`, and every tool shares it. It printed the command, its `(in <cwd>)` line and its output as they were. So when a `pre-receive` hook refused a leg push under `--local-remote-dir <D>/re<U+202E>mote`, the raw U+202E was printed three times: in the command, and in git's own `To` and `error:` lines.

The change is in `adopt-project.py` only. `shape_materialize.py` is unchanged.
- `_unacted(text, kept="")` writes each character that `str.isprintable` refuses, other than those in `kept`, as `_spelled_character` spells it, with no backticks. That is what `_first_said` does to the line gh said.
- `_loudly(exc, step)` builds the same REFUSED block from the command's arguments, its directory and its output, each passed through `_unacted`.
  - The output keeps its line breaks (`kept="\n"`), so it still reads one line per line.
  - This settles the point the issue left open: `loudly` prints the whole output, while `_first_said` keeps one line.
- The leg push (`_push_the_leg`), `_failed_loudly` and `main`'s catch-all now print a refused command through `_loudly`, not `exc.loudly`.
- A printable character prints as it is, so a command with plain paths prints the same block as before.

I measured it with a real `execute --allow-empty-leg spec` and a global `pre-receive` hook that refuses every push:
- **U+202E.** On `5208e874e`, U+202E in `--local-remote-dir` reaches stderr raw 3 times. On this head it reaches stderr 0 times. The command, the `(in ...)` line and git's `To` line each name it as `\u202e`, six ASCII characters.
- **ESC.** ESC behaves the same way. git itself writes ESC as `?` in its `error:` line.
- **Byte 0xff.** It was already printed as `\udcff` before this change, because stderr is `backslashreplace`. git's own lines hold U+FFFD for it, the character `run` decodes that byte to.

### N4: a NOTE says when `NEXT:`'s clone command holds a character a terminal does not show

#1195 asks for a ruling: refuse such a source, as the README's clone line does, or add a note under `NEXT:`. The code settles it in favour of the note:
- **Such a source is writable.** `_refuse_an_unwritable_clone_url` asks `unwritable_reason`. Since #255, that lets through a `Cf` character other than the nine bidi controls. Its docstring in `scripts/shape_materialize.py` says such a character "is invisible, not unwritable", and that a Persian name joins its parts with U+200C.
- **The tests pin it.** `tests/test_adopt_template_values.py` lists `Ali<U+200C>Reza`, `a<U+200E>b`, `a<U+200F>b` and `a<U+061C>b` as `WRITABLE`. Refusing the source would reverse #255.
- **Spelling breaks pasting.** Spelling the command instead would break `_branch_deletion`'s rule that a printed command pastes as it is. `sh` reads a quoted path, not a spelled one.

I measured the old behaviour on `5208e874e`, with a full `execute --local-remote-dir` of a source under `<D>/so<c>urce/Thing`. U+200B, U+200F, U+200C and U+00A0 each pass, and the `split` line spells them. `NEXT:` prints each one raw, once, inside `shlex.quote`'s single quotes.

On this head, the clone command is unchanged. When the url is not `str.isprintable`, this line prints just before the `NEXT:` block:

```
NOTE the path in the clone command below holds a character a terminal does not show as itself, so it can read as another path: it is `<D>/so\u200burce/Thing`, as the `split` line names it.
```

A url whose every character is printable gets no NOTE. A source name that ends in a space shows between the quotes, so it gets none either.

**Where the NOTE goes differs from the issue's wording; please weigh it.**
- The issue says a note *under* `NEXT:`.
- #1121 and #1207 each add lines right after the `print` of the `NEXT:` block. With the NOTE printed under the block, this branch conflicted with #1121 (`git merge-tree` exit 1).
- Printed just before the block, the NOTE merges cleanly with both. It is also read before the command a person would paste.
- Mutant M14 (the NOTE after the block) fails 2 rows, so the placement is pinned.
- Moving it under the block means moving one `print` and flipping the row's order check. It would then need a rebase over whichever of #1121 and #1207 lands first.

### The new rows

The new file goes from 148 to 188 rows, 40 of them new. `tests/test_adopt_github_exits.py` keeps its 23 rows, with one assertion tightened.
- **K1, K2.** `test_a_printable_plan_is_named_as_typed_unless_900_spells_it` runs `check` on the uncovered plan, in the plan's own directory, four ways. `run_adopt` now takes `cwd=` and `over=`.

  | `--plan` given | Named as |
  |---|---|
  | absolute, ending in a space | `` `<D>/plan.yaml ` `` |
  | `` `plan.yaml` ``, relative, between backticks | `` `\x60plan.yaml\x60` `` |
  | `plan.yaml`, relative | `plan.yaml` |
  | `./plan.yaml` | `plan.yaml` |

- **K4, K5.** Two new `ROWS` entries. Each runs under `check` and `execute`, with the plan at each of the five path forms.
  - `plan-wrong-kind-a-placement-plan` expects `kind is 'placement-plan', expected 'adoption-plan'`.
  - `org-too-long`, with an `org:` of 40 `o`, expects `` `org:` is oooooooooooo...oooooooooooo, 40 characters ``.
  - The issue read both expected lines from the code. Both rows pass on `5208e874e`, which confirms them.
- **K6.** `printable-U+00E9` is added to the remote-dir test. `re<U+00E9>mote` prints as typed, with no backticks.
- **K7.** In `tests/test_adopt_github_exits.py`, the GitHub-mode `split` line must now match in full: `  split <12 hex> on adopt/three-repo-shape -> https://github.com/testorg/Northwind.git`.
- **N4.** `SPLIT_SOURCES` gains `right-to-left-mark` (U+200F). Every split row checks either that the NOTE comes before `NEXT:`, or that there is no NOTE.
- **N3.** Three tests:
  - `test_a_refused_command_names_the_remote_and_work_dirs_spelled` is the probe above as a test. The character goes in both `--local-remote-dir` and `--work-dir`, for U+202E, ESC, byte 0xff and a plain control. The line feed is left out, because git's own output names the path and the output's line breaks are kept.
  - `test_a_late_refused_command_is_said_spelled` checks `_failed_loudly`, in process, for all five `CHARACTERS`.
  - `test_a_refused_command_no_step_said_is_said_spelled` checks `main`'s own block, in process, with `cmd_check` replaced, for all five.

## Proof

### Before and after

| Code | The new file (188 rows) and `tests/test_adopt_github_exits.py` (23 rows) |
|---|---|
| #1177's head `5208e874e` | 12 failed, 199 passed |
| This head `73c9f57e8` | 211 passed |

- **What fails on `5208e874e`.** The 12 failures are all N3 and N4 rows:
  - 2 split rows (U+200B and U+200F);
  - 2 refused-push rows (U+202E and ESC);
  - 4 `_failed_loudly` rows;
  - 4 `main` rows.
- **The K rows** pass on `5208e874e`, because its code is right there. Each one fails on its mutant (below).
- **Two N3 controls** pass on both heads: byte 0xff, because stderr already wrote `\udcff`, and the plain control.

### Mutants

All 20 were killed. Each was applied to `adopt-project.py` on this head and restored with `git checkout`. After every restore, the file's sha256 was `163c692aff5b076410bde27740439070f2b9a4c62b4a7dc9510199cb0a7f890a`.
- For K1 to K6, the whole new file was run (188 rows). For K7, `tests/test_adopt_github_exits.py` was run too (211 rows).
- Under every K mutant, only new rows failed, so the old 148 stayed green.
- M1 to M14 ran the N3 or N4 rows.

| Mutant | What it does | Rows failed |
|---|---|---|
| K1 | `check`'s last count line names `--plan` by `isprintable()` alone | 2 of 188 |
| K2 | that line names `plan.path.absolute()` | 3 of 188 |
| K4 | the PLACEMENT plan's `plan-wrong-kind` names the plan raw | 8 of 188 |
| K5 | `adopt-org-too-long` names the plan raw | 8 of 188 |
| K6 | the extracted leg line spells every url outside ASCII | 1 of 188 |
| K7 | the `split` line names the source's own path | 2 of 211 |
| M1 | `_loudly` leaves the arguments raw | 10 of 14 |
| M2 | `_loudly` leaves the working directory raw | 10 of 14 |
| M3 | `_loudly` leaves the output raw | 8 of 14 |
| M4 | the output's line breaks are spelled too | 14 of 14 |
| M5 | the arguments are wrapped in backticks | 14 of 14 |
| M6 | the leg push goes back to `exc.loudly` | 2 of 14 |
| M7 | `_failed_loudly` goes back to `exc.loudly` | 4 of 14 |
| M8 | `main` goes back to `exc.loudly` | 4 of 14 |
| M9 | `_unacted` keeps every whitespace character | 2 of 14 |
| M10 | no NOTE | 2 of 4 |
| M11 | a NOTE wherever the `split` line spells the path | 1 of 4 |
| M12 | the NOTE names the path raw | 2 of 4 |
| M13 | the clone command is spelled, not quoted | 4 of 4 |
| M14 | the NOTE prints after the block, not before it | 2 of 4 |

### Gate

The gate ran on the scratch merge `37c65a609` of `origin/main` `961640c68` and this head `73c9f57e8`, in the landing gate's environment:

| Shards | Tests | Result |
|---|---|---|
| g0 to g5: the 52 files listed below | 3,250 | 3,246 passed, 4 skipped |
| d0 to d7: `tests/test_shape_doctor.py` | 448 | 445 passed, 3 skipped |

- The shard lists hold each collected id exactly once. Every shard exited 0.
- **The 7 skips are environment skips.** Three `tests/test_adopt_root_symlinks.py` rows need git 2.45 for the reftable backend. One `tests/test_stdout_encoding.py` row and the three doctor rows run only on Windows.
- **g1 ran twice.** A host reboot killed its first run part way. It was re-run whole: 542 passed.

<details><summary>The 52 files in g0 to g5</summary>

`tests/test_adopt_attributes_eol_block.py`, `tests/test_adopt_c_locale_bytes.py`, `tests/test_adopt_clone_template.py`, `tests/test_adopt_contracts_dir.py`, `tests/test_adopt_e2e.py`, `tests/test_adopt_entry_paths.py`, `tests/test_adopt_execute_refusals.py`, `tests/test_adopt_filter_repo_failure.py`, `tests/test_adopt_git_reads.py`, `tests/test_adopt_git_rm_bytes.py`, `tests/test_adopt_github_exits.py`, `tests/test_adopt_late_failure.py`, `tests/test_adopt_leg_keys.py`, `tests/test_adopt_mount_ignored.py`, `tests/test_adopt_pins.py`, `tests/test_adopt_plan_and_remote_paths_spelled.py`, `tests/test_adopt_plan_escapes.py`, `tests/test_adopt_reencoded_files.py`, `tests/test_adopt_relative_submodule_url.py`, `tests/test_adopt_root_manifest.py`, `tests/test_adopt_root_shape_paths.py`, `tests/test_adopt_root_symlinks.py`, `tests/test_adopt_spec_only.py`, `tests/test_adopt_spelled_names.py`, `tests/test_adopt_split_branch.py`, `tests/test_adopt_submodule_url_answers.py`, `tests/test_adopt_submodules.py`, `tests/test_adopt_temp_work_roots.py`, `tests/test_adopt_template_values.py`, `tests/test_adopt_tracking_branch.py`, `tests/test_adopt_unsearchable_source.py`, `tests/test_adopt_values_as_typed.py`, `tests/test_adopt_verify.py`, `tests/test_doctor_next_is_a_command.py`, `tests/test_dry_run_asks_remotes.py`, `tests/test_family_add_refusals.py`, `tests/test_git_output_decoding.py`, `tests/test_github_limits_init_check_org.py`, `tests/test_github_name_limits.py`, `tests/test_non_utf8_name_callers.py`, `tests/test_path_guard_hygiene.py`, `tests/test_refusal_default_remediation.py`, `tests/test_repo_hygiene.py`, `tests/test_ruleset_hint_tracking_branch.py`, `tests/test_scaffold_leg_path_collisions.py`, `tests/test_scaffold_manifest_values.py`, `tests/test_scaffold_reuse_seeded_legs.py`, `tests/test_stdout_encoding.py`, `tests/test_template_values_single_pass.py`, `tests/test_update_shape.py`, `tests/test_update_shape_add.py`, `tests/test_update_shape_merged_away.py`

</details>

**`main` has moved since the gate's base, and it touched `adopt-project.py`.**
- `origin/main` is now `50ce8ab15`. Of the 15 commits since `961640c68`, one touches `adopt-project.py`: `b7edd8816` (#1119, for #1083), with 279 lines added and 78 removed. None touches either test file.
- `git merge-tree` of this head with `50ce8ab15` is clean. In the merged `adopt-project.py`:
  - the file parses;
  - `_unacted` and `_loudly` are each defined once;
  - `.loudly(` is called only inside `_loudly`, so #1119 adds no new `exc.loudly(` call.
- The gate above did not run on `50ce8ab15`. The landing gate re-tests this head on its own merge.

### Merge-trees (2026-10-23T20:14Z)

`git merge-tree --write-tree <X> 73c9f57` exits 0 (clean) for every `<X>` below:
- `origin/main` at `50ce8ab15`;
- #1177's head, `5208e874e`;
- each of the 24 open PRs that touch `adopt-project.py`: #1210, #1207, #1198, #1194, #1190, #1189, #1186, #1180, #1178, #1171, #1170, #1169, #1154, #1153, #1143, #1141, #1125, #1123, #1122, #1121, #1120, #1118, #1106 and #1105.

No other open PR touches either test file. #1121, which adds lines after `NEXT:`, has not landed, and it merges cleanly.

Each of the 24 was also merged against a scratch merge of `origin/main` and this head:
- 21 merge cleanly.
- #1169, #1180 and #1190 conflict in `tests/test_adopt_check_throwaway_repos.py`, and #1169 also conflicts in `adopt-project.py`.
- Those three conflict with `origin/main` alone, in the same hunks byte for byte: 6 in `adopt-project.py` for #1169, and 13, 8 and 8 in the test file. So this head adds no conflict.

## Not in this PR

These are outside #1195, which covers `adopt-project.py`'s `--local-remote-dir`:
- `scaffold-project.py`, `update-shape.py`, `scripts/family.py` and `scripts/bump-leg.py` still print `CommandFailed.loudly` as it is.
- `_init_refused` prints `git init`'s argument list raw, and those arguments hold the `--work-dir` path.
- The `adopt-remote-unreadable` and `source-unclonable` refusals print git's or gh's output raw.
- `_unacted` and the NOTE test `str.isprintable`, as `_first_said` does. So the default-ignorable characters that #1171 (#1128) adds to `_shown` get no NOTE, and are not spelled in a REFUSED block. They belong with `_first_said` under #1165.

Closes #1195

Lane: openreposhape-4 (openRepoShape-4)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Nov 10, 2026
… repository over 100, so `plan --source <50 b's>/Thing` never asks `gh` for a name GitHub cannot hold, no remedy offers `--org <50 b's>`, and `check` and `execute` never clone such a record again (#1129) (#1194)

Lane 4's W1129 for #1129, RV1122's NIT-1 on #1122 (#1122 issuecomment-6319493639). RV1194 reviewed it READY at `900f77af` (#1194 issuecomment-6365280794).

**It was stacked on #1122,** which landed as `ebb8716`. RS1194 then restacked it onto `main` with three merges (#1122's final head, its squash, then `main`), which carry exactly the reviewed change (#1194 issuecomment-6751617746). "Why stacked" below says why it was stacked.

**A fix round followed #1268.** Since #1268, `Source.clone` hands `gh repo clone` `-- --quiet --origin origin`. So FX1194 merged `main` (`106f92ff`) and changed only the rows' helper `cloned_by_gh` to expect that line (+4 -2, #1194 issuecomment-6769522297). RVD1194b reviewed the round READY at `ddc21fb5`: the reviewed change's lines are byte-equal, and the 14 rows fail before the fix and pass after it (#1194 issuecomment-6772772773).

## What

`adopt-project.py`, `_github_name`: an owner of more than `GITHUB_OWNER_MAX` (39) characters, or a repository of more than `GITHUB_NAME_MAX` (100), counted once the trailing `.git` is dropped, names no `owner/repo`. The file already imports both limits from `shape_materialize`.

```python
    if len(owner) > GITHUB_OWNER_MAX or len(repo) > GITHUB_NAME_MAX:
        return None
```

Every reader of `_github_name` now gives the same answer for such a spelling:

| Reader | Used by | Before | Now |
|---|---|---|---|
| `_source_spec` | `plan`, `check` and `execute` `--source` | taken as GitHub's name: `gh repo clone` asked, or `source-ambiguous` beside a directory of that spelling | a path: read in place where it is one, `source-unresolvable` ("neither a path that exists nor an `org/repo` name") where it is not |
| `_repository_in_url` | a url `--source`, `github.com/...` too | `gh repo clone` asked | `source-unresolvable`, "names no `owner/repo` on github.com", before any `stat` |
| `_recorded_repository` | `check` and `execute`, a plan's clone gone (`cloned: true`) | "is cloned again from GitHub", `gh repo clone` asked | `source-unresolvable`, "the plan's `source.repository`, ..., names no `owner/repo` on github.com" |
| `_held_repository` | `check` and `execute`, a source with no `origin` | held to the record: `plan-not-the-source`, remedy `--org <40 c's>` | holds the plan to nothing, as a record that names no `owner/repo` does |
| `_source_there` | beside a directory this user cannot search | #1122: no url | unchanged: no url (the name is None now) |

`_refuse_another_repository`'s remedy (`adopt-not-the-source`) is reached only after `_source_spec`, so it never offers `--org <a name GitHub cannot hold>` for an `org/repo` `--source` now.

**#1122's guard in `_source_there` is redundant, and is folded in.** `_source_there` is called only by `_source_spec` and `_repository_in_url`, and both take `name` from `_github_name`. So a name past the limits now arrives as None, and the `name is None` branch gives the same refusal #1122's guard gave. The guard is gone, `if name is None:` is back, and the docstring says the limits are asked in `_github_name`. The merge with `main` and with #1122 is clean (see "Merges").

**Why stacked.** The textual merge with #1122 is clean, but the two do not hold together as they stand. A `github.com/` spelling past the limits is now refused by `_repository_in_url` before any `stat`, so four of #1122's rows, which expected `source-unreadable` from `_source_there`, fail on the combination:
- `[bare-github-url]`;
- `[www-github-url]`;
- `[bare-github-url-owner-one-over-EIO]`;
- `[bare-github-url-owner-one-over-EACCES]`.

This PR moves those three params out of #1122's `_source_there` tests, with a comment pointing to the new file. There they assert the new answer (`source-unresolvable`, no url), with the control at the limit kept: two readings and the url.

No refusal code is new or changed, and no help text or `docs/cli.md` sentence changes: `--source`'s help already says `source-unresolvable` refuses "one that is neither a path that exists nor an `org/repo`".

## Behaviour that changes besides the refusal

- **A directory here spelled `<40 c's>/Thing`** (or `testorg/<101 r's>`) is read in place, and the plan is written, recording that directory and no repository. Before, it was `source-ambiguous`, which named a GitHub repository that cannot exist. At the limit, it is still `source-ambiguous`.
- **A plan whose source has no `origin`, and whose `source.repository` records `<40 c's>/Thing`,** is held to nothing. `check` says `plan ok`, and `execute` goes on. Before, it was held to that record, and the remedy said `--org <40 c's>`, which `execute` then refuses as `adopt-org-too-long`. A record at the limit still holds the plan.
- **`github.com/<300 a's>/Thing` beside a `./github.com`** is `source-unresolvable`, "names no `owner/repo` on github.com". #1122 made it `source-unreadable`, "whether a repository is there cannot be told". Both offer no url.

## Before and after

Probed with a `gh` first on PATH that logs each call and refuses it (exit 4), and with:
- `GH_TOKEN=bogus`, an empty `GH_CONFIG_DIR`;
- `GIT_SSH_COMMAND=false`, `GIT_CONFIG_GLOBAL` an empty file, `GIT_CONFIG_NOSYSTEM=1`;
- uid 1000, Python 3.12.3, run in an empty directory.

Each row is `plan --source <it> --project <repo> --org <owner>`, except where `--org` is said. `main` `961640c6` gave the same answers as #1122's head on every row.

| `--source` | #1122 head `c01c4d73` | this head |
|---|---|---|
| `<50 b's>/Thing`, `--org <50 b's>` (the issue's) | `gh repo clone <50 b's>/Thing` (1 call), `source-unclonable` | `source-unresolvable`, 0 calls |
| `<50 b's>/Thing`, `--org testorg` (the issue's) | `adopt-not-the-source`, remedy `--project Thing --org <50 b's>`, 0 calls | `source-unresolvable`, no `--org` offered, 0 calls |
| `<40 c's>/Thing` | 1 call | `source-unresolvable`, 0 calls |
| `testorg/<101 r's>`, and with `.git` | 1 call each | `source-unresolvable`, 0 calls |
| `<40 c's>/<101 r's>` | 1 call | `source-unresolvable`, 0 calls |
| `https://github.com/<40 c's>/Thing`, `github.com/<40 c's>/Thing` | 1 call each | `source-unresolvable` ("names no `owner/repo` on github.com"), 0 calls |
| `<39 c's>/Thing`, `testorg/<100 r's>`, `testorg/<100 r's>.git` (controls) | 1 call each (`.git` dropped) | the same |
| `<39 c's>/Thing`, `--org testorg` (control) | `adopt-not-the-source`, remedy `--org <39 c's>` | the same |

## Tests

The landing gate's environment throughout:
- `/usr/bin/python3 -m pytest -p no:cacheprovider`, Python 3.12.3;
- a stub `gh` first on PATH, `GH_TOKEN=bogus`, an empty `GH_CONFIG_DIR`;
- `GIT_CONFIG_GLOBAL` set to an empty file, `GIT_CONFIG_NOSYSTEM=1`;
- the test author and committer variables, and `EMAIL`;
- `GIT_SSH_COMMAND`, `GIT_ALLOW_PROTOCOL` and the `LANES_*` variables unset.

**New file `tests/test_adopt_source_github_limits.py`, 48 rows,** ASCII only. It skips on Windows: the logging `gh` is a `/bin/sh` script, and the moved rows need a POSIX `File name too long`. Each child puts the logging `gh` ahead of the suite's guard, and every `execute` gets `--local-remote-dir`.

| Test | Rows | What it asserts | #1122 head | main | this head |
|---|---|---|---|---|---|
| `test_plan_asks_gh_for_a_name_github_can_hold` (control) | 6 | owner 39, repository 100, 100 + `.git`, both at, a url and a bare url: `gh` logged exactly `repo clone <name> <work>/source-readonly/<repo> -- --quiet --origin origin`, once | 6 pass | 6 pass | 6 pass |
| `test_plan_never_asks_gh_for_a_name_github_cannot_hold` | 9 | owner 40 and 50, repository 101 and 101 + `.git`, both over, and four url spellings: the `gh` log empty, exit 2, the `source-unresolvable` line, no plan, no work directory | 9 fail at the `gh` log (`cloning ...`) | 9 fail, the same | 9 pass |
| `test_a_github_url_past_the_limits_is_refused_before_any_stat` (moved from #1122) | 4 | `[www.]github.com/<300 a's>/Thing` with a real `File name too long`; `github.com/<40 a's>/Thing` with `stat` refused (EIO, EACCES): `source-unresolvable`, no url; control at 39, both readings and the url | 4 fail at the code (`source-unreadable`, "cannot be told") | 4 fail, the same | 4 pass |
| `test_no_remedy_offers_an_org_github_cannot_hold` | 3 | `--org testorg` with owner 40, 50, both over: no `--org <owner>`, no `adopt-not-the-source`; control at 39 offers `--org <39 c's>` | 3 fail at `--org <owner>` offered | 3 fail, the same | 3 pass |
| `test_a_directory_github_cannot_name_is_read_in_place` | 2 | `./<40 c's>/Thing`, `./testorg/<101 r's>` repositories here: exit 0, recorded in place, no repository, 0 `gh` calls; control at the limit is `source-ambiguous` | 2 fail at the exit (`source-ambiguous`) | 2 fail, the same | 2 pass |
| `test_a_recorded_name_github_can_hold_is_cloned_again` (control) | 4 | `check`, `execute`: the NOTE and 1 `gh` call | 4 pass | 4 pass | 4 pass |
| `test_a_recorded_name_github_cannot_hold_is_never_cloned_again` | 6 | `check`, `execute`; owner 40, repository 101, both: the `gh` log empty, the `source-unresolvable` line, no "cloned again" | 6 fail at the `gh` log (the NOTE, "cloned again") | 6 fail, the same | 6 pass |
| `test_check_and_execute_read_a_source_name_as_plan_reads_it` | 10 | `check`, `execute` with `--source`: 4 controls at the limits (1 `gh` call), 6 past them (0 calls, `source-unresolvable`) | 6 fail at the `gh` log; 4 pass | the same | 10 pass |
| `test_a_record_github_cannot_hold_offers_no_org` | 4 | `check`, `execute` (no `--yes`); a source with no `origin`, record owner 40 and 50: no `--org <owner>`, no `plan-not-the-source`; `plan ok` / `adopt-unconfirmed`; control at 39 keeps `plan-not-the-source` and `--org <39 c's>` | 4 fail at `--org <owner>` offered | 4 fail, the same | 4 pass |

Totals for the 48 rows:
- **#1122's head:** 34 failed, 14 passed;
- **main:** 34 failed, 14 passed;
- **this head:** 48 passed.

Every row that is not a control fails on both bases, at the assertion that names the defect, not at a setup step. The 14 controls pass on all three.

**#1122's file** `tests/test_adopt_unsearchable_source.py`: 40 rows at this head, from 44. Three params moved out: the two url rows, and the url row's EIO and EACCES variants. Before the move, those four rows failed at this head (`source-unresolvable` against `source-unreadable`), and the other 40 passed.

## Mutants

Each was applied to this head's `adopt-project.py` (sha256 `d494ba0e...`) by exact substitution of the new guard line, and run against this file, `test_adopt_unsearchable_source.py` and `test_adopt_unenterable_source_and_locale.py` (101 tests). After each one the file was restored from its saved bytes and its sha256 checked. Unmutated, all 101 pass. All 8 were killed.

| Mutant | Killed by |
|---|---|
| M1: owner limit one lower (`> GITHUB_OWNER_MAX - 1`) | 24: the owner-39 controls (plan, `--source`, the recorded clone, the remedy, the directory, the held record, the moved rows' controls), and #1122's 5 owner controls at 39 |
| M2: owner limit one higher (`+ 1`) | 15: every owner-40 row (plan, url, `--source`, the recorded clone, the remedy, the directory, the held record, the 2 moved EIO/EACCES rows), and #1122's 2 `owner-one-over` rows |
| M3: repository limit one lower (`- 1`) | 15: the repository-100 controls, and #1122's 5 repository controls at 100 |
| M4: repository limit one higher (`+ 1`) | 11: every repository-101 row, and #1122's 2 `repository-one-over` rows |
| M5: owner limit removed | 25 |
| M6: repository limit removed | 15 |
| M7: both limits removed (no guard anywhere, since #1122's is folded in) | 46: every refused row here, and 12 of #1122's |
| M8: the repository counted with its `.git` (`len(segments[1])`) | 1: `test_plan_asks_gh_for_a_name_github_can_hold[repository-100-dot-git]` |

## Gate

Run on the scratch merge `w1129-gate` at `ca06ad25a`: a merge of `main` `961640c6` and this head `900f77af`. Its tree, `90fbea0e`, is the one `git merge-tree --write-tree origin/main HEAD` gives, and `main` has not moved since. The environment is the one under "Tests"; targeted files only, never the full suite. Every run ended with rc=0.

**Test files, 23:**

| File | Passed | Skipped |
|---|---|---|
| `test_adopt_source_github_limits` (new) | 48 | 0 |
| `test_adopt_unsearchable_source` | 40 | 0 |
| `test_adopt_unenterable_source_and_locale` | 13 | 0 |
| `test_adopt_check_plan_name` | 45 | 0 |
| `test_adopt_source_clone_record` | 100 | 0 |
| `test_adopt_template_values` | 78 | 0 |
| `test_adopt_work_dir_refusal` | 53 | 0 |
| `test_windows_paths` | 46 | 0 |
| `test_adopt_clone_claimed` | 42 | 0 |
| `test_adopt_late_failure` | 88 | 0 |
| `test_adopt_plan_flag_refusals_first` | 89 | 0 |
| `test_adopt_temp_work_roots` | 9 | 0 |
| `test_adopt_origin_repository` | 30 | 0 |
| `test_adopt_plan` | 66 | 1 |
| `test_adopt_project_is_the_source` | 23 | 0 |
| `test_adopt_relative_submodule_url` | 34 | 0 |
| `test_adopt_split_branch` | 47 | 0 |
| `test_adopt_values_as_typed` | 40 | 0 |
| `test_adopt_plan_escapes` | 59 | 0 |
| `test_path_guard_hygiene` | 49 | 0 |
| `test_repo_hygiene` | 101 | 0 |
| `test_scaffold_leg_path_collisions` | 104 | 0 |
| `test_github_name_limits` | 64 | 0 |
| **Total** | **1268** | **1** |

**`tests/test_shape_doctor.py`, all 448 collected ids, in 8 shards of 56** (the shard lists together hold every collected id exactly once; every `adopt-project.py` change is gated with it):

| Shard | Ids | Passed | Skipped |
|---|---|---|---|
| d01 | 56 | 56 | 0 |
| d02 | 56 | 56 | 0 |
| d03 | 56 | 55 | 1 |
| d04 | 56 | 55 | 1 |
| d05 | 56 | 55 | 1 |
| d06 | 56 | 56 | 0 |
| d07 | 56 | 56 | 0 |
| d08 | 56 | 56 | 0 |
| **Total** | **448** | **445** | **3** |

**Totals: 1713 passed, 4 skipped, 0 failed, 0 errors.** The skips are the host's: three `test_shape_doctor.py` rows that print the PowerShell line and need `powershell.exe` on a Windows host, and one `test_adopt_plan.py` row that needs `SHAPE_MEDXEHR_CLONE`, a read-only clone of MedxSoft/MedxEHR.

The gate paused after d02 for disk space and ran d03 to d08 later, on the same scratch merge, whose head did not change.

## Merges

`git merge-tree --write-tree`, this head `900f77af` against each of these; all are clean (rc=0, no conflict):

| Against | Head | Tree |
|---|---|---|
| `main` | `961640c6` | `90fbea0e` |
| #1122, the base | `c01c4d73` | `e2cea9b3` (this head's own tree) |
| #1186 | `07486a49` | `78702414` |
| #1180 | `6cd96b8b` | `eff9e4db` |
| #1178 | `c4beba19` | `b79abc31` |
| #1177 | `5208e874` | `91156ae6` |
| #1171 | `8162b874` | `87e2ce31` |
| #1170 | `24ee133a` | `f001382d` |
| #1169 | `25805102` | `b58ed451` |
| #1154 | `8a782833` | `2e67c977` |
| #1153 | `ff33ba12` | `070c39b2` |
| #1143 | `7af5fabc` | `7237b405` |
| #1141 | `7a2711d0` | `c0bcaf88` |
| #1125 | `9549006f` | `c16ff99a` |
| #1123 | `5c3908f8` | `aba16ad4` |
| #1121 | `1c517375` | `6e1f5cb9` |
| #1120 | `c55e55e3` | `845f0ab5` |
| #1119 | `bba168bd` | `ab6af7c8` |
| #1118 | `2307036a` | `1d53a9d9` |
| #1106 | `504a1dd6` | `60cd4c67` |
| #1105 | `b28f40de` | `b5f065ec` |
| #1189 | `8684af86` | `352b9e86` |
| #1190 | `00f959c6` | `6335ed44` |

These are the open PRs that touch `adopt-project.py`, and #1122 also touches `tests/test_adopt_unsearchable_source.py`. #1189 and #1190 opened, and #1169 and #1171 moved, after the first run of these; the four were merged again at the heads shown, just before the push, and the other heads were read again and had not moved. The merge with #1122 is clean as text, and see "Why stacked" for what it does not settle.

## Out of scope

- **The origin url has its own reader.** A local source whose `origin` is `https://github.com/<40 c's>/Thing` is read by `url_repository` in `scripts/repo_shape.py`, a pinned script that shares the reading with `shape-doctor.py`, and not by `_github_name`. It still records that name, and `--org testorg` would be told `--org <40 c's>`. I read this in the code and did not measure it.
- **Owner characters.** `_github_name` takes owner characters GitHub gives no owner: `.`, a trailing `-`, and `--`. `_` is let by on purpose, for GitHub Enterprise Managed Users (#863's `GITHUB_OWNER_CHARACTERS`). The brief limited this change to the two lengths.
- **The refusal's wording.** `source-unresolvable` for a spelling past the limits says "neither a path that exists nor an `org/repo` name", which is true now, but does not say which limit it broke.

Closes #1129

Lane: openreposhape-4 (openRepoShape-4)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Nov 10, 2026
… with `git rm -f` and writes the twins the root keeps back from the index, so on a disk that ignores case `execute` keeps a set the plan splits across repositories or drops (#1183) (#1237)

On a disk that ignores case, `adopt-project.py execute` lost a case twin the plan keeps in the root when its twin goes to a leg or is dropped (`adopt-lost`, exit 1), or stopped mounting the legs (`REFUSED mounting the legs`, exit 2), in each case after both legs were pushed, and `check` printed `plan ok` for every such plan, since `plan-case-twins` (#1161, #1189) asks only about twins the plan keeps in ONE repository. The loss was in the assembly's work tree, between `_mount_the_legs`'s `git rm` loop and `_stage_the_split`'s `git add -A -- .`. Now the mount removes what a case twin is at or under with `git rm -f`, writes the twins the root keeps back from the index, and takes out of the index alone what `-f` would reach through a symlink or at a gitlink.

Outside v1.2.0 by Brett Heap's ruling of 2026-10-21T10:32:04Z

- `_mount_the_legs` lists the assembly's index once, each path with its mode (`git ls-files -s -z`, `_index_modes`), and keeps each `_case_twin_sets` set with a path at or under a path it removes (`_split_case_twins`). It removes each path such a set has a path at or under with `git --literal-pathspecs rm -r -q -f --` (`GIT_RM_FORCED`) and every other path with today's `GIT_RM`, then writes the twins of those sets that the root keeps back from the index with `git checkout-index -f -z --stdin` (`_write_from_the_index`; a refusal is `CommandFailed`, one of `LATE_FAILURES`). A source with no such set gets the same `git rm` commands as before.
- A path `-f` would reach through a symlink is taken out of the index alone (r1237's MUST 1). On a disk that ignores case a folder `D/` and a symlink `d` are one name, and the clone writes `d` last: at `c9f0cc18`, `git rm -r -q -f -- D` unlinked `D/x` in the folder the symlink leads to, outside the work directory. Before each `-f`, `_taken_beyond_a_symlink` asks each path the index holds at or under the removed path, folder by folder from the top, with `lstat` (`_beyond_a_symlink`, `_is_a_symlink`), and takes a path beyond a symlink out with `git --literal-pathspecs rm -r -q --cached --` (`GIT_RM_CACHED`), which touches no file on the disk. A refusal would come after both legs are pushed, for a plan that is good on every disk.
- A gitlink whose own path is no folder is taken out the same way (r1237b's MUST 1): `git rm` of a gitlink's entry removes the folder at its path and follows a symlink there, so a plan that drops a gitlink `D` and keeps `d`, a symlink to a folder outside, stopped after both legs were pushed and left that folder EMPTY. `_index_modes` replaces `_index_paths`; where no folder on the way is a symlink, `_taken_beyond_a_symlink` asks each gitlink's own path with `lstat` (`_is_itself_a(path, kind)`, which `_is_a_symlink` now calls). The empty folder a clone writes for a gitlink is still removed with `-f`.
- The twins are written back after the loop, from the index: writing each before its sibling's `git rm` was rejected, since one `git rm -r` can remove two twins at once (a dropped folder holding `d/x` and `d/X`). `--cached` for a twin's own path was rejected too: on a disk that keeps case it leaves the file, and `git add -A` adds it again. No `core.ignorecase` probe is made, so the same commands run on every disk.
- `plan-case-twins`' remediation text is unchanged, but its words no longer name a stop at `git rm` (r1237's SHOULD 1): `execute` could stop there before any leg exists, at git's `will not add file alias`, or, for a set in the assembly root, after both legs are pushed, as `adopt-lost`. `twins_kept` pins them.
- Measured with git 2.43 on a FUSE disk that ignores case and keeps it, `plan`, `check` then `execute --local-remote-dir`, base `4d40ce9f` (#1189's head as it was then) against `ef18f059`'s `adopt-project.py`. Where the twin that goes sorts last (`A` root, `a` code), `git rm a` deleted the one file both names share and `git add -A` staged the kept twin's deletion; where it sorts first (`A` code, `a` root), `git rm A` refused with `the following file has local modifications: A`.
  - At base `across`, `acrossspec`, `dropped`, `ffacross` and `ffdropped` were exit 1, `adopt-lost`, and `acrossrev`, `droppedrev`, `dropboth` and `specode` exit 2, `REFUSED mounting the legs`; `ffacrossrev` verified. At head all verified, and so did `samebytesacross`, `samebytesdropped`, `dirmergeacross`, `deepacross` and `none`, which base was not measured on. `root` (`A`, `a` root) is `check` exit 1 and `execute` exit 2, `plan-case-twins` before any leg (#1189's refusal, unchanged), and was not run at base. "Verified" means `check` printed `plan ok`, and `execute` exited 0 with `adoption verified: every source path is in exactly one place`.
  - r1237's symlink scenarios (`victim/` outside `--work-dir`): at `c9f0cc18` `symvictim`, `symvictimdrop`, `symvictimrel` and `symboth` verified and deleted `x`, and `syminside` and `syminsidedrop` gave exit 1, `adopt-lost` `E/x`; at `0b8252c3` all verified, with `x` kept.
  - r1237b's gitlink scenarios (1 run each): at `63c52718` `glinkdrop`, `glinkdir` and `glinkcode` were exit 2, `REFUSED mounting the legs`, after both legs were pushed, with `victim` EMPTY, `glinkfile` and `glinkfiletop` exit 2 too, and `glinkfolder` verified; at `b557859f` all six verified, `victim` whole where the plan has one, and so did the symlink scenarios of both rounds but `symrev`. r1237c's `glinkrepo`: at `58aa9d2b` git moved an outside repository's `.git` into the assembly before it refused; `--cached` skips that.
  - Rows: the first rows 10 failed, 2 passed and 4 skipped at `58aa9d2b`, 12 passed and 4 skipped at head; round 1's 14 failed and 1 passed at `c9f0cc18`, 15 passed; round 2's gitlink rows 5 failed and 1 passed at `63c52718`, 6 passed; round 3's row passed at `87325bed`.
  - Mutants of the changed lines, restored after each run: 37 of 40 at `ef18f059` (34 of 40 at the first rows), 15 of 16 for round 1's, 14 of 14 for round 2's, and 10 of 11 for r1237c's, C05 killed by round 3's row at `87325bed`. Each survivor is equivalent (C09 on POSIX).
- Known limits:
  - The bench disk, which keeps case, was not run in full at head: only `across` and `acrossrev` ran there, and both verified; at base all 15 scenarios but `root` verified there.
  - `three` (`A` root, `a` code, U+00C5 drop, U+00E5 root) gave no result, a defect in the bench script, not in the tool: the plan quotes the name U+00C5 and the bench's `path:` match does not.
  - The FUSE-only rows have not been run on a FUSE disk, and skip on every CI disk; the gitlink rows make the clone's symlink, or its one file, by hand on CI's disks. Every FUSE scenario of both review rounds ran once, with git 2.43, and no real macOS or Windows disk was available.
  - `symrev` still stops at the mount, as at `58aa9d2b`: a symlink `D` that sorts first and goes to a leg, beside a folder `d/` the root keeps; `git rm -f -- D` meets the folder the clone left, `fatal: git rm: 'D': Is a directory`, exit 2 after both legs are pushed, with nothing deleted. It is filed as #1250.
  - `check`'s rehearsal of the mount still asks `git rm` without `-f` and writes no twin back, so for a twin set the plan splits that the source's rules reach (`* text=auto` on a disk that ignores case), it names a `plan-file-reencoded` the mount no longer meets, and `execute` refuses before any leg. Nothing is lost; follow-up #1298 (r1237e's SHOULD 1).
- Not in this PR: the remediation's option to answer the twins of each set into different repositories (left for a follow-up with `TWINS_REMEDIATION` and the doc trio; this PR does not call it safe on every disk), and a `check` probe of `core.ignorecase`.

Review: lane 1's independent reviewers reviewed each round. r1237 read `c9f0cc18` and found one MUST, one SHOULD and one NIT: MUST 1, the forced `git rm` removed a file through a symlink a case twin left, answered by `0b8252c3`; SHOULD 1, `plan-case-twins`' words named a stop at `git rm` that `-f` took away, by `f645fcb8`; NIT 1, `_split_case_twins`' docstring, by `63c52718`. r1237b read `63c52718` and found one MUST, one SHOULD and three NITs: MUST 1, a gitlink whose case twin is a symlink, answered by `9259da2b`; SHOULD 1 (R11), NIT 1 (R04) and NIT 2 (R02, R03), each a row, by `3ff03feb`; NIT 3, the test module's #1183 paragraph, by `b557859f`. r1237c read `b557859f` and found it READY, with three NITs: NIT 1 (C05, a row for a gitlink's own path asked only after the folders on the way) is answered by `87325bed`; NIT 2, three stale lines, and NIT 3, the Why bullet on `--cached`, are applied to the body. After #1189 landed as `9cb156a9` (the squash of its final head `dae72509`), the branch was restacked by three merges with no rebase, `181c992c`, `dbbe541e` and `b61d218e` (main `370a23cd`). The reviewed delta and the restacked one are the same 1069 lines (sha256 `58581a52` and `4dbd7dcf`) but for the docstring's blank line; at `87325bed` it is 1088 lines (sha256 `9de5b4d6`), adding exactly round 3's NIT 1 lines. r1237d found `87325bed` READY, with no MUST and no SHOULD (#1237 issuecomment-6755448563). Its NIT 2 is applied to the body. Its NIT 1, a comment's wording, is answered by `fa6d189f`, after a merge of main `de55beb0` (`04f1d0fd`) that #1253's landing needed: one `conftest` import hunk was resolved, and the PR's own lines are otherwise unchanged. r1237e read `fa6d189f` (#1237 issuecomment-6760779988) and found the merge correct, with one SHOULD the branch already had, taken as the Known limit and #1298, which it grades READY.

Tests, under a stub `gh` with a bogus token, at `87325bed` with CPython 3.12.3 on the bench (CI runs 3.14), one pytest call per line: `tests/test_adopt_check_throwaway_repos.py` 233 passed and 6 skipped (the 4 FUSE-only rows, and 2 outside this section), its #1183 section alone, 43 rows, 39 passed and 4 skipped; `tests/test_adopt_make_reads_first.py` 34 passed; `tests/test_adopt_clone_template.py`, `tests/test_adopt_git_rm_bytes.py`, `tests/test_adopt_late_failure.py`, `tests/test_adopt_mount_ignored.py` and `tests/test_adopt_submodules.py` 316 passed; `tests/test_adopt_collision_make_reads.py` with `tests/test_adopt_single_repository_record.py` 67 passed; `tests/test_scaffold_leg_path_collisions.py` 104 passed; `tests/test_path_guard_hygiene.py` with `tests/test_no_auto_maintenance.py` 179 passed and 2 skipped; `tests/test_agents_md_codes.py`, `tests/test_cli_reference.py` and `tests/test_repo_hygiene.py` 171 passed; `tests/test_shape_doctor.py` in 4 shards 112 passed, 112 passed, 113 passed, and 109 passed and 3 skipped. `tests/test_adopt_symlink_target_bytes.py` gave `13 failed, 137 passed` at `87325bed`, the same 13 rows that failed on main `370a23cd` then, each because #1170's row did not expect the `plan-case-twins` finding #1189 adds; with lane 1's #1293 (`d3143d84`) merged into a scratch copy of that head, never pushed, it gave 150 passed. #1293 has since landed as `9304069`, and `73b45ee5` holds it. At `fa6d189f`, the first file gave 260 passed and 6 skipped, with #1253's 27 rows, and `tests/test_adopt_symlink_target_bytes.py` 150 passed.

It lands by fast refresh (Brett Heap, 2026-10-15T22:48:35Z). After #1189 landed, the branch was restacked over its squash by three merges, and r1237d found the result, `87325bed`, READY; after #1293 mended main, the branch was refreshed over it (`73b45ee5`); after #1253 landed, main was merged into it with r1237d's NIT 1, and r1237e found that head, `fa6d189f`, READY with one Known limit. `fa6d189f` is its H0, and it is green on Linux and SonarCloud. The branch was never rebased. Any commit after H0 is update-branch's clean merge of main, and the head that lands, 1bb333c, is green on SonarCloud and Git Bash. Lane 1's gate passed on its tree: 47 pytest calls over `tests/test_adopt_check_throwaway_repos.py`, `tests/test_adopt_symlink_target_bytes.py`, `tests/test_adopt_root_symlinks.py`, `tests/test_adopt_root_shape_paths.py`, `tests/test_adopt_clone_template.py`, `tests/test_adopt_git_rm_bytes.py`, `tests/test_adopt_late_failure.py`, `tests/test_adopt_mount_ignored.py`, `tests/test_adopt_submodules.py`, `tests/test_adopt_collision_make_reads.py`, `tests/test_adopt_make_reads_first.py`, `tests/test_adopt_next_make_reads_first.py`, `tests/test_adopt_root_manifest.py`, `tests/test_adopt_shape_pin_and_work_dir.py`, `tests/test_adopt_verify.py`, `tests/test_doctor_plan_overrides.py`, `tests/test_adopt_reencoded_files.py`, `tests/test_adopt_nested_attributes.py`, `tests/test_adopt_eol_block_through_links.py`, `tests/test_adopt_printed_sentences.py`, `tests/test_adopt_single_repository_record.py`, `tests/test_scaffold_leg_path_collisions.py`, `tests/test_path_guard_hygiene.py`, `tests/test_no_auto_maintenance.py`, `tests/test_agents_md_codes.py`, `tests/test_cli_reference.py`, `tests/test_repo_hygiene.py`, `tests/test_adopt_clone_default_remote_name.py`, `tests/test_adopt_filter_repo_origin_url.py`, `tests/test_adopt_github_exits.py`, `tests/test_adopt_partial_clone_source.py`, `tests/test_adopt_pin_row_values.py`, `tests/test_adopt_pins.py`, `tests/test_adopt_plan_against_its_source.py`, `tests/test_adopt_plan_and_remote_paths_spelled.py`, `tests/test_adopt_plan_paths_spelled.py`, `tests/test_adopt_plan_value_order.py`, `tests/test_adopt_plan_values_read_as.py`, `tests/test_adopt_relative_submodule_url.py`, `tests/test_adopt_shown_default_ignorables.py`, `tests/test_adopt_source_clone_record.py`, `tests/test_adopt_source_github_limits.py`, `tests/test_adopt_spelled_unambiguous.py`, `tests/test_adopt_unsearchable_source.py`, `tests/test_advisory_agents_md_symlink.py`, `tests/test_bootstrap_spelling.py`, `tests/test_doctor_local_leg_aliases.py`, `tests/test_doctor_unreadable_paths.py`, `tests/test_doctor_unreadable_pin.py`, `tests/test_family.py`, `tests/test_load_yaml_refusals.py`, `tests/test_manifest_validator.py`, `tests/test_naming_gate_spelled.py`, `tests/test_naming_policy_line_break.py`, `tests/test_pinned_copy_text.py`, `tests/test_root_git_unreadable.py`, `tests/test_shape_doctor.py`, `tests/test_update_shape_merged_away.py`, `tests/test_update_shape_pin_source.py`, `tests/test_update_shape_unreadable.py`, `tests/test_value_pattern_line_break.py` and `tests/test_shape_doctor.py` in 4 shards: 5,170 passed, 19 skipped.

Closes #1183

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

Labels

None yet

Projects

None yet

1 participant