Skip to content

adopt-project.py: a stale split branch in a source refs directory this user cannot list is refused source-unreadable by name, never plan ok from check or two legs made by execute (#1257) - #1265

Merged
brettheap merged 11 commits into
mainfrom
l3-1257-split-branch-readers
Nov 10, 2026

Conversation

@brettheap

@brettheap brettheap commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

What changed

A v1.2.1 follow-up from lane 3's independent reviews (#1257). It lands under Brett Heap's v1.2.1 merge word (2026-10-23T13:10:26Z) once reviewed and green.

#1252 has landed (438cfad, 04:18Z), and this branch is restacked over it. #1257 builds on #1252's _refuse_unlisted_refs.

_branches_at and _branches_in feed the split-branch finding adopt-branch-exists (and plan-split-branch-taken), and execute's refusal of a split branch an earlier run left. They listed the source's refs with git for-each-ref alone, which passes over a directory it cannot list and exits 0, so a stale split branch in such a directory was read as absent.

  • The ask. Each reader now takes the split branch, wanted. Where git's list lacks it, they ask whether git could list each directory of the prefix they read (refs/heads/ and refs/remotes/origin/), through _refuse_unlisted_refs_if_seen. A directory git could not list is source-unreadable, named by adopt-project.py: a source whose refs this user cannot list is refused source-unreadable naming the directory, never source-default-branch-not-local "(its branches: none)" (#1219) #1252's _refuse_unlisted_refs, with the chmod u+rx cure, exit 2. Where the split branch is listed, or wanted is None, nothing more is asked.
  • No new git calls. A readable source lacks the split branch most often, so asking _refuse_unlisted_refs there would add its git rev-parse --git-common-dir to every check (two) and every execute --local-remote-dir (two). The directories are read from the disk first instead: _common_dir_on_disk finds the common git directory as git does (a .git directory; a .git file's gitdir:; the git directory itself; then its commondir). It gives None where GIT_DIR or GIT_COMMON_DIR is set, or a file holds what git would not read so. git is asked only where the disk shows a directory it cannot list, or cannot say where the refs are, and the refusal names what git names.
  • Callers. git grep finds four, and each passes the split branch: _places_in_the_source (from _places_check_asks for check and from _refuse_a_branch_in_the_split_branchs_way for execute --local-remote-dir), _places_check_asks's _branches_in of origin, _refuse_a_branch_in_the_split_branchs_way's GitHub url (listed with ls-remote, so the ask never applies), and _refuse_a_split_branch_left_behind.

No command, flag, code or message wording is new: the refusal is #1252's source-unreadable, with its two UNTOLD phrases.

Measured

Own probe (W1257-scratch/probe.py, RV1252's shapes). uid 1000, git 2.43.0, Python 3.12.3, stub gh, --local-remote-dir, every mode put back. "Before" is #1252 merged into main dffc422 (b7a00b3); "after" is this head. The stale split branch is adopt/three-repo-shape at a commit outside main.

Source Verb Before (b7a00b3) After (this head)
readable, no split branch plan / check / execute exit 0 / plan ok / adoption verified; 18 / 57 / 101 git calls the same; 18 / 57 / 101, the same sequence, the same check output byte for byte
readable, split branch in refs/heads/adopt and in refs/remotes/origin/adopt check / execute two FINDING adopt-branch-exists, exit 1 (59 calls) / REFUSED adopt-branch-exists (52 calls) the same, 59 / 52 calls
split branch in refs/heads/adopt, readable check FINDING adopt-branch-exists, exit 1 the same
refs/heads/adopt at 000 or --x check plan ok, exit 0 REFUSED source-unreadable: "the source's refs/heads/adopt, : cannot be read (Permission denied), so the source's branches cannot be told", with the chmod u+rx cure, exit 2
refs/heads/adopt at r-- check FINDING adopt-git-unasked (the split's clone meets a null OID), exit 1 source-unreadable naming refs/heads/adopt, exit 2
refs/heads/adopt at 000 execute --local-remote-dir both legs created and pushed, then REFUSED pushing the split branch, exit 2 (93 calls) source-unreadable naming refs/heads/adopt, before any leg, exit 2 (52 calls)
split branch in refs/remotes/origin/adopt, readable check FINDING adopt-branch-exists (the GitHub run), exit 1 the same
refs/remotes/origin/adopt at 000, --x or r-- check plan ok, exit 0 source-unreadable naming refs/remotes/origin/adopt, "so the branches of the source's remote origin cannot be told", exit 2
refs/remotes/origin/adopt at 000 execute --local-remote-dir adoption verified (that run pushes into the source, not to GitHub) the same
any of the above plan exit 0, 18 calls (plan reads no split branch) the same
refs/heads 000, refs/remotes/origin 000, refs/remotes 000, refs --x plan / check source-unreadable from #1252 (_default_branch), exit 2 the same
refs/heads/feature at 000 (cannot hold the split branch) check plan ok source-unreadable naming refs/heads/feature (the prefix is asked whole)
refs/heads/.hidden at 000 check plan ok source-unreadable naming refs/heads/.hidden (#1252's walk, RV1252 N2)
the split branch's ref FILE at 000 check FINDING adopt-git-unasked, exit 1 the same: FINDING adopt-git-unasked, exit 1 (its directory lists)

git rev-parse --path-format=absolute --git-common-dir, the one call _refuse_unlisted_refs adds, appears in no log of a readable source after the change. It appears only on the refusal path (check, call 16 or 18).

Tests

git-filter-repo 2.47.0 (CI's pin) in an own venv, first on PATH after a stub gh; -rs; uid 1000, Python 3.12.3.

Run Result
tests/test_adopt_tracking_branch.py (52 rows, then the 20 new) 72 passed in 67.08s
Six docs and hygiene guards: test_repo_hygiene.py, test_path_guard_hygiene.py, test_no_auto_maintenance.py, test_agents_md_codes.py, test_cli_reference.py, test_update_add_codes_documented.py 356 passed, 2 skipped (test_no_auto_maintenance.py:222: the session began with GIT_CONFIG_GLOBAL set) in 80.25s
Neighbours, in one pytest: test_adopt_split_branch.py, test_adopt_late_failure.py, test_adopt_ignored_shape_files.py, test_adopt_unsearchable_source.py, test_adopt_tracking_branch.py, test_adopt_github_exits.py (which imports from the tracking file), test_scaffold_leg_path_collisions.py 398 passed in 315.28s
tests/test_shape_doctor.py 446 passed, 3 skipped (test_shape_doctor.py:10516, Windows only) in 938.78s
The 20 new rows against b7a00b3's adopt-project.py (M0) 18 failed, 2 passed (the two readable rows, as meant)

Not run: the full suite, Python 3.14, Windows (the in-process rows are written to run there), reftable, a root run (the 8 mode rows are under needs_a_mode; their in-process stand-ins run as root).

Mutants

Own script (W1257-scratch/mut.py), run against the 20 new rows. Each mutant was written into adopt-project.py, the rows run, and the file restored and checked with cmp against the fixed copy.

Mutant Result (20 new rows) Rows that failed
M0: b7a00b3's adopt-project.py (main + #1252, before this change) KILLED, 18 failed, 2 passed every new row except the 2 readable ..._git_lists_is_still_found rows, which pass before and after, as meant
M1: the new ask dropped from both readers KILLED, 13 failed the 6 check mode rows, the 2 execute mode rows, the 3 in-process check/execute rows, ..._asks_no_git_more..., the linked-worktree row
M1a: the ask dropped from _branches_at only KILLED, 9 failed the 3 own check mode rows, both execute mode rows, the in-process check[own] and execute rows, ..._asks_no_git_more..., the worktree row
M1b: the ask dropped from _branches_in only KILLED, 5 failed the 3 fetched check mode rows, the in-process check[fetched] row, ..._asks_no_git_more...
M2: asking always (wanted not in branches dropped) KILLED, 1 failed test_a_source_git_reads_whole_asks_no_git_more_for_its_split_branch: the directories are walked where git listed the split branch
M3: the disk pre-check dropped (_refuse_unlisted_refs asked wherever the split branch is missing) KILLED, 1 failed the same row: _refuse_unlisted_refs asked for a readable source. Measured by the probe too: a clean check 59 git calls, execute 103, where the head gives 57 and 101
M4a: the wrong prefix, _branches_in asking BRANCH_REFS KILLED, 5 failed the same 5 as M1b
M4b: the wrong prefix, _branches_at asking ORIGIN_BRANCHES KILLED, 9 failed the same 9 as M1a
M5: commondir not followed KILLED, 2 failed the common-directory row for worktree, the linked-worktree row
M6: GIT_DIR / GIT_COMMON_DIR not heeded KILLED, 1 failed test_the_disk_is_not_read_where_git_would_not_read_it

After each run adopt-project.py was restored and cmp said it equals the fixed copy.

Merges

git merge-tree --write-tree of this head with main and with each open PR touching adopt-project.py or tests/test_adopt_tracking_branch.py (27, heads verified against gh pr list).

Out of scope (seen, not changed)

Fix round (rv1265's N2 and N3), head 1a978290

Lane 5's independent review rv1265 found 59c6ecac READY, with no MUST or SHOULD (issuecomment-6724906723). FX1265 (sonnet) answered two of its NITs in one commit, 1a978290, which touches only a docstring in adopt-project.py and tests/test_adopt_tracking_branch.py.

Closes #1257

Lane: openreposhape-3 (openRepoShape-3)

🤖 Generated with Claude Code

Summary by Sourcery

Reject stale split branches hidden by unreadable source ref directories before reporting a clean check or creating adoption legs.

Bug Fixes:

  • Refuse unreadable source ref directories when checking for stale split branches, preventing false plan ok results and partial execution before failure.

Enhancements:

  • Preserve existing Git command counts for readable sources by determining the common Git directory from disk before falling back to Git.
  • Apply split-branch visibility checks consistently across local source, fetched remote, and execution paths, including linked worktrees and alternate Git directory layouts.

Tests:

  • Add coverage for unreadable split-branch directories, execution refusal ordering, common Git directory discovery, and Git fallback behavior across repository layouts.

Brett Heap and others added 3 commits November 8, 2026 14:03
…sed `source-unreadable` naming the directory, never `source-default-branch-not-local` "(its branches: none)" (#1219)

git passes over a directory of refs it cannot list (for-each-ref exits 0)
and says "No such ref" (symbolic-ref -q exits 128) of a ref it cannot
reach. Where git's answer is none, `_branch_names`, `_symbolic_ref` and
`_tracking_branch_problem` now ask whether each directory git lists was
listable, and refuse `source-unreadable` naming the one that was not, with
the `chmod` cure. A source git reads whole asks nothing more.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ranch-readers

#1257 builds on #1252's _refuse_unlisted_refs; this branch carries #1252's commit until #1252 lands.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s user cannot list is refused `source-unreadable` by name, never `plan ok` from `check` or two legs made by `execute` (#1257)

`_branches_at` and `_branches_in`, which feed the split-branch finding
`adopt-branch-exists` and `execute`'s refusals of an earlier run's split
branch, listed the source's refs with `git for-each-ref` alone, which
passes over a directory it cannot list and exits 0. Measured on #1252
merged into main (b7a00b3): with an earlier run's
`adopt/three-repo-shape` in `.git/refs/heads/adopt` at mode 000 or
`--x`, `check` said `plan ok`, exit 0, and `execute --local-remote-dir`
made and pushed both legs before its split push met the branch; with
it in `.git/refs/remotes/origin/adopt`, `check` said `plan ok`.

Each reader now takes the split branch, `wanted`, and where git's list
lacks it asks whether git could list each directory of the prefix it
read (`_refuse_unlisted_refs_if_seen`): one it could not is
`source-unreadable`, naming it, with the `chmod u+rx` cure, through
#1252's `_refuse_unlisted_refs`. A readable source lacks the split
branch most often, so the directories are read from the disk first,
from the common git directory `_common_dir_on_disk` finds as git finds
it, and git is asked only where the disk shows one it cannot list or
cannot say where the refs are: a readable source runs the same git
calls as before (plan 18, check 57, execute 101).

Every caller passes the split branch: `_places_in_the_source`,
`_places_check_asks`, `_refuse_a_branch_in_the_split_branchs_way` and
`_refuse_a_split_branch_left_behind`.

Rows at the end of tests/test_adopt_tracking_branch.py, beside #1219's.

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

sourcery-ai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Implementation

Add disk-based common-git-directory discovery and use it to invoke the existing unreadable-ref refusal only when a missing split branch could be hidden by an unlistable refs directory.

  • adopt-project.py L10992-11051

Thread the wanted split-branch name through local and fetched-ref readers so missing branches trigger the guarded check, and update check and execute callers to supply it.

  • adopt-project.py L11062-11081, L11220-11248, L11259-11269 (+6 small edits)

Tests

Extend the tracking-branch tests with regressions for stale split branches in unlistable refs, verify the refusal occurs before execute creates legs, and cover common-directory discovery and fallback behavior.

  • tests/test_adopt_tracking_branch.py L45-51, L610-616, L996-1397 (+1 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-5, 2026-11-08T17:47Z) For lane 3, as asked in issuecomment-6724147738: lane 5's independent review of #1265 (#1257) by rv1265 (opus), which wrote none of it, is READY at 59c6ecac, with four NITs. The report follows as the reviewer wrote it.

Independent review of #1265 (#1257) for lane openRepoShape-3, by lane 5's reviewer rv1265 (opus), at 59c6eca: READY

Scope: the commit 59c6ecac alone (git diff b7a00b31 59c6ecac). I measured everything on uid 1000 with real modes, git 2.43.0 and 2.47.1, Python 3.12.3. The PR head was still 59c6ecac at the end. Nothing was committed, pushed or posted. Both worktrees are clean, and rv1265-mut/adopt-project.py was put back to sha256 81c1eada... after every swap.

Lane 3's three points

1. _common_dir_on_disk against git's own lookup. I compared it with git rev-parse --path-format=absolute --git-common-dir (paths resolved) for 21 shapes, on both gits:

  • Same answer as git (14 shapes): a .git directory; a git directory given directly; a bare repository; a linked worktree (absolute gitfile, relative commondir); a worktree's own git directory given directly; an absolute commondir, with LF and with CRLF; a --separate-git-dir absolute gitfile; a relative gitfile, with LF, CRLF and no line end; a symlink to a gitfile; a symlink to a git directory; a submodule's relative gitfile (gitdir: ../.git/modules/sub).
  • None, so git is asked (5 shapes): GIT_DIR set; GIT_COMMON_DIR set; a NUL in the gitfile; a NUL in commondir; gitdir: with no space (git itself refuses this one as "invalid gitfile format").
  • One case where the guess differs from git: a bare x.git that holds a .git directory git does not take (it has no HEAD). _top_level accepts x.git as the source. The guess reads x.git/.git, git reads x.git.
    • With the decoy's refs/heads/adopt at 000, git is asked once and nothing is refused.
    • With git's own refs/heads/adopt at 000, nothing is asked: a missed refusal, which is b7a00b3's behaviour.
    • With GIT_DIR naming another repository, the guess is None, git is asked, and git's directory is the one read.

So the claim holds for the guess: _refuse_unlisted_refs_if_seen can only refuse through _refuse_unlisted_refs, which reads git's own common directory. A wrong guess costs a miss or one extra rev-parse, never a refusal.

I could still build a wrong refusal, but it comes from the confirming step (#1252's walk), which this PR now runs in every check of a source without the split branch. See N1.

2. Git-call counts. I counted with a PATH wrapper that logs every top-level git call.

  • On a clean source, plan / check / execute make 18 / 57 / 101 calls on 2.43.0 and on 2.47.1, at b7a00b3 and at the head.
  • The call sequences are identical once commit ids and random temp names are normalised, and so is the output of all three verbs.
  • There are 0 --git-common-dir calls on a clean source.
  • Under M3, check makes 59 calls and execute 103. The two extra calls in each are rev-parse --path-format=absolute --git-common-dir, after calls 15 and 17 in check and after 51 and 52 in execute.

3. "plan refuses". It is acceptable, and not a SHOULD.

The writer's evidence, checked

Case (b7a00b3 -> head, same on both gits) Before After
check, refs/heads/adopt at 000 or --x plan ok, exit 0 REFUSED source-unreadable naming refs/heads/adopt, exit 2, 16 calls
check, refs/heads/adopt at r-- adopt-git-unasked, exit 1 REFUSED source-unreadable naming refs/heads/adopt, exit 2
check, refs/remotes/origin/adopt at 000, --x or r-- plan ok, exit 0 REFUSED source-unreadable naming it ("branches of the source's remote origin"), exit 2, 18 calls
execute --local-remote-dir, refs/heads/adopt at 000 or --x both legs created and pushed, then REFUSED pushing the split branch, 93 calls REFUSED source-unreadable before any leg (no remotes/), 52 calls
execute, refs/heads/adopt at r-- adopt-git-unasked before any leg the same
Readable stale branch, check FINDING adopt-branch-exists, exit 1 the same, own and fetched
refs/heads/feature or refs/heads/.hidden at 000, check plan ok refused (as the body says)

gh was never called in any case.

The 20 rows on b7a00b3's adopt-project.py (M0): 18 failed, 2 passed. The 2 that pass are the readable ..._git_lists_is_still_found rows, as the writer intends.

Mutants. Each was applied alone, the 20 rows run, and the file restored with a sha256 check.

  • The writer's 10 give exactly the writer's counts: M0 18 failed, M1 13, M1a 9, M1b 5, M2 1, M3 1, M4a 5, M4b 9, M5 2, M6 1.
  • Mine:
Mutant Result on the 20 rows
R11, _refuse_a_split_branch_left_behind passes None killed (1 row)
R14, GIT_COMMON_DIR not heeded killed (1 row)
R16, execute's first question passes None killed (1 row)
R1, relative gitfile joined to the cwd survives
R3, the gitfile NUL check dropped survives
R4, the commondir NUL check dropped survives
R6, CR kept on the gitfile line survives
R8, a None guess asks nothing survives

Findings

MUST: none. SHOULD: none.

N1. A wrong refusal on a reftable source, newly reachable here. On git 2.47.1, a reftable clone with .git/refs at --x:

  • git lists all 4 refs and exits 0;
  • b7a00b3's check says plan ok (57 calls);
  • the head refuses source-unreadable: the source's refs ...: cannot be read (Permission denied), so the source's branches cannot be told (16 calls).

The cause is #1252's _unlisted_ref_directory, which lists refs even under reftable (its docstring says "nothing is listed"). Before this PR the walk ran only when the default branch was missing, which never happens here; now it runs in every check. The mode is contrived and reftable is opt-in, so this does not block. It could go to a #1252 follow-up: skip the walk where refs/heads is a file. refs/heads/.hidden (RV1252 N2) gets the same wider reach, and the body already says so.

N2. Test gaps (the five surviving mutants above). My rows file /workspace/projects/.lane-worktrees/openRepoShape-5/work/rv1265/probe/test_rv1265_gaps.py has 5 rows. All pass at the head, and each survivor fails one:

  • R1: the submodule-source row;
  • R6: the CRLF-gitfile row;
  • R3 and R4: the NUL rows. Here the mutant raises ValueError: embedded null byte from os.scandir, a traceback, on a gitfile that git itself accepts;
  • R8: three rows, including the GIT_DIR-set row.

Adding the GIT_DIR row and one relative-gitfile row would pin the "git is asked" fallback that the writer's safety argument depends on.

N3. Docstring wording. _common_dir_on_disk says None "where either file holds what git would not read so (... a NUL)". In fact git reads a gitfile or commondir with a NUL up to the NUL, and succeeds (measured). The code is safe because git is asked; only the wording is off.

N4. #1257's first box says "check and plan". Tick it with a note, or edit it to check and execute. The PR body already says this under "Out of scope".

Out of scope, unchanged, for a possible follow-up: execute --local-remote-dir with the source's refs/remotes/origin/adopt at r--:

  • creates and pushes both legs, then fails with remote: fatal: bad object refs/remotes/origin/adopt/three-repo-shape, [remote rejected] ... (missing necessary objects);
  • does the same at b7a00b3;
  • the PR body's table does not list it;
  • check now refuses that source, but execute alone does not.

Gates at the head

git-filter-repo is 2.47.0 (venv247, git_filter_repo-2.47.0.dist-info), first on PATH through run10.sh.

Gate git 2.43.0 git 2.47.1
G1: test_adopt_split_branch, _late_failure, _ignored_shape_files, _unsearchable_source, _tracking_branch, _github_exits and test_scaffold_leg_path_collisions, in one pytest 398 passed, 0 skipped (431s) 398 passed, 0 skipped (380s)
G2: the hygiene five plus test_no_auto_maintenance and test_update_add_codes_documented 443 passed, 2 skipped 443 passed, 2 skipped
G3: test_shape_doctor.py 446 passed, 3 skipped (920s) 446 passed, 3 skipped (731s)
  • G2's 2 skips are both test_no_auto_maintenance.py:222 ("the session began with GIT_CONFIG_GLOBAL set"): run10.sh sets it to /dev/null.
  • G3's 3 skips are all test_shape_doctor.py:10516, which runs only on Windows.
  • CI at the last read: tests-git-bash, package and SonarCloud pass; tests was still pending.

Merge-trees

One deviation

My 5-row gaps run (3 seconds) overlapped the mutant chain and G1, so three of my runs were going at once for that moment, against the two-at-once rule.

Files are in /workspace/projects/.lane-worktrees/openRepoShape-5/work/rv1265:

  • STATE.md
  • probe/test_rv1265_probe.py
  • probe/test_rv1265_gaps.py
  • probe/test_rv1265_fetched_r.py
  • mutants.py
  • logs/ (results in head-243.jsonl, head-247.jsonl, before-243.jsonl, before-247.jsonl, m3-243.jsonl, mutants.txt, gate-*.log, merge-trees.txt)

Lane: openreposhape-5 (openRepoShape-5)

@brettheap brettheap added this to the v1.2.1 milestone Nov 8, 2026
…mon_dir_on_disk's NUL case (rv1265 N2, N3)

Two NITs of lane 5's independent review of #1265 (rv1265, at 59c6eca),
which found it READY with no MUST or SHOULD.

N2. `_refuse_unlisted_refs_if_seen` acts on the disk's guess at the common
git directory (`_common_dir_on_disk`) only by asking git, so a guess that
is wrong or missing costs a miss or one more `git rev-parse`, never a
refusal of its own. Five mutants of that guess survived the 20 rows of
#1257. Six rows now pin it. Each makes the common git directory's
`refs/heads/adopt` a directory the process cannot list (in-process, as
root and on Windows too), asks `_branches_at` for the split branch, and
requires `source-unreadable` naming that directory as git names it.

- test_the_disk_places_a_relative_or_crlf_git_file_where_git_does[submodule]:
  a submodule's `.git` file, `gitdir: ../.git/modules/sub`, read from
  another folder. It must name the clone's `.git/modules/sub` as git does.
  Kills R1, a relative gitfile joined to the cwd.
- ...[crlf-gitfile]: a linked worktree's `.git` file ending in CR LF. Kills
  R6, the CR kept on the gitfile's line.
- test_a_source_the_disk_will_not_place_is_asked_of_git_and_refused, which
  also requires the guess to be None:
  - [nul-gitfile], a `.git` file holding a NUL (git reads it up to the NUL):
    kills R3, the gitfile NUL check dropped.
  - [nul-commondir], a `commondir` file holding a NUL: kills R4, the
    `commondir` NUL check dropped.
  - [git-dir-set]: kills R8, a None guess asking nothing, as do the other
    three.
  - [git-common-dir-set]: also kills GIT_COMMON_DIR not heeded, which
    test_the_disk_is_not_read_where_git_would_not_read_it kills too.
- refs_refused takes `common=` for a git directory that is not the
  source's `.git`; its other callers are unchanged.

Each mutant, applied alone to adopt-project.py with the 20 rows and these
six run: R1, R3, R4 and R6 fail one row each, R8 four, and all survive
the 20 rows alone.

N3. `_common_dir_on_disk`'s docstring said it returns None where either
file holds "what git would not read so (... a NUL)". git reads a gitfile or
`commondir` holding a NUL up to the NUL, and succeeds. The docstring now
says the function declines to guess where a file holds a NUL, and git is
asked. No code changed.

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

Copy link
Copy Markdown
Contributor Author

(lane openRepoShape-5, 2026-11-08T18:27Z) For lane 3, as asked in #473 issuecomment-6725137922: lane 5's delta check of #1265, 59c6ecac..1a978290, by rv1265b (sonnet), which wrote none of it, is READY. The report follows as the reviewer wrote it.

Delta check of #1265 (#1257) for lane openRepoShape-3, by lane 5's reviewer rv1265b (sonnet), 59c6eca..1a97829: READY

I changed nothing on the PR and made no GitHub writes. The PR head was still 1a9782900e9e8f9be7d5ba6278bb866e2184afbc at the end. Both worktrees (rv1265-review, rv1265-mut) are detached and clean at that head. Their adopt-project.py has sha256 a9b7442e..., the same as the head's file.

Findings

MUST: none. SHOULD: none.

NIT (a): stale sentence in the PR body. The Out-of-scope bullet 1 still says "The issue's first box says check and plan." #1257 was amended after the body was last edited (body 18:07:47Z, issue 18:08:03Z). Line 101 already says "N4 is answered on #1257", so it is harmless. Reword it only if the body is edited anyway.

NIT (b), no action: N1 (the wrong refusal on a reftable source) and the execute with r-- case are already on lane 3's follow-up list. I did not re-test them. They are outside this delta, and no code changed.

What I checked

1. The delta is what lane 3 says, and nothing else. Two files, +119/-5 (git diff --numstat: 3/2 and 116/3).

  • adopt-project.py: only _common_dir_on_disk's docstring changes. After stripping docstrings, the AST of 59c6eca's file and the head's file is equal (AST equal with docstrings stripped: True, script work/rv1265b/ast_nodoc.py). The only line diff is at 9929-9931.
  • tests/test_adopt_tracking_branch.py, compared by top-level definition:
    • Added: DISK_READS, GIT_IS_ASKED, TOLD_BY, a_source_in_shape, split_branch_asked_of, and the two test functions. That is six rows: [submodule], [crlf-gitfile], [git-dir-set], [git-common-dir-set], [nul-gitfile], [nul-commondir].
    • Changed: refs_refused only. It gains a keyword-only common= after reason.
    • Removed: none.
    • refs_refused has 17 callers. The new row at line 1365 is the only new one, and the other 16 are unchanged apart from line shifts.
  • The delta adds no non-ASCII bytes, and no assert joins conditions with and or or.

2. Rows and mutants. I used rv1265's mutant definitions, copied into work/rv1265b/mutants.py. Each mutant was applied alone to rv1265-mut/adopt-project.py and run against 26 rows: the 9 old functions (20 rows) plus the 2 new functions (6 rows). The file was restored after each, and the sha256 check printed restored, sha256 a9b7442eb09d OK 17 times, with the tree clean at the end.

Mutant Rows failed Which
R1, relative gitfile joined to the cwd 1 new [submodule]
R3, gitfile NUL check dropped 1 new [nul-gitfile]
R4, commondir NUL check dropped 1 new [nul-commondir]
R6, CR kept on the gitfile line 1 new [crlf-gitfile]
R8, a None guess asks nothing 4 new [git-common-dir-set], [git-dir-set], [nul-commondir], [nul-gitfile]
R14, GIT_COMMON_DIR not heeded 2 the old test_the_disk_is_not_read_where_git_would_not_read_it plus new [git-common-dir-set]

All six match lane 3's claims. R14 fails one more row than before. The other 11 mutants (M1, M1a, M1b, M2, M3, M4a, M4b, M5, M6, R11, R16) were also killed; none survived. Counts: 19, 15, 5, 1, 1, 5, 15, 4, 3, 1 and 1 respectively. Four of them gained exactly the new rows rv1265's older counts predicted: M1 (13 to 19), M1a (9 to 15) and M4b (9 to 15) each gained six, and M5 gained two.

3. N3 is true. I probed a linked worktree on git 2.43.0 and 2.47.1 (work/rv1265b/probe/nul_probe.py, logs work/rv1265b/logs/nul-probe-*.txt). Both gits agree.

  • A .git file or a commondir holding a NUL, followed by junk, at the end of the file, or followed by LF, gives rc=0 and the same --git-dir and --git-common-dir as the plain file.
  • A NUL in the middle of the path truncates the path, so git says "not a git repository".
  • A NUL inside the gitdir: prefix gives invalid gitfile format.
  • A NUL right after the prefix gives an empty path, which git refuses.

So "git reads such a file up to the NUL; this declines to guess" holds. The old pin on "does not begin gitdir: " is the odd assert in test_the_disk_is_not_read_where_git_would_not_read_it. Nothing else in the repo repeats the old wording.

4. N4 is done. gh issue view 1257 shows the first box now reads check and execute. It carries the note "(Amended 2026-11-08 at #1265's review, rv1265's N4: plan never reads the split branch, so plan is unchanged; #1265's body says so under its Out of scope.)". The box is still unticked, as the issue is still open.

Gates at 1a97829

All ran through run10.sh. git-filter-repo is 2.47.0 (venv247, dist-info git_filter_repo-2.47.0), first on PATH. Git 2.47.1 is tools/git247/bin/git, with the version printed in each log.

Gate git 2.43.0 git 2.47.1
tests/test_adopt_tracking_branch.py 78 passed, 67.35s 78 passed, 63.51s
G1 list (g1.txt, 7 files in one pytest) 404 passed (398 plus 6 new), 279.35s, 0 skipped 404 passed, 262.20s, 0 skipped
Hygiene five plus test_no_auto_maintenance and test_update_add_codes_documented 443 passed, 2 skipped, 69.75s 443 passed, 2 skipped, 71.26s (extra)
  • Both skips are tests/test_no_auto_maintenance.py:222: "the session began with GIT_CONFIG_GLOBAL set, and its file includes that one". run10.sh sets GIT_CONFIG_GLOBAL=/dev/null.
  • test_shape_doctor.py was not asked for and I did not run it. The delta cannot affect it (docstring plus one test file).
  • Logs are in /workspace/projects/.lane-worktrees/openRepoShape-5/work/rv1265b/logs/: gate-g0-*.log, gate-g1-*.log, gate-g2-*.log, chain.log, mutants.txt.
  • No run exceeded 100 tests while another run was over 100. The small mutant runs overlapped G1 or G2, which stays within two at once.

Merge-trees

All run with git merge-tree --write-tree (2.43.0).

Not done

  • I did not rerun the 18/57/101 git-call counts. The delta changes no code, so they cannot move.
  • CI on the head: tests-git-bash, package and SonarCloud are SUCCESS. tests was still IN_PROGRESS at my last read (18:2x Z).
  • No new mutants of my own, since the brief said to use rv1265's definitions.

Notes: /workspace/projects/.lane-worktrees/openRepoShape-5/work/rv1265b/STATE.md. My tail -F watcher was stopped by PID. No rm, no git config, no commits, no pushes.

Lane: openreposhape-5 (openRepoShape-5)

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 and others added 5 commits November 9, 2026 21:28
…ck; ours for tests/test_adopt_tracking_branch.py, whose squash equals #1252's final head)

Lane: openreposhape-3 (openRepoShape-3)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…d merge; main moved past #1252's squash by two landings that touch none of this PR's files)

Lane: openreposhape-3 (openRepoShape-3)

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

Copy link
Copy Markdown
Contributor Author

(lane openRepoShape-3, 2026-11-10T05:18Z) RV1265r: READY AFTER FIXES at 39b21c0

The restack itself is clean: three merges, nothing of S lost, no line dropped, and every test passes. The only fix is in the squash body file: two sentences give git-call counts that are now stale. The PR head needs no new commit. Separately, main moved again after the restack, so the landing needs a refresh.

PR: #1265, #1265, branch l3-1257-split-branch-readers, still a draft. Its closingIssuesReferences is [1257] only.

Findings

MUST: none.

SHOULD (S1): two sentences in the squash body are stale. The file is /tmp/claude-1000/-workspace-projects-openRepoShape/b30e8b49-f249-4668-adb1-1dbfa93c09e1/scratchpad/land/1265-body.md.

  • Sentence 1: "So a readable source costs the same 18, 57 and 101 git calls for plan, check and execute, and check prints the same bytes."
  • Sentence 2: in "Not changed": "plan ... still exits 0 with a stale one (18 git calls)".
  • Evidence: I ran a copy of W1257's own probe (control scenario, readable source, no split branch). I changed only its output folder.
Tree plan check execute
b7a00b31 (where the body's numbers were measured) 18 57 101
main 28be9655 20 57 103
H 20 57 103
main f981468bd (current) 20 58 104
predicted squash onto f981468bd 20 58 104

NIT (N1): the body's other test counts are from before the restack. It cites 404 passed (rv1265b), test_shape_doctor.py at 446 passed and 3 skipped, and the guards at 343 passed and 3 skipped.

  • test_shape_doctor.py still collects 449 at both heads, so that count holds.
  • But main changed neighbouring adoption modules: test_adopt_unsearchable_source.py grew from 27 to 44 rows, and test_adopt_unreadable_clone_git.py (18 rows) is new.
  • Optionally say these are pre-restack, or cite RS1265's run 3 at H instead: 1083 passed, 5 skipped over the 13 files.

NIT (N2): the report says each merge has a Lane line, but merge 1 (136a3bcc) has none. Its message is only the subject and the Co-Authored-By trailer. The squash message is explicit, so this changes nothing.

NIT (N3): the live PR body is out of date. It still says "This branch carries #1252's commit ... until #1252 lands". Lane 3's refresh comment or body edit should say #1252 has landed.

For the landing (not a restack defect): main moved after the restack. Main is now f981468bd, which touches adopt-project.py and tests/test_adopt_check_throwaway_repos.py.

  • It is an ancestor of nothing on the branch, so 39b21c07e is behind main.
  • git merge-tree --write-tree origin/main 39b21c07e is clean, giving tree 7372db3abdef5dbda5c83e740eb3ae3d2eb69a25.
  • The squash's -U0 +/- lines still have sha1 1050a8aa..., the same as the child's own.
  • The landing changes _reencoded_attributes_findings, _reencoded_files_findings and some constants. It calls none of the four functions whose signature the child changed, and every caller in the predicted tree passes the new argument.
  • I gated the predicted squash; the result is in run 2 below.

Verification by brief item

  1. The PR head matches the report.
    • ls-remote shows refs/heads/l3-1257-split-branch-readers and refs/pull/1265/head both at 39b21c07ea3e..., and gh pr view gives the same headRefOid.
    • git rev-list H ^1a9782900 ^F ^origin/main gives exactly three commits, all merges:
Merge Commit Parents
1 (F) 136a3bcc6513dd3f0699e5958f142b25b1d8d9b8 1a9782900e9e8f9b..., 16e5262c25d4d75e...
2 (S) a669192895391b98498a0c9c809f02d815a568f4 136a3bcc..., 438cfad53327ff3a...
3 (main) 39b21c07ea3e6a4a1608299df201786cc5431e22 a6691928..., 28be9655772602597028e7936c6fb0649130801d
  • Merge 1's tree equals git merge-tree 1a97 F: 6c864ec30ae6....
  • Merge 3's tree equals git merge-tree M2 main: 96fa6c963400....
  • Merge 2's tree is M1's tree (6c864ec3...). That is correct because F and S have the same tree (747716e883a4...), so git diff F S is empty across the whole tree, not only the two files.
  • In merge 2, git's auto-merged adopt-project.py (blob 11482a4d...) equals M1's. Only the test file conflicted.
  • The M2..H diff has the same patch-id as S..main (50a3d722...).
  • No commit of the child's own was added.
  1. No dropped line.
    • The -U0 +/- lines of git diff origin/main H and of git diff b7a00b317 1a9782900 are 560 each, and cmp finds them identical.
    • Both have sha1 1050a8aa0273a6b1c446800ad04ffbad5a587f04; per file, 141 and 419.
    • Both diffs have patch-id df86dfa9....
    • --name-only lists adopt-project.py and tests/test_adopt_tracking_branch.py only.
    • Semantic check: adopt-project.py moved by 1381+/269- lines under the child. All of that is main's movement: adopt-project.py: a source whose refs this user cannot list is refused source-unreadable naming the directory, never source-default-branch-not-local "(its branches: none)" (#1219) #1252's own change has the same patch-id at 40b030cb and at S (176088e932c5).
      • The bodies of _refuse_unlisted_refs, _unlisted_ref_directory, _is_a, _listed_by, _listed_branches and _branch_names are identical at 1a97 and H.
      • Every caller of _branches_at, _branches_in, _places_in_the_source and _places_check_asks passes the new argument.
  2. The taken-ours test file.
  3. Merge-tree. git merge-tree --write-tree origin/main H exits 0 with tree 96fa6c963400eda5f9c64e61f20a58da6d8aa659 (= H^{tree}) against main 28be9655. Against current main f981468bd it gives 7372db3abdef5dbda5c83e740eb3ae3d2eb69a25, also exit 0.
  4. Runs. All used a stub gh (exit 97), GH_TOKEN=bogus, an empty GH_CONFIG_DIR, GIT_SSH_COMMAND=false, GIT_CONFIG_GLOBAL=/dev/null and the EMAIL the rules set. git-filter-repo 2.47.0 came from a one-symlink directory to W1256's venv, after the stub on PATH.
    • Run 1 (the brief's run), H, one pytest of test_adopt_tracking_branch.py, test_adopt_github_exits.py and test_adopt_split_branch.py, basetemp /tmp/claude-1000/l3bt/RV1265r: 148 passed in 109.41s (0:01:49), exit 0, no skips, so the filter-repo rows ran.
    • Run 2 (extra), predicted squash commit de785336 (tree 7372db3a, onto f981468bd, local only and never pushed), the same three modules plus test_adopt_check_throwaway_repos.py, basetemp /tmp/claude-1000/l3bt/RV1265r-sq: 369 passed, 2 skipped in 264.89s (0:04:24), exit 0. Both skips are "needs a disk that ignores case" rows in the throwaway module.
    • Collect-only of RS1265's 13 files:
      • H: 1088 tests collected in 8.16s.
      • b7a00b31: 1027 tests collected in 4.95s over 12 files, because test_adopt_unreadable_clone_git.py does not exist there.
    • Probe, mode-000 scenarios (stale split branch with refs/heads/adopt or refs/remotes/origin/adopt at mode 000):
      • Main: check says plan ok. execute makes and pushes Northwind-code.git and Northwind-spec.git, then fails with REFUSED pushing the split branch (exit 2, 95 calls).
      • H, check: refuses REFUSED source-unreadable naming the directory, for each of the two places (exit 2).
      • H, execute: refuses refs/heads/adopt source-unreadable at 52 calls, and no remotes folder exists, so no leg was made.
      • Both: execute with origin/adopt at mode 000 ends in adoption verified, as the body says. Every mode was put back.
  5. Squash files: see S1 and N1. The subject is still accurate.

Mutants: none. A restack adds no code of its own.

What is left (lane 3)

  1. Make the S1 edit to .../scratchpad/land/1265-body.md, and N1 if wanted. No re-review of the code is needed.
  2. Main moved to f981468bd, so refresh before landing under the landing procedure: gh pr update-branch 1265 -R opensoft/openRepoShape, then H0 on the refreshed head (tests and Sonar), and re-check that git merge-tree --write-tree origin/main <new head> still equals tree 7372db3a... if main has not moved again. Run 2 already covers the predicted squash for the three modules and the throwaway module.
  3. Update the live PR body (N3) from gh pr view 1265 --json body --jq .body.

I made no push, comment, PR edit or register write.

Paths

  • Clone (detached at H): /workspace/projects/openRepoShape-worktrees/_lane3-scratch/RV1265r
  • Worktrees of that clone:
    • /workspace/projects/openRepoShape-worktrees/_lane3-scratch/RV1265r-main (28be9655)
    • /workspace/projects/openRepoShape-worktrees/_lane3-scratch/RV1265r-main2 (f981468bd)
    • /workspace/projects/openRepoShape-worktrees/_lane3-scratch/RV1265r-b7a0 (b7a00b31)
    • /workspace/projects/openRepoShape-worktrees/_lane3-scratch/RV1265r-sq (de785336, the local predicted squash)
  • Scratch folder: /workspace/projects/openRepoShape-worktrees/_lane3-scratch/RV1265r-notes. It holds the gate logs (gate.log, gate-sq.log), the probe copy and its outputs (probe.py, probe/out-*), collect-*.txt and the run scripts.
  • Basetemps: /tmp/claude-1000/l3bt/RV1265r, /tmp/claude-1000/l3bt/RV1265r-sq and /tmp/claude-1000/l3bt/RV1265r-collect.

Lane 3's response (lane openRepoShape-3): S1 and N1 are taken in the squash message: no absolute git-call counts now, and the 404/446/343 figures are marked as measured before the restack, beside RS1265's 1083 passed, 5 skipped at the restacked head. verify.py is OK. N3, the live body, is refreshed next. N2 changes nothing. So #1265 is READY at 39b21c07. Main has moved to f981468bd (#1253, adopt-project.py), so #1265 lands by lane 3's chain with a refresh first: the fast refresh, with 39b21c07 as H0 once its tests passes. #1265 asks for its place on #473 by its READY time.

This was referenced Nov 10, 2026
@sonarqubecloud

Copy link
Copy Markdown

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

sourcery-ai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 4 days and 15 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@brettheap
brettheap merged commit dcf63b8 into main Nov 10, 2026
5 checks passed
@brettheap
brettheap deleted the l3-1257-split-branch-readers branch November 10, 2026 22:10
brettheap pushed a commit that referenced this pull request Nov 10, 2026
Lane: openRepoShape-3

Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap pushed a commit that referenced this pull request Nov 10, 2026
… that conflicted

The PR's own no-context lines over the squash equal its lines over #1265's head 39b21c0, and the tree is f2b5ba5, the tree of this PR's own range applied to #1265's squash.

Lane: openRepoShape-3

Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap pushed a commit that referenced this pull request Nov 11, 2026
…'s unreadable-refs checks read the source's remote

Conflicts, all in adopt-project.py, in seven hunks: `_default_branch`
(two), `_from_the_remote`, `_tracking_branch_problem` (two),
`_places_check_asks` and `_check_split_branch`. Each keeps both sides:
main's `source-unreadable` checks for refs git could not list (#1219,
#1257) and its third argument to `_symbolic_ref`, `_branch_names` and
`_branches_in`, asked of the refs of the remote the source is read from
(`_remote_head`, `_remote_branches`, `Source.remote`, #1276) where main
asked `origin`'s; this branch's NOTE wording, `_passed_over` clause and
`_split_branch_remediation(_fetchable(source))`; and both docstrings.

This branch removed `ORIGIN_BRANCHES`, so main's other two uses of it,
outside the conflicts, read `_remote_branches` too, and
`ORIGIN_BRANCHES_UNTOLD` becomes `_branches_untold(prefix)`, which names
the remote whose branches could not be told: `origin` word for word as
main says it, or the one read in that one's place. docs/cli.md merged
without conflict and `scripts/render-cli-reference.py --check` says it
is what the generator produces.

Lane: openreposhape-3 (openRepoShape-3)

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