Repository navigation
scripts/shape_materialize.py and adopt-project.py: CommandFailed.loudly spells 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-unclonable and both adopt-remote-unreadable routes spell the argument list and git's or gh's words as _unacted does (#1213) - #1322
brettheap wants to merge 12 commits into
Conversation
… `--local-remote-dir` path in `execute`'s `bare`, leg and `split` lines, are named with `_shown`, as #1154 names `--out` and `--work-dir`, so a bidi control, an escape, a line feed or a byte that is not UTF-8 in either no longer reaches the terminal as it was typed (#1152) ## What #1154 (#1115) names `--out` and `--work-dir` in `plan`'s and `check`'s report with `_shown`. W1115 found two groups of paths it leaves raw (#1152): the `--plan` path, and the `--local-remote-dir` path. A bidi control (U+202E), an ESC or a line break in either reached the terminal as it was typed, where the other plan lines name a path with `_shown`. This change spells each of the 21 sites with `_shown(str(...))`, so a path with a character that is not printable is named as `_spelled` names it, between backticks, and every other path prints byte for byte as it did. The `--plan` path, 16 sites in `check` and `execute`: - the five `N finding(s) in <plan>` lines: `_refuse_a_mistyped_plan`, `_refuse_what_check_finds`, the `plan-split-branch-taken` refusal, and `cmd_check`'s two branches; - the `<plan>: ...` refusals: `plan-wrong-kind` (the code's name for it; the issue calls it `plan-bad-kind`), `plan-unsupported-mode`, `plan-unreadable`, `plan-no-source`, the three `plan-bad-id` ones, `plan-not-the-source`, `adopt-topic-too-long`, and the `legs.assembly` and `org:` ones. The `--local-remote-dir` path, 5 sites in `execute`: - the `<bare> already exists` refusal; - the ` bare <bare>` line; - the two leg lines, `_extract_leg` and `_seed_leg`, which end `-> <url>`; - the `split <commit> on <branch> -> <url>` line, which names the source's directory under `--local-remote-dir`. The `NEXT:` clone command is not touched: it already quotes the url with `shlex.quote`, and a row pins that it still does. A path that is not UTF-8 now prints as `\udcff` between backticks, where it printed raw before. No refusal code is new, and none changes its name or its exit code. The changed lines that ran past 79 columns are rewrapped; the message text is unchanged. `repo_shape.load_yaml`'s own refusals still print a path raw, as `yaml-unreadable`. They live in another file and are a separate follow-up (see #1168). ## Test `tests/test_adopt_plan_and_remote_paths_spelled.py` is new, ASCII only and POSIX only, with every non-ASCII character written as an escape. It has 148 rows: - 135 plan rows: 14 refusal families (27 family and command pairs) by 5 path forms (U+202E, ESC, a line feed, the byte `\xff`, and a plain control); - 5 `--local-remote-dir` rows for the `bare` and leg lines (the code leg is extracted, the spec leg seeded); - 3 `split` rows. `execute` refuses a source path that holds U+202E, ESC, a line feed or `\xff` as `adopt-unwritable-value` before any leg exists, so these rows use U+200B in the parent and a name that ends in a space, and a plain control; - 5 in-process rows for `{bare} already exists`, which call `_create_leg_remote`. On main's `adopt-project.py`, 118 of the 148 fail, each for the raw path, and the 30 that pass are exactly the plain controls. On this commit all 148 pass. 23 mutants (each new spelling put back to raw, one at a time, and `_shown` swapped for `_spelled` at two sites) are each killed by the rows that name them. Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…cter a terminal acts on in the command, its directory and what it printed, as `_first_said` spells gh's, so `--local-remote-dir` no longer reaches the terminal raw there; a NOTE before `NEXT:` 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) Follow-up of #1177 (for #1152), from RV1177's review: its N3, N4 and the surviving mutants K1, K2, K4, K5, K6 and K7. Stacked on #1177's branch, and lands after it. - N3: `_loudly` builds `CommandFailed.loudly`'s block from the command's arguments, its directory and its output, each `_unacted`: a character `str.isprintable` refuses is spelled as `_spelled_character` spells it, with no backticks, and the output keeps its line breaks. The leg push, `_failed_loudly` and `main` say a refused command through it. - N4: a source path that `_refuse_an_unwritable_clone_url` lets through (#255) but `str.isprintable` refuses, as U+200B and U+200F, gets a NOTE just before `NEXT:` naming it `_spelled`. The clone command stays as `sh` reads it. Refusing such a source would undo #255's ruling that a `Cf` character other than the nine bidi controls is text a file holds. The NOTE is printed before the block, so it touches none of the lines that #1121 and #1207 add after it. - Rows: a `--plan` ending in a space, a relative one between backticks, a relative one and `./plan.yaml` (K1, K2); a PLACEMENT plan's `plan-wrong-kind` and `adopt-org-too-long` with the plan's path spelled (K4, K5); a printable `--local-remote-dir` outside ASCII (K6); the GitHub-mode `split` line matched in full (K7); and N3's and N4's rows. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…leftovers Step (a) of the restack after #1177's squash: the head F of the branch #1225 was stacked on, merged as it stands, with no conflict. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…overs Step (b) of the restack after #1177's squash: its two files, adopt-project.py and tests/test_adopt_plan_and_remote_paths_spelled.py, are the same in the squash as in the final head merged in step (a), so a conflict in them is resolved by keeping this branch's bytes and the step changes none of them. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Step (c) of the restack after #1177's squash: main as it stands, past the squash, merged with no conflict. The branch now differs from main in adopt-project.py, tests/test_adopt_github_exits.py and tests/test_adopt_plan_and_remote_paths_spelled.py only. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…dly` spells 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-unclonable` and both `adopt-remote-unreadable` routes spell the argument list and git's or gh's words as `_unacted` does (#1213) `loudly` printed what a refused command was, where it ran and what it printed as they were, and sixteen calls in `scaffold-project.py`, `update-shape.py`, `scripts/family.py` and `scripts/bump-leg.py` print what it makes. It now writes each character `str.isprintable` refuses as the plan's `path:` does (`shape_materialize.unacted`), keeping the output's line breaks, as #1195's `adopt-project.py` `_loudly` does. The spelling is in `loudly` once and no tool spells at its call; the choice and its measure are written at `loudly`. A command of printable text prints the block it always printed. In `adopt-project.py`, `_init_refused` spells the `git init` it names, `Source.clone` spells the up to 400 characters of gh's words it quotes in `source-unclonable` (cut first), `_refuse_a_tracking_branch_the_remote_lacks` spells git's one line and an `OSError`'s text in `adopt-remote-unreadable`, and so does `_in_the_way_on_github` for an `OSError`. `_loudly` is not touched: #1233 edits it. tests/test_command_output_spelled.py holds a row per site: 110 rows, 83 of them failing before this change. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
#1225 landed as one squash commit on main, whose tree is the tree of the head the branch was just merged with, so its files already hold #1225's final content. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Reviewer's GuideImplementationAdd
Spell command arguments and error text in the adoption probe, clone, and remote-read refusal paths.
TestsAdd POSIX regression coverage for safe command diagnostics across helper behavior, callers, adoption refusals, and real tool runs.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
RV1213: independent review of #1322 at Independent review for lane openRepoShape-4 of #1322 (for #1213) at 1. The design and
|
| Probe | base dc9a0bcc7 |
head 476bfdd3c |
|---|---|---|
loudly_unit |
5/5/0 | 0/0/0 |
scaffold_main |
4/4/0 | 0/0/0 |
update_main |
4/4/0 | 0/0/0 |
update_rolled_back |
5/5/0 | 0/0/0 |
family_main |
4/4/0 | 0/0/0 |
family_put_back |
5/5/0 | 0/0/0 |
bump_main |
4/4/0 | 0/0/0 |
bump_put_back |
4/4/0 | 0/0/0 |
adopt_init_refused |
1/1/1 | 0/0/0 |
adopt_ls_remote_stub |
2/2/0 | 0/0/0 |
adopt_ls_remote_real_git |
0/1/0 | 0/0/0 |
adopt_ls_remote_oserror |
1/1/0 | 0/0/0 |
adopt_gh_oserror |
1/1/1 | 0/0/0 |
adopt_gh_failed |
0/0/0 | 0/0/0 |
adopt_cut |
0/1/0 | 0/0/0 |
scaffold_push |
2/2/0 | 0/0/0 |
family_init_push |
2/2/0 | 0/0/0 |
scaffold_push_lf |
1/1/0 | 0/0/0 |
family_init_push_lf |
1/1/0 | 0/0/0 |
scaffold_push_byte |
1/1/0 | 0/0/0 |
family_init_push_byte |
1/1/0 | 0/0/0 |
adopt_check_init_bogus_hash |
1/1/0 | 0/0/0 |
adopt_check_init_bogus_hash_lf |
0/0/0 | 0/0/0 |
adopt_plan_unclonable |
1/1/0 | 0/0/0 |
- Every site that is raw at the base is clean at the head.
adopt_gh_failedis clean on both sides, because_first_saidalready spelled it.- Line feeds. In
adopt_check_init_bogus_hash_lf, the base splits the NOTE at the line feed and the head writes\n. The*_lfand*_byteruns print(in .../wo\nrk/...)and(in .../wo\udcffrk/...)at the head. - git's own spelling. Git writes ESC as
?itself but not U+202E (adopt_ls_remote_real_git:wh?erebeside a raw U+202E at the base), as the body says.
4. My mutants, beyond the PR's table
Each mutant ran in rv1213-mut-wt at the head, against the whole 110-row file. Afterwards the file was copied back, its blob checked equal to HEAD's and its sha256 recorded. git status was clean at the end.
| Id | Mutant | File | Rows failed |
|---|---|---|---|
| R1 | unacted spells only ESC |
scripts/shape_materialize.py |
33 of 110 |
| R2 | unacted spells only the Cc controls, leaving Cf (bidi) and Cs raw |
scripts/shape_materialize.py |
23 of 110 |
| R3 | unacted drops a refused character instead of spelling it |
scripts/shape_materialize.py |
53 of 110 |
| R4 | unacted keeps double_quoted's quotes |
scripts/shape_materialize.py |
53 of 110 |
| R5 | loudly keeps a line feed in the command |
scripts/shape_materialize.py |
1 of 110 |
| R6 | loudly keeps a line feed in the directory |
scripts/shape_materialize.py |
1 of 110 |
| R7 | loudly keeps a line feed in the step |
scripts/shape_materialize.py |
1 of 110 |
| R8 | unacted passes a lone surrogate raw |
scripts/shape_materialize.py |
3 of 110 |
| R9 | unacted spells only the first refused character |
scripts/shape_materialize.py |
28 of 110 |
| R10 | source-unclonable keeps a carriage return raw |
adopt-project.py |
0 of 110, survives (equivalent) |
| R11 | source-unclonable cuts at 40, not 400 |
adopt-project.py |
2 of 110 |
| R12 | _init_refused keeps a line feed in the command raw |
adopt-project.py |
3 of 110 |
| R13 | ls-remote's words spelled whole (line feeds as escapes), not joined |
adopt-project.py |
3 of 110 |
| R14 | adopt's _loudly reverted to a bare exc.loudly(step) |
adopt-project.py |
0 of 110, survives (equivalent) |
| R15 | family.py remove --dry-run's call prints the old raw block |
scripts/family.py |
2 of 110 |
- Two survive, R10 and R14, and both are equivalent. R10:
runnever hands a CR toSource.clone. R14:loudlyspells what_loudlyspelled. - R1, R2 and R9 are the "spells only some" mutants (only ESC, only Cc, only the first one). Each fails 23 to 33 rows, 17 to 24 of them per-site rows beside the unit rows.
5. The restack
- Changed lines are equal.
git diff cc230f2f1 1b8438d43andgit diff dc9a0bcc7 476bfdd3ceach have 1004 changed lines, both with sha256d113fc9d66390624c88c6ef4b4098c1d5fa2ba85f6e13df60a9a701de868d03a. - Files.
git diff dc9a0bcc7 476bfdd3c --name-onlynames onlyadopt-project.py,scripts/shape_materialize.pyandtests/test_command_output_spelled.py. - The commit.
1b8438d43's parent iscc230f2f1.
6. Today's main and the other PRs
- The merge with main.
git merge-tree --write-tree origin/main 476bfdd3c(main838358bf9) is clean: tree745fe669.- It differs from main only in the three files.
- Its changed lines from main hash to the same
d113fc9d..., 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 change toadopt-project.pymerges around it.
- Tests on the merge. On a scratch merge commit
b36590c1bI ran the rows file and the 11tests/test_adopt_*files that grep_shown,_unactedor_first_said: 12 files in two runs. 919 + 380 = 1299 passed, 0 failed, 0 skipped.- The 11 files are
entry_paths,literal_names,plan_and_remote_paths_spelled,plan_escapes,plan_paths_spelled,plan_source_branch_shown,plan_yaml_quoting,question_and_submodule_spelling,shown_default_ignorables,spelled_namesandtemplate_values.
- The 11 files are
- Scans on the same merge (cheap, beyond the 12):
test_no_auto_maintenance.py,test_non_utf8_name_callers.py,test_pinned_copy_text.pyandtest_path_guard_hygiene.py. 302 passed, 2 skipped, 0 failed. The skips are the environment's,GIT_CONFIG_GLOBALbeing set. The first three of these are not in the PR's 176-file list. - 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) #1311c7749c1cf(lane 2, edits_loudly). The merge-tree is clean against the head and against the scratch merge.- On a scratch merge
b3ed02b85(main, 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 and 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), the rows file and 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'stests/test_adopt_plan_and_remote_paths_spelled.pygive 321 passed, 0 failed. - 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 still ends inCommandFailed(...).loudly(step), so its_output_unactedoutput is spelled again, harmlessly.
- On a scratch merge
- 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. No open PR: I searched the open PRs' closing references, branch names and bodies. - adopt-project.py: a source whose only remote is not named
origin, 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) #12805cb1abdbcand shape-doctor.py: a repository whose only remote is not namedoriginis 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) #13209d71536d1each conflict inadopt-project.py: with the head, with main alone, and with the scratch merge.- The conflict hunks, labels dropped, are identical between main-vs-PR and merge-vs-PR: 73 lines, sha256
ea6f6f8c59166345...for all four. - So the conflict is not this change's.
- The conflict hunks, labels dropped, are identical between main-vs-PR and merge-vs-PR: 73 lines, sha256
7. Tests at the head
The rules' environment: env -u of the lane variables and GIT_SSH_COMMAND, EMAIL set, an empty GIT_CONFIG_GLOBAL, GIT_CONFIG_NOSYSTEM=1, test identities, a stub gh, GH_TOKEN=bogus, an empty GH_CONFIG_DIR, and git filter-repo on PATH.
| Run | Files | Result |
|---|---|---|
| Rows | tests/test_command_output_spelled.py |
110 passed |
| scaffold, bump-leg, hygiene | test_scaffold_reuse_seeded_legs.py, test_bump_leg_reachability_words.py, test_repo_hygiene.py |
288 passed |
| update-shape, family | test_update_shape_messages.py, test_family_dry_run.py |
88 passed |
The base dc9a0bcc7, rows file copied in |
tests/test_command_output_spelled.py |
83 failed, 27 passed |
- The 27 that pass at the base are the 24
[plain-control]ids and the three the body names. - Of the 83 failures, 17 fail because
unacteddoes not exist there (AttributeError), and 66 fail on their assertions.
8. SonarCloud
- The check.
SonarCloud Code Analysispassed on476bfdd3cat 19:15:39Z. - The bot comment.
sonarqubecloud[bot]posted at 19:15:41Z: Quality Gate passed, 0 new issues, 0 accepted, 0 security hotspots, 0.0% duplication on new code. - The API.
qualitygates/project_statusfor this PR isOKon all five conditions.issues/searchwithresolved=falsereturns 0, andhotspots/searchreturns 0. - The other checks.
packageandtests-git-bashpassed.testswas in progress at 19:41Z.
9. The body, fact by fact
- Restack: cc230f2, then two merges, sha256
d113fc9d.... Confirmed (section 5). - Sixteen calls, 2/4/8/2;
_loudlyuntouched: confirmed. - 110 rows, 35 test functions, ASCII source, POSIX only, two real child runs: confirmed. A non-ASCII grep of the file is empty, and
pytestmarkskips onnt. - 83 failed and 27 passed at the base, 110 passed at the head, and the 27 named: confirmed exactly.
- "14 test files assert the block's markers": confirmed, counting
THE EXACT COMMAND,--- output ---,end outputand.loudly(. With the first two markers alone it is 12. - The "where" choice is written at
loudly, and there are no pinned copies: confirmed (section 1). - Measured table (22 sites raw at the base, none at the head; git writes ESC as
?but not U+202E; the line feed splits the NOTE at the base): reproduced with my own probes (section 3). The counts differ only because my probes differ. - Gate, 176 files, 11259 passed, 38 skipped, 0 failed: confirmed from the writer's junit files and logs. The four shards hold 11297 tests, 0 failures and 0 errors, and each log's first line is
HEAD 476bfdd3c.... - Merge-trees: the base named,
f39c6707a, is out of date (N3). adopt-project.py: a source whose only remote is not namedorigin, 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) #1280 and shape-doctor.py: a repository whose only remote is not namedoriginis 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) #1320 are confirmed as not this change's (section 6). - "Not in this PR": each draft exists in the lane's scratch (
w1213c/issue-*.md) and says what the body says it does.- I read
scaffold-project.py_unread_becauseandscripts/family.py_reason, and both print the command and git's line raw, as stated. - The
loudlyoutput line-feed split shows in myloudly_unitprobe: an echoed argument holding a line feed splits--- output ---. - See N2 and N4 for the 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 andNEXT-line items.
- I read
Findings
-
N1 (NIT) A tab in git's words now prints as
\t. This changes the block of ordinary failures, not only of hostile ones. Measured with a realgit checkout -q otherover a local change:- the base printed
<TAB>fundererror: Your local changes to the following files would be overwritten by checkout:; - the head prints
\tf.
This is the rule 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's
CommandFailed.loudlystill names--local-remote-dirraw, andNEXT:prints U+200B or U+200F raw #1195 settled and the issue asks for, and a tab cannot hide or reorder text. Fix: either keep the tab in the output (kept="\n\t", and changetest_loudly_spells_a_tab_and_a_return_in_the_output_and_keeps_its_lines, the row behind the PR's L7), or add one sentence toloudly's docstring saying that a tab in git's words, such as the file list of a refused checkout, prints as\ton purpose. The docstring now says only that a printable command prints the block it always printed. - the base printed
-
N2 (NIT) 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 cannot nameshape_materialize.unacted, which is new here. 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 was claimed by lane 4 at 18:28Z. With 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 on main, the same NOTE now spells a default-ignorable character in one place and not the other. Measured on the scratch merge, with a work directorywo<U+034F>rk:_spelledwrites the directory as`/w/wo\u034frk`;_init_refused's command, andloudly's, print the U+034F raw, which reads aswork.
Fix: a comment 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 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, or a word to its writer, namingshape_materialize.unactedbeside_unactedand_first_said, so that 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's change covers it. -
N3 (NIT) The body's merge-tree base is out of date. "
origin/mainf39c6707a: clean" predates 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. Against838358bf9it is still clean, and the tests above pass on that merge. Fix: say838358bf9when the body is next edited. Lane 4's pre-gate tests the predicted squash anyway. -
N4 (NIT) The
NEXT-line follow-up points at the broader draft. The sentence names the part neither family.py, bootstrap.py, validate-family.py:family-root-missing,family-members-unreadable,siblings-script-missingprint the holder's path as typed andmember-unknownpastes it raw, so a bidi control, an ESC or a line feed in it reaches the terminal (follow-up to #1288) #1317 nor update-shape.py:_by_hand's lines, the NEXT lines ofcheckandapply,update-root-missing,update-upstream-not-a-repoandupdate-branch-not-utf8print--rootas typed, so a bidi control, an ESC or a line feed in it reaches the terminal raw (follow-up to #1288) #1318 covers (scripts/bump-leg.py'sNEXT, the branch and refspec in each push line,scripts/family.py_print_next). It points atissue-update-shape-next-line-raw.md, which also covers what family.py, bootstrap.py, validate-family.py:family-root-missing,family-members-unreadable,siblings-script-missingprint the holder's path as typed andmember-unknownpastes it raw, so a bidi control, an ESC or a line feed in it reaches the terminal (follow-up to #1288) #1317 and update-shape.py:_by_hand's lines, the NEXT lines ofcheckandapply,update-root-missing,update-upstream-not-a-repoandupdate-branch-not-utf8print--rootas typed, so a bidi control, an ESC or a line feed in it reaches the terminal raw (follow-up to #1288) #1318 hold. W1213D's narrowed draft for exactly that gap isw1213d/issue-next-push-line-branch-raw.md. Fix: name the narrowed draft, so that the candidate put to Brett Heap does not repeat family.py, bootstrap.py, validate-family.py:family-root-missing,family-members-unreadable,siblings-script-missingprint the holder's path as typed andmember-unknownpastes it raw, so a bidi control, an ESC or a line feed in it reaches the terminal (follow-up to #1288) #1317 and update-shape.py:_by_hand's lines, the NEXT lines ofcheckandapply,update-root-missing,update-upstream-not-a-repoandupdate-branch-not-utf8print--rootas typed, so a bidi control, an ESC or a line feed in it reaches the terminal raw (follow-up to #1288) #1318.
Scratch: _lane4-scratch/tools/run/rv1213/ (probes in probe/, mutants in mutants.py, mutants-final.tsv and logs/mut/).
Lane: openreposhape-4 (openRepoShape-4)
…refuse every push also sets git's `sideband.allowControlCharacters`, so the two `[escape]` rows that push to a hook saying an ESC judge the tool's own spelling on a git that masks control characters on the sideband, where 2.56 handed the tool `^[` and the row looked for `\x1b` (#1213) CI's `tests` on 476bfdd (run 42883271189, job 130064864499, git 2.56.0) failed exactly two rows, `test_scaffold_names_a_refused_push_spelled[escape]` and `test_family_init_names_a_refused_push_spelled[escape]`: 2 failed, 22359 passed. git 2.56 masks control characters that arrive on the sideband (its `sideband.allowControlCharacters` defaults to `color`, which lets only ANSI colour sequences through), so the hook's ESC reached the tool as `^[` and the row's `remote: ... \x1bx` was not there. The bench's git is 2.43.0, which does not mask, so the rows passed there. The tool was right either way: no raw ESC reached the terminal. The rows' premise, that git hands the hook's words over unmasked, is what fails on a new git. `a_config_whose_hook_refuses_every_push` now writes `[sideband]` and `allowControlCharacters = true`, so git hands the hook's words over as the hook wrote them on every git; an older git ignores the key. A `^[` is not accepted as a pass, because that would stop the rows judging the tool on a new git. No other row of the file reaches a `remote:` line or the sideband: the others build their `CommandFailed` by hand or run a local command whose words never travel the sideband. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
FX1322: #1322's two [escape] rows hold on git 2.56's sideband masking. New head The delta is one commit, What failed and whyCI's
git 2.56 masks control characters that arrive on the sideband. Its The tool is right either way: no raw ESC reached the terminal. What failed is the rows' premise, that git hands the hook's words over unmasked. The change
so git hands the hook's words to the tool as the hook wrote them, on every git, and the rows keep judging the tool's own spelling. An older git ignores the key. The docstring says so and names Bytes read back with Other routes: none. The two rows above are the only callers of the helper, and no other row of the file reaches a Bench (git 2.43.0, the landing gate's environment, real
|
|
|
RVD1322: delta review of FX1322's fix at Delta review for lane openRepoShape-4 of #1322 (for #1213). I did not write the fix. The question is only whether FX1322's one commit I also built git v2.56.0 from the upstream tag (a git that masks the sideband, the runner's version) in my own scratch folder, so the premise and the rows are measured on a masking git here, not only on the bench's 2.43.0. 1. Ancestry: PASS
2. The diff: PASS
3. The premise: PASS
4. The rows still judge the tool: PASS
Under the mutant, on both gits, the six push rows fail: the 5. Other routes: PASS
6. Tests at
|



Closes #1213
Built on #1225's head
cc230f2f, then restacked onto #1225's squashdc9a0bcc7with 2 merges, carrying exactly the change (changed lines byte-equal, sha256d113fc9d66390624c88c6ef4b4098c1d5fa2ba85f6e13df60a9a701de868d03a).What
#1213 asks that three groups of sites print what a refused command says the way #1152 and #1195 print a plan's
path:: every character a terminal acts on (U+202E and the other bidirectional controls, ESC, a carriage return, a lone surrogate) written as its escape, instead of reaching the terminal raw.scripts/shape_materialize.py: a newunacted(text, kept=""), andCommandFailed.loudlyspells the step, the command, the directory and the output (line breaks of the output kept). Sixteen calls print its block: 2 inscaffold-project.py, 4 inupdate-shape.py, 8 inscripts/family.pyand 2 inscripts/bump-leg.py.adopt-project.py:_init_refusedspells thegit initit names;source-unclonable(Source.clone) cuts gh's words to 400 characters first and then spells them; both routes toadopt-remote-unreadable(_refuse_a_tracking_branch_the_remote_lacksfor git's one line and anOSError's text,_in_the_way_on_githubfor anOSError) spell what they quote._loudlyis not touched: 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 (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) edits it.tests/test_command_output_spelled.py: 110 rows, ASCII source, POSIX only.A printable command prints the block it always printed.
Measured (base
dc9a0bcc7= main with #1225, against this head476bfdd3c)Each site run with U+202E, ESC, a line feed and a lone surrogate (byte 0xff) in an argument, a directory or the output, in the rules' environment (a stub
gh,GH_TOKEN=bogus, an emptyGH_CONFIG_DIR,GIT_SSH_COMMAND=false). Raw ESC count / raw U+202E count / raw 0xff count on stdout and stderr together:scaffold_mainscaffold_pushupdate_commit_undone_noneupdate_commit_undoneupdate_landingupdate_mainfamily_init_pushfamily_add_dry_clonefamily_add_clonefamily_add_rollbackfamily_bump_resolvefamily_put_backfamily_remove_listfamily_mainbump_put_backbump_mainadopt_init_refusedadopt_init_refused_lfadopt_unclonableadopt_ls_remote_git_saysadopt_ls_remote_stubadopt_ls_remote_oserroradopt_gh_oserror22 sites print a raw character at the base and none does at the head. At the base git writes ESC as
?itself in its own lines, but not U+202E.adopt_init_refused_lf(a line feed in--work-dir) has no ESC or U+202E on either side: it measures the line feed, which splits the NOTE in two at the base (a raw line feed ingit init -q <dir>) and is written\nat the head. The probes are in the lane's scratch (measured-base.md,measured-head.md).The "where" choice (the issue leaves it to the builder)
Spell once, inside
CommandFailed.loudly; no tool spells at its call. The cost the issue names is thatloudlymoves every tool's REFUSED block, so a row that asserts raw text there would move. Measured, there is none:THE EXACT COMMAND WAS,--- output ---). None asserts a raw bidirectional control or ESC in a block:tests/test_adopt_late_failure.pyandtests/test_adopt_plan_and_remote_paths_spelled.pyassert the spelled form,tests/test_scaffold_reuse_seeded_legs.pyasserts the raw character is absent, and the rest name printable text. Rows that build the expected block withfailed.loudly(...)itself stay equal.family.pycalls put a member's path in the step, so their rows cannot pass otherwise. A printable step is unchanged.The choice and the measure are written at
CommandFailed.loudly. Pinned copies: none.shape_materialize.pyis not copied intotemplates/, a holder or an assembly root; no digest of any changed or called tool file exists intemplates/orcontracts/; no test compares copies; README, AGENTS and the handbook have no sentence about the block's spelling.Rows
tests/test_command_output_spelled.py: 110 rows (35 test functions):unactedandloudlythemselves, a row per call of the 16, group 1 (a realcheckand the refs probe), group 2 (a stubgh, the 400-character cut, bothOSErrorbranches), and two real child runs (scaffold,family init). Each row asserts the block as it is spelled and that no raw U+202E, ESC or 0xff reaches stdout or stderr.dc9a0bcc7): 83 failed, 27 passed. At the head: 110 passed. The same counts held at 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 headcc230f2f1.[plain-control]),test_loudly_prints_a_plain_block_as_it_always_did,test_init_refused_leaves_a_refusal_as_it_wasandtest_source_unclonable_names_a_byte_that_is_not_utf_8_as_run_reads_it(the 0xff control).Mutants
Each put into a worktree at this head, run against the whole 110-row file, the file restored and its sha256 checked equal after every one. Every mutant fails at least one row.
loudlyprints the directory rawscripts/shape_materialize.pyloudlyprints the command rawscripts/shape_materialize.pyloudlyprints the output rawscripts/shape_materialize.pyloudlyprints the step rawscripts/shape_materialize.pyloudlyspells the output's line feeds tooscripts/shape_materialize.pyunactedspells every non-ASCII characterscripts/shape_materialize.pyloudlykeeps a tab in the outputscripts/shape_materialize.pyloudlykeeps a carriage return in the outputscripts/shape_materialize.pyunactedwraps a spelling in backticksscripts/shape_materialize.py_init_refusedprints the command rawadopt-project.pysource-unclonableprints gh's words rawadopt-project.pysource-unclonablespells gh's words, then cuts themadopt-project.pysource-unclonabledrops gh's line breaksadopt-project.pyadopt-remote-unreadableprintsls-remote's words rawadopt-project.pyadopt-remote-unreadableprints anls-remoteOSErrorrawadopt-project.pyadopt-remote-unreadableprints aghOSErrorrawadopt-project.pyadopt-remote-unreadablekeepsls-remote's line breaksadopt-project.py_init_refusedwraps its spelled command in backticksadopt-project.py.loudlycalls put back as the old raw block, one at a time (scaffold-project.py2,update-shape.py4,scripts/family.py8,scripts/bump-leg.py2)scaffold-project.py's refused push) 4Gate
Run on this head
476bfdd3c(the merge with maindc9a0bcc7, #1225's squash), four shards of 44 files, in the rules' environment (env -uof the lane variables,EMAILset,git filter-repoon PATH, a stubgh), at most 2 pytest runs in parallel. The list isgateset.sh's against this diff (176 files: the new rows, every test file that greps a function, refusal code or file changed, the four tools' files,test_adopt_plan_and_remote_paths_spelled.py,test_repo_hygiene.py,test_path_guard_hygiene.py,test_cli_reference.py,test_shape_doctor.py,test_scaffold_leg_path_collisions.py), united with W1213's earlier list.Each shard's junit file agrees (0 failures, 0 errors; 11297 tests in all), the four shard lists are exactly the 176 files of the list, and every shard ran on
476bfdd3c. The skips are the environment's: the reftable rows (this git is older than 2.45), the case-insensitive-disk rows, the Windows-only rows (junctions, PowerShell, the default stdout encoding) and themakejobserver row.Main has moved since (see Merge-trees), and the gate ran on this head, not on its merge with the newer main; lane 4's landing pre-gate tests the predicted squash over it.
Merge-trees
git merge-tree --write-treeof this head against:origin/mainf39c6707a: clean. Main has moved since the restack onto 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 squashdc9a0bcc7(adopt-project.py:_github_namereads no owner over 39 characters or repository over 100, soplan --source <50 b's>/Thingnever asksghfor a name GitHub cannot hold, no remedy offers--org <50 b's>, andcheckandexecutenever clone such a record again (#1129) #1194's squash20e692acdand fix: keep ignored compatibility links within their declared Git leg #1316'sf39c6707a, which changeadopt-project.py,shape-doctor.pyand four test files). This head does not merge them, because lane 4's landing pre-gate tests the predicted squash over the newer main.adopt-project.py,scripts/shape_materialize.pyortests/test_command_output_spelled.py(32 open PRs listed at 19:13Z on 2026-11-10, heads as read then; the same set as at 18:27Z but for adopt-project.py and scripts/shape_materialize.py: a keptMakefile/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) #1321, new since): 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) #1171c5c02e6dd, adopt-project.py: the mount removes a path a case twin is at or under withgit rm -fand writes the twins the root keeps back from the index, so on a disk that ignores caseexecutekeeps a set the plan splits across repositories or drops (#1183) #1237fa6d189ff, 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, isyaml-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, adopt-project.py: a stale split branch in a source refs directory this user cannot list is refusedsource-unreadableby name, neverplan okfromcheckor two legs made byexecute(#1257) #126539b21c07e, adopt-project.py and update-shape.py: a revision git is asked about ends its argv in--, so a root file namedHEADno longer stopsexecutewith exit 128 before that leg is pushed, nor blanks whatapply --branchsays it committed (#1215) #1294cf07ba0d1, adopt-project.py: the #654 rehearsal asks nothing about the case twinsplan-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) #12972e020b458, repo_shape.py and adopt-project.py: a local source'soriginpast 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) #1304ec240265c, adopt-project.py:checklists 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, 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) #1311c7749c1cf, adopt-project.py:checkandexecutework 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, adopt-project.py:check, 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, adopt-project.py and scripts/shape_materialize.py: a keptMakefile/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) #13217392e85aa: clean.origin, 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) #12805cb1abdbc: conflicts inadopt-project.py(3 hunks), and the conflict is not this change's:git merge-tree --write-tree origin/main <#1280's head>conflicts in the same file too, and the three conflict hunks of the two merges (this head's and main's) are byte-equal (marker labels dropped, sha256af6aa9516ef807093d128e91399d59fa81aae63e48f9dbb0ed0d2f0110e91bf3, 73 lines). adopt-project.py: a source whose only remote is not namedorigin, 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) #1280 has to be brought up to main whether or not this lands.originis 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: conflicts inadopt-project.py(3 hunks), and the conflict is not this change's:git merge-tree --write-tree origin/main <#1320's head>conflicts in the same file too, and the three conflict hunks of the two merges (this head's and main's) are byte-equal (marker labels dropped, sha256af6aa9516ef807093d128e91399d59fa81aae63e48f9dbb0ed0d2f0110e91bf3, 73 lines). shape-doctor.py: a repository whose only remote is not namedoriginis 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) #1320 has to be brought up to main whether or not this lands.Not in this PR
Each defect below is outside #1213's three groups. The drafts named are in the lane's scratch; none is filed, because a follow-up candidate is filed only on Brett Heap's word.
--- output ---block in the four tools, becauseloudlykeeps the output's line breaks. 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 (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) handles it foradopt-project.pyonly, and no open issue covers the other four tools: a follow-up candidate for Brett Heap, not filed (draftissue-loudly-output-line-feed.md).scaffold-project.py_unread_becauseprints the command and git'sfatal:line raw; no open issue names it: a follow-up candidate for Brett Heap, not filed (draftissue-scaffold-unread-because-raw.md).scripts/family.py_reasonprints the command and git'sfatal:orerror:line raw; no open issue names it: a follow-up candidate for Brett Heap, not filed (draftissue-family-reason-raw.md).NEXTlines (update-shape.pylanding_failedandmain,scripts/bump-leg.py,scripts/family.pythroughrepo_shape.shell_quoted) quote a path or branch for the shell and leave U+202E and ESC in it raw. The root inupdate-shape.py's lines is update-shape.py:_by_hand's lines, the NEXT lines ofcheckandapply,update-root-missing,update-upstream-not-a-repoandupdate-branch-not-utf8print--rootas typed, so a bidi control, an ESC or a line feed in it reaches the terminal raw (follow-up to #1288) #1318's, and the holder inscripts/family.py's pasted lines is family.py, bootstrap.py, validate-family.py:family-root-missing,family-members-unreadable,siblings-script-missingprint the holder's path as typed andmember-unknownpastes it raw, so a bidi control, an ESC or a line feed in it reaches the terminal (follow-up to #1288) #1317's. What neither covers (scripts/bump-leg.py'sNEXT, the branch and the refspec in each push line,scripts/family.py_print_next) is a follow-up candidate for Brett Heap, not filed (draftissue-update-shape-next-line-raw.md).unacted, like_unactedand_first_said, testsstr.isprintable()only: 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 (open) covers it.adopt-project.py's_unactedand_loudlynow repeatshape_materialize.unactedandloudly; left alone because 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 edits that region. A follow-up candidate for Brett Heap, not filed (draftissue-unacted-duplicates-adopt-unacted.md).🤖 Generated with Claude Code
Lane: openreposhape-4 (openRepoShape-4)
Summary by Sourcery
Ensure refused-command diagnostics render terminal-sensitive characters safely across materialization and project-adoption workflows.
Bug Fixes:
Enhancements:
Tests: