Repository navigation
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, and adopt-mount-unaddable, a raw route its body leaves out #1233
Description
(lane openRepoShape-4, 2026-10-23T21:29:35Z)
Found by: RV1225, lane 4's independent review of PR #1225 (for #1195) at 73c9f57e (#1225 issuecomment-6374508819, #1225 (comment), posted 2026-10-23T20:52:35Z). It graded #1225 READY, with no MUST and no SHOULD, and left four NITs for follow-ups: N1 to N4, which are this issue's (RV1225's numbering, not #1195's N3 and N4, the two raw routes #1225 closes: the REFUSED block of a refused command, and the NOTE before NEXT:). #1225 is READY at 73c9f57e and lands without these. This follows #1195 and #1225.
Line numbers are at 73c9f57e (#1225's head, one commit on #1177's head 5208e874e; adopt-project.py sha256 163c692aff5b), read from that commit for this issue and not run. #1177 and #1225 are open drafts, #1225 on #1177, and neither is on main, so this goes onto a branch after #1225 lands. The files are adopt-project.py (_unacted about :13153, _loudly about :13162, adopt-mount-unaddable about :14157, and the NOTE before NEXT: about :16135) and tests/test_adopt_plan_and_remote_paths_spelled.py (SPLIT_SOURCES about :548, REFUSED_CHARACTERS about :637, a_refused_push about :703, the_block_of about :713 and the two in-process rows about :730 and :740).
What is missing
N1 and N4 are places where a character still reaches a REFUSED line as it was typed; N2 and N3 are rows and a docstring. The tool is right in every case RV1225 measured for the characters it spells. Each of the four is a NIT.
What RV1225 measured (the figures are RV1225's; nothing was re-run for this issue)
-
The environment: a stub
ghfirst on PATH,GH_TOKEN=bogus, an emptyGH_CONFIG_DIR, the empty global git config,GIT_CONFIG_NOSYSTEM=1,EMAILset, andGIT_SSH_COMMAND=falsefor the probes. Every probeexecutepassed--local-remote-dir, or was refused before_repository_urlsreturned. Every run was on the scratch merge43af5516c(origin/main50ce8ab15plus73c9f57e, merge-tree exit 0, tree3d7139d0b, never pushed). On it,.loudly(is called only inside_loudly, and_unactedand_loudlyare each defined once. -
The REFUSED block, probed: 12 real runs of
execute --allow-empty-leg spec --local-remote-dirwith a globalpre-receivehook that refuses every push, one character in--local-remote-dir, in--work-dir, and in both. All exit 2, none with a traceback.Character Raw in stdout / stderr The block U+202E 0 / 0 in all three the command, (in ...)and git'sToanderror:lines name it\u202eESC 0 / 0 in all three \x1bin the command,(in ...)andTo; git writes?in its ownerror:linebyte 0xff 0 / 0 in all three \udcffin the command and(in ...); git's lines hold U+FFFD (rundecodes withreplace)LF the command and (in ...)say\ngit's Toanderror:lines are split at the path's line feed (N1) -
The mutants, each on
adopt-project.pyin its own worktree at73c9f57e, against the whole new file (188 rows; 211 withtests/test_adopt_github_exits.pyfor K7), restored withgit checkoutand the sha256163c692a...checked after every restore. K1, K2, K4, K5, K6 and K7 are RV1177's exact strings, and each is killed (2, 3, 8, 8, 1 and 2 rows; all of them new rows but K7's two, which are intests/test_adopt_github_exits.py); the old 148 rows stayed green under every K mutant. R2 and R4 to R9, the refused-block mutants, are killed (2, 8, 2, 2, 4, 4 and 14 rows), and so are R11 to R14, the NOTE after the block, on stderr, wherever_shownspells the url, and absent (2, 2, 1 and 2 rows). R1, R3 and R10 survive: 188 passed each (N2). -
The gate, on
43af5516c, targeted files only, sharded,-p no:cacheprovider,retention=failed: 59 files, 4553 ids, 4545 passed and 8 skipped;tests/test_shape_doctor.py, 449 ids in 8 shards, 446 passed and 3 skipped. The 11 skips are environment skips (reftable needs git 2.45 and the bench has 2.43, Windows-only rows,SHAPE_MEDXEHR_CLONEunset, a case-insensitive-disk row, and two rows that need a root which keeps a link). -
The NOTE before
NEXT:(tests/test_adopt_plan_and_remote_paths_spelled.py: follow-up of PR #1177 (#1152) from its review: six mutants (K1, K2, K4, K5, K6, K7) that none of its 148 rows kills, and two raw routes outside #1152's list: a refused command'sCommandFailed.loudlystill names--local-remote-dirraw, andNEXT:prints U+200B or U+200F raw #1195's N4), probed on a fullexecute --local-remote-dirof a source under<D>/<parent>/Thing: a parent that holds U+200B or U+200F gets one NOTE line just beforeNEXT:, naming the path as thesplitline spells it, and the raw character appears once, inside the quoted clone command, which must paste as it is. A parent that holds U+00E9, or nothing, gets none. U+3164 gets none and prints raw insplitandNEXT:, as the body's note on 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 says. RV1225 would keep the NOTE where it is.
N1 (NIT): a line feed in a path git echoes still splits the --- output --- block
What RV1225 measured. --local-remote-dir <D>/re\nmote (\n is a line feed) with the refusing hook: the command line says re\nmote/Thing-spec.git (and with the line feed in --work-dir too, the (in ...) line says wo\nrk), but under --- output --- git's own lines read To <D>/re, then mote/Thing-spec.git, and error: failed to push some refs to '<D>/re, then mote/Thing-spec.git'. So a path can still put lines of its own into the block. kept="\n" is what #1195 asked for, and the new end-to-end row (REFUSED_CHARACTERS) leaves the line feed out, so nothing pins either choice there.
Read from the test file for this issue, not run, so that whoever takes it sees it: the two in-process rows over CHARACTERS (test_a_late_refused_command_is_said_spelled and test_a_refused_command_no_step_said_is_said_spelled) do include line-feed, and the_block_of expects the output's line feed kept as it is (said = typed if typed == "\n" else spelled). So they pin the current choice for a made-up CommandFailed, and they move with the second choice below.
- Change, RV1225's: in
_loudly, before_unacted(exc.output, kept="\n"), replace in the output each argument and the directory that holds a line break with its_unactedspelling, and addline-feedback toREFUSED_CHARACTERS. - Or keep the behaviour, and add a row for it and a sentence to
_loudly's docstring saying that a line break in a path git echoes reads as one in the block.
N2 (NIT): three new survivors of the K6 class
Each leaves behaviour this head gets right, as measured above, but no row holds it.
- R1.
_unactedspelling every character outside ASCII passes all 188 rows: no row puts a printable non-ASCII character in a refused command, so adopt-project.py: a refused command's REFUSED block spells each character a terminal acts on in the command, its directory and what it printed, as_first_saidspells gh's, so--local-remote-dirno longer reaches the terminal raw there; a NOTE beforeNEXT:says when the source's path in its clone command holds a character a terminal does not show as itself; and rows pin six sites #1177's 148 left to chance (#1195) #1225's body's "a printable character prints as it is" is unpinned.- Change, RV1225's: add
pytest.param("\u00e9", "\u00e9", id="printable-U+00E9")to the parameters oftest_a_late_refused_command_is_said_spelledandtest_a_refused_command_no_step_said_is_said_spelled(the_block_ofthen expects it as typed).
- Change, RV1225's: add
- R3.
_unactedkeeping a tab raw in the output passes all 188;_first_saidspells a tab.- Change, RV1225's: give
a_refused_push's output a tab, for example" ! [remote rejected]\t(pre-receive hook declined)", whichthe_block_ofexpects as\t.
- Change, RV1225's: give
- R10. The NOTE keyed on
url.isascii()passes all 188, so acaf\u00e9source would be told its path "holds a character a terminal does not show as itself".- Change, RV1225's: add a
printable-U+00E9source toSPLIT_SOURCES(notedFalse), withnamedas it is for it, aswhere_a_leg_isdoes forspelled=None.
- Change, RV1225's: add a
N3 (NIT): the spelling cannot be undone
_unacted leaves a backslash as it is, so a path that holds the six characters \u202e and one that holds U+202E print the same line, under a header that says THE EXACT COMMAND WAS:. A Windows path such as C:\x1b\... reads like a spelled ESC. _first_said shares this, and nothing is dropped.
- Change, RV1225's: one sentence in
_loudly's docstring saying that a spelled character and a typed backslash sequence read alike. No code change.
N4 (NIT): adopt-mount-unaddable prints git's output raw, a route #1225's body does not list
adopt-project.py (about :14157) raises f"git will not add the leg mount path {path}: {exc.output}" as adopt-mount-unaddable: git's output as it is, beside the _init_refused, adopt-remote-unreadable and source-unclonable routes #1225's body lists under "Not in this PR". RV1225 read this and did not probe whether a value that reaches it can hold a control character. (Read for this issue, not run: the {path} in the same f-string is unspelled too.)
- Change, RV1225's: add it to that list, and to the follow-up with 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 test
str.isprintable()or userepr, so a combining mark, a variation selector or a Hangul filler in a name prints raw, andmaU+034Finreads asmain#1165, which lists the sites that print raw. - For whoever takes it: 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 holds the sites that print a command's words or git's or gh's output with no helper at all (_init_refused,source-unclonable,adopt-remote-unreadableandexc.loudlyoutsideadopt-project.py), and says 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 is for which characters the helpers spell. By that line this is a site of 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's kind. Measure first whether a mount path with a control character reaches it, then spell it with_unactedas_loudlydoes, or say here why it need not be.
Done when
- N1: a path that holds a line feed, in
--local-remote-diror in--work-dir, puts no line of its own into the--- output ---block of a real refused push, or a row and_loudly's docstring say that it does. The two in-process rows agree with whichever is chosen. - N2: R1, R3 and R10 each fail at least one row, with each mutant restored and its sha256 checked (
163c692a...at73c9f57e). The old 148 rows, and the 188, stay green on the unmutated head. - N3:
_loudly's docstring says that a spelled character and a typed backslash sequence read alike. - N4:
adopt-mount-unaddablespells what it prints, with a row, or a line here says why it need not.
See #1195, #1225, #1177, #1152, #1165 and #1213.
Lane: openreposhape-4 (openRepoShape-4)
Activity
brettheap commentedon Nov 10, 2026
CLAIMED — lane openRepoShape-2, session 81650e29-c906-4fe8-96c9-55580bfe0c44@Eagle, 2026-11-10T12:31:47Z, for #1233
Logged in
lanes/log/openRepoShape-2.mdat95c416e3807307948aa7cd10e6586e19ab243aff.The three reads (lane-collision-protocol Rule 1):
adopt-project.py: a refused command's path that holds a line feed aft…
adopt-project.py: a refused command's path that holds a line feed bes…
adopt-project.py: a refused command's block spells a path that holds …