Skip to content

repo_shape.py and adopt-project.py: a plain integer of more digits than this Python reads, or a decimal too large to be finite, is yaml-unparsable by its line, where it was a ValueError traceback or "the number inf", and _read_as says a float in digits with no exponent, where it said "the number 1e+300" (#1212) - #1249

Draft
brettheap wants to merge 6 commits into
mainfrom
fix/1212-overflow-and-long-int-said

Conversation

@brettheap

@brettheap brettheap commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1212

This PR is stacked on #1198 (for #1114): its base is fix/1114-pin-row-value-read-as, at d38e4e36d, and it lands after #1198, which is open and not on main. Its rows read the pin row's wording #1198 puts in. The code itself applies to main without #1198 (see "Without #1198" below).

What

RV1198's NIT-1 and NIT-2 on #1198, both older than it.

scripts/repo_shape.py, _scalar: a plain number this reader cannot make is refused, by its line.

REFUSED yaml-unparsable: <plan>: line 63: a plain integer of 4301 digits is too long for this Python to read as a number
Remediation: unquoted, YAML reads this value as a number, and this reader cannot make one of it, so it refuses it rather than guess. Write it in double quotes if it is text, or as a number of fewer digits, and run the command again.
REFUSED yaml-unparsable: <plan>: line 63: a plain decimal of 401 digits is too large to read as a number: a 64-bit float cannot hold it, so it would be infinite

adopt-project.py, _read_as: a float is said in digits, with no exponent. repr writes 1e+300, 1e-05 and 1.2345678901234568e+16, and the plan's reader reads each of those as text. The digits are now repr's (the shortest that read back as that float), written out in full by decimal.Decimal, with .0 added where they hold no point. So 9 * 300 + .5 is "the number 1000...000.0" (a 1 and 300 zeros), 0.00001 is "the number 0.00001", and 12345678901234567.5 is "the number 12345678901234568.0". The plan's reader reads each of those back as the same float. An integer, a boolean and every other value are said as before. So is #1198's wording for a number the reader reads as itself: "records commit: as the number 7, which is not text".

The change is in scripts/repo_shape.py (an import, a constant, the two branches of _scalar, and comments and docstrings) and in adopt-project.py (an import and _read_as).

Choices #1212 left open

Without #1198

Measured on main 50869f384, in a worktree without #1198, with check:

  • a follow_ups: item of four hundred 1s and .5: "item 1 of follow_ups: is the number inf, not text";
  • the same of three hundred 9s and .5: "is the number 1e+300"; and 0.00001: "is the number 1e-05";
  • probe_extra: of 4301 digits: exit 1, the ValueError traceback;
  • a pin's commit: of four hundred 1s and .5: records `commit: inf` (main's repr in _pin_row_problem).

None of the lines this PR changes is a line #1198 changes. Its commit put onto main alone merges clean (git merge-tree --merge-base d38e4e36d origin/main HEAD, exit 0), so its code would mend all of the above on main alone. On this head, the follow-up reads "is the number 1000...000.0", and the other three are the reader's refusal. What needs #1198 is the rows file: it imports #1198's helpers from tests/test_adopt_pin_row_values.py, and its rows for a pin's commit: read #1198's wording. The lane's order puts this PR after #1198, so it is stacked.

Behaviour change

  • A plain integer of more digits than this Python reads (4300 by default), anywhere in any YAML file the reader reads: REFUSED yaml-unparsable with the line and a remedy, where it was a ValueError traceback.
  • A plain decimal too large to be finite: the same refusal, where it was read as inf.
  • _read_as says a float in digits: 0.00001, not 1e-05.
  • Unchanged: 4300 digits is still a number (plan-pin-malformed for a commit:), and a quoted value is text. A float that repr writes without an exponent (7.5, -0.0, 0.1) is said as before.

Rows

tests/test_plan_number_limits.py is new, ASCII only, with 35 rows. The reader's rows call load_yaml and parse_yaml in this process, and the _read_as rows load adopt-project.py as a module. The plan's rows edit a plan plan wrote and run check and execute --yes, with a stub gh first on PATH and --local-remote-dir. Each asserts that gh was asked nothing, that no remotes directory was made, and that there was no traceback. The rows that end in a finding are @needs_filter_repo, as #1198's are. The refusal rows run anywhere, because execute loads the plan before it asks for git filter-repo. The 21 rows that read or build an integer of thousands of digits set sys.set_int_max_str_digits(4300) and PYTHONINTMAXSTRDIGITS=4300, so a host that changed the limit runs them as CI does; the 14 that say a float do not need it. The file also collects at any limit: the one control that compares with the longest integer makes it inside its row, under the setting (see "Round 2").

Group Rows On the base On this head
The reader refuses a number it cannot make, by its line: seven integer forms (block value, negative, zeros, sequence item, flow sequence, flow mapping, nested) and four decimals 11 11 failed (7 ValueError, 4 did not raise) 11 passed
The refusal follows this Python's setting (640, and 5000) 1 1 failed (ValueError) 1 passed
_read_as says a float in digits: 1e300, the largest float, 1.2345678901234568e16, 1e-05, the smallest 5 5 failed (the exponent spelling) 5 passed
check and execute refuse by the line: a commit: of 4301 digits, a key outside pins: of 4301 digits, a commit: too large to be finite 3 3 failed (a traceback twice, "the number inf" once) 3 passed
A float commit: and a float follow_ups: item are said without an exponent 4 4 failed (the exponent spelling) 4 passed
Control: the reader reads as before (the longest integer, a quoted long integer, the largest finite decimal, a quoted decimal) 4 4 passed 4 passed
Control: _read_as says 7.5, 7.0, -0.0, 0.1 and -3.25 as repr does 5 5 passed 5 passed
Control: _read_as says an integer, a long integer and a boolean as before 1 1 passed 1 passed
Control: a commit: of 4300 digits is still the plan-pin-malformed finding 1 1 passed 1 passed
All 35 24 failed, 11 passed 35 passed

The base is #1198's head d38e4e36d merged with main bd3e9c148 (scratch commit d6ed89391, tree 8949c1b2d), with this file added. 80ec29177 is merged with main the same way (scratch commit 3f5b71b3e, tree a09d575c5). Both runs had git-filter-repo 2.47.0 on PATH, so no row skipped. The 11 that pass on the base are the controls: they pin what must not change. Every one of the 24 failures is for the reason in the table.

Mutants

At 80ec29177: 16 mutants of the two files, all killed. Each ran the whole rows file, and both files were restored and their sha256 checked after every run.

Mutant Failed, of 35
R1: int() with no guard 10
R2: the integer refusal without its remedy 10
R3: digits counted against a fixed 4300 1
R4: the sign counted as a digit 1
R5: no infinity check 5
R6: the decimal refusal without its remedy 5
R7: only positive infinity caught 1
R8: the point counted as a digit 5
R9: a long integer read as text 15
R10: an infinite decimal read as text 5
A1: repr put back in _read_as 9
A2: no .0 added 6
A3: format(x, "f") 14
A4: Decimal(x), the exact binary value 8
A5: .0 always added 8
A6: str(x) 9

These ran at 80ec29177, before main moved from 50869f384 to bd3e9c148. The three changes in between (#1180, #1109 and #1235) leave scripts/repo_shape.py byte-identical (git diff 50869f384 origin/main -- scripts/repo_shape.py is empty), and _read_as in adopt-project.py is byte-identical between 80ec29177 and the merge with bd3e9c148 (the same sha256 of the function). So five of the sixteen were run again on that merge, in a scratch worktree with each file restored and its sha256 checked: R1, R5, R7, A1 and A3 failed 10, 5, 1, 9 and 14 of 35, as in the table.

Gate

At 80ec29177: a scratch merge of it with main bd3e9c148: commit 3f5b71b3e, tree a09d575c5. It holds #1198's head d38e4e36d, its parent. Targeted files only, in the landing gate's environment: a stub gh first on PATH, GH_TOKEN=bogus, an empty GH_CONFIG_DIR, an empty global git config, GIT_ALLOW_PROTOCOL and GIT_SSH_COMMAND unset. git-filter-repo 2.47.0, CI's pin, was on PATH for every run below, so no row skipped for want of it. At most two pytest runs at a time, each with one reused basetemp.

The set is 35 test files, narrower than every file that names the reader's functions (grep -l for _scalar, parse_yaml, load_yaml or _read_as finds 134, and the full suite is CI's tests job on this PR):

Chunk Files Result
c1 the rows file, test_adopt_pin_row_values.py, test_adopt_pins.py, test_adopt_plan_value_order.py, test_adopt_plan_yaml_quoting.py, test_family_add_gitlink_and_null_members.py, test_leg_path_yaml_scalars.py, test_update_shape_header_comments.py, test_windows_paths.py, test_yaml_block_scalar_keys.py 1193 passed, 8 skipped
c2 test_yaml_flow_brackets.py, test_yaml_flow_quotes.py, test_yaml_indicator_openers.py, test_yaml_quote_boundaries.py, test_yaml_reader_spaces.py, test_yaml_flow_mappings.py, test_load_yaml_refusals.py, test_reader_refusals_named.py, test_refusal_default_remediation.py, test_adopt_plan_escapes.py 1066 passed
c3 test_adopt_execute_refusals.py, test_adopt_values_as_typed.py, test_adopt_manifest_values.py, test_neutral_pin_entry_one_spelling.py, test_scaffold_manifest_values.py, test_family_init_values.py, test_template_text_placeholders.py, test_repo_hygiene.py, test_path_guard_hygiene.py 1005 passed, 19 skipped
c4 the six source-reading files 579 passed
d0 to d3 test_shape_doctor.py, 112, 113, 112 and 112 ids 111 passed 1 skipped, 112 passed 1 skipped, 111 passed 1 skipped, 112 passed

Every chunk exited 0. In all, 4289 passed, 30 skipped, 0 failed. Every skip is one the files declare and none cites git filter-repo: 8 in c1 (test_leg_path_yaml_scalars.py: five empty parameter sets and three where the templates already read the value back), 19 in c3 (test_family_init_values.py: templates that quote the value), and 3 in the doctor shards (the PowerShell line is printed only on a Windows host).

The rows file ran by itself on the merge: 35 passed. With no git-filter-repo on PATH it is 30 passed and 5 skipped, which are the five rows that end in a finding.

Main then moved to b1f45fa76 (#1144, which edits shape-doctor.py, scripts/shape_advisory.py, tests/test_path_guard_hygiene.py and adds a test file). It touches neither file this PR changes. 80ec29177 merged with it (scratch commit 05f5e65c8, tree 3e3962f43) is clean, and on that merge the rows file, test_path_guard_hygiene.py, test_shape_advisory.py and test_repo_hygiene.py ran again: 304 passed.

Merge-trees

At 80ec29177: git merge-tree --write-tree against each, all clean (exit 0), at the heads fetched on 2026-11-08 (main at 14:01Z, #1169 and #1237 at their heads of 14:04Z):

None of the 24 touches tests/test_plan_number_limits.py. #1210 and #1125 add new _read_as callers: they benefit from the digits and do not conflict with them.

Round 2: RV1249's review, 3146c3ca5 on top of 80ec29177

RV1249 (#1249 (comment)) graded 80ec29177 NOT READY: no MUST, one SHOULD and four NITs, with the behaviour right. One more commit, 3146c3ca5, answers the SHOULD and two NITs, in tests/test_plan_number_limits.py and scripts/repo_shape.py and no other file. NIT-2 (_read_as of inf and nan, which the reader never makes) and NIT-3 (the helpers left alone still spell 1e-05, which pairs with str(value), the text execute writes) are left as RV1249 left them.

  • SHOULD-1, the rows file did not collect under a changed limit. MADE held int(LONGEST), 4300 digits, which was evaluated at import, so PYTHONINTMAXSTRDIGITS=1000 ended in "1 error, no tests collected" before the limit-setting fixture ran. integer-at-the-limit now holds None, and the row makes int(LONGEST) itself, under the fixture. The 35 rows pass with the variable unset, at 1000, at 640 and at 0 (on 80ec29177, at 1000: the collection error).
  • NIT-1, four composite assertions (Sonar S9073) at the old lines 212, 214, 321 and 338, are now one assertion for each fact (four become eight), the two on return codes with the output as their message.
  • NIT-4, "for this Python" was wrong for the decimal. Infinity is a limit of the 64-bit float, not of this Python. The refusal now reads a plain decimal of 401 digits is too large to read as a number: a 64-bit float cannot hold it, so it would be infinite. The line it names, the digit count and _UNMADE_NUMBER_REMEDY are as they were. The integer's refusal still says "for this Python", which is true of it (sys.set_int_max_str_digits sets that limit). Only too_large in the rows pinned the old words: README.md, AGENTS.md and docs/ do not hold them. Two comments in scripts/repo_shape.py that called the decimal a number "this Python cannot make" no longer do.
Check Result
The rows file, PYTHONINTMAXSTRDIGITS unset, 1000, 640, 0 35 passed each (git-filter-repo 2.47.0 on PATH, no skips)
The rows file on 80ec29177 at 1000 1 error, no tests collected
Mutants (RV1249's R1 to R14 and A1 to A11, and five of this round: the old wording put back, "64-bit" dropped, "integer" for "decimal", and the integer control compared with int(LONGEST) + 1 or never made) 30 of 30 killed, each file restored and its sha256 checked. R3, R4, R7 and R13 are each held by one row, as RV1249 measured
Gate, a scratch merge of 3146c3ca5 with main dffc42265 (commit 83698e6a3, tree eda7be55f; it holds #1198's head d38e4e36d): the rows file, #1198's three test files, both hygiene files, test_cli_reference.py, the reader's three refusal files, the six files that read the changed file's source, and test_shape_doctor.py in four shards of 449 ids 1597 passed, 3 skipped (the PowerShell line, Windows only), 0 failed
Main then moved to 5926cccab (adopt-project.py, docs/cli.md and a new test file). A second scratch merge of 3146c3ca5 with it (commit 41e904e86, tree 55fcaf8bb): the rows file (also at PYTHONINTMAXSTRDIGITS 1000 and 0), #1198's three test files, both hygiene files, test_cli_reference.py, the reader's three refusal files and the new test_adopt_plan_partial_clone.py 587 passed, 0 skipped, 0 failed
git merge-tree --write-tree of 3146c3ca5 against origin/main at both dffc42265 and 5926cccab, #1198's head, #1171 8162b874e and the 24 other open PRs that change adopt-project.py all clean; against #1198 the tree is 34d5c9541, this head's own

Not in this PR

🤖 Generated with Claude Code
Lane: openreposhape-4 (openRepoShape-4)

Summary by Sourcery

Handle unrepresentable YAML numbers safely and make floating-point diagnostics use values the plan reader can represent.

Bug Fixes:

  • Refuse plain integers exceeding Python’s configured digit limit and decimals that overflow 64-bit floats as line-specific YAML parsing errors instead of tracebacks or inf.
  • Render floating-point values in reader diagnostics as exponent-free decimal digits that round-trip through the plan parser.

Tests:

  • Add comprehensive coverage for numeric parsing limits, configurable integer digit limits, diagnostic formatting, and command-level refusal behavior.

Brett Heap and others added 2 commits October 22, 2026 21:42
…not text as `_read_as` says what the plan's reader read, "records `commit:` as the number 7", where it spelled it as Python does, `commit: 7` and `True`, so `check` and `execute` name it in the words the plan's other refusals use under the same `plan-pin-malformed` (#1114)

`_pin_row_problem` held each of a pin's five fields (`product`, `repository`, `commit`, `tree_sha256`, `digest_source`) to text and spelled a value that is not text with `repr`: a number as `commit: 7`, a boolean as `True`, a list as `['a', 'b']` and a mapping as `{'k': 'v'}`. Every other refusal of a plan's value says what the reader read (`_read_as`): "the number 7", "the boolean true", "a list of 2 item(s)", "a mapping of 1 key(s)". It says it that way now, field by field: "records `commit:` as the number 7, which is not text", and for two or more "records `commit:` as the number 7, `tree_sha256:` as the boolean true, which are not text".

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

The other `!r` in the pin rows are on a value that is text by then: the later branches of `_pin_row_problem`, a text product in the entry's name, and an entry that is a name. An entry that is neither a name nor a mapping is #1020's, in #1125.

tests/test_adopt_pin_row_values.py runs each of the five fields with a number, a boolean, a list and a mapping through `check` and `execute`, with the edges of `_read_as`, two fields at once, null and blank rows, and text controls. tests/test_adopt_pins.py and tests/test_adopt_plan_value_order.py had one row each that pinned the old spelling.

Lane: openreposhape-4 (openRepoShape-4)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…an this Python reads, or a decimal too large to be finite, is `yaml-unparsable` by its line, where it was a `ValueError` traceback or "the number inf", and `_read_as` says a float in digits with no exponent, where it said "the number 1e+300" (#1212)

RV1198's NIT-1 and NIT-2 on #1198, both older than it; this follows #1114
and #1198.

- `scripts/repo_shape.py`'s `_scalar` catches the `ValueError` `int()`
  raises past `sys.get_int_max_str_digits()` (4300 by default), and refuses
  a decimal `float()` makes infinite. Each is a `YamlError` carrying a
  remedy, so `_block_value` records its line and `load_yaml` names it:
  `REFUSED yaml-unparsable: <file>: line 63: a plain integer of 4301 digits
  is too long for this Python to read as a number`. The words give the
  count of digits and not the value, which can be thousands of characters.
- `adopt-project.py`'s `_read_as` says a float in the digits of its `repr`
  written out in full, with `.0` where they hold no point, so the plan's
  reader reads them back as that float: "the number 0.00001", not
  "the number 1e-05". An integer, a boolean and every other value are said
  as before.
- `tests/test_plan_number_limits.py` is new: 35 rows, 24 of which fail on
  `d38e4e36d` and pass here.

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

Implementation

Refuse plain integers beyond Python’s configured digit limit and decimals that overflow a finite float as line-specific YAML errors, with a shared remediation.

  • scripts/repo_shape.py L592-600, L616-625, L641-654 (+4 small edits)

Spell floats in _read_as using full decimal digits from their shortest round-tripping representation, so the plan reader can read them back as floats.

  • adopt-project.py L229, L9372-9384

Tests

Add reader, _read_as, and end-to-end plan tests for numeric limits, configurable integer digit settings, and reader-compatible float wording.

  • tests/test_plan_number_limits.py L1-350

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

RV1249: independent review of #1249 at 80ec2917: NOT READY

Independent review (RV1249, lane openRepoShape-4, 2026-11-08). Reviewed #1249's own delta, git diff d38e4e36d 80ec2917 (3 files: scripts/repo_shape.py, adopt-project.py, tests/test_plan_number_limits.py), against #1212's "Done when". Python 3.12.3 (the bench; CI's 3.14 is not available here), git-filter-repo 2.47.0 (a40bce548d2c) first on PATH for every run, gh stubbed to exit 97, GH_TOKEN=bogus, empty GH_CONFIG_DIR, empty global git config, GIT_SSH_COMMAND=false.

Verdict. The behaviour is right: no MUST. One SHOULD, in the rows file only: the body's claim that a host that changed the int limit runs the rows as CI does is false for a limit below 4300 (the whole file fails to collect). It is a 3-line fix, shown below. Three NITs.

Findings

SHOULD-1. tests/test_plan_number_limits.py does not collect on a host whose int-digit limit is below 4300, against the body's claim. The body says the 21 rows that build an integer of thousands of digits set the limit to 4300, "so a host that changed the limit runs them as CI does", and the file's own comment says the same of DEFAULT_DIGITS. But MADE (module level, line 147) evaluates int(LONGEST) at import, before any fixture runs:

"integer-at-the-limit": (f"k: {LONGEST}\n", int(LONGEST)),

Measured: PYTHONINTMAXSTRDIGITS=1000 pytest --co tests/test_plan_number_limits.py gives ERROR tests/test_plan_number_limits.py - ValueError: Exceeds the limit (1000 ...), no tests collected, 1 error: all 35 rows are lost, the 14 float rows that need no big integer included. At 0 and 5000 it collects 35. Fix: keep the expected value out of the module body, e.g. "integer-at-the-limit": (f"k: {LONGEST}\n", None) and, in test_a_number_the_reader_can_make_reads_as_it_did, if value is None: value = int(LONGEST) (after the fixture has set the limit). Verified on a scratch copy: with that change the file is 35 passed at PYTHONINTMAXSTRDIGITS=1000 and at 0 (file restored, sha256 checked). Grade note: if the lane judges a non-default host limit out of scope, this is a NIT; the PR claims it, so I graded it SHOULD.

NIT-1. Four open Sonar S9073 ("split this composite assertion") smells in the rows file, lines 212, 214, 321 and 338 (assert "e" not in digits and "inf" not in digits; assert isinstance(read, float) and repr(read) == repr(value), read; assert "e+" not in found and "e-0" not in found, found[:400]; assert checked.returncode == 1 and executed.returncode == 2). The quality gate passed with them, but they are real smells and the file is being edited for SHOULD-1 anyway: split each into two asserts.

NIT-2. _read_as of a non-finite float says "the number Infinity.0" / "the number NaN.0". format(Decimal(repr(inf)), "f") is Infinity, which has no point, so .0 is appended. Unreachable today: every caller is handed a value load_yaml made, and _scalar now refuses an infinite decimal and makes no NaN. If a future caller hands it JSON's Infinity, the words name a value no plan holds. Optional: a one-line math.isfinite guard (say repr for a non-finite) or a comment that the branch is for the reader's floats only.

NIT-3. Two spellings of one float across findings (the body's "Not in this PR", answered). The body says which commands reach _the_loader_made / shape_materialize._read_as / _reading_in_words with a float "was not run". Run (head, check on a plan with tracking_branch: 0.00001 and follow_ups: [0.00001]):

FINDING plan-bad-tracking-branch: `tracking_branch:` was read out of the plan as the number 1e-05, not as text, so `execute` would take it as the text `1e-05`
FINDING plan-bad-follow-ups: item 1 of `follow_ups:` is the number 0.00001, not text: ...

So one typed 0.00001 is "1e-05" in one finding and "0.00001" in the next. It does not matter to a user in the first: that sentence pairs the number with str(value), the text execute writes (1e-05), so it is accurate as it stands, and changing _the_loader_made would make it wrong. Leave it; a follow-up could say "(written 1e-05)" or unify, not a blocker. The same helpers cannot be handed inf any more (checked).

NIT-4. Wording only. The decimal refusal says "too large for this Python to read as a number". An infinite decimal is a limit of an IEEE double, not of this Python (the integer refusal is Python's). "too large to be a finite number" would be exact.

What I measured

1. Pinned copies. No copy, fixture or digest of repo_shape.py is stored in the repo (git ls-files | grep repo_shape is the one file; no 64-hex digest names it). The copies are written at scaffold/adopt/family init time from scripts/repo_shape.py through shape_materialize.py's copy lists (REPO_SHAPE, lines 440 and 649: the assembly root's and the family holder's), and contracts/shape-pin.yaml digests them then. So the change reaches every root as upstream-changed scripts/repo_shape.py on the next update-shape.py check, as #1126's change to the same file does (main has it); nothing is out of step. No name is added or removed (one import math, one private constant), so the #536/#604 update-accept-local-missing-name cases do not arise. #370/#610: I put v1.1.1's validate-manifest.py, validate-pins.py, bootstrap.py and validate-repository-naming.py beside the head's repo_shape.py in a scratch git root whose project.yaml holds schema_version: of 4301 digits (limit 4300): both validators exit with REFUSED yaml-unparsable: ...project.yaml: line 1: a plain integer of 4301 digits is too long ... and the remedy; the same root with d38e4e36d's repo_shape.py ends in ValueError: Exceeds the limit (4300 digits). So an existing root's pinned validators meet nothing they cannot run, and the change is an improvement for them once re-pinned. Copy-comparison tests all passed: test_pinned_copy_text.py, test_update_shape_kept_helper.py, test_bootstrap_spelling.py, test_bootstrap_pasteable_lines.py, test_doctor_validator_rows.py, test_doctor_validator_site.py, test_openreposhape_package.py, test_release_workflow.py, both hygiene files (counts below).

2. _scalar behaviour (own probes on the head; plus a differential of base d38e4e36d against head over 975 generated scalars):

  • Integers: 4299 and 4300 digits are ints; 4301 and 4302 refuse (the sign is not counted); - + 4300 digits is an int, - + 4301 refuses; 4301 zeros refuse (CPython counts leading zeros, so does the message); + + 4301 digits stays text (as on base).
  • sys.set_int_max_str_digits: the code never touches it. At 0: 20000 digits read as an int. At 640: 641 refuses, 640 reads. At 5000: 5001 refuses, 5000 reads. At 100000 all read.
  • Decimals: 308 digits + .5 is finite (1e+308); 309 digits + .5 refuses ("decimal of 310 digits"); 400 ones + .5 and its - form refuse; 4400 digits + .5 refuses; 1. + 5000 fraction digits reads (finite); 0. + 400 zeros + 1 reads as 0.0 (underflow, not refused, as the body says); 1.7976931348623157e308 and 1e309 / -1e309 / 1e-400 / 1E5 stay text (no exponent form is read, as on base).
  • inf, -inf, +inf, Inf, INF, .inf, -.inf, .Inf, nan, NaN, .nan, .NaN, -.nan, infinity, 0x1F, 1_000, 1:30: all text, unchanged.
  • Quoted (double, single) 4301-digit and 400-digit values stay strings; block and folded scalars stay strings; a 4301-digit KEY stays a key.
  • Differential over 975 inputs (lengths 1-5000, signs, zeros, nines, decimals, Arabic-Indic digits): the ONLY accepted-before-refused-now values are the 179 decimals that read as inf or -inf; the only other change is 27 ValueError becoming YamlError. No other value changes.
  • load_yaml names the right line for both refusals in 16 file shapes (first and second dash keys, - - x, after a block scalar, CRLF, BOM, comment lines, trailing space, tab after the colon, 4-deep mapping, flow mapping, flow sequence, nested flow, negative, quoted key beside a big value, with a trailing comment) and in all the rows' positions; every refusal carries the remedy; the message holds the digit count, never the value.
  • Callers: the parse_yaml round-trip helpers (_reads_back, _reading_of, family.py's id check, adopt-project.py's _reads_back_as_text) catch YamlError, so a long all-digit text is now quoted, not a traceback; update-shape.py's and the doctor's pin readers catch it too.

3. _read_as floats. 31 hand-picked floats (0.0, -0.0, 1e15, 1e16, 1e22, 1e-05, 5e-324, the largest, 1.2345678901234568e17, 0.30000000000000004, ...) and 200000 random bit-pattern floats (seed 1249): no exponent in any, a point in every one, .0 only where repr's digits hold no point (7.0 stays "7.0", 1e+16 is "10000000000000000.0"), -0.0 keeps its sign, and every one reads back through parse_yaml as the same float (sign of zero too). Longest outputs: 326 characters for 5e-324, 303 for 1e300, which is what #1212 asked for (no exponent). Decimal(repr(x)) is exact whatever the decimal context. Int, bool, text, null, list and mapping wording unchanged.

4. Rows. On d38e4e36d merged with main (105b5daf9) plus the new file: 24 failed, 11 passed, exactly the body's. Failure causes by line: 7 ValueError at _scalar, 1 ValueError at the 640 setting, 4 "DID NOT RAISE Refusal" (decimals), 3 check/execute rows (2 with a Traceback, 1 records commit: as the number inf), 5 _read_as exponent spellings, 4 float finding wordings = 24. On the head merged with main: 35 passed (and 80 passed with #1198's 45). With no git-filter-repo on PATH: 30 passed, 5 skipped (the five @needs_filter_repo rows, skip reason names it, the refusal rows run).

5. Mutants (25, on a scratch merge of head and main; whole rows file each; both files restored and sha256 checked after every run, restored=True for all). All killed:

Mutant Failed of 35
R1 int() with no guard 10
R2 integer refusal without remedy 10
R3 digits counted against a fixed 4300 1
R4 the sign counted as a digit 1
R5 no infinity check 5
R6 decimal refusal without remedy 5
R7 only +inf caught 1
R8 the point counted as a digit 5
R9 isnan in place of isinf 5
R10 the long integer read as text 15
R11 a plain ValueError raised, not YamlError 10
R12 remedy text changed 14
R13 negative infinity not refused 1
R14 integer message says "decimal" 10
A1 repr put back for a float 9
A2 no .0 added 6
A3 format(x, "f") 14
A4 Decimal(x), the binary value 8
A5 .0 always added 8
A6 str(x) 9
A7 abs() drops the sign 2
A8 whole-number formatting 11
A9 a float said as text 14
A10 .0 tested on repr, not on the digits 6
A11 exponent kept from 1e16 up 6

R3, R4, R7 and R13 are held by one row each (the setting row, integer-negative, decimal-negative). Dropping from exc was not run: nothing reads the YamlError's __cause__ (the rows assert the Refusal's).

6. Gate (scratch merge 0b671d663 = 80ec2917 + origin/main 105b5daf9; tree a0b45e886; 129 files, 6 chunks, then test_shape_doctor.py as 4 shards of 449 ids read from files into arrays; at most 3 pytest runs at a time; one reused basetemp per chunk): the rows file, #1198's three test files plus test_adopt_pin_row_values.py, all 122 files that name _scalar, load_yaml or _read_as, both hygiene files, test_cli_reference.py, test_scaffold_leg_path_collisions.py, test_adopt_template_values.py, and the copy-comparison tests of item 1.

Chunk Result
files 1 1431 passed, 5 skipped
files 2 1628 passed
files 3 1612 passed, 23 skipped
files 4 (holds the rows file) 1442 passed, 1 skipped
files 5 2367 passed, 8 skipped
files 6 1560 passed
doctor shards 1-4 112+1, 111+1, 112, 111+1 = 446 passed, 3 skipped (449 ids)

10486 passed, 40 skipped, 0 failed, every chunk exit=0. No skip cites git-filter-repo (grep -i 'filter.repo' over every log is empty; every skip is a declared one: reftable needs git 2.45, case-insensitive disk, NTFS junctions, SHAPE_MEDXEHR_CLONE unset, templates that already quote, empty parameter sets, Windows-only PowerShell line). Main then moved to dffc42265 (four commits, none touching repo_shape.py, adopt-project.py or the rows' imports, but one rewrote update-shape.py and test_update_shape_kept_helper.py); on a second scratch merge with it (732a57cb3), test_update_shape_kept_helper.py, test_neutral_pin_entry_one_spelling.py and test_pinned_copy_text.py gave 399 passed, and the rows file, test_adopt_pin_row_values.py, both hygiene files, test_cli_reference.py, test_bump_leg_reachability_words.py and test_update_shape_landing.py gave 452 passed, no skips.

7. Merge-trees (git merge-tree --write-tree, head 80ec2917): origin/main 105b5daf9 clean (tree a0b45e886; it differs from main in six files: adopt-project.py, scripts/repo_shape.py, #1198's three test files and the rows file, i.e. the stack's own); origin/main dffc42265 clean; #1198's head d38e4e36d clean (tree 89a4e55c0, the head's own); the delta alone onto main, git merge-tree --merge-base d38e4e36d origin/main 80ec2917, clean and touching exactly its three files (the body's "Without #1198" claim holds structurally); and clean with the heads of the 25 other open PRs that change adopt-project.py or repo_shape.py: #1105 b28f40de0, #1106 504a1dd65, #1118 2307036ab, #1120 c55e55e33, #1122 c01c4d73d, #1123 5c3908f8d, #1125 9549006fe, #1141 0b8fb3205, #1143 7af5fabc3, #1153 ff33ba12a, #1154 8a7828332, #1170 24ee133aa, #1171 8162b874e, #1177 5208e874e, #1178 c4beba193, #1186 07486a498, #1189 7d2f651e7, #1190 e42134e10, #1194 900f77af9, #1207 6fa1edd56, #1210 791106c2b, #1225 73c9f57e8, #1237 63c527185, #1251 825923c76, #1252 40b030cbf (#1141 and #1189 moved since the body's list; #1251 and #1252 are new). #1171 is the only other PR that edits repo_shape.py (adds code_point_escaped, DEFAULT_IGNORABLE*, visible_repr and a checked_value message; no overlap with _scalar): on a three-way scratch merge of the head, main and #1171, the rows file, #1171's three test files, test_pinned_copy_text.py, both hygiene files, test_adopt_pin_row_values.py, test_load_yaml_refusals.py and test_reader_refusals_named.py gave 656 passed. In #1125, #1141, #1171, #1189, #1210, #1251 and #1252 (grepped) no test pins an exponent spelling of a float.

Scratch: /workspace/projects/openRepoShape-worktrees/_lane4-scratch/tools/run/rv1249/ (probes, logs, mutate.py, mutants.out, chunk lists), clone rv1249-clone and worktrees rv1249-merge-wt, rv1249-merge2-wt, rv1249-base-wt, rv1249-mut-wt, rv1249-m1171-wt beside it. Nothing pushed or edited.

Lane: openreposhape-4 (openRepoShape-4)

…collect and run under any PYTHONINTMAXSTRDIGITS, each assertion states one fact, and the refusal of a decimal says a 64-bit float cannot hold it, where it said "for this Python" (#1212)

RV1249's review of #1249 at 80ec291 (see #1212), one SHOULD and two NITs
taken here:

- SHOULD-1: the rows file evaluated int(LONGEST), 4300 digits, at import, so
  a host whose limit is below that (PYTHONINTMAXSTRDIGITS=1000) could not
  collect the file at all, before the limit-setting fixture ran. The
  "integer-at-the-limit" control now holds None and makes the integer inside
  the row, under the fixture. The file passes 35 of 35 with the variable
  unset, at 1000, at 640 and at 0.
- NIT-1: the four composite assertions (Sonar S9073) are one assertion for
  each fact.
- NIT-4: the infinite decimal's refusal said "too large for this Python to
  read as a number". Infinity is a limit of a 64-bit float, not of this
  Python, so it now says "too large to read as a number: a 64-bit float
  cannot hold it, so it would be infinite". The line, the digit count and
  _UNMADE_NUMBER_REMEDY are as they were. Nothing else pins the old words:
  README.md, AGENTS.md and docs/ do not hold them. The integer refusal still
  says "for this Python", which is true of it, since sys.set_int_max_str_digits
  sets that limit. The two comments that called the decimal a number "this
  Python cannot make" no longer do.

NIT-2 and NIT-3 are left as RV1249 left them.

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

Copy link
Copy Markdown
Contributor Author

F1249 answers RV1249's NOT READY (#1249 (comment)). New head: 3146c3ca5f102624d0c36761ca192cbd7f60df93, one commit on top of 80ec29177, pushed without force. It touches two files, tests/test_plan_number_limits.py and scripts/repo_shape.py. #1198's branch is not touched.

Please give it a DELTA review of 3146c3ca5 only (git diff 80ec29177 3146c3ca5, 29 insertions and 17 deletions in the two files).

SHOULD-1, the rows file did not collect under a changed limit. MADE held int(LONGEST), evaluated at import. Now integer-at-the-limit holds None and the row makes the integer itself, under the limit-setting fixture. The 35 rows pass with PYTHONINTMAXSTRDIGITS unset, at 1000, at 640 and at 0 (git-filter-repo 2.47.0 on PATH, no skips). On 80ec29177 at 1000: "1 error, no tests collected". Also 35 passed at 1000 and at 0 on the merge with the current main.

NIT-1, Sonar S9073. The four composite assertions (old lines 212, 214, 321 and 338) are one assertion for each fact, eight in all; the two on return codes carry the output as their message.

NIT-4, "for this Python". The decimal refusal now reads a plain decimal of 401 digits is too large to read as a number: a 64-bit float cannot hold it, so it would be infinite. The line it names, the digit count and _UNMADE_NUMBER_REMEDY are as they were. The integer refusal keeps "for this Python", which is true of it. Only too_large in the rows pinned the old words: grep of tests/, README.md, AGENTS.md and docs/ for the old wording finds nothing else. Two comments that called the decimal a number "this Python cannot make" are reworded to match. The PR body's example line, one heading and the "At 80ec29177" anchors are updated, and it has a new "Round 2" section; I read it back.

NIT-2 and NIT-3 are left alone, as you graded them.

Mutants. 30 of 30 killed, each file restored and its sha256 checked (restored=True every time): your R1 to R14 and A1 to A11, and five of this round (the old wording put back: 5 failed; "64-bit" dropped: 5; "integer" for "decimal": 5; the integer control compared with int(LONGEST) + 1: 1; the control never made: 1). R3, R4, R7 and R13 each fail exactly one row, as you measured: R3 test_the_refusal_follows_this_pythons_setting, R4 [integer-negative], R7 and R13 [decimal-negative].

Gate (a scratch merge of 3146c3ca5 with main dffc42265, commit 83698e6a3, tree eda7be55f, holding #1198's head d38e4e36d; at most 2 runs at once, -o tmp_path_retention_policy=failed): the rows file, #1198's three test files, both hygiene files, test_cli_reference.py, the three reader refusal files, the six files that read the changed file's source, and test_shape_doctor.py in four shards of 449 ids. 1597 passed, 3 skipped (the PowerShell line, Windows only), 0 failed. Main then moved to 5926cccab; on a second merge (commit 41e904e86, tree 55fcaf8bb) the rows file, #1198's three files, both hygiene files, test_cli_reference.py, the three refusal files and the new test_adopt_plan_partial_clone.py gave 587 passed, 0 skipped, 0 failed. A wider batch of 56 files was started and stopped at 269 tests (0 failed) because the host was loaded; it is not part of the gate.

Merge-trees (git merge-tree --write-tree), all clean: origin/main at dffc42265 and 5926cccab, #1198's head (tree 34d5c9541, this head's own), #1171 8162b874e, and the 24 other open PRs that change adopt-project.py.

Lane: openreposhape-4 (openRepoShape-4)

@brettheap

Copy link
Copy Markdown
Contributor Author

RD1249: independent delta review of #1249 at 3146c3ca: READY

Independent DELTA review (RD1249, lane openRepoShape-4, 2026-11-08) of git diff 80ec2917 3146c3ca only: 2 files, 29 insertions and 17 deletions (scripts/repo_shape.py, tests/test_plan_number_limits.py). The rest of #1249 was reviewed by RV1249 and is not re-reviewed here. Python 3.12.3 (the bench), git-filter-repo 2.47.0 first on PATH (no row skipped), gh stubbed to exit 97, GH_TOKEN=bogus, empty GH_CONFIG_DIR, empty global git config, GIT_SSH_COMMAND=false, basetemps under /tmp/lane4-rd1249-bt/.

Verdict. No MUST, no SHOULD. One NIT. All three RV1249 findings in scope (SHOULD-1, NIT-1, NIT-4) are answered.

What I measured

1. SHOULD-1 is fixed. The rows file on 3146c3ca, -rs, 35 passed and no skip each time: PYTHONINTMAXSTRDIGITS unset, 1000, 640 and 0. On the scratch merge with current main: 35 passed at 1000, at 0 and unset. On 80ec2917 at 1000: tests/test_plan_number_limits.py:147: ValueError: Exceeds the limit (1000 digits) for integer string conversion, "1 error in 0.58s", nothing collected (the old failure, reproduced).

2. The integer-at-the-limit row tests what it did. MADE["integer-at-the-limit"] holds None, and the row sets value = int(LONGEST) under the default_digits fixture before it compares parse_yaml(text) == {"k": value}. None is only the expected side, so it cannot excuse a broken reader. Mutants (all killed, see the table): a reader that returns None for every integer (S8) or only for exactly 4300 digits (S12) fails [integer-at-the-limit]; int(text) + 1 (S9), a refusal at 4300 (S10) and the integer read as text (S11) fail it too; and the row itself with the sentinel left in place (T1), compared with int(LONGEST) + 1 (T2) or with the text (T3) fails exactly that one row.

3. NIT-1 (S9073): nothing is dropped. The four composites are now eight asserts, each fact kept: "e" not in digits and "inf" not in digits; isinstance(read, float) and repr(read) == repr(value), each with the old message read; "e+" not in found and "e-0" not in found, each with found[:400]; checked.returncode == 1 and executed.returncode == 2, now each with its stderr as the message (checked.stderr[:2000] is already used a few lines above, and executed.stderr is already read as text below). An AST scan of the file finds no assert with a boolean operator left (32 asserts). SonarCloud at this head: quality gate pass, and the MCP search for OPEN or CONFIRMED issues on PR 1249 returns 0.

4. NIT-4: the wording is true, and nothing else pins the old text. The decimal refusal reads a plain decimal of N digits is too large to read as a number: a 64-bit float cannot hold it, so it would be infinite. Probed on the head: 1 + 309 zeros + .0 and its - form give N = 311; 400 ones + .5 gives 401; str(2**1024 - 2**970) + ".0" (the first value that rounds to infinity) is refused, and the largest finite float and a value above it that still rounds to it (17976931348623158 + 292 zeros + .0) are read as 1.7976931348623157e+308, so only a value a 64-bit float cannot hold is refused. The integer refusal still reads a plain integer of 4301 digits is too long for this Python to read as a number, which is true: int() raises past sys.get_int_max_str_digits(), a setting of the interpreter. git grep on the merge with origin/main be21751c3 (README.md, AGENTS.md, docs/, templates/, every test): the only lines holding too large, digits is too, plain decimal, plain integer of or cannot hold it for this message are scripts/repo_shape.py and tests/test_plan_number_limits.py; the old words (too large for this Python, read as a number: it would be infinite, THIS PYTHON CANNOT MAKE) appear nowhere. The reworded header comment (THIS READER CANNOT MAKE) and the _scalar docstring now agree with the message.

Mutants (17, on 3146c3ca, whole rows file each; both files restored and sha256 checked after every one, restored=True for all, git status clean at the end)

Mutant Failed rows, of 35
S1 decimal says "for this Python" again 5
S2 "64-bit" dropped 5
S3 decimal message says "integer" 5
S4 decimal digit count off by one (point counted) 5
S5 decimal refusal without its remedy 5
S6 integer message loses "for this Python" 10
S7 decimal tail "so it is infinite" 5
S8 reader returns None for an integer 9 failed, 8 errors
S9 reader returns int(text) + 1 2 failed ([integer-at-the-limit], the setting row), 8 errors
S10 reader refuses an integer of exactly 4300 digits 3 ([integer-at-the-limit], the setting row, test_a_commit_of_4300_digits_is_still_a_finding)
S11 reader reads the integer as text 9 failed, 8 errors
S12 reader returns None only for exactly 4300 digits 2 ([integer-at-the-limit], test_a_commit_of_4300_digits_is_still_a_finding)
T1 row keeps the None (the sentinel is not replaced) 1 ([integer-at-the-limit])
T2 row compares with int(LONGEST) + 1 1 ([integer-at-the-limit])
T3 row compares with the text LONGEST 1 ([integer-at-the-limit])
T4 checked.returncode == 1 becomes == 2 1 (test_a_float_follow_up_is_said_without_an_exponent)
T5 executed.returncode == 2 becomes == 1 1 (test_a_float_follow_up_is_said_without_an_exponent)

Gate

On a scratch merge of 3146c3ca (which holds #1198's head d38e4e36d) with the CURRENT origin/main be21751c3: commit e9e9f2e09, tree 6248166af. It differs from main in exactly six files: adopt-project.py, scripts/repo_shape.py, tests/test_adopt_pin_row_values.py, tests/test_adopt_pins.py, tests/test_adopt_plan_value_order.py, tests/test_plan_number_limits.py. At most 2 runs at once on a host at load 40 to 65, -o tmp_path_retention_policy=failed, -rfs:

  • the rows file, test_adopt_pin_row_values.py, test_adopt_pins.py, test_adopt_plan_value_order.py, test_load_yaml_refusals.py, test_reader_refusals_named.py and test_refusal_default_remediation.py: 327 passed, 0 skipped, 0 failed (7m25s);
  • test_repo_hygiene.py, test_path_guard_hygiene.py and test_cli_reference.py: 245 passed, 0 skipped, 0 failed.

Total 572 passed, 0 skipped, 0 failed. (F1249's gate ran on main dffc42265 and then 5926cccab; main has moved to be21751c3, and the result holds on it.)

Merge-trees (git merge-tree --write-tree, head 3146c3ca)

Findings

NIT-1. MADE uses None as the "make it in the row" marker, and None is also what YAML null reads as. Harmless today: the only row with None is integer-at-the-limit, and a mis-set marker fails a row rather than passing one (T1 and S8 show it). But a later control row that wants {"k": None} (k: null) would be compared with int(LONGEST) and fail for a reason that is hard to see. Optional: a module-level MADE_BY_THE_ROW = object() sentinel, or a lambda: int(LONGEST) that the test calls. Follow-up only; it does not block.

Outside the delta (already noted by F1249, no action): the PR body's own mutant table numbers R9 to R13 differently from RV1249's.

Lane: openreposhape-4 (openRepoShape-4)

This was referenced Nov 8, 2026
brettheap added a commit that referenced this pull request Nov 9, 2026
…: a kept `GNUmakefile/` is a directory GNU make stops at, `python3 scripts/bootstrap.py` names `python` on Windows, and the template says what to run where `make` reads another file (#1207)

**#1132, the parts that hold on main: the assembly-root template says what to run where GNU make reads a kept `GNUmakefile` or `makefile` first; a kept DIRECTORY of either name is named as one GNU make stops at, in the `CONTRACTS_DIR` line and in `execute`'s NEXT; every sentence that names `python3 scripts/bootstrap.py` for a person to run names `python` on Windows too; and two follow-up texts no longer say more than is true (RV1105b's NIT-2 and NIT-3a).**

This PR was built on main `961640c6`. Lane 4's #1121 (#1047) landed as `0ed3e57f8` at 21:37Z, and this round merged it in (`6fa1edd56`): NEXT now words a kept file (#1121's) and a kept directory (this PR's) through one lookup and one clause. #1105 landed as `12122952b` on 2026-11-08, and this PR merges it in (see "Main merge after #1105"). The items that live only in #1105's code, and the parts of #1121's that this merge does not do, are in their own issue, #1240 (see "Left"). Item 5 is #1206.

Lane 4's #1105 (#1048) landed as `12122952b` at 16:45Z. This round merges main into the branch with `git merge origin/main`, never a rebase, and does it twice:
- main `46fe6ac19` as merge `7b0192bde`;
- then NIT-A in its own commit, `e5e077940`;
- then main `9729315f1` as merge `01e93b6d1`, the head. Lane 1's #1123 had landed meanwhile, and one of its rows meets this PR's directory line (see "The second merge, after #1123").

The first merge conflicted in `scripts/shape_materialize.py` only: 3 hunks, all in `collision_follow_up`, as "Landing order" said. `adopt-project.py` and `templates/assembly-root/AGENTS-shape.md` merged with no conflict.

Both sides' behaviour stays: #1105's second `GNU_MAKE_READS`, its `_predict_collisions` lookup and its collision line, and this PR's `_make_reads_first`, `_make_reads_first_clause` and NEXT. None of #1240's unification is done here (one tuple, one lookup).

### The three hunks

| hunk | this PR (`6fa1edd56`) | main (`46fe6ac19`, #1105) | resolution |
|---|---|---|---|
| 1. The docstring's NIT-4 sentence | "This said "both callers say it", and `execute` calls it nowhere" | "`Materialized.follow_ups()` would say this of them, and nothing calls it" | **Main's.** Both sides rewrote the same sentence for the same finding. Main's also names `Materialized.follow_ups()`, which #1240's item G changes. So this PR no longer touches that sentence, and the last `scripts/shape_materialize.py` bullet under "What changed" is #1105's text now. |
| 2. The docstring's Makefile paragraphs | the `BOOTSTRAP_COMMAND` sentence and NIT-2's tail | the heading "WHERE `make` READS THE MERGED FILE", and the "BUT GNU MAKE READS" paragraph | **Both.** Main's heading and both paragraphs. This PR's sentences on `BOOTSTRAP_COMMAND` and on NIT-2's tail go in the first paragraph, and one new sentence goes in the second: "Both name that command as `BOOTSTRAP_COMMAND` does, `python` on Windows as well (#1132)." |
| 3. The returns | two `return`s, each one sentence | `arrive`, `joint`, `meanwhile` and `until` set per branch, then one pair of `return`s | **#1105's structure, with a per-branch `then` in place of `until`.** With no `reads_first`, the line is this PR's, byte for byte. With one, it is #1105's, byte for byte, except that the command a person runs is `BOOTSTRAP_COMMAND`, both in `meanwhile` and in "and then ... runs it". |

- **Hunks 1 and 2 carry no code.** In the merged file they sit at lines 1022-1023 and 1032-1070, inside `collision_follow_up`'s docstring (lines 1014-1084).
- **The rendered lines.** I loaded the function from `6fa1edd56`, from main, and from the merge, and rendered each `reads_first` (none, `GNUmakefile`, `makefile`) with and without `scripts/bootstrap.py` aside.
  - With no `reads_first`, the merge equals `6fa1edd56` (2 of 2).
  - With one, it equals main with " (`python` on Windows)" after `python3 scripts/bootstrap.py` in those two places (4 of 4). For a root that keeps `Makefile` and `GNUmakefile`, the line now ends "...; until then `python3 scripts/bootstrap.py` (`python` on Windows) is what the shape's `make bootstrap` runs".
- **NIT-2's tail where `make` reads another file** stays #1105's own: "neither `make bootstrap` nor `python3 scripts/bootstrap.py` runs the shape's bootstrap until then, and then `python3 scripts/bootstrap.py` (`python` on Windows) runs it". #1105's review fixed that branch for the same finding, so it needs nothing more.
- **Of #1240's list,** this round does item C for #1105's collision line, as #1240 asks a resolution to say. So the "with `python3`" part of "Left"'s second bullet is done. Item B, the kept directory, stays: #1105's lookup asks `_root_keeps`, so a root that keeps `Makefile` and `GNUmakefile/` is told GNU make "reads the source's `GNUmakefile`". Mutant U3 below shows that no row pins this line for a directory.

### #1105's test pins

`tests/test_adopt_collision_make_reads.py` is #1105's file, and it pins the texts this PR changes, as "Landing order" expected.
- **Four pins move.** `MERGE_IS_ENOUGH` and `BOTH_MERGES` (no `reads_first`) move to this PR's words. `MEANWHILE` and `SCRIPT_MERGED` (with one) move to `python` on Windows. All four go through a new `COMMAND`.
- **One comment changes.** The comment on the `Makefile+scripts` row now says what NIT-2's tail says.
- **Measured:** before the move, the six adopt and pin files gave 11 failed and 242 passed, and the 11 are exactly the rows that use those four pins. After the move, 253 passed.
- **On main's code:** main `46fe6ac19`'s four production files (`adopt-project.py`, `scripts/shape_materialize.py`, `templates/assembly-root/AGENTS-shape.md` and `README.md`) were swapped into the mutant worktree at `e5e077940`. 64 of the three files' 106 rows fail:
  - in this file, exactly those 11 rows, and the other 20 pass;
  - in the new file, 34 of 35, as before (NIT-4's row passes);
  - in `tests/test_adopt_next_make_reads_first.py`, 19 of 40, as before.

  The four files were then restored, each matched the head by sha256 (4 of 4), and the tree was clean.

### NIT-A

`tests/test_adopt_next_make_reads_first.py:64` called #480's NOTE "unchanged", but the merge of #1121 moved that pin to `python` on Windows. The comment now says the NOTE "names `python` on Windows too since #1132". The change is a comment only, in its own commit.

### The second merge, after #1123

Lane 1's #1118 and #1123 landed while the first merge was being gated: `9ec0dc79c` at 17:30Z and `9729315f1` at 17:47Z. Both merge with `e5e077940` with no conflict in the text. The predicted merge with `9ec0dc79c` passed (gate P below). The predicted merge with `9729315f1` failed 1 row of 254 (gate P2):
- **The row:** #1123 adds `test_a_name_only_a_disk_that_ignores_case_takes_for_makefile[makefile-directory]` to `tests/test_adopt_make_reads_first.py`. For a kept DIRECTORY `makefile/`, it expects the `CONTRACTS_DIR` line a kept `makefile` FILE gets ("only once `makefile` does"). #1123's own message says that line is not true for a directory, and that the row works as a crash guard for `twins` in `_makefile_follow_up`. This PR changes exactly that line: a kept directory is one GNU make stops at.
- **The fix, in the merge `01e93b6d1`:** the row now expects `SHAPES + written_as("makefile")`, as #1123 wrote it, which is the part that guards `twins`. This PR's directory clause follows, through a new `stops_at` helper beside `reads`. The comment above `ANSWERED` and the row's docstring now say so. Nothing else changes in the merge.
- **Mutants on the row.** Each ran alone in the mutant worktree at `01e93b6d1` against `tests/test_adopt_make_reads_first.py` (34 rows). Each was restored with `git checkout` and matched by sha256 (`adopt-project.py` `3c2cb5f5bea5`), and the tree was clean after each.

| id | mutant | rows failing | result |
|---|---|---|---|
| D1 | `_make_reads_first` drops a directory's `/`, so the line is the one #1123's row pinned | 1 of 34, the row | killed |
| D2 | #1123's R10: `twins` reads the entry with its slash | 1 of 34, the row, with `IndexError` | killed |

### Mutants on the resolution

H3a-H3g and U1-U3b are the first merge's. All ran in the mutant worktree at `e5e077940`.
- **Method:** each mutant was applied alone, then restored with `git checkout`. Each restore matched by sha256 (`shape_materialize.py` `b18f09d7c396`, `adopt-project.py` `2055a81acdc6`), and the tree was clean after each.
- **Rows:** H3a-H3g, U3 and U3b ran against 93 rows: `tests/test_adopt_collision_make_reads.py` (31), the new file (35) and `tests/test_adopt_e2e.py` (27). U1 ran against the new file, `tests/test_adopt_make_reads_first.py` (33) and `tests/test_adopt_collision_make_reads.py`, 99 rows. U2 ran against the new file and `tests/test_adopt_next_make_reads_first.py` (40), 75 rows.
- **Unmutated,** every row passes (gate A below).

| id | mutant | rows failing | result |
|---|---|---|---|
| H3a | hunk 3, no `reads_first`: `meanwhile` back to main's plain `python3` | 4 of 93 | killed |
| H3b | hunk 3, no `reads_first`: the script tail back to main's "before both merges are made" | 4 of 93 | killed |
| H3c | hunk 3, with `reads_first`: `meanwhile` without `BOOTSTRAP_COMMAND` (main's) | 5 of 93 | killed |
| H3d | hunk 3, with `reads_first`: "and then ... runs it" without `BOOTSTRAP_COMMAND` (main's) | 3 of 93 | killed |
| H3e | hunk 3, with `reads_first`: this PR's tail in place of #1105's | 3 of 93 | killed |
| H3f | hunk 3: `reads_first` ignored, so the resolution is this PR's side whole | 15 of 93 | killed |
| H3g | hunk 3, with `reads_first`: #1105's `joint` ("; and") lost | 3 of 93 | killed |
| U1 | `_makefile_follow_up` drops `_make_reads_first` (`first = None`) | 31 of 99 | killed |
| U2 | `_next_steps` drops `_make_reads_first` (`first = None`) | 35 of 75 | killed |
| U3 | `_predict_collisions` asks `_make_reads_first` in place of #1105's lookup | 0 of 93 | **survived** |
| U3b | `_predict_collisions` passes no `reads_first`, so #1105's lookup is lost in the merge | 15 of 93 | killed |

- **H3c and H3d** are killed only by rows that use the moved `MEANWHILE` and `SCRIPT_MERGED`. Those pins are what hold `BOOTSTRAP_COMMAND` in #1105's branch.
- **U3 survives,** and that is #1240's item B. For a kept file, both lookups give the same name. They differ only for a kept directory, where `_make_reads_first` adds the `/`, and no row runs `_predict_collisions` on a root that keeps `Makefile` and `GNUmakefile/`. A row now would pin the line #1240 is to correct, so this round adds none.

### Runs

Each run went through the lane's runner, with git-filter-repo 2.47.0 (CI's pin) on PATH, on a commit with a clean tree.

| run | git | files | passed | failed | skipped |
|---|---|---|---|---|---|
| gate A2 | 2.43.0 | `01e93b6d1`, the head: the 12 files below | 1096 | 0 | 3: the PowerShell rows (`test_shape_doctor.py:10516`), which run only on a Windows host |
| gate B2 | 2.47.1 | `01e93b6d1`: the same 12 files | 1096 | 0 | 3: the same |
| gate A | 2.43.0 | `e5e077940`, after the first merge: the 12 files below | 1095 | 0 | 3: the same |
| gate B | 2.47.1 | `e5e077940`: the same 12 files | 1095 | 0 | 3: the same |
| gate P | 2.43.0 | the predicted merge of `e5e077940` with main `9ec0dc79c` (#1118; tree `ba3f3c1f3`, a local commit object, not pushed): the six adopt and pin files, plus #1118's `tests/test_adopt_root_shape_paths.py` and `tests/test_adopt_symlink_target_bytes.py` | 509 | 0 | 0 |
| gate P2 | 2.43.0 | the predicted merge of `e5e077940` with main `9729315f1` (#1123; tree `0eb290ae2`, a local commit object): the six adopt and pin files | 253 | 1: #1123's `makefile-directory` row, which the second merge moves | 0 |
| gate P4 | 2.43.0 | the predicted merge of `01e93b6d1` with main `801a7d6d0` (#1106; tree `25bc27d39`, a local commit object): the six adopt and pin files, plus #1106's `tests/test_adopt_one_byte_locale.py` and `tests/test_adopt_unenterable_source_and_locale.py` | 277 | 0 | 0 |

The files are the six adopt and pin files (`tests/test_adopt_collision_make_reads.py`, `tests/test_pinned_copy_text.py`, the new file, `tests/test_adopt_next_make_reads_first.py`, `tests/test_adopt_e2e.py` and `tests/test_adopt_make_reads_first.py`, 253 rows), plus `tests/test_shape_doctor.py` and `tests/test_scaffold_leg_path_collisions.py`, which adopt changes need, plus the hygiene five (`test_path_guard_hygiene.py`, `test_repo_hygiene.py`, `test_agents_md_codes.py`, `test_cli_reference.py` and `test_pinned_copy_text.py`). That is 1098 rows in one run at `e5e077940`, and 1099 at `01e93b6d1`, where #1123 adds one row.

All of this was measured on main `961640c68` with GNU make 4.3, offline.

| item | on main |
|---|---|
| 1, the template | `AGENTS-shape.md` (the "Work from here" paragraph and the five-commands table) and `README.md` (Get started, and the parking steps) give `make bootstrap` with no caveat. With the template's own `Makefile` beside a plain `GNUmakefile` or `makefile`, `make -n bootstrap` exits 2, `No rule to make target 'bootstrap'`. |
| 2, a kept directory | With `GNUmakefile/` or `makefile/` beside `Makefile`, `make bootstrap` exits 2 with `make: *** GNUmakefile: Is a directory.  Stop.`, or the same with `makefile`. It does this for every target, and for each directory alone too. Main's `CONTRACTS_DIR` line says "`make` there exports `CONTRACTS_DIR` only once `GNUmakefile` does". NEXT prints `make bootstrap` for a root that keeps only `GNUmakefile/`. Beside a kept `Makefile`, it prints #480's NOTE that the targets "arrive only once the follow-up merges the two". Rendered by the lane's `probe_texts.py` on main. |
| 3, `python3` | The template's `scripts/bootstrap.py` says `python3 scripts/bootstrap.py (python on Windows)`. #480's NOTE and the Makefile collision follow-up's "until then" name `python3` alone. |
| NIT-2 | The no-`reads_first` script-aside tail says "neither `make bootstrap` nor `python3 scripts/bootstrap.py` runs the shape's bootstrap before both merges are made". In a root that keeps its own `Makefile` and `scripts/bootstrap.py`, merging the script alone makes `python3 scripts/bootstrap.py` print the shape's `SHAPE-BOOT`, while `make bootstrap` still exits 2. Measured again by a row below. |
| NIT-3a | `_predict_collisions` says the wording comes from "the same function `execute` reports its actual collisions through", and `collision_follow_up` says "Both callers say it". `execute` never calls `collision_follow_up`: it carries the plan's stored `follow_ups:` into the split message. |

`adopt-project.py`:
- **`_make_reads_first(surviving)`** gives the first of `GNUmakefile` and `makefile` the root keeps. It reads `GNU_MAKE_READS`' order, asks the way `_root_keeps` asks, and adds a `/` for a DIRECTORY. **`_make_reads_first_clause`** words the clause. For a file, the words are main's, byte for byte. For a directory, it says: "GNU make at the root stops at the source's directory `GNUmakefile/`, the first of `GNUmakefile`, `makefile` and `Makefile` it finds (`GNUmakefile: Is a directory.`), so ... only once the root keeps no directory of that name".
- **`_makefile_follow_up`** (the `CONTRACTS_DIR` line) asks both. A kept file's line is unchanged: `tests/test_adopt_make_reads_first.py` passes as it is.
- **`_next_steps`** takes `surviving=`, the plan's root paths, which `cmd_execute` passes as `paths_for["root"]`, as #1121 does.
  - Where a kept DIRECTORY stops make, the command is `python3 scripts/bootstrap.py`. The NOTE says GNU make stops there. Beside a kept `Makefile`, it also says the targets run there once the follow-up merges the two, and only once the directory is gone. Where the script went aside too, alone or with the `Makefile`, the NOTE names that command after the merges.
  - Since the merge of #1121, a kept FILE goes through the same lookup and the same clause. For a file the clause gives #1121's words byte for byte, and its NOTEs end in `BOOTSTRAP_COMMAND` too.
- **`BOOTSTRAP_COMMAND`** is in every NOTE: #480's, #1121's and the directory's. Each command line a person pastes stays `python3 scripts/bootstrap.py`.
- **`_predict_collisions`' docstring** says what the plan stores and what `execute` carries (NIT-3a).

`scripts/shape_materialize.py`:
- **`BOOTSTRAP_COMMAND`** = "`python3 scripts/bootstrap.py` (`python` on Windows)", as the template's script names it.
- **The Makefile collision follow-up** says "until then `python3 scripts/bootstrap.py` (`python` on Windows) is what `make bootstrap` runs".
- **Where the script went aside too,** the follow-up says "so `python3 scripts/bootstrap.py` (`python` on Windows) runs the shape's bootstrap once the script is merged, and `make bootstrap` once both merges are made" (NIT-2).
- **The docstring's "Both callers say it"** paragraph says what is true (NIT-3a's twin, #1105's review NIT-4). #1105 made the same fix, and the merge keeps main's text (see "Main merge after #1105").

`templates/assembly-root/`:
- **`AGENTS-shape.md`:** the "Work from here" paragraph adds "; where the root keeps a `GNUmakefile` or a `makefile`, which GNU make reads before `Makefile`, run `python3 scripts/bootstrap.py` (`python` on Windows), which is what the shape's `make bootstrap` runs." A sentence after the five-commands table says they are the shape's Makefile's targets, which `make` at the root reaches only where the file it reads first holds them, or includes a Makefile that does.
- **`README.md`:** one sentence after Get started covers `make bootstrap` "here and below". A second says `make park` and `make resume` below work there only where that file holds them, or includes a Makefile that does.
- **This is a template byte change, so every project re-pins.** No digest of either file is stored in this repository. `tests/` was grepped for every changed line, and only this PR's own rows pin them (see "Template pins").

Tests:
- **`tests/test_adopt_e2e.py`:** two pins move to the new words, at :312 (the "until then" sentence) and at :447-450 (NIT-2's tail).
- **`tests/test_adopt_next_make_reads_first.py`** (#1121's): the merge moves three pins, `OWN_MAKEFILE_NOTE`, `RUNS` and `script_aside`, to `python` on Windows. #480's NOTE merged with no textual conflict, so without them its rows fail.
- **The new file `tests/test_adopt_make_bootstrap_followups.py`** has 35 rows:
  - the template's sentences, held to its `Makefile` (`PYTHON ?= python3`, `bootstrap:` runs `$(PYTHON) scripts/bootstrap.py`) and to `scripts/bootstrap.py`'s own words;
  - `make -n bootstrap` against the template's `Makefile` beside each kept name, each row asserting the `AGENTS-shape.md` caveat that measurement backs;
  - `_make_reads_first` (10 roots);
  - the `CONTRACTS_DIR` line for 4 directory roots;
  - NEXT for a directory, beside a kept `Makefile` (both names), after both merges, and after the script's merge alone;
  - #480's NOTE, called both as main's signature allows and with `surviving=`;
  - the collision follow-up's two sentences;
  - NIT-2 measured with the template's `Makefile` and stand-in scripts, and tied to the follow-up's new tail;
  - three real adoptions of a source holding `GNUmakefile/rules.mk`. One is kept by a `--path-policy` rule, so `plan` writes the line, `check` prints it and the split message carries it. One is answered `root`. In both, NEXT is asserted, `make -n bootstrap` in the pasted clone exits 2 with `GNUmakefile: Is a directory.`, and the printed command exits 0. In the third, the question is answered `code`: NEXT names `make bootstrap`, and that command runs in the pasted clone.

### This round (#1207's review, issuecomment-6374516382)

| finding | what changed |
|---|---|
| SHOULD-1 | A row pins NEXT where only `scripts/bootstrap.py` went aside beside a kept `GNUmakefile/` (`test_next_after_the_script_merge_names_python3_where_make_stops`). It fails under the review's mutant X1. |
| SHOULD-2 | The "Left" list is one issue, #1240. |
| SHOULD-3 | "Landing order", below. #1121 landed while this round ran, and is merged and resolved here. |
| NIT-1 | `AGENTS-shape.md`'s sentence after the table loses "(above)": nothing above names a Makefile that includes another. |
| NIT-2 | `README.md` names `make park` and `make resume`. |
| NIT-3 | Beside a kept `Makefile`, the directory NOTE names the merge as well as the directory. Its row is parametrized over `GNUmakefile/` and `makefile/`. |
| NIT-4 | An adoption sends `GNUmakefile/` to the code leg, and NEXT names `make bootstrap`. It fails under the review's mutant X6. |
| NIT-5 | The notes for the squash message at landing, below. |

Measured at the merge head `6fa1edd56`, in a scratch worktree:
- main `0ed3e57f8`'s bytes of the four production files (`adopt-project.py`, `scripts/shape_materialize.py`, `templates/assembly-root/AGENTS-shape.md`, `templates/assembly-root/README.md`) were checked out over the head;
- the new file (35 rows) and `tests/test_adopt_next_make_reads_first.py` (40 rows) ran through the lane's runner;
- the four files were restored with `git checkout`, and each matched the head by sha256 (`c94bd19b`, `12555f39`, `8660bafb`, `b3f9409b`).

| file | fail on main | pass on main |
|---|---|---|
| the new file | 34 | 1: `test_an_adoption_sending_a_gnumakefile_directory_to_a_leg` |
| `tests/test_adopt_next_make_reads_first.py` | 19 | 21 |

Main now has #1121, so its `_next_steps` takes `surviving=`. The NEXT rows for a kept directory therefore fail on their words, not on a `TypeError`. Main reads `GNUmakefile/` as a file: "then run `python3 scripts/bootstrap.py`; GNU make at the root reads the source's `GNUmakefile`, ...". This is the case for the SHOULD-1 row, the after-the-merges row, both directory rows, and NIT-3's `makefile/` row.

The new file's other rows fail on main for these reasons:
- the template rows: main's `AGENTS-shape.md` and `README.md` lack the sentences;
- `_make_reads_first`: main has no such helper;
- the `CONTRACTS_DIR` line: "only once `GNUmakefile` does";
- the NOTE and collision rows: plain `python3`, and NIT-2's old tail;
- the two adoptions that keep the directory.

The one new row that passes on main is NIT-4's. It sends `GNUmakefile/` to the code leg, and there main's NEXT is already `make bootstrap`. It guards what main has: under the review's mutant X6, which hands NEXT every leg's paths, it is the row that fails.

The 19 rows of #1121's file that fail on main are exactly the rows that use the three pins this merge moved (`OWN_MAKEFILE_NOTE`, `RUNS`, `script_aside`). The 21 that pass use none of them.

Earlier heads, on main `961640c68` and with the same method: `1c7ca5c6d` failed 29 of 35 rows, and `8b499842f` failed 34 of 35 (the new file plus the three `tests/test_adopt_e2e.py` rows the mutants use).

**This round**, at `75c90b6db`, in a scratch worktree. Each mutant was applied alone and restored, and each file's sha256 was checked against the commit (4/4 every time). Each ran against 95 rows: the new file (35), `tests/test_adopt_e2e.py` (27) and `tests/test_adopt_make_reads_first.py` (33). Unmutated, all 95 pass.

| id | mutant | rows failing (of 95) | result |
|---|---|---|---|
| X1 | the review's: the script-only NOTE names `make bootstrap` after the merge (`if stops and makefile`) | 1 | killed |
| X6 | the review's: `cmd_execute` passes every leg's paths | 1 | killed |
| N1 | NIT-3 undone: beside a kept `Makefile`, no merge named | 2 | killed |
| N2 | the merge named where the script went aside too | 1 | killed |
| N3 | the merge named where no `Makefile` was kept | 4 | killed |
| T1 | NIT-1 undone: "(above)" back | 1 | killed |
| T2 | NIT-2 undone: README's `make park` / `make resume` sentence removed | 1 | killed |

The merge with #1121 rewrote the clause code that N1-N3 mutate (`stopped` became `reads`, and the merge condition gained `stops`). The mutants were not run again at `6fa1edd56`.

**Earlier,** 18 mutants at `1c7ca5c6d` against 43 rows, each applied alone in a scratch worktree and restored with its sha256 checked:

| id | mutant | rows failing (of 43) | result |
|---|---|---|---|
| M1 | `_make_reads_first` drops the `/` of a directory | 14 | killed |
| M2 | the clause's directory branch never taken | 10 | killed |
| M3 | NEXT ignores a kept directory (`stops = None`) | 6 | killed |
| M4 | NEXT's command stays `make bootstrap` for a directory | 4 | killed |
| M5 | `cmd_execute` passes `surviving=()` | 2 (the two adoptions) | killed |
| M6 | `BOOTSTRAP_COMMAND` without `(python on Windows)` | 12 | killed |
| M7 | NIT-2's tail back to "neither ... before both merges are made" | 2 | killed |
| M8 | `AGENTS-shape.md`'s "Work from here" caveat removed | 1 | killed |
| M9 | the sentence after the five-commands table removed | 1 | killed |
| M10 | `README.md`'s sentence removed | 1 | killed |
| M11 | #480's NOTE back to plain `python3` | 1 | killed |
| M12 | the collision follow-up's "until then" back to plain `python3` | 2 | killed |
| M13 | after the merges, NEXT says `make bootstrap` where a directory stops make | 1 | killed |
| M14 | the lookup takes the LAST kept name (`reversed`) | 4 | killed |
| M15 | the directory NOTE's lead ignores a kept `Makefile` | 1 | killed |
| M16 | the lookup folds case (`fold=True`) | 4 | killed |
| M17 | the clause drops GNU make's own words (`GNUmakefile: Is a directory.`) | 10 | killed |
| M18 | the file clause says `does` whatever `has` is | 0 | **survived** |

M18 was equivalent before the merge: the file clause's only caller was the `CONTRACTS_DIR` line. Since the merge, #1121's NOTE calls it with `has them`, and `tests/test_adopt_next_make_reads_first.py` pins that wording. M18 was not run again.

Each run went through the lane's runner: `gh` stubbed first on PATH with a bogus token, `GIT_SSH_COMMAND=false`, `GIT_CONFIG_GLOBAL=/dev/null`, `EMAIL` set, `-p no:cacheprovider`, and `tmp_path_retention_policy=failed`. Each run is on a commit, with a clean tree.

| run | commit | git | files | passed | failed |
|---|---|---|---|---|---|
| gate M | `6fa1edd56`, the merge | 2.43.0 | the new file, `test_adopt_next_make_reads_first.py`, `test_adopt_e2e.py`, `test_adopt_make_reads_first.py`, `test_path_guard_hygiene.py`, `test_repo_hygiene.py`, `test_agents_md_codes.py`, `test_cli_reference.py`, `test_pinned_copy_text.py`, `test_scaffold_leg_path_collisions.py` | 618 | 0 |
| gate N | `6fa1edd56` | 2.47.1 | the new file and `test_adopt_next_make_reads_first.py` (75), then `test_adopt_e2e.py` (27), run one after the other | 102 | 0 |
| gate H | `6fa1edd56` | 2.47.1 | the hygiene five | 379 | 0 |
| gate A2 | `75c90b6db` | 2.43.0 | the new file, `test_adopt_e2e.py`, the hygiene five (`test_path_guard_hygiene.py`, `test_repo_hygiene.py`, `test_agents_md_codes.py`, `test_cli_reference.py`, `test_pinned_copy_text.py`), `test_adopt_make_reads_first.py`, `test_adopt_contracts_dir.py`, `test_adopt_printed_sentences.py`, and the template's readers: `test_scaffold_e2e.py`, `test_scaffold_free_text_values.py`, `test_free_plan_hint.py`, `test_template_quoted_values.py`, `test_template_values_single_pass.py`, `test_template_text_placeholders.py`, `test_bootstrap_placement_texts.py`, `test_park_resume_targets.py`, `test_update_shape_hardlink.py` | 1128 | 0 |
| gate A | `1c7ca5c6d` | 2.43.0 | 17 files (the new file, `test_adopt_e2e.py`, the hygiene five, `test_scaffold_leg_path_collisions.py`, `test_adopt_make_reads_first.py`, `test_adopt_contracts_dir.py`, `test_adopt_printed_sentences.py`, `test_adopt_attributes_eol_block.py`, `test_adopt_leg_path_collisions.py`, `test_scaffold_e2e.py`, `test_bootstrap_placement_texts.py`, `test_park_resume_targets.py`, `test_template_text_placeholders.py`) | 966 | 0 |
| gate B | `1c7ca5c6d` | 2.47.1 | the new file, `test_adopt_e2e.py`, `test_path_guard_hygiene.py`, `test_repo_hygiene.py` | 209 | 0 |
| doctor | `1c7ca5c6d` | 2.43.0 | `test_shape_doctor.py`, `test_scaffold_leg_path_collisions.py` | 549 (3 skipped: the PowerShell rows, which run only on a Windows host) | 0 |

`tests/` was grepped for every line this PR changes in `templates/assembly-root/` ("They are the shape", "reads first holds", "includes a Makefile that", "(above)", "here and below", "Where this root keeps", "it is what the shape", "before `Makefile`", "`python` on Windows"). Only `tests/test_adopt_make_bootstrap_followups.py` pins them. Four other files read the README as a whole, and each passes in gate A2:
- `test_scaffold_free_text_values.py` counts its lines against the template;
- `test_free_plan_hint.py` looks for "Free plan" and `--repo`;
- `test_template_quoted_values.py` and `test_template_values_single_pass.py` render it.

`git merge-tree --write-tree` of the head `01e93b6d1`, on git 2.43.0, at 18:11Z.
- **Main** `9729315f1`, fetched again at 18:11Z, is the main this round merged last. The merge-tree is clean, and its tree is the head's own, `f6488542f`.
- **Main moved to `801a7d6d0`** at 18:14Z, when lane 3's #1106 landed (`adopt-project.py` and two locale test files). The merge with it is clean, tree `25bc27d39`, and gate P4 passed on it. It was not merged in: it touches none of the code this round resolves, and landing refreshes the branch anyway.
- **The open PRs:** one `gh pr list --state open --limit 100 --json number,headRefName,headRefOid,files` read at 18:11Z returned 51 open PRs. 26 of them touch one of this PR's paths. That includes `tests/test_adopt_collision_make_reads.py` and `tests/test_adopt_make_reads_first.py`, which this PR now changes. 25 merge cleanly: #1106, #1120, #1122, #1125, #1141, #1143, #1153, #1154, #1170, #1171, #1177, #1178, #1186, #1189, #1194, #1198, #1210, #1225, #1244, #1249, #1251, #1252, #1253, #1265 and #1268. #1106 has landed since (above).
- **Lane 1's #1189** (`472944b5d`, read fresh at 18:11Z) edits three test files that this round changes too: `tests/test_adopt_next_make_reads_first.py`, `tests/test_adopt_collision_make_reads.py` and `tests/test_adopt_make_reads_first.py`. The merge is clean, tree `7fd030b29`. #1189's hunks are in the imports, in the clone rows' parameter lists and docstrings, and in a new refusal row, away from the moved pins, the `makefile-directory` row and NIT-A's comment. On that predicted merge, a local commit object, the three shared files pass on git 2.43.0: `tests/test_adopt_make_reads_first.py` and `tests/test_adopt_collision_make_reads.py` give 62 passed, and `tests/test_adopt_next_make_reads_first.py` gives 38 passed. There are fewer rows than at this head because #1189 leaves out the clone rows that keep case twins.
- **#1237** (`b557859fd`) conflicts in `tests/test_adopt_check_throwaway_repos.py`, a file this PR does not change. Main conflicts with #1237 in that file too, while `6fa1edd56` did not, so the conflict is main's, carried in by the merge.
- **Main moved again after the round** (rv1207e, at 19:25Z): lane 1's #1143 landed as `81eaf757c` (`adopt-project.py`) and lane 4's #1117 as `9252ef208` (README, the handbook and `scripts/family.py`). The head merges clean with both (trees `e40373967` and `279f8c6ce`), and rv1207e's gate P passed on the predicted merge with `9252ef208` (359 passed). At 19:22Z, 48 PRs were open, 24 touch this PR's files, and 23 merge clean; #1237's conflict is main's, as above.
- **No longer on the list:** #1105, #1121, #1118 and #1123 are on main. Since `6fa1edd56`, #1104, #1160, #1169, #1180, #1190 and #1223 landed too.

The conflicts are the same in every order, measured offline both ways round and with predicted squashes:
- **#1121:** 4 hunks, 84 lines, in `adopt-project.py`'s `_next_steps` and `cmd_execute`'s comment.
- **#1105:** 3 hunks, 65 lines, in `scripts/shape_materialize.py`'s `collision_follow_up`: its docstring's NIT-4 sentence, its paragraph on the Makefile's merge, and its two `return`s.
- #1121 and #1105 merge with each other cleanly, and so do #1104 and this PR.

So the order decides only who resolves them. **Both have landed**, and lane 5 resolved both on this branch:
- **#1121** (merge `6fa1edd56`). The resolution is one lookup and one clause, `BOOTSTRAP_COMMAND` in #1121's NOTEs, and #1121's three test pins moved.
- **#1105** (merge `7b0192bde`, see "Main merge after #1105"). The resolution keeps #1105's `reads_first` branch and runs `BOOTSTRAP_COMMAND` through it. NIT-2's tail is this PR's where `make` reads the merged `Makefile`, and #1105's where `make` reads another file. Four of #1105's test pins moved: `MERGE_IS_ENOUGH`, `BOTH_MERGES`, `MEANWHILE` and `SCRIPT_MERGED`.

Main was merged in once more after lane 1's #1123 (merge `01e93b6d1`): one of #1123's rows pinned the line this PR changes for a kept `makefile/` directory, and it moved (see "The second merge, after #1123").

No other PR has to land first now. `6fa1edd56` was re-checked READY (rv1207b, rv1207c and rv1207d, issuecomment-6722602375). The head, `01e93b6d1`, needs a check of its delta since then: the two merges' resolutions, the four moved pins in #1105's file, #1123's moved row, and NIT-A.

#1240 tracks what this PR leaves:
- #1132's item 4 (one `GNU_MAKE_READS`, one lookup);
- #1105's collision line, for a kept directory (its `python3` part is done here: see "Main merge after #1105");
- #1121's file NOTE beside a kept `Makefile`, which does not name the merge (as this PR's directory NOTE now does);
- #1105's second review's NIT-1, NIT-3b, NIT-3c, NIT-4 and NIT-5;
- `_make_reads_first_clause`'s `has` argument, now live;
- rv1207e's NIT-1: the docstring sentence "With none, the Makefile's follow-up is what it was, byte for byte" (`scripts/shape_materialize.py` about :1067), kept from #1105, is no longer true, since this PR changes the line with no `reads_first`. It sits beside #1240's items F and G, which reword the same docstring.

The local branch `fix/1132-template-bootstrap-stacked` (`9eb5cce0b`, never pushed and never tested) is a model of the end state on #1105 + #1121 + main.

- **Item 5,** follow-ups that go stale after a hand edit of the plan, is its own issue, filed as #1206. It also holds the three related cases this work found:
  - a kept `makefile/` directory gets "until the two are merged";
  - a directory kept only through deeper entries is not seen by `_root_keeps`;
  - a kept `Makefile/` directory is treated as a Makefile.
- **This PR's `answered-root` row meets item 5 too.** `plan` asks about `GNUmakefile/`, and its stored `CONTRACTS_DIR` line, written before the answer, names no directory. The row asserts what NEXT and `make` do there, and not that line.
- **Not measured:** a disk that ignores case, and GNU make other than 4.3.

Review: rv1207b and rv1207c, lane 5's independent opus reviewers, and rv1207d, lane 5's independent sonnet reviewer, none of which wrote #1207: READY at `6fa1edd5` (issuecomment-6722602375). Then rv1207e, lane 5's independent opus reviewer, which wrote none of it: READY at `01e93b6d`, H0 of this landing, after the main merges past #1105 and #1123 (issuecomment-6726033282), with no MUST or SHOULD; its three NITs are answered in the body. CI (Brett Heap's ruling 27 and his fast-refresh ruling of 2026-10-15T22:48:35Z): H0 01e93b6 passed tests, tests-git-bash and SonarCloud; the head c9be952 is a clean update-branch merge of main 9cb156a, with tests-git-bash and SonarCloud green; and the local gate passed on its predicted squash tree 0a01d35 over main 9cb156a: the adopt_collision_make_reads, adopt_e2e, adopt_make_bootstrap_followups, adopt_make_reads_first, adopt_next_make_reads_first, repo_hygiene, agents_md_codes, cli_reference sets, 333 passed. Landed on Brett Heap's word of 2026-10-23T13:10:26Z, relayed to every lane by lane 3 (#473 issuecomment-6365697123): "merge v1.2.1 PRs once reviewed and green".

Closes #1132

Lane: openreposhape-5 (openRepoShape-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Nov 10, 2026
…t four sites, so a name that ends in a line feed matches no family and `validate-repository-naming.py` refuses it, and `repository-naming.yaml` says a pattern is read whole (#1202) (#1266)

**#1202: a repository name that ends in a line feed is the name of no family of the naming policy, and `validate-repository-naming.py` refuses it as `naming-unclassified`, by name, over a manifest's leg `repository:` and over an argument, where main classified `Atlas\n` as `Atlas` and exited 0.**

This is a DRAFT on `main` (`be21751c3`, the landing for #1243). It is the follow-up lane 5 filed as #1202 from its independent review of #1166 (#1139), finding 1 (pull/1166 issuecomment-6352173084). #1166 ended the seven module-level patterns of the validators in `\Z` and read the three ids with `fullmatch`, and left `NamingPolicy`, whose patterns come from `contracts/repository-naming.yaml`, every one `^...$`, read with `.match`. The change is one commit, `09697e9c5`: 3 files, +255 and -4 (`git diff --shortstat origin/main...HEAD`): `scripts/repo_shape.py` (+5 -4), `contracts/repository-naming.yaml` (+8), and the new `tests/test_naming_policy_line_break.py` (+242, 77 rows).

Measured on main `be21751c3` (production code equal to `5926cccab`, where the branch was cut), Python 3.12.3, git 2.43.0, a stub `gh` and no network.

`NamingPolicy` read a name with `.match` at four sites of `scripts/repo_shape.py`: `descendant_referents` (the family's `_re`, then its `_split_re`) and `matches` (a role's `_re`, then a family's). In Python `$` also matches just before a trailing line feed, and the YAML reader reads a double-quoted `"...\n"` as the text and a line feed. So `matches`, `classify` and `descendant_referents` gave a name with a trailing line feed the answers of the name without it (`NamingPolicy.load(contracts/repository-naming.yaml)`, in process):

| Name, with and without `\n` | `classify` on main | On this branch, with `\n` |
|---|---|---|
| `Atlas`, `Atlas-spec`, `Atlas-code` | `('project-leg', 'assembly' / 'spec' / 'code')` | `matches == []`, `classify is None` |
| `openFoo` | `('neutral-product', None)`, also `project-leg/assembly` | `matches == []`, `classify is None` |
| `Thing-Install` | `('install', None)` | `matches == []`, `classify is None` |
| `user-wip` | `('workspace', None)` | `matches == []`, `classify is None` |
| `InkxRouter`, `MedxScribe` | `('project-leg', 'assembly')`, with `descendant_referents` `('openRouter', 'openxRouter')` and `('openScribe', 'openxScribe')` | `matches == []`, `classify is None`, and `descendant_referents == ()` |

`Atlas-Spec` (a capital S) is `None` with and without the line feed, on both. `topic_pattern.match('xf-project-atlas\n')` is a match on main; no tool reads `topic_pattern` (see Limits).

The gate (`validate-repository-naming.py`, run by the root template at `Makefile:48` and `validate.yml:310`), measured by the new rows run on main's code:

- `--project project.yaml` over a scaffolded root whose leg `repository:` is written `"testorg/Atlas\n"` (and likewise `-spec` and `-code`): **exit 0**, the table naming the leg and its family on two lines (`'  Atlas'`, then `'                           project-leg/assembly'`).
- The same name as an argument (`Atlas\n`, `Atlas-spec\n`, `Atlas-code\n`): exit 0, the same split. A name read from stdin is stripped (`line.strip()`), and is untouched.
- The issue also measured that `validate-manifest.py` has refused such a leg since #1166 (`manifest-leg-repository`, `QUALIFIED_RE` ending in `\Z`), so the root's gate as a whole already failed; the naming step passed. I did not re-run that measurement.

- **`scripts/repo_shape.py`:** the four sites read `fullmatch`. `NamingPolicy` is the only code that matches a name against the data's patterns (`grep` of the tracked `*.py`; `scaffold-project.py:1535` prints the neutral-product pattern's text in a remedy and matches nothing). A one-line note beside `topic_pattern` says that a reader must use `fullmatch`, because `$` takes a final line feed.
- **`contracts/repository-naming.yaml`:** a paragraph at the end of the header, "A PATTERN IS READ AGAINST THE WHOLE NAME", for a fork's pattern. A pattern with no `$` was read as a prefix under `.match` and is read as the whole name now, so a fork writes the pattern for the entire name. I took this of the two ways the issue offers (the other is to keep `.match` and refuse a name that holds a line feed at the entry of `matches`, `classify` and `descendant_referents`) as the shorter. Every shipped pattern begins with `^` and ends with `$`, and the measured sweep below shows `fullmatch` changes no answer except a trailing line feed.
- **`tests/test_naming_policy_line_break.py` (new, 77 rows):**
  - the names are read from the data (`families[].examples`, `roles[].examples`, the descendant family's `claim_without_referent_examples`), so a family or a role added to the contract is covered without a line here; a `declared_only` family is asked under its own id;
  - a baseline row per name (the name without the line feed is matched as it was) and, per name with the line feed, `matches == []`, `classify is None` and `descendant_referents == ()`;
  - rows over a fork's policy (`NamingPolicy` built from the shipped data with ONE pattern written without `$`) for each of the four sites;
  - the gate rows: `validate-repository-naming.py --project` over a scaffolded root for each of the three roles, a double-quoted baseline, and an argv name for each, with its baseline.
- **Nothing else.** No refusal code is added, changed or renamed, no sentence of a refusal changes, no command or flag is added, so `AGENTS.md`, `README.md`, `docs/` and the handbook mirror stay as they are. Before the change I grepped `tests/`, `README.md`, `docs/` (the handbook), `AGENTS.md` and `contracts/` for text that pins the header's wording or a prefix reading of a policy pattern: nothing reads the contract's comments, and the only patterns a test writes into a policy are `tests/test_naming_policy.py:2498`'s fork form `^~[a-z]+$`, which has a `$`, and `tests/test_doctor_validator_verdicts.py:324`'s corrupted `(^open(?:`, which does not compile.
- **What pins `scripts/repo_shape.py`.** This repository holds no copy of it and no digest of it. A project's copy is pinned by the shape pin's tree digest (`sorted-ls-tree-r-v1`, computed over the shape's tree at the pinned commit), and `update-shape.py` reaches it as an `upstream-changed scripts/repo_shape.py` row; `contracts/repository-naming.yaml` is in the copy lists of `scripts/shape_materialize.py` (lines 444 and 652) and reaches a project the same way. `fullmatch` needs no import, so no pinned script meets a name it lacks; `tests/test_pinned_copy_text.py` passes (hygiene five below).

`tests/test_naming_policy_line_break.py` run on main's production code (`n1202-mut`, a detached tree at `be21751c3` with the new file copied in; sha256 of the file equal to the branch's): **40 failed, 37 passed** (`run-new-main-be21751c3.log`). The 37 that pass are the baselines (21 family names, 6 role names, 6 descendant names, the double-quoted leg, 3 argv names). The 40 that fail, and why:

| Row (function) | Failing on main | Because |
|---|---|---|
| `test_a_name_that_ends_in_a_line_feed_matches_no_family` | 24: `neutral-product-` `openxFactory`, `openXwallet`, `openChart`, `openDox`, `openXdox`; `install-` `xFactory-Hermes-Install`, `Hermes-Install`, `Keycloak-Install`; `domain-descendant-` `MedxChart`, `LedgerxWallet`, `codexFactory`, `MedxGlass`, `codexDox`; `project-leg-` `Atlas`, `Atlas-spec`, `Atlas-code`, `Northwind`, `Northwind-spec`, `Northwind-code`; `family-` `InkRouter`, `Northwind`; `workspace-` `brett-wip`, `scott-wip`, `a1-wip` | `matches(name + "\n")` was the answer for the name |
| `test_a_descendant_name_that_ends_in_a_line_feed_has_no_referent` | 6: `MedxChart`, `LedgerxWallet`, `codexFactory`, `MedxGlass`, `codexDox`, `MedxScribe` | `descendant_referents` gave `openChart` and `openxChart`, and so on |
| `test_a_forks_descendant_pattern_with_no_dollar_is_read_as_the_whole_name` | 2: `family-pattern`, `split-pattern` | a prefix pattern took `MedxScribe` |
| `test_a_forks_leg_pattern_with_no_dollar_is_read_as_the_whole_name` | 2: `role-pattern`, `family-pattern` | a prefix pattern took `Atlas_x` |
| `test_the_naming_gate_refuses_a_leg_repository_that_ends_in_a_line_feed` | 3: `assembly`, `spec`, `code` | exit 0 where 1 is expected |
| `test_the_naming_gate_refuses_an_argv_name_that_ends_in_a_line_feed` | 3: `Atlas`, `Atlas-spec`, `Atlas-code` | exit 0 where 1 is expected |

On the branch all 77 pass. The refusal is, for each: exit 1 and the line `FINDING naming-unclassified: <name>`.

**No name without a line feed changes its answer** (measured, not argued): `matches`, `classify` and `descendant_referents` over 66,688 names (every string of up to 5 characters over `A a x X - 1 _`, a space and a line feed, and 11 stems with 12 suffixes, with and without `open`) under 5 declared roles (none, `assembly`, `spec`, `code`, `family`), on main and on the branch: 333,440 rows, **3,225 differ and every one is a name that ends in a line feed; none that does not**; and no name that ends in a line feed matches anything on the branch (`probe_inproc.py` and `sweep.py` in lane 5's `work/n1202/`). `tests/test_naming_policy.py` passes unchanged.

Each applied alone to `scripts/repo_shape.py` on the branch's copy in `n1202-mut`, run against the new file, and restored with a sha256 check (`restored True`, and at the end the file is main's bytes again, blob `00759f1e6`):

| Mutant | Result | Killed by |
|---|---|---|
| M1: `descendant_referents`, the family's `_re.fullmatch` put back to `.match` | 1 failed, 76 passed | `test_a_forks_descendant_pattern...[family-pattern]` |
| M2: `descendant_referents`, `_split_re.fullmatch` put back to `.match` | 1 failed, 76 passed | `test_a_forks_descendant_pattern...[split-pattern]` |
| M3: `matches`, a role's `_re.fullmatch` put back to `.match` | 25 failed, 52 passed | 18 of the every-name rows, `test_a_forks_leg_pattern...[role-pattern]`, and the 3 leg and 3 argv gate rows |
| M4: `matches`, a family's `_re.fullmatch` put back to `.match` | 31 failed, 46 passed | all 24 every-name rows, `test_a_forks_leg_pattern...[family-pattern]`, and the 3 leg and 3 argv gate rows |
| M5: M1 and M2 together | 14 failed, 63 passed | 6 every-name rows, the 6 descendant rows, both fork descendant rows |
| M6: all four sites | 40 failed, 37 passed | the same 40 as on main |

No survivor. **M1 and M2 are killed only by the fork rows, and that is the shape of the code, not a gap in the rows:** the two sites of `descendant_referents` stand in series, and the shipped `split_pattern` takes the family pattern's language, so on the shipped data either alone makes the other redundant (M5 is what the shipped-data rows kill). A fork's policy whose one pattern has no `$` is what asks each by itself; it is also the case the contract's new paragraph is written for.

Python 3.12.3 (CI runs 3.14; the rows assert lists, tuples and finding 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 `09697e9c5`, dirty=0:

| Run | git | Result |
|---|---|---|
| the new file, `tests/test_value_pattern_line_break.py` (the sibling it imports two helpers from), `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` | 2.43.0 | **751 passed** in 131.18s |
| the same files | 2.47.1 (`tools/git247/bin/git`, built from kernel.org's tarball) | **751 passed** in 120.02s |
| the neighbours that name `NamingPolicy` or run the naming gate: `test_manifest_validator`, `test_scaffold_referent_chain_links`, `test_chain_pin_sources`, `test_github_name_limits`, `test_adopt_manifest_values`, `test_scaffold_manifest_values`, `test_reader_refusals_named`, `test_pin_source_env_collisions`, `test_family_init_values` | 2.43.0 | **750 passed, 19 skipped** in 383.95s (all 19 are template skips in `tests/test_family_init_values.py`: 16 at `:229`, "this template quotes the placeholder", and 3 at `:301`, "this template quotes `id:`", as rv1266 printed them with `-rs`) |

Before the rebase onto `be21751c3` the same files (without the sibling) passed at the then head `f552017f1`: 720 on 2.43.0 and 720 on 2.47.1. **Not run:** the full suite, a real Windows host and macOS, and `test_shape_doctor.py` (it reads the naming validator through the doctor and no name in it ends in a line feed).

**Read again by rv1266 at 2026-11-08T17:10Z:** main `46fe6ac19` gives tree `251537e4`, clean, and main `12122952b` gives `c46cbe55`, clean. The new file, `test_value_pattern_line_break`, `test_naming_policy` and the hygiene five passed on that predicted merge (751, git 2.43.0), since `12122952b` changed `tests/test_pinned_copy_text.py`.

`git merge-tree --write-tree <other> 09697e9` (git 2.43.0) at 2026-11-08T16:29Z, against main and every open PR that touches one of this PR's files (50 open):

| Against | Head | Tree |
|---|---|---|
| main | `be21751c3` | `836cb7fec` (clean) |
| #1249 (`scripts/repo_shape.py`) | `3146c3ca5` | `f41cf1dca` (clean) |
| #1171 (`scripts/repo_shape.py`) | `8162b874e` | `29eee887f` (clean) |
| #1236 (`scripts/validate-repository-naming.py`, which the new rows run) | `352dcbc96` | `64990151d` (clean) |

The later lander takes the refresh.

- **`topic_pattern` has no row.** Nothing outside `tests/test_naming_policy.py:422` reads it at main, and the data's `topic.pattern` and `topic.id_pattern` are read by no tool, so a row cannot fail on main for it. The note beside it, and the contract's paragraph, say a reader must use `fullmatch`.
- **A project's own copy reaches this through `update-shape.py`.** Until a project takes the new `scripts/repo_shape.py` its `validate-repository-naming.py` and `validate-manifest.py` run the old `.match`. The root's `validate-manifest.py` already refuses a leg `repository:` that ends in a line feed since #1166.
- **The refusal prints the name raw.** `naming-unclassified` names the name as typed, so `Atlas\n` ends the finding's first line and the existing text ("These names match none of the families ...") follows after a blank line; a name holding an ESC prints raw there on main too. Not changed: the issue asks that the name be refused by name, and no wording or code moves.
- **A fork's data that relied on a prefix reading.** A fork's pattern with no `$` is read as the whole name now, as the contract's header says. The shipped data has none, and no test writes one.
- Not touched, read at their call sites: `scaffold-project.py`, `setup-project.py`, `family.py` and `shape_materialize.py` take a name from argv, which `checked_value` refuses first; `validate-family.py` strips it.

Review: rv1266, lane 5's independent opus reviewer, which wrote none of #1266: READY at `09697e9c`, H0 of this landing (issuecomment-6724498649), with no MUST or SHOULD; its NIT 2 is #1267, fixed by the stacked #1271. CI (Brett Heap's ruling 27): H0 is the head 09697e9 itself, which passed tests, tests-git-bash and SonarCloud; main has touched none of its files since its base be21751; and the local gate passed on its predicted squash tree 8af5516 over main 3027202: the naming_policy_line_break, adopt_check_throwaway_repos, adopt_e2e, adopt_pins, chain_link_fold, doctor_unsearchable_links, family, path_guard_hygiene, pinned_copy_columns, pinned_copy_text, update_shape_unreadable, validate_family_unreadable, no_auto_maintenance, repo_hygiene, agents_md_codes, cli_reference sets, 1263 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 #1202

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
…ame the file as `shown_path` does, and validate-pins.py, family.py and shape-doctor.py read either spelling (#1168) (#1274)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Closes #1168

Lane: openreposhape-5 (openRepoShape-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Base automatically changed from fix/1114-pin-row-value-read-as to main November 10, 2026 11:02
Brett Heap and others added 2 commits November 10, 2026 11:07
…said (#1212)

Restacks #1249 after #1198 squash-landed (3add78e). Step (a) of three:
the final head of #1198, an update-branch merge of main.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…#1212)

Restacks #1249 after #1198 squash-landed. Step (b) of three: the squash
of #1198 on main. Its four files (adopt-project.py,
tests/test_adopt_pin_row_values.py, tests/test_adopt_pins.py,
tests/test_adopt_plan_value_order.py) are byte-equal between #1198's
final head and the squash, so this merge changes none of them.

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

Copy link
Copy Markdown
Contributor Author

Restack of this PR after #1198's squash. A delta review of the restack only, please: the reviewed change itself (RD1249 graded 3146c3c READY, issuecomment-6724096167) is carried byte-for-byte, as shown below.

New head: 3e5d1fde13bbdb31b9f5a1a6839536085ae72beb on fix/1212-overflow-and-long-int-said. It is a fast-forward of the old head 3146c3ca5f102624d0c36761ca192cbd7f60df93, pushed without force. Its tree is 1e6bad0ac0c07e471bc9b6d0e9fc4abd74b78000. Main is 3add78e1cfffcb8f92d9fbb6ea3c884674b129e2 (#1198's squash, S) and was still that when I pushed, so git merge-tree --write-tree origin/main HEAD is clean and gives that same tree.

The merges (merge commits by the estate git identity, never a rebase):

Delta comparison. The real base is d38e4e36df7be4ba85a4600fd0e0d2f9931a13c1, #1198's pre-refresh head H0, which is git merge-base 3146c3ca5 d38e4e36d. For each side I took the changed lines as grep -E '^[+-]' | grep -vE '^(\+\+\+|---) ' prints them:

  • old, git diff -U0 d38e4e36d 3146c3ca5: 424 lines, sha256 2cc683baf5a6774e962ed6e136b1305ae558dcb5f2075bc92965d259732ad000
  • new, git diff -U0 origin/main HEAD: 424 lines, sha256 2cc683baf5a6774e962ed6e136b1305ae558dcb5f2075bc92965d259732ad000
  • cmp says the two are byte-equal.
  • git diff --name-only origin/main HEAD lists only adopt-project.py, scripts/repo_shape.py and tests/test_plan_number_limits.py (3 files changed, 412 insertions, 12 deletions).

Gate, run in a worktree detached at 3e5d1fde1, with PYTHONINTMAXSTRDIGITS unset unless noted, the real gh stubbed out, and git filter-repo first on PATH. An earlier attempt was stopped part-way for an account swap, and none of its counts is used here. All of these are whole runs:

  • contA, tests/test_shape_doctor.py: 446 passed, 3 skipped (the Windows-only PowerShell rows at line 10516), in 792.93 s, exit 0.
  • contB, the other 17 files: 1379 passed in 613.01 s, exit 0. They are test_adopt_pin_row_values, test_adopt_pins, test_adopt_plan_value_order, test_bootstrap_pasteable_lines, test_bootstrap_spelling, test_cli_reference, test_git_output_decoding, test_load_yaml_refusals, test_path_guard_hygiene, test_pinned_copy_text, test_plan_number_limits, test_reader_refusals_named, test_readme_windows_quoting_sentence, test_refusal_default_remediation, test_repo_hygiene, test_scaffold_leg_path_collisions and test_shape_advisory.
  • rowsU, rows640 and rows0, tests/test_plan_number_limits.py alone with PYTHONINTMAXSTRDIGITS unset, 640 and 0: 35 passed under each.
  • No failures, so no comparison against a clean main was needed.

Merge-trees (run at 11:09Z against this same head 3e5d1fde1): clean against main; clean against #1171, #1284 and #1304, the open PRs that touch scripts/repo_shape.py; no other open PR touches tests/test_plan_number_limits.py. #1280 conflicts in adopt-project.py, and the merge-tree of main against #1280 conflicts the same way, so that conflict is #1280's own with main and not caused by this restack.

The branch fix/1212-overflow-and-long-int-said-wip holds the same commit as a checkpoint copy and is left as it is.

Lane: openreposhape-4 (openRepoShape-4)

@sonarqubecloud

Copy link
Copy Markdown

@brettheap

Copy link
Copy Markdown
Contributor Author

RVD1249: delta review of #1249's restack at 3e5d1fde: READY

Independent DELTA review (RVD1249, lane openRepoShape-4, 2026-11-10) of the restack only. The change itself was graded READY by RD1249 at 3146c3ca5 (issuecomment-6724096167) and is not re-reviewed. My one question: did the restack carry exactly that change onto main, and nothing else? It did. I read the branch head git ls-remote reported at 12:40Z: 3e5d1fde13bbdb31b9f5a1a6839536085ae72beb on fix/1212-overflow-and-long-int-said, which is also the PR head (GitHub says base main, OPEN, MERGEABLE). Main was 3add78e1cfffcb8f92d9fbb6ea3c884674b129e2 (#1198's squash S) at the same read. My clone is fresh, Python 3.12.3, git-filter-repo a40bce548d2c first on PATH, the real gh stubbed to exit 97, GH_TOKEN=bogus, an empty GH_CONFIG_DIR, an empty global git config, GIT_SSH_COMMAND=false.

Verdict. No MUST, no SHOULD, no NIT. Checks 1 to 8 all PASS.

Checks

# Check Result
1 Ancestry PASS
2 Merge 1 tree equals merge-tree of 3146c3ca5 and F PASS
3 Merge 2 changes nothing; F equals S on #1198's four files PASS
4 No third merge was needed PASS
5 The delta is byte-identical and touches only #1249's three files PASS
6 Today's main: clean, same delta PASS
7 Tests PASS
8 RS1249-cont's comment, fact by fact PASS

1. Ancestry. git merge-base --is-ancestor 3146c3ca5 3e5d1fde1 holds. git log --first-parent --format='%H %P | %an | %cn | %s' 3146c3ca5..3e5d1fde1 lists exactly two commits, author and committer both Brett Heap with the estate service address:

Without --first-parent the range lists 83 commits, the main commits F and S bring in, as expected. F itself is a merge of main (b1a87293a has parents d38e4e36d and b607223b4, subject "Merge branch 'main' into fix/1114-pin-row-value-read-as").

2. Merge 1. Its tree is 1e6bad0ac0c07e471bc9b6d0e9fc4abd74b78000. git merge-tree --write-tree 3146c3ca5 b1a87293a6579388f278136d01a92e7160ec3af7 exits 0 and prints 1e6bad0ac0c07e471bc9b6d0e9fc4abd74b78000.

3. Merge 2. git diff F S -- adopt-project.py tests/test_adopt_pin_row_values.py tests/test_adopt_pins.py tests/test_adopt_plan_value_order.py is 0 bytes. The merge's tree is 1e6bad0ac..., equal to its first parent's tree; git diff a7dfa6b9b 3e5d1fde1 is 0 bytes; and git merge-tree --write-tree a7dfa6b9b 3add78e1c exits 0 with the same tree again.

4. No third merge. git merge-base --is-ancestor 3add78e1c 3e5d1fde1 holds, and git log --oneline 3add78e1c..origin/main is empty (0 commits) at 12:40Z, after a fresh fetch. Main is still S, so a merge of main would have been a no-op.

5. The delta. The changed lines, as grep -E '^[+-]' | grep -vE '^(\+\+\+|---) ' prints them:

  • old, git diff -U0 $(git merge-base 3146c3ca5 d38e4e36d) 3146c3ca5, the base being d38e4e36d: 424 lines, sha256 2cc683baf5a6774e962ed6e136b1305ae558dcb5f2075bc92965d259732ad000
  • new, git diff -U0 3add78e1c 3e5d1fde1: 424 lines, sha256 2cc683baf5a6774e962ed6e136b1305ae558dcb5f2075bc92965d259732ad000
  • cmp says the two files are byte-equal, and the sums equal the one the restack writer reported.
  • git diff --name-only 3add78e1c 3e5d1fde1 lists adopt-project.py, scripts/repo_shape.py and tests/test_plan_number_limits.py and nothing else. --shortstat: 3 files changed, 412 insertions, 12 deletions. --raw shows modes 100755/100644 unchanged for the two modified files and one added file, tests/test_plan_number_limits.py, mode 100644.

I also re-derived the head by a different route: git merge-tree --write-tree 3add78e1c 3146c3ca5 (the reviewed head merged straight onto main, no stack) exits 0 and prints 1e6bad0ac0c07e471bc9b6d0e9fc4abd74b78000, the restack's own tree. So the restack is exactly what a direct merge of the reviewed head with main gives.

6. Today's main. git merge-tree --write-tree origin/main 3e5d1fde1 exits 0, tree 1e6bad0ac0c07e471bc9b6d0e9fc4abd74b78000. The changed lines of git diff -U0 origin/main <that tree> hash to 2cc683baf5a6774e962ed6e136b1305ae558dcb5f2075bc92965d259732ad000, and the name-only list is the same three files.

7. Tests. Main is still S, so the scratch merge of main and the head is 3e5d1fde1 itself (tree 1e6bad0ac..., checked with merge-tree). A detached worktree at 3e5d1fde1, /usr/bin/python3 -m pytest -p no:cacheprovider -o tmp_path_retention_policy=failed -q -rfs, EMAIL set, the lane variables unset, two runs at once at most, on a host at load about 48:

  • RD1249's set of ten files (test_plan_number_limits, test_adopt_pin_row_values, test_adopt_pins, test_adopt_plan_value_order, test_load_yaml_refusals, test_reader_refusals_named, test_refusal_default_remediation, test_repo_hygiene, test_path_guard_hygiene, test_cli_reference): 693 passed, no skip, no failure, 478.75 s, exit 0.
  • tests/test_plan_number_limits.py alone with PYTHONINTMAXSTRDIGITS=640: 35 passed (12.88 s). With =0: 35 passed (11.16 s). Both match RD1249's 35.
  • No failure, so no comparison against a clean main was needed.

The count is 693 where RD1249 saw 572 because the main under it was different (be21751c3 then; it says so itself). Collected counts for the same ten files: main S alone 658 (the file tests/test_plan_number_limits.py is absent there), the head 693 = 658 + 35, the old head 3146c3ca5 498. Main's own tests grew by way of #1198's squash and the other landings (for example test_load_yaml_refusals.py is 11 rows at the old head and 112 on main). The PR adds exactly its 35 rows to this set and nothing else.

8. RS1249-cont's comment (issuecomment-6767485388, posted 12:36:13Z). Each fact it states, against what I measured:

Mutants

None run: the restack changes no line of the reviewed change (check 5), so RD1249's table of 17 mutants on 3146c3ca5 stands for the same lines.

Findings

None. No MUST, no SHOULD, no NIT.

Scratch (not committed): /workspace/projects/openRepoShape-worktrees/_lane4-scratch/tools/run/rvd1249/ (scripts, logs, delta-old.txt, delta-new.txt), the clone /workspace/projects/openRepoShape-worktrees/_lane4-scratch/rvd1249-clone and its worktrees rvd1249-merge-wt, rvd1249-old-wt and rvd1249-main-wt; basetemps under /tmp/lane4-rvd1249-bt/.

Lane: openreposhape-4 (openRepoShape-4)

This was referenced Nov 10, 2026

This branch has not been deployed

No deployments
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