Repository navigation
update-shape.py: check's root header, update-root-missing, update-branch-not-utf8's REFUSED text, a typed --upstream's update-upstream-not-a-repo and pin_source's three refusals name the path as shown_path does (Part of #1318) - #1329
brettheap wants to merge 2 commits into
Conversation
…e-branch-not-utf8`'s REFUSED text, a typed `--upstream`'s `update-upstream-not-a-repo` and `pin_source`'s three refusals name the path as `shown_path` does (#1318) These five places printed a typed `--root` (or `--upstream`) as it was typed, so a bidi override, an ESC or a line feed in a folder's name reached the terminal raw, or began a line of the name's choosing. Each now names the path as `shown_path` does, as #1288 and #1310 did for the pin: as it is, or as `repr` spells it where a character in it does not print. `pin_source`'s `named` is spelled once, so `update-upstream-not-a-repo`, `update-upstream-unresolvable` and `unsafe-value` (which `checked_value` raises with `named` as its `what`) all follow. A printable path prints byte for byte as before; no code and no other word changes. tests/test_update_shape_root_lines_shown.py runs the real tool over a root (or an `--upstream`) named with U+202E, an ESC and a line feed, and a printable name: 28 rows, 21 of which fail on #1310's head. Every line a person pastes (`_by_hand`'s calls, `apply_command`, `next_line`, `landing_failed`'s NEXT, `_restore_by_hand`'s redirect) still names the root as typed: that is #1318's Scope question, left to Brett Heap. Part of #1318 Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Reviewer's GuideImplementationRender the root, typed upstream, and pin paths with
TestsExercise the affected diagnostics with unsafe and printable root, upstream, and pin paths, including a relative typed upstream.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Independent review of #1329 (Part of #1318) for lane openRepoShape-5, by rv1329 (opus), at cccde4e: READY Summary. There is no MUST and no SHOULD. I found three NITs and have six follow-up candidates.
FindingsMUST: none. SHOULD: none. NIT 1: the
NIT 2: the
NIT 3: the commit subject ends
Note. The body on GitHub is n1318's 1. Each site, measured with real runsProbe setup:
Results, 70 base/head pairs, 0 mismatches:
2. What is leftThese lines still print a typed root or path raw and are not pasted lines. Unless marked otherwise, each was measured at the base and the head over U+202E, ESC, LF and a printable name, and the output was the same at both. Each is listed as a candidate.
3. The rows
4. MutantsEach was applied alone in
5. GatesEnvironment: Python 3.12.3, run through The results were identical on both gits:
6. Merge-treesHeads were read fresh, and
No other open PR touches 7. The record
FilesLogs, probes and
Both trees, Nothing was posted to GitHub, and no issue was filed or drafted. Lane: openreposhape-5 (openRepoShape-5) |
…is pinned as typed and not as resolved, and `update-branch-not-utf8`'s detail is pinned as one line with `refusal_detail` (Part of #1318) rv1329's review of cccde4e found two mutants of update-shape.py that no row killed. Rows now kill both; update-shape.py is unchanged. NIT 1: the typed `--upstream` row passed an absolute, resolved path, which `shown_path(spec)` and `shown_path(path)` spell alike, so naming the resolved path in `open_upstream` passed every row. Four new rows type a relative `--upstream ./<name>` from the folder that holds it, over U+202E, an ESC, a line feed and a printable name, and hold the whole line, naming the flag's value as typed and as `shown_path` spells it. NIT 2: the `update-branch-not-utf8` row read only the first line of stderr, so a second detail line holding the raw root, above the remedy, passed. The row now holds `refusal_detail(stderr, "update-branch-not-utf8")` equal to the one `REFUSED` line. The remedy under it is a pasted line and stays raw by design, so nothing is asserted about it. The file has 32 rows; 24 fail on #1310's head. Those two mutants and the ten the file already killed are each killed. Part of #1318 Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
|
Delta check of #1329 (Part of #1318) for lane openRepoShape-5, by rv1329b (sonnet), cccde4e..28a71d9: READY No MUST and no SHOULD. I found one new NIT and no new follow-up candidates. Everything below was measured at FindingsMUST: none. SHOULD: none. NIT 1 (new): the
1. The diff
2. The rowsAll mutants ran one at a time in my one tree, against the new file only. After each,
3. The commit
4. GatesPython 3.12.3,
5. The bodyI read the live body (updated 01:21:39Z) against
6. Merge-treesHeads were fetched and read back with
The only open PRs touching Not run, and leftovers
Lane: openreposhape-5 (openRepoShape-5) |



Goal
Part of #1318. Five places in
update-shape.pynamed a typed--root(or--upstream) as it was typed, so a bidi override (U+202E), an ESC or a line feed in a folder's name reached the terminal raw, or began a line of the name's choosing. Each now names the path asshown_pathdoes, as #1288 and #1310 did for the pin: as it is, or asreprspells it where a character in it does not print. A printable path prints byte for byte as before. No refusal code changes and no word but the path.DRAFT. Stacked on #1310 (base
fix/1288-refusals-shown-more, headdaaa5ad8a). It restacks onto main after #1284 and #1310 land.shown_pathis already imported byupdate-shape.pyat that base (#1284), so the import is untouched.The sites (measured before and after)
Real runs of
update-shape.pyover a project cut byscaffold-project.py --local-remote-dirfrom a clone of the base, a copy of it in a folder named with U+202E, an ESC, a line feed, and a printable name (wd+ e-acute +and a space), with a stubghfirst on PATH,GH_TOKEN=bogus, an emptyGH_CONFIG_DIR,GIT_SSH_COMMAND=false,GIT_CONFIG_GLOBAL=/dev/nulland a local--upstream. 28 runs before (atdaaa5ad8a) and 28 after: the 21 runs over a name that does not print each put U+202E or the ESC on a stream raw, or began a lineWARNING forged-line: pwned/...; the 7 printable runs print the folder as typed, and print byte for byte the same text after (stdout and stderr compared whole, with the temp path and the commit ids normalised).daaa5ad8acheck'sroot <root>header, stdout:2480(report)check --root R --upstream U --at Bupdate-root-missing,<root> is not a directory:2544(prepare)check --root <a folder that is not there>update-branch-not-utf8,<root> is on the branch b'caf\xe9' ...(the REFUSED text):2828(current_branch)apply --branch, HEAD on a branch named with the bytescafand 0xE9_by_handremedy under it is pasted (below)update-upstream-not-a-repofor a typed--upstream,--upstream <path> exists but is not a git repository:704(open_upstream)check --root R --upstream <a folder that holds no repository>update-upstream-not-a-repo,<pin>: source_repository: is <value>, which exists but is not a git repository:816(pin_source'snamed)check --root R, the pin'ssource_repository:an existing folder that is no repositoryupdate-upstream-unresolvable, the same line,which is not an owner/repo name:816source_repository:isno-such-shapeunsafe-valuefor the pin'ssource_repository:(repo_shape.checked_value's, handednamedas itswhat):816source_repository:is-a/bAfter the change the root reads, for U+202E,
'<D>/wd-pl\u202ean'(quotes and escapes asreprspells it), and a printable root as it was, with no quotes.pin_source'snamedis one f-string, so spelling its{pin_path}once covers all three codes.What changed
update-shape.py, five edits and two comments,+16 -7:report's header,prepare'supdate-root-missing,current_branch'supdate-branch-not-utf8text,open_upstream's--upstream {spec}, andpin_source'snamed. Each takesshown_path(...)where it took the bare value. The newtests/test_update_shape_root_lines_shown.pyholds them. Nothing else in the tree changes. The README,AGENTS.md,docs/cli.mdand the handbook quote none of these lines (grep for each line's words and codes), so no doc changes;tests/test_cli_reference.pyandtests/test_agents_md_codes.pypass.Rows
tests/test_update_shape_root_lines_shown.py, 28 ids: four tests overNAMES(U+202E, ESC, line break, printable) for the header,update-root-missing,update-branch-not-utf8and the typed--upstream, and one over the pin's three codes timesNAMES. Each runs the real tool and asserts the exit code, the wholeREFUSEDline (or the header line) with the path asnamed_asgives it (reprwhere the name does not print, byte for byte where it does), no U+202E, ESC or forged line on the lines it owns, and no traceback. Each skips by name where its folder cannot be made (unsafe_folder). The file is ASCII; the names come fromconftest(the e-acute as an escape) andchr(0x202E).daaa5ad8a'supdate-shape.py(the sha256eca58c8960e8..., in a detached tree with the new file copied in): 21 failed, 7 passed. The 21 are every row over a name that does not print; the 7 printable controls pass.Mutants
Each applied alone to this head's
update-shape.pyin a detached tree, run against the new file, and restored with its sha256 checked (f74fe96b3a56...):update-root-missingrevertedupdate-branch-not-utf8text reverted--upstreamrevertednamedreverted (all three pin codes)checked_value'swhatrevertedunsafe-valuealone)whatkept spelledrepralways, at all five sitesNo survivor.
Runs
Python 3.12.3, git 2.43.0 and git 2.47.1 (the lane's own build from kernel.org's tarball),
git-filter-repo2.47.0 (CI's pin, on PATH), throughtools/run10.sh,-rsalone, at most 100 ids a run, one pytest at a time, run namesn1318-.... Every group passed on both gits:test_update_shape_root_lines_shown, test_update_shape_unreadabletest_update_shape_apply_lines_and_headers, test_update_shape_pin_sourcetest_update_shape_merged_away, test_value_pattern_line_break, test_family_member_name, test_update_shape_paste_linestest_windows_paths, test_update_shape_partial_rollback, test_update_shape_add_ignoredtest_update_shapetest_update_shape_messages, test_update_shape_next_quoting, test_cli_referencetest_refusal_paths_shown_moretest_pinned_copy_texttest_no_auto_maintenancetest_agents_md_codestest_path_guard_hygiene (alone, flock)test_repo_hygiene (alone, flock)test_yaml_reader_spaces (alone, flock)Skips, named:
tests/test_no_auto_maintenance.py:222, 2 rows on each git: "the session began with GIT_CONFIG_GLOBAL set, and its file includes that one" (run10.shexportsGIT_CONFIG_GLOBAL=/dev/null, so they skip in every lane run). No other skip.One run of the new file on git 2.43.0 under the lane's
run10-lane.sh(the same runner withLANES_LANEexported): 28 passed.Merges
Heads read fresh,
git merge-tree --write-treeof this head with:daaa5ad8a(the base) clean; maina6f1374b0clean (main moved fromdcf63b8b9while this ran; the one commit between them touchesrepo_shape.pyandadopt-project.py, neither of which this PR touches); #1294's headcf07ba0d1(the open PR that touchesupdate-shape.py) clean; #1284's head86ab76db4clean. No other open PR touchesupdate-shape.pyor the new file.Round 1
rv1329's independent review of
cccde4ec1is READY (issuecomment-6783933685): no MUST, no SHOULD and three NITs. The sections above describecccde4ec1and stand. This round changes rows only:update-shape.pyis byte for byte as atcccde4ec1(sha256f74fe96b3a56...). The new commit is28a71d981(tests/test_update_shape_root_lines_shown.pyalone,+36 -12), pushed to this branch as a fast-forward.--upstreamrow passed an absolute, resolved path, whichshown_path(spec)andshown_path(path)spell alike, so naming the resolved path inopen_upstreampassed all 28 rows. A new test,test_a_relative_upstream_is_named_as_it_was_typed_and_spelled, adds four ids (U+202E, ESC, line break, printable). Each runscheck --upstream ./<name>from the folder that holds<name>and holds the wholeREFUSED update-upstream-not-a-repoline: the flag's value as typed,./and all, spelled asshown_pathspells it ('./wd-\x1b[31mRED'for the ESC). The absolute row stays as a control.update-branch-not-utf8's row read only the first line of stderr, so a second detail line holding the raw root, above the remedy, passed. The row now holdsrefusal_detail(result.stderr, "update-branch-not-utf8") == [<the REFUSED line>](tests/conftest.py), so the detail is one line. The remedy under it is a pasted line and stays raw by design, so nothing is asserted about it. The row keeps its four ids.cccde4ec1's subject ends(#1318), which in this repository reads as a reference to the whole issue. This PR is one part of it:closingIssuesReferencesis empty, and the squash message will sayPart of #1318. The new commit's subject ends(Part of #1318).Rows: 32 ids, the 28 above and the four new ones. At
daaa5ad8a'supdate-shape.py(sha256eca58c8960e8..., in a detached tree with this file copied in): 24 failed and 8 passed. The 24 are every row over a name that does not print, and the 8 printable controls pass. At this head: 32 passed.Mutants, each applied alone to this head's
update-shape.pyin a detached tree, run against the new file, and restored with its sha256 checked (f74fe96b3a56...):shown_path(path)forshown_path(spec)inopen_upstreamupdate-branch-not-utf8's remedyshown_path(candidate), the normalisedPath, which drops the./update-root-missing,update-branch-not-utf8text--upstreamrevertednamed,checked_value'swhatonly, the two refusals onlyrepralways, LF and ESC only, no bidi controlsX1 and X2 are killed, and n1318's ten are still killed. The new relative rows add three failures to the typed
--upstreammutant (its three unsafe names) and one to each rival. No survivor.Gates at
28a71d981, Python 3.12.3, throughtools/run10.sh,-rsalone, one pytest at a time, run namesn1318b-...:test_update_shape_root_lines_shown, test_update_shape_unreadabletest_path_guard_hygiene (alone, flock)test_repo_hygiene (alone, flock)One run of the new file on git 2.43.0 under the lane's
run10-lane.sh: 32 passed. There was no skip in any of these runs. No file but the new test file changed, so the other groups of the Runs table above stand. The merge-trees were not run again for this commit.Known limits
_by_hand's call sites (soupdate-branch-not-utf8's own remedy,git -C <root> branch -m <a new name>, under the spelled REFUSED text),_restore_by_hand's redirect,apply_command(check's NEXT line),next_line's two lines andlanding_failed's NEXT. That 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 Scope question, a decision for Brett Heap, not a given: family.py, scaffold-project.py and bump-leg.py:init's plan rows and seven refusals name a holder, a folder, a lock, a remote path or a root as it is, so an ESC, a line break or U+202E in a path reaches the terminal as #692's refusals no longer let it #766 left such lines raw on purpose and bump-leg.py, family.py, update-shape.py and the roots' validate-manifest.py, bootstrap.py, siblings.py and validate-family.py: fourteen missing, unreadable and wrong-kind refusals and four ofcheck_pinname the path asshown_pathdoes (#1288) #1310'spin_rows_remediationis the only one spelled. The rows read the header and the report above the NEXT line, and the REFUSED line ofupdate-branch-not-utf8, because the pasted line under each still holds the root as typed.CommandFailed.loudly's(in <root>)is 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 (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).Not in this PR
Candidates, for Brett Heap's word (nothing is filed, and no issue is drafted):
--upstreamthat is a PATH is named raw byUpstream.label, whichupdate-shape.pyprints incheck'sshape <label>header (:2481atdaaa5ad8a) and inupdate-revision-unresolvable's<label> cannot resolve ...text (:564). Read, not probed: the three other{self.label}refusals ofUpstream,:571,:605and:620. Measured at this head over an--upstreamclone in a folder named as above: 6 of 6 runs over a name that does not print put U+202E or the ESC raw on a stream or begin a forged line; the 2 printable runs are as typed.labelis also the--upstreamthatapply_commandpastes, so it shares the Scope question above for that use. rv1329 confirmed this item as its C4, atcccde4ec1:check'sshapeheader (:2488) andupdate-revision-unresolvable(:564) are each raw, 3 of 3, and:571,:605and:620were read only._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 lists it):update-unreadablenames a path in full.update-shape.py:448atcccde4ec1(unreadable_refusal, through_named_from). Measured by rv1329: a root at mode 600 prints the root raw, 3 of 3, and a typed--upstreamat mode 000 prints<upstream>/.gitraw, 3 of 3, where a line feed forges a line.update-add-not-upstream(update-shape.py:1769) prints a typed--addpath raw, 3 of 3. Read, not probed: the--addpath inupdate-add-already-pinned(:1760),update-add-not-a-directory(:1781),update-add-would-overwrite(:1796) andlink_refusal.Rollback._restore'sso make {shut} writable(update-shape.py:3530) names a full path under the root as prose, on a rollback line next to a pasted command, so the Scope question above may cover it.shape-doctor.py:13002, the doctor's ownrootheader, prints the root raw, and so does itsstandardline (:13004). Measured by rv1329: the ESC reaches stdout raw, and a line feed forges a line.shown_pathletting U+034F and U+3164 through raw is 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, and lane 4's open 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 changesshown_pathfor it with a table of default-ignorable characters (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 issuecomment-6783879460).Part of #1318
Lane: openreposhape-5 (openRepoShape-5)
🤖 Generated with Claude Code
Summary by Sourcery
Display update-shape.py root, upstream, and pin paths safely in reports and refusals without changing their codes or surrounding text.
Bug Fixes:
Enhancements:
Tests: