Skip to content

repo_shape.py: load_yaml's three refusals and policy-unreadable name the file as shown_path does, and validate-pins.py, family.py and shape-doctor.py read either spelling (#1168) - #1274

Merged
brettheap merged 3 commits into
mainfrom
fix/1168-load-yaml-shown
Nov 10, 2026
Merged

brettheap merged 3 commits into
mainfrom
fix/1168-load-yaml-shown

Conversation

@brettheap

@brettheap brettheap commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Goal

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.

What held on main (measured)

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.

What changed

  • 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 (scripts/repo_shape.py load_yaml catches OSError and YamlError but not UnicodeDecodeError, so a plan or manifest holding a non-UTF-8 byte makes adopt-project.py check and execute exit 1 with a traceback instead of REFUSED yaml-unreadable #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.

The version mix

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 51a9c5f10:..., 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.

Two styles in one tool

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.

Rows, and what they do on main

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.

Mutants

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

Runs

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.

Merges

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.

Review round (rv1274, rv1274b)

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):

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.

Limits

Closes #1168

Lane: openreposhape-5 (openRepoShape-5)

🤖 Generated with Claude Code

Summary by Sourcery

Use safe path rendering for YAML-related refusals and make all affected readers accept both legacy raw and new rendered path formats.

Bug Fixes:

  • Sanitize YAML and naming-policy refusal paths with shown_path so unsafe characters cannot reach terminal output raw while printable paths remain unchanged.
  • Keep path-based readers compatible with both current and older refusal path spellings across pin validation, family handling, and shape diagnostics.

Enhancements:

  • Update diagnostics to consistently identify affected files and preserve relative-path behavior across mixed-version shape copies.

Tests:

  • Add comprehensive coverage for unsafe, printable, relative, and mixed-version paths across YAML refusals, policy loading, command-line tools, and downstream readers.

…ame the file as `shown_path` does, so a U+202E, an ESC or a line feed in a typed path is spelled, and validate-pins.py, family.py and shape-doctor.py read either spelling (#1168)

`load_yaml` named the file with the bare `{path}` in `yaml-unreadable`
(twice) and `yaml-unparsable`, so a bidi override, an ESC or a line feed in
a `--plan`, `--path-policy`, `--policy`, `--project` or `--root` path
reached the terminal raw from `adopt-project.py check` and `plan`,
`validate-repository-naming.py`, `bump-leg.py`, `family.py bump`,
`update-shape.py check` and `validate-manifest.py`. Each now names it as
`shown_path` does: `repr` for a path that is not printable, byte for byte
for one that is. `policy-unreadable`, the next line of `NamingPolicy.load`,
does the same.

Every reader that finds the path at the start of the detail by its text
asks both the spelled and the raw prefix, so it reads a `repo_shape.py`
from before this change or after it: `validate-pins.py`'s `_load` (a root
re-copies its pinned files one row at a time), `family.py`'s member
manifest (the swap to `<repo> @ <commit>:project.yaml`), and in
`shape-doctor.py` `naming_script_refusal` and the `manifest-kinds` row's
`less_the_path`. `link_declarations`' own swap is unchanged and reads as
it did.

Rows: tests/test_load_yaml_refusals.py.

Closes #1168

Lane: openreposhape-5 (openRepoShape-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@brettheap brettheap added this to the v1.2.1 milestone Nov 8, 2026
@sourcery-ai

sourcery-ai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

API

Make load_yaml and NamingPolicy.load spell unsafe paths in refusal details while preserving printable paths and the existing refusal wording.

  • scripts/repo_shape.py L1340-1351, L1356-1360 (+2 small edits)

Uses of the API

Keep refusal-detail readers compatible with both the new displayed path and the older raw path, including when shape copies are at different versions.

  • scripts/family.py L1127-1133
  • shape-doctor.py L2763-2774, L4335-4346, L4482
  • templates/assembly-root/scripts/validate-pins.py L668-676, L683-688

Tests

Add coverage for unsafe and printable paths, affected tools, mixed-version readers, and relative typed paths while retaining the existing refusal tests.

  • tests/test_load_yaml_refusals.py L20-31, L36-51, L126-578

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

Independent review of #1274 (#1168) for lane openRepoShape-5, by rv1274b (opus), at e39b5d7: READY

I continued rv1274's review from its checkpoint (2026-11-08T21:24Z) and did not repeat what it had measured. Every gate it left is now done and green. There is no MUST. One SHOULD and some NITs remain, each on my own evidence. Nothing was committed, pushed or written to GitHub; the only GitHub calls were gh pr view, gh pr list, gh issue view and gh issue list.

Fresh reads

Findings

The five items R22 asks me to judge, re-checked against main 8e6f53268

  1. Scope: no reader is left. Main gained one commit since rv1274's base, adopt-project.py: execute unsets the leg clone's remote.origin.url before git filter-repo, so under a Latin-1 locale a source under a directory named with the byte 0xE9 is extracted, where filter-repo died printing that url as U+FFFD, and every branch of the source is still rewritten as before (#1247) #1251 (adopt-project.py and tests/test_adopt_filter_repo_origin_url.py), and it reads no load_yaml detail. My grep of every shipped .py (tests excluded) in the predicted merge 25cc03916 finds exactly these detail-by-text readers:

    • family.py:1132-1133
    • repo_shape.py:3374 (link_declarations, which now swaps nothing)
    • shape-doctor.py:2774 and :4264
    • validate-pins.py:669

    All five are in the PR. The other hits read something else: bump-leg:2214 (ROLLED_BACK), naming :600 (how), shape_materialize:3731 (a pin-source reason; that file calls no load_yaml).

  2. The version mix: the third order (an older gate beside this library) is acceptable for v1.2.1. It names the whole spelled path, nothing raw, and the body lists it under Limits.

  3. The gate's own _shown (validate-pins.py:1518) has the same body as shown_path, so M15 is equivalent.

  4. Two styles in one tool: the difference is quote marks only. It is acceptable and stated in the body.

  5. Shape copies: the tree holds one copy each of repo_shape.py and validate-pins.py. Neither the old nor the new blob id or sha256 of either file is stored anywhere at e39b5d7e3.

rv1274's numbers my verdict uses (read from its logs, not re-run):

  • Swaps: 33+8=41 with main's four files, 41 with repo_shape.py alone, 6 validate-pins.py, 3 family.py, 9 doctor. These match the body.
  • Mutants: the verdict lines for M1-M17 and its own X1-X8 match the body's table; M15, M16 and X5 survive. Every restore was checked by sha256.

Gates at e39b5d7e3 (Python 3.12.3; git-filter-repo a40bce548d2c, the venv's 2.47.0, which is CI's pin; one run per chunk of at most 100 ids; every chunk's testcase count equals its id count)

run git result
Writer's 53-file list, fresh collect: 46 chunks in REV (13:31:03Z-14:17:08Z) 2.43.0 (/usr/bin/git) 4,591 ids: 4,579 passed, 12 skipped, 0 failed. Same counts as the body gives for 0e5f95db5.
Targeted gate, 2,081 ids (t247-00..07 by rv1274: 798 passed, 2 skipped; t247-08..20 by me in MUT: 1,278 passed, 3 skipped) 2.47.1 (L/tools/git247/bin/git) 2,076 passed, 5 skipped, 0 failed
Extras x243-00..15 (18 files) 2.43.0 1,504 passed
Extras y243-00..04 (bootstrap_spelling, family_members_not_a_list, legs_not_a_list) 2.43.0 474 passed
Predicted merge 25cc03916 (#1274 on main 8e6f53268), in MUT: the 109 rows, #1251's new test file (5), test_pinned_copy_text (87), test_family_py_unreadable (75) 2.43.0 276 passed, 0 failed. MUT was returned to e39b5d7e3 and the five files' sha256 checked.

The skips, by name:

  • On 2.43.0 (12):
    • test_adopt_root_symlinks.py:1960, :2015 and :2596: reftable needs git 2.45.
    • test_family_operation_reftable.py:393 (3) and :437 (1): reftable needs git 2.45.
    • test_no_auto_maintenance.py:222 (2): the session's GIT_CONFIG_GLOBAL.
    • test_shape_doctor.py:10516 (3): the PowerShell line is printed only on Windows.
  • On 2.47.1 (5): test_no_auto_maintenance.py:222 (2) and test_shape_doctor.py:10516 (3).

Merge-trees (git 2.47.1, objects only, 13:32Z; heads from a fresh gh pr list; all ten named heads are unchanged from rv1274's reads)

with head result
main 8e6f53268 clean, tree a8b57c3ba; predicted merge commit 25cc03916 (unreferenced)
#1266, #1171, #1249, #1177, #1263, #1248, #1239, #1172, #1269, #1201 09697e9c5, 8162b874e, 3146c3ca5, 5208e874e, 9ef8f0ab5, 1b747f7ab, fff421456, bbe5b414e, c792615f4, 24b6a0af6 clean against #1274's head and against main+#1274
#1269's local -wip head 52e5c1883 clean
#1264 (scripts/family.py) 43d2e8b26 Conflicts in docs/handbook.html (#1274 does not touch it). Against main alone it also conflicts in family.py and four tests. Its five family.py conflict blocks are identical with and without #1274 (mt1264/diff.txt), so this is #1264's own skew; it is stacked on #1201.
#1164 (scripts/family.py) 74096eb47 Conflicts in tests/test_path_guard_hygiene.py, against main alone too

State

  • I followed LAST STEP (14:15Z): nothing new started after it, and chain A finished at 14:17:08Z.
  • REV and MUT are both detached at e39b5d7e3, git status --porcelain empty, and no rv1274b process is left.
  • The scratch commit 25cc03916 is unreferenced. Basetemps are left under L/tools/bt/rv1274b-* (no rm).
  • Two process slips, both caught and voided: the first chain launch passed relative chunk paths and ran nothing (logs/chain?-relpath-void.log). Some STATE.md times before 13:44Z are estimates.

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

  • STATE.md
  • logs/chainA.log, logs/chainB.log, logs/pm-chain.log
  • chunks/ (one log and junit file per chunk)
  • junit_sum.py
  • merge-trees.txt, mt1264/
  • probes/probe-notmap-head.log
  • checks-1274.json, open-prs.json, issue-1168.json, followup-search.txt

Lane: openreposhape-5 (openRepoShape-5)

…l runs in is named as typed and spelled by `adopt-project.py check --plan`, and `_load`'s row builds its file before, not inside, `pytest.raises` (#1168)

rv1274 and rv1274b found two things in the rows of #1274, each with no
change to production code.

Every tool row typed its path under `tmp_path`, which is absolute, so a
`load_yaml` that named `Path(path).absolute()` (rv1274's X5) passed all of
them. The new row, `test_a_path_typed_relative_is_named_as_typed_and_spelled`
(U+202E, ESC and a line feed), types `<name>/adoption-plan.yaml` and runs
`adopt-project.py check --plan` with that folder's parent as the working
directory: the refusal names the path as typed, still relative, as `repr`
spells it.

SonarCloud python:S5778 (MAJOR) flagged `unparsable(root / "project.yaml")`
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 ids and verdicts are the same.

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

brettheap commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Re-check of #1274 (#1168) for lane openRepoShape-5, by rv1274c (sonnet), at 136b38d: READY

Every check in R24 came out as the body and the commit say. I found no MUT, SHOULD or NIT. I committed, pushed and wrote nothing to GitHub. My only GitHub calls were gh pr view, gh pr list and gh issue view. The Sonar calls were reads.

Open at 16:37Z: the PR's CI tests job is still IN_PROGRESS (started about 16:26Z). tests-git-bash, package and SonarCloud Code Analysis have passed.

Fresh reads (16:29Z to 16:37Z)

Findings

  1. Nothing else changed. git diff --stat e39b5d7e3..136b38d12 gives one file, tests/test_load_yaml_refusals.py (+22/-1), and no production file.

    • It is one commit, a fast-forward from e39b5d7e3, by Brett Heap <[email protected]>.
    • The subject is 222 characters and the whole message is ASCII.
    • It has no Closes line, no Sonnet-forbidden content, and carries the Lane and Co-Authored-By lines.
  2. NIT 3, the S5778 hoist.

    • By AST, the one with pytest.raises(Refusal) in test_the_gates_load_takes_either_prefix now holds only gate._load(root, manifest).
    • manifest = unparsable(root / "project.yaml") is built before the block.
    • All five pytest.raises blocks in the file hold exactly one call.
    • The row's 8 ids pass on both gits, with the same ids and verdicts as e39b5d7e3 (from rv1274 and rv1274b's junit).
    • M5 and M6 still kill it. M5 fails the 3 older-library _load ids (6 of 112 fail in all). M6 fails the 3 this-library ones (6 of 112).
  3. NIT 2, the relative-path row.

    • The 3 new ids pass at the head on both gits.

    • By hand I reproduced the row (probe in probe_rel.py, output in probe-rel-head.log). typed is wd-pl\u202ean/adoption-plan.yaml, wd-\x1b[31mRED/adoption-plan.yaml or wd-\nWARNING forged-line: pwned/adoption-plan.yaml. Each is non-absolute, and the tool is handed it unchanged with cwd set to the parent.

    • Each run exits 2 with exactly one REFUSED line, spelled as repr spells it and still relative. No raw control character or U+202E appears.

    • The assertion is exact. It checks returncode == 2, then refused_lines(stderr) == [one line] with the whole expected line, then U+202E absent, then assert_shown_safe (no ESC, no forged line). No assert joins conditions with and or or.

    • Mutants in rv1274-mut, each applied alone and restored:

      mutant result
      X5 (named = shown_path(Path(path).absolute())) KILLED 3/112, exactly the 3 relative ids
      X5b (.resolve()) KILLED 3/112, the same 3
      main's scripts/repo_shape.py swapped in (from 51a9c5f10, and from ebb87168a, which is the same blob) 44/112 fail, the 3 relative ids among them
      • Every restore matched its sha256 (repo_shape.py a3bb291e0f0f, validate-pins.py 1a4fe392dc71, family.py a08464a6c149, shape-doctor.py 209985d4aeba), and the tree was clean after each.
  4. The tool choice, spot-checked with an ESC folder and the path typed relative (probe-tools.log).

    • validate-repository-naming.py --policy and --project name the path as typed, relative.
    • bump-leg.py --root, family.py bump --family-root and update-shape.py check --root name the absolute .../wd-\x1b[31mRED/<file>.
    • Together with adopt-project.py check --plan above, that is three file-typed tools and three root-typed tools, all as n1168b said.
    • I did not probe adopt-project.py plan --path-policy or validate-manifest.py --root on their own. The body's claim covers them.
  5. Gates at the head, in rv1274-review clean at 136b38d12. Python 3.12.3, git-filter-repo a40bce548d2c (the venv's 2.47.0, CI's pin). I ran the file in 2 chunks of 56 and the hygiene five plus test_no_auto_maintenance in 5 chunks (88, 88, 88, 88, 87), 439 ids, with -rs alone. Logs are in work/rv1274c/gate/.

    git testcases (junit) passed skipped failed
    2.43.0 (/usr/bin/git) 551 549 2 0
    2.47.1 (L/tools/git247/bin/git, its --version printed in each log) 551 549 2 0

    Both skips are tests/test_no_auto_maintenance.py:222 (2): "the session began with GIT_CONFIG_GLOBAL set". The hygiene five are test_path_guard_hygiene (121), test_repo_hygiene (101), test_agents_md_codes (47), test_cli_reference (23) and test_pinned_copy_text (87).

  6. The body (live copy in body-live.md; guard rc 0).

Merge-trees (git 2.47.1, objects only, 16:30Z; heads from a fresh gh pr list)

with head result
main ebb87168a clean, tree dff82dc5e2e2a3165ae3ca944bfa1530bbaf8747
#1266, #1171, #1249 (each touches scripts/repo_shape.py) 09697e9c5, 8162b874e, 3146c3ca5 clean in all three tests (head vs PR, main vs PR, predicted merge vs PR)
#1164, #1201, #1239, #1248, #1263, #1269, #1177 16ff93917, 24b6a0af6, fff421456, 1b747f7ab, 9ef8f0ab5, 52e5c1883, 5208e874e clean in all three tests
#1264 43d2e8b26 head vs PR conflicts only in docs/handbook.html, which #1274 does not touch. Main vs PR and predicted merge vs PR conflict in the same six files: docs/handbook.html, scripts/family.py and four tests.

#1264's five family.py conflict blocks are text-identical with and without #1274. No open PR touches tests/test_load_yaml_refusals.py other than #1274.

State

  • rv1274-review and rv1274-mut are both detached at 136b38d12, clean. No process of mine is left.
  • The scratch commit 691b5c914 is unreferenced, and basetemps are left under L/tools/bt/rv1274c-* (no rm).
  • Slip: my first probe_rel.py run used the wrong script path and ran nothing. I fixed it and reran, and the log kept is the good run.
  • Early STATE.md stamps (before 16:31Z) were my estimates; the log files carry the real times.
  • Everything is in /workspace/projects/.lane-worktrees/openRepoShape-5/work/rv1274c/. Start with STATE.md, mut/run1.log, merge-trees.txt, probe-rel-head.log, probe-tools.log, gate/chain-243.log, gate/chain-247.log and pm/chain.log.

Lane: openreposhape-5 (openRepoShape-5)

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
…prints through `spelled()`, so a name with a line feed or an ESC byte is one row and one `naming-unclassified` name, with its column worked out from the spelled form (#1267) (#1271)

**#1267: `validate-repository-naming.py` prints every name it tables or refuses through `repo_shape.spelled()`, so a name that holds a line feed or another control byte stays on one line and in one table row, and the finding for `Atlas` plus a line feed cannot read as the finding for a valid `Atlas`.**

**This PR was stacked on #1266 (#1202) and was restacked onto main after #1266's squash.** Its base was `fix/1202-naming-fullmatch` (#1266's head `09697e9c5`); its base is `main` now, and #1266 is on main as the squash `28be96557`. It is a DRAFT. The change is three commits written on top of `09697e9c5`, `4b1653d8b`, the review round `4fa9f78a6` and the round after rv1271b's delta check `76e99ec86` (see "Review round" and "The round after rv1271b's delta check"), and the restack's merge of #1266's squash, `2d9250c57` (see "The restack after #1266's squash"). Against main it is 3 files, +416 and -19 (`git diff --shortstat origin/main..HEAD`): `scripts/validate-repository-naming.py` (+31 -15), the new `tests/test_naming_gate_spelled.py` (+376, 39 rows), and `tests/test_naming_policy_line_break.py` (+9 -4: two of #1266's rows now assert the spelled form, see "What changed").

It is the follow-up lane 5's independent review of #1266 filed as #1267 (NIT 2, #1266 issuecomment-6724498649). #1266 makes `Atlas` plus a line feed a name of no family; this one is about how the gate then prints that name.

rv1271 (opus, independent) found this PR READY at `4b1653d8b` with six NITs, none blocking (#1271 issuecomment-6726218829). The round is one commit on it, `4fa9f78a6`: 2 files, +39 and -20 (`scripts/validate-repository-naming.py` +13 -10, `tests/test_naming_gate_spelled.py` +26 -10). NITs 1 to 5 are done. NIT 6 was left for the restack, and the restack has done it (see "The restack after #1266's squash").

| NIT | What rv1271 found | What was done |
|---|---|---|
| 1 | The module docstring said two things that cannot both be true: a chain link and a caller's words are "printed as given", and "every repository name this prints" is spelled | **Docstring only** (the script's syntax tree outside the docstring is equal to `4b1653d8b`'s, proved with `ast`). It now says one thing: every name the gate classifies or refuses is spelled, and a sentence that quotes one is spelled whole, so a chain link or a caller's `--link-remedy` words inside it are spelled too, while the `CHAIN` line, `link-source-unreadable` and the NOTEs print a chain link as given. The old "printed as given" lines no longer list a chain link or the words of a remedy |
| 2 | Two rival escapers survived every row: X1 (escape only a line feed and an ESC) and X3 (`repr(value)[1:-1]`) | **Four new rows**, below. X1 now fails 2 rows and X3 fails 2, each mutant applied alone and restored with a sha256 check |
| 3 | A surrogate name's row changed, against "byte for byte as before" | **Body only.** "What changed" now says the name's bytes are unchanged and its label moved from character 40 to 35 |
| 4 | The skips were explained wrongly: the body said the reasons "were not printed" | **Body only.** "Runs" names each reason and says why the first gate's logs hid them (`run10.sh`'s `-rs`, then the gate's `-rf`: pytest keeps only the last `-r`) |
| 5 | The Merges section was stale | **Body only.** "Merges" is re-measured at the round's head against main fetched fresh |
| 6 | `closingIssuesReferences` was `[]` while the base was #1266's branch | **Left for the restack, now done:** the PR was restacked onto main, and `closingIssuesReferences` reads #1267 (see "The restack after #1266's squash") |

**NIT 1, measured.** At the round's head, with a chain link `openX<ESC>dox` and `--link-remedy 'openXdox=run<TAB>make <ESC>[31mfetch'` (`logs/docstring-claims-head.log`, `logs/note-claims-head.log`): the stderr `WARNING <name>: <sentence>` and `--explain`'s `WARNING` spell the link (`openX\x1bdox`) and the remedy words (`run\tmake \x1b[31mfetch`); `--explain`'s `CHAIN` line, the `link-source-unreadable` WARNING (`could not answer for openX<ESC>dox`) and the NOTEs that name a link (`no name classified here reads openX<ESC>dox's own declaration`, `links: openX<ESC>dox, openDox`) print the link with its ESC byte. The values of `--link-source` and `--link-remedy` go through `_shown`, as the docstring's paragraph above the new one says. The "Limits" bullet on chain links still holds as written; the remedy words are the half it did not name.

**NIT 2, the rows.** `SPELLED_ITSELF` in `tests/test_naming_gate_spelled.py` adds two names to the finding row and the table row on the shipped contract (the file is 36 rows now). The expected spellings are written out by hand, as the file's others are:

| Name | Spelled | Pins |
|---|---|---|
| `Atlas` plus a CR (`ends-in-cr`) | `Atlas\r` | the CR: a gate that escapes only a line feed and an ESC prints it raw |
| `At\las` plus a line feed (`backslash`) | `At\las\n` | the backslash: `spelled` prints it as it is, so `repr` doubles it (and an escaper of every non-ASCII character does too); the line feed beside it keeps the row failing on the base |

A ZWJ was not used for the table row: lane 3's #1217 pads by terminal columns and a ZWJ (category Cf) takes none, so its row would change on the restack (`ZERO_COLUMN_CATEGORIES` at `352dcbc96`). A backslash is ASCII and one column.

- **At the head:** the 4 rows pass (`tests/test_naming_gate_spelled.py` 36 passed, `logs/new-file-head.log`).
- **On the base** (`09697e9c5`'s script): the 4 fail, the base prints the CR raw and splits the backslash name's row and finding at its line feed (`logs/run-base.log`, `logs/new-names.log`). **On main** (`dff8fd4ba`): the same 4 fail (`logs/run-main-gate-spelled.log`).
- **Under X1** (`spelled` replaced by a local escaper of a line feed and an ESC): **2 failed**, the finding row and the table row of `ends-in-cr`; the other 40 of the 42 core tests pass. **Under X3** (`repr(str(value))[1:-1]`): **2 failed**, the finding row and the table row of `backslash`; the other 40 pass. Each applied alone to the script in `n1267-mut` and restored from git, `restored x1-narrow sha256 ok`, `restored x3-repr-unquoted sha256 ok` (`logs/mutants-core.out`, `logs/mut-core-x1-narrow.log`, `logs/mut-core-x3-repr-unquoted.log`). No other row fails under either mutant.

rv1271b (sonnet, independent) found this PR READY at `4fa9f78a6` with no MUST or SHOULD and two NITs (#1271 issuecomment-6726914536). The round is one commit on it, `76e99ec86`: 2 files, +44 and -15 (`scripts/validate-repository-naming.py` +5 -2, `tests/test_naming_gate_spelled.py` +39 -13). Both NITs are done and nothing else changed: the script's syntax tree outside its module docstring is equal to `4fa9f78a6`'s (proved with `ast`, `logs/ast-delta.log`), and the test file adds three ids.

| NIT | What rv1271b found | What was done |
|---|---|---|
| 1 | Five rival escapers pass every row, because no name holds a character outside LF, CR, ESC and a backslash: y1 (C0 controls only), y2 (category Cc only), y3 (`spelled` without the bidirectional controls), y4 (an `isprintable` test) and y5 (a table of LF, CR and ESC) | **Three new ids**: a name with U+202E (RLO) in the finding row and the table row, and a name with U+200D (ZWJ) in the finding row only. Each of y1 to y5, applied alone and restored with a sha256 check, now fails at least one |
| 2 | The module docstring's first paragraph says every `--link-remedy` value this prints is shown as it is or by `_shown`, but the `declared-unverified` WARNING prints the remedy's words spelled, without quotes | **Docstring only.** The paragraph names that one exception |

**NIT 1, the rows.** The names are written in the test source as `chr(0x202E)` and `chr(0x200D)`, never as raw characters, and the expected spellings by hand, as the file's others are. Both are asked of the shipped contract, where the file's other `SPELLED_ITSELF` names are:

| Name | Printed as | Rows | Pins |
|---|---|---|---|
| `At`, U+202E, `las` (`rlo`) | `At\u202elas` | the finding, the table row | a bidirectional control that reorders the text around it and is no C0 or C1 control: an escaper that misses it (y1, y2, y3, y5) prints it raw |
| `At`, U+200D, `las` (`zwj`) | the name itself, the joiner as it is | the finding only | a format character `spelled` leaves alone, as its docstring says: an `isprintable` test (y4) writes it `\u200d` |

The ZWJ is in the finding row only. #1236 (landed on main as `81cbe9c82`) pads the table by the columns a name takes, and a ZWJ (category Cf) takes none, so a table row holding one would depend on that pad; the RLO name prints as ASCII (`\u202e` is six columns) and is safe in both. The ZWJ row passes on main and on the base **by design**: those print the joiner as it is, which is the text `spelled` gives, so it cannot fail there. It is a row that kills a rival, not one that fails on the base (see "Failing on the base"). The other two ids, `finding[rlo]` and `table[rlo]`, fail on both.

**Each rival, measured** (`probes/mutate.py`, `logs/mutants-y.out`; each applied alone to the gate's call in `n1267-mut` at `76e99ec86`, in place of the import of `spelled`, the new file run, the script restored with a sha256 check, `9cc39a2eafb0` each time, porcelain 0 after each):

| Rival | What it escapes | Rows failing (of the 39) | Killed by |
|---|---|---|---|
| y1 | C0 controls only | 2 | `finding[rlo]`, `table[rlo]` |
| y2 | category Cc only (C0, DEL, C1) | 2 | `finding[rlo]`, `table[rlo]` |
| y3 | every category `spelled` escapes, but no bidirectional controls | 2 | `finding[rlo]`, `table[rlo]` |
| y4 | what `str.isprintable` refuses | 1 | `finding[zwj]` |
| y5 | LF, CR and ESC by a table | 2 | `finding[rlo]`, `table[rlo]` |

No other row fails under any of the five, which is the proof that each passed every row of `4fa9f78a6`. rv1271b's other rivals and rv1271's X1 and X3 are still killed (`logs/mutants-rest.out`): y6 (every non-ASCII character too) 9, y7 (C0 as `\xNN`) 25, y8 (`ascii()` without quotes) 11, y9 (one-lining) 37, X1 4, X3 3. **These six counts are over the new file's 39 rows alone.** The Mutants table below counts over the 45 core tests, the new file's 39 rows and the 6 updated rows of `tests/test_naming_policy_line_break.py`, and is the first round's table re-measured at this head. Over the 45, X1 is 4 and X3 is 3 as here (they are rows of that table), and rv1271c measured the four y rivals that are not in it as y6 9, y7 31, y8 11 and y9 43: y7 and y9 each count 6 more over the 45 (y7 25 and 31, y9 37 and 43).

**NIT 2, the docstring.** The paragraph now says the one exception: the WORDS of a `--link-remedy` where a `declared-unverified` WARNING offers them stand inside its sentence and are spelled with it, so a TAB or an ESC in them is `\t` or `\x1b`, without quotes. Measured at the head (`probes/docstring-claim.py`, `logs/docstring-claim-head.log`): `--link-remedy 'openXdox=run<TAB>make <ESC>[31mfetch'` read by a chain gives `WARNING InkxDox: declared-unverified: openXdox declaring a pin on openDox is a fact in openXdox's own tree, which is not reachable here (run\tmake \x1b[31mfetch). The recorded chain still classifies.`, with no raw TAB or ESC in the output; a remedy no holder used is a NOTE whose VALUE goes through `_shown`, quotes included (`NOTE --link-remedy 'openQdox=run\tmake \x1b[31mfetch': not used ...`), as the paragraph still says.

**The runs of this round.** Head `76e99ec86`, dirty=0, Python 3.12.3, git-filter-repo 2.47.0 (`a40bce548d2c`), through `run10.sh` with its `-rs` and no other `-r`, so a skip names its reason. The files are the brief's: the new file (39), `test_naming_policy_line_break` (77), `test_naming_policy` (264), `test_chain_link_fold` (17), `test_legs_not_a_list` (112), the hygiene five (`test_path_guard_hygiene` 121, `test_repo_hygiene` 101, `test_agents_md_codes` 47, `test_cli_reference` 23, `test_pinned_copy_text` 87) and `test_no_auto_maintenance` (60): 948 tests in 9 runs per git. Four single files hold more than 100 tests (`test_naming_policy`, `test_legs_not_a_list`, `test_path_guard_hygiene`, `test_repo_hygiene`); each took `flock` on one lock, so no two runs of more than 100 tests overlapped, and no other run held more than 100.

| Run | git | Result |
|---|---|---|
| the 11 files (9 runs) | 2.43.0 (`/usr/bin/git`) | **946 passed, 2 skipped, 0 failed** |
| the 11 files (9 runs) | 2.47.1 (`tools/git247/bin/git`) | **946 passed, 2 skipped, 0 failed** |
| the new file alone, before the commit | 2.43.0 | 39 passed |

The 2 skips are the same on both gits: `tests/test_no_auto_maintenance.py:222` x2 ("the session began with `GIT_CONFIG_GLOBAL` set, and its file includes that one"): `run10.sh` exports `GIT_CONFIG_GLOBAL=/dev/null` for every run, which is the lane's rule for a gate, and the two rows of that test skip under it. Logs: `gate/gate-243-1.log` to `-9.log`, `gate/gate-2471-1.log` to `-9.log`. **Not run:** the full suite, a real Windows host and macOS; the first commit's 37-file gate under "Runs" stands for the rest, since the round changes a docstring and the new test file only.

**The restack's `_print_classification` hunk, pre-checked.** #1236 landed on main as `81cbe9c82` while this PR waited for #1266. The restack onto main will conflict at one line, and only there (see "Merges"). I built the resolution as an object-only commit, with no branch, no ref and never pushed: `git merge-tree --write-tree` of this head and main `30272026e`, then `git commit-tree` over the resolved file, the one `print` line read as `print(f"  {_padded(_printed(spelled(name)), 32)} {label}{also}")` and main's comment above it kept. That commit is `0cfaedf3f` (tree `24e4b4e3`). Checked out detached in `n1267-mut`, through the gate runner, in 4 runs: the new file with `test_chain_link_fold.py` (39 + 19 = 58 tests), `test_pinned_copy_columns.py` (55), `test_siblings_family_name.py` (154, under `flock`, as the one file that needs more than 100) and `test_naming_policy_line_break.py` (77): **344 passed** (`logs/resolved-main-a.log` to `-d.log`). The mut tree was put back at `76e99ec86`, clean, its script's sha256 equal to the branch's.

#1266 (#1202, this PR's base) landed on main as a squash, and GitHub retargeted this PR to `main`. The restack was done by hand, in the writing tree `l5-1267-naming-spelled`, as three merges (the route lane 5's `restack3.sh` takes: the parent's final head, the parent's squash, then main), because one conflict is in a file #1266 never touched. The merge commit carries the identity the lane's rules give it. The PR's own change is the one it was: its diff against main is the same 435 changed lines as before the restack, except the one print line resolved below, and no row or test changed.

| Step | What | Result |
|---|---|---|
| H66, #1266's final head | `09697e9c52f35c9aadbafdebb88e47950105f474` | already an ancestor of the branch (`git merge-base --is-ancestor` says yes: the branch was built on it), so no merge and **no commit** |
| S, #1266's squash | `28be9655772602597028e7936c6fb0649130801d` (its parent is main `30272026e`, its tree `8af55167`) | `git merge --no-ff S`: the merge commit **`2d9250c57f8d571ac4280a297927cf51d07be1a6`** (parents `76e99ec86` and S); **two conflicts, both the expected ones** (below) |
| main | `28be96557`, fetched fresh with `-c gc.auto=0 -c maintenance.auto=false fetch --no-write-fetch-head`; it is S itself, main's tip | `git merge origin/main`: **"Already up to date."** No commit |

**The two conflicts, and no other** (`git merge-tree --write-tree --name-only S 76e99ec` named the same two before the merge):

- **`tests/test_naming_policy_line_break.py`, add/add.** The file is #1266's own, and this PR changed 13 lines of it (+9 -4: the two rows that now assert the spelled form). Resolved by taking the branch's side whole (`git checkout --ours`, then `git add`). Nothing is lost: S's copy of the file is #1266's own (blob `b6a75d9bf`, equal to the one at `09697e9c5`), and the branch's copy is that blob plus the 13 lines. The result's blob is `5885627f8c27426bbbcfff1e49e42bc88770809a`, **equal to `76e99ec86`'s**.
- **`scripts/validate-repository-naming.py`, one hunk, `_print_classification`'s print line,** where main's #1236 (`81cbe9c82`, the display-width pad) meets this PR's `spelled`. The branch's side was `print(f"  {spelled(name):<32} {label}{also}")`; main's side is the two comment lines and `print(f"  {_padded(_printed(name), 32)} {label}{also}")`. Resolved by hand, as the body has said all along: spell first, then pad what is printed, with main's comment kept: `print(f"  {_padded(_printed(spelled(name)), 32)} {label}{also}")`. The resolved file's blob is `c568e33b86ca922ade043a856bf47b060fd1f3ae`, **equal to the file in the object-only commit `0cfaedf3f` (tree `24e4b4e3`) that the round before pre-checked**, and main's file is the same as it was then (blob `4bfafa631` at `30272026e` and at S), so the pre-check stands for the head. Neither side was taken wholesale.

The merge commit's message names S, both files and how each was resolved.

**Verified at `2d9250c57`** (git 2.43.0; the changed lines are in `changed-old.txt` and `changed-new.txt` in the writer's folder):

- `git diff --name-only origin/main HEAD` lists exactly `scripts/validate-repository-naming.py`, `tests/test_naming_gate_spelled.py` and `tests/test_naming_policy_line_break.py`: 3 files, +416 and -19, with `scripts/validate-repository-naming.py` +31 -15, the new test file +376, `tests/test_naming_policy_line_break.py` +9 -4. `scripts/repo_shape.py` is the same blob (`852d272ef`) at the head, at S and at `09697e9c5`: the restack leaves it to #1266.
- The `-U0` changed lines of `git diff origin/main HEAD` (435) equal those of `git diff 09697e9 76e99ec` (435), line for line, **except the one resolved print line**. Before: `-    print(f"  {name:<32} {label}{also}")` and `+    print(f"  {spelled(name):<32} {label}{also}")`. Now: `-    print(f"  {_padded(_printed(name), 32)} {label}{also}")` and `+    print(f"  {_padded(_printed(spelled(name)), 32)} {label}{also}")`.
- `git merge-tree --write-tree origin/main HEAD` exits 0 and gives **`24e4b4e3255e9fcd55abcdec217f577ccb22270d`, the head's own tree**: nothing is left to merge, and the tree is the one of `0cfaedf3f`.

**The runs of the restack.** Head `2d9250c57`, dirty=0, Python 3.12.3, git-filter-repo 2.47.0 (`a40bce548d2c`), through `run10.sh` with its `-rs` and no other `-r`, so a skip names its reason. The files are the brief's: the new file (39), `test_naming_policy_line_break` (77), `test_naming_policy` (264), `test_chain_link_fold` (19 at the head; 17 at `76e99ec86`, and the two more rows are main's #1236, `81cbe9c82`), `test_legs_not_a_list` (112), `test_pinned_copy_columns` (55), `test_siblings_family_name` (154), the hygiene five (`test_path_guard_hygiene` 121, `test_repo_hygiene` 101, `test_agents_md_codes` 47, `test_cli_reference` 23, `test_pinned_copy_text` 87) and `test_no_auto_maintenance` (60): 1159 tests in 11 runs per git. Five single files hold more than 100 tests (`test_siblings_family_name`, `test_naming_policy`, `test_legs_not_a_list`, `test_path_guard_hygiene`, `test_repo_hygiene`); each took `flock` on one lock, so no two runs of more than 100 tests overlapped, and no other run held more than 100.

| Run | git | Result |
|---|---|---|
| the 13 files (11 runs) | 2.43.0 (`/usr/bin/git`) | **1,157 passed, 2 skipped, 0 failed** |
| the 13 files (11 runs) | 2.47.1 (`tools/git247/bin/git`) | **1,157 passed, 2 skipped, 0 failed** |

The 2 skips are the same on both gits: `tests/test_no_auto_maintenance.py:222` x2 ("the session began with `GIT_CONFIG_GLOBAL` set, and its file includes that one"): `run10.sh` exports `GIT_CONFIG_GLOBAL=/dev/null` for every run, which is the lane's rule for a gate, and the two rows of that test skip under it. Logs: `gate/gate-243-1.log` to `-11.log`, `gate/gate-2471-1.log` to `-11.log`. **Not run:** the full suite, a real Windows host and macOS.

**The new rows on main's own script.** With #1266 on main, main's `validate-repository-naming.py` (S's, blob `4bfafa631`) was swapped into `n1267-mut` at the head (its `scripts/repo_shape.py` is the same blob as main's), and the two test files run in two runs (`logs/swap-main-a.log`, `logs/swap-main-b.log`): `tests/test_naming_gate_spelled.py` gives **37 failed, 2 passed**, and `tests/test_naming_policy_line_break.py` gives **6 failed, 71 passed**. The 2 passes are `test_a_plain_valid_name_prints_exactly_as_it_did` (the plain-name control) and `test_the_finding_prints_the_spelled_name_on_one_line[zwj]` (the ZWJ finding row, which prints the same on main by design, see "The round after rv1271b's delta check"); the 6 failures of #1266's file are the 6 rows this PR updated to assert the spelled form. The script was restored from git with a sha256 check (`f504b0e48b4a`, the head's) and the tree was clean after.

**The record after the push.** `git ls-remote origin refs/heads/fix/1267-naming-spelled` reads `2d9250c57f8d571ac4280a297927cf51d07be1a6`; `gh pr view 1271` reads base `main`, head `2d9250c57f8d571ac4280a297927cf51d07be1a6`, `closingIssuesReferences` `[1267]` and `mergeable` `MERGEABLE`. Sections elsewhere in this body that say "on main (without #1266)" or call `09697e9c5` the base describe those commits as they were measured, before the restack; they are not re-measured, and the Mutants and Runs sections still describe the heads they name.

rv1271c (sonnet, independent) found this PR READY at `76e99ec86` and again at the restack `2d9250c57`, with no MUST or SHOULD and three NITs (#1271 issuecomment-6759403546). This round takes the first two. It is one commit on `2d9250c57`, `c56753ba7`: 1 file, +4 and -4 (`tests/test_naming_gate_spelled.py`, four `#` comment lines). NIT 3 is informational (rival edits the new file's rows cannot tell from `spelled`, which the library's own tests kill) and needs nothing. Nothing was merged into the branch: main is `28be96557` still, an ancestor of the head, and the PR's diff against it is the same 3 files, +416 and -19.

| NIT | What rv1271c found | What was done |
|---|---|---|
| 1 | Four `#:` comments in `tests/test_naming_gate_spelled.py` write an escape with a doubled backslash. A doubled backslash is right in a string literal or a docstring, where Python reads it as one, and wrong in a comment, where it reads literally. Two of the four read correctly at `4fa9f78a6` and became wrong at `76e99ec86`, when the paragraph was re-wrapped | **Comments only.** The four comments write one backslash. Lines 80 and 81 read as they did at `4fa9f78a6` (its lines 72 and 73); lines 87 and 98 are the comments the RLO and ZWJ rows added |
| 2 | The sentence that gives `y6 9, y7 25, y8 11, y9 37, X1 4, X3 3` counts over the new file's 39 rows, while the Mutants table counts over the 45 core tests, and the body says neither | **One sentence**, in "The round after rv1271b's delta check": it says the six counts are over the new file's 39 rows, that the Mutants table counts over the 45 core tests, and what the same rivals count over the 45 |

**NIT 1, the four lines** (`git diff -U0 2d9250c c56753b`, the whole diff of the round; the lines are code text and show a backslash as the file has it):

```
@@ -80,2 +80,2 @@ NAMES = [pytest.param(*ENDS_IN_LF, id="ends-in-lf"),
-#: double the backslash: `spelled` writes a CR as `\\r` and leaves a backslash
-#: as it is (the line feed beside it is still `\\n`), so the name holding it
+#: double the backslash: `spelled` writes a CR as `\r` and leaves a backslash
+#: as it is (the line feed beside it is still `\n`), so the name holding it
@@ -87 +87 @@ WITH_BACKSLASH = ("At\\las" + LF, "At\\las\\n")
-#: `\\u202e`, and a rival that escaped only the C0 controls, only the category
+#: `\u202e`, and a rival that escaped only the C0 controls, only the category
@@ -98 +98 @@ SPELLED_ITSELF = [pytest.param(*ENDS_IN_CR, id="ends-in-cr"),
-#: `str.isprintable` would write it as `\\u200d`. It takes no column, so only
+#: `str.isprintable` would write it as `\u200d`. It takes no column, so only
```

**The round is comments only, proved** (`probes/prove-comments-only.py`, run over the two committed blobs, `logs/prove-comments-only-committed.log`; the file's sha256 is `bac49172...` before and `9b52a2cb...` after):

- `ast.dump` of the file, with `include_attributes=False`, is equal before and after (48,502 characters each); with the node positions it is equal too.
- A `tokenize` comparison: 2,337 tokens on each side, and **4 differ, all 4 COMMENT tokens**. The tokens that are not comments are equal in type and text; four NL tokens, the line ends after the shortened comments, stand one column to the left.
- `git diff -U0` shows 8 changed lines, every one a `#` line, in three hunks (lines 80 and 81, line 87, line 98).
- No comment holds a doubled backslash now: 0 `COMMENT` tokens by `tokenize` (4 before), and 0 lines with a `#` before a doubled backslash by a text search (`probes/grep-comments.py`, `logs/grep-comments-after.log`). The doubled backslashes that remain are in string literals and docstrings, where Python reads them as one (`"Atlas\\n"`, the module docstring, the finding test's docstring), and are untouched.

**NIT 2, the sentence.** It is the last sentence of the paragraph in "The round after rv1271b's delta check" that gives the counts of rv1271b's other rivals and rv1271's X1 and X3. The numbers were true and are not changed; the sentence now names what they count over.

**The runs of this round.** Head `c56753ba7`, dirty=0, Python 3.12.3, git-filter-repo 2.47.0 (`a40bce548d2c`), through `run10.sh` with its `-rs` and no other `-r`, so a skip would name its reason. Three files, each run alone: the new file (39) and the two single files that hold more than 100 tests (`test_repo_hygiene` 101, `test_path_guard_hygiene` 121). Each of those two took `flock` on one lock, so no two runs of more than 100 tests overlapped, and the two gits ran side by side (two runs at most): 261 tests per git, 6 runs.

| Run | git | Result |
|---|---|---|
| the new file alone | 2.43.0 (`/usr/bin/git`) | **39 passed** |
| the new file alone | 2.47.1 (`tools/git247/bin/git`) | **39 passed** |
| `tests/test_repo_hygiene.py` alone, under `flock` | 2.43.0 | **101 passed** |
| `tests/test_repo_hygiene.py` alone, under `flock` | 2.47.1 | **101 passed** |
| `tests/test_path_guard_hygiene.py` alone, under `flock` | 2.43.0 | **121 passed** |
| `tests/test_path_guard_hygiene.py` alone, under `flock` | 2.47.1 | **121 passed** |

0 failed and 0 skipped in all six. Logs: `gate/gate-243-1.log` to `-3.log` and `gate/gate-2471-1.log` to `-3.log`. **Not run:** the rest of the 11-file gate. The round changes four comment lines, proved above, so rv1271c's gate at `2d9250c57` stands for the rest: 1,157 passed and 2 skipped on both gits (`tests/test_no_auto_maintenance.py:222` x2, "the session began with `GIT_CONFIG_GLOBAL` set, and its file includes that one"). Also not run: the full suite, a real Windows host and macOS.

Measured at `09697e9c5` (Python 3.12.3, git 2.43.0): the gate printed a name raw.

- `validate-repository-naming.py` given `Atlas` plus a line feed: exit 1, stdout `'  Atlas'` and then `'                           NO FAMILY'` on the next line (the row split in two), stderr `FINDING naming-unclassified: Atlas` and then a blank line, which reads exactly as the finding for a valid `Atlas`.
- `At`, a line feed, `las`: the same split.
- `At`, ESC, `[31mlas`: the ESC byte reached the terminal in the row and in the finding.
- A name with a CR (`Atlas-spec` plus a carriage return) printed the same way, the CR raw in the row and in the finding.

On main (without #1266) `Atlas` plus a line feed is not refused at all: it exits 0, classified as `Atlas`, with its row split in two (#1266's body has that measurement).

Every `print` of the script, and every string it builds from a name, at the base (`09697e9c5`), with what became of it. Ten changed:

| # | Site (base line) | What it prints | Row |
|---|---|---|---|
| 1 | `_print_classification` (1297) | the plain listing's row, `  <name padded to 32> <label>` | table rows, classified-name row |
| 2 | `_no_family_lines` (791) | `--explain`'s header for a name of no family | explain NO FAMILY |
| 3 | `_describe` (955) | `--explain`'s header for a classified name | explain classified |
| 4 | `_referent_claim_note` (831) | `[a CLAIM: needs a declared pin on openRouter or openxRouter ...]`, the referents derived from the name | claim note |
| 5 | `_referent_lines` (935) | `--explain`'s `WARNING <sentence>`; the sentence quotes the name | explain WARNING |
| 6 | `_referent_lines` (937) | `--explain`'s `OVERLAP <reason>`; a broken chain's reason quotes the name | explain OVERLAP |
| 7 | `_classify_targets` (1321) | the stderr line `WARNING <name>: <sentence>`; the sentence quotes the name again | stderr WARNING |
| 8 | `_leg_target` (1112) | `FINDING <name>: declared role 'code' but the name is the 'assembly' form ...` | role finding |
| 9 | `_leg_target` (1119) | `FINDING <name>: <broken chain's reason>`; the reason quotes the name | broken-chain finding |
| 10 | `_emit_reports` (1358) | `FINDING naming-unclassified: <name>, <name>` | the finding rows |

Sites 1 to 4, 8 and 10 spell the name (1 pads the SPELLED name: `f"  {spelled(name):<32} ..."`, so the width is worked out from the printed form). Sites 5, 6, 7 and 9 spell the WHOLE string: the sentence `resolve_referent` builds says the name again (`it ends at openQ, but <name> would need openDox or openxDox`), so spelling only the prefix leaves the name raw in the same line. (A mutant that spells only the name, M7b and M9b, is killed.)

**Not changed, and why** (each prints no repository name):

- `print(f"WARNING {warning}")` (1347) and `print(f"FINDING {finding}")` (1354), `print("\n".join(_describe(...)))` (1317): they emit the strings above, spelled where they are built.
- `sources.unread_lines()` and `unused_lines()` (WARNING and NOTE, 1350 and 1352): link-source values and paths through `_shown`, chain links as given, as the module docstring has said since #610.
- `print(str(exc))` (1457, 1473), `no_path_refusal()` (1482), `REFUSED naming-no-target` (1500): the policy or manifest path and fixed words.
- `_pins_field_findings`, `_chain_field_findings`, `_legs_field_findings`, `_topic_finding`, and `_leg_target`'s `manifest-leg` and `a leg has no repository:` lines: values through `!r` or `_shown`.
- `--explain`'s `CHAIN` line (a chain link is a neutral product's name, printed as given; a manifest's links are checked printable by `_not_a_name`, #714), the family rows (the policy's ids and patterns) and the policy's notes.

- **`scripts/validate-repository-naming.py`:** `spelled` is imported from `repo_shape` and applied at the ten sites; the module docstring says so beside the `_shown` paragraph, and that a name with no control prints as it did. `spelled` is in every kept library: `scripts/repo_shape.py` at v1.0.0, v1.0.1, v1.1.0, v1.1.1 and v1.2.0 each define it, with the same text (the sha256 of the AST source of `spelled` and of its two constants, `ESCAPED_CATEGORIES` and `ESCAPED_BIDI_CONTROLS`, is equal in all five and at the head), so the import is not skewed (`tests/test_pinned_copy_text.py`'s `NEWER_THAN_A_KEPT_LIBRARY` names only `shown_path` and `host_shell_dialect`, and passes unchanged).
- **No refusal code, flag, command or exit status changes.** `naming-unclassified` stays; only the name in its words is spelled. A name without a line feed, CR, ESC or other control prints as before (the plain-name row, and the 3,563 gate tests below), with one change in a ROW and none in the name: a name with a lone surrogate (`Atl\udcffas`, in `test_legs_not_a_list.py`) prints its own bytes as before (`spelled` writes `\udcff`, as stderr's `backslashreplace` did), but its label moved from character 40 to character 35, because the column is now worked out from the spelled name and so lines up with every other row's (measured on `09697e9c5`, `4b1653d8b` and the round's head: `logs/surrogate-label.log`; rv1271's NIT 3).
- **`tests/test_naming_policy_line_break.py` (#1266's file), two rows updated:** `test_the_naming_gate_refuses_a_leg_repository_that_ends_in_a_line_feed` (3 rows) and `test_the_naming_gate_refuses_an_argv_name_that_ends_in_a_line_feed` (3 rows) asserted `FINDING naming-unclassified: Atlas`, the raw form (the line feed ended the first line). They assert `FINDING naming-unclassified: Atlas\n` now (a backslash and an `n`), which is what the issue asks. The docstrings say so. No other row of the file changed.
- **What pins the printed forms (grepped first).** `tests/`, `README.md`, `docs/` (the handbook included) and `AGENTS.md` for `naming-unclassified`, `NO FAMILY`, `declared role`, `also_matches` and the table's columns: README, docs and AGENTS name the command only, never a printed name with a control; the tests that pin the table or the finding use printable names (`test_chain_link_fold.py`, `test_naming_policy.py`, `test_setup_project_name_edges.py` with its trailing space), which `spelled` leaves alone, or `Atl\udcffas` (`test_legs_not_a_list.py`), which `spelled` writes as `\udcff` exactly as stderr's `backslashreplace` did. The files that run the gate or read its output all pass (Runs).

`tests/test_naming_gate_spelled.py` (new, 39 rows). The expected spellings are written out by hand (`Atlas\n`, `At\nlas`, `At\x1b[31mlas`, `Atlas\r`, `At\las\n`, `At\u202elas`; the joiner's name prints as it is), not computed by the library under test.

- **On the shipped contract (19 rows):** for each of the issue's three names, the finding is exactly three stderr lines (the finding on one line with the spelled name, then the two lines a plain unclassified name gets), the stdout is exactly one row `  <spelled padded to 32> NO FAMILY`, and `--explain`'s header is `  <spelled>: NO FAMILY` with every later line indented; one run of all three plus a plain `Atlas` gives four rows with their labels in one column and one finding naming all three; a name on stdin (an ESC; stdin strips a line feed) is spelled too; and a control row, a run of five plain names, prints exactly as it did. Two more names pin `spelled` itself (rv1271's NIT 2; the finding row and the table row of each, 4 rows): `Atlas` plus a CR, which `spelled` writes `\r` (a gate that escaped only a line feed and an ESC prints it raw), and `At\las` plus a line feed, written `At\las\n` (a backslash prints as it is; `repr` would double it). Two more pin it against the rivals rv1271b found (its NIT 1; the RLO name in the finding row and the table row, the ZWJ name in the finding row only, 3 rows): `At`, U+202E, `las`, written `At\u202elas` (a bidirectional control no C0 or C1 escaper writes), and `At`, U+200D, `las`, which prints as it is (a format character an `isprintable` test would write).
- **On a fork's contract (20 rows):** the shipped contract classifies none of the three names (#1202), so sites 3 to 9 print a name only when a fork's patterns take an ESC and a line feed. The rows read the shipped contract with its 12 character classes `[A-Za-z0-9]` widened (`loosened()` asserts the count), and ask: the listing row and the header of a classified name (3 + 3 rows), the claim note's derived referents (3), the stderr WARNING (2), `--explain`'s WARNING and OVERLAP (2 + 2), the role finding (3) and the broken-chain finding (2). A descendant name ends in its product, which the direct pin reads, so the control is in its stem there (inner line feed and ESC); the other rows ask all three names.

### Failing on the base

The base is `09697e9c5`'s script (sha256 `fc5c9f81c953`), swapped into `n1267-mut` (detached at the round's head `76e99ec86`, so the new file and the updated rows are the branch's) and restored with a sha256 check (`9cc39a2eafb0`, the branch's script; `logs/swap-base.log`, `logs/swap-base.out`):

- `tests/test_naming_gate_spelled.py`: **37 failed, 2 passed**. The two that pass are the plain-name control (it must: nothing about a plain name changed) and the ZWJ finding row, which passes on the base and on main by design (`spelled` leaves U+200D as it is, so their raw print is already the text it expects; the row kills the `isprintable` rival y4, see "The round after rv1271b's delta check"). The 37 fail because the base prints the raw bytes: the finding row ends its first line at the line feed (`assert ['FINDING naming-unclassified: Atlas', '', ...] == [...]`), the table row is `'  Atlas\n   ...  NO FAMILY\n'` where `'  Atlas\\n  ...  NO FAMILY\n'` is expected, the ESC rows carry the byte, `--explain`'s header is `'  Atlas'` and the stderr WARNING and the broken-chain finding carry the raw name twice. The 4 rows of the first round fail the same way: the base prints the CR raw in the row and the finding, and splits the backslash name's row and finding at its line feed (`logs/new-names.log`). The 2 RLO rows fail because the base prints U+202E raw.
- `tests/test_naming_policy_line_break.py`: the 6 updated rows fail (**6 failed** in this run; the file's other 71 rows passed when it was run whole with the first commit, and neither the file nor the base has changed), because the base prints `Atlas` where the spelled `Atlas\n` is now asserted.
- **On main, what each row does:** the new file is **37 failed, 2 passed** at main `438cfad53` (fetched at 04:21Z on 2026-11-10, still without #1266, with main's `repo_shape.py` swapped in as well; `logs/swap-main.log`, `logs/swap-main.out`; main's two files are the same at `30272026e`, main when this body was written), the same 37 as on the base, and the same two pass. Rows for the two names without a trailing line feed fail as above. Every `ends-in-lf` row fails first on the exit code (`assert 0 == 1`): main classifies `Atlas` plus a line feed as `Atlas`, exit 0, with its row split in two. `tests/test_naming_policy_line_break.py` is **40 failed, 37 passed** on main (measured at `9729315f1` with the first commit; it is #1266's file and has not changed since), the number #1266's own body gives. The PR needs #1266's change, and has it: #1266 landed as `28be96557` and the PR was restacked onto main.

Each applied alone to the branch's `scripts/validate-repository-naming.py` in `n1267-mut` (detached at the round's head `76e99ec86`), run against `tests/test_naming_gate_spelled.py` (39 rows) and the 6 updated rows of `tests/test_naming_policy_line_break.py` (45 tests). The counts are re-measured at this head: the round's three ids add to M1, M1w, M10, M11, X1, X2, X3, X4 and X8, and nothing else moves. Each is restored with a sha256 check (`restored ... sha256 ok` after each, and the script's bytes equal the branch's at the end, porcelain 0; `logs/mutants-core.out`):

| Mutant | Rows failing | Killed by |
|---|---|---|
| M1: site 1 prints the raw name (`{name:<32}`) | 16 | the 6 table rows, the 4-row run, stdin, the 3 classified-listing rows, the stderr WARNING (2), the role finding (3) |
| M1w: site 1 spells the name but pads by the RAW name's length (`32 - len(name)`) | 16 | the same 16: the escape is longer than the byte it writes, so every label stands 1 or 3 columns off (5 for the RLO name) |
| M2: site 2 raw | 3 | the 3 `--explain` NO FAMILY rows |
| M3: site 3 raw | 7 | the 3 classified-header rows, and 4 more that read the header line (2 claim rows, 2 `--explain` WARNING rows) |
| M4: site 4 raw (the claim note's referents) | 3 | the 3 claim rows |
| M5: site 5 raw (`--explain` WARNING) | 2 | the 2 `--explain` WARNING rows |
| M6: site 6 raw (`--explain` OVERLAP) | 4 | the 2 OVERLAP rows and the claim rows whose OVERLAP line splits (inner line feed, trailing line feed) |
| M7: site 7 raw (stderr WARNING) | 2 | the 2 stderr WARNING rows |
| M7b: site 7 spells the name only, not the sentence | 2 | the same 2 (the sentence says the name again) |
| M8: site 8 raw (role finding) | 3 | the 3 role-finding rows |
| M9: site 9 raw (broken-chain finding) | 2 | the 2 broken-chain rows |
| M9b: site 9 spells the name only | 2 | the same 2 |
| M10: site 10 raw (`", ".join(unclassified)`) | 14 | the 6 finding rows (every name with a control: the ZWJ's prints as it is), the 4-row run, stdin, and #1266's 6 updated rows |
| M11: `spelled` replaced by `repr` | 45 | all 39 rows of the new file, plain control included, and the 6 updated rows (the quotes and the doubled backslash are not the spelling) |
| X1 (rv1271's): `spelled` is a local escaper of a line feed and an ESC only | 4 | the finding row and the table row of `ends-in-cr` (first round) and of `rlo` (this round: U+202E is neither) |
| X3 (rv1271's): `spelled` is `repr(str(value))[1:-1]` | 3 | the finding row and the table row of `backslash` (first round), and the finding row of `zwj` (`repr` writes U+200D as an escape and `spelled` does not) |

rv1271's other mutants are killed too, with the rows of the rounds: X2 (escape every non-ASCII character; the backslash rows and the ZWJ finding row kill it) 11, X4 (spell the whole `naming-unclassified` block, its line breaks too) 15, X5 (site 9 spells the reason and not the name) 2, X6 (site 7 spells the sentence and not the name) 2, X7 (the claim note spells its first referent only) 3, X8 (pad the raw name, then spell it) 16.

X1 and X3 survived every row of the first commit (rv1271's NIT 2); the first round's 4 rows kill them, and the new ids fail them too (X1 4, X3 3, above). rv1271b's y1 to y5 survived every row of the first round; this round's 3 ids kill them (the table in "The round after rv1271b's delta check"). No survivor.

Python 3.12.3 (CI runs 3.14; the rows assert lists and lines, nothing that depends on a `repr` or an `ast.dump`), through lane 5's `run10.sh` (gh stub first on PATH, bogus token, empty `GH_CONFIG_DIR`, blank git identity, `GIT_SSH_COMMAND=false`, `GIT_CONFIG_GLOBAL=/dev/null`), git-filter-repo 2.47.0 (CI's pin; `git filter-repo --version` prints `a40bce548d2c`), at head `4b1653d8b`, dirty=0. The gate list is the 37 test files that name `validate-repository-naming` or pin its printed forms (`grep -l`), this PR's three, `tests/test_naming_policy.py`, and the hygiene five (`test_path_guard_hygiene`, `test_repo_hygiene`, `test_agents_md_codes`, `test_cli_reference`, `test_pinned_copy_text`): 3,567 tests in 28 runs, none of more than 100 tests beside another (one exception, below).

| Run | git | Result |
|---|---|---|
| the gate list (28 runs) | 2.43.0 | **3,563 passed, 4 skipped, 0 failed** |
| the gate list (28 runs) | 2.47.1 (`tools/git247/bin/git`, built from kernel.org's tarball) | **3,560 passed, 7 skipped, 0 failed** (3 more skips than the 2.43.0 leg: `test_adopt_check_throwaway_repos.py:1041`, below) |
| `tests/test_naming_gate_spelled.py` alone, before the commit | 2.43.0 | 32 passed |
| the naming files, `test_naming_policy`, the hygiene five and `test_chain_link_fold`, on the PREDICTED merge of current main (`51a9c5f10`) and the branch (`merge-tree` and `commit-tree`: an object, no ref) | 2.43.0 | **769 passed** in 92.43s |

**The skips, by reason.** rv1271 measured them. The first gate's logs hid them because `run10.sh` passes `-rs` and the gate runs then passed `-rf`, and pytest keeps only the LAST `-r` option, so no reason was printed. On 2.43.0 the 4 skipped are `tests/test_shape_doctor.py:10516` x3 ("the PowerShell line is printed, and powershell.exe exists, only on a Windows host") and `tests/test_adopt_check_throwaway_repos.py:482` x1 ("needs a disk that ignores case: `git init` wrote no `core.ignorecase=true` in the work directory, so that disk keeps case; the rows above write the setting into the throwaway repository by hand instead"). On 2.47.1 the 7 are those 4 and `tests/test_adopt_check_throwaway_repos.py:1041` x3 ("this git's `git clone` takes `init.defaultBranch = a..b`, as 2.55's does: the split clones there"); 2.43.0's clone does not take it, so its rows run. I ran those two files again at the round's head with `-rs` alone, on both gits, and the same lines print (`logs/skips-243.log`, `logs/skips-2471.log`). **A slip in the load rule (first gate):** the 106-test run of the #1236 check below ran while the gate's slot A held a run of more than 100 tests; it passed.

**The review round's runs.** Head `4fa9f78a6`, dirty=0, Python 3.12.3, git-filter-repo 2.47.0 (`a40bce548d2c`), through `run10.sh` with its `-rs` and no other `-r`, so a skip would name its reason. The files are the brief's ten: the new file, `test_naming_policy_line_break`, `test_naming_policy`, `test_chain_link_fold`, `test_legs_not_a_list` and the hygiene five (`test_path_guard_hygiene`, `test_repo_hygiene`, `test_agents_md_codes`, `test_cli_reference`, `test_pinned_copy_text`): 885 tests in 8 runs per git, none of more than 100 tests beside another.

| Run | git | Result |
|---|---|---|
| the ten files (8 runs) | 2.43.0 (`/usr/bin/git`) | **885 passed, 0 skipped, 0 failed** |
| the ten files (8 runs) | 2.47.1 (`tools/git247/bin/git`) | **885 passed, 0 skipped, 0 failed** |
| `tests/test_naming_gate_spelled.py` alone, before the round's commit | 2.43.0 | 36 passed |

Logs: `gate/gate-243-*.log`, `gate/gate-2471-*.log`, `gate/slotA.out`, `gate/slotB.out`. The round changes the script's docstring and the new test file only, so the first commit's 37-file gate above stands for the rest. **A slip in the load rule:** the resolved-#1236 check (Merges) ran its 154-test chunk while the skip re-run above held a 152-test file; both passed. **Not run:** the full suite, a real Windows host and macOS.

`git merge-tree --write-tree --name-only <other> c56753b` (git 2.43.0) at 2026-11-10T05:01:53Z, against main (fetched fresh at 05:01:28Z and again at 05:01:53Z, before the push: `28be96557` both times; a third fetch at 05:04:12Z, after it: still `28be96557`) and every open PR that touches one of this branch's files (32 open when listed; `live/open-prs.json`, `logs/merge-trees.txt`, `probes/merge-trees.sh`):

| Against | Head | Result |
|---|---|---|
| main | `28be96557` (#1266's squash, main's tip) | **clean**, exit 0, tree `723bb5ad`, the head's own tree: main is an ancestor of the head |
| #1284 (lane 5's #1279; `scripts/validate-repository-naming.py`) | `0270d48d7` | clean, tree `2eeb4848` |
| #1274 (`scripts/repo_shape.py`) | `136b38d12` | clean, tree `70f33a48` |
| #1249 (`scripts/repo_shape.py`) | `3146c3ca5` | clean, tree `e4a8454a` |
| #1171 (`scripts/repo_shape.py`) | `ce1dd661f` | clean, tree `52ca1d68` |

Of the open PRs only #1284 touches one of the three files this branch changes against main. #1274, #1249 and #1171 touch `scripts/repo_shape.py`, which this branch carried while it was stacked on #1266 and does not carry now; they stay in the table because the earlier Merges listed them. #1266 landed: its head `09697e9c5` is an ancestor of this branch and is no longer a row.

**The conflict this body has named all along is resolved in the head, and main no longer conflicts.** #1236 landed on main as `81cbe9c82` (lane 3's #1217 display-width pad) while this PR waited for #1266. The merge of #1266's squash met it at `_print_classification`'s `print` line and nowhere else, and the line was resolved as this body said it would be: `print(f"  {_padded(_printed(spelled(name)), 32)} {label}{also}")`, with main's comment kept (see "The restack after #1266's squash").

- **Sites 3 to 9 print a control only under a fork's contract.** The shipped patterns take `[A-Za-z0-9]` and hyphens, so on the shipped data a name with a control is never classified and only sites 1, 2 and 10 print it. The other sites are spelled for the same reason the first three are (one rule: a repository name the gate prints is spelled), and their rows read a fork's contract. No shipped project sees them change.
- **Chain links and `--pins` values are printed as given** (the module docstring's standing rule; a manifest's are checked printable, a command line's are the caller's words). So `--explain`'s `CHAIN` line prints a link raw, while the four sentences that quote it (sites 5, 6, 7, 9) are spelled whole and so escape a control in a link too. Not changed here.
- **A manifest leg's `role:` prints raw** in `--explain`'s `[ADMITS ...; <role> is declared here and is not admitted]` note (`--role` is a closed choice; a manifest's value is not). It is a role, not a repository name, so it is outside #1267. Found, not fixed.
- **A name read from stdin is stripped**, so a trailing line feed reaches the gate only from argv or a manifest; the stdin row asks for an ESC.
- A project's own copy of `validate-repository-naming.py` reaches this through `update-shape.py`; it needs `spelled` in its `scripts/repo_shape.py`, which every kept library has.
- `shape-doctor.py` and the setup, scaffold and adopt tools run the gate and quote its lines; they print what it prints, so a name with a control is spelled in their rows too. Their tests are in the gate list above.

Review: rv1271, lane 5's independent opus reviewer, which wrote none of #1271: READY at `4b1653d8` (issuecomment-6726218829), with no MUST or SHOULD; its NITs 1-5 are fixed in `4fa9f78a`. Then rv1271b, lane 5's independent sonnet reviewer, which wrote none of it: READY at `4fa9f78a` (issuecomment-6726914536); its NITs 1-2 are taken in `76e99ec8`. Then rv1271c, lane 5's independent sonnet reviewer, which wrote none of it: READY at `76e99ec8`, and READY at the restack `2d9250c5` onto main after #1266's squash `28be9655` (issuecomment-6759403546), with no MUST or SHOULD. Its NITs 1-2 are taken in `c56753ba`, comments only: one file, four `#` lines, the syntax tree equal (checked by the coordinator; n1267e, W22). `c56753ba` is H0 of this landing once `tests` is green on it. CI (Brett Heap's ruling 27): H0 is the head c56753b itself, which passed tests, tests-git-bash and SonarCloud; main has touched none of its files since its base 28be965; and the local gate passed on its predicted squash tree e344d88 over main 3bf35b2: the naming_gate_spelled, naming_policy_line_break, adopt_check_throwaway_repos, path_guard_hygiene, pinned_copy_text, no_auto_maintenance, repo_hygiene, agents_md_codes, cli_reference sets, 774 passed, 4 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 #1267

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
…once, with `--upstream` passed too, and refuses a path or a value that is no `owner/repo` in the pin's name; shape-doctor.py answers as it did (#1203) (#1269)

`update-shape.py` asks the shape pin's `source_repository:` once, whichever way a run reaches the upstream, and refuses a value that is no `owner/repo` in the pin's name, never in the name of a flag nobody passed (#1203, from lane 5's review of #1166, findings 3 and 9).

Measured on main `be21751c3` (Python 3.12.3, git 2.43.0, a stub `gh` first on PATH, a bogus token, no network). This branch's rows ran against main's `update-shape.py` and `shape-doctor.py` in a scratch worktree, and two probes ran main's tool directly.

- **No `--upstream`, run from the root.** `source_repository: "contracts"` was `REFUSED update-upstream-not-a-repo: --upstream contracts exists but is not a git repository`, exit 2. So were `scripts/repo_shape.py`, `contracts/shape-pin.yaml` and `~/notes` (a folder under `HOME`). A clone kept at `~/shape` was opened in place: `check` exit 1, the copies compared.
- **The values #1166 already names in the pin** (a line feed, a trailing space, `has space/x`) still had the remedy "or pass `--upstream` a path to a clone of openRepoShape".
- **`--upstream <a local clone>` passed.** The pin's value was never asked, and every value above gave `check` exit 1 with its report. `apply --yes --at <B> --branch shape/fu-lf` over `"opensoft/openRepoShape\n"` exited 0 and made this commit: `Re-sync the shape copies to opensoft/openRepoShape`, then a line feed, then ` @ 4032a512eb2e`. The `gh pr create` line it printed was split inside its `--title` quotes.
- **The pin and `--upstream "opensoft/openRepoShape\n"` both bad:** the refusal named the flag.

- **`update-shape.py`: a new `pin_source(pin, pin_path)`.** `prepare` asks it once, after reading the pin and before opening the upstream, with or without `--upstream`. It asks three questions, under the codes these values already had:
  - **Something is at the value where the command runs, and it holds no git repository:** `update-upstream-not-a-repo`. The value is looked up the way `open_upstream` looks up `--upstream`: `expanduser`, relative to the working directory.
  - **`REPOSITORY_RE` does not take the whole value** (`fullmatch`): `update-upstream-unresolvable`.
  - **`checked_value` refuses it:** `unsafe-value`.
- **What each refusal says.** Each names the pin and its field, ``<root>/contracts/shape-pin.yaml: `source_repository:` ``.
  - Since #1166 the second one said "which is neither a path on this machine nor an `owner/repo` name". It now says "which is not an `owner/repo` name", because a path is never what the pin holds.
  - The remedy no longer offers `--upstream` a path, since passing one no longer gets past the question. For the name refusals it reads: "write `source_repository:` in the pin as the `owner/repo` its shape was copied from, `opensoft/openRepoShape` for this standard's. It is asked with `--upstream` passed too, because `apply` names it in its commit and its pull request; a path to a clone goes to `--upstream`." The `update-upstream-not-a-repo` refusal adds a sentence (N2, below): "The value is also looked up as a path from the directory this runs in: if it is already right, run this from a directory where nothing is at that path."
- **`open_upstream(spec)` asks only about `--upstream` again.** #1166's `pin_path` and its two pin-named branches moved into `pin_source`. Both functions use `_holds_a_repository` as their one repository question.
- **`prepare(args, *, ask_source=True)`.** `shape-doctor.py`'s `check_shape_currency` call passes `ask_source=False`. Its `refusals_ahead` call asks the field (S2 of the review round, below).
  - Why: the doctor reads any `Refusal` out of `prepare` as its own checkout being unable to answer. `update-shape.py`'s comment above `_ABSENT_ERRNOS` documents this.
  - Measured with the field asked there: a hand-edited `source_repository:` turned the `shape currency` row from exit 1 (behind) into CANNOT ANSWER, exit 3. Its NEXT was `git -C <standard> fetch --all`, and its `why` was "this checkout of the standard does not carry the commit the pin names".
  - With the opt-out at `check_shape_currency` the doctor answers as it does on main. Where the root is behind, the doctor's NEXT is `update-shape.py check`, which refuses the field in the pin's name.
- **Codes:** none added, renamed or removed.
- **Tests:**
  - `tests/test_update_shape_pin_source.py` is new, with 36 rows: 22 from the first round, 12 from the review round and 2 from the second round (NIT A, one in each route).
  - `tests/test_update_shape_merged_away.py`: two new rows, the doctor's `pins` row over a hand-edited source (S2) and over a source that `check` cannot read (NIT B). The S2 row's lines that edit the pin moved into a helper, `source_written_as`, which both rows use.
  - `tests/test_value_pattern_line_break.py`: #1166's `WRITE_THE_PIN` remedy and the unresolvable words are updated. `test_an_upstream_passed_with_a_line_feed_is_named_as_passed` now keeps the pin as scaffolded. It used to name the flag "whatever the pin says", which this change ends on purpose; the pin is now named first.
  - `tests/test_update_shape_unreadable.py`: the `temporaries` stand-in wraps `open_upstream(spec)`.

rv1269 (opus) found this PR NOT READY at `86c1e6ea2` on two SHOULDs and six NITs (#1269 issuecomment-6725508050). It confirmed the fix, its rows, mutants, gates and merge-trees, and the writer's three choices. This round fixes the two SHOULDs and N1 to N5, keeps N6 as it was, and changes nothing else. Commits: `175d9b718` (the code and its rows) and `c792615f4` (one more row).

- **S1. A pin value `~<unknown user>/...` was a Python traceback, exit 1.**
  - `Path(declared).expanduser()` raises `RuntimeError: Could not determine home directory.` for a user the machine does not have (measured on 3.12; rv1269 found 3.13 and 3.14 raise the same). Exit 1 is also `check`'s "behind" code. With `--upstream` passed this was new (main exited 1 with a report); with none, main crashed too.
  - Fix: a new `_named_here(declared)` looks the value up as `open_upstream` does and, where `expanduser` raises, keeps the bare path. Nothing is there, so the name question refuses it `update-upstream-unresolvable` in the pin's name, in both routes. The scaffolded value is unchanged.
  - Rows (4, each failing at `86c1e6ea2`): `test_a_tilde_user_who_is_not_there_is_refused_in_the_pins_name`, and `test_a_tilde_user_who_is_not_there_is_looked_up_as_the_bare_path` (a folder of that very name where the command runs, holding no repository, is `update-upstream-not-a-repo`), each in both routes.
- **N1. A first part over 255 bytes was `update-unreadable ... (File name too long)`**, with a permissions remedy, naming neither the pin nor the field.
  - Fix: `_named_here` takes `ENAMETOOLONG`, and only that errno, as nothing there. Every other refused `stat` is raised as it was.
  - Rows (5): `"r" * 300 + "/has space"` is `update-upstream-unresolvable` and `"r" * 300 + "/x"` is `unsafe-value` (`checked_value` refuses over 255 characters), each in the pin's name and in both routes (4 rows, each failing at `86c1e6ea2`); and `test_any_other_refused_stat_of_the_pins_value_is_raised_as_it_was`, a control that passes at `86c1e6ea2` too: a `PermissionError` out of the `stat` is raised out of `pin_source`.
- **S2. The doctor's `refusals_ahead` opt-out made a `pins` row sentence false.**
  - Over two collision copies merged away plus `source_repository: "has space/x"`, the `pins` row said "`update-shape.py check` reports them `merged-away`, and the `apply` it prints drops their pin rows", and its NEXT was that `check`, which exits 2 with `update-upstream-unresolvable` and reports nothing.
  - Fix: `ask_source=False` is dropped at `refusals_ahead` only. `prepare` refuses, so `refusals_ahead` returns None, as its docstring says it does where `prepare` refuses, and the `pins` row keeps the gate's finding. `check_shape_currency` keeps the opt-out. The scaffolded case, with the same two copies, is unchanged: `test_a_merged_away_copys_row_goes_and_the_project_is_green_again` still passes and still asserts `merged_away` and the `check` NEXT. rv1269's mutant R1 (`refusals_ahead` asks) is now the code.
  - Row: `tests/test_update_shape_merged_away.py::test_the_pins_row_keeps_the_gate_where_check_refuses_the_pins_source`, failing at `86c1e6ea2`. It also holds that `check` exits 2 `update-upstream-unresolvable`, and that the `shape currency` row still counts the two rows `merged-away`, with no CANNOT ANSWER.
- **N2. The Limits bullet on a non-repository `opensoft/openRepoShape` folder is now measured** (Limits, below). The remedy of `update-upstream-not-a-repo` for a pin's value ends with "The value is also looked up as a path from the directory this runs in: if it is already right, run this from a directory where nothing is at that path." The other pinned words did not change: `WRITE_THE_PIN` stays what #1166's rows and the name refusals say.
  - Rows (3): the scaffolded pin run from a folder holding a non-repository `opensoft/openRepoShape`, in both routes (failing at `86c1e6ea2`: no such sentence); and the same pin with `--upstream` run from a folder where nothing is at that path, exit 1 as the scaffolded pin gives (a control).
- **N3.** The comment above `REPOSITORY_RE` no longer says it is the pin's value "where no `--upstream` is passed".
- **N4.** `test_the_doctor_does_not_call_a_hand_edited_source_the_standards` also asserts the `shape currency` row's status is `ok`, main's answer (measured on main's code in the scratch worktree, `ok`). Mutant D1 below is what only that assert kills.
- **N5.** The Merges section below is refreshed: main and the PRs were read fresh.
- **N6.** The Sourcery summary below the footer is kept exactly as it was: no closing keyword; body-guard exits 0.

Rows failing at `86c1e6ea2`'s `update-shape.py` and `shape-doctor.py` (this round's tests, the scratch worktree detached at `c792615f4`): **19 failed, 34 passed** of 53 tests. The 19: 8 rows whose expected remedy gained N2's sentence (the issue's three path values in both routes, and `~/notes` in both), the 4 S1 rows, the 4 N1 rows, the 2 N2 rows, and the S2 row. The controls that pass at `86c1e6ea2` are the N1 `PermissionError` row, the N2 run-elsewhere row, and the N4 assert.

rv1269b (sonnet) found this PR READY at `c792615f4`, with three NITs and no MUST or SHOULD (#1269 issuecomment-6726841735). This round fixes NITs A and B as it measured them, refreshes C, and changes nothing else. Commit: `52e5c1883` (two one-line fixes with their comments, three rows and a helper).

- **NIT A. A raw NUL byte after the `~` in the pin's value was a traceback, exit 1.**
  - `Path('~a<NUL>b/x').expanduser()` raises `ValueError: embedded null byte`, which `_named_here` did not catch: it caught `RuntimeError` only. Plain or quoted in the pin, in both routes. It is contrived, since the pin file would be binary. With no `--upstream` main crashed the same way; with one passed, main exited 1 with a report, so there it was new.
  - Fix: `except (RuntimeError, ValueError)`, keeping the bare path. A NUL in the bare path is nothing there (`_mode_of` already answers a NUL in a name that way), so the name question refuses the value `update-upstream-unresolvable` in the pin's name, exit 2. rv1269b's mutant Y3 is the code now.
  - Row (1, in both routes, so 2 ids, each failing at `c792615f4`): `test_a_nul_byte_after_a_tilde_is_refused_in_the_pins_name`. Its NUL byte is built with `chr(0)`.
- **NIT B. The doctor's `pins` row could read "could not be run" in one narrow case.**
  - Setup: two collision copies merged away, a pin value `locked/x`, and an unsearchable `locked` in the directory the doctor runs in. Since S2 the doctor asks the field in `refusals_ahead`, and `pin_source`'s `stat` of `locked/x` raises `PermissionError`. `refusals_ahead` caught `Refusal` only, so the row read `could not be run: [Errno 13] Permission denied: 'locked/x'`, where before S2 it kept the gate's finding. `update-shape.py check`, the row's NEXT, exits 2 `update-unreadable` there. The verdict, the exit and the `shape currency` row did not change.
  - Fix: `except (Refusal, OSError): return None` in `refusals_ahead`, so the row keeps the gate's finding. Its docstring and comment say so. rv1269b's mutant Z1 is the code now.
  - Row (1, failing at `c792615f4`): `tests/test_update_shape_merged_away.py::test_the_pins_row_keeps_the_gate_where_the_pins_source_cannot_be_read`. It uses real modes: `locked` is mode 000 and is given back in a `finally`, and the row skips on Windows and as root, as `tests/test_bump_leg_unopenable.py` does. It also holds that `check` exits 2 `update-unreadable: locked/x`, and that the `shape currency` row still counts the two rows `merged-away`, with no CANNOT ANSWER.
- **NIT C.** The Merges section below is read fresh. The counts in Rows failing on main, Mutants and Runs are this round's.

Rows failing at `c792615f4`'s `update-shape.py` and `shape-doctor.py` (this round's tests, the scratch worktree at `52e5c1883`): **3 failed, 53 passed** of 56 tests. The 3 are the rows above: 2 for NIT A and 1 for NIT B.

**Refused.**

- **Why.** The value is the name `prepare` gives the upstream in both routes. The README `Shape:` line is compared with it, and `apply` writes it into its commit subject, its pull request's title and the lines it prints.
- **Cost.** No tool writes a path there: both templates hold `{{SHAPE_REPOSITORY}}`. So refusing one costs no root that a tool made.
- **One answer for both routes.** The same question is asked whether or not `--upstream` is passed:
  - **A value that names something here holding no repository** (`contracts`, `scripts/repo_shape.py`, `~/notes`) is `update-upstream-not-a-repo`, with or without `--upstream`.
  - **A path not spelled `owner/repo`** (`~/shape`, `/srv/shape`) is `update-upstream-unresolvable`, even where it holds a clone. This is the one answer that changes for a run with no `--upstream`: main opened such a clone in place.
  - **An `owner/repo` spelling that is a repository where the command runs** is taken, as on main. An example is a checkout laid out by owner, run from the folder above `opensoft/openRepoShape`. With no `--upstream` it is opened in place.

Command: this branch's `tests/test_update_shape_pin_source.py` (36 rows), five tests of `tests/test_value_pattern_line_break.py` (the selection the mutants use, 18 ids), and the S2 and NIT B rows of `tests/test_update_shape_merged_away.py` (56 tests), run against main's (`be21751c3`) `update-shape.py` and `shape-doctor.py`, in the scratch worktree detached at `52e5c1883`.

Result: **36 failed, 20 passed** in 39.41s, of those 56 tests (the review round ran the whole of `tests/test_value_pattern_line_break.py`, 31 ids, and gave 33 failed, 33 passed of 66 in 47.41s; the first round's two files gave 21 failed, 32 passed).

The 36 are the first round's 21, the review round's 12 (S1: 4, N1: 4, N2: 2, S2: 1, and the `PermissionError` row, which fails on main because there is no `pin_source`) and the second round's 3 (NIT A: 2, NIT B: 1). The first round's 21:

- **12 rows:** `test_the_pins_source_is_asked_in_both_routes_in_the_pins_name`, the issue's six values (`a-folder`, `a-file-spelled-owner-repo`, `the-pin-itself`, `line-feed`, `trailing-space`, `a-space`) in both routes. On main:
  - `no-upstream`: `--upstream ... exists` for the three paths, and #1166's old remedy for the other three;
  - `upstream-a-clone`: exit 1 and a report.
- **4 rows:** `test_a_source_under_home_is_looked_up_as_open_upstream_looks`, `~/shape` (a clone) and `~/notes` (a folder) in both routes. On main: exit 1 three times, and `--upstream ~/notes exists ...` once.
- **`test_a_source_checked_value_refuses_is_refused_with_upstream_passed`:** exit 1 on main.
- **`test_the_pins_source_is_named_before_a_bad_upstream`:** main named the flag.
- **`test_apply_over_a_refused_source_writes_nothing`:** exit 0 and a commit on main.
- **#1166's `test_a_pins_source_that_is_no_owner_repo_is_named_as_the_pins[line-feed]` and `[space]`:** main gives the old words and remedy.

Four rows pass on main by design, because they hold answers this change keeps:

- the scaffolded pin with no `--upstream` reaches `open_upstream` with `opensoft/openRepoShape` (in-process, with a stand-in that opens the local upstream);
- the `owner/repo` clone where the command runs is opened in place;
- the doctor's `shape currency` row is no `environment` row and the doctor does not exit 3, and its status is `ok`;
- the scaffolded pin with `--upstream` passed, run from a folder where nothing is at `opensoft/openRepoShape`, is exit 1 over the upstream one commit on.

Setup:

- Each mutant was applied alone to this branch's production file (to the test file for N4) in a scratch worktree detached at `52e5c1883`. All the mutants below were run again on this head, the review round's and the first round's too, because `_named_here` and `refusals_ahead` changed.
- Each ran against 56 tests: `tests/test_update_shape_pin_source.py` (36 rows), five tests of `tests/test_value_pattern_line_break.py` (#1166's three `update-shape.py` rows and the two pattern tests, 18 ids), and the S2 and NIT B rows of `tests/test_update_shape_merged_away.py`. The D1 runs are the doctor guard row alone.
- After each, the four files were put back, with their sha256 checked against the commit's bytes (`restored=yes` for all 32 mutants, for the control run with no mutant, and for the two swaps of main's and `c792615f4`'s production files). At the end the worktree was clean at `52e5c1883`.
- The first round's M1-M10 were run again. M4, M5 and M7 are re-aimed: the path question and `expanduser` moved into `_named_here` and `pin_source`; M7 now names the `(RuntimeError, ValueError)` guard.

This round's mutants:

| Mutant | Result | Killed by |
|---|---|---|
| NIT A the guard back to `RuntimeError` alone (the inverse of rv1269b's Y3, which is the code now) | 2 failed | the NUL rows, one per route |
| NIT A `ValueError` alone | 4 failed | the S1 rows (`~<unknown user>`), both routes |
| NIT B the catch back to `Refusal` alone (the inverse of rv1269b's Z1, which is the code now) | 1 failed | the NIT B row |
| NIT B `OSError` alone, no `Refusal` | 1 failed | the S2 row |
| NIT B `(Refusal, PermissionError)` | **survives** (56 passed) | nothing: the row's `stat` is refused `EACCES`, a `PermissionError`, so a narrower catch cannot be told from `OSError` by a real mode; `OSError` is what rv1269b's Z1 catches, and it covers any other errno |
| NIT B the opt-out put back at `refusals_ahead`, the `OSError` catch kept | 2 failed | the S2 row and the NIT B row |

The review round's mutants, run again:

| Mutant | Result | Killed by |
|---|---|---|
| S1 the guard removed (`RuntimeError` and `ValueError`) | 6 failed | the S1 rows (4), both routes, and the NUL rows (2) |
| S1 the bare path not kept (`return None`) | 2 failed | the bare-path row, both routes |
| N1 the `ENAMETOOLONG` test removed | 4 failed | the four long-name rows |
| N1 every `OSError` taken as nothing there | 2 failed | the `PermissionError` row and the NIT B row |
| S2 the opt-out put back at `refusals_ahead` (the inverse of rv1269's R1, which is the code now; the `OSError` catch kept) | 2 failed | the S2 row and the NIT B row |
| N2 the sentence removed from the not-a-repo remedy | 12 failed | the three path values and `~/notes` (both routes each), the two N2 rows, the bare-path rows |
| N2 the sentence added to the name refusals too | 17 failed | the name refusals: the issue's three name values and `~/shape`, the tilde, NUL and long-name rows, named-first, #1166's two |
| D1 the doctor's `shape currency` row asks the field and calls a refusal a plain FINDING (exit 1, no `environment`) | 1 failed | the guard row's new status assert |
| D1 with N4's assert undone | **survives** (1 passed) | nothing: that assert alone kills D1 |
| N4's assert undone, production as committed | 56 passed | a control: the assert holds main's answer |

The first round's mutants, run again:

| Mutant | Result | Killed by |
|---|---|---|
| M1 the question removed from the `--upstream` route | 19 failed | every `upstream-a-clone` row, checked_value, named-first, apply, the S1, N1, N2, S2 and NIT B rows, and the NUL row of that route |
| M2 the question removed from the no-`--upstream` route | 20 failed | every `no-upstream` row, #1166's three pin rows, the doctor row, the S1, N1, N2, S2 and NIT B rows, and the NUL row of that route |
| M3 `fullmatch` put back to `match` | **survives: equivalent** (56 passed) | `REPOSITORY_RE` ends in `\Z` since #1166, so `match` and `fullmatch` agree on every string (rv1269 checked 66,430) |
| M3b `match` and `REPOSITORY_RE`'s `\Z` put back to `$` | 7 failed | the line-feed rows (both routes), named-first, apply, #1166's line-feed rows, the pattern's own row |
| M4 the path question removed | 12 failed | the three path values and `~/notes`, both routes; the bare-path and N2 rows |
| M5 any path refused, a repository or not | 3 failed | `~/shape` both routes, the `owner/repo` clone where it runs |
| M6 `checked_value` dropped | 4 failed | the checked_value rows and the long-name `unsafe-value` rows |
| M7 no `expanduser` | 2 failed | `~/notes` both routes |
| M8 asked after the upstream is opened | 20 failed | every `no-upstream` row but `~/shape`, named-first, the doctor row, #1166's three, the S1, N1, N2, S2 and NIT B rows, and the NUL row of that route |
| M9 the doctor's `shape currency` call asks the field | 3 failed | the doctor row, the S2 row and the NIT B row |
| M10 `ask_source` defaults to False | 19 failed | as M1 |

rv1269b's own mutants (its `mutate2.py`), run on this head:

| Mutant | Result | Killed by |
|---|---|---|
| Y1 `_named_here` takes `ENOENT` where it took `ENAMETOOLONG` | 4 failed | the four long-name rows |
| Y2 `EACCES` taken as nothing there too | 2 failed | the `PermissionError` row and the NIT B row |
| Y4 the not-a-repo remedy's last words changed | 12 failed | the rows that pin the remedy |
| Y7 `_named_here` returns the candidate where nothing is there | 26 failed | the rows that read nothing-there as a path, in both routes |
| Y5 `or not args.upstream` dropped from `prepare`'s condition | **survives: unreachable** (56 passed) | nothing: the only caller that passes `ask_source=False` passes `upstream=` too (rv1269's R2) |
| Y6 `.resolve()` dropped from the path question | **survives: equivalent** (56 passed) | nothing: rv1269b read it as equivalent, since both stats of `_holds_a_repository` follow a link as `resolve()` does |

Gates ran on the commit `52e5c1883` (dirty=0), with a stub `gh` first on PATH, `GH_TOKEN` bogus, an empty `GH_CONFIG_DIR`, a blank git identity, `GIT_SSH_COMMAND=false`, `GIT_CONFIG_GLOBAL=/dev/null`, Python 3.12.3 and git-filter-repo 2.47.0 (`git filter-repo --version` prints `a40bce548d2c`). A first writer ran gate A on 2.43.0 and was stopped for a workstation reboot in gate B; a second writer ran the rest, at the same head.

- **git 2.43.0** (`/usr/bin/git`):
  - **Gate A**: the 20 `tests/test_update_shape*.py` files (this PR's new one among them), `tests/test_value_pattern_line_break.py`, 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`: 1360 tests, one run. **1355 passed, 5 skipped** in 830.98s (the review round: 1352; this round adds the 3 rows).
  - **Gate B**, run because `shape-doctor.py` changed: `test_shape_doctor`, `test_doctor_unreadable_pin`, `test_doctor_next_is_a_command`, `test_doctor_partial_clone`, `test_doctor_pin_restore_merges`, `test_shape_pin_files_not_a_list`, `test_pin_source_env_collisions` and `test_bom_reads`: 827 tests, by node id in 10 runs of at most 90. **824 passed, 3 skipped** (1194s in all, summed over the runs; the review round: 824 passed, 3 skipped).
- **git 2.47.1** (built from kernel.org's tarball, first on PATH, `git --version` printed into every log):
  - **Gate A**, in 16 runs of at most 90 ids each, so that no run held the slot for over 100 tests: **1355 passed, 5 skipped** (787s in all), the same count as on 2.43.0.
  - **Gate B**, in 10 runs of at most 90: **824 passed, 3 skipped** (1192s in all), the same count as on 2.43.0.
- **The ids** of both gates were collected at this head (1360 and 827, identical to the first writer's lists, which were collected at the same head).
- **The skips are the same on both gits:** 3 `test_update_shape_add_symlink.py:832` (junctions are NTFS's), 2 `test_no_auto_maintenance.py:222` (the session began with `GIT_CONFIG_GLOBAL` set) and 3 `test_shape_doctor.py:10516` (the PowerShell line is printed, and powershell.exe exists, only on a Windows host). The new NIT B row ran, as uid 1000; it skips only as root or on Windows.
- **The review round's runs**, on `c792615f4`: gate A 1352 passed, 5 skipped (699s on 2.43.0) and gate B 824 passed, 3 skipped (1045s), by the writer; rv1269b re-ran both at `c792615f4` with the same counts on both gits. On 2.47.1 the writer's gate A ran as 17 runs under 100 tests.
- **The first round's runs**, on `e1692c147` and `86c1e6ea2`: gate A 1339 passed, 5 skipped and gate B 824 passed, 3 skipped, on both gits. A first doctor run on 2.47.1, at `e1692c147`, had failed three rows of `test_doctor_unreadable_pin.py`: their stand-in for `prepare` took one argument and the doctor now passes `ask_source`. `86c1e6ea2` widens the stand-in. rv1269 re-ran both gates at `86c1e6ea2` with the same counts.
- **The rows on main, the rows at `c792615f4` and the mutants** above ran on git 2.43.0.

Run with `git merge-tree --write-tree <other> 52e5c18` (git 2.43.0) at 2026-11-09T14:14:11Z, at heads read fresh just before the push. All are clean (exit 0, no conflict line):

- main `2fde6c3d0`: tree `35c270e2`. Main is 15 commits past this branch's base `be21751c3`. #1159, #1147 and #1172 have merged (#1172 at 2026-11-09T14:01Z as `2fde6c3d0`, which is main now), so they are no longer listed. #1172's change to `shape-doctor.py` lies well away from `refusals_ahead`, and its merge with this head is clean.
- #1231 `aca00dfd9` (`update-shape.py`): `ba12a305`.
- #1241 `ab137eb5f` (`update-shape.py`, `tests/test_update_shape_unreadable.py`): `052a989f`.
- #1248 `1b747f7ab` (`shape-doctor.py`): `9c022d62`.
- #1273 `0657e3964` (`tests/test_value_pattern_line_break.py`): `9da0792f`.
- #1274 `e39b5d7e3` (`shape-doctor.py`): `a570550a`.

Main, #1248 and #1274 touch `shape-doctor.py`. None of the added or removed lines of any of these heads, against its merge base with this head, in the seven files this PR touches (`update-shape.py`, `shape-doctor.py` and five test files) mentions `open_upstream`, `pin_path`, `prepare(`, `source_repository`, `WRITE_THE_PIN`, `REPOSITORY_RE`, `refusals_ahead`, `ask_source`, `pin_source`, `expanduser`, `ENAMETOOLONG` or this round's `_named_here`, `source_written_as` and `NUL_AFTER_TILDE` (read from `git diff` against each merge base). One name is shared: #1241 uses a `needs_a_mode` mark in `tests/test_update_shape_unreadable.py`, and this round's `needs_a_mode` is defined in `tests/test_update_shape_merged_away.py`, so each file has its own. The rows on the merged tree with current main are left to the landing gate. Lane 3 says the later lander takes the refresh.

- **The doctor does not name a hand-edited `source_repository:` itself**, as on main: where the pin names the standard's commit, its row is `ok`. Naming it on the pin's side would mean teaching `pin_restore`, whose history walk reads pins with `check_pin`, the same question, and the path half of that question reads the working directory. That is a follow-up candidate, not this PR.
- **The path question reads the working directory**, as `open_upstream` does for `--upstream`. So `scripts/repo_shape.py` is refused when run from the root, and taken as an `owner/repo` name when run from elsewhere. For any one directory, both routes give the same answer.
- **A folder holding no repository at `opensoft/openRepoShape` where the command runs** (an unpacked archive, say) refuses the scaffolded pin with `--upstream` passed. On main only the run with no `--upstream` refused it. Measured by rv1269 and by this round's rows: the refusal is `update-upstream-not-a-repo` in the pin's name, in both routes, and its remedy now ends by saying to run it from a directory where nothing is at that path. That run answers as the scaffolded pin does (`--upstream` route: exit 1).
- **The doctor's `shape currency` row, over a hand-edited source and merged-away copies,** still names `update-shape.py check` as its NEXT, and that `check` refuses in the pin's name (exit 2). The row answers as on main by design (the first bullet). The `pins` row, which states what `check` reports, asks the field since the review round.
- **`--upstream ~<unknown user>/x` on the command line** is still a `RuntimeError` traceback out of `open_upstream` (measured in process), as on main, and an argv value whose first part is over 255 bytes is `update-unreadable` naming that path. Both name the value a person passed, not the pin. A follow-up candidate, not this PR.
- **`REPOSITORY_RE` takes `.` and `..` as an owner**, so `../shape` is `owner/repo`-shaped. Unchanged.

Review: rv1269, lane 5's independent opus reviewer, which wrote none of #1269: NOT READY at `86c1e6ea` on two SHOULDs (issuecomment-6725508050), both fixed in `c792615f`. Then rv1269b, lane 5's independent sonnet reviewer, which wrote none of it: READY at `c792615f` with NITs A-C (issuecomment-6726841735), fixed in `52e5c188`. Then rv1269c, lane 5's independent sonnet reviewer, which wrote none of it: READY at `52e5c188`, H0 of this landing (issuecomment-6745471925). CI (Brett Heap's ruling 27 and his fast-refresh ruling of 2026-10-15T22:48:35Z): H0 52e5c18 passed tests, tests-git-bash and SonarCloud; the head a31f0cf is a clean update-branch merge of main e22f295, with tests-git-bash and SonarCloud green; and the local gate passed on its predicted squash tree af35c58 over main e22f295: the doctor_unreadable_pin, update_shape_merged_away, update_shape_pin_source, update_shape_unreadable, value_pattern_line_break, adopt_execute_refusals, adopt_filter_repo_origin_url, adopt_one_byte_locale, adopt_pins, adopt_plan_and_remote_paths_spelled, adopt_plan_source_branch_shown, adopt_spelled_names, adopt_template_values, chain_link_fold, clone_url_bytes, family, non_utf8_name_helpers, pin_source_unreadable, pinned_copy_text, stdout_encoding, update_shape_apply_lines_and_headers, update_shape_header_comments, update_shape_messages, validate_pins_spelled_and_named, path_guard_hygiene, no_auto_maintenance, repo_hygiene, agents_md_codes, cli_reference sets, 1866 passed, 4 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 #1203

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

Copy link
Copy Markdown

@brettheap
brettheap marked this pull request as ready for review November 10, 2026 07:53
@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 5 days and 5 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@brettheap
brettheap merged commit 0354a7e into main Nov 10, 2026
5 checks passed
@brettheap
brettheap deleted the fix/1168-load-yaml-shown branch November 10, 2026 07:54
brettheap pushed a commit that referenced this pull request Nov 10, 2026
…70a23c) into fix/1279-refusals-shown

Step 1 of the three-merge restack of #1284 after #1274 landed as a squash. 52a140c is 136b38d (the head this branch carried) plus the pilot's refresh with main; the merge is clean and changes no file this PR owns.

Lane: openreposhape-5 (openRepoShape-5)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
brettheap pushed a commit that referenced this pull request Nov 10, 2026
…flicts resolved to this branch's side

Step 2 of the three-merge restack of #1284 after #1274 landed as a squash. #1274's final head H74 is 52a140c and its squash S74 is 0354a7e; their trees are equal (2fb87fe), so main changed nothing in any file after H74.

Two files conflict, both files #1274 changed, and every hunk is resolved to this branch's side:
- shape-doctor.py (1 hunk): the docstring of `naming_script_refusal`. This branch's text says `policy-wrong-kind` is spelled since #1279 and a root's library never reaches the function; the squash's text says it is named raw. Resolved blob c08b1c8 equals merge 1's.
- tests/test_load_yaml_refusals.py (3 hunks): the `wrong-kind` param and the docstring of `test_the_doctor_finds_its_own_policy_in_the_naming_scripts_refusal`, and the body and docstring of `test_the_doctor_still_finds_its_own_policy_named_raw`. Resolved blob da9734c equals merge 1's and the head 0270d48's.

scripts/repo_shape.py auto-merged. The tree of this commit equals merge 1's (d57d76c), so the merge changes no line.

Lane: openreposhape-5 (openRepoShape-5)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Nov 11, 2026
…tHub's limits (an owner over 39 characters, a repository over 100) names no `org/repo`, by the rule `_github_name` reads a typed name by, so `plan --org testorg` is no longer told to pass `--org <40 c's>`, `check` holds the plan alike with `origin` there or gone, and the doctor's adoption line asks for `--org` (#1211) (#1304)

A local source whose `origin` names an owner over 39 characters or a
repository over 100 (GitHub's limits, `GITHUB_OWNER_MAX` and
`GITHUB_NAME_MAX`) names no `org/repo` now, as a path `origin` does.
`url_repository`, the one reading of an `origin`, which
`adopt-project.py` and `shape-doctor.py` both ask, asked neither limit,
though `_github_name` asks both of a typed or recorded `owner/repo`
(#1129). So `plan --org testorg` on a clone whose `origin` is
`https://github.com/<40 c's>/Thing.git`, or the same on gitlab.com, was
refused `adopt-not-the-source` and told to run `plan` again with `--org
<40 c's>`, which `execute` refuses as `adopt-org-too-long` (a repository
of 101 was told `--project <101 r's>`); `plan` with no `--org` wrote
`org: <40 c's>`, which `execute` also refuses; `check` held a plan to
that name while `origin` was there (`plan-not-the-source`) and to
nothing once it was gone (`plan ok`); and the doctor's adoption line for
such a clone, `the way in`, carried no `--org`, as it read `<40 c's>` as
`plan` did.

Now `plan --org testorg` writes the plan (exit 0) with `repository:
null` and offers nothing; `plan` with no `--org` is `adopt-no-org`
("pass --org <org>"), as for a path `origin`; `check` says `plan ok`
with `origin` there or gone, and `execute` without `--yes` says
`adopt-unconfirmed` either way; and the doctor's line ends `--org
<your-org>`, with its why, "this repository's `origin` names none that
`plan` can read", as for a path `origin` (#545), so the line and `plan`
still read one answer. Nothing changes at the limits: an owner of 39 and
a repository of 100 are read as before, by `plan`, `check` and the
doctor.

The rule is one function, `repo_shape.github_can_hold(owner, repo)`: an
owner of at most `GITHUB_OWNER_MAX` and a repository of at most
`GITHUB_NAME_MAX`, counted once one trailing `.git`, in any case, is
dropped. `_github_name` hands it the repository as written, with the
answer its own count gave for every spelling, and `url_repository` hands
it the last segment of the url's path as written, `.git` and all, so an
`origin` and the same `owner/repo` typed get one answer:
`https://github.com/testorg/<100 r's>.git.git` names nothing, as
`testorg/<100 r's>.git.git` names nothing to `_github_name`. The two
limits were defined in `shape_materialize.py`, which imports from
`repo_shape.py`; `repo_shape.py` cannot import back, and is copied alone
into every assembly root and family holder. So they are defined in
`repo_shape.py` now, and `shape_materialize.py` imports them, as it
imports `TOPIC_PREFIX`; every other importer still reads them from
`shape_materialize`. `repo_shape.py` is digest-pinned in every estate,
and v1.2.1 already changes it (#1126, #1266 and #1274 since the v1.2.0
tag), so this adds no re-pin of its own.

The limits go in `url_repository`, not `_remote_repository`, as the
issue left to settle. With them in `_remote_repository` alone, `plan`
would refuse that `origin` as `adopt-no-org` while the doctor, which
reads `url_repository` through `origin_org`, still offered its line with
no `--org`: #545's case, made again. Review ran that narrow fix and 10
rows failed.

Not changed: `adopt-no-org`'s words, which say the `origin` "ends in no
`org/repo`" and name no limit, and `--org`'s help; no NOTE is printed
for such an `origin`, as for a url that ends in no `org/repo`;
`url_repository` drops only a lowercase `.git`, as before, and the limit
counts a `.GIT` name with the `.GIT` dropped, as `_github_name` does;
`github_can_hold` asks lengths only, not owner characters; and `--source
github.com/<40 c's>/Thing` with that directory here is
`source-unresolvable`, as for every `github.com/` spelling that names no
`owner/repo` (`--source ./github.com/<40 c's>/Thing` is read in place,
with no `gh` call).

Measured, by one probe of 50 commands run on the bytes before and after,
in the landing gate's environment with a `gh` that refuses every call:
21 changed, as above, and 29 are byte-identical, among them every
`origin` at the limits (an owner of 39, a repository of 100 with `.git`,
`.GIT` or a trailing `/`), a path `origin`, no `origin` and six doctor
rows. No `adopt-project.py` command made a `gh` call. Review added 11
commands and a sweep of 13,440 urls: 2,453 answers change, every one to
None, and each url is past a limit.

34 new rows: 30 in `tests/test_adopt_source_github_limits.py` and 4 in
the `ORIGIN_ORGS` table of `tests/test_shape_doctor.py`. 22 fail at the
bytes before this change, at the assertion that names the defect, and
all 34 pass; the 12 controls pass both ways. They are `url_repository`
read by the rule a typed name is (11 rows, 7 fail), `plan --org testorg`
offering no org (7, all fail), the same `origin` at the limits still the
source (4 controls), `plan` reading no org from such an `origin` (4, 3
fail), `check` and `execute` holding a plan alike with `origin` there or
gone (4, 2 fail) and the doctor's four (3 fail). One row,
`repository-101-slash` (`https://github.com/testorg/<101 r's>.git/`, an
owner of 7 characters, so only the repository is past a limit), kills
the mutant that reads the repository from the url before its trailing
`/` is stripped. All 8 mutants run are killed: the rule left out of
`url_repository` (20 rows), `.git` handled wrongly (M2, M3 and M6, 1 to
5 rows), the owner limit one lower or one higher and the repository
limit one lower (27, 22 and 14 rows), and the `/` read (2 rows).

Before the restack onto #1194's squash,
`tests/test_adopt_source_github_limits.py` with
`tests/test_adopt_unsearchable_source.py` gave 118 passed; the two other
groups of adoption modules that name the three codes 648 passed, 4
skipped and 632 passed, 3 skipped; `tests/test_github_name_limits.py`,
`tests/test_github_limits_init_check_org.py` and
`tests/test_scaffold_leg_path_collisions.py` in one pytest 264 passed;
`tests/test_shape_doctor.py` with
`tests/test_doctor_unsearchable_links.py` and
`tests/test_shape_advisory.py` 546 passed, 3 skipped; and the guards 470
passed, 3 skipped. At the restacked head the 27 gate files give 2131
passed, 9 skipped in three pytests, one at a time, each exit 0:
`tests/test_adopt_source_github_limits.py` with
`tests/test_github_name_limits.py`,
`tests/test_github_limits_init_check_org.py`,
`tests/test_scaffold_leg_path_collisions.py` and the two guards that
always run, 406 passed, 2 skipped; the 18 other adoption modules with
`tests/test_shape_advisory.py`, 1226 passed, 4 skipped; and
`tests/test_shape_doctor.py` with
`tests/test_doctor_unsearchable_links.py`, 499 passed, 3 skipped.

Closes #1211

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

Labels

None yet

Projects

None yet

1 participant