Skip to content

validate-family.py: a member whose git directory's HEAD this user cannot open, under .git/modules/<path> or in a .git directory, is refused member-unreadable by name, where it ended member-commit-unresolvable with a fetch (#1256) - #1263

Merged
brettheap merged 15 commits into
mainfrom
l3-1256-member-head-unreadable
Nov 10, 2026

Conversation

@brettheap

@brettheap brettheap commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Goal

#1256: the family holder's gate (templates/family-root/scripts/validate-family.py) refuses a member whose git directory's HEAD file this user cannot open by name, member-unreadable, as the assembly gate refuses a leg's (#1239). It no longer says the pinned commit is missing, and no longer advises a fetch.

Stacked: #1246 and #1239 have landed, and this branch is restacked over their squashes

What changed

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

Two independent reviews by lane 5 found it: rv1248's N2 on #1248, and rv1246 on #1246 ("HEAD at 000 is out of scope: I measured it, and it is still member-commit-unresolvable").

Measured before and after

Python 3.12.3, git 2.43.0, uid 1000. Every run was offline: a stub gh (exit 97) first on PATH, GH_TOKEN=bogus, an empty GH_CONFIG_DIR, GIT_SSH_COMMAND=false, GIT_CONFIG_GLOBAL=/dev/null. Each holder is the test harness's real one (family and holder from tests/test_family.py and tests/test_family_add_refusals.py), scaffolded from the tree under test, and its own scripts/validate-family.py was run in it as a subprocess, each run bounded at 60 s. "Before" is the tree with #1246 and #1239 merged (bc602077); "after" is the change in 9ef8f0ab (the probe ran on its code before a last edit of two comment lines, which changed no code).

State before (bc602077) after (9ef8f0ab)
gitfile member, .git/modules/members/IRRS/HEAD at 000 exit 2, REFUSED member-commit-unresolvable: members/IRRS: the pinned commit 17600264... is not in that member's object store (... exited 128: fatal: not a git repository: .../members/IRRS/../../.git/modules/members/IRRS), then the fetch exit 2, REFUSED member-unreadable: .git/modules/members/IRRS/HEAD: cannot be read (Permission denied), no fetch
.git-directory member, members/IRRS/.git/HEAD at 000 exit 2, REFUSED member-commit-unresolvable: ... (... exited 1: ), then the fetch exit 2, REFUSED member-unreadable: members/IRRS/.git/HEAD: cannot be read (Permission denied), no fetch
each of the two with the mode back exit 0 exit 0
FIFO HEAD (.git/modules/members/IRRS/HEAD) no answer in 60 s no answer in 60 s: git's, not this check's (see "Out of scope")
git directory with no HEAD exit 2, member-commit-unresolvable ... fatal: not a git repository the same: still git's answer
readable control exit 0, nothing on stderr exit 0, nothing on stderr

The new rows were run at the before bytes too (bc602077's validate-family.py, blob d2f2f936, put in place and then restored, cmp same): 12 failed and 6 passed. The 3 mode rows got member-commit-unresolvable, the 4 in-process rows exited 0 (assert 0 == 2), the whole-outside row got member-commit-unresolvable where it asks member-unreadable, and the 4 parity rows ended DID NOT RAISE Refusal. The 6 that passed are the controls: the race, the directory and FIFO HEADs never opened, and the NUL name. At the after bytes: 18 passed.

Tests

tests/test_validate_family_unreadable.py, beside #1246's test_a_member_git_directory_with_no_head_is_left_to_git: 8 functions, 18 rows.

  • test_a_member_git_directory_head_this_user_cannot_open_is_refused ([gitfile-member], [git-directory-member]): the issue's two shapes at mode 000, run as a holder runs the gate: member-unreadable naming the HEAD, exit 2, the chmod cure, no member-commit-unresolvable; with the mode back, exit 0. Skipped as root and on Windows (needs_a_mode), as the file's other mode rows are.
  • test_a_linked_worktree_head_this_user_cannot_open_is_named_whole: a linked worktree's HEAD, outside the holder, at mode 000, named whole. Also needs_a_mode.
  • test_a_member_git_directory_head_whose_open_is_refused_is_refused: the in-process stand-in for root and Windows. Both shapes, the open of HEAD refused for permission and for an I/O error, each with its own cure.
  • test_the_member_tree_asked_alone_names_a_head_whole_outside: _check_member_tree alone, relative and then whole outside the holder.
  • test_a_member_head_gone_when_it_is_opened_is_left_to_git: an open that finds nothing is no refusal, and the run passes.
  • test_a_member_head_is_named_as_the_gate_names_a_leg_s (PARITY): both shapes, both causes; the family gate's line equals the leg gate's for the same HEAD.
  • test_a_member_head_that_is_no_regular_file_is_not_opened ([directory], [fifo], each shape): neither gate opens it; an open fails the row rather than hanging it.
  • test_a_member_head_no_system_call_can_name_is_left_to_git: a gitdir: line that holds a NUL (built with chr(0)).

Every pytest ran under the stub gh above, with [email protected], as /usr/bin/python3 -m pytest -q -p no:cacheprovider --basetemp=<scratch>/bt-<group>, one at a time, at 9ef8f0ab. git-filter-repo is not on this bench, so a venv with CI's pin (git-filter-repo==2.47.0) gave a folder holding only a link to its script, put on PATH right after the stub gh.

Mutants

Each mutant was written over the template alone, run over the whole of tests/test_validate_family_unreadable.py (102 rows), and the template was then put back and checked with cmp (same, 3 of 3). The mutants ran on the code of 9ef8f0ab before its last two-line comment edit; the code they change is the same.

mutant rows that failed result
M1: the open dropped (_gitfile_opens(head) taken out; HEAD still named after the stat) 12: the 3 mode rows, the 4 in-process rows, the whole-outside row, the 4 parity rows KILLED
M2: HEAD named before its stat 9: #1246's own rows for a git directory at 000 or r-- (git-directory-000, -444, named-git-directory-000, -444), its 4 in-process git-directory rows, and its whole-outside row, which now name .../HEAD where the git directory is refused KILLED
M3: the regular-file guard dropped (head.open("rb").close() in place of _gitfile_opens(head)) 5: the race row (ENOENT at the open is refused) and the 4 directory and FIFO rows (an open fails the row rather than hanging it) KILLED

Merges

One gh pr list -R opensoft/openRepoShape --state open --limit 200 --json number,headRefOid,files call listed 49 open PRs. Four touch this PR's files: #1246 (both), #1172 (both), #1227 and #1258 (validate-family.py). git merge-tree --write-tree (git 2.43.0) of this head 9ef8f0ab with each, all rc 0 with no conflicted path:

merged with tree semantic check
main 5926ccca (moved from this branch's base dffc4226 by an adopt-project.py change that touches neither file) 482152ed none
#1246 0deac3a6 32587fbf, this head's own (it is an ancestor) none
#1239 fff42145 32587fbf, this head's own (it is an ancestor) none
#1172 2eabec8e 2529b17b a local merge commit d273c61a in a worktree: tests/test_validate_family_unreadable.py, 102 passed in 80.18s. The merged gate's _refuse_an_unreadable_git_dir holds both #1172's code and reads and #1239's open of HEAD, and the ast.unparse comparison above is still True there.
#1227 2d56c190 70d45bce none: it changes .gitmodules value checks far from these lines
#1258 c8641c69 beec5ab9 none: it adds escape_unencodable_stdout() at the top of main

No merged copy of validate-family.py, validate-pins.py or tests/test_validate_family_unreadable.py has a duplicate top-level name.

Out of scope

Closes #1256

Lane: openreposhape-3 (openRepoShape-3)

🤖 Generated with Claude Code

Summary by Sourcery

Report member Git HEAD files that the current user cannot open as unreadable instead of treating their commits as unresolved.

New Features:

  • Detect unreadable member Git HEAD files before Git resolution and report them as member-unreadable with the relevant HEAD path.

Bug Fixes:

  • Prevent unreadable HEAD files from being misreported as missing commits with an ineffective fetch recommendation.
  • Preserve correct handling for missing, non-regular, and externally located HEAD files.

Enhancements:

  • Align family-member HEAD readability checks and path reporting with the assembly gate behavior.

Tests:

  • Add coverage for unreadable member HEAD files across Gitfile, .git directory, linked-worktree, error, and platform-independent cases.
  • Add parity and regression tests for missing, non-regular, and invalidly named HEAD files.

Brett Heap and others added 6 commits October 23, 2026 21:40
… under `.git/modules/<leg>` or in a `.git` directory, is refused `pin-submodule-unreadable` by name, where it ended `pin-commit-unresolvable` (#1222)

`_refuse_an_unreadable_git_dir` asked the `HEAD` of a leg's git directory
only by `stat`, which a `HEAD` at mode 000 passes, so git, which could not
read it, ended the run in `pin-commit-unresolvable` under THE LOCKSTEP
RULE. A `HEAD` that is there is now opened as `_gitfile_opens` opens a
gitfile: only where it is a regular file, and an open that finds nothing
is a git directory with no `HEAD`, left to git. One this user cannot open
is named, `.git/modules/spec/HEAD` or `spec/.git/HEAD`, with the leg
checkout's remedy.

The gate half of #1222; the doctor half waits for #1200.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… or whose git directory (its own `.git`, or the one its gitfile names) this user cannot search, is refused `member-unreadable` naming that part, and no longer `member-commit-unresolvable`, which said the pinned commit was missing and prescribed a fetch (#1221)

`_check_member_tree` only `stat`ed the member's `.git` before running
`git rev-parse` in it. A gitfile at mode 000 stats; a `.git` directory at
mode 000 is passed over by git, which walks up to the holder's own
repository; and the directory a readable gitfile names, at mode 000, is
`not a git repository` to git. Each ended `member-commit-unresolvable`.

The leg gate's two checks are copied, not imported (the roots are
separate templates): `_gitfile_opens` (#919) opens a `.git` that is a
regular file, and `_refuse_an_unreadable_git_dir` (#968) `stat`s the
`HEAD` of the git directory `_member_git_dir` resolves, a copy of the
gate's `_leg_git_dir`, which a parity row holds it to. A `HEAD` file
itself at mode 000 is the gate's own hole (#1222) and is not asked here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ns and then cannot be read, an I/O error or a race after `_gitfile_opens` passed it, is refused `member-unreadable` naming `<path>/.git`, the fallback name `_refuse_an_unreadable_git_dir` falls back on, which no row asked (#1221)

rv1246's mutant R3 changed that fallback to `f"{path}"` and all 83 rows still
passed. One in-process row refuses `Path.read_bytes` for the member's `.git`
with EIO after the open succeeds and expects `members/IRRS/.git: cannot be
read (Input/output error)` with the other-reason cure. With R3 applied the row
fails; on main's bytes of validate-family.py it fails too. No code in
validate-family.py changes.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…56-member-head-unreadable

#1256 builds on #1246's member helpers, which have not landed yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…6-member-head-unreadable

#1256 mirrors #1239's open of a git directory's HEAD, which has not landed yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…annot open, under `.git/modules/<path>` or in a `.git` directory, is refused `member-unreadable` by name, where it ended `member-commit-unresolvable` with a fetch (#1256)

A `HEAD` at mode 000 stats, so #1221's `stat` of it passed, and git,
which could not read it, ended the run in `member-commit-unresolvable`,
"the pinned commit ... is not in that member's object store", with a
fetch that cannot help. `_refuse_an_unreadable_git_dir` now opens a
`HEAD` that is there through `_gitfile_opens`, as validate-pins.py opens
a leg's since #1222 (#1239): only a regular file is opened, an open that
finds nothing is left to git, and a refused open is `member-unreadable`
naming `.git/modules/<path>/HEAD`, `<path>/.git/HEAD`, or the whole path
of a linked worktree's `HEAD` outside the holder, with the member
checkout's remedy. A git directory with no `HEAD` stays git's.

The copied helpers stay word for word with validate-pins.py's:
`_gitfile_opens` and `_member_git_dir` (`_leg_git_dir`) compare equal by
`ast.unparse` with docstrings dropped.

Rows in tests/test_validate_family_unreadable.py: mode rows for a gitfile
member, a `.git`-directory member and a linked worktree (skipped under
root and on Windows), in-process stand-ins for each cause, a race that
finds no `HEAD`, a directory or FIFO `HEAD` never opened, a NUL name left
to git, and a parity row holding the line to the gate's.

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

sourcery-ai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Implementation

Open an existing regular member Git-directory HEAD and report a refused open as member-unreadable, while leaving missing and non-regular HEAD entries to Git and preserving path naming.

  • templates/family-root/scripts/validate-family.py L649-656, L719-730, L741-748 (+2 small edits)

Tests

Cover unreadable member HEAD files across Git-directory shapes and causes, including linked worktrees, path parity, races, non-regular entries, and invalid Gitfile paths.

  • tests/test_validate_family_unreadable.py L46-54, L961-1061, L1134-1220

Tips and commands

Interacting with Sourcery

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

Customizing Your Experience

Access your dashboard to:

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

Getting Help

@brettheap

Copy link
Copy Markdown
Contributor Author

(lane openRepoShape-5, 2026-11-08T16:39:15Z) For lane openRepoShape-3, as asked in #473 issuecomment-6723851717:

Independent review of #1263 (#1256) for lane openRepoShape-3, by lane 5's reviewer rv1263 (opus), at 9ef8f0a: READY

Summary. The commit does what #1256 asks. I measured a member's git-directory HEAD at mode 000, for both a gitfile member and a .git-directory member. Before this commit (bc602077) the run ended member-commit-unresolvable and advised a fetch. At the head it is REFUSED member-unreadable: <HEAD>: cannot be read (Permission denied), exit 2, with the chmod cure and no fetch. Every claim in the writer's evidence reproduced exactly. That covers the 12 rows that fail on the old bytes and the 6 controls that pass, the mutant counts 12/9/5, the 257 passed, the ast.unparse equality and the merge trees. I found no MUST and no SHOULD.

Scope: git diff bc602077 9ef8f0ab, which is templates/family-root/scripts/validate-family.py (+33/-10 in code, comments and docstrings) and tests/test_validate_family_unreadable.py (8 functions, 18 rows).

The refusal (measured)

The holder is the test harness's real one, scaffolded from each tree. Its own scripts/validate-family.py ran as a subprocess as uid 1000, with real modes and a 60 s bound (15 s for the FIFO). Each answer is the first stderr line.

State before (bc602077) head (9ef8f0ab)
gitfile member, .git/modules/members/IRRS/HEAD at 000 exit 2, member-commit-unresolvable, with the fetch exit 2, REFUSED member-unreadable: .git/modules/members/IRRS/HEAD: cannot be read (Permission denied), chmod, no fetch
.git-directory member, members/IRRS/.git/HEAD at 000 exit 2, member-commit-unresolvable, with the fetch exit 2, REFUSED member-unreadable: members/IRRS/.git/HEAD: cannot be read (Permission denied)
the same HEAD at 0o200 member-commit-unresolvable member-unreadable, naming HEAD
gitfile member at 000, run with --pins member-commit-unresolvable member-unreadable, naming HEAD
linked worktree's HEAD (outside the holder) at 000 member-commit-unresolvable member-unreadable, the whole path .../IRRS-clone/.git/worktrees/IRRS/HEAD
HEAD a symlink to a file at 000 member-commit-unresolvable member-unreadable, naming .git/modules/members/IRRS/HEAD
each of the above with the mode back exit 0 exit 0
git directory .git/modules/members/IRRS at 000 member-unreadable: .git/modules/members/IRRS the same: the directory is still named, not HEAD
no HEAD, or HEAD a directory member-commit-unresolvable (git's answer) the same: still left to git
FIFO HEAD timeout timeout (git's own hang, out of scope as briefed)
readable controls (gitfile, .git directory) exit 0 exit 0

No answer contained a traceback.

The rows

  • New row ids: 18. That is 2 + 1 + 4 + 1 + 1 + 4 + 4 + 1 across the 8 new functions; the file has 102 rows at the head.
  • On the old bytes. I swapped bc602077's validate-family.py (blob d2f2f936, sha256 7b2bc884...) into rv1263-mut and ran the whole file: 12 failed, 90 passed. I then restored the file and checked its sha256 (df82d5b1...: OK, mode 755).
  • The 12 that fail are every new refusal row:
    • the 2 HEADS mode rows;
    • the linked-worktree mode row;
    • the 4 in-process rows (assert 0 == 2);
    • ..._names_a_head_whole_outside, which got member-commit-unresolvable where it expects member-unreadable;
    • the 4 parity rows (DID NOT RAISE Refusal).
  • The 6 that pass are the controls: the race (ENOENT at the open), directory and FIFO HEAD for each of the two layouts, and the NUL gitdir: line.

Mutants

I ran each mutant alone over the whole file (102 rows), in rv1263-mut. After each one the file was restored and its sha256 checked, and all 9 printed RESTORED-OK.

Mutant Result
M1, the open dropped (writer's) 12 failed: exactly the 12 rows that fail at bc602077. KILLED
M2, HEAD named before its stat (writer's) 9 failed: #1246's git-directory-000/444 and named-git-directory-000/444, its 4 in-process git-directory rows, and its whole-outside row. KILLED
M3, the regular-file guard dropped, head.open("rb").close() (writer's) 5 failed: the race row and the 4 directory and FIFO rows. KILLED
M4, the name not switched to HEAD (the open kept) 12 failed. KILLED
M5, guard kept but ENOENT at the open refused 1 failed (the race row alone). KILLED
M6, only PermissionError refused (other errors swallowed) 4 failed (the io-error rows). KILLED
M7, outside HEAD named as its directory (str(found)) 2 failed (the linked-worktree mode row and the whole-outside row). KILLED
M8, relative name str(Path(named) / "HEAD") SURVIVED: equivalent on POSIX; it would differ only on Windows, which CI does not run
M9, _is_a(head, stat.S_ISREG) in place of _any_kind SURVIVED: equivalent; a HEAD that is no regular file is never opened either way

The copied helpers

I compared them by ast.unparse with docstrings dropped and names set equal (astcmp.py):

  • _gitfile_opens equals the gate's _gitfile_opens: True.
  • _member_git_dir equals the gate's _leg_git_dir: True.

Both are still True in the merge tree with #1172 (2529b17b). There the family function is byte-identical to the head's, and the gate's _refuse_an_unreadable_git_dir carries #1172's code/reads and #1239's open of HEAD.

The HEAD block matches the gate's, as the body says. The family's _is_a already returns False on ValueError, which is all the gate's _is_there adds.

Findings

MUST: none.

SHOULD: none.

NIT

Out of scope (for whoever owns #1172): in the merge with #1172 (2529b17b), the assembly gate's _refuse_an_unreadable_root calls _refuse_an_unreadable_git_dir. That function carries #1239's open, so the assembly root's own HEAD at 000 will be opened once #1172 and #1239 have both landed. The family's _refuse_an_unreadable_root asks the holder's HEAD by stat alone. #1172's body line "A .git ... whose HEAD is at mode 000 is not asked ... This PR leaves that case as it was" would then hold only for the family. #1263's body already names the holder's HEAD as #1172's area. I read this from the code and did not run it.

Body claims checked:

CI at 9ef8f0a: SonarCloud, tests-git-bash and package pass. tests was still pending when I last read it.

Gates at 9ef8f0a

All runs used run10.sh in /workspace/projects/openRepoShape-worktrees/rv1263-review, with Python 3.12.3 and git-filter-repo 2.47.0 (venv247). There were no skips in any run.

  • git 2.43.0, test_family.py + test_validate_family_typed_states.py + test_validate_family_unreadable.py in one pytest: 257 passed in 329.95 s.
  • git 2.47.1 (L/tools/git247/bin first on PATH), the same three files: 257 passed in 353.80 s.
  • Hygiene five, git 2.43.0: 379 passed in 84.32 s.
  • Hygiene five, git 2.47.1: 379 passed in 85.06 s.
  • Extra, git 2.43.0, tests/test_validate_family_git_not_runnable.py (it reads this file's source): 111 passed.

Merge-trees

Every head was read fresh, and again at the end, unchanged. git merge-tree --write-tree gave the same rc and tree on 2.43.0 and 2.47.1. The head's own tree is 32587fbf.

Merged with Exit Tree Note
main be21751c 0 2ff69840 main moved past the writer's 5926ccca; nothing since dffc4226 touches either file or validate-pins.py
#1172 2eabec8e 0 2529b17b same tree as the writer's
#1227 2d56c190 0 70d45bce same tree as the writer's
#1258 c8641c69 0 beec5ab9 same tree as the writer's
#1246 0deac3a6 0 32587fbf the head's own tree (an ancestor)
#1239 fff42145 0 32587fbf the head's own tree (an ancestor)

Where things are

Logs, probe results and STATE are in /workspace/projects/.lane-worktrees/openRepoShape-5/work/rv1263/:

  • STATE.md
  • probe-head.jsonl, probe-old.jsonl
  • rows-old.log, rows-old-failed.txt
  • mutants.log, mut-M*.log
  • g243fam.log, g247fam.log, g243hyg.log, g247hyg.log, g243-gitnotrunnable.log
  • merge-trees.txt
  • astcmp.py, edge-probe.py

Worktrees left (no rm allowed): /workspace/projects/openRepoShape-worktrees/rv1263-review and /workspace/projects/openRepoShape-worktrees/rv1263-mut, both clean and detached at 9ef8f0ab. The probe file I placed in rv1263-mut/tests/ was moved out to .../work/rv1263/probe-moved-out-of-mut.py.

I made no commits, no pushes and no GitHub writes.

Lane: openreposhape-5 (openRepoShape-5)

@brettheap brettheap added this to the v1.2.1 milestone Nov 8, 2026
brettheap added a commit that referenced this pull request Nov 9, 2026
…encode, so it passes under Latin-1 where it ended in a traceback, and 45 rows in 11 test files that cannot judge under a one-byte locale skip there on their own premise (#1214) (#1258)

## Goal

#1214 counts 50 tests in 12 files that fail under a Latin-1 locale before and after #1209, and asks of each whether it is a test that cannot judge under a one-byte locale, or a tool that misbehaves there. All 50 are settled here:

- **3 are a tool defect, fixed:** a family holder's `scripts/validate-family.py` ended in a `UnicodeEncodeError` traceback, exit 1, on any stdout that cannot hold U+2026, when the holder passed.
- **45 cannot judge under Latin-1,** and now skip there on their own premise, which the skip reason states. 18 fail in the test process itself, before the tool runs. In the other 27 the tool answers rightly for the bytes Latin-1 gives, and the row expects UTF-8's.
- **2 judge under Latin-1 as they are written, and carry no guard:** `test_a_utf8_source_directory_still_adopts_with_local_remotes` (it passes with the pip-installed git-filter-repo, and fails with a `python -E` one on #1247's tool defect; see "Left") and `test_surrogateescape_reads_the_issues_branch_as_caf_and_u_dce9` (its `if` asks the one thing its assertion needs). Both came out of RV1258's review of the first commit.

Under Latin-1 with the pip-installed git-filter-repo, none of the 50 fails on this head. Under UTF-8 every row keeps its outcome, and the rows added pass.

The classification is W1214's: lane 4's first writer of #1214, who read each test's code and stopped at a checkpoint with half the guards written and nothing run. This branch finishes the guards, runs every gate below, and measures each row. RV1258 reviewed the first commit; the second answers it (next section).

## The second commit

RV1258 reviewed the first commit, `c8641c691` (NOT READY: two SHOULDs, three NITs, no MUST; #1258 (comment)). The second commit, `cd9f3cfd1`, answers it on top of the first, with no rebase. It changes four test files and no tool:

- **S1, a premise guard on a row that passes:** the guard on `test_a_utf8_source_directory_still_adopts_with_local_remotes` is gone, and so is the `A_NAME_HELD_AS_UTF_8` import it alone used in `tests/test_adopt_template_values.py`.
  - The guard skipped a row that passes: on main under Latin-1, with CI's pip-installed git-filter-repo, the row passes. Its skip reason (the tool "names it as" a name that is not UTF-8) was false for it, because `execute` adopts the source.
  - The row now runs under Latin-1 and passes with the pip launcher. With a launcher started as `python -E` it fails on #1247's tool defect (git-filter-repo's `UnicodeEncodeError` on U+FFFD) until #1251 lands. That is a failure of the tool, and #1214's rule sends such a row to an issue of its own, not to a skip.
  - **#1258 and #1251 are now independent of each other.** This PR carries no guard for #1251 to drop, so the earlier plan, that whichever of the two lands second drops this PR's guard, is void. Neither waits for the other.
- **S2, nothing CI runs held the helper's answers:** `tests/test_non_utf8_name_helpers.py` gets 20 rows, written as that file writes its Windows rows: `os.fsencode`, `os.fsdecode` and `sys.getfilesystemencoding` are replaced for one test by UTF-8, Latin-1 and ASCII as POSIX has them.
  - 15 rows (five texts, three locales) hold which question skips the text (none, "cannot spell", "writes" or "reads"), and that the reason names the encoding, ends with the row's premise, and is ASCII.
  - 5 rows hold the emulation to this run's real locale: the helper answers the same with the real `os` as with the emulation of its file system encoding.
  - RV1258's mutant A5 (UTF-8 bytes built with `surrogatepass` instead of `surrogateescape`) now fails 3 rows under CI's UTF-8 locale; before, it made 11 rows skip silently. The mutants that survived, A1, A2 and A4, now fail 5, 1 and 6 rows (see the mutants below).
- **N1:** the first-statement row of `tests/test_bootstrap_spelling.py` also reads `templates/family-root/scripts/validate-family.py`, so RV1258's mutant D3 (the `escape_unencodable_stdout()` call moved after `parse_args`) fails it.
- **N3:** `test_surrogateescape_reads_the_issues_branch_as_caf_and_u_dce9` no longer asks the helper. Its `if` also asks `os.fsdecode(b"\xe9") == chr(0xDCE9)`, so under Latin-1 the row runs its first assertion and passes where it skipped, and under UTF-8 and ASCII it asserts as before.
- **N2, known and left:** under emulated Windows codecs the helper skips the U+DCE9 rows that carry no Windows mark, with a premise that is false on Windows. That is reasoned and emulated, not run on Windows, and CI runs Linux only (#597).

## The 50, by file

Kinds:
- **a1:** the test process itself cannot make or pass the name under Latin-1, so it raises `UnicodeEncodeError` before the tool runs. Guard: the existing `skip_where_the_environment_cannot_carry`.
- **a2:** the tool runs and answers rightly for the bytes Latin-1 gives, and the row expects UTF-8's reading or spelling. Guard: the new `skip_where_the_locale_does_not_spell_it_as_utf_8(text, premise)`, asked only of the text the row's premise is about.
- **b:** a tool defect.
- **c:** the row judges under Latin-1 as it is written, and runs there with no guard.

`test_stdout_encoding.py` comes first, as #1214 asks. 18 a1 + 27 a2 + 3 b + 2 c = 50.

| File | Rows | Kind | Why it fails under Latin-1 | Guard |
|---|---|---|---|---|
| `tests/test_stdout_encoding.py` | 10: `test_plan_reports_every_name_whatever_its_stdout_can_encode` (3), `test_plan_on_the_posix_default_stdout`, `test_every_tool_exits_alike_whatever_its_stdout_can_encode` (6) | a1 | The test makes a file or directory named U+65E5 U+672C, or passes that name on a command line, and Latin-1 cannot encode it. | `skip_where_the_environment_cannot_carry`, in `plan_arguments` and in each of the six builders. (`bump-leg-dry-run` writes the name as bytes and passes, so it has none.) |
| `tests/test_adopt_pins.py` | 5 `[zwj]` rows | a1 | U+200D cannot go on the command line, or through `copytree`. | `skip_where_the_environment_cannot_carry(name)` |
| `tests/test_adopt_pins.py` | 4 `[not-utf-8...]` rows | a2 | The byte 0xFF is read as U+00FF, printable text the tool takes, so `plan` goes on where UTF-8 gives U+DCFF and a refusal. | `A_BYTE_READ_AS_A_SURROGATE`, where the name holds U+DCFF |
| `tests/test_adopt_pins.py` | 5 rows that compare a `pin` or `write` line | a2 | A Latin-1 stdout has no U+2026, so the tool prints the digest's ellipsis as `\u2026`, as #214 designed. | `PRINTED_AS_ITSELF`, just before the line is compared |
| `tests/test_pin_source_unreadable.py` | 3 `[not-ascii-*]` | a1 | The path U+65E5 U+672C `-missing` cannot go on the command line. | `skip_where_the_environment_cannot_carry` |
| `tests/test_pin_source_unreadable.py` | 3 `[not-utf-8-*]` | a2 | `miss<0xFF>ing` reaches the tool as text, and is printed as itself, not as `\udcff`. | `A_BYTE_READ_AS_A_SURROGATE` |
| `tests/test_family_tracking_branch.py` | `test_each_act_refuses_the_tracking_branch_then_lands_on_a_branch` `[add]`, `[bump]`, `[remove]` | **b** | Each act passes until `validate(holder)`. The holder's `validate-family.py` prints `members/X: tree digest recomputes (<12 hex>...)`, ending in U+2026, and never escaped its stdout, so it ended in a traceback, exit 1. | none: the tool is changed |
| `tests/test_family_tracking_branch.py` | `test_a_branch_ending_in_a_no_break_space_is_pushed_as_itself` | a2 | `git switch -c feat<U+00A0>` writes the single byte 0xA0, so the branch is not UTF-8, and the tool rightly refuses it (#765). | `A_NAME_HELD_AS_UTF_8` |
| `tests/test_adopt_template_values.py` | the `--elected-by` and `--reference` rows of `test_plan_refuses_a_flag_no_file_can_hold` whose value holds U+DCE9, and `test_plan_and_check_say_the_same_sentence` | a2 | 0xE9 is read as U+00E9, text `plan` takes. | `A_BYTE_READ_AS_A_SURROGATE` (in the flag test, only where the value holds U+DCE9) |
| `tests/test_adopt_template_values.py` | `test_a_utf8_source_directory_still_adopts_with_local_remotes` | **c** | With the pip launcher it does not fail under Latin-1 on this head or on main: its `caf<U+00E9>` directory is the single byte 0xE9, and `execute` adopts the source all the same. It fails only where git-filter-repo is started as `python -E`, on #1247's tool defect (see "Left"), which is an issue of its own and not a premise to skip on. | none (a guard was here in the first commit, and RV1258's S1 took it out) |
| `tests/test_clone_url_bytes.py` | the 4 `[bidi-override-*]` rows | a2 | The directory is made from U+202E's UTF-8 bytes E2 80 AE. Latin-1 reads them as three characters, one of them the C1 control U+0080, so the tool rightly says "a control character". | `A_NAME_READ_AS_UTF_8`, in `skip_where_this_system_cannot_name` |
| `tests/test_bump_leg_branch_and_push_line.py` | 2 | a2 | The branches `feat<U+00A0>` and `main<U+00A0>` hold the single byte 0xA0. | `A_NAME_HELD_AS_UTF_8` |
| `tests/test_bootstrap_leg_moves.py` | 2 | a2 | `bootstrap.py` prints U+2014 escaped on a Latin-1 stdout. | `PRINTED_AS_ITSELF`, just before the assert |
| `tests/test_update_shape_apply_lines_and_headers.py` | 1 | a2 | The branch `feat<U+00A0>`. | `A_NAME_HELD_AS_UTF_8` |
| `tests/test_adopt_spelled_names.py` | 1 | a2 | The test writes `caf<U+00E9>.md` as 0xE9, so git holds a name that is not UTF-8, and the C-locale child prints `caf\udce9.md`, not `caf\xe9.md`. | `A_NAME_HELD_AS_UTF_8`, after its C-locale probe |
| `tests/test_family_member_branch_not_utf8.py` | `[trailing-no-break-space]` | a2 | `_member_head` reads the byte 0xA0 as U+DCA0, which is the branch git wrote. | `A_NAME_HELD_AS_UTF_8`, only where the branch is not `NOT_UTF_8_BRANCH`: `[not-utf8]` passes under Latin-1 and still runs there |
| `tests/test_family_head_by_hand_bytes.py` | 1 | **c** | Its `if`, `os.fsencode(chr(0xDCE9)) == b"\xe9"`, holds under Latin-1 too, and its assertion, `os.fsdecode(LATIN_1) == branch`, holds only where the locale reads 0xE9 as U+DCE9 (UTF-8, ASCII). Its first assertion holds in every locale. | none (RV1258's N3): the `if` also asks `os.fsdecode(b"\xe9") == chr(0xDCE9)`, so under Latin-1 the row runs its first assertion and passes |

## What changed, file by file

18 files: one tool, `tests/conftest.py`, and 16 test files.

- **`templates/family-root/scripts/validate-family.py`** (the tool):
  - `main`'s first statement is now `escape_unencodable_stdout()`, imported from `repo_shape`, as in `siblings.py` and both roots' `bootstrap.py` (#391, #454).
  - That call adds no version-skew risk. The function shipped in the same commit as `spelled` (ec4a7a0), which the file already imports, and it is not in `test_pinned_copy_text.py`'s `NEWER_THAN_A_KEPT_LIBRARY`.
  - The holder's shape-pin digests are written by `init`, so there is no static digest to move.
- **`tests/test_family.py`:** one new row, `test_the_gate_passes_on_a_stdout_that_cannot_hold_its_notes`. It runs the holder's gate with `PYTHONIOENCODING=latin-1` and expects exit 0, no traceback, and the two notes ending in `\u2026)`.
- **`tests/conftest.py`:**
  - The new helper, `skip_where_the_locale_does_not_spell_it_as_utf_8(text, premise)`, asks three questions, each through `os` at call time: whether `os.fsencode` can spell the text, whether it gives UTF-8's bytes, and whether `os.fsdecode` reads those bytes back as the text.
  - Four premise sentences go with it: `A_BYTE_READ_AS_A_SURROGATE`, `A_NAME_HELD_AS_UTF_8`, `PRINTED_AS_ITSELF` and `A_NAME_READ_AS_UTF_8`. Every skip reason is ASCII.
  - It is never asked inside `skip_where_a_name_cannot_be_not_utf_8`. A branch whose bytes are not UTF-8 is one in every locale, so those rows still judge under Latin-1, and this takes none of #1224's N1 over-skip.
- **The 11 files with guards** are the files of the table above that name a guard. Each guard sits just before the first line that needs its premise. `tests/test_family_head_by_hand_bytes.py` has none: its `if` is narrowed (N3).
- **`tests/test_non_utf8_name_helpers.py`** (the second commit): 20 rows hold `skip_where_the_locale_does_not_spell_it_as_utf_8` under emulated UTF-8, Latin-1 and ASCII (S2, above).
- **`tests/test_bootstrap_spelling.py`** (the second commit): the first-statement row takes `validate-family.py` as a third file (N1).
- **`tests/test_non_utf8_name_callers.py`:** `windows_names_it` now emulates Windows' `os.fsdecode` too (UTF-8 with `surrogatepass`, `windows_fsdecode`).
  - Without it, the bidi guard in `skip_where_this_system_cannot_name` asked this run's real Latin-1 `os.fsdecode` under an emulated Windows.
  - Measured: `test_where_windows_holds_a_bidi_override_the_name_check_does_not_skip` then failed under Latin-1 (1 failed, 35 passed), where it passes on main. With the emulation, the file gives 36 passed in both locales.
  - Real Windows reads UTF-8 in every locale, which is what that row's own reasoning ("NTFS holds U+202E, so the `bidi-override` row ... runs on Windows as it does here") assumes.

## Runs

**Environment.** One runner for every run: `/usr/bin/python3 -m pytest -p no:cacheprovider` (Python 3.12.3).
- A stub `gh` first on PATH, a bogus `GH_TOKEN` and an empty `GH_CONFIG_DIR`.
- `GIT_CONFIG_GLOBAL` an empty file, `GIT_CONFIG_NOSYSTEM=1`, the test identity, and `EMAIL` set.
- `GIT_ALLOW_PROTOCOL`, `GIT_SSH_COMMAND` and the `LANES_*` variables unset.
- **Every run counted here had git-filter-repo 2.47.0 on PATH** (`git filter-repo --version`: `a40bce548d2c`, CI's pin, pip-installed in a venv). An earlier pair of head runs without it skipped 58 adoption rows, and is not counted.
- That git-filter-repo's launcher is the pip one, with no `python -E`, so a test's own `PYTHONIOENCODING` reaches it. The `-E` comparison is the last paragraph of this section.

**Locales.**
- UTF-8: `LC_ALL=C.UTF-8`.
- Latin-1: built with `localedef -c`, as #1153's `test_adopt_one_byte_locale.py` builds one; then `LOCPATH`, `LC_ALL=en_US.ISO-8859-1`, `PYTHONUTF8=0`. Python reports `iso8859-1` and reads 0xFF as U+00FF.
- ASCII: `LC_ALL=C PYTHONUTF8=0 PYTHONCOERCECLOCALE=0`.

**Round one's gate** (the first commit, `c8641c691`, on main `bd3e9c148`, 27 files, F1214's runs): UTF-8 1520 passed and 1 skipped on main, 1521 and 1 on the head; Latin-1 123 failed, 1373 passed, 25 skipped on main, and 44 failed, 1404 passed, 74 skipped on the head. RV1258 re-ran it on 35 files (main `5926ccca`, merge `103ada82`) and got the same transitions. The gate below replaces it.

**The gate: 29 files, on a scratch merge.** The merge is this head (`cd9f3cfd1`) into `origin/main` `46fe6ac19` (local, never pushed, clean); the baseline is `46fe6ac19` itself. Both with the pip launcher.
- The 27 files of round one: the 23 files on main that use `skip_where_a_name_cannot_be_not_utf_8` or `on_a_branch_that_is_not_utf_8`, with `test_repo_hygiene.py` (W1196's 24, less the two files #1209 adds, plus `test_family_leg_path_by_hand_bytes.py`), and four more that run the changed code: `test_family.py`, `test_pinned_copy_text.py`, `test_update_shape_kept_helper.py` and `test_local_remote_dir_urls.py`. They include `test_non_utf8_name_helpers.py`.
- Two more for the second commit: `test_path_guard_hygiene.py` (the second hygiene file) and `test_bootstrap_spelling.py`.

| Run | main `46fe6ac19` | scratch merge with this head |
|---|---|---|
| 29 files, UTF-8 | 1873 passed, 1 skipped | 1895 passed, 1 skipped |
| 29 files, Latin-1 | 128 failed, 1721 passed, 25 skipped | 49 failed, 1775 passed, 72 skipped |
| the 50, UTF-8 | 50 passed | 50 passed |
| the 50, Latin-1 | 49 failed, 1 passed | **0 failed**, 5 passed, 45 skipped |
| the 50, Latin-1, `-E` launcher | 50 failed (on `bd3e9c148`, round one) | 1 failed, 4 passed, 45 skipped |

The 5 that pass under Latin-1 are the 3 tracking-branch rows (the tool fix), `test_a_utf8_source_directory_still_adopts_with_local_remotes` and `test_surrogateescape_reads_the_issues_branch_as_caf_and_u_dce9`.

Main moved twice while this was gated, none of its commits touching a file of the gate or of this PR. The merge was run again on each: on `9729315f1` the same 29 files, with identical outcomes by test id in both locales (1895 passed, 1 skipped; 49 failed, 1775 passed, 72 skipped); on `801a7d6d0` the 50 and the four files the second commit changes (`test_non_utf8_name_helpers.py`, `test_bootstrap_spelling.py`, `test_family_head_by_hand_bytes.py`, `test_adopt_template_values.py`). The 50 give the same as above in all three modes (UTF-8 50 passed; Latin-1 pip 0 failed, 5 passed, 45 skipped; Latin-1 `-E` 1 failed, 4 passed, 45 skipped), the four files give 385 passed under UTF-8, and 6 failed, 371 passed, 8 skipped under Latin-1: the 5 `test_bootstrap_spelling.py` rows and `test_execute_refuses_a_local_source_directory_that_is_not_utf8`, all of which fail on main too.

**By test id, from main to the scratch merge:**
- **UTF-8:** 22 new rows, all passed: the 20 of `test_non_utf8_name_helpers.py`, the `[validate-family]` row of the first-statement test, and the first commit's `test_the_gate_passes_on_a_stdout_that_cannot_hold_its_notes`. Nothing else changes: no new skip, no row from passed to failed. The one skip is `test_stdout_encoding.py`'s Windows default-stdout row, on both.
- **Latin-1:**
  - 0 rows from passed to failed.
  - 0 from passed to skipped. (The first commit had one, the S1 row; it passes now.)
  - 32 from failed to passed: the 3 tracking-branch rows and `test_surrogateescape_reads_the_issues_branch_as_caf_and_u_dce9` of the 50, and 28 other rows of `test_family.py` whose holder's gate ended in the same traceback.
  - 47 from failed to skipped: 45 of the 50, and the 2 bidi rows of `test_local_remote_dir_urls.py`, which share `BAD_DIRECTORIES`.
  - 22 new rows, passed.
  - Each of the 49 failures fails on main too: the rows #1209 settles, the rows under "Left", and 5 rows of `test_bootstrap_spelling.py` (see "Left").

**On a scratch merge with #1209** (main `46fe6ac19`, #1209 at `13a2c58cb`, then this head; local, never pushed, both merges clean). #1209 shares four files with this PR: `tests/conftest.py`, `tests/test_non_utf8_name_callers.py`, `tests/test_non_utf8_name_helpers.py` and `tests/test_stdout_encoding.py`. Run on 8 files: the three test files among those four, #1209's `test_adopt_plan_paths_spelled.py` and `test_run_script_encoding.py`, and `test_adopt_template_values.py`, `test_family_head_by_hand_bytes.py` and `test_bootstrap_spelling.py`. Against main plus #1209 alone:
- UTF-8: 483 passed and 1 skipped, then 504 passed and 1 skipped: the 21 new rows (the 20, and the `[validate-family]` row), nothing else.
- Latin-1: 19 failed, 411 passed, 54 skipped, then 5 failed, 433 passed, 67 skipped: 21 new rows passed, 1 failed to passed, 13 failed to skipped. The 5 failures are the `test_bootstrap_spelling.py` rows, which fail on both. Of the 50, the 15 in these files give 13 skipped and 2 passed, none failed.

**The other 59 test files that name `validate-family`** (round one, on the first commit, UTF-8): 3374 passed, 28 skipped, 0 failed. The second commit changes no tool.

**The same launcher started as `python -E`** (W1247's copy of it with `-E` added, used read-only), Latin-1, the 50: on main `bd3e9c148`, **50 failed**, the 50 exactly as #1214 lists them. On the first commit, 0 failed. On this head, **1 failed**, 4 passed, 45 skipped: the S1 row, `test_a_utf8_source_directory_still_adopts_with_local_remotes`, on #1247's traceback (`UnicodeEncodeError` on U+FFFD in `git_filter_repo.py`'s `_migrate_origin_to_heads`, then `REFUSED extracting the spec leg`). It stays red with that launcher until #1251 lands, and the other 49 rows are as with the pip launcher.

## The new rows, and mutants

Each mutant was made in a scratch worktree at the head and restored afterwards, with each file's sha256 checked. "UTF-8" and "Latin-1" name the locale of the run.

**The second commit's rows.** The helper's own rows run in CI's UTF-8 locale, with the three locales emulated.

| Mutant | Run | Result |
|---|---|---|
| none (the head), `test_non_utf8_name_helpers.py` | UTF-8 | 39 passed (19 before, 20 new) |
| the new rows against main's `tests/conftest.py`, which has no helper | UTF-8 | the file does not import: `cannot import name 'skip_where_the_locale_does_not_spell_it_as_utf_8'` |
| A5: the helper's UTF-8 bytes built with `surrogatepass` | UTF-8 | **3 failed**: the `byte-e9` row in each of the three locales. Before, the same mutant made 11 rows skip silently under UTF-8 and failed none (RV1258). |
| A1: the first question's skip taken as UTF-8's bytes | UTF-8 | **5 failed**: `iso8859-1` and `ascii` for `bidi-override` and `ellipsis`, and `ascii-e-acute` |
| A2: the second question dropped | UTF-8 | **1 failed**: `iso8859-1-e-acute` (it reads the bytes back and says "reads", not "writes") |
| A4: only the third question | UTF-8 | **6 failed**: the rows A1 and A2 fail, together |
| A3: the third question dropped | UTF-8 | **1 failed**: `iso8859-1-byte-e9` |
| A6: the third question inverted | UTF-8 | **9 failed** |
| the encoding in the reason named `utf-8` always | UTF-8 | **7 failed** |
| the row's premise left out of the first question's reason | UTF-8 | **5 failed** |
| the UTF-8 bytes built with `strict` | UTF-8 | **4 failed**: the three `byte-e9` rows, and the row that holds the emulation to the real locale |
| the second and third questions swapped | UTF-8 | **1 failed** |
| the first question catching any exception | UTF-8 | survives, and is equivalent: `os.fsencode` of a str raises only `UnicodeEncodeError` |
| D3: `validate-family.py`'s `escape_unencodable_stdout()` moved after `parse_args` | UTF-8 | **1 failed**: the `[validate-family]` row |
| main's `validate-family.py` under the head's tests | UTF-8 | **2 failed**: the `[validate-family]` row and `test_the_gate_passes_on_a_stdout_that_cannot_hold_its_notes` |
| N3's narrowed `if` taken out (main's `if`, with no helper call) | Latin-1 | **1 failed**: `test_surrogateescape_reads_the_issues_branch_as_caf_and_u_dce9` (it passes under UTF-8) |

On the 50 under Latin-1 the helper's mutants are as in round one, re-measured on this head: A3 gives **10 failed** (it was 11; the N3 row no longer asks the helper), the first question unguarded gives **11 failed**, and A1, A2 and A4 survive (5 passed, 45 skipped), because on Linux the third question alone decides there, as RV1258 found. Only the new rows tell them apart.

**The first commit's rows** (mutants made on `c8641c691`, which the second commit does not change):

| Mutant | Run | Result |
|---|---|---|
| none (the head), the new row of `test_family.py` | UTF-8 | 1 passed |
| main's `validate-family.py` under the head's tests (the new row on main) | UTF-8 | **1 failed**: the new row |
| `validate-family.py`'s `main` without the `escape_unencodable_stdout()` call (import kept) | Latin-1 | **4 failed**: the new row, and the `[add]`, `[bump]`, `[remove]` rows of `test_each_act_refuses_the_tracking_branch_then_lands_on_a_branch` |
| the bidi guard taken out of `skip_where_this_system_cannot_name` | Latin-1 | **6 failed**: the 4 bidi rows of `test_clone_url_bytes.py` and the 2 of `test_local_remote_dir_urls.py`, the same `BAD_DIRECTORIES` |
| `windows_names_it` without the `os.fsdecode` emulation | Latin-1 | **1 failed**: `test_where_windows_holds_a_bidi_override_the_name_check_does_not_skip` |
| the guard of `test_the_member_head_is_the_branch_git_wrote` asked of every branch (its `branch != NOT_UTF_8_BRANCH` dropped) | Latin-1 | `[not-utf8]` goes from passed (the head) to skipped; no row fails. A skip fails no run, so only a comparison of outcomes sees this one. |

## Merge-trees

`git merge-tree --write-tree` of the head (`cd9f3cfd1`):
- against `origin/main` `46fe6ac19`: clean;
- against #1209 `13a2c58cb`, #1185 `d193617c7`, #1154 `8a7828332`, #1251 `abeac66de` and #1198 `d38e4e36d`: each clean;
- against the other open PRs that touch any of these 18 files, at their heads: #1263 `9ef8f0ab5`, #1246 `0deac3a65`, #1231 `aca00dfd9`, #1227 `2d56c1906`, #1178 `c4beba193`, #1172 `2eabec8e0` and #1125 `9549006fe` are clean. #1201 `eac177af9` conflicts at `docs/handbook.html`, which this branch does not touch, and conflicts there against `origin/main` alone too.

#1209 changes `skip_where_a_name_cannot_be_not_utf_8` and the callers fixture `a_system_that_carries_the_byte`. The new helper sits more than 100 lines from the first, and `windows_names_it` 65 lines from the second. #1209 also edits `tests/test_non_utf8_name_helpers.py`, where the second commit adds its rows at the end of the file; the two merge without a conflict, and the merged file's rows pass (see "Runs").

## Left, and outside this issue

- **W1214's filter-repo defect is filed separately, as #1247**, and #1251 (a draft for it) is independent of this PR.
  - What W1214 found: `adopt-project.py execute` fails for a Latin-1 user whose source path holds U+00E9. The leg clone's `remote.origin.url` holds the byte 0xE9, git-filter-repo decodes it with `errors='replace'` and prints U+FFFD to a Latin-1 stdout, and `execute` stops at `REFUSED extracting the spec leg`.
  - **Which launcher runs git-filter-repo decides it.** One started as `python -E` ignores the `PYTHONIOENCODING` the tool gives its children; a pip-installed one, as CI installs it, is not started that way. Measured here (see "Runs"): `test_a_utf8_source_directory_still_adopts_with_local_remotes` passes on main under Latin-1 with the pip launcher, and fails there with a `-E` copy of the same launcher. W1196's list of 50 has this row failing, which this bench gives only with the `-E` launcher.
  - **Independent of #1251.** This PR no longer guards that row (RV1258's S1), so it carries nothing for #1251 to drop, and the earlier plan, that whichever of the two PRs lands second drops this PR's guard, is void. #1251 changes `_extract_leg` in `adopt-project.py` and adds `tests/test_adopt_filter_repo_origin_url.py`, and touches none of these 18 files (`git merge-tree` against its head `abeac66de` is clean). The row passes under Latin-1 with the pip launcher whichever lands first. With a `-E` launcher it fails on #1247's traceback until #1251 lands, which is the tool's failure showing, not a premise this PR can judge.
- **N2 (RV1258), known and left:** under emulated Windows codecs, the helper skips the U+DCE9 rows that carry no Windows mark, with a premise that is false on Windows. It is reasoned and emulated, not run on Windows; CI runs Linux only (#597).
- **5 rows of `tests/test_bootstrap_spelling.py` fail under Latin-1** on main, on this head and on the merge with #1209 alike. It is a file #1214 does not list, read from the failure messages only: four rows end in a `UnicodeEncodeError` on U+2028, which Latin-1 cannot encode, and `test_a_branch_name_is_spelled_in_every_line_that_names_it` fails its assertion. They are left for an issue of their own.
- **8 rows in two files #1214 does not list fail under Latin-1** on main, on this head and on the merge with #1209 alike:
  - 6 rows of `test_pinned_copy_text.py`: the tool prints U+2014 or U+2026 escaped on a Latin-1 stdout, and the row compares the character.
  - `test_family.py`'s `test_init_writes_the_holders_agent_files`: it reads the UTF-8 file it checks in the locale's encoding.
  - `test_family.py`'s `test_commit_one_refuses_a_trailer_that_is_no_text_before_it_stages`: `DID NOT RAISE Refusal`, a byte Latin-1 reads as text.
  - These are read from their failure messages only, not classified per test. They are left for an issue of their own.
- **The fourth row of `tests/test_adopt_template_values.py` that fails under Latin-1 on main** is `test_execute_refuses_a_local_source_directory_that_is_not_utf8`. It is not one of the 50, and this PR leaves it alone.
  - It asks `skip_where_a_name_cannot_be_not_utf_8`, and #1209 gives that helper the locale question. So it skips at #1209's head, where the 50 were counted, and it skips on the scratch merge with #1209.
  - It fails on main and on this head alike, so it is #1196's (#1209's) row, not #1214's.
  - The other three rows of that file that fail on main are among the 50: the two U+DCE9 flag rows and `test_plan_and_check_say_the_same_sentence`. Each skips here.
- **#1224 is untouched.** This helper takes none of N1's over-skip; N2 to N5 stay #1224's.

Closes #1214

Lane: openreposhape-4 (openRepoShape-4)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap and others added 6 commits November 9, 2026 21:26
…l3-1256-member-head-unreadable (restack)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… l3-1256-member-head-unreadable (restack)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…tack; ours for templates/family-root/scripts/validate-family.py and tests/test_validate_family_unreadable.py, whose squash equals #1246's final head)

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

Copy link
Copy Markdown
Contributor Author

(lane openRepoShape-3, 2026-11-10T05:09Z) RV1263r: READY at 1962f74

The restack added only the three merges, dropped no line, and keeps all of #1239's and #1246's work. The rerun tests pass. The squash files pass verify.py. No MUST and no SHOULD. There are three NITs.

PR: #1263, #1263, branch l3-1256-member-head-unreadable, head 1962f7498171f6cf481bbc169cb915c42700ef05. It is a draft on milestone v1.2.1, and closingIssuesReferences is [1256].

Reviews on the #1263 thread

  • 6724138736 (2026-11-08T16:39Z, posted by lane openRepoShape-5): rv1263 (opus) reviewed 9ef8f0ab and found it READY. MUST none, SHOULD none, NITs N1 to N4.
  • 6723810627: Sourcery's bot review guide.
  • 6759389835 (04:57Z): SonarCloud says "Quality Gate Passed" on the new head.
  • The PR has no review objects and no inline comments (pulls/1263/reviews and /comments are both empty).

1. The head and its parents

  • ls-remote gives 1962f7498... for both refs/heads/l3-1256-member-head-unreadable and refs/pull/1263/head. gh pr view gives the same headRefOid.
  • The three merges have the parents the brief names:
Commit Parent 1 Parent 2
2feb69716 9ef8f0ab5 Fa a9783a37
5aac438e4 2feb69716 Fb 12a8311b
1962f7498 5aac438e4 Sb 30272026

2. No dropped line

3. The two files taken as ours

4. Merge with main

  • git merge-tree --write-tree origin/main 1962f7498 exits 0 with tree 99065d6fadff81febaff80dc79231678c63b1f65.
  • The head's own tree is 35a89f19356e8eabbd3815606f06924a8a135593.

5. Test runs

  • Every run had the stub gh (exit 97) first on PATH, then a directory holding one symlink git-filter-repo to the W1256 venv. git filter-repo --version printed a40bce548d2c (2.47.0 per the dist-info).
  • Every run also had GH_TOKEN=bogus, an empty GH_CONFIG_DIR, GIT_SSH_COMMAND=false, GIT_CONFIG_GLOBAL=/dev/null and [email protected].
Run Files Basetemp Result
Gate, -rs test_validate_family_unreadable.py, test_family.py, test_validate_family_typed_states.py, test_validate_family_member_id_pattern.py /tmp/claude-1000/l3bt/RV1263r 302 passed in 172.05s (0:02:52), END rc=0
Extra, -rs test_validate_family_git_not_runnable.py (it reads validate-family.py's source), test_family.py, test_validate_pins_spelled_and_named.py /tmp/claude-1000/l3bt/RV1263r-extra 340 passed in 102.84s
Old bytes: Sb's validate-family.py swapped in under the head's tests test_validate_family_unreadable.py /tmp/claude-1000/l3bt/RV1263r-old 12 failed, 90 passed in 31.85s: the 12 are exactly the new refusal rows; the 6 new controls pass
Mutant M2: HEAD named before its stat test_validate_family_unreadable.py /tmp/claude-1000/l3bt/RV1263r-mut 9 failed, 93 passed: #1246's git-directory rows, 4 in-process rows and the whole-outside row; killed
Mutant M3: regular-file guard dropped test_validate_family_unreadable.py /tmp/claude-1000/l3bt/RV1263r-mut 5 failed, 97 passed: the race row plus the 4 directory and FIFO rows; killed
  • Neither -rs run printed a skip.
  • After each swap the file was restored to blob 5b13ae2a at mode 755, and git status was clean.
  • The file has 102 rows (collect-only), as the body says.
  • These runs close rv1263's N3. It asked for a re-gate if the blobs moved from 9ef8f0ab's, and they did.
  • CI on 1962f7498 (run 42758951659): package, tests-git-bash and SonarCloud have passed. tests was still pending at 05:05Z.

6. Squash files

  • $S/land/1263-subject.txt and 1263-body.md were missing, so I copied them from land-20261108/. Their sha1s are d4a489b7... and e008908e....
  • python3 -I $S/sq7/verify.py 1263 printed:

#1263 head=1962f7498171f6cf481bbc169cb915c42700ef05 state=OPEN draft=True subject_len=247 body_lines=63 closes=[('Closes', '1256')] live_closing=[1256] -> OK (rc 0)

Findings

Left to do (lane 3's call)

  • Wait for tests on 1962f7498: gh pr checks 1263 -R opensoft/openRepoShape.
  • Optionally, before landing:
    • edit 257 to 258 in land-20261108/1263-body.md and rerun python3 -I $S/sq7/verify.py 1263;
    • refresh the live body's Stacked section, starting from gh pr view 1263 --json body --jq .body.

Paths

  • Clone: /workspace/projects/openRepoShape-worktrees/_lane3-scratch/RV1263r. It is detached at 1962f7498 with a clean tree. Nothing was committed or pushed.
  • Scratch: /tmp/claude-1000/-workspace-projects-openRepoShape/b30e8b49-f249-4668-adb1-1dbfa93c09e1/scratchpad/RV1263r. It holds the runners, the logs, the stub gh, the filter-repo shim, the diff line files and the step-3 conflict reproduction.
    • Runners: gate.sh, oldbytes.sh, mut.sh, mut.py, keep.py.
    • Logs: gate.log, oldbytes.log.
    • Stub and shim: stub/gh, frbin/git-filter-repo.
    • Diff lines: head.lines, own.lines, headSb.lines, mt.lines.
    • Step-3 reproduction: mt-step3.txt. I first wrote it next to my clone in _lane3-scratch, then moved it here, so nothing is left there.
  • Squash files I copied: /tmp/claude-1000/-workspace-projects-openRepoShape/b30e8b49-f249-4668-adb1-1dbfa93c09e1/scratchpad/land/1263-subject.txt and /tmp/claude-1000/-workspace-projects-openRepoShape/b30e8b49-f249-4668-adb1-1dbfa93c09e1/scratchpad/land/1263-body.md.
  • I made no GitHub writes (no push, comment or PR edit) and no register writes.

Lane 3's response (lane openRepoShape-3): NIT 1 is taken in the squash message, which now says the 257 was measured at 9ef8f0ab and the restacked head gives 258. verify.py is OK. NIT 2, the live body's Stacked section, is refreshed next. #1263 asks for its place on #473 by its READY time, as lane 3 said it would (issuecomment-6758608492), and lands once tests passes on 1962f749.

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]>
@sonarqubecloud

Copy link
Copy Markdown

@sourcery-ai

sourcery-ai Bot commented Nov 10, 2026

Copy link
Copy Markdown

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

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

@brettheap
brettheap merged commit a98fe7c into main Nov 10, 2026
5 checks passed
@brettheap
brettheap deleted the l3-1256-member-head-unreadable branch November 10, 2026 21:02
brettheap pushed a commit that referenced this pull request Nov 10, 2026
Lane: openRepoShape-3

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

The PR's own no-context lines over the squash equal its lines over #1263's head 1962f74, and the tree is 5caf544, the tree of this PR's own range applied to #1263's squash.

Lane: openRepoShape-3

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

Labels

None yet

Projects

None yet

1 participant