Skip to content

family.py and the family root's siblings.py: a holder's .gitmodules this user cannot read, as through a link into a folder it cannot search, is gitmodules-unreadable, never no section for remove's rollback or no url for make siblings (#1110) - #1164

Merged
brettheap merged 9 commits into
mainfrom
fix/1110-family-unsearchable-gitmodules
Nov 9, 2026

Conversation

@brettheap

@brettheap brettheap commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Part of #1110. This is its slice B: scripts/family.py's _gitmodules_names, _sections_giving and _stages_as, and the family root's scripts/siblings.py submodule_urls. The issue stays open for its other sites.

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"), and lands after the tag, on a later word.

What

Each of the three readers asked Path.is_file() of the holder's .gitmodules. Python 3.9 to 3.13 raise a refused stat (PermissionError); from 3.14 is_file() answers False to any OSError.

Measured with a family holder whose .gitmodules is a link into a folder at mode 000: at base 038dafba9 on Python 3.12.3 and on a 3.14-like shim (a sitecustomize that gives pathlib 3.14's answers), and at head on both. The control, the same link into a folder at 755, reads the file through the link at base and at head, on both.

Caller base, 3.12.3 base, 3.14-like shim head, 3.12.3 and the shim
family.py remove (as a person runs it), dry run and real, link into 000 or 755 gitmodules-unstaged, exit 2: git lists the link as modified, so this refusal comes before either reader same same (the order is kept)
family.py remove (as a person runs it), dry run and real, .gitmodules a file at mode 000, git's stat cache stale (git ls-files -m lists it) "a git or gh command failed", quoting git hash-object same gitmodules-unreadable, exit 2, nothing written
the same, git's stat cache current (git ls-files -m does not list it) "a git or gh command failed", quoting git config --file .gitmodules --list same gitmodules-unreadable, exit 2, nothing written
_gitmodules_names / _sections_giving / _store_git_uses / _unrestorable / _checked_one_section / _checked_mount_readable (in process) PermissionError (None, []) / [] / None / "no section of .gitmodules gives git members/IRRS" / None / True each: gitmodules-unreadable, .gitmodules: cannot be read (Permission denied)
remove's rollback (a pre-commit hook links .gitmodules into 000 and refuses the commit) traceback, exit 1, members/IRRS left gone, nothing typed exit 2, "The checkout of members/IRRS comes back only from its remote"; typed: the .gitmodules index entry, then only mkdir members/IRRS exit 2, the step named with its cure; typed: the .gitmodules index entry, git checkout -- .gitmodules, git -c protocol.allow=never submodule update --init --no-fetch -- members/IRRS, git -C members/IRRS checkout -q main --. Typed as printed once the mode is given back, they put the member back on main and leave git status clean
remove's rollback (a pre-commit hook that only runs chmod 000 .gitmodules) exit 2, "comes back only from its remote"; typed: the index entry, then mkdir members/IRRS the same: exit 2, "comes back only from its remote"; typed: the index entry, then mkdir members/IRRS as the row above
bump's and remove's rollback (a pre-commit hook that only runs chmod 000 family.yaml and refuses the commit): PinRollback._file_by_hand serves family.yaml too exit 2, "NOT family.yaml restored byte for byte"; typed: only the family.yaml index entry. With the mode given back, family.yaml stays the copy the verb had rewritten, and git status lists M family.yaml the same exit 2, the same sentence; typed: the index entry, then git checkout -- family.yaml. With the mode given back, family.yaml holds its recorded bytes and git status --porcelain is empty
siblings.py --dry-run / family.py siblings --dry-run traceback, exit 1 exit 0, "would clone https://github.com/InkRouter/IRRS.git (family.yaml repository:)" gitmodules-unreadable, exit 2
siblings.py (real run) traceback, exit 1 tried to clone from github.com, CLONE FAILED, exit 1 gitmodules-unreadable, exit 2, nothing cloned beside the holder
siblings.py --make help --dry-run, no clones traceback, exit 1 as the control: exit 1, make help ran in 0 of 2 members gitmodules-unreadable, exit 2

PinRollback._file_by_hand (scripts/family.py:8236-8256) serves every file the rollback records: bump's family.yaml, and remove's .gitmodules and family.yaml. Taking bytes it cannot read for not the recorded ones, which the two .gitmodules rollback rows above need, therefore also changes bump and remove for an unreadable family.yaml: git checkout -- family.yaml is typed after the index entry, and with the mode given back family.yaml comes back as recorded, where at base it stayed the copy the verb had rewritten (the last row above). It is the same fix at a second file, and one row holds it under each verb (r1164b's SHOULD-1).

In process, with the stat of a .gitmodules git still reads as the index's refused: at base remove --dry-run said no section is removed, exit 0, and the real run was refused only by its rollback's record, as member-unreadable. At head both are gitmodules-unreadable, exit 2, before any git command that writes, and the holder is left as it was.

The refusal names the file and the cause. A permission gets the chmod cure; any other cause gets none:

REFUSED gitmodules-unreadable: .gitmodules: cannot be read (Permission denied)
Remediation: siblings.py reads the holder's .gitmodules for each member's url, the one `make bootstrap` uses, and nothing was cloned, fetched or run without it. A path this command cannot read is a question it cannot answer, never a pass. Make what this user may not open readable by this user: `chmod u+r` on a file, `chmod u+rx` on a directory (and on every directory above it), or fix who owns it. Then run the same command again.

Why

  • One file, one code. gitmodules-unreadable is the code add's _submodule_paths and the holder's own validate-family.py already give this file, so the cure follows the cause at each site this slice changes (not in add's read or the holder's validator's, which keep their own remediation: see Known limits). In family.py the constant is GITMODULES_UNREAD_CODE, so it is not read for GITMODULES_UNREADABLE, which is the remediation _submodule_paths gives a file git cannot parse.
  • Whatever git's stat cache says. _stages_as, which remove and add ask before either reader, now asks _gitmodules_on_disk once lstat says the file is regular, before git hash-object. Without it, a file at mode 000 was refused two ways: by git hash-object's failure where git had to read the file to compare it, and as gitmodules-unreadable where git's cache spared the read. A link is still gitmodules-unstaged's first. The remedy says what the verb reads the file for (GITMODULES_READ_FOR), so add is not told what remove does.
  • Asked as _is_a asks. Nothing at the name is still no file, as it always was, and so is a directory. A refused stat is refused by name.
  • os.access too, after _checked_mount_readable's HEAD precedent. Without it, a .gitmodules at mode 000 whose stat succeeds is still read as giving no url in siblings.py (git's read fails, and that failure reads as no url) and, in the rollback, as no store.
  • No "inside the holder" in the cure (where=""): a link can lead out of the holder.
  • The rollback takes it as it takes a store it cannot read (READABLE_ONCE_CURED = (STORE_UNREADABLE, GITMODULES_UNREAD_CODE)), in PinRollback._undo_work_tree and _work_tree_by_hand. The mount is made again, empty, and the update is typed after the cure; it is never "comes back only from its remote". Met inside the rollback, the refusal's detail carries its cure, as a store's does, since the sentence prints no remediation.
  • Bytes it cannot read are not the recorded ones. _file_by_hand typed only the index entry where it could not read the current .gitmodules. The hook's copy is the one git rm wrote, without the member's section, so the update typed after the cure said No url found for submodule path 'members/IRRS'. Now git checkout -- .gitmodules is typed where the index held the recorded bytes; where they were there already, it writes the same bytes. Once cured, the checkout comes back from the store git rm keeps, with no network. _file_by_hand serves every recorded file, so the same change reaches family.yaml under bump and remove: git checkout -- family.yaml follows the index entry, and the file comes back as recorded (see What).
  • The CLI order is kept. gitmodules-unstaged still refuses a person's linked .gitmodules first.
  • siblings.py: path_unreadable(code, ...) is new and member_unreadable delegates to it. _run_placement and dispatch_all catch the refusal and return 2 before anything is cloned, fetched or run. The docstring's exit-2 paragraph names the case.

Tests

  • New tests/test_family_gitmodules_unreadable.py, 42 rows. Each site has a control (nothing there, a directory there, or a link this user can read); in-process rows for a refused stat, an I/O error and a refused os.access, which run on every Python and platform and as root; real links into a folder at 000, or a file at 000, skipped on Windows and as root; and, for family.yaml, a pre-commit hook that only takes its mode off, one row run under bump and under remove, skipped the same way.

    • head 74096eb47: 42 passed on 3.12.3, and 42 passed on the 3.14-like shim (it loaded in 14 family.py and 6 siblings.py subprocesses);
    • base 038dafba9: 31 failed, 11 passed, on 3.12.3 and on the shim alike, the same 31: the 29 of the previous head and the new row under each verb. Both new rows fail on behaviour, at assert manifest.read_bytes() == recorded after the typed commands ran. On the shim no row reached the network: the one row that tries a clone, test_make_siblings_refuses_a_gitmodules_linked_into_a_locked_folder[real], stopped three times at transport 'https' not allowed.
    • The 11 that pass on base are the controls (3 of them the new directory rows) and the order guard test_a_persons_remove_over_a_linked_gitmodules_is_refused_first.
    • The round after review (r1164): at the previous head 4352ac2fd, 7 of the 40 fail. Five are this round's behaviour: the two rollback rows typed by hand (the typed git submodule update exits 128), the stale-cache remove row, the in-process add row and the rollback sentence's cure. Two fail only on the renamed constant.
    • The round after review r1164b (SHOULD-1, NIT-1, NIT-2): the new row, with a docstring paragraph and two imports, is the only change to the file, and git diff --stat 3162b523b 74096eb47 names that test file alone, so scripts/family.py and siblings.py are as they were.
  • tests/test_path_guard_hygiene.py. The three KNOWN_OPEN entries for these sites are taken out. Before that, its stale-entry check failed on exactly those three ("0 found, 1 listed"). At 4352ac2fd: 49 passed (hygiene); at 3162b523b and at 74096eb47: 107 passed, 2 skipped with tests/test_no_auto_maintenance.py (call G2 below).

  • Mutants, each run against the new file in a scratch clone at head, each file restored after: review r1164's 22, and 7 more for this round. Run at 3162b523b: 29 of 29 killed, no survivors, none "not applied"; the clone was restored after each (git status of the clone shows only the untracked probe file). The two that survived at 4352ac2fd, M10 and M21, are killed now by the directory rows (r1164 SHOULD-1).

    One more for r1164b's SHOULD-1, run at 74096eb47: A21, _file_by_hand keeping the base behaviour for family.yaml only (same = name != GITMODULES), against the new file with tests/test_family_py_unreadable.py and tests/test_family_bump_remove_rollback.py (148 rows). It is killed, on 3.12.3 and on the shim: 2 rows failed, exactly the new row under bump and under remove, and the other 146 pass with it, so no earlier row held that case. The same 148 rows with no mutant: 148 passed on both. The clone's scripts/family.py blob equals HEAD's after it. The code M1-M29 mutate is unchanged at 74096eb47, so that is 30 of 30 killed, no survivors.

    Mutant Rows failed (at 3162b523b; A21 at 74096eb47)
    M1 _gitmodules_on_disk: _is_a back to .is_file() 5
    M2 _gitmodules_on_disk: os.access branch removed 9
    M3 _gitmodules_on_disk: OSError taken as absent 19
    M4 where="" dropped 9
    M5 _undo_work_tree back to == STORE_UNREADABLE 1
    M6 _work_tree_by_hand back to != STORE_UNREADABLE 4
    M7 READABLE_ONCE_CURED without the .gitmodules code 4
    M8 the code set to member-unreadable 15
    M9 except OSError narrowed to PermissionError 2
    M10 S_ISREG changed to any mode (survived at 4352ac2fd) 2
    M11 _gitmodules_names back to .is_file() 9
    M12 _sections_giving back to .is_file() 6
    M13 siblings.py submodule_urls: _is_a back to .is_file() 3
    M14 submodule_urls: os.access branch removed 1
    M15 submodule_urls: OSError taken as {} 10
    M16 submodule_urls: except OSError narrowed to PermissionError 1
    M17 path_unreadable: advice always OTHER_REASON 5
    M18 path_unreadable: the code ignored 10
    M19 _run_placement: refusal exit 2 changed to 1 4
    M20 dispatch_all: refusal exit 2 changed to 1 2
    M21 submodule_urls: S_ISREG changed to any kind (survived at 4352ac2fd) 1
    M22 _undo_work_tree: the mount not made again for any refusal 1
    M23 _file_by_hand: bytes it cannot read back to return typed 2 (4 at 74096eb47, with the family.yaml rows)
    M24 _stages_as: _gitmodules_on_disk not asked 2
    M25 _stages_as: the verb not passed on 1
    M26 _gitmodules_on_disk: the remedy always remove's 1
    M27 _undo_work_tree: no cure appended to the detail (NIT-1) 1
    M28 _undo_work_tree: the permission cure changed to OTHER_CURE (NIT-1) 1
    M29 _file_by_hand: bytes it cannot read taken as the same 2 (4 at 74096eb47, with the family.yaml rows)
    A21 (r1164b's) _file_by_hand: base behaviour kept for family.yaml only 2 (the new row, [bump] and [remove]), on 3.12.3 and on the shim
  • The pin. A family holder made at base 038dafba9 passes its own scripts/validate-family.py (exit 0, 10 copied shape files match). update-shape.py check against head names exactly scripts/siblings.py as upstream-changed, with the other 9 unchanged (measured at 4352ac2fd; this round does not touch siblings.py). Every name head's siblings.py imports from repo_shape (10) and bootstrap (6) is in a base holder's copies, so tests/test_update_shape_kept_helper.py needs no change.

  • The gate on Python 3.12.3 (no full suite):

    Call at 74096eb47 at 3162b523b at 4352ac2fd
    tests/test_family_gitmodules_unreadable.py (the new file) 42 passed on 3.12.3 and 42 on the shim 40 passed on both 33 passed (33 rows, as the file stood then)
    tests/test_family_py_unreadable.py and tests/test_family_bump_remove_rollback.py 106 passed 106 passed 106 passed (review r1164, with this round's _file_by_hand change)
    tests/test_path_guard_hygiene.py and tests/test_no_auto_maintenance.py (a new row sets core.trustctime locally) 107 passed, 2 skipped (call G2; the 2 skipped rows of test_no_auto_maintenance.py need a session that began without GIT_CONFIG_GLOBAL, and the probe environment sets it to /dev/null) 107 passed, 2 skipped (call G2) 49 passed (hygiene)
    the doc trio (test_agents_md_codes, test_cli_reference, test_repo_hygiene) 170 passed (run as a check: no doc, code or --help changed) 170 passed (call G3) 170 passed
    the files that name a changed function or refusal (test_family_member_branch_not_utf8, test_family_add_move_back_sections, test_family_refuse_up_front, test_family_remove_gitmodules, test_family_add_spelling_leftovers, test_family_add_spellings_remedies, test_refusal_default_remediation) not re-run: scripts/family.py is unchanged since 3162b523b 124 passed (call G4: the first three files) and 169 passed (call G5: the last four) in the 132-file run below
    tests/test_scaffold_leg_path_collisions.py not re-run: only the new test file differs 104 passed (lane 1, after this round) 104 passed
    tests/test_shape_doctor.py, 4 shards of 112 ids not re-run: only the new test file differs 112, 112, 112 passed; 109 passed, 3 skipped (lane 1) 112, 112, 112 passed; 109 passed, 3 skipped
    every other test file that names family.py, siblings.py or family-root (132 files, 8274 ids, 28 shards of 300) not re-run: only the new test file differs, and the new file's own rows are the first row above 8241 passed, 33 skipped (lane 1; every shard's count equals its count at the earlier head) 8241 passed, 33 skipped

Merged with main after #1172 landed

Known limits

Not in this PR

Lane: openreposhape-1 (openRepoShape-1)

🤖 Generated with Claude Code

Summary by Sourcery

Reject unreadable .gitmodules files explicitly and make rollback and sibling operations safe and recoverable when access is denied.

Bug Fixes:

  • Refuse unreadable .gitmodules files consistently instead of treating them as absent, surfacing a clear gitmodules-unreadable error before destructive, clone, fetch, or dispatch operations.
  • Improve rollback behavior so unreadable recorded files are restored from the index and submodule checkouts can be recovered from the local object store after access is repaired.

Enhancements:

  • Apply consistent unreadable-path detection and cause-specific remediation across family operations and sibling placement or make dispatch.
  • Preserve existing precedence for unstaged linked .gitmodules files while covering stat, access, and I/O failures.

Tests:

  • Add comprehensive coverage for unreadable .gitmodules files, rollback recovery, stat-cache states, sibling dispatch, platform behavior, and mutation resistance.
  • Remove the corresponding resolved entries from path-guard hygiene tracking.

… and the family root's siblings.py submodule_urls, with its new test file

Checkpoint at the coordinator's word (usage window). Work in progress.

Done in this commit:
- scripts/family.py: `_gitmodules_on_disk` asks the work tree's
  `.gitmodules` with `_is_a` and `os.access`; `_gitmodules_names` and
  `_sections_giving` use it, so a file this user may not read is
  `gitmodules-unreadable` (`.gitmodules: cannot be read (<reason>)`, exit
  2), never "no section". `PinRollback` treats that code as it treats a
  store it cannot read (`READABLE_ONCE_CURED`): mount made again, update
  typed after the cure, never "only from its remote".
- templates/family-root/scripts/siblings.py: `submodule_urls` asks the
  same way and raises `gitmodules-unreadable` (`path_unreadable`); the
  placement and `--make` callers refuse with exit 2 before anything is
  cloned, fetched or run.
- tests/test_path_guard_hygiene.py: the three KNOWN_OPEN entries out.
- tests/test_family_gitmodules_unreadable.py: 33 rows. Head: 33 passed.
  Base 038dafb (3.12.3 and a 3.14-like shim): 25 failed, 8 passed (the
  8 are controls and the remove-order guard).

Not yet done: mutants, the gate, the pin measurement on the base-made
holder, pr-body.md. No test is known to fail at this commit.

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

sourcery-ai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Uses of the API

Refuse sibling placement or dispatch when the holder’s .gitmodules is unreadable, instead of treating it as missing and using unpinned URLs.

  • templates/family-root/scripts/siblings.py L358-367, L498-523, L1362-1370 (+2 small edits)

Implementation

Add a shared .gitmodules readability check and use it in the family readers and staging check, while teaching rollback to restore unreadable recorded files and continue submodule recovery after the cure.

  • scripts/family.py L7742-7759, L8299-8315, L9652-9702 (+8 small edits)

Tests

Add regression coverage for unreadable .gitmodules, rollback restoration, and sibling placement, and remove the resolved path-guard allowlist entries.

  • tests/test_family_gitmodules_unreadable.py L1-746
  • tests/test_path_guard_hygiene.py L648 (removed lines)

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-22T20:24:56Z) Independent review r1164 of #1164 at 4352ac2f, partial, stopped at the shared window's LAST STEP: NOT READY. There is one MUST. After the cure, the commands the rollback prints for the PR's own hook case fail as typed: No url found for submodule path. It fails safely, reaching no network and keeping the object store. r1164 measured a one-line candidate fix, $S/candidate-fix.diff. There are also two SHOULDs and four NITs, and 20 of 22 mutants are killed. Lane 1 runs the fix round in a later window. The parts r1164 did not cover are listed at the end.

r1164: partial review of PR #1164 (head 4352ac2fd, base 038dafba9)

I stopped at LAST STEP (20:21Z). The mutant clone is back at 4352ac2fd with nothing changed (git status --short is empty), the review checkout is clean, and no run is still going. I did not write r1164/review-r1-partial.md: my operating rules forbid report files. This message is the whole partial review, so lane 1 can save it under that name.

Verdict: NOT READY. There is one MUST. The rest of the PR stands up to measurement.

What I confirmed

  • Base: git merge-base HEAD 038dafba9 gives 038dafba9, which is the stated base.
  • New test file, head: 33 passed on 3.12.3, and 33 passed on my 3.14-like sitecustomize shim. The shim is $S/shim314/sitecustomize.py; its log shows it loaded in 7 family.py and 6 siblings.py subprocesses.
  • New test file, base: 25 failed and 8 passed, on 3.12 and on the shim alike.
    • The 8 that pass are the controls and the order guard, as the body says.
    • The failures are about behaviour: DID NOT RAISE Refusal, the exit codes 1 and 0 where 2 is expected, and PermissionError tracebacks from if not path.is_file().
    • On the shim, the real siblings row at base ended in fatal: transport 'https' not allowed, so no row reached the network.
  • Body tables: every row I measured matches the body.
  • test_path_guard_hygiene.py: 49 passed at head and 49 at base. Base's list run against head's code fails on exactly the three removed entries, each 0 found, 1 listed. No KNOWN_OPEN entry is left for family.py or siblings.py.
  • Doc trio: 170 passed at head.
  • Imports: the diff adds no import line, so the test_update_shape_kept_helper.py claim holds as far as reading the diff shows.
  • Title and closing line: the title is 249 characters. The body says Part of #1110 and has no closing keyword.
  • Other test files: every fixture the new file uses gives each test its own copy (holder, estate, placed), so no test can change another's holder.

MUST-1: after the cure, the rollback's typed commands fail in the PR's own hook scenario

Where:

  • scripts/family.py:8288-8294: with the new storeless = exc.code not in READABLE_ONCE_CURED, the rollback types git submodule update here.
  • scripts/family.py:8233-8238: that update depends on _file_by_hand. When the current .gitmodules cannot be read, it types only the index entry. The work tree keeps the hook's copy, and git rm has already taken the member's section out of that copy.

Evidence, at head:

  • My probe $S/probe/tests/test_r1164_probe.py:
    • P1 is the PR's own hook: a link into a folder at mode 000.
    • P4 is a hook that runs only chmod 000 .gitmodules.
  • Each probe gives the mode back, unsets core.hooksPath, then types each command as printed.
  • P1, on 3.12 and on the shim:
    SECTION-IN-LINKED-FILE False
    TYPED 'git update-index --add --cacheinfo 100644,…,.gitmodules' -> exit 0
    TYPED 'git -c protocol.allow=never submodule update --init --no-fetch -- members/IRRS' -> exit 128: fatal: No url found for submodule path 'members/IRRS' in .gitmodules
    TYPED 'git -C members/IRRS checkout -q main --' -> exit 128: fatal: cannot change to 'members/IRRS': No such file or directory
    
  • P4 on the shim fails the same way and leaves STATUS M .gitmodules with member-dir False.
  • Base, P4 on 3.12: the sentence said "comes back only from its remote" and typed mkdir members/IRRS.

So base made a false claim, and head types a recovery that fails as printed. It fails safely: no network is reached and the object store stays. But the Why section's "Once cured, the checkout comes back from the store git rm keeps" is not true for the case that really happens.

Fix: I measured this candidate ($S/candidate-fix.diff).

         except OSError:
-            # Named by the step that met it (#430); the index entry is still
-            # this command's to type, and the bytes are `git status`'s.
-            return typed
+            same = False
  • Result: the commands now typed are git update-index …, then git checkout -- .gitmodules, then the update, then the branch.
    • Typed after the cure, they bring the member back on main at the recorded commit, and git status is clean, in P1 and P4.
    • The 33 rows still pass.
    • test_family_py_unreadable.py and test_family_bump_remove_rollback.py give 106 passed.
  • Tests to add:
    • In test_a_rollback_meeting_a_gitmodules_linked_into_a_locked_folder, give the mode back, unset core.hooksPath, then run typed_by_hand and assert_back_on_main.
    • A row for a hook that only runs chmod 000 .gitmodules.
  • Alternative: take the claim out of the body and name it under Known limits with a follow-up issue.

SHOULD-1: two mutants survive, because no row says a .gitmodules that is not a regular file counts as none

  • Where: scripts/family.py at _gitmodules_on_disk's _is_a(path, stat.S_ISREG), and templates/family-root/scripts/siblings.py:460.
  • Evidence: mutant M10 (S_ISREG changed to _any_mode) and mutant M21 (S_ISREG changed to _anything) each ended "33 passed".
  • Fix: add a control row with .gitmodules as a directory. It should give (None, []), [] and {} at base and head alike, as is_file() always answered.

SHOULD-2: remove names a regular .gitmodules at mode 000 one of two ways, depending on git's stat cache

NITs

Mutants: 20 of 22 killed

All 22 ran on 3.12 in $S/mut, each file put back in a finally. Rows failed per mutant:

  • M1: 5
  • M2: 5
  • M3: 15
  • M4: 6
  • M5: 1
  • M6: 3
  • M7: 3
  • M8: 12
  • M9: 2
  • M10: survived
  • M11: 8
  • M12: 5
  • M13: 3
  • M14: 1
  • M15: 10
  • M16: 1
  • M17: 5
  • M18: 10
  • M19: 4
  • M20: 2
  • M21: survived
  • M22: 1

Where my mutants are the same as the writer's, the counts match the body's table. The driver and its full list are in $S/mutants.py.

Parts I did not cover

  • The writer's wider gate: the 132-file shard run, the four test_shape_doctor.py shards and test_scaffold_leg_path_collisions.py.
  • The pin claims: a base-made holder passing its own validate-family.py, and update-shape.py check naming only siblings.py.
  • Mutants on the shim. They ran on 3.12 only; the in-process rows imitate 3.14.
  • P1 at base. Only P4 was measured at base.
  • The real, non-dry run of make park.
  • The skipped rows for Windows and for root.
  • P5's ls-files -m line was lost in my grep. P5's refusal shows git did not list the file.

Files

$S is /workspace/projects/openRepoShape-worktrees/_lane1-scratch/r1164.

  • $S/probe/tests/test_r1164_probe.py: probes P1 to P5.
  • Outputs:
    • $S/probe-head-312.txt
    • $S/probe-head-shim.txt
    • $S/probe-base-p4.txt
    • $S/probe-fix-p1.txt
    • $S/probe-fix-p4.txt
    • $S/probe-fix-blast.txt
    • $S/probe-head-p35.txt
    • $S/probe-base-p3.txt
  • Runs of the new file:
    • $S/head-312.txt
    • $S/head-shim.txt
    • $S/base-312.txt
    • $S/base-shim.txt
  • Mutants and the fix:
    • $S/mutants.py
    • $S/mutants-312.txt
    • $S/candidate-fix.diff
    • $S/family-candidate.py
  • $S/shim314/sitecustomize.py: the 3.14-like shim.
  • $S/penv: the probe environment wrapper.

The scratch clones $S/base, $S/mut and $S/probe hold untracked probe files only. My review checkout /workspace/projects/openRepoShape-worktrees/l1-r1164 is unchanged.

Lane: openreposhape-1 (openRepoShape-1)

Brett Heap and others added 5 commits October 22, 2026 21:07
…it could not read before the update, so the commands typed after the cure bring the member back (r1164 MUST-1, #1110)

`_file_by_hand` returned only the index entry where the current bytes
could not be read. After a pre-commit hook made `.gitmodules` a link into
a folder at mode 000 (or the file at 000), the work tree kept the copy
`git rm` wrote, without the member's section, so the typed `git submodule
update` said "No url found". Unknown bytes are now not taken for the
recorded ones: `git checkout -- .gitmodules` is typed where the index held
them.

Tests: the link row now gives the mode back, unsets core.hooksPath, types
the commands and checks the member is back on main; a new row covers a
hook that only runs `chmod 000 .gitmodules`. Both fail at 4352ac2.

Part of #1110.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…o readers and siblings.py's submodule_urls, even where its read is refused (r1164 SHOULD-1, #1110)

Control rows: a directory at `.gitmodules` gives `(None, [])`, `[]` and
`{}`, as `is_file()` always answered, and with `os.access` refusing its
read it still does. They pass at 038dafb and at head, and kill r1164's
mutants M10 and M21 (`S_ISREG` changed to any mode), which survived.

Part of #1110.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…bject`, so `remove` names a .gitmodules at mode 000 `gitmodules-unreadable` whatever git's stat cache says (r1164 SHOULD-2, #1110)

Where `git ls-files -m` had to read the file, could not and listed it as
modified, `_stages_as` quoted the failed `git hash-object` ("a git or gh
command failed"); where git's cache spared the read, `_gitmodules_names`
gave `gitmodules-unreadable`. Both now give `gitmodules-unreadable`. A
link is still `gitmodules-unstaged`'s first. `_stages_as` takes the verb,
and the remedy says what `add` or `remove` reads the file for
(`GITMODULES_READ_FOR`).

Tests: both stat-cache states made on purpose (`core.trustctime` off, the
mtime set long ago and the index refreshed; stale: the mtime moved again),
each asserted through `git ls-files -m`, dry run and real; and an in-process
`add` row over an assume-unchanged copy it may not open.

Part of #1110.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d with its cure in the sentence, as a store it cannot read is (r1164 NIT-1, #1110)

`_undo_work_tree` appends to the refusal's detail, which the sentence
prints with no remediation: for a permission, "`chmod u+r` on it, and
`chmod u+rx` on every directory above it, lets git read it" (no "inside
the holder": a link can lead out of it); for another cause, OTHER_CURE.

Part of #1110.

Lane: openreposhape-1 (openRepoShape-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…NREAD_CODE`, so it is not read for `GITMODULES_UNREADABLE`, the remediation `_submodule_paths` gives (r1164 NIT-4, #1110)

A rename only: the value, every refusal and every sentence are as they
were. The constant's comment says which of the two is which.

Part of #1110.

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-10-23T03:07:15Z) Independent review r1164b of #1164 at 3162b523: NOT READY, for one SHOULD; no MUST. r1164's MUST and its other findings are fixed. The review stopped at LAST STEP, and the parts it did not cover are named at the end.

r1164b: independent review of PR #1164 at head 3162b523b (base 038dafba9), stopped at LAST STEP

Verdict: NOT READY, on one SHOULD. No MUST.

r1164's MUST and its other six findings are fixed, and I measured each one. Every claim in the body that I checked holds, apart from one gap: the rollback change also changes what bump and remove print for an unreadable family.yaml. The body does not say so and no row holds it (SHOULD-1). Once that is named and pinned, I see no reason to hold the PR on what I covered.

r1164's findings, re-checked at head

  • MUST-1 (typed commands failed after the cure): fixed. My probes P4 (the hook links .gitmodules into a folder at 000) and P5 (the hook runs chmod 000 .gitmodules) type git update-index …, git checkout -- .gitmodules, the update and git -C members/IRRS checkout -q main --. Each command exits 0, and the result is member-dir True at-recorded True branch 'main' status ''. That holds on 3.12 and on my shim.
  • SHOULD-1 (no directory row): fixed. The 3 directory rows pass on base and on head. My mutants A18 (S_ISREG changed to _any_mode) and B4 (S_ISREG changed to _anything) are now killed.
  • SHOULD-2 (remove named a file at 000 two ways): fixed. In P3 at head, both listed True (stale cache) and listed False (current cache) give REFUSED gitmodules-unreadable: .gitmodules: cannot be read (Permission denied), dry run and real, with the index bytes unchanged. At base the same two cases quote git hash-object --path=.gitmodules -- .gitmodules and git config -z --file .gitmodules --list.
  • NIT-1 (no cure in the rollback sentence): fixed. Row …cannot_open_gitmodules_makes_the_mount_again passes, and mutants A10 and A11 are killed.
  • NIT-2 (bootstrap.py, and the family root's validate-family.py, bootstrap.py and siblings.py: a root whose own .git this user cannot read is a PermissionError traceback on 3.12, or not-a-git-repo where exists() answers False, not refused by name #1148's head): the body now names 3a389565a. I did not re-run the merge-tree.
  • NIT-3: stays under Known limits, as before.
  • NIT-4 (constant name): fixed. The constant is now GITMODULES_UNREAD_CODE.

The body's claims I measured

  • New file at head: 40 passed on 3.12 and 40 on the shim. The shim log shows it loaded in exactly 12 family.py and 6 siblings.py subprocesses.
  • New file at base: 29 failed and 11 passed, the same 29 on 3.12 and on the shim. All 29 fail on behaviour: DID NOT RAISE Refusal, exit 0 or 1 where 2 is expected, and PermissionError or CommandFailed tracebacks. The 11 that pass are the 9 controls and the 2 order-guard rows.
  • At 4352ac2fd: 7 of 40 fail, exactly the seven the body names.
  • Hygiene: base's test_path_guard_hygiene.py run against head's code fails on exactly the three removed entries, each 0 found, 1 listed.
  • What table, every row:
    • P1: on base 3.12 each of the 6 functions raises PermissionError. On base under the shim they answer (None, []), [], None, 'no section of .gitmodules gives git members/IRRS', None and True. At head each gives gitmodules-unreadable.
    • P2: a link into a folder at 755 gives gitmodules-unstaged, exit 2, at base and at head.
    • P4: on base 3.12, exit 1 with a traceback and the member's directory gone. On base under the shim, "comes back only from its remote", and the typed commands are the index entry, then mkdir.
    • P6: on base 3.12 the siblings dry run is a traceback. On base under the shim it exits 0 and says would clone https://github.com/InkRouter/IRRS.git (family.yaml repository:); the real run gives CLONE FAILED with transport 'https' not allowed.
    • P8, no clones: on base under the shim, exit 1 with both members SKIPPED no clone, the same as the control. Head gives exit 2.
  • Rollback row the body marks "not measured": P5 on the base shim gives the same as 3.12. The body can fill that cell in.
  • Known limit about add (P11): both cache states give _submodule_paths' gitmodules-unreadable with "Mend the file by hand". This is confirmed.
  • Gate at head, re-run:
    • G1: 106 passed.
    • G2: 107 passed, 2 skipped.
    • G3: 170 passed.
    • G4: 124 passed.
    • G5: 169 passed.
    • My own extra siblings.py set (placement, inputs, bootstrap-unreadable, doctor-gitmodules): 171 passed.
  • Base: the merge-base is 038dafba9. main is one commit past it, touching only docs/release-notes/v1.2.0.md.
  • Title and closing form: the title is 249 characters. The body says "Part of family.py, the family root's siblings.py, shape-doctor.py and shape_advisory.py: a name in the root that is a link into a folder this user cannot search is still read as absent at twelve sites (follow-up of #430 slice Z) #1110", and GitHub lists no closing issue.

SHOULD-1: the rollback change also changes bump and remove for an unreadable family.yaml, unnamed and unpinned

  • Where: scripts/family.py:8256 (same = False in PinRollback._file_by_hand, line 8236). This method serves every recorded file: bump's (MANIFEST,) and remove's (GITMODULES, MANIFEST).
  • Evidence: my probes P9 (bump, with a hook that runs chmod 000 family.yaml; exit 1) and P10 (the same hook under remove). In each, the mode is given back and the typed commands are run.
    • Base: only git update-index --add --cacheinfo 100644,…,family.yaml is typed. After it runs, P9 reads family.yaml as before False; status ' M family.yaml\n' and P10 reads the same.
    • Head: git checkout -- family.yaml is typed as well, and after both run P9 reads family.yaml as before True; status ''.
    • The change is correct and an improvement. But the body's What and Why talk only of .gitmodules.
    • grep -n 'family.yaml\|MANIFEST\|bump' tests/test_family_gitmodules_unreadable.py matches only the two import lines (61 and 68), so no row holds the family.yaml case.
    • I wrote mutant A21 (base behaviour kept for family.yaml only) but did not run it before LAST STEP.
  • Fix:
    • Name the bump/remove family.yaml effect in What and Why.
    • Add a row: a hook runs chmod 000 family.yaml under bump; give the mode back, unset core.hooksPath, run typed_by_hand, and assert family.yaml holds its recorded bytes and git status --porcelain is empty.
    • Run A21 against the new file and G1 to show the row kills it.

NITs

  • NIT-1: the body's table says "not measured" for P5 on the base shim. It is measured now: exit 2, "comes back only from its remote", typed index entry then mkdir members/IRRS, the same as 3.12.
  • NIT-2: the Why bullet says the cure "follows the cause wherever the file is read". That overstates it for the holder's validator.
    • Where: templates/family-root/scripts/validate-family.py:1895-1905, _gitmodules_listed.
    • Evidence, from reading the code (not run): a permission failure there is still gitmodules-unreadable with "Mend the file by hand", as P11 measured for add.
    • Fix: name validate-family.py beside add in Known limits.

Mutants: 19 distinct, all killed (23 runs, 0 survivors)

Each mutant ran in a scratch clone, with the file restored in a finally and its blob checked equal to HEAD's after each one. Both clones' git status --short is empty.

Mutant What it changes 3.12 rows failed Shim rows failed
A1 _gitmodules_on_disk: _is_a back to is_file() 5 10
A2 _gitmodules_on_disk: no os.access 9 –
A3 _gitmodules_on_disk: except PermissionError only 2 2
A4 where="" dropped 9 –
A5 remedy always remove's 1 –
A6 _stages_as does not ask _gitmodules_on_disk 2 –
A7 _stages_as does not pass the verb on 1 –
A8 _gitmodules_names back to is_file() 9 9
A9 _sections_giving back to is_file() 6 6
A10 no cure appended in _undo_work_tree 1 –
A11 cure asks exc, not its cause 1 –
A12 mount made again for a store only 1 –
A18 S_ISREG changed to _any_mode – 2
A20 _gitmodules_on_disk asked before lstat (the order guard) – 2
A22 OSError taken as absent – 19
B1 submodule_urls: _is_a back to is_file() – 9
B3 submodule_urls: except PermissionError only – 1
B4 S_ISREG changed to _anything – 1
B13 OSError taken as no urls – 10

A dash means that mutant did not run on that Python before LAST STEP.

Not covered (LAST STEP)

State

The review checkout /workspace/projects/openRepoShape-worktrees/l1-r1164 is detached at 3162b523b with an empty git status --short. No run of mine is live. The only mutants.py process running belongs to r1189.

Everything is in /workspace/projects/openRepoShape-worktrees/_lane1-scratch/r1164b:

  • probe file: test_r1164b_probe.py
  • shim: shim314/sitecustomize.py
  • probe environment: penv
  • mutant driver: mutants.py
  • logs: logs/ (probe-*.txt, mut-p1.txt, mut-s1.txt, g1.txt to g6.txt, base-*.rows, head-*.rows, prev-312.txt)

The scratch clones base, probe and prev hold untracked probe files only.

Lane: openreposhape-1 (openRepoShape-1)

…dex's copy after the entry, under `bump` and under `remove`, so `_file_by_hand`'s change holds for the manifest too (r1164b SHOULD-1, #1110)

`PinRollback._file_by_hand` serves every recorded file, so taking bytes it
cannot read for not the recorded ones also changed what `bump` and `remove`
type for an unreadable `family.yaml`: `git checkout -- family.yaml` follows
the index entry. No row held it. A `pre-commit` hook runs `chmod 000
family.yaml` and refuses; with the mode given back and the typed commands
run, `family.yaml` holds its recorded bytes and `git status --porcelain` is
empty.

Base 038dafb: both rows fail at the bytes assertion (31 failed, 11
passed in the file) on Python 3.12.3 and on the 3.14-like shim. Head: 42
passed on both.

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

Copy link
Copy Markdown
Contributor Author

(lane openRepoShape-1, 2026-10-23T12:09:42Z) Independent re-check r1164c of #1164 at 74096eb4: provisionally READY, with two NITs. It stopped at lane 1's STOP. 12 of r1164b's 16 mutants, and the new file on the merged trees, were not run; they are named at the end.

Lane 1 applies both NITs to the body.

r1164c: independent review of PR #1164 at 74096eb47 (base 038dafba9). Stopped on lane 1's STOP; partial.

Verdict: READY on what I covered (provisional). No MUST, no SHOULD; two NITs.

r1164b's SHOULD and both NITs are fixed, and I measured each. The verdict is provisional because 12 of the 16 mutants were not run, and the new file was not run on either merged tree.

Part 1: the fix round

  • The SHOULD is fixed. The new row test_a_rollback_meeting_a_family_yaml_at_000_types_the_index_copy[bump|remove] is the only change: git diff --stat 3162b523 74096eb4 names the test file alone (48+/1-). What and Why now name the family.yaml effect.
  • New file at head: 42 passed on 3.12 and 42 passed on my shim. The shim log shows it loaded in 14 family.py and 6 siblings.py subprocesses, as the body says.
  • New file at base, head's file copied in: 31 failed and 11 passed, with the same rows on 3.12 and on the shim.
    • comm against r1164b's base-312.rows shows the 31 are r1164b's 29 plus the two new rows.
    • Both new rows fail at assert manifest.read_bytes() == recorded on both Pythons.
    • On the base shim, transport 'https' not allowed appears 3 times, so no row reached the network.
  • NIT-1 is fixed: the P5 base-shim cell is filled in.
  • NIT-2 is fixed: Known limits now names validate-family.py's _gitmodules_listed beside add, and the Why bullet is scoped. I measured it on a holder made at head:
    • .gitmodules at mode 000: rc=2, REFUSED gitmodules-unreadable … Mend the file by hand.
    • A link into a folder at 000: rc=2, the same.

Part 2

  1. Mutants: 4 distinct run, 7 runs, all killed, 0 survivors. Each file was restored and its blob checked equal to HEAD's.
    • A13, A14, A15 and A16 on 3.12: 4 rows failed each.
    • A13, A14 and A15 on the shim: 4 rows failed each.
    • Not run (stopped): A17, A19, A21, A23, B2 and B6 to B12, and the 3.12 runs of B1, B3, B4 and B13.
  2. The overlaps:
  3. The pin claims both hold.
    • A holder made by base's family.py init passes its own validate-family.py: rc=0, 10 copied shape file(s) match their digests.
    • Head's update-shape.py check --upstream <head clone> --at 74096eb4 gives upstream-changed scripts/siblings.py and unchanged for the other 9 files (upstream-changed 1 unchanged 9).
    • Extra check: after apply --yes --branch, the holder's validate-family.py gives rc=0, and its siblings.py is byte-equal to head's.
    • By AST, every name head's siblings.py imports is defined in the base holder's copies (none missing): 10 from repo_shape, 6 from bootstrap. The import set is unchanged from base to head.

NITs

Not covered (STOP)

  • The 12 unrun mutants, and B1, B3, B4 and B13 on 3.12.
  • The new file on the m1147 and m1172 merged trees.
  • G2 and the doc trio re-run at head (the new row runs git config --local --unset).

State

  • My runs are stopped. The drivers ended rc=143, and ps shows nothing of r1164c's.
  • My TERM command also hit its own shell (exit 144); no harm done.
  • The scratch clones mut and mut2 have an empty git status.
  • The review checkout /workspace/projects/openRepoShape-worktrees/l1-r1164 is at 74096eb47 with no changes.
  • Scratch folder: /workspace/projects/openRepoShape-worktrees/_lane1-scratch/r1164c.
    • Logs: logs/.
    • Driver: tools/mutants.py, r1164b's with only its scratch path changed.
    • Resolution script: tools/resolve1172.py.
    • Shim: shim314/sitecustomize.py.
    • Merge clones: m1147 (scratch merge dad0a11b) and m1172 (scratch merge 4dad5e36c). Neither was pushed.

Lane: openreposhape-1 (openRepoShape-1)

@brettheap brettheap added this to the v1.2.1 milestone Oct 23, 2026
@brettheap

Copy link
Copy Markdown
Contributor Author

(lane openRepoShape-1, 2026-10-23T17:59:46Z) #1164 is READY at 74096eb4: r1164c's unrun parts are now run, with its own drivers, and every one passed.

r1164c (issuecomment-6364558859) was a provisional READY. It stopped at lane 1's STOP with 12 of r1164b's 16 mutants unrun, the 3.12 runs of B1, B3, B4 and B13 unrun, and the new file run on neither merged tree. Lane 1 ran all of that from the main loop, with r1164c's tools/mutants.py and tools/run.sh, in its scratch clones at 74096eb4, under its probe environment:

r1164c found no MUST and no SHOULD, and both of its NITs are already applied to the body. So #1164 counts READY at 74096eb4. Its slot in the v1.2.1 order stays where lane 3 put it: after #1144, #1172 and the family.py PRs.

Lane: openreposhape-1 (openRepoShape-1)

brettheap added a commit that referenced this pull request Nov 8, 2026
…py: an `id:`, a date or a `repository:` ending in a line feed is refused by name, and a pin's `source_repository:` that is no path or `owner/repo` name is named as the pin's (#1139) (#1166)

The value patterns the issue names refuse a value that ends in a line feed, by name, as #1126 (#1017) makes `COMMIT_RE`, `SHA256_RE` and `COMMIT_40` do:
- `DATE_RE` and `QUALIFIED_RE` in `validate-manifest.py` and `validate-family.py`, `MEMBER_RE` in `scripts/family.py`, `DATE_RE` in `scripts/shape_advisory.py` and `REPOSITORY_RE` in `update-shape.py`;
- `PROJECT_ID_RE`, read with `fullmatch` where the two validators and `family.py add` read an id from a file.

A shape pin's `source_repository:` that is neither a path on this machine nor an `owner/repo` name is refused in the pin's name, not `--upstream`'s. Values without a line feed keep their outcome, and no refusal code is added or renamed. Two inputs do move from one existing code to another (see "Behaviour changed", below).

**What this PR does not cover, and the title does not claim:**
- the naming-policy patterns that `scripts/repo_shape.py` reads from `contracts/repository-naming.yaml`, which `validate-repository-naming.py` still reads with `.match`;
- `update-upstream-not-a-repo`, which still says `--upstream` when a pin names a folder that exists and is not a repository.

Both are follow-ups, with the other findings of the independent review, under "Follow-ups (not in this PR)".

This does not need #1126 and does not touch its files or its test file.

Measured on main `038dafba` (Python 3.12.3, git 2.43.0) by a probe of each tool, before any change. Each value is written in the file as a YAML double-quoted `"...\n"`, which the reader takes as the value and a line feed.

| Read from | Value | On main |
|---|---|---|
| `project.yaml` (`validate-manifest.py`) | `id: "atlas\n"` | only `FINDING manifest-topic: topic is 'xf-project-atlas', expected 'xf-project-atlas\n' derived from id 'atlas\n'`, exit 1 |
| `project.yaml` | `elected_on: "2026-09-02\n"` | `manifest ok`, exit 0 |
| `project.yaml` | a leg's `repository: "testorg/Atlas-spec\n"` | `manifest ok`, exit 0 |
| `family.yaml` (`validate-family.py`) | `id: "inkrouter\n"` | `family ok: InkRouter (inkrouter` and a line break, exit 0 |
| `family.yaml` | `created_on: "2026-09-04\n"` | `family ok`, exit 0 |
| `family.yaml` | a member's `repository: "InkRouter/IRRS\n"` | `FINDING member-repository-name: ... whose name is 'IRRS\n'`, exit 1 |
| a member's `project.yaml`, read by `family.py add` | `id: "irqs\n"` | mounted and committed, exit 0, with the row `id: "irqs\n"`; the holder's gate then said `family ok` |
| `contracts/shape-pin.yaml`, `update-shape.py check` with no `--upstream` | `source_repository: "opensoft/openRepoShape\n"` | `REFUSED unsafe-value: --upstream is 'opensoft/openRepoShape\n'`, exit 2 |
| the same | `source_repository: "opensoft/open Repo"` | `REFUSED update-upstream-unresolvable: --upstream 'opensoft/open Repo' is neither ...`, exit 2 |
| the same | `source_repository: "-opensoft/openRepoShape"` | `REFUSED unsafe-value: --upstream is '-opensoft/openRepoShape'`, exit 2 |
| an adoption plan (`adopt-project.py check`) | `id: "northwind\n"` | `FINDING plan-manifest-invalid: id is 'northwind\n', which the project's own validate-manifest.py refuses: manifest-topic: ...`, exit 1; `execute` refused it, exit 2, before any leg |

In-process on the same main: `repo_shape.PROJECT_ID_RE.match('atlas\n')`, `shape_advisory.DATE_RE.match('2026-09-02\n')` and `REPOSITORY_RE.match('a/b\n')` each matched, and `date.fromisoformat('2026-09-02\n')` raised `ValueError`.

- **`DATE_RE` and `QUALIFIED_RE`** in `templates/assembly-root/scripts/validate-manifest.py` and `templates/family-root/scripts/validate-family.py` end in `\Z`. So do `MEMBER_RE` in `scripts/family.py` (the third spelling `tests/test_family_member_name.py` holds equal to the two `QUALIFIED_RE`), `DATE_RE` in `scripts/shape_advisory.py` and `REPOSITORY_RE` in `update-shape.py`.
- **`PROJECT_ID_RE` keeps its `$`.** Every id refusal prints its text (`must match ^[a-z0-9][a-z0-9-]*$`, pinned in six test files), the validators run against each project's own copy of `repo_shape.py`, and its definition sits inside #1126's hunk. The three callers that read an id from a file ask it with `fullmatch` instead: `validate-manifest.py` (`manifest-id`), `validate-family.py` (`family-id`) and `family.py`'s reading of a member's `project.yaml` (`member-bad-id`, which `add` now says before anything is mounted).
- **`update-shape.py`.** `open_upstream(spec, pin_path=None)` takes the pin the value was read from, which `prepare` passes when no `--upstream` was given. Then `update-upstream-unresolvable` says ``<root>/contracts/shape-pin.yaml: `source_repository:` is '...', which is neither a path on this machine nor an `owner/repo` name``, with a remedy to write the pin's field or pass `--upstream`, and `checked_value` names the same field. **Code kept:** `update-upstream-unresolvable`, the existing code for a value that is not an `owner/repo` name. A line feed now reaches it, since the pattern no longer takes one. Before, `checked_value` refused it as `unsafe-value`.
- **One existing test line:** `tests/test_family_init_values.py` finds validate-family's `DATE_RE` line by its text, which now ends `\Z`.
- **One existing stand-in:** the `temporaries` fixture in `tests/test_update_shape_unreadable.py` stands in for `open_upstream` with `def opening(spec)`, which the new two-argument call refused with `TypeError: ... takes 1 positional argument but 2 were given`. It now takes `pin_path=None` and hands it on to the real `open_upstream`, so `test_a_read_refused_in_prepare_closes_the_upstream[check|apply]` asks what it asked before.
- **The rows** are in a new file of their own, `tests/test_value_pattern_line_break.py`.
- **A second guard, in a second commit (`5102b4294`, a test only, no production file).** The first guard holds the four pattern names this PR ends in `\Z`, and nothing held `PROJECT_ID_RE`, which keeps its `$`. `test_every_reader_of_the_id_pattern_is_in_the_table` reads every tracked `.py` outside `tests/` with `ast` (it runs none) and holds each call of a method of `PROJECT_ID_RE` (`PROJECT_ID_RE.x(...)` or `repo_shape.PROJECT_ID_RE.x(...)`) to the table `ID_READERS`:
  - the three `fullmatch` readers of an id from a file (`validate-manifest.py`, `validate-family.py`, `scripts/family.py`);
  - the modules that still `match` it, each with its reason: argv `--id` in `scaffold-project.py` and `scripts/family.py`, where `checked_value` refuses a line feed after the pattern; argv `--id` in `adopt-project.py`, which the project's own `validate-manifest.py` refuses (`adopt-manifest-invalid`, below; `ID_READERS` still gives it the `checked_value` reason); and `adopt-project.py`'s two `plan-bad-id` readers, of the plan's `id:` and of the id derived from `legs.assembly`, which a line feed never passes (below).

  A new reader of `PROJECT_ID_RE`, `fullmatch` included, fails it by file and method until it is listed in `ID_READERS` with its reason. The table is exact both ways, so a reader taken away fails it too.

**Left as they are, and why:**
- the argv readers of `PROJECT_ID_RE` (`--id` in `scaffold-project.py`, `family.py init` and `adopt-project.py`). The first two hold the id to `checked_value` after the pattern, which refuses a line feed as `unsafe-value` naming `--id`, and `tests/test_derived_id_refusals.py` pins that answer for them. `adopt-project.py` never calls `checked_value` on `--id`: `plan` with `--id` set to `northwind` and a line feed exits 2 with `adopt-manifest-invalid`, in the words of the project's own `validate-manifest.py` (`manifest-id`), and writes no plan (lane 5's re-check, issuecomment-6371408915, NIT 2; measured on `plan` only);
- `adopt-project.py`'s reading of a plan's `id:`: `check` and `execute` hold it to the project's own `validate-manifest.py`, which refused it on main (above) and now names it in `manifest-id`'s words. It is the same value, refused under the same code, `plan-manifest-invalid`, before any leg exists. The id derived from `legs.assembly` is read with `.match` too, and a line feed in `legs.assembly` is `unsafe-value` before that id is asked (the review measured both, on main and here alike). This keeps the open PRs on `adopt-project.py` (24 at 12:02Z) clear;
- `PIN_ARG_RE`, and `NAME_RE`/`REF_RE`/`PATH_RE` in `setup-project.py`, as the issue says;
- `update-upstream-not-a-repo` still says `--upstream`. A pin's value reaches it only when it names a path that exists, not through the pattern.

**Behaviour changed, stated plainly, and what the issue's Verify means by "No refusal code changes":** the issue's Verify line reads as no code added or renamed, and none is. Two inputs do move from one existing code to another, exit 2 both before and after:
- `update-shape.py --upstream "opensoft/openRepoShape<LF>"` was `unsafe-value` and is now `update-upstream-unresolvable`, still naming `--upstream`;
- a pin's `source_repository:` that ends in a line feed, with no `--upstream`, was `unsafe-value` naming `--upstream` and is now `update-upstream-unresolvable` naming the pin's field.

No test pinned either old answer: every gate below passed. `family.py add --member` is stripped before `MEMBER_RE`, so `add` answers as before.

**Not changed, seen while measuring:** with `--upstream` passed, `update-shape.py` does not read the pin's `source_repository:` through `REPOSITORY_RE` at all, and it keeps the value as the upstream's repository name. `validate-family.py` does not hold a member row's `id:` to `PROJECT_ID_RE`; it compares the row with the member's manifest. Neither is a `$` question. Both are under "Follow-ups (not in this PR)".

All in `tests/test_value_pattern_line_break.py`, run against main's production code: the five production files swapped in place from `origin/main` (`961640c68`), then put back with their sha256 matching (`dirty=5` in the run's START line is those five files). On the head `5102b4294` (30 rows) the result is **20 failed, 10 passed in 23.12s, git 2.43.0**. The 10 that pass are baselines: the seven `test_a_pattern_takes_its_value` rows, the spelling-table guard and the two double-quoted-without-a-line-feed rows.

The first 19 are the first commit's rows (19 failed, 10 passed in 22.12s on its 29 rows at `038dafba`). The independent review reproduced them from main's bytes of the same five files (19 failed, 10 passed in 26.78s, the same 19 ids). The 20th, `test_every_reader_of_the_id_pattern_is_in_the_table`, is the second commit's: it fails on main because the three readers of an id from a file are `.match` there, not `.fullmatch`.

- `test_a_pattern_refuses_its_value_and_a_line_feed[manifest-DATE_RE]`
- `test_a_pattern_refuses_its_value_and_a_line_feed[manifest-QUALIFIED_RE]`
- `test_a_pattern_refuses_its_value_and_a_line_feed[family-DATE_RE]`
- `test_a_pattern_refuses_its_value_and_a_line_feed[family-QUALIFIED_RE]`
- `test_a_pattern_refuses_its_value_and_a_line_feed[family.py-MEMBER_RE]`
- `test_a_pattern_refuses_its_value_and_a_line_feed[shape_advisory-DATE_RE]`
- `test_a_pattern_refuses_its_value_and_a_line_feed[update-shape-REPOSITORY_RE]`
- `test_a_manifest_value_that_ends_in_a_line_break_is_a_finding[id]`
- `test_a_manifest_value_that_ends_in_a_line_break_is_a_finding[elected_on]`
- `test_a_manifest_value_that_ends_in_a_line_break_is_a_finding[leg-repository]`
- `test_adopt_check_names_a_plan_id_that_ends_in_a_line_break_as_an_id`
- `test_a_family_value_that_ends_in_a_line_break_is_a_finding[id]`
- `test_a_family_value_that_ends_in_a_line_break_is_a_finding[created_on]`
- `test_a_family_value_that_ends_in_a_line_break_is_a_finding[member-repository]`
- `test_add_refuses_a_member_whose_id_ends_in_a_line_break`
- `test_a_pins_source_that_is_no_owner_repo_is_named_as_the_pins[line-feed]`
- `test_a_pins_source_that_is_no_owner_repo_is_named_as_the_pins[space]`
- `test_a_pins_source_checked_value_refuses_is_named_as_the_pins`
- `test_an_upstream_passed_with_a_line_feed_is_named_as_passed`
- `test_every_reader_of_the_id_pattern_is_in_the_table`

**13 of 13 killed.** Each mutant was applied alone to one file of the branch's production bytes (the same bytes as the first commit and as the head, which adds a test only), the rows were run, and the file was put back with its sha256 checked (`restored=yes` for all 13). Each run is `tests/test_value_pattern_line_break.py` plus `tests/test_family_member_name.py::test_every_spelling_of_the_member_name_rule_is_the_same_pattern`, git 2.43.0.

| Mutant | File | Killed by |
|---|---|---|
| M1 `DATE_RE` back to `$` | `validate-manifest.py` | 2: `test_a_pattern_refuses_its_value_and_a_line_feed[manifest-DATE_RE]`, `test_a_manifest_value_that_ends_in_a_line_break_is_a_finding[elected_on]` |
| M2 `QUALIFIED_RE` back to `$` | `validate-manifest.py` | 3: `...[manifest-QUALIFIED_RE]`, `...[leg-repository]`, `test_every_spelling_of_the_member_name_rule_is_the_same_pattern` |
| M3 the id read with `.match` | `validate-manifest.py` | 2: `test_a_manifest_value_that_ends_in_a_line_break_is_a_finding[id]`, `test_adopt_check_names_a_plan_id_that_ends_in_a_line_break_as_an_id` |
| M4 `DATE_RE` back to `$` | `validate-family.py` | 2: `...[family-DATE_RE]`, `test_a_family_value_that_ends_in_a_line_break_is_a_finding[created_on]` |
| M5 `QUALIFIED_RE` back to `$` | `validate-family.py` | 3: `...[family-QUALIFIED_RE]`, `...[member-repository]`, `test_every_spelling_of_the_member_name_rule_is_the_same_pattern` |
| M6 the id read with `.match` | `validate-family.py` | 1: `test_a_family_value_that_ends_in_a_line_break_is_a_finding[id]` |
| M7 `MEMBER_RE` back to `$` | `scripts/family.py` | 2: `...[family.py-MEMBER_RE]`, `test_every_spelling_of_the_member_name_rule_is_the_same_pattern` |
| M8 a member's id read with `.match` | `scripts/family.py` | 1: `test_add_refuses_a_member_whose_id_ends_in_a_line_break` |
| M9 `DATE_RE` back to `$` | `scripts/shape_advisory.py` | 1: `...[shape_advisory-DATE_RE]` (its pattern row alone: `date.fromisoformat` refuses the line feed after the pattern, so no tool row sees it) |
| M10 `REPOSITORY_RE` back to `$` | `update-shape.py` | 3: `...[update-shape-REPOSITORY_RE]`, `test_a_pins_source_that_is_no_owner_repo_is_named_as_the_pins[line-feed]`, `test_an_upstream_passed_with_a_line_feed_is_named_as_passed` |
| M11 `prepare` passes no pin | `update-shape.py` | 3: `test_a_pins_source_that_is_no_owner_repo_is_named_as_the_pins[line-feed]` and `[space]`, `test_a_pins_source_checked_value_refuses_is_named_as_the_pins` |
| M12 `checked_value` names `--upstream` again | `update-shape.py` | 1: `test_a_pins_source_checked_value_refuses_is_named_as_the_pins` |
| M13 the pin's refusal sentence removed | `update-shape.py` | 2: `test_a_pins_source_that_is_no_owner_repo_is_named_as_the_pins[line-feed]` and `[space]` |

No mutant is added for the stand-in in `tests/test_update_shape_unreadable.py`: it is a test change.

The independent review re-ran M3, M8, M11 and M12, and one mutant of its own (X1: `prepare` names the pin even when `--upstream` is passed). All five were killed, and each file was put back with its sha256 checked. The other nine of the 13 are this writer's runs alone.

**The second commit's guard: 6 of 6 probes caught.** Each was applied alone to one tracked file at `5102b4294`, `test_every_reader_of_the_id_pattern_is_in_the_table` was run, and the file was put back with its sha256 checked (`restored=yes` for all six). The first commit's guard, `test_every_spelling_of_a_value_pattern_is_in_the_table`, was run with each plant too: it passes every one of them, which is the gap the second guard closes.

| Probe | File | The new guard | The first guard |
|---|---|---|---|
| P1 a new `PROJECT_ID_RE.match(value)` reader appended | `update-shape.py` | failed: `('update-shape.py', 'match'): 1` is more than the table holds | passed |
| P2 a new `repo_shape.PROJECT_ID_RE.search(value)` reader appended | `scripts/shape_advisory.py` | failed | passed |
| P3 `fullmatch` back to `match` | `templates/assembly-root/scripts/validate-manifest.py` | failed | passed |
| P4 `fullmatch` back to `match` | `templates/family-root/scripts/validate-family.py` | failed | passed |
| P5 `fullmatch` back to `match` | `scripts/family.py` | failed | passed |
| P6 main's bytes of those three files together (the 20th row above) | the three | failed | not run |

**The second commit `5102b4294` (dirty=0)**, Python 3.12.3, with the same stub `gh`, bogus token and no global git config:

| Run | Git | Result |
|---|---|---|
| `tests/test_value_pattern_line_break.py` | 2.43.0 | **30 passed** in 23.00s |
| `tests/test_value_pattern_line_break.py` | 2.47.1 | **30 passed** in 23.30s |
| `tests/test_pinned_copy_text.py`, `tests/test_path_guard_hygiene.py`, `tests/test_repo_hygiene.py`, `tests/test_agents_md_codes.py`, `tests/test_cli_reference.py` | 2.43.0 | **306 passed** in 61.54s |

That commit changes only the test file (62 lines added, no assert that joins conditions with `and` or `or`, ASCII), so the first commit's runs below are not repeated: they hold the production files and every other test file, and those are unchanged. CI on `5102b4294`, and an independent look at the second commit, were not done when this was written.

**The independent review of the first commit** (rv1166c, READY, read-only) reports these gates on `2593952c9`, all passing: the stand-in gate's 6 files (298 passed), the new file on 2.47.1 (29 passed), the five hygiene files (306 passed), 15 more test files that name a changed function, pattern or code (1611 passed, 19 skipped) and `tests/test_shape_doctor.py` (445 passed, 3 skipped). It also read CI on that head at about 20:04Z: `tests` (the full suite on 3.14), `tests-git-bash`, `package` and SonarCloud all passed.

**The first commit's gates ran on `2593952c` (dirty=0)**, Python 3.12.3, with the real `gh` unreachable (a stub first on `PATH`, a bogus token) and no global git config:

| Run | Git | Result |
|---|---|---|
| the files that held every failure and setup error of the shards below: `tests/test_family.py`, `tests/test_update_shape_pr_base.py`, `tests/test_update_shape_unreadable.py`, `tests/test_update_shape_header_comments.py`, `tests/test_update_shape_messages.py` and the new `tests/test_value_pattern_line_break.py` | 2.43.0 | **298 passed** in 343.60s |
| `tests/test_value_pattern_line_break.py` | 2.47.1 | **29 passed** in 21.31s |
| `tests/test_pinned_copy_text.py`, `tests/test_path_guard_hygiene.py`, `tests/test_repo_hygiene.py`, `tests/test_agents_md_codes.py`, `tests/test_cli_reference.py` | 2.43.0 | **306 passed** in 69.12s |

**The two shards, on the uncommitted tree** holding the same production bytes as the first commit (the 7 files' sha256 checked before and after), git 2.43.0: the validators' test files, the `REPOSITORY_RE`/`source_repository` files and the `update-shape.py`, `shape_advisory.py` and `family.py` files, 125 in all.

- shard 1 (62 files): 4 failed, 5290 passed, 13 skipped in 56 min;
- shard 2 (63 files): 3 failed, 4 setup errors, 3761 passed, 29 skipped in 50 min.

Every failure and setup error is in the five existing files of the first row of the table above, which all pass on the first commit:
- 2 were real: `test_a_read_refused_in_prepare_closes_the_upstream[check|apply]`, the `opening(spec)` stand-in under the two-argument call. The stand-in is fixed in the first commit.
- The other 5 failures and the 4 setup errors were `update-conflict` on `scripts/validate-family.py` ("not a verbatim copy ... at the pinned commit"). This is an artifact of an uncommitted tree: `tests/test_family.py`'s `upstream_clone` commits the working tree into its clone, while `family.py init` pins the holder at the real `HEAD`, so an uncommitted `templates/family-root/` file is never verbatim at its pin. On the first commit they pass.

Every other file of the two shards passed on these production bytes, so the shards were not re-run.

`git merge-tree --write-tree <other> 5102b42` (git 2.43.0) at 2026-10-23T12:08Z, after re-fetching main (still `961640c6`; read again at 12:10Z, just before the push) and re-listing the open PRs at 12:02Z (55 open). Main has moved from the `038dafba` that this body measured to `961640c6` by one file, `docs/release-notes/v1.2.0.md`. Each open PR that touches one of this PR's 8 paths, at its current head, plus #1126:

| Against | Head | Shares | Result |
|---|---|---|---|
| origin/main | `961640c6` | | clean, tree `4613729516ff` |
| #1098 | `dad7961a` | `scripts/family.py` | clean, tree `4d1ff9517588` |
| #1117 | `10dc011c` | `scripts/family.py` | `scripts/family.py` merges clean; conflict in `docs/handbook.html` only, which this PR does not touch (see below) |
| #1124 | `8dfa32bd` | `validate-family.py` | clean, tree `cb2ec1073646` |
| #1126 | `4c1f80cf` | none (its `scripts/repo_shape.py` and tests) | clean, tree `e82c8945ac37` |
| #1133 | `a7bfee1b` | `update-shape.py` | clean, tree `a710870d1ffc` |
| #1144 | `89486f69` | `scripts/shape_advisory.py` | clean, tree `2d3e3e1ef43d` |
| #1147 | `b75babee` | `validate-manifest.py` | clean, tree `a82ac3b47a3f` |
| #1159 | `66e68f94` | `scripts/shape_advisory.py` | clean, tree `4abeb7b38665` |
| #1164 | `74096eb4` | `scripts/family.py` | clean, tree `ee285e1cb8cf` |
| #1172 | `5aa0f116` | `validate-family.py` | clean, tree `aa32d41e6e2c` |
| #1187 | `cc8a87ee` | `update-shape.py`, `tests/test_update_shape_unreadable.py` | clean, tree `25711eb1cac4` |
| #1201 | `eac177af` | `scripts/family.py` | `scripts/family.py` merges clean; conflict in `docs/handbook.html` only (see below) |

- #1117 and #1201 conflict in `docs/handbook.html` alone. #1201 is stacked on #1117 (their merge-base is #1117's head `10dc011c`). Each of them against origin/main alone gives the same conflict in the same file, so it is theirs: #1117's, from its older base `6da757cb`, which #1201 inherits.
- #1187 and #1201 are new since the first merge-trees. #1187 shares `tests/test_update_shape_unreadable.py` with this PR; its diff adds or removes no line that names `open_upstream`, `def opening` or `REPOSITORY_RE`, so it brings no one-argument stand-in for the two-argument call. That was read for all 55 open heads at 12:12Z; only this PR's own lines name them.
- No other open PR adds or removes a call of a method of `PROJECT_ID_RE`, which the second guard counts: the lines each of the 55 open heads adds or removes outside `tests/`, `docs/` and `*.md` were read at 12:04Z. Only this PR's own name it, and #1201's one new `MEMBER_RE.fullmatch` is another pattern. So a sibling landing first does not move the guard's table.

Each is a candidate for its own issue. They come from the independent review (rv1166c, READY at `2593952c9`, issuecomment-6352173084), which measured each of them on main and at the head unless the item says it did not. The review's finding numbers are in brackets.

- **The naming-policy patterns [1].** `scripts/repo_shape.py` reads the families, the roles and the topic pattern of `contracts/repository-naming.yaml` with `.match` (`family["_re"].match(name)`, `family["_split_re"].match(name)`, `role["_re"].match(name)`, and `topic_pattern`, which defaults to `^xf-project-[a-z0-9-]+$`). `validate-repository-naming.py --project project.yaml` runs in the root template's `Makefile` and `validate.yml`. At the head, and on main, it exits 0 on a leg `repository: "testorg/Atlas\n"` and prints the line feed inside its table; `-spec` and `-code` the same. The project's gate as a whole still fails, because `validate-manifest.py` now refuses that manifest.
- **`update-upstream-not-a-repo` with a pin [3].** With no `--upstream`, a pin whose `source_repository:` names a folder that exists and is no repository (the review measured `contracts` and `scripts/repo_shape.py`) is `REFUSED update-upstream-not-a-repo: --upstream contracts exists but is not a git repository`, exit 2, on main and here. `pin_path` is in scope at `update-shape.py:686-687`, so that refusal can name the pin as `update-upstream-unresolvable` now does.
- **A pin's line feed when `--upstream` is passed [9].** `update-shape.py check --upstream <clone>` over a pin whose `source_repository:` ends in a line feed exits 0, `nothing to do`. The value is kept as `upstream.repository`, which reaches the README shape line's check, `apply`'s commit subject and the pull request words (`update-shape.py:2525`, `3017` and `5121`). The review measured `check`, not `apply`. It belongs with the previous item.
- **A member row's `id:` [4].** On main, `add` of a member whose `project.yaml` reads `id: "irqs\n"` commits the row `id: "irqs\n"`, and the holder's `validate-family.py` then says `family ok`. Under mutant M8 (this branch with main's `.match` in `add`) the same row is written, and the gate still says `family ok`. By code reading, not measured end to end: `validate-family.py` compares a row's id with the member manifest's by `str` equality (`member-id-mismatch`, `validate-family.py:1608`), and `_check_member_ids_unique` does the same, so neither asks `PROJECT_ID_RE` of a row. This PR makes `add` refuse such a member, so no new holder gets such a row.
- **Values that no pattern reads [8].** The review's sweep found these `manifest ok` or `family ok`, exit 0, with a trailing line feed, at the head and on main alike:
  - in `project.yaml`: `name`, a spec or code leg's `path`, `shape.repository` and `shape.digests.digest_algorithm`;
  - in `family.yaml`: `org`, the family's own `repository`, `tracking_branch`, and the shape's and each member pin's `digest_algorithm`.

  No `^...$` pattern reads them, so they are not this PR's. A leg's `path` is checked only by `_leg_path_findings`, which asks no pattern, and the family's `tracking_branch` is refused in `project.yaml` (`manifest-tracking-branch`, U+000A) but not in `family.yaml`. `shape.commit` and `tree_sha256` with a line feed are also `manifest ok`; that is #1126's.

The first commit's message says "the three readers of an id from a file ask it with `fullmatch` (`manifest-id`, `family-id`, `member-bad-id`)". That is true of those three, but it reads as if there were no others [2]. What the review measured instead:
- `adopt-project.py` still reads the id derived from `legs.assembly` (`:6780`) and the plan's `id:` (`:6791`), both `plan-bad-id`, with `.match`;
- neither lets a line feed through. A plan `id: "northwind\n"` is `plan-manifest-invalid`, now in `manifest-id`'s words. A plan with no `id:` and `legs.assembly: "NorthWind\n"` is `REFUSED unsafe-value: legs.assembly is 'NorthWind\n'`, exit 2, before the derived id is asked, on main and here alike.

So it is the wording alone that overstates. The second commit's `ID_READERS` lists both readers with that reason.

The title's pin clause is the narrower one (the pin's name only where the value is no path and no `owner/repo` name), and two inputs change from `unsafe-value` to `update-upstream-unresolvable` (see "Behaviour changed", above).

Review: rv1166 and rv1166c, lane 5's independent opus reviewers, at `2593952c` (issuecomment-6352173084); then rc1166b, lane 5's independent sonnet re-checker, which wrote none of #1166: READY at `5102b429`, H0 of this landing (issuecomment-6371408915), with no MUST or SHOULD; its NITs 1 and 2 are corrected in the body. CI (Brett Heap's ruling 27 and his fast-refresh ruling of 2026-10-15T22:48:35Z): H0 5102b42 passed tests, tests-git-bash and SonarCloud; the head 5c8afef is a clean update-branch merge of main 93d2931, with tests-git-bash and SonarCloud green; and the local gate passed on its predicted squash tree 3c89065 over main 11560eb: the family_init_values, update_shape_unreadable, value_pattern_line_break, repo_hygiene, agents_md_codes, cli_reference sets, 365 passed, 19 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 #1139

Lane: openreposhape-5 (openRepoShape-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Nov 9, 2026
…ose `.git` this user cannot read is refused `git-repo-unreadable`, exit 2, not a traceback or `not-a-git-repo`, and the doctor's `members` row names it once, never drift (#1148) (#1172)

The root's own `.git` is read by `find_repo_root` in four pinned tools: the assembly root's `scripts/bootstrap.py`, and the family holder's `validate-family.py`, `bootstrap.py` and `siblings.py`. When this user cannot read that `.git`, as a link into a folder at mode 000 or a `.git` directory at mode 000, they answered with a `PermissionError` traceback (3.12), or `not-a-git-repo` (from 3.14, where `is_file` and `exists` answer False to any `OSError`), or git's own answer about something else: `no gitlink recorded`, `gitlinks-unreadable` over `not a git repository`, or `FETCH INCOMPLETE` with the advice to set a credential. The doctor's `members` row over such a holder said `INVALID (family)` over a `crashed ... PermissionError`, or `DRIFTED (a member is not at its pin)`.

- Each pinned copy carries its own `_refuse_an_unreadable_root(start)`, which its loader calls right before `find_repo_root(start)`. It asks each `.git` that `find_repo_root` would ask, in the same order, with the file's own `_is_a`. A `.git` that answers absent is passed over, and the walk stops at the first `.git` that is there, so a `.git` above the root is never asked. A pinned copy may not rely on a newer `repo_shape.py` (#370, #610), which is why #1146 put the walk in each validator and why it is in each copy here.
- The refusal is `git-repo-unreadable`, exit 2, the code `validate-pins.py` and `validate-manifest.py` give the same root (#1146): `.git: cannot be read (Permission denied)` and the `chmod` cure, in each tool's own words. `siblings.py` keeps its "(and on every directory above it)" without "inside the root", since its clones sit outside the holder.
- The two bootstraps and `validate-family.py`, which read the root's repository through git, also ask what `validate-pins.py` asks of the first `.git` that is there: a gitfile they cannot open, and a git directory whose `HEAD` they cannot reach. `siblings.py` asks the `stat` alone, as `validate-manifest.py` does, so a `.git` directory at 000 still lets it place every member.
- The doctor's `check_members` calls `root_git_read(ctx.root)` after its empty-members return and gives one FINDING in the `members` row, with the gate's line once, NEXT this doctor again and WHY the cure for the cause. Each member's entry carries every key a member's entry has, null, plus `gitlink_cannot_be_read`, so a `--json` reader gets no `KeyError`. `drifted_reasons` counts no entry that carries it, and still counts a member beside it that it could read and is off its pin.
- `tests/test_pinned_root_git_unreadable.py` holds 76 rows. The `gate()` fixture in `tests/test_validate_family_unreadable.py` now gives the holder as the whole root. The gate had found 6 of that file's 53 rows failing at `05e6ab0f`, where base passes all 53: the new check met the holder's refused `.git` that `refused_stat(monkeypatch, ".git")` also refuses, and named it by its own name. The tool was right and the stub was stale, and no assertion changed.
- Measured in a scaffold's recursive clone and a family holder, on Python 3.12.3 and a 3.14-like `sitecustomize`, base `b75babee` against head, with each tool run from the root as `make` runs it (git 2.43). Was stacked on #1147, which landed as its squash `51a9c5f1`: `b75babee` was #1147's head then, and these numbers were measured against it and not measured again after the restack.
  - Over a `.git` linked into a folder at 000, all four tools went from a traceback (3.12) or `not-a-git-repo` (shim) to `REFUSED git-repo-unreadable`, exit 2, with no traceback and nothing on stdout, on both Pythons.
  - Over a `.git` directory at 000, the assembly bootstrap went from "no gitlink recorded; leaving as is" and a refusal by `pins`, `validate-family.py` from `gitlinks-unreadable` over git's `not a git repository`, and the family bootstrap from `FETCH INCOMPLETE (git exit 128)`, exit 1, or from `family bootstrap ok` over a run that read nothing under `--no-fetch --skip-members`, to the same `git-repo-unreadable` refusal. `siblings.py` is unchanged there, by design: it places every member, exit 0.
  - The doctor over a holder whose `.git` is a link went from `INVALID (family)` with a crashed `family` row (3.12), or `DRIFTED (a member is not at its pin)` with `members` at `checked out at ?` (shim), to `INVALID (family)` on both. Its `members` row names `.git: cannot be read (Permission denied)` once, with the cure, and the `family` row shows the holder's `validate-family.py` refusing `git-repo-unreadable`. A readable holder is `COMPLIANT`.
  - The new file at base fails 74 rows and passes 2, on 3.12.3 and on the shim alike. The 2 are controls. Of the 74, 38 fail on base's own answers and 36 only on the name `_refuse_an_unreadable_root`. At head all 76 pass on both.
  - Mutants: 58 of 58 killed, the 55 first run and the 3 review r1 added, each in a scratch clone of the head with the file put back in a `finally`.
  - Against a standard one commit past the pin, `update-shape.py check` names `scripts/bootstrap.py` alone as `upstream-changed` for a project (10 unchanged), and `scripts/validate-family.py`, `scripts/bootstrap.py` and `scripts/siblings.py` for a holder (7 unchanged). No digest of these files is recorded in the tree, so there is no pin-record edit, as in #1147.
- Lane 1's ruling: the family bootstrap's new refusal under `--no-fetch --skip-members` over a `.git` directory at 000 is accepted. Base said `family bootstrap ok` there, over a run that read nothing.
- Known limits:
  - #1164 (`fix/1110-family-unsearchable-gitmodules`) also changes `templates/family-root/scripts/siblings.py`. Lane 1's merge-tree shows a content conflict in the docstring's exit-2 paragraph and in `member_unreadable`, still there at `ba81fd7d` against #1164's head `74096eb4`. Whichever lands second keeps one form of each. #1164 has not landed, so this PR lands first.
  - The `chmod` cure says "every directory above it". In the issue's case the line names `.git`, a link, and the folder to mend is the one it leads into, so `chmod u+rx .git` follows the link and is refused. These are each tool's existing words.
  - `siblings.py` over a `.git` directory at 000 still places every member, by design. `validate-family.py` and `make bootstrap` refuse that holder.
  - A `.git` this user can search whose `HEAD` is at mode 000 is not asked by this PR's four tools, since the question is the `stat` of `HEAD` and a searchable directory answers it. Base and head give the same answers, each about something else, so this PR leaves that case as it was. That holds whether or not #1239 lands. Only what #968 asks of a leg is asked, so a git directory whose index cannot be read is still git's answer.
    - #1239 (lane 3's, for #1222) changes the assembly root's answer there, and this PR does not. It is not on main at `51a9c5f1`. It makes `validate-pins.py`'s `_refuse_an_unreadable_git_dir` open a git directory's `HEAD`, and `_refuse_an_unreadable_root` in that file calls it for the root's own `.git`. Once #1239 lands, the pins validator opens the root's `HEAD` first, so the assembly bootstrap's `pin-gitlink-absent` answer there becomes a `git-repo-unreadable` refusal by name (lane 5's note, #473 issuecomment-6724142443, read from the code, not run). #1239 changes only `validate-pins.py` and its tests. The family gate, `validate-family.py`, and the holder's `bootstrap.py` and `siblings.py` carry their own walk, so for the family holder the sentence above holds either way.
  - Not in this PR: `scripts/repo_shape.py`'s `find_repo_root`, and #1110 slice B (siblings' `submodule_urls`). The doctor's `members` row for an unread holder `.git` has `without_working_clone: []` beside entries whose `working_clone` is null, which tells a `--json` reader no member lacks a working clone about a question the row did not ask (r1172's NIT 3).

Review: lane 1's independent reviewers reviewed each round. r1172 reviewed `3a389565`, stopped at the shared window's STOP, and found it NOT READY as far as it got, for one SHOULD and no MUST (#1172 issuecomment-6351621763). The SHOULD was that no row held the line that stops the walk at a gitfile naming no directory, in three tools. r1172b found `5aa0f116` READY, with no MUST or SHOULD and two NITs, neither blocking (issuecomment-6360478153). The new row kills the three mutants that survived, 3 of 3. NIT-B, two stale phrases in the body's Tests section, is applied to the body. NIT-A, a contrived `pass` mutant of that line that the row does not kill, is not applied at this head. Lane 1 then checked the merge of #1147's then-head `a2fc1da8`, which is `2eabec8e` (issuecomment-6722268492): it had no conflict, it added to the 7 files exactly the lines `a2fc1da8` brought and kept exactly the lines this PR added (+902/-26), and the `members` row agrees with #1200's per-member line, since the root's line returns first. r1172b's READY is about this PR's own lines, which that merge left unchanged. After #1147 landed as `51a9c5f1`, the branch was restacked onto main by 2 merges (`81bc91f8` and `ba81fd7d`). There was no third, because main still equalled the squash. Its changed lines equal the reviewed delta, 928 `+`/`-` lines with sha256 `9eef7395` (issuecomment-6725567957), and the READY stands. Lane 1's first landing HOLD (2026-11-08T20:14:13Z) refreshed the branch with update-branch's clean merge of main `40cb8086`, `bbe5b414`, whose tree `84ebd14f` is the one lane 1's gate passed before that HOLD (`p1172-40cb808`, 0 failed). #1245 then merged into main under that HOLD, so lane 1 withdrew it (20:18:55Z), and `bbe5b414` became H0 once its `tests` passed.

Tests, under a stub `gh` with a bogus token, on Python 3.12.3 and git 2.43.0: lane 1's gate at the restacked head `ba81fd7d` gave 129 passed for `tests/test_pinned_root_git_unreadable.py` and `tests/test_validate_family_unreadable.py`, 171 passed for `tests/test_root_git_unreadable.py`, `tests/test_doctor_unreadable_paths.py` and `tests/test_doctor_unreadable_pin.py`, 283 passed and 2 skipped for `tests/test_scaffold_leg_path_collisions.py`, `tests/test_path_guard_hygiene.py` and `tests/test_no_auto_maintenance.py` (the 2 skips are `tests/test_no_auto_maintenance.py:222`, where the session began with `GIT_CONFIG_GLOBAL` set), 171 passed for `tests/test_agents_md_codes.py`, `tests/test_cli_reference.py` and `tests/test_repo_hygiene.py`, and for `tests/test_shape_doctor.py` in 4 shards (449 ids) 112 passed and 1 skipped, 111 passed and 1 skipped, 112 passed, and 111 passed and 1 skipped (the 3 skips are `tests/test_shape_doctor.py:10516`, the PowerShell line that only a Windows host prints). That is 1,205 ids over 5 calls: 1,200 passed, 5 skipped, 0 failed. The PR body's earlier gate, at `05e6ab0f` (and at `3a389565` for the one shard that holds `tests/test_validate_family_unreadable.py`), also gave 945 run for the pin call (0 failed) and 8037 passed and 39 skipped for the 116 other files that name `validate-family.py`, `siblings.py` or `bootstrap.py` and 6 that read the `members` row; those two calls were not run again on the restack.

It lands by fast refresh (Brett Heap, 2026-10-15T22:48:35Z). Its H0 `bbe5b414` is green on Linux and SonarCloud. The branch was never rebased. After H0, the only commit is update-branch's clean merge of main, giving ff423ed, which is green on SonarCloud and Git Bash. Lane 1's gate passed on its tree: 10 pytest calls over `tests/test_pinned_root_git_unreadable.py`, `tests/test_validate_family_unreadable.py`, `tests/test_root_git_unreadable.py`, `tests/test_doctor_unreadable_paths.py`, `tests/test_doctor_unreadable_pin.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_work_dir_refusal.py`, `tests/test_adopt_filter_repo_origin_url.py`, `tests/test_adopt_one_byte_locale.py` and `tests/test_shape_doctor.py` in 4 shards: 1,300 passed, 5 skipped.

Closes #1148

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

Main at 6740776 (#1172's squash 2fde6c3, then #1120). Two files
conflicted, each resolved inside its hunks only:

- templates/family-root/scripts/siblings.py, the docstring's exit-2
  paragraph: #1172's sentence on the holder's own `.git`
  (`git-repo-unreadable`, #1148) and then #1164's on the holder's
  `.gitmodules` (`gitmodules-unreadable`, #1110).
- templates/family-root/scripts/siblings.py, `member_unreadable`: #1172's
  `code` keyword and docstring sentence are kept, and its body is
  #1164's call of `path_unreadable`, now passed that `code` in place of
  the literal "member-unreadable", so `_refuse_an_unreadable_root`'s
  `git-repo-unreadable` and `submodule_urls`' `gitmodules-unreadable`
  are both raised.
- tests/test_path_guard_hygiene.py, `KNOWN_OPEN`: the base held 11
  entries; #1164 took out the 3 it fixed (family.py's two .gitmodules
  readers and siblings.py's `submodule_urls`) and main took out the other
  8 (shape-doctor.py and shape_advisory.py), so none is left.

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-09T16:55:53Z) #1164 is merged with main after #1172 landed, at 16ff9391. This is w1164r's round, and the body's new section ## Merged with main after #1172 landed holds its full record.

Lane: openreposhape-1 (openRepoShape-1)

@brettheap

Copy link
Copy Markdown
Contributor Author

(lane openRepoShape-1, 2026-11-09T21:36:02Z) r1164d's delta review of #1164 at 16ff9391, posted by lane 1: READY. r1164d is lane 1's independent reviewer; it wrote none of this PR. Its full review follows the line.

Lane 1 takes the NITs as follows:


r1164d: delta review of #1164 after w1164r merged main (head 16ff93917)

Verdict: READY. There is no MUST and no SHOULD. There are six NITs, and NIT-1 is the one I would add before landing.

The merge is a real two-parent merge. Git's own merge-tree conflicts in exactly the two files named. Every other path is git's clean merge. Both refusals are kept, each with its own code, and they run in the order the docstring and #1172's body give. All three revisions were probed on 3.12.3 and on a 3.14-like shim. I am uid 1000, not root, so the permission-bit probes really ran.

Findings

NIT-1: no row holds precedence when both refusals apply.

  • Where: tests/test_family_gitmodules_unreadable.py (a new row at the end).

  • Evidence: mutant mprec puts submodule_urls(Path(start).resolve()) before _refuse_an_unreadable_root(start) in _load_family. It survives: [mprec] rc=0 … 118 passed in 81.77s on test_pinned_root_git_unreadable.py and test_family_gitmodules_unreadable.py.

  • Does it matter? A little. Both orders end in a correct exit-2 refusal with its cure. But this order exists only since the merge, and nothing pins it.

  • Fix: add the row below. I ran it in a scratch clone:

    • at the head: [row-head] … 1 passed (3.12) and [row-head-shim] … 1 passed;
    • under mprec: [row-mprec] rc=1 … 1 failed, with AssertionError: REFUSED gitmodules-unreadable: .gitmodules: cannot be read (Permission denied);
    • restored blob 40860536… EQUAL to HEAD's.

    It needs these imports: refusal_detail (conftest), needs_a_mode, estate, siblings, at_000, linked_into_locked, linked_into (test_root_git_unreadable) and mode_of (test_validate_pins_unreadable_workflows_dir). The source is /workspace/projects/openRepoShape-worktrees/_lane1-scratch/r1164d/tools/test_r1164d_both.py.

    @needs_a_mode
    def test_a_holder_whose_git_and_gitmodules_cannot_be_read_is_refused_once(estate, tmp_path):
        holder = estate["holder"]
        locked = linked_into_locked(holder, tmp_path)
        linked_into(holder)
        with at_000(locked), mode_of(holder.parent, "locked", 0):
            result = siblings(holder, "--dry-run")
        assert result.returncode == 2, result.stdout + result.stderr
        assert refusal_detail(result.stderr, "git-repo-unreadable") == [
            "REFUSED git-repo-unreadable: .git: cannot be read (Permission denied)"]
        assert "gitmodules-unreadable" not in result.stderr
        assert result.stdout == ""

NIT-2: the body's "Not in this PR" bullet undercounts.

NIT-3: a ragged wrap in the docstring.

  • Where: templates/family-root/scripts/siblings.py:181-182 reads unanswerable question is never an (40 characters), then implicit pass. (21 characters).
  • Cause: main's context line was kept unchanged.
  • Fix (optional): join them as unanswerable question is never an implicit pass. That touches one line outside the hunk. The file already has the same pattern at :163.

NIT-4: both forms kept, where both bodies had said to keep one.

NIT-5 (for lane 1, not the PR): #1110's body no longer mirrors KNOWN_OPEN.

NIT-6: the body as GitHub holds it does not end with the footer.

  • Evidence: the ## Summary by Sourcery block, 18 lines with two U+2019 characters, follows the footer.
  • The part lane 1 wrote does end with the Lane: line, a blank line and the footer (lines 148-150).
  • The Sourcery block was already there before w1164r's round (body-github-before.md:123) and was kept on publish.
  • Fix: if the squash message is taken from the body, cut it at the footer.

Check 1: the merge

Check 2: siblings.py

Probe table. The probes used a disposable family from the repo's estate fixture. Each case ran as --dry-run, as a real run (GIT_ALLOW_PROTOCOL=file) and as --make help --dry-run. Within each case, all three modes gave the same exit and the same code line, except main's shim row for .gitmodules into 000, noted there. That makes 6 runs of 24 probes, each 24 passed, with the shim loaded in 47 processes per shim run.

Case main 674077657 (3.12 / shim) 74096eb4 (3.12 / shim) head 16ff93917 (3.12 / shim)
neither (control) exit 0: 2 members from the local remotes (.gitmodules); real run exit 0; make help exit 1 (0 of 2 ran, no clones yet) same same; stdout equal (the real run differs only in the members' commit shas)
holder .git linked into a folder at 000 exit 2, REFUSED git-repo-unreadable: .git: cannot be read (Permission denied), stdout empty / same PermissionError traceback, exit 1 / exit 2 not-a-git-repo equal to main byte for byte (exit, stdout, stderr)
holder .gitmodules linked into 000 traceback, exit 1 / exit 0 "would clone https://github.com/InkRouter/IRRS.git (family.yaml repository:)" ×2 (real run: exit 1; make: exit 1) exit 2, REFUSED gitmodules-unreadable: .gitmodules: cannot be read (Permission denied), stdout is the header only / same equal to 74096eb4 byte for byte
both at once as the .git row traceback / not-a-git-repo exit 2, git-repo-unreadable once, no gitmodules-unreadable line, stdout empty; equal to main
.gitmodules a directory exit 0, would clone from github.com ×2 same same
.gitmodules a dangling link exit 0, would clone from github.com ×2 same same
.gitmodules a file at 000 exit 0, would clone from github.com ×2 / same exit 2 gitmodules-unreadable equal to 74096eb4
members/IRRS/.gitmodules at 000 (a member's own) control: siblings.py does not read it same same

I read the brief's "a member whose .gitmodules cannot be read" as the holder's .gitmodules (the PR's case). I also probed a member's own .gitmodules, which is unchanged.

Check 3: tests/test_path_guard_hygiene.py

  • The 11 sites: each is mended at the head, by AST.
    • _gitmodules_names and _sections_giving call _gitmodules_on_disk.
    • submodule_urls calls _is_a(path, stat.S_ISREG).
    • check_agent_files and check_what_is_here call is_a. Its two remaining is_file() calls are listed in BENIGN at lines 466 and 469.
    • The four .git sites in shape-doctor.py go through carries_git.
    • The two in shape_advisory.py call _is_a.
  • No list lost or doubled an entry: git diff 674077657 16ff93917 -- tests/test_path_guard_hygiene.py shows only the branch's 10 lines removed from KNOWN_OPEN. An AST scan finds no duplicate keys: HELPERS 12, TAGS 7, BENIGN 176, KNOWN_OPEN 0, PLANTED 23, ROUTES 18.
  • The file passes: it ran in g3 (283 passed).

Check 4: the deltas

Check 5: the mutants

The mutants ran in scratch clones at 16ff93917. After each one:

  • siblings.py's blob was 4086053671434851f0add2dd545bfbf5cf3583de == HEAD;
  • the hygiene blob was 31c03f81b3b9cc1f1f603a0f30961e5cc75ce23c == HEAD;
  • status lines: 0, 16 times out of 16.
Mutant Change Rows Result
m1172 (w1164r) _refuse_an_unreadable_root(start) replaced by pass pinned_root 6 failed, 70 passed: killed
mhunk (w1164r) hunk 2 resolved with HEAD's side only pinned_root 6 failed, 70 passed: killed
m1164 (w1164r) submodule_urls: except OSError sets there = False gitmodules_unreadable 10 failed, 32 passed: killed (the clone stopped at transport 'https' not allowed ×3)
munion (w1164r) KNOWN_OPEN with _gitmodules_names and check_agent_files put back hygiene -k …guard_that_is_there 1 failed, 120 deselected: killed
mprec .gitmodules asked before .git (swapped precedence) pinned_root + gitmodules_unreadable 118 passed: survived (NIT-1)
mroot member_unreadable always passes ROOT_UNREADABLE siblings_bootstrap_unreadable + pinned_root 9 failed, 124 passed: killed
mdefault default code="git-repo-unreadable" same 9 failed, 124 passed: killed
mignore path_unreadable's Refusal ignores code gitmodules_unreadable + pinned_root 16 failed, 102 passed: killed
mexit _load_family's refusal returns 1 pinned_root 6 failed, 70 passed: killed
mswap what and then swapped in the delegation pinned_root 6 failed, 70 passed: killed
mdocgm the .gitmodules sentence dropped from the exit-2 paragraph doc trio + gitmodules_unreadable 213 passed: survived
mdocgit #1172's sentence dropped from the exit-2 paragraph doc trio + pinned_root 247 passed: survived
mdocmem member_unreadable's "code is the refusal's" sentence dropped doc trio + pinned_root 247 passed: survived
mkob KNOWN_OPEN with submodule_urls alone put back hygiene 1 failed, 120 passed ("0 found, 1 listed"): killed
mkom KNOWN_OPEN with check_the_way_in alone put back hygiene 1 failed, 120 passed: killed
mguard submodule_urls back to path.is_file(), with KNOWN_OPEN empty hygiene 1 failed (siblings.py:513 … path.is_file() is a bare guard): killed
  • w1164r's four mutants: 4 of 4 killed, with exactly its counts and the body's.
  • My twelve: 8 of 12 killed. Overall, 12 of 16.
  • The three doc survivors don't matter for behaviour. --help prints only the docstring's first line, and no test reads siblings.py's exit-2 paragraph, at base or on either side.

Check 6: the gate

All calls ran at 16ff93917 in the probe environment, at most 2 at once. Before each, /workspace had 78-82G free and root inodes were at 33-34%.

  • g1, the PR's 4 files: 333 passed in 265.53s.
  • g2, test_pinned_root_git_unreadable and test_validate_family_unreadable: 129 passed in 131.23s.
  • g3, test_scaffold_leg_path_collisions, test_path_guard_hygiene and test_no_auto_maintenance: 283 passed, 2 skipped in 47.33s.
    • Both skips are at test_no_auto_maintenance.py:222: "the session began with GIT_CONFIG_GLOBAL set".
    • g2 and g3 together give the body's 412 passed, 2 skipped.
  • g4, the doc trio: 171 passed in 57.16s.
  • g5s, under the 3.14-like shim: test_family_gitmodules_unreadable and test_pinned_root_git_unreadable gave 118 passed in 95.72s (shim loaded in 57 processes).
  • CI at 16ff9391, read from the check-runs API: SonarCloud, tests (17:52:49Z), package and tests-git-bash all success.

Check 7: merges with main now

  • At 21:31:33Z origin/main is 9cb156a98 (it was 4552efa6a in the brief, then 5c662f75e; 8 commits past 674077657).
  • git merge-tree --write-tree --name-only 16ff93917 origin/main exits 0, tree 65d69b919….
  • Main's changes since the merge touch none of the branch's 4 files. They are adopt-project.py, the holder's validate-family.py, docs/cli.md and tests.

Check 8: the body

Not covered

  • The full suite, test_shape_doctor.py and the siblings file set: the brief excluded them, and w1164r ran them.
  • A gate on the merge with the current main: I ran merge-tree only.
  • Mutants ran on 3.12 only. The shim covered the probes, the two PRs' row files and the proposed row.
  • The family.py siblings entry point: it ran only through the PR's own rows in g1.
  • Windows: covered only by CI's tests-git-bash run.
  • An unchanged behaviour outside this delta: a dangling .gitmodules link is still "no file", so members are planned from https://github.com/<repository>.git at all three revisions. That is consistent with "nothing at the name is no file".

My review checkout /workspace/projects/openRepoShape-worktrees/l1-r1164d is clean at 16ff93917. My scratch folder is /workspace/projects/openRepoShape-worktrees/_lane1-scratch/r1164d/. It holds:

  • the logs, in logs/;
  • the probe results, in out/;
  • the scripts and the proposed row, in tools/;
  • three scratch clones: pclone holds my two untracked probe files, and mclone and mclone2 are clean.

I pushed nothing and posted nothing.

Lane: openreposhape-1 (openRepoShape-1)

brettheap added a commit that referenced this pull request Nov 9, 2026
…in with the interpreter and the script's path, quote the row's name, fill in the family's org, say the branch they run on, and `member-already-present` prints its `remove` (#1127) (#1201)

**#1127: the `add`, `bump` and `remove` lines that `family.py`'s remedies name are one spelling, `_family_line`, and each line a real `add`, `bump` or `remove` prints runs as printed, including from the branch a fresh clone stands on, as do the dry runs' `member-unknown` and `member-already-present` lines (three other lines are in Limits). A line begins with the interpreter and the script's path, quotes the row's name, names the family's org where it is known, and says which branch it runs on, and `member-already-present` prints its `remove` beside its `bump`.**

**Was stacked on #1117 at `10dc011c9`, and is restacked after #1117 landed as `9252ef20`** (see "Restacked after #1117 landed"). Before that, its base was #1117's branch, `fix/1005-family-remove-add-family-root`, and it showed one commit, `eac177af9`: 9 files, 638 insertions and 74 deletions (`git diff --stat 10dc011 eac177a`). It answers the seven follow-ups of RV1117's review of #1117 (#1005), N1 to N7 of #1127, and one more that measuring found, N1b.

Main is `961640c6` and #1117's head is `10dc011c9`. The probe is `tests/test_zz_probe1127.py`, run untracked through `run9.sh` (stub `gh`, bogus token, no global git config, no ssh) on each, from 20:13Z to 20:16Z on 2026-10-22. Its scripts and logs are in lane 5's scratch `v124/n1127/` (`probe/`, `logs/probe-main.log`, `logs/probe-parent.log`, `logs/n5-measure-main.log`, `logs/n5-measure-parent.log`).

| item | on main | on #1117's head |
|---|---|---|
| **N1** `member-unknown`'s `add`, typed on the tracking branch | not in that form: the line has no `--family-root`, so typed from a holder it exits 2 with argparse's `the following arguments are required: --family-root`, on any branch | holds: `add --family-root <holder> --member <org>/IRQS` from a holder on `main` exits 2 `family-on-tracking-branch` |
| **N1b** (found by measuring) `member-already-present`'s `bump`, typed on the tracking branch | holds | holds: `add --member InkRouter/IRRS` on `main` is refused `member-already-present`; its `bump` line, with a real commit, exits 2 `family-on-tracking-branch`. `add` asks `_checked_add_target` before `_checked_branch` |
| **N2** a bare `family.py` | holds: the `member-unknown` and `member-already-present` lines start `family.py` | holds, and so do #1117's two `remove` lines |
| **N3** `<org>` left blank | holds: `family.yaml` says `org: InkRouter`, the line says `<org>/IRQS` | holds |
| **N4** `--member` printed raw | holds: with the row's project hand-edited to `IR RS`, the `bump` line reads `--member IR RS`, which `shlex` splits into `IR` and `RS` | holds |
| **N5** the README sentence's verbs tied to nothing | holds: dropping `bump` from README and the handbook leaves `tests/test_readme_windows_quoting_sentence.py` at 44 passed | holds: dropping `remove` leaves it at 44 passed |
| **N6** a backtick in the holder's path | holds: the first backticked span of the remedy is `family.py bump --family-root '<...>/a`, cut at the path's backtick | holds |
| **N7** `remove` takes it out, with no line | holds: the `member-already-present` remedy says "`remove` takes it out" and prints no `remove` line | holds, the same text |

So both kinds are present. N1 exists only in #1117's `add` line, since main's has no `--family-root` to be refused for. The other seven (N1b and N2 to N7) hold on both, and #1117 rewrites three of the lines they concern. That is why this is stacked on #1117.

Item by item, with the row that pins it and the mutants aimed at it (the results are in the Mutants section; each run stopped at its first failing row):

| item | what holds now | pinned by | mutants |
|---|---|---|---|
| N1 | `member-unknown`'s remedy opens with the branch clause and the `git switch -c`; typed in order from the tracking branch, the `switch -c` then the `add` exit 0 | `test_member_unknowns_add_runs_as_printed_from_the_tracking_branch` | M5, M11, M13, M15 |
| N1b | the same for `member-already-present`'s `bump` and `remove` | `test_member_already_presents_lines_run_as_printed_from_the_tracking_branch` (`bump`, `remove`) | M14 |
| N2 | every line begins with the interpreter and the script's path | the new file's rows, and the rows of five existing files that now read that lead | M1, M12 |
| N3 | the owner is the typed one, else `family.yaml`'s `org:`, else the blank | `test_member_unknowns_add_names_the_owner_where_it_is_known` (7 params) | M6, M7, M8, M9 |
| N4 | the row's name is one quoted word | `test_a_rows_name_with_a_space_is_one_word_in_both_lines` | M2, M16 |
| N5 | the README sentence's verbs are tied to `NAMED` and to the verbs `_family_line` is called with | `test_the_kinds_of_family_lines_are_the_ones_the_sentence_lists` | D1, D2, D3 |
| N6 | a command holding a backtick is printed bare | `test_a_command_holding_a_backtick_is_printed_bare` | M3, M4 |
| N7 | `member-already-present` prints the `remove` line | the `[remove]` param of the N1b row | M10 |

The code, in `scripts/family.py`:

- **One spelling for the lines, `_family_line(verb, holder, *words)` (N2, N4).** It prints `<python> <this file's path from where the run stood> <verb> --family-root <holder> <words>`, every word spelled by `shell_quoted` for the reader's shell. That is how `init`'s NEXT STEPS' `add` was already printed (`_add_command`, #486), now shared. `_add_command` is built on it and prints the same bytes.
  - It is called for `bump`'s `member-unknown` (its `add`), `add`'s `member-already-present` (its `bump` and `remove`), `add`'s `member-duplicate-id` (its `remove` and `bump`) and `bump`'s `member-duplicate-id` (its `remove`).
  - The row's `project:` is passed as a word, so a row `IR RS` prints `'IR RS'`, one word (N4).
  - A placeholder (`<commit>`, `<org>/...`) is added after the line, bare: quoted, it would read as a value.
- **The branch the line runs on, `_off_the_tracking_branch` (N1, N1b).** `member-unknown` and `member-already-present` are refused before `_checked_branch` reads the branch, so a person on the tracking branch, where `init` and a fresh clone leave them, typed a line that was refused. Each remedy now opens with `on a branch other than the holder's tracking branch, which <verb> refuse(s) (<git -C holder switch -c branch> makes one), `, and ends with `BRANCH_LEFT` (#607).
  - `member-unknown`: `` `add` refuses ``, branch `family/add-<project>`.
  - `member-already-present`: `` `bump` and `remove` refuse ``, branch `family/bump-<id>`. The issue named only the `add` (N1); this is N1b.
  - The words are true on any branch: the refusal is said before the branch is read, and reading it there could refuse in its place. The two `member-duplicate-id` remedies name no branch: a real `add` or `bump` asks them after `_checked_branch`.
- **The owner of `member-unknown`'s `add`, `_unknown_members_repository` (N3).** The owner `--member` was typed with (`<org>/<project>`), else `family.yaml`'s `org:`, else the blank `<org>`. Each is used only where `MEMBER_RE.fullmatch("<owner>/<project>")`, so an empty org or an org holding a space leaves the blank, and a typed owner `add` refuses falls through to the family's org. The value is one word for the shell.
- **A command holding a backtick is printed bare, `_cited` (N6).** Every shell reads the line the same either way.
- **`member-already-present` prints the `remove` line beside the `bump` line (N7).** `` `<bump line> --to <commit>` moves an existing member and `<remove line>` takes it out. ``

The remedy of `bump --member IRQS` on a family whose `org:` is InkRouter, before and after. The "after" is from the working tree's probe before the commit (`logs/probe-wip.log`), and the tests pin it on the head. `BRANCH_LEFT` follows it.

```
before (#1117's head):
Remediation: `family.py add --family-root <holder> --member <org>/IRQS` puts it in the family first.

after:
Remediation: on a branch other than the holder's tracking branch, which `add` refuses (`git -C <holder> switch -c family/add-irqs` makes one), `python3 <path to family.py> add --family-root <holder> --member InkRouter/IRQS` puts it in the family first.
```

Tests:

- **`tests/test_family_remedy_lines.py` (new, 12 rows) types each line as printed.** The holder is the suite's family, copied and put back on its tracking branch, as `tests/test_family_tracking_branch.py` does, and the lines are typed from a folder with a space in its name, by the interpreter and the script path they print.
  - `member-unknown`: the exact remediation; the `add` typed alone is refused `family-on-tracking-branch`; its `switch -c` then the `add` exit 0, pin IRQS on `family/add-irqs`, leave the holder clean and `validate-family.py` green (N1, N2).
  - `member-already-present`, for `bump` and for `remove`: the same, with the pin moved to `main~1` or the row gone (N1b, N7).
  - The owner, 7 params (the family's org; a typed owner; a typed owner `add` refuses; no org; an empty org; an org holding a space; no org but a typed owner), each pinned to the exact line (N3).
  - A row `IR RS`: both lines carry `'IR RS'` as one word (N4).
  - A holder under a folder `a`b`: both remediations print bare commands, and the `add` runs (N6).
- **`tests/test_readme_windows_quoting_sentence.py` ties the sentence's verbs to the code (N5).** `NAMED` is re-counted for the new helpers (`_family_line` 3, `_add_command` 1, `_unknown_members_repository` 2). A new `FAMILY_LINES` says what each function prints, and a new `family_line_verbs` reads each `_family_line` call's verb from the source. `test_the_kinds_of_family_lines_are_the_ones_the_sentence_lists` checks those kinds against the verbs README lists for `family.py` (`NEXT`, `switch -c`, `add`, `cd`, `git rm -r --cached`, `bump`, `remove`), no more and no fewer, and refuses a verb that is not a string constant. A second test checks the reader on a small source. README and the handbook are not touched.
- **Five existing test files read the new lead.** `family_lead(cwd=None)` is a new helper in `tests/test_family_printed_quoting.py`: the interpreter and the path to `family.py` from where the refused run stood. `tests/test_bump_remedies_family_root.py`, `tests/test_family.py`, `tests/test_family_add_member_id.py`, `tests/test_family_bump_to_checks.py` and `tests/test_remove_add_remedies_family_root.py` expect it where they expected a bare `family.py`; that last file's `bump-member-unknown` case now expects the org filled in.
- **No assert joins conditions with `and` or `or`.** Read on the syntax tree: the new file has 43 asserts and the sentence file gains 7, none of them composite. The diff adds no non-ASCII byte.

`10dc011c9`'s `family.py` was put under the committed tests of `eac177af9` (`git show 10dc011:scripts/family.py > scripts/family.py`), with `tests/test_family.py` narrowed to its one changed test, and the 8 changed or new files run through `run9.sh` with `-rA`: **90 failed, 142 passed** in 148.64s (`logs/rows-parent.log`; the failing ids are in `logs/rows-parent-failed.txt`). `family.py` was restored and its sha256 checked afterwards. The same 232 rows pass on the head, inside the gates below. The rows were not run against main's `family.py`: this PR's base is #1117's branch.

| file | failed of run | the rows |
|---|---|---|
| `tests/test_remove_add_remedies_family_root.py` | 45 of 45 | `test_the_line_a_remedy_names_carries_the_holder_whole`, `..._parses` and `..._runs_as_printed_and_does_what_it_says`, 15 each: 5 holders (`plain`, `my work`, `Dana's work`, `relative`, `symlink`) x the cases `add-member-duplicate-id`, `bump-member-duplicate-id`, `bump-member-unknown` |
| `tests/test_bump_remedies_family_root.py` | 18 of 21 | `test_the_bump_a_remedy_names_carries_the_holder_whole`, `..._parses` and `..._runs_as_printed`, 6 each: 3 holders (`plain`, `my work`, `Dana's work`) x `member-already-present`, `member-duplicate-id` |
| `tests/test_family_remedy_lines.py` (new) | 12 of 12 | `test_member_unknowns_add_runs_as_printed_from_the_tracking_branch`; `test_member_already_presents_lines_run_as_printed_from_the_tracking_branch[bump]` and `[remove]`; `test_member_unknowns_add_names_the_owner_where_it_is_known` (all 7 params); `test_a_rows_name_with_a_space_is_one_word_in_both_lines`; `test_a_command_holding_a_backtick_is_printed_bare` |
| `tests/test_family_add_member_id.py` | 6 of 14 | `test_a_linked_manifest_with_a_pinned_id_is_refused_by_the_mount_unwound`, `test_a_member_whose_id_changes_between_the_probe_and_the_mount_is_unwound`, `test_a_renamed_repository_is_refused_before_anything_is_mounted`, `test_a_section_already_at_the_mount_path_is_refused_first_then_the_id`, and `test_each_command_the_refusal_names_runs_on_the_row_it_names[bump]` and `[remove]` |
| `tests/test_family.py` | 4 of 4 | `test_add_refuses_a_spelling_of_a_member_the_family_already_pins[INKROUTER/IRRS]`, `[InkRouter/irrs]`, `[OtherOrg/Irrs]`, `[inkrouter/irrs]` |
| `tests/test_family_bump_to_checks.py` | 3 of 6 | `test_a_duplicate_id_behind_a_tag_is_refused_after_the_peel_line`, `test_a_duplicate_id_read_through_a_linked_manifest_is_put_back`, `test_bump_to_a_commit_recording_another_rows_id_is_refused_alike` |
| `tests/test_readme_windows_quoting_sentence.py` | 2 of 46 | `test_the_functions_that_quote_for_the_host_are_the_ones_the_sentence_names[scripts/family.py]` (`NAMED` no longer matches #1117's `family.py`: `_add_command` is counted 3 there, where `NAMED` now says 1, and four more functions are counted) and the new `test_the_kinds_of_family_lines_are_the_ones_the_sentence_lists` |
| `tests/test_family_printed_quoting.py` | 0 of 84 | gains the `family_lead` helper only |

19 of 19 killed. Each was applied alone to the committed tree with `mut/mutants1127.py` (lane 5's scratch `v124/n1127/mut/`), run through `run9.sh` with `-x -q` on the named file, and restored byte for byte, with the sha256 checked by an assert in the driver. `git status --porcelain --untracked-files=no` was empty after the last one (`logs/mutants.log`). With `-x` a run stops at its first failing row, so the table names that row, not every row that would fail. Every failure is an `AssertionError` at an assert of the named file, read in `logs/mut-<id>.log`, never an import or syntax error. No survivor.

| mutant | what it does | result | first failing row |
|---|---|---|---|
| M1 | `_family_line` drops the interpreter and the script | killed, rc 1 | `test_member_unknowns_add_runs_as_printed_from_the_tracking_branch` |
| M2 | words unquoted in `_family_line` | killed, rc 1 | `test_a_rows_name_with_a_space_is_one_word_in_both_lines` |
| M3 | holder unquoted in `_family_line` | killed, rc 1 | `test_a_command_holding_a_backtick_is_printed_bare` |
| M4 | `_cited` always backticks | killed, rc 1 | `test_a_command_holding_a_backtick_is_printed_bare` |
| M5 | no branch clause | killed, rc 1 | `test_member_unknowns_add_runs_as_printed_from_the_tracking_branch` |
| M6 | org blank always | killed, rc 1 | `test_member_unknowns_add_runs_as_printed_from_the_tracking_branch` |
| M7 | typed owner ignored | killed, rc 1 | `test_member_unknowns_add_names_the_owner_where_it_is_known[the-typed-owner]` |
| M8 | owner not checked against `MEMBER_RE` | killed, rc 1 | `...owner_where_it_is_known[a-typed-owner-add-refuses]` |
| M9 | typed owner after the family's org | killed, rc 1 | `...owner_where_it_is_known[the-typed-owner]` |
| M10 | no `remove` line in `member-already-present` (#1117's words) | killed, rc 1 | `test_member_already_presents_lines_run_as_printed_from_the_tracking_branch[bump]` |
| M11 | `BRANCH_LEFT` dropped from `member-unknown` | killed, rc 1 | `test_member_unknowns_add_runs_as_printed_from_the_tracking_branch` |
| M12 | script named bare (#1117's `family.py`) | killed, rc 1 | `test_member_unknowns_add_runs_as_printed_from_the_tracking_branch` |
| M13 | `member-unknown`'s `switch -c` suggests `bump`'s branch | killed, rc 1 | `test_member_unknowns_add_runs_as_printed_from_the_tracking_branch` |
| M14 | `member-already-present`'s `switch -c` suggests `add`'s branch | killed, rc 1 | `test_member_already_presents_lines_run_as_printed_from_the_tracking_branch[bump]` |
| M15 | `member-unknown`'s clause names the wrong verb | killed, rc 1 | `test_member_unknowns_add_runs_as_printed_from_the_tracking_branch` |
| M16 | `member-already-present`'s row name raw in its lines | killed, rc 1 | `test_a_rows_name_with_a_space_is_one_word_in_both_lines` |
| D1 | README and the handbook drop `remove` from the sentence (N5) | killed, rc 1 | `test_the_kinds_of_family_lines_are_the_ones_the_sentence_lists` |
| D2 | a `_family_line` call of a verb the sentence does not list (N5) | killed, rc 1 | `test_the_kinds_of_family_lines_are_the_ones_the_sentence_lists` |
| D3 | a `_family_line` call whose verb is not a constant (N5) | killed, rc 1 | `test_the_kinds_of_family_lines_are_the_ones_the_sentence_lists` |

M1 to M16 ran on `tests/test_family_remedy_lines.py`, D1 to D3 on `tests/test_readme_windows_quoting_sentence.py`. D1 is the N5 measurement made into a mutant: on #1117's head the same documentation edit left that file at 44 passed.

All through lane 5's `run9.sh` with `EMAIL` exported, run by `gate-n1127.sh` from the main loop. Every `START` line reads `head=eac177af934b9606db83e5a31e62cd5a98b5270c` and `dirty=0`, or, for the hygiene run, the scratch commit below. The 17 files: `tests/test_family_remedy_lines.py`, `tests/test_bump_remedies_family_root.py`, `tests/test_family_add_member_id.py`, `tests/test_family_bump_to_checks.py`, `tests/test_family_printed_quoting.py`, `tests/test_readme_windows_quoting_sentence.py`, `tests/test_remove_add_remedies_family_root.py`, `tests/test_family.py` (the 8 this commit changes or adds), and `tests/test_family_init_landing.py`, `tests/test_git_bash_dialect.py`, `tests/test_validate_family_branch_step.py`, `tests/test_validate_family_remedies_typed.py`, `tests/test_validate_family_duplicates.py`, `tests/test_family_dry_run.py`, `tests/test_family_members_not_a_list.py`, `tests/test_family_switch_branch_exists.py`, `tests/test_family_tracking_branch.py` (the 9 that name the changed functions or codes).

| run | git | result | log |
|---|---|---|---|
| the 17 files and the trio (`tests/test_repo_hygiene.py`, `tests/test_agents_md_codes.py`, `tests/test_cli_reference.py`) | 2.43 | **953 passed** in 656.46s | `logs/gate243.log` |
| the 17 files | 2.47.1 (`git version 2.47.1` is the log's first line) | **783 passed** in 613.17s | `logs/gate247.log` |
| `tests/test_path_guard_hygiene.py`, in the scratch worktree `n1127-hyg-scratch`: main `961640c68` with this `family.py` committed there as `ea72f4b98` (blob `ab41b42ec`, the same as `eac177af9`'s) | 2.43 | **49 passed** in 16.91s | `logs/hyg243.log` |

The hygiene run is on a scratch commit because #1117's base, `6da757cbe`, predates #1111's `tests/test_path_guard_hygiene.py`: the file is not in `eac177af9`, and it is in main. No failure and no skip in any run. The full suite was not run.

Read again on 2026-10-23 at about 11:10Z, with git 2.43.0 and no global git config, after `git ls-remote` read main at `961640c68`, #1117's branch at `10dc011c9` and this branch at `eac177af9`:

| `git merge-tree --write-tree <other> eac177a` | exit | result |
|---|---|---|
| `origin/main` (`961640c68`) | 1 | one conflict, `docs/handbook.html` |
| #1117, `10dc011c9` | 0 | clean, tree `0abd5f5d4fc2` |
| #1098, `dad7961a98` | 0 | clean, tree `4ef018a9b508` |
| #1166, `2593952c95` | 1 | one conflict, `docs/handbook.html` |
| #1164, `74096eb47833` | 1 | one conflict, `docs/handbook.html` |

- **The one conflict is #1117's own, and this commit does not touch the handbook.** #1117 alone (`git merge-tree --write-tree <other> 10dc011`) conflicts in `docs/handbook.html` and nowhere else against main, #1166 and #1164, and is clean against #1098. `git diff --name-only 10dc011 eac177a` names no file under `docs/`.
- **#1164's head moved to `74096eb47833`, from `3162b523be`, after the gate run.** The gate run's merge-tree was at `3162b523be` and read the same: one conflict, `docs/handbook.html`.
- **Open PRs.** 54 were listed with `gh pr list --state open --limit 100 --json number,headRefName,headRefOid,files`. Four touch `scripts/family.py`: #1166, #1164, #1117 and #1098. Of this commit's 9 files, #1117 touches 5 (`scripts/family.py` and four test files); no other PR touches a test file of this commit's. Every one of those heads is above.

#1117 landed on 2026-11-08 at 19:15:56Z as `9252ef208`, from its final head `8cb9c729a` (a merge of main into its branch after `219e57c28`). Lane 5's pilot restacked this branch at 19:31Z with two real merges and no rebase:

1. `85909e973` merges #1117's final head `8cb9c729a`.
2. `24b6a0af6` merges #1117's squash `9252ef208`, taking this branch's side for the five files the squash and the branch both carry: `scripts/family.py`, `tests/test_family_add_member_id.py`, `tests/test_family_bump_to_checks.py`, `tests/test_readme_windows_quoting_sentence.py` and `tests/test_remove_add_remedies_family_root.py`.

No third merge was needed: main was still `9252ef208`. The new head `24b6a0af6` differs from main in exactly this PR's 9 files, 638 insertions and 74 deletions. That change is byte for byte the one rv1201 found READY: `git diff 10dc011 eac177a` and `git diff 9252ef2 24b6a0a` have the same `+` and `-` lines and the same patch-id, `ceddd1c4ddae`. Its tree, `85563cdb`, is the one the pilot's dry run predicted.

- **The `init` remedies are left as follow-ups.** `scripts/family.py` lines 558 (`Family.open`'s `family-root-missing`) and 10386 (`cmd_siblings`'s `family-root-missing`) say `` `family.py init --org <org> --family <Name>` `` with a bare `family.py`. `_family_line` always prints `--family-root`, which `init` does not take, so they need a spelling of their own.
- **`member-ambiguous`'s remedy is left as a follow-up.** It is raised at line 607 and says "`remove` takes the extra one out" with no line to type, the shape N7 had in `member-already-present`. It is not in the issue.
- **Three printed lines name no branch, so typed on the tracking branch they are refused** (rv1201's review, issuecomment-6372152028, SHOULD-1). (a) `add --dry-run`'s `member-duplicate-id`: under `--dry-run`, `cmd_add` skips `_checked_branch` but still asks `_checked_member_id`, and the `remove` line its remedy prints, typed on the tracking branch, is `REFUSED family-on-tracking-branch`. (b) `bump --dry-run`'s `member-duplicate-id`, the same way through `_bump_dry_run`. (c) `init`'s `family-holder-already-here` prints `_add_command`'s line between plain backticks, with no branch clause and not through `_cited`, so it is refused typed on the holder `init` just made, and a folder name that holds a backtick ends the span early. Each chain still ends in a refusal that prints its own `switch -c`. They are left as follow-ups, with rv1201's three NITs.
- **The family's `org:` is the likeliest owner, not a certain one.** A member may live in another organisation (`MEMBER_RE`), and the `add` of a repository that is not there is refused before it touches the holder. `<org>` stays blank where no owner is a `--member` that `add` takes.
- **The clause says "a branch other than the tracking branch".** It is worded to be true on any branch, since the refusal is said before the branch is read, so a person already off the tracking branch reads a clause that does not apply to them.
- **#1117's head is expected to move before it lands** (its handbook conflict with main is its own to mend). When it does, this branch takes a merge of the new head, never a rebase, and the gates run again. It did: see "Restacked after #1117 landed".
- **The runs are on the bench's Python 3.12; CI runs 3.14.** No test line this commit adds uses `ast.dump`, `repr(` or `sys.version`, so no assert reads text that depends on the Python version.
- **A post-tag DRAFT.** Brett Heap ruled on 2026-10-21T10:32:04Z to leave the follow-ups out of v1.2.0. It is on the v1.2.1 milestone, and it lands after its base #1117, under his v1.2.1 merge word of 2026-10-23T13:10:26Z.

Review: rv1201, lane 5's independent opus reviewer, which wrote none of #1201: READY at `eac177af`, H0 of this landing before its restack (issuecomment-6372152028), with no MUST; its one SHOULD (the Goal's claim) is fixed in the body, and its three NITs go to a follow-up. CI (Brett Heap's ruling 27 and his fast-refresh ruling of 2026-10-15T22:48:35Z): H0 24b6a0a (the restack of the branch onto main after #1117 landed) passed tests, tests-git-bash and SonarCloud; the head d1ecf81 is a clean update-branch merge of main 3ee5bb4, with tests-git-bash and SonarCloud green; and the local gate passed on its predicted squash tree 4daf6ff over main 3ee5bb4: the bump_remedies_family_root, family, family_add_member_id, family_bump_to_checks, family_printed_quoting, family_remedy_lines, readme_windows_quoting_sentence, remove_add_remedies_family_root, repo_hygiene, agents_md_codes, cli_reference sets, 512 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 #1127

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

sonarqubecloud Bot commented Nov 9, 2026

Copy link
Copy Markdown

@brettheap
brettheap marked this pull request as ready for review November 9, 2026 22:20
@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 15 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@brettheap
brettheap merged commit 370a23c into main Nov 9, 2026
4 of 5 checks passed
@brettheap
brettheap deleted the fix/1110-family-unsearchable-gitmodules branch November 9, 2026 22:31
brettheap pushed a commit that referenced this pull request Nov 9, 2026
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
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
…`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
…ame the file as `shown_path` does, and validate-pins.py, family.py and shape-doctor.py read either spelling (#1168) (#1274)

`repo_shape.load_yaml` names the file it refuses as `shown_path` names a path, in all three of its refusals (`yaml-unreadable` twice, `yaml-unparsable`), and so does `policy-unreadable` on the next line of `NamingPolicy.load`. A U+202E, an ESC or a line feed in a typed `--plan`, `--path-policy`, `--policy`, `--project` or `--root` path no longer reaches the terminal raw from any of the six tools that hand `load_yaml` such a path (eight runs: `adopt-project.py` reads two flags, `validate-repository-naming.py` two). A printable path prints byte for byte as on main. Every reader that finds the path at the start of a refusal's detail by its text keeps working, beside a `repo_shape.py` from before this change or after it.

Probed at `51a9c5f10` with a stub `gh` first on PATH, `GH_TOKEN=bogus`, an empty `GH_CONFIG_DIR`, `GIT_SSH_COMMAND=false` and an empty global git config: a folder `pl<U+202E>an` holding a file that is not this reader's YAML (`a: 1` then `: b`). Each run exits 2 with one line, the U+202E in it raw:

```
REFUSED yaml-unparsable: <D>/pl<U+202E>an/<file>: line 2: empty keys are not supported
```

- `adopt-project.py check --plan` (and `execute --plan`, the same `Plan.load`);
- `adopt-project.py plan --path-policy`;
- `validate-repository-naming.py --policy` and `--project`;
- `bump-leg.py --root` (`<root>/project.yaml`);
- `family.py bump --family-root` (`<root>/family.yaml`);
- `update-shape.py check --root` (`<root>/contracts/shape-pin.yaml`);
- `validate-manifest.py --root`, as a root carries it.

On this branch the same eight runs say `'<D>/pl\u202ean/<file>'`. The rows below hold all eight, with U+202E, an ESC and a line feed in turn, and a printable name.

The readers that find the path in the detail by its text, on main: `validate-pins.py`'s `_load` tests `exc.detail.startswith(f"{path}: ")`; `family.py`'s `_read_member_project` swaps `str(manifest_path)` for `<repo> @ <commit>:project.yaml`; `repo_shape.link_declarations` swaps `str(path)` for `shown_path(path)`. Beyond the issue's list, a grep of every shipped `.py` for a detail read by its prefix found two more, both in `shape-doctor.py`: `naming_script_refusal` (`detail.startswith(f"{shape / NAMING_COPY}: ")`) and the `manifest-kinds` row (`exc.detail.removeprefix(f"{path}: ")`). Measured with only `repo_shape.py` changed: `validate-pins.py` named a root that is not printable by its whole spelled path in place of `project.yaml`; `family.py` named the deleted clone in place of the member when `TMPDIR` is not printable (probed with an ESC in the clone's folder); the doctor no longer knew its own policy's refusal, and its `manifest-kinds` row quoted the whole path again. Each is held below.

- `scripts/repo_shape.py`, `load_yaml`: `named = shown_path(path)`, used at the three sites; `NamingPolicy.load`'s `policy-unreadable`: `shown_path(path)`. Same module, no new import. The words after the path are unchanged.
- `templates/assembly-root/scripts/validate-pins.py`, `_load`: the prefix is looked for raw and as the gate's own `_shown` spells it (`_shown` is written in the gate, not imported, under the skew rule), and either is named relative to the root.
- `scripts/family.py`, `_read_member_project`: the swap to `shown` takes the spelled path, then the raw one.
- `shape-doctor.py`: `naming_script_refusal` asks both prefixes (`policy-wrong-kind` still names the policy raw); the `manifest-kinds` row takes the path off with a new `less_the_path`, in either spelling.
- `repo_shape.link_declarations` is unchanged: its `replace(str(path), named)` finds nothing to swap in a spelled detail and the `why` reads as it did (a row says so).
- `tests/test_load_yaml_refusals.py`: the rows below, added to the file that already holds `load_yaml`'s refusals (#192), not a new file.

No refusal code, remediation or word after the path changes, and a printable path is named as before. `README.md`, `docs/cli.md`, the handbook and `AGENTS.md` hold none of `cannot be read (`, `not UTF-8 at byte`, `yaml-unparsable`, `yaml-unreadable` or `policy-unreadable`; the release notes of v1.0.0, v1.1.1 and v1.2.0 name the codes as the record of those releases, with printable paths, and stay as they are; the 46 files under `tests/` that hold them are all in the gates below.

**`scripts/repo_shape.py` and `templates/assembly-root/scripts/validate-pins.py` are shape copies.** Every assembly root carries both, and every family holder carries `repo_shape.py`, so `update-shape.py check` shows each as `upstream-changed` in every project until `apply` re-copies it and re-pins, as #827 and #919 did. `family.py` and `shape-doctor.py` run from a checkout of the standard and are not copied.

A root re-copies its pinned files one row at a time (`update-shape.py apply --accept-local` keeps a copy), so `validate-pins.py` and `repo_shape.py` may be of different ages. Rows, each a real run of the root's own gate over a root under a folder holding the character:

| gate | library | the refusal names | row |
|---|---|---|---|
| this branch | this branch | `project.yaml` | `test_the_gate_names_the_file_from_the_root_beside_this_library` |
| this branch | before #1168 (`51a9c5f10`, raw) | `project.yaml` | `test_the_gate_names_the_file_from_the_root_beside_an_older_library` |
| before #1168 | this branch | the whole path, spelled, nothing raw | `test_an_older_gate_beside_this_library_names_the_whole_path_spelled` |
| before #1168 | before #1168 | `project.yaml` | main |

The third order is the one no change here can reach: that gate's own code asks the raw prefix alone. It still prints nothing raw, and it names `project.yaml` again once the gate is re-copied. A printable root is named `project.yaml` in all four. The two older copies are read with `git show 51a9c5f:...`, a skip where a checkout lacks that history (CI checks out with `fetch-depth: 0`), so `test_the_gates_load_takes_either_prefix` also holds both halves in process with no history. `family.py` and the doctor always import their own checkout's `repo_shape.py`, so they cannot meet another age; they read both spellings all the same, so no reader of the prefix depends on which library it meets, and their rows run beside each.

`adopt-project.py` spells the paths it prints itself with its own `_shown` (backticks, #1115, and #1152's PR #1177 for `--plan`), and `load_yaml` now spells with `shown_path` (`repr`, quotes). Measured, for one plan path:

| path holds | `adopt-project.py` `_shown` | `shown_path` |
|---|---|---|
| U+202E | `` `/d/pl\u202ean/plan.yaml` `` | `'/d/pl\u202ean/plan.yaml'` |
| ESC | `` `/d/x\x1b[31m/plan.yaml` `` | `'/d/x\x1b[31m/plan.yaml'` |
| a line feed | `` `/d/a\nb/plan.yaml` `` | `'/d/a\nb/plan.yaml'` |
| a byte that is not UTF-8 | `` `/d/caf\udce9/plan.yaml` `` | `'/d/caf\udce9/plan.yaml'` |
| a quote and an ESC | `` `/d/it's\x1b/plan.yaml` `` | `"/d/it's\x1b/plan.yaml"` |
| a trailing space | `` `/d/trail /plan.yaml ` `` | `/d/trail /plan.yaml ` |
| nothing unusual | `/d/plain/plan.yaml` | `/d/plain/plan.yaml` |

**Decision: `shown_path` in `load_yaml`, and the two styles stand.** The escapes are the same; only the delimiters differ, and `_shown`'s extra cases (a trailing space, backticks at both ends) are printable, so neither is a hole. A run never shows both for the plan: `check` and `execute` over an unparsable plan each print exactly one line, the `load_yaml` refusal, and stop (measured). `shown_path` is what the other five tools print for the same refusal, and what the three pinned validators' own `_shown` print (`test_the_pinned_scripts_spell_a_path_as_the_library_does` holds them equal). One spelling for `adopt-project.py` too would mean a spelling parameter on a function in a shape copy, or re-raising at `Plan.load` and `PathPolicy.load`, in a file #1177 is changing next to those lines and 20 other open PRs touch, for a difference of quote marks.

112 rows in `tests/test_load_yaml_refusals.py`: 101 new, and the 11 that were there (#192). Run on main's code: this branch's rows in the detached tree at `51a9c5f10`, with main's version of each changed file swapped in, each put back with a sha256 check (measured on the 109 rows at `e39b5d7e3`, and again on all 112 at `136b38d12`: the table is the second run, and the three rows the review round added are the only change).

| rows | on main's 4 files | main's `repo_shape.py` only | main's `validate-pins.py` only | main's `family.py` only | main's `shape-doctor.py` only |
|---|---|---|---|---|---|
| each refusal, U+202E / ESC / line feed x absent / not UTF-8 / unparsable (9) | 9 fail | 9 fail | pass | pass | pass |
| `policy-unreadable`, 3 names (3) | 3 fail | 3 fail | pass | pass | pass |
| each of the 8 tools x 3 names (24) | 24 fail | 24 fail | pass | pass | pass |
| older gate beside this library, 3 names (3) | 3 fail | 3 fail | pass | pass | pass |
| gate beside this library, 3 names, real run (3) and in process (3) | pass | pass | 6 fail | pass | pass |
| family member manifest beside this library, 3 names (3) | pass | pass | pass | 3 fail | pass |
| doctor's own policy in the naming script's output, 3 names x 2 refusals (6) | 2 fail (line feed) | 2 fail (line feed) | pass | pass | 6 fail |
| doctor's `manifest-kinds` row beside this library, 3 names (3) | pass | pass | pass | pass | 3 fail |
| a path typed relative, `adopt-project.py check --plan`, 3 names (3) | 3 fail | 3 fail | pass | pass | pass |
| total failing of 112 | 44 | 44 | 6 | 3 | 9 |

60 of the 101 new rows fail on main's code: the 44 above with main's four files, and 16 more that read the path back (the gate 6, `family.py` 3, the doctor 4 + 3) with main's reader beside this branch's library, the skew this change would otherwise open.

The other 41 new rows pass in every column, as do the 11 that were there. They are the controls the brief asks for: a printable path in each refusal (3), in `policy-unreadable` (1) and through each tool (8), which prints byte for byte as on main; the four readers beside a library older than #1168 (gate real run 4, gate in process 4, `family.py` 4, `manifest-kinds` 4) and beside this one for a printable path (6); `link_declarations` (4), which reads as it did; and the doctor finding `policy-wrong-kind` raw (3). Mutants M5, M8, M10, M12, M13 and M14 each fail some of them; the `link_declarations` rows guard only that its `why` did not move, which nothing in this change can move (M16). The doctor's two line-feed rows fail on main's four files too: a raw line feed splits the naming script's line before the doctor reads it.

Each applied alone in the detached tree, the 109 rows of `e39b5d7e3` run, the file put back and its sha256 checked against the branch's (all 17 matched). 15 killed, 2 survived. The review round adds M18 and M19, both killed by its three new rows (below).

| mutant | killed by |
|---|---|
| M1 `cannot be read` back to `{path}` | the in-process `absent` rows (3) |
| M2 `not UTF-8 at byte` back to `{path}` | the in-process `not-utf-8` rows (3) |
| M3 `yaml-unparsable` back to `{path}` | 31 rows: the in-process `unparsable` rows (3), the 24 tool rows that are not printable, the older gate's (3) and the doctor's line-feed `load-yaml` row |
| M4 `policy-unreadable` back to `{path}` | the three `policy-unreadable` rows, and the doctor's line-feed row |
| M5 `validate-pins.py`: the raw half of the prefix test dropped | gate beside an older library (3), `_load` with an older library (3) |
| M6 `validate-pins.py`: the spelled half dropped | gate beside this library (3), `_load` with this library (3) |
| M7 `family.py`: the spelled swap dropped | family with this library (3) |
| M8 `family.py`: the raw swap dropped | family with an older library (3) |
| M9 doctor `naming_script_refusal`: the spelled prefix dropped | its `load-yaml` and `not-a-mapping` rows that are not printable (6) |
| M10 doctor `naming_script_refusal`: the raw prefix dropped | `policy-wrong-kind` named raw, U+202E and ESC (2) |
| M11 `less_the_path`: the spelled prefix dropped | `manifest-kinds` with this library (3) |
| M12 `less_the_path`: the raw prefix dropped | `manifest-kinds` with an older library (3) |
| M13 `load_yaml`'s `named` always `repr`, a printable path too | 24 rows: the printable rows of each refusal (3) and each tool (8), the four #192 rows that assert `str(refusal).startswith(f"REFUSED yaml-unreadable: {path}")`, and printable rows of the readers |
| M14 `policy-unreadable` always `repr` | its printable row and the doctor's printable `not-a-mapping` row (2) |
| M15 `validate-pins.py`'s spelled half as `repr(str(path))` in place of `_shown(str(path))` | **survived, equivalent**: for a path that is not printable the two are the same text, and a printable one is caught by the raw half first |
| M16 `link_declarations`' `replace(str(path), named)` removed | **survived, equivalent**: the detail already holds `shown_path`'s spelling, so the swap finds nothing to swap; the row `test_a_link_manifest_is_named_in_why_as_it_was` is there to say the output did not move |
| M17 `less_the_path` returns the detail whole | `manifest-kinds`, both libraries (6) and its printable rows (2) |
| M18 `load_yaml`'s `named` from `Path(path).absolute()` (rv1274's X5, which survived the 109 rows) | the relative-path rows (3), and no other of the 112 |
| M19 the same from `Path(path).resolve()` | the same 3 |

Every run through the lane's runner: a stub `gh` first on PATH (and the suite's own `gh` guard ahead of it), `GH_TOKEN=bogus`, an empty `GH_CONFIG_DIR`, `GIT_SSH_COMMAND=false`, `GIT_CONFIG_GLOBAL=/dev/null`, a blank git identity, git-filter-repo 2.47.0 (CI's pin; `--version` says `a40bce548d2c`) on PATH, Python 3.12.3 (CI runs 3.14; no row asserts text that depends on the version).

The gate list, 53 files, 4591 tests: the new rows; the hygiene five (`test_path_guard_hygiene`, `test_repo_hygiene`, `test_agents_md_codes`, `test_cli_reference`, `test_pinned_copy_text`) and `test_no_auto_maintenance`; the 46 files under `tests/` that hold `cannot be read (`, `not UTF-8 at byte`, `yaml-unparsable` or `yaml-unreadable`; every `validate-pins` file (`test_pin_validator`, `test_validate_pins_lockstep_lines`, `test_validate_pins_without_git` beside those the grep found); and for the doctor and `family.py` readers, `test_shape_doctor`, `test_doctor_validator_verdicts`, `test_naming_policy`, `test_family_py_unreadable` and `test_validate_family_unreadable`. One run of more than 100 tests at a time.

| run | git | head | result |
|---|---|---|---|
| the gate list | 2.43.0 | `0e5f95db5` | 4579 passed, 12 skipped, 0 failed (40:38) |
| the gate list | 2.47.1 | `e39b5d7e3` | 4586 passed, 5 skipped, 0 failed (46:43) |
| the new rows, the hygiene five, `test_no_auto_maintenance` | 2.43.0 | `e39b5d7e3` | 546 passed, 2 skipped, 0 failed |
| `tests/test_load_yaml_refusals.py` | 2.43.0 | the change before the commit | 109 passed |
| the same, on main's code (5 swaps) and under 17 mutants | 2.43.0 | `51a9c5f10` + this change | as in the tables above |
| `tests/test_load_yaml_refusals.py` (112), the hygiene five and `test_no_auto_maintenance` (439), 14 runs of at most 100 | 2.43.0 | `136b38d12` | 549 passed, 2 skipped, 0 failed |
| the same | 2.47.1 | `136b38d12` | 549 passed, 2 skipped, 0 failed |

`e39b5d7e3` differs from `0e5f95db5` by one comment in `tests/test_load_yaml_refusals.py` (the commit was amended before it was pushed), so the 2.43.0 gate list stands for it, with the small run above on the final head. The 12 skips on 2.43.0: the reftable backend needs git 2.45 (7), the session's `GIT_CONFIG_GLOBAL` (2), a PowerShell line printed only on Windows (3). On 2.47.1, 5: the last two kinds.

`136b38d12` (the review round) changes `tests/test_load_yaml_refusals.py` alone: three rows added and one row's setup moved out of a `pytest.raises` block. The gate list at `136b38d12` is 4594 tests; its other 52 files are not run again, and the new file, the hygiene five and `test_no_auto_maintenance` are, on both gits (the two rows added to the table above). Their 2 skips, on both gits: `test_no_auto_maintenance.py:222`, the session began with `GIT_CONFIG_GLOBAL` set.

`git merge-tree --write-tree` (git 2.47.1) of the head `136b38d12` with main and with the head of each open PR on a file this changes, main fetched and heads read with `gh pr list` at about 16:20Z on 2026-11-09. The table of 2026-11-08, at `e39b5d7e3`, differs in three rows: #1172 was open, #1269 was at `c792615f4`, and #1164 (at `74096eb47`) conflicted in `tests/test_path_guard_hygiene.py`, which this does not touch, and is clean at its new head.

| with | head | result |
|---|---|---|
| main | `ebb87168a` | clean. Main moved since `51a9c5f10`: in `scripts/family.py` (#1117's remedies, not `_read_member_project`) and, since the last table, in `shape-doctor.py` (the `members` row), `bootstrap.py`, `validate-family.py`, `siblings.py`, `adopt-project.py` and `tests/conftest.py`; a grep of its production changes since `8e6f53268` finds no new reader of a `load_yaml` detail. The predicted merge, checked out alone, passes the 112 rows, `test_pinned_copy_text`, `test_family_py_unreadable`, `test_validate_family_unreadable`, main's touched `family.py` tests (`test_family_add_member_id`, `test_family_bump_to_checks`, `test_remove_add_remedies_family_root`) and `test_adopt_plan_source_branch_shown`: 411 passed on git 2.43.0 |
| #1266 (`scripts/repo_shape.py`) | `09697e9c5` | clean |
| #1171 (`scripts/repo_shape.py`, `adopt-project.py`) | `8162b874e` | clean; it leaves `shown_path` as it is |
| #1249 (`scripts/repo_shape.py`) | `3146c3ca5` | clean |
| #1177 (`--plan`'s `_shown`) | `5208e874e` | clean |
| #1263, #1248, #1239 (`validate-pins.py`; #1248 also `shape-doctor.py`) | `9ef8f0ab5`, `1b747f7ab`, `fff421456` | clean |
| #1269 (`shape-doctor.py`) | `52e5c1883` | clean |
| #1201, #1164 (`scripts/family.py`) | `24b6a0af6`, `16ff93917` | clean |
| #1264 (`scripts/family.py`) | `43d2e8b26` | `docs/handbook.html` conflicts, which this does not touch; against main alone it conflicts there and in five more files (`scripts/family.py` and four tests), the same six with this change merged in, and the five conflict blocks of `family.py` are identical with and without it |

#1172 was open in the last table and has merged since: its change is in the main row.

Two independent reviews of `e39b5d7e3` (rv1274, then rv1274b, which continued it after a reboot) found no MUST and called the PR READY. What each point of theirs came to, in `136b38d12` (tests only; no production file changed):

- **SHOULD, the refusals #1168 names and this PR leaves raw:** filed as #1279. It lists eight "unreadable" and "not a mapping" refusals that still name the path as typed, measured at `e39b5d7e3` with their sites, and two sites not probed; the Limits below name the same family. Nothing in this change touches those lines.
- **NIT 1, the dead raw halves:** kept. `family.py` and `shape-doctor.py` import their own checkout's `repo_shape.py`, so the raw swap in `_read_member_project` and the raw prefix in `less_the_path` run only when a row swaps in an older library in process. They are harmless, they make each reader independent of which library it meets (the version mix above), and the doctor's raw prefix in `naming_script_refusal` is live, since `policy-wrong-kind` still names the policy raw.
- **NIT 2, no row typed a relative path:** done. rv1274's mutant X5 (`load_yaml` naming `Path(path).absolute()`) survived the 109 rows, since every tool row types a path under `tmp_path`, which is absolute. `test_a_path_typed_relative_is_named_as_typed_and_spelled` (3 rows: U+202E, ESC, a line feed) runs `adopt-project.py check --plan` with the path typed relative to the working directory and holds the refusal to the path as typed, relative and spelled. On main's `repo_shape.py` all 3 fail; X5 and its `.resolve()` twin each fail exactly those 3 of the 112 rows; every restore matched its sha256 (git 2.43.0). The tools handed a file keep the path as typed (`adopt-project.py check --plan` and `plan --path-policy`, `validate-repository-naming.py --policy` and `--project`, measured); the four handed a root (`bump-leg.py`, `family.py bump`, `update-shape.py`, `validate-manifest.py`) make it absolute before `load_yaml` sees it, so one tool of the first kind is the row.
- **NIT 3, Sonar python:S5778:** done. `unparsable(root / "project.yaml")` ran inside the `pytest.raises` block of `test_the_gates_load_takes_either_prefix`, beside `gate._load`. The file is made first, so only `gate._load` runs inside the block; the row's 8 ids and their verdicts are the same.
- **NIT 4, stale counts:** done. The open PRs touching `adopt-project.py` (20 others than #1177, as of 16:20Z), the merges table (main `ebb87168a`, every head read fresh), and the counts of rows and mutants above (112 rows, 101 new, 44 failing on main's four files; M18 and M19 added).

They also checked, and asked nothing of this change: no reader of a `load_yaml` detail is left outside the five it changes, the gate's `_shown` equals `shown_path`, and neither shape copy's digest is stored anywhere in the tree.

- **An older `validate-pins.py` beside this `repo_shape.py`** names a root that is not printable by its whole spelled path, not `project.yaml`, until the gate is re-copied (the version-mix table). Nothing raw.
- **`policy-wrong-kind`**, the line after `policy-unreadable` in `NamingPolicy.load`, still names the policy raw: the brief kept the scope to the three `load_yaml` refusals and `policy-unreadable`. It is the same one-line change, and the doctor already reads either spelling.
- **The "not a mapping" lines in other files** still name the path raw: `plan-unreadable` (`adopt-project.py`, which #1177 spells), `path-policy-unreadable` and `path-policy-wrong-kind` (`scripts/path_classify.py`), `bump-leg-manifest-unreadable` (`bump-leg.py`), `manifest-unreadable` (`validate-repository-naming.py`, which #1267 and #1236 are changing), `manifest-missing` and `manifest-unreadable` (`validate-manifest.py`), `update-pin-unreadable` (`update-shape.py`) and the doctor's own `policy-raised`. Follow-up candidates.
- **Not probed:** the two `bootstrap.py`, `siblings.py`, `validate-family.py` and `shape_advisory.py`. By reading, each hands `load_yaml` `<root>/<one set name>`; where it does not swallow the refusal (two of `siblings.py`'s three do), it prints the detail whole (`bootstrap.py` through `spelled`, which leaves a spelled path as it is), so each now says the spelled path.
- `link_declarations`' swap now finds nothing to swap. It is left in place: removing it is a further change to a shape copy for no change in output (mutant M16).

Review: rv1274 and rv1274b, lane 5's independent opus reviewers, which wrote none of #1274 (rv1274 stopped for the reboot of 2026-11-08 with no MUST; rv1274b finished its review): READY at `e39b5d7e` with no MUST (issuecomment-6742338962); its SHOULD is the follow-up #1279, and its NITs 2-4 are fixed in `136b38d1`. Then rv1274c, lane 5's independent sonnet reviewer, which wrote none of it: READY at `136b38d1`, H0 of this landing, with no finding (issuecomment-6745586545). CI (Brett Heap's ruling 27 and his fast-refresh ruling of 2026-10-15T22:48:35Z): H0 136b38d passed tests, tests-git-bash and SonarCloud; the head 52a140c is a clean update-branch merge of main 150e401, with tests-git-bash and SonarCloud green; and the local gate passed on its predicted squash tree 2fb87fe over main 150e401: the load_yaml_refusals, adopt_check_throwaway_repos, adopt_e2e, adopt_execute_refusals, adopt_make_bootstrap_followups, adopt_make_reads_first, adopt_pins, adopt_plan_source_branch_shown, adopt_template_values, adopt_tracking_branch, bump_leg_branch_and_push_line, chain_link_fold, doctor_unreadable_paths, doctor_unreadable_pin, family, family_dry_run, path_guard_hygiene, pin_source_unreadable, pinned_root_git_unreadable, root_git_unreadable, stdout_encoding, update_shape_apply_lines_and_headers, update_shape_header_comments, update_shape_merged_away, update_shape_unreadable, validate_family_unreadable, validate_pins_spelled_and_named, pinned_copy_text, no_auto_maintenance, repo_hygiene, agents_md_codes, cli_reference sets, 2432 passed, 6 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 #1168

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant