Repository navigation
validate-repository-naming.py, validate-manifest.py, validate-pins.py, bootstrap.py, repo_shape.py, shape_materialize.py and adopt-project.py: every helper #1165 names asks #1128's default-ignorable table, so ma U+034F in is spelled by its code point wherever a line names it or the plan writes it, and a branch holding one is refused as one no person can see (#1165) - #1325
brettheap wants to merge 22 commits into
Conversation
… `_shown` names a path, so a bidi control, a line boundary or a byte that is not UTF-8 in it is spelled and no longer reaches the terminal raw (#1035) The branch was printed as it is, `({source.branch})`. It is `_shown` now: a printable branch reads as it did, and any other is spelled between backticks as `check` spells it in `plan-stale` and `plan-tracking-branch-missing`. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…r and zero-width characters are written as ASCII escapes in the rows' source, not as the characters (#1035) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…able character, which a terminal draws as nothing, is spelled by its code point in `plan`'s lines and in the `unsafe-value` refusal, so a branch `ma<U+034F>in` no longer prints as `main` (#1128) `_shown` printed a name as it is wherever `str.isprintable` passed it, and that passes 267 of Unicode's Default_Ignorable_Code_Point characters: 263 combining marks, among them U+034F and the variation selectors, and the four Hangul fillers, among them U+3164. `checked_value` named the value it refused with `repr`, which prints the same 267 as they are. - scripts/repo_shape.py: `DEFAULT_IGNORABLE_RANGES`, the property's 17 joined ranges (4174 code points, the same in Unicode 14.0.0, 16.0.0 and 17.0.0), written as a fixed table so that Python 3.12 and 3.14 agree; `DEFAULT_IGNORABLE`; `code_point_escaped`, taken out of `_escaped`, which is unchanged; `visible_repr`; and `checked_value`'s `unsafe-value` refusal names the value with `visible_repr`. - adopt-project.py: `_shown` spells a name that holds one, and `_spelled_character` writes one as its code-point escape, which the plan's reader reads back as the character. - tests/test_adopt_shown_default_ignorables.py (new, 46 rows), with the rows RV1120's review asked for on #1120's `source` line: a printable branch outside ASCII prints as it is, a branch named `main` between backticks is spelled, and the branch that is not UTF-8 is spelled under a `utf-8:surrogateescape` stdout too. - tests/test_adopt_spelled_unambiguous.py: its two sweeps of every character take the default-ignorables apart and hold each to its escape. Stacked on #1120 (see #1035). Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…a value that holds three default-ignorable characters is refused and shown with each one escaped, the compiled `DEFAULT_IGNORABLE` is held to the table, and the skew rule knows the four new names (#1128) RV1171's review of #1171 (issuecomment-6356224053), the SHOULD and two of the NITs. - tests/test_adopt_shown_default_ignorables.py (46 rows, now 48): - S1: `m` U+034F `a` U+3164 `in` U+FE0F through `checked_value`'s `unsafe-value` refusal and through `_shown`: each is written as its escape and none is raw. Every other row held one character to a value, so a `visible_repr` that escaped only the first match passed all of them. - N1: the compiled `DEFAULT_IGNORABLE` matches exactly the table's code points over all 0x110000. The sweeps take their expected value from the pattern, so a pattern one past each range passed them. - tests/test_pinned_copy_text.py: `DEFAULT_IGNORABLE_RANGES`, `DEFAULT_IGNORABLE`, `code_point_escaped` and `visible_repr` join `NEWER_THAN_A_KEPT_LIBRARY`, so the skew rule refuses a pinned script that imports one. Stacked on #1120 (see #1035). Test-only. Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…, bootstrap.py, repo_shape.py, shape_materialize.py and adopt-project.py: every helper that spells a name for a line or for the plan asks #1128's default-ignorable table, so `ma` U+034F `in` is spelled by its code point wherever a line names it or the plan writes it, and a branch holding one is refused as one no person can see (#1165) `str.isprintable` passes 267 of Unicode's Default_Ignorable_Code_Point characters, which a terminal draws as nothing (U+034F, the variation selectors, the Hangul fillers). #1171 wrote the table into `scripts/repo_shape.py`; every other helper that asked `str.isprintable` alone, or spelled with `repr`, printed or wrote them raw. Each asks the table now, and spells one by its own rule: - the three validators' `_shown` and `repo_shape.shown_path` (so `shape_materialize.shown_source`): `repr`'s escape, `'ma\u034fin'`; - `shape_materialize.readable_branch` refuses such a branch as `unseen-branch`, and names a refused value with `visible_repr`; `validate-manifest.py`'s `_branch_finding` finds it and the assembly root's `bootstrap.py` `_argument_fault` faults it, as #715's rule asks of all three; - `repo_shape.double_quoted` writes its code-point escape into the plan and the `submodules:` record, which the reader takes back as the name; `_spelled_character` is `double_quoted(char)[1:-1]` again; - `adopt-project.py`'s `_worded`, `_line_shown` (and `shape_materialize`'s), `unwritable_values`, `_refuse_an_unwritable_clone_url`, `_from_the_remote`, `_first_words`, `_first_said` and `_refetch` (RV1171's N5), through a new `_seen`. RV1171's N4: `_spelled`'s "THE SPELLING IS THE PLAN'S OWN" and `unwritable_values`' "as `unsafe-value` spells one" hold again. The validators and `bootstrap.py` carry their own copy of the table, in `\u` escapes, since a root's `repo_shape.py` may be older than they are; `tests/test_default_ignorables_spelled.py` holds each copy to the library's over every code point. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…D block, asks the default-ignorable table too, so U+034F in git's words, a path or an argument is escaped there, `ma\u034fin` (RV1225; #1165) #1225's `_unacted` came to main after #1171's last merge of main, so it was not on the head #1165 was built on. It asked `str.isprintable` alone, as `_first_said` did; it asks `_seen` now. #1311 gives `adopt-mount-unaddable` the same helper. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… `_branch_finding` holds now that it asks the default-ignorable table, so the older manifest validator #715's update-shape rows run against is still made (#1165) The fixture writes an upstream commit whose `validate-manifest.py` asks a branch for a NUL alone, by replacing `_branch_finding`'s test in the text; #1165 split that line in two, so the fixture's count found nothing and its five rows errored at setup. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideData structuresExtend the shared Unicode spelling rules so default-ignorable characters are escaped in YAML output, visible paths, and checked-value refusals.
APIMake branch validation refuse visually invisible default-ignorable characters and spell refused branch names safely.
Uses of the APIUpdate the naming, manifest, pins, and bootstrap copies to use the same default-ignorable table and escape invisible characters in displayed names.
ImplementationApply the visibility rule throughout adoption and materialization messages, branch instructions, and refusal output so invisible characters are escaped rather than shown raw.
TestsAdd regression coverage for spelling and rejecting default-ignorable characters across helpers, output, plan serialization, and copied tables.
Update the pinned-copy spelling cases and the older-validator fixture to track the revised branch-check source line.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
….py: each `_visible_repr` escapes a default-ignorable character as `ascii` does, `\u034f`, with no `_code_point_escaped` of its own, so each copy of the table's helpers is shorter and writes the same escape (#1165) `ascii(char)[1:-1]` is the shortest of `\x`, `\u` and `\U`, in lowercase hex: `repo_shape.code_point_escaped`'s escape for every character. The three copies carried eight lines of their own for it, and SonarCloud counted the copies in the naming gate and the manifest validator as one duplicated block of 23 lines (7.2% of the new code, over its 3%). Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
RV1165: independent review of #1325 at Lane 4's independent review of #1325 (for #1165), head Summary. The code is right as far as I measured it. The table is Unicode's. The four copies are byte-equal. My own sweep agrees with the writer's. The refusals are within #1165. No text pin breaks, and SonarCloud's gate passed. It is NOT READY for one SHOULD: the rows hand every site only What I measured1. The table and its copies
2. The sites, and my sweep
3. The refusals
4. Template copies and pins
5. The rows and the mutantsThe rows file has 99 rows (my count: 16 + 16 + 8 + 36 + 8 + 8 + 7).
My mutants, X1 to X16, are beyond the PR's 29. Each was a single exact replacement, committed locally on a detached head in
The four survivors survive the existing files too. I ran each against the files that test its function, and each passes all of them:
What the survivors let through, measured:
S1 has the fix. 6.
|
….py: a default-ignorable character is handed to `shown_path`, `shown_source`, both `_line_shown` and each pinned copy of `_shown` beside an ESC, beside a printable non-ASCII character and before a line feed, so a site or a copy that escapes the table only where the rest of the name is printable, or that spells with `ascii`, fails a row (RV1165's S1; #1165) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…AULT_IGNORABLE` cites #610, which made the skew rule, for the reason it holds the table rather than imports it, not #715, the branch rule (RV1165's N2; #1165) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…_as_the_plan_writes_it` asserts `_spelled_character(char) == double_quoted(char)[1:-1]` for every code point it sweeps, the default-ignorables included, since `double_quoted` escapes them and the carve-out that said it did not is gone (RV1165's N3; #1165) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
ma U+034F in is spelled by its code point wherever a line names it or the plan writes it, and a branch holding one is refused as one no person can see (#1165)ma U+034F in is spelled by its code point wherever a line names it or the plan writes it, and a branch holding one is refused as one no person can see (#1165)
|
|
FX1165: RV1165's S1 and N1 to N5 on #1325. New head Head S1 (
X13 to X16, RV1165's exact old and new strings, one replacement each, in a scratch worktree on a detached head (never pushed), the two files above run (201 rows). Each file restored, sha256 checked (all four equal), tree clean:
N2 ( N3 ( N4. The title now says "every helper #1165 names asks #1128's default-ignorable table", with the rest and the N1 and N5 (the body). Edited from the live body (Sourcery's summary section kept as it stands). The opening paragraph names R1 is not done, as briefed: Gate at the head, in the rules' environment (stub
Merge-trees at One thing to schedule, not fixed here: #1310 (for #1288). It merges clean (my first version of the S1 paths conflicted with its one-line change in the same list, so they sit at the top of it now). But on a scratch merge of the two heads (never pushed), SonarCloud at Lane: openreposhape-4 (openRepoShape-4) |
|
RVD1165: delta review of FX1165's round at Lane 4's delta review of FX1165's round on #1325 (for #1165), head Bench: The eleven checks
1. Ancestry: PASS
2. The diff: PASS
3. S1: PASS
The sha256 after each of the seven restores equals the head blob's (X15 and X19 share 4. N2: PASS
5. N3: PASSThe 6. N4, N1 and N5, the title and the body: PASS
7. #1310 on a scratch merge: information for lane 5, not a finding against this round
8. Tests at the head: PASSIn a clone checked out at
I did not re-run FX1165's larger 32-file group (2427 passed) or its 701 group; 9. Today's main: PASS
10. SonarCloud and CI: PASS, with
|



Closes #1165
Stacked, then restacked. Built on #1171's head
ce1dd661f(for #1128) while #1171 landed, then restacked onto #1171's squash838358bf9with 2 merges (#1171's final headc5c02e6dd, the update-branch merge that landed, then its squash838358bf9;origin/mainhad not moved past it), carrying exactly the change: the changed lines ofgit diff ce1dd661f fb50d5165(the one commit on #1171's head) and ofgit diff 838358bf9 0c53e651b(the restacked merge against main) have the same sha256,f837ac693bc879a4e77ecad5c187642de5dd5b1b0d7bd50ca71181482e27974f, over the same 8 files. Three commits follow the restack:504d4ed13, RV1225's site,_unacted, which came to main with #1225 after #1171's last merge of main, so no commit once1dd661fcould hold it; and674e4e3d6,tests/test_yaml_reader_spaces.py'solder_validator, which the gate found pins the line_branch_findingchanges (see Gate); and39af51527, the validators'_visible_represcaping asasciidoes, for SonarCloud's duplication condition (see SonarCloud). Three more follow for RV1165's review (see Fix round):561810310,5102ac4efand75ddbdaa9, tests and one comment, no tool changed.What
#1128 (#1171) wrote Unicode's Default_Ignorable_Code_Point table into
scripts/repo_shape.py(DEFAULT_IGNORABLE, 17 ranges, 4174 code points) and taught_shown,_spelled_characterandchecked_value's refusal to spell those characters.str.isprintablepasses 267 of them, which a terminal draws as nothing: 263 combining marks (U+034F, the variation selectors U+FE00 to U+FE0F and U+E0100 to U+E01EF, and others) and the four Hangul fillers (U+3164 among them). Every other helper that askedstr.isprintablealone, or spelled withrepr, printed or wrote them raw, somaU+034Finread asmain. Each now asks the table, and spells such a character by its own rule:repr-based_showncopies (scripts/validate-repository-naming.py,templates/assembly-root/scripts/validate-manifest.py,templates/assembly-root/scripts/validate-pins.py) andrepo_shape.shown_path, whichshape_materialize.shown_sourceis:repr's escape,'ma\u034fin', through_visible_repr(each validator's) orvisible_repr(the library's).shape_materialize.readable_branchtookmaU+034Finfor a branch, to be compared and handed togh pr create --base: it isunseen-branchnow, and its two refusals name the value withvisible_repr. The root's two that hold its rule (repo_shape.py's YAML reader: Unicode spaces are stripped from text YAML keeps, the empty block key andk: {?: 1}still read, and three texts about the reader are one word out of date (what #635 left) #715) move with it, as the issue asks:validate-manifest.py's_branch_findingfinds it (manifest-tracking-branch,manifest-leg-branch), named'ma\u034fin', where it said nothing and the gate saidmanifest ok; and the assembly root'sbootstrap.py_argument_faultfaults it asUNSEEN, by its code point, where step (a) mademaU+034Finbesidemainin every leg.repo_shape.double_quoted(_escaped) writes it as its code-point escape,"ma\u034fin", in the plan and in thesubmodules:record, where it wrote it raw; the reader takes it back as the same name._spelled_characterisdouble_quoted(char)[1:-1]again, so adopt-project.py and repo_shape.py: a name that holds a default-ignorable character, which a terminal draws as nothing, is spelled by its code point inplan's lines and in theunsafe-valuerefusal, so a branchma<U+034F>inno longer prints asmain(#1128) #1171's second rule in it is gone, with the same output (the sweep below).adopt-project.py:_wordednames it outside the backticks (`ma`, then the character U+034F, then`in`);_line_shownandshape_materialize's copy spell it withvisible_repr;unwritable_valuesand_refuse_an_unwritable_clone_urlname the value withvisible_repr;_from_the_remotesays the step in words with the name_spelled, as it does for a name that does not print;_first_wordsand_first_saidspell it with_spelled_character. They ask one new local helper,_seen:str.isprintableand noDEFAULT_IGNORABLEcharacter._refetch(adopt-project.py:checkandexecuterun withGIT_NO_LAZY_FETCH=1and refuse a partial-clone source that lacks an object its branches, tags or HEAD reach assource-partial-clone, so neither fetches into the source any more (#1145) #1180) says the step in words. RV1171's N4:_spelled's "THE SPELLING IS THE PLAN'S OWN" holds again, since the plan now writes the escape_spelledprints; andunwritable_values' value is spelled "asunsafe-valuespells one",visible_repr. RV1225's finding:_unacted, the helper a REFUSED block spells the command, its directory and its output with, and which adopt-project.py: a refused command's--- output ---block spells each argument and directory that holds a line feed where git names it,adopt-mount-unaddablespells git's output, and rows pin mutants R1, R3 and R10 (#1233) #1311 givesadopt-mount-unaddable, asks the table too.double_quoted,shown_path,shown_source,readable_branch,_branch_finding,_argument_fault, each validator's_shown,_spelled,_spelled_character,_worded,_line_shown(both),_refetch,unwritable_values,_unacted, andsubmodule_record's sentence on what is spelled by its code point (validate-repository-naming.py, validate-manifest.py, validate-pins.py, repo_shape.py, shape_materialize.py and adopt-project.py: the helpers that spell a name for a line or for the plan teststr.isprintable()or userepr, so a combining mark, a variation selector or a Hangul filler in a name prints raw, andmaU+034Finreads asmain#1165 item 4's last bullet).No other output changes: the sweep below compares every helper's output, base against head, for every code point outside the table.
Measured (base vs head)
Each site handed
ma<X>in, X one of U+034F, U+FE0F, U+E0100 and U+3164, on #1171's headce1dd661f(_unactedonorigin/mainf39c6707a, where it is) and on this head; Python 3.12.3, Unicode 15.0.0. "Raw" means the character itself is in what the site printed or wrote.validate-repository-naming.py_shownma<U+034F>in'ma\u034fin'validate-manifest.py_shown'ma\u034fin'validate-pins.py_shown'ma\u034fin'shown_path,shown_source'ma\u034fin'readable_branchREFUSED unseen-branch: tracking_branch is 'ma\u034fin', which holds U+034F, ...readable_branch, a leading-unsafe-value, the value raw... is '-ma\u034fin', which begins with ..._branch_finding[](manifest ok)FINDING manifest-tracking-branch: tracking_branch is 'ma\u034fin', which holds U+034F, ..._argument_faultNone(the branch made)U+034F, a character that does not print or is white spacedouble_quoted"ma<U+034F>in"raw"ma\u034fin"- path: "ma<U+034F>in.md"raw- path: "ma\u034fin.md"_worded`ma<U+034F>in`raw`ma`, then the character U+034F, then`in`_line_shown(both)`ma<U+034F>in`raw'ma\u034fin'unwritable_values'ma<U+034F>in\n'raw'ma\u034fin\n'_refuse_an_unwritable_clone_url'/srv/ma\u034fin\n'_from_the_remote`git branch 'ma<U+034F>in' 'origin/ma<U+034F>in'``ma\u034fin`made fromorigin's branch of that name_first_wordsfatal: 'ma\u034fin' does not appear_first_said: HTTP 404: ma\u034fin Not Found_refetch(N5)`git fetch --refetch --no-filter 'ma<U+034F>in'`git fetch --refetch --no-filterfrom the remote named`ma\u034fin`_unacted(RV1225)ma\u034finThe same holds for U+FE0F, U+E0100 (
\U000e0100) and U+3164.The sweep. Every helper above, base against head, over all 0x110000 code points in
ma<c>in, run twice:ce1dd661fagainst the first commit, andorigin/main838358bf9against this head,_unactedincluded, with the same digests: for the 1,109,938 that are not default-ignorable, the sha256 of their outputs is the same on both, for every helper; of the 4174 that are, 267 came back raw on the base from each spelling helper and 0 do on the head._spelled,_spelled_characterand_showngive the same output on both for every code point, so dropping #1171's second rule from_spelled_characterchanged nothing.The design, and its evidence
scripts/repo_shape.py(adopt-project.py and repo_shape.py: a name that holds a default-ignorable character, which a terminal draws as nothing, is spelled by its code point inplan's lines and in theunsafe-valuerefusal, so a branchma<U+034F>inno longer prints asmain(#1128) #1171'sDEFAULT_IGNORABLE_RANGES,DEFAULT_IGNORABLE,code_point_escaped,visible_repr).adopt-project.pyandscripts/shape_materialize.pyimport it: they run from the shape repository beside its own library, andshape_materialize.pyis in no copy list (its own comment onreadable_branch).validate-repository-naming.py,validate-manifest.py,validate-pins.pyand the assembly root'sbootstrap.py. Each is copied into a root, and runs beside thescripts/repo_shape.pythat root kept, which may predate the table:tests/test_pinned_copy_text.py's skew rule lists all four of the table's names inNEWER_THAN_A_KEPT_LIBRARY, so importing one is refused. Each copy is the same 17 ranges as one pattern, in\uescapes (asked of nounicodedata, so 3.12 and 3.14 read one table), with a comment saying why it is written there; the three validators add_visible_repr,repo_shape.visible_repr's twin, which writes such a character asasciidoes,\u034f: the escapecode_point_escapedwrites, as the copy rows check for every default-ignorable code point.repo_shape.DEFAULT_IGNORABLEdoes, and each validator's_visible_reprisrepo_shape.visible_reprfor every default-ignorable character. The_shownrows assert each validator's spelling equalsshown_path's,test_pinned_copy_text.py's rule for the copies.upstream-changedrows for them, as for every change to them). The test that compares the copies istest_the_pinned_scripts_spell_a_path_as_the_library_does(tests/test_pinned_copy_text.py), which passed unchanged at39af51527and holds three more paths since the Fix round (S1). No sentence in README.md, AGENTS.md, the handbook ordocs/cli.mddescribes these spellings. One test pinned a changed line's bytes,tests/test_yaml_reader_spaces.py'solder_validator, which rewrites_branch_finding's test in the text to make an older validator: the gate found it (see Gate), and674e4e3d6keeps it in step.Rows
tests/test_default_ignorables_spelled.py(new, ASCII only), 99 rows at39af51527and 111 at75ddbdaa9(the Fix round's S1 adds 12): one per site and character (U+034F, U+FE0F, U+E0100, U+3164), each asserting the character is in none of what the site prints or writes and that the site names it by its own rule; the plan file end to end (file, stdout and stderr); N4's two sentences; N5's_refetch; RV1225's_unactedand a REFUSED block; and the copies of the table.ce1dd661f, the first commit's 91 rowsorigin/main838358bf9(#1171's squash), all 990c53e651b, before504d4ed13504d4ed13, and this head39af51527(674e4e3d6changes no row and no code)Every row fails on the base for its own reason: the character raw, no refusal or finding, or (the 7 copy rows)
AttributeError, no copy.Mutants
Each put one site's old test back, ran the new file, and restored the file, its sha256 checked.
scripts/validate-repository-naming.py:naming._shown asks str.isprintable alone, spells with repr(rerun on39af51527)templates/assembly-root/scripts/validate-manifest.py:manifest._shown asks str.isprintable alone, spells with repr(rerun on39af51527)templates/assembly-root/scripts/validate-pins.py:pins._shown asks str.isprintable alone, spells with repr(rerun on39af51527)scripts/repo_shape.py:shown_path asks str.isprintable alone, spells with reprscripts/shape_materialize.py:readable_branch's check without the tablescripts/shape_materialize.py:readable_branch's unsafe-value back on !rscripts/shape_materialize.py:readable_branch's unseen-branch back on !rtemplates/assembly-root/scripts/validate-manifest.py:_branch_finding's check without the tabletemplates/assembly-root/scripts/validate-manifest.py:_branch_finding's finding back on !r(rerun on39af51527)templates/assembly-root/scripts/bootstrap.py:_argument_fault without the tablescripts/repo_shape.py:double_quoted's _escaped asks str.isprintable aloneadopt-project.py:_worded groups by str.isprintableadopt-project.py:adopt._line_shown asks str.isprintable, spells with reprscripts/shape_materialize.py:shape_materialize._line_shown asks str.isprintable, repradopt-project.py:unwritable_values back on !radopt-project.py:_refuse_an_unwritable_clone_url back on !radopt-project.py:_from_the_remote asks str.isprintableadopt-project.py:_first_words keeps what str.isprintable passesadopt-project.py:_first_said keeps what str.isprintable passesadopt-project.py:_refetch asks str.isprintable (N5)adopt-project.py:_seen is str.isprintable alonescripts/validate-repository-naming.py:naming's copy of the table drops U+3164(rerun on39af51527)templates/assembly-root/scripts/validate-manifest.py:manifest's copy of the table drops U+3164(rerun on39af51527)templates/assembly-root/scripts/validate-pins.py:pins' copy of the table drops U+3164(rerun on39af51527)templates/assembly-root/scripts/bootstrap.py:bootstrap's copy of the table drops U+3164scripts/validate-repository-naming.py:naming's _visible_repr keeps ascii's quotes(rerun on39af51527)templates/assembly-root/scripts/validate-manifest.py:manifest's _visible_repr keeps ascii's quotes(rerun on39af51527)templates/assembly-root/scripts/validate-pins.py:pins' _visible_repr keeps ascii's quotes(rerun on39af51527)adopt-project.py:_unacted keeps what str.isprintable passes (RV1225)Every mutant is killed. Each file was restored after its run and its sha256 matched. Dropping #1171's second rule from
_spelled_characterhas no mutant: it is the same output (the sweep).Gate
At
504d4ed13, the restacked merge withorigin/main838358bf9plus RV1225's commit, in the landing gate's environment (a stubghfirst onPATH,GH_TOKENbogus, an emptyGH_CONFIG_DIR,GIT_SSH_COMMAND=false,LANES_*unset, the filter-repo venv onPATH), in four shards, two at a time. 187 test files, of the head's 349: the new rows; everytests/test_*.pythat names a function, constant or refusal code this PR changes (_shown,shown_path,readable_branch,_branch_finding,_argument_fault,double_quoted,_spelled,_worded,_line_shown,unwritable_values,_first_said,_refetch,_unacted,unseen-branch,unsafe-value,plan-unwritable-value,manifest-tracking-branch, and the rest); every one that namesvalidate-repository-naming.py,validate-manifest.py,validate-pins.pyor the assembly root'sbootstrap.py, or runs them (the validators' and the template copies' tests); andtest_repo_hygiene.py,test_path_guard_hygiene.py,test_cli_reference.py,test_shape_doctor.pyandtest_scaffold_leg_path_collisions.py. A test that only runsadopt-project.pyor importsrepo_shapeis not in it: that is nearly every file.Shard 0's 5 errors, and the fix. At
504d4ed13shard 0 had 5 errors, all at setup oftests/test_yaml_reader_spaces.py'solder_validatorfixture, which makes an oldervalidate-manifest.pyby replacing_branch_finding's test,if not c.isprintable() or c.isspace()),, in its text: this PR split that line, so the count found 0 ("the validator no longer asks this"). The same file on a cleanorigin/main838358bf9worktree: 513 passed.674e4e3d6makes the fixture ask for the line as it now stands, and the file at674e4e3d6: 513 passed, the 5 among them.674e4e3d6changes only that file, so every other shard's result stands for it.Main moved after the restack, to
f7f34fb09(two commits,2af1d6644andf7f34fb09, touchingadopt-project.py,tests/test_adopt_check_throwaway_repos.py,tests/test_adopt_plan_paths_spelled.py).git merge-treeof this head with it is clean, and this branch is not merged with it, so the gated head is the one pushed. On a scratch merge of674e4e3d6withf7f34fb09, main's two changed test files and the new rows: 390 passed, 6 skipped (case-folding disks only), 0 failed.39af51527, for SonarCloud, changes only the three validators'_visible_repr. Gated again at39af51527, two shards: the 33 files of the gate that name a validator by file name or by test name (test_validate_*,test_pin_validator*,test_neutral_pin_validator,test_chain_*,test_link_source_*,test_pin_source_*,test_validator_*,test_doctor_validator_*,test_pinned_*and the like), the new rows,test_yaml_reader_spaces.py,test_repo_hygiene.py,test_path_guard_hygiene.pyandtest_cli_reference.py: 3286 passed, 0 failed. The sweep at39af51527gives every helper the digest it gave at504d4ed13, and 0 raw.SonarCloud
674e4e3d6: failed, one condition, 7.2% duplication on new code (at most 3%). SonarCloud counted one block of 23 lines twice: the copy of the table and its two helpers, with_shown's body, invalidate-repository-naming.py(:194) andvalidate-manifest.py(:485). The copies are there by design (the skew rule), so the copies were made shorter, not shared:39af51527drops each validator's_code_point_escapedforascii(found[0])[1:-1], which is the same escape. A local count of the longest identical run of tokens, strings normalized: 129 tokens between those two files at674e4e3d6(flagged), 95 withvalidate-pins.py(not flagged), 86 at39af51527. The other block SonarCloud lists for this PR,validate-pins.py:1435 besidevalidate-family.py:2010, is older code (86bf55304), not new.39af51527: passed. Duplication on new code 0.0%, reliability, security and maintainability ratings A, hotspots reviewed 100%, 0 open issues, 0 hotspots.Fix round (FX1165, for RV1165's S1 and N1 to N5)
RV1165 graded
39af51527NOT READY (issuecomment-6782728560): S1, a SHOULD, five NITs, and R1, a SHOULD for the restack after #1322. Head75ddbdaa9: three commits on39af51527, tests and one comment, no tool changed (git diff 39af51527 75ddbdaa9is 4 files). Please review the delta only.561810310).test_the_pinned_scripts_spell_a_path_as_the_library_doestakes three more paths:"caf\u00e9\u034f"(beside printable non-ASCII),"ma\u034f\x1bin"(beside an ESC) and"ma\u3164in\n"(before a line feed). 11 paths, was 8;tests/test_pinned_copy_text.pyis 90 rows, was 87.test_shown_path_and_shown_source_escape_itandtest_line_shown_escapes_ittake abesideparameter, nothing or an ESC ("\x1b"), so each site is handedma, the character,in, andma, the character, an ESC,in, and must name the second'ma\u034f\x1bin'. The first goes from 4 rows to 8 and the second from 8 to 16, sotests/test_default_ignorables_spelled.pyis 111 rows, was 99.\uand\xescapes: read back, the commit adds no byte above 0x7F and no raw control.39af51527, with 0 rows failed.scripts/repo_shape.pyshown_pathescapes the table only where the rest of the name is printable,reprbeside a controlescapecases oftest_shown_path_and_shown_source_escape_it, and the pinned pathsma\u034f\x1binandma\u3164in\nscripts/validate-repository-naming.py_visible_reprisascii(text)caf\xe9\u034fadopt-project.py_line_shownescapes the table only where the rest of the line is printableadopt-projectescapecases oftest_line_shown_escapes_ittemplates/assembly-root/scripts/validate-manifest.py_visible_reprisascii(text)caf\xe9\u034f5102ac4ef):templates/assembly-root/scripts/bootstrap.py:658 cites Pinned shape copies: AGENTS-shape.md'sCONTRACTS_DIRsentence is false for every scaffolded root, and the chain WARNING offers remedies the scaffold lacks (one shape bump before the v1.1.0 tag) #610, the skew rule's issue, where it cited repo_shape.py's YAML reader: Unicode spaces are stripped from text YAML keeps, the empty block key andk: {?: 1}still read, and three texts about the reader are one word out of date (what #635 left) #715, the branch rule's. A template file, so it was committed before it was gated.75ddbdaa9):test_a_character_is_spelled_as_the_plan_writes_itdrops its default-ignorables carve-out and its comment, so it asserts_spelled_character(char) == double_quoted(char)[1:-1]for every code point it sweeps.tests/test_adopt_spelled_unambiguous.py: 145 passed.str.isprintable()or userepr, so a combining mark, a variation selector or a Hangul filler in a name prints raw, andmaU+034Finreads asmain#1165 names".674e4e3d6forolder_validator,_not_a_nameis at :284, the Merge-trees list gives today's heads, and "Not in this PR" lists two more raw routes.mainhas noshape_materialize.unactedyet (see Not in this PR).Gate at
75ddbdaa9, in the landing gate's environment (a stubghfirst onPATH,GH_TOKENbogus, an emptyGH_CONFIG_DIR,LANES_*unset, the filter-repo venv onPATH), at most two pytest runs at a time:tests/test_default_ignorables_spelled.py,tests/test_pinned_copy_text.py,tests/test_adopt_spelled_unambiguous.py,tests/test_yaml_reader_spaces.pybootstrap.py's test files, 32 (everytest_bootstrap_*.py,test_manifest_validator.py,test_naming_gate_spelled.py,test_naming_policy*.py,test_pin_validator.py,test_neutral_pin_validator.py, everytest_validate_pins_*.py,test_validator_child_encoding.py,test_pinned_copy_text.py,test_pinned_copy_columns.py,test_reader_refusals_named.py,test_non_utf8_name_helpers.py,test_tracking_branch_ref.py,test_update_shape_pr_base.py)tests/test_repo_hygiene.pytests/test_shape_doctor.py,tests/test_scaffold_leg_path_collisions.py,tests/test_adopt_shown_default_ignorables.pyandtests/test_repo_hygiene.pyTwo of those runs, 22 of the 32 files and the last row, were made at the local head
250175cc6, which differs from75ddbdaa9only in where three entries stand in one list oftests/test_pinned_copy_text.py(moved up, so that #1310's one-line change beside it merges clean). That file is in the first row, run at75ddbdaa9, and no other file imports that list.Merge-trees
git merge-tree --write-treeof this head75ddbdaa9withorigin/mainand with each open PR at its head as fetched on 2026-11-11:origin/maindcf63b8b9: cleanfamily-root-missing, bothfamily-members-unreadablelines andsiblings-script-missing's message name the holder's path asshown_pathdoes, so U+202E, an ESC or a line feed in a --family-root no longer reaches the terminal #1327aa1c71e79: cleanskip_where_a_name_cannot_be_not_utf_8says it also skips the branch rows, its first two questions are one predicate, and rows hold the order it asks them in, on Windows too (#1224) #1326e73592062: clean.git/refsthis user cannot list is read as git reads it,plan okfromcheckand adopted byexecute, never refusedsource-unreadablenamingrefs(#1291) #132493424b9c6: cleanexecuterows that reach_require_filter_reposkip without git filter-repo, as each row'sreaches_filter_reposays, and a check with the tool hidden holds the guard to them (#1286) #13231cf7a37a2: cleanCommandFailed.loudlyspells the step, the command, the directory and the output of the REFUSED block, so the four tools that print it no longer put a bidirectional control or an ESC there raw, and_init_refused,source-unclonableand bothadopt-remote-unreadableroutes spell the argument list and git's or gh's words as_unacteddoes (#1213) #1322db0eb87c3: cleanMakefile/DIRECTORY is no Makefile of the source's own, so theCONTRACTS_DIRline, the Makefile's collision line and NEXT say GNU make stops at it, in the words a keptGNUmakefile/(#1207) andmakefile/(#1312) get, and none says the shape's Makefile waits to be merged with it (#1314) #13214f50eae21: cleanoriginis offered the adoption lineplantakes,--project Thingwith no--org, where it was--project WorkUpstream --org <your-org>, whichplanrefusedadopt-not-the-source; thenamingrow and the Triad advisory read that remote too (#1292) #13209d71536d1: conflict in adopt-project.pyHEADthat is a FIFO, a socket or a device, or a symlink to one, is refused by name before git is asked, where a FIFO left the gate with no answer at all (#1290) #131925c52b414: cleanencoding="utf-8", and a pin source namedcafplus U+00E9 skips where the file name encoding is ASCII, so 16 rows stop failing under an ASCII locale (#1285) #1315bd84004f3: cleancheck, given no--local-remote-dir, asks GitHub nothing about the two legs of a plan for another repository and prints no NOTE thatexecuteasks again, asexecuterefusesplan-not-the-sourcefirst and asks nothing; under--local-remote-dirit still asks the disk (#1232) #1313cf6585063: cleancheckandexecutework the follow-ups out from the plan as it stands andplanno longer stores them, so after a hand edit of an entry'sleg:neitherchecknor the split commit names aGNUmakefileor a collision the root no longer keeps, and a plan that still holds afollow_ups:list is refused by name (#1206) #13125235870f1: clean--- output ---block spells each argument and directory that holds a line feed where git names it,adopt-mount-unaddablespells git's output, and rows pin mutants R1, R3 and R10 (#1233) #1311c7749c1cf: cleancheck_pinname the path asshown_pathdoes (#1288) #1310daaa5ad8a: clean (textually; see below)0.and four hundred0s and a1, isyaml-unparsableby its line with the large end's remedy, where_scalarread it as0.0andcheckandexecutewent on with a number the file does not hold (#1260) #1309574a8a7a2: clean4682320a9: cleandouble_quotedandwith_linefromtest_adopt_template_valuesand puts nothing onsys.pathitself, and its docstring says_work_rootrefuses more, among them the file and the shared directory, no longer two things (#1234) #1307522e3584f: cleanchecklists an unanswered entry with the plan's problems against its source, before the split branch and the entries, so beside an uncovered path, an unsafe path, a bad leg path, the split branch taken or another entry finding its first finding isexecute's refusal,plan-unresolved(#1197) #130528f6f6694: cleanoriginpast GitHub's limits (an owner over 39 characters, a repository over 100) names noorg/repo, by the rule_github_namereads a typed name by, soplan --org testorgis no longer told to pass--org <40 c's>,checkholds the plan alike withoriginthere or gone, and the doctor's adoption line asks for--org(#1211) #130410c9bb081: cleancheckwith a subprocess one unsetsLANES_LANEin its own process, asrunblanks it for the child, so a lane in the shell no longer puts a--traileron one answer (#1299) #130364154fe85: cleana\udcffbrun what judges there and skip on their premise, as each failed on a tool that is right (#1301) #1302371264be0: cleantb\udcffxis said created, then on, where it saidcould not create branchandgit refused(#1283) #1300cb9ed8067: cleanplan-case-twinsnames, sochecknames folder twins once undercore.ignorecase=true, never again asplan-file-reencodedover git'swill not add file alias, and names the files beside them as it does without that setting (#1184) #1297a8a7eb7bf: cleanmember_unreadablehas one form and_refuse_an_unreadable_rootaskspath_unreadablefor its own code, and a row holds that a holder whose.gitand.gitmodulescannot both be read is refused once asgit-repo-unreadable(#1287) #1296f51349796: cleanproject.yamlorfamily.yamlcommitted as a symlink is read through it inside the commit, and a linkedsingle-repository.yamlgets a NOTE that says it is a symlink not followed, nevercould not be read (YamlError)(#1272) #1295129f4dce8: clean--, so a root file namedHEADno longer stopsexecutewith exit 128 before that leg is pushed, nor blanks whatapply --branchsays it committed (#1215) #1294cf07ba0d1: cleanshown_pathdoes, so no U+202E, ESC or line feed is raw (#1279) #128486ab76db4: cleanorigin, asclone.defaultRemoteNamenames it, is read from that remote, soplanreads its organisation, default branch and branches where it refusedadopt-no-org, took HEAD's branch as the default and asked--tracking-branchof the source's own branches, and one with several remotes and nooriginnames them and guesses none (#1276) #128047c547984: conflict in adopt-project.pygit submodule addmakes of each leg names its remoteorigin, whateverclone.defaultRemoteNamesays, so--local-remote-dirno longer endsREFUSED a git or gh command failed("No such remote 'origin'") after both legs are pushed (#1275) #1277d07b6fc51: cleanyaml-unparsableby its line, where it was aValueErrortraceback or "the number inf", and_read_assays a float in digits with no exponent, where it said "the number 1e+300" (#1212) #12493e5d1fde1: clean--work-dirrow skips and the two U+00E9 rows read the child's UTF-8, so none of the three fails on a tool that is right, and the bytes helper starts its child asrun_scriptdoes (#1196) #120901ee69763: cleance4dc664a: cleanrunner.temp, not/tmp, so it runs on Ubuntu 26.04 and thetestsjob goes back toubuntu-latest(#1096) #10979402c4d92: cleanThe two conflicts are both in
adopt-project.py. #1280 (lane 3's) conflicts in one region of_from_the_remote, where it writesremotefororiginand this PR writes_seen(branch)forbranch.isprintable(); it tookorigin/maindcf63b8b9, soorigin/mainalone merges clean with it now, and whoever restacks keeps_seen(branch). #1320 conflicts withorigin/mainon its own. #1322 is #1213's PR:db0eb87c3is the tip offix/1213-raw-command-output-spelled(fix/1213-raw-command-output-spelled-wip2476bfdd3cis an older head of it).#1310 (for #1288) merges clean and still collides. It adds the family root's
validate-family.py,bootstrap.pyandsiblings.pytotest_the_pinned_scripts_spell_a_path_as_the_library_does, each with its own_shown, and none asks the default-ignorable table. On a scratch merge of the two heads (never pushed),tests/test_pinned_copy_text.pyand the new rows give 3 failed, 200 passed: each of this PR's three new paths,caf\u00e9\u034f,ma\u034f\x1binandma\u3164in\n, is spelled by each of those three copies asreprspells it, the character raw, whereshown_pathescapes it. So whichever of #1310 and #1325 lands second gives those three copies the table (and its_visible_repr), as the three validators have here; this PR does not, since its base has no family-root copy of_shown.Not in this PR
adopt-mount-unaddableline itself (RV1225's site) is adopt-project.py: a refused command's--- output ---block spells each argument and directory that holds a line feed where git names it,adopt-mount-unaddablespells git's output, and rows pin mutants R1, R3 and R10 (#1233) #1311's (lane 2's, for adopt-project.py and tests/test_adopt_plan_and_remote_paths_spelled.py: follow-up of PR #1225 (#1195) from its review: a line feed in a path git echoes still splits a refused command's--- output ---block, three mutants (R1, R3, R10) that none of its 188 rows kills, a spelling that cannot be undone, andadopt-mount-unaddable, a raw route its body leaves out #1233): it spells git's output there with_output_unacted, which is_unacted, so once both are in, a default-ignorable character in that line is spelled. The mount path cannot hold one:leg_path_problemholds it toSAFE_ARG_RE, ASCII only.CommandFailed.loudlyspells the step, the command, the directory and the output of the REFUSED block, so the four tools that print it no longer put a bidirectional control or an ESC there raw, and_init_refused,source-unclonableand bothadopt-remote-unreadableroutes spell the argument list and git's or gh's words as_unacteddoes (#1213) #1322'sshape_materialize.unacted(for adopt-project.py, scaffold-project.py, update-shape.py, scripts/family.py and scripts/bump-leg.py:_init_refusednamesgit init's arguments raw, two refusals print git's or gh's output raw, andexc.loudlyprints a command, its directory and its output raw outside adopt-project.py (W1195's leftovers; follows #1152 and #1195) #1213, not on main yet; RV1213's N2 on scripts/shape_materialize.py and adopt-project.py:CommandFailed.loudlyspells the step, the command, the directory and the output of the REFUSED block, so the four tools that print it no longer put a bidirectional control or an ESC there raw, and_init_refused,source-unclonableand bothadopt-remote-unreadableroutes spell the argument list and git's or gh's words as_unacteddoes (#1213) #1322, issuecomment-6777421098). It spells exactly whatstr.isprintablerefuses, andCommandFailed.loudlyspells through it, so it does not spell U+034F and the other printable default-ignorables: measured by lane 4 on a merge with today's main,_init_refused's NOTE spells U+034F in the work directory through_spelled, and the command beside it prints it raw through_unactedandloudly. This PR givesadopt-project.py's_unactedthe table (504d4ed13), the same rule; scripts/shape_materialize.py and adopt-project.py:CommandFailed.loudlyspells the step, the command, the directory and the output of the REFUSED block, so the four tools that print it no longer put a bidirectional control or an ESC there raw, and_init_refused,source-unclonableand bothadopt-remote-unreadableroutes spell the argument list and git's or gh's words as_unacteddoes (#1213) #1322 calls_unactedat four more sites, which this covers once both are in, andloudlyreachesunacted, which this PR does not touch, since its base has nounacted. A follow-up candidate for Brett Heap, not filed: whichever of validate-repository-naming.py, validate-manifest.py, validate-pins.py, repo_shape.py, shape_materialize.py and adopt-project.py: the helpers that spell a name for a line or for the plan teststr.isprintable()or userepr, so a combining mark, a variation selector or a Hangul filler in a name prints raw, andmaU+034Finreads asmain#1165 and scripts/shape_materialize.py and adopt-project.py:CommandFailed.loudlyspells the step, the command, the directory and the output of the REFUSED block, so the four tools that print it no longer put a bidirectional control or an ESC there raw, and_init_refused,source-unclonableand bothadopt-remote-unreadableroutes spell the argument list and git's or gh's words as_unacteddoes (#1213) #1322 lands second must giveshape_materialize.unactedthe default-ignorable table too.git merge-treeof the two heads is clean.repo_shape.spelled(templates/assembly-root/scripts/bootstrap.py and templates/family-root/scripts/bootstrap.py:mainprints the manifest'snamewith a plainprintbefore any step runs, soname: "a\ud83db"(a lone surrogate) endsmake bootstrapin aUnicodeEncodeErrortraceback, exit 1 (make: 2), and the validator that names the problem is never reached; a valid name the stdout cannot encode ends the same way #391), whichbootstrap.pynames a branch with, prints every format character other than the bidirectional controls as it is, by design (a zero-width joiner in an emoji, the zero-width non-joiner a Persian name needs). So bootstrap's newUNSEENline names the branch through it, with the character raw, beside its code pointU+034F. validate-repository-naming.py, validate-manifest.py, validate-pins.py, repo_shape.py, shape_materialize.py and adopt-project.py: the helpers that spell a name for a line or for the plan teststr.isprintable()or userepr, so a combining mark, a variation selector or a Hangul filler in a name prints raw, andmaU+034Finreads asmain#1165 does not namespelled.str.isprintable()or userepr, so a combining mark, a variation selector or a Hangul filler in a name prints raw, andmaU+034Finreads asmain#1165's list that askstr.isprintablealone or spell withrepr, found while reading, untouched (line numbers at this head):validate-pins.py:943,shlex.quote(text) if text.isprintable() else _shown(text), a command to paste;shape_materialize.py:2279 (said.isprintable()) and :4389 and :4400 (remote.isprintable() and "`" not in remote);_not_a_nameinvalidate-repository-naming.py(:284) andvalidate-manifest.py(:313);shape_materialize.py:5937,the text {reading!r}, beside its_line_shown; and the family root'ssiblings.py:689,branch.isprintable(), a branch reader repo_shape.py's YAML reader: Unicode spaces are stripped from text YAML keeps, the empty block key andk: {?: 1}still read, and three texts about the reader are one word out of date (what #635 left) #715's docstrings name.75ddbdaa9; follow-up candidates for Brett Heap, not filed), each printingmaU+034Finraw (measured by RV1165):shape_materialize.manifest_misreads's{str(values[key])!r}(about :6007), in the same sentence where_line_shownnow spells the line; it is reachable only from a copy of the standard that writes the line bare.shape_materialize.leg_path_problem's{value!r}(about :5508 and :5512), which--spec-pathand--code-pathreach beforechecked_valuerefuses the value.CommandFailed.loudlyspells the step, the command, the directory and the output of the REFUSED block, so the four tools that print it no longer put a bidirectional control or an ESC there raw, and_init_refused,source-unclonableand bothadopt-remote-unreadableroutes spell the argument list and git's or gh's words as_unacteddoes (#1213) #1322 lands, validate-repository-naming.py, validate-manifest.py, validate-pins.py, bootstrap.py, repo_shape.py, shape_materialize.py and adopt-project.py: every helper #1165 names asks #1128's default-ignorable table, somaU+034Finis spelled by its code point wherever a line names it or the plan writes it, and a branch holding one is refused as one no person can see (#1165) #1325 is updated to giveshape_materialize.unactedthe table, with rows throughunactedandCommandFailed.loudly(its step, command, directory and output). Not done here:mainhas nounactedyet.🤖 Generated with Claude Code
Lane: openreposhape-4 (openRepoShape-4)
Summary by Sourcery
Ensure default-ignorable Unicode characters are detected and visibly escaped wherever repository names are validated, reported, or written to plans.
New Features:
Bug Fixes:
maU+034Finfrom being treated or displayed asmain.Enhancements:
Tests: