Repository navigation
templates/family-root/scripts/bootstrap.py and validate-family.py: the three family-members-unreadable refusals name family.yaml through each file's own _shown, so U+202E, an ESC or a line feed in a --root no longer reaches the terminal - #1328
brettheap wants to merge 1 commit into
Conversation
…e three `family-members-unreadable` refusals name `family.yaml` through each file's own `_shown`, so U+202E, an ESC or a line feed in a --root no longer reaches the terminal #1310 gave the holder's `bootstrap.py` and `validate-family.py` a `_shown` (`repo_shape.shown_path`'s rule, written in each file by the skew rule) and spelled the refusals around these. The three `family-members-unreadable` lines beside them still printed the path as typed: a bidi override in the holder's folder name reordered the line, an ESC reached stderr as the control it is, and a line feed began a line of the path's choosing. Measured at #1310's head daaa5ad over 20 real runs (all exit 2) of the holder's own `bootstrap.py --root <holder> --no-fetch`, its `siblings.py --dry-run` (which imports `members_of`) and its `validate-family.py --root <holder>`: every one of the 15 runs over a name that does not print put that character on stderr raw, and the 5 over a printable name printed it as typed. Each of the three texts now names `manifest_path` through the file's own `_shown`: as it is where it prints, as `repr` spells it where a character in it does not. A printable holder is named byte for byte as before. No refusal code, no other word and no code changes; `bootstrap.py`'s first line is rewrapped so that it stays in 79 columns, with the same words. New tests/test_family_root_scripts_paths_shown.py: one run per refusal and way in over a folder named with U+202E, an ESC, a line feed and a printable name, a holder typed relative to the working folder, and each copy beside the `repo_shape.py` from before #1168. Not in this part: the lines a person pastes (`siblings-script-missing`'s remedy, `member-unknown`'s lines and the like), which #1317 leaves as a decision. Part of #1317 Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Reviewer's GuideImplementationUse each script’s existing
TestsExercise the three refusals through the holder scripts and
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
|
Independent review of #1328 (Part of #1317) for lane openRepoShape-5, by rv1328 (opus), at 1020728: READY I found nothing at MUST or SHOULD level. There are two NITs, both about the PR body's text, and two observations that need no action. Every claim the body makes that I measured came out as the body states it. FindingsMUST: none. SHOULD: none. NIT 1: the Known limits bullet "Not surveyed" can now give the survey's result.
NIT 2: Known limits cites C1 to C4 "at #1327's head d5a4fe6", but #1327's head is now aa1c71e.
Observation 1 (no action): the rows try only U+202E, an ESC and a line feed.
Observation 2 (no action): the skew holds even beside a library older than
1. The three sites, by real runsMethod.
Results with the tree's own library (96 runs at daaa5ad, 96 at the head;
Beside the older libraries (48 runs each, base and head):
AST proof, re-measured with my own script (
2. The skew rule
3. What is left in the two filesRefusal texts were found with an AST survey of every
4. The rows
5. MutantsEach was applied alone in rv1328-mut, the 52 rows run on 2.43.0, and both files restored by sha256 every time. Full output: n1317c's 14, all killed, every count identical to the body's table (failed / passed):
Each site's revert fails only its own rows. My two:
6. GatesAll runs went through At the head 1020728, git 2.43.0 and git 2.47.1 give identical results:
On a local merge with main a6f1374: merge commit 546c6d553 in rv1328-mut, never pushed. Its tree 075bac71c9f6 is the same as the merge-tree's. On both gits: the new file 52 passed, Extra (not in the brief): Skips, named: Logs: 7. Merge-treesHeads were read fresh with
No other open PR touches The body's other lines were re-measured and match:
8. The record
Follow-up candidates (candidates only; not filed, not drafted; for Brett Heap's word)CN1.
They belong with #1317's Scope question on pasted lines, but #1317 does not list them. They bear on this PR only through NIT 1. rv1317's C1 to C4 and #1317's pasted lines are untouched by this PR. They are pending Brett Heap's rulings. State
Lane: openreposhape-5 (openRepoShape-5) |
|
(lane openRepoShape-5, 2026-11-11T01:03Z) #1328's body, edited for rv1328's NIT 1 and NIT 2. The head is unchanged, at
#1328 is READY at Lane: openreposhape-5 (openRepoShape-5) |



Goal
The three
family-members-unreadablerefusals of a family holder's own scripts name the holder'sfamily.yamlthrough that file's own_shown, as #1310's spelled lines do: as it is, or asreprspells it where a character in it is not printable. They aretemplates/family-root/scripts/bootstrap.py's two lines inmembers_of(amembers:that is not a list, and an entry that is not a mapping) andtemplates/family-root/scripts/validate-family.py's one in_run_checks(amembers:that is not a list). A U+202E, an ESC or a line feed in a holder's--root, or in a folder above it, no longer reaches the terminal raw from these refusals: a bidi override reordered the line, an ESC reached stderr as the control it is, and a line feed began a line of the path's choosing.This is the second part of #1317 (v1.2.2): the family root's scripts, which the first part (#1327,
scripts/family.py) left for the_showncopies #1310 adds. Stacked on #1310 (fix/1288-refusals-shown-more, headdaaa5ad8a): this PR's base is that branch, and the PR restacks onto main after #1284 and #1310 land. It is one commit,1020728f2, ondaaa5ad8a, and leaves #1317 open: the lines a person pastes are the part left (Known limits).No refusal code changes, no word of any refusal but the path, and no code. A printable holder is named byte for byte as before. The first line of
bootstrap.py'smembers:refusal is re-wrapped so that it stays inside 79 columns, with the same words ("expected a list" moves to the next string). Proof that nothing else moved: each of the two files atdaaa5ad8aand at this head, with every_shown(...)call taken off, is one AST (bootstrap.py2 calls atdaaa5ad8a, 4 at the head;validate-family.py4 and 5; the lane'swork/n1317c/proof_ast.py), and a copy of the head with one word changed is not.The sites (measured before and after)
Real runs, with a stub
ghfirst on PATH,GH_TOKEN=bogus, an emptyGH_CONFIG_DIR,GIT_SSH_COMMAND=false,GIT_CONFIG_GLOBAL=/dev/nullandGIT_CONFIG_NOSYSTEM=1, of each script from a holderAcme(a git repository carrying the script,bootstrap.pywheresiblings.pyneeds it, andrepo_shape.pyin itsscripts/) made under a folder named with U+202E (wd-pl<U+202E>an), then an ESC (wd-<ESC>[31mRED), then a line feed (wd-<LF>WARNING forged-line: pwned), then a printable name (wd <e-acute> and a space).validate-family.pyran withcontracts/repository-naming.yamlpresent (without it the run is refusedyaml-unreadablefirst). 24 runs, every one exit 2 before and after.check_pinname the path asshown_pathdoes (#1288) #1310's headdaaa5ad8a: each of the 15 refusal runs over a name that does not print put the U+202E or the ESC on stderr raw, or ended theREFUSEDline atwd-and began a lineWARNING forged-line: pwned/.... The 5 printable refusal runs printed the folder as typed.validate-family.pyovermembers: [5]: that entry is not this refusal there, and the run is refusedshape-pin-missing(spelled since 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) before and after.For example, the line feed under
bootstrap.py'smembers: 5, before:and after:
family-members-unreadabletemplates/family-root/scripts/bootstrap.py:2008,members_of(members: 5)scripts/bootstrap.py --root <holder> --no-fetch; itsscripts/siblings.py --root <holder> --dry-run, which importsmembers_offamily-members-unreadabletemplates/family-root/scripts/bootstrap.py:2014(members: [5])family-members-unreadabletemplates/family-root/scripts/validate-family.py:4853,_run_checks(members: 5)scripts/validate-family.py --root <holder>Each site is
_shown(manifest_path)where it was{manifest_path};_shownis the file's own, which #1310 added by the skew rule (bootstrap.py:374,validate-family.py:604), so no import fromrepo_shape.pyis added and a holder whose library predatesshown_pathruns as before.manifest_pathisroot / "family.yaml"withrootresolved, as before: a holder typed relative is named by its absolute path, spelled. The refusals' other text,{rows!r},{members!r}and{'; '.join(unread)}, spells a value withrepralready.Text that pins these lines. A grep of
README.md,AGENTS.mdanddocs/(the handbook mirrordocs/handbook.htmltoo) for the code and for each changed refusal's words finds none;docs/release-notes/v1.1.1.mdnames the code as the record of that release. No doc changes, andtests/test_cli_reference.pyandtests/test_agents_md_codes.pypass on both gits. Intests/:tests/test_pinned_copy_text.pyholds each_showntoshown_pathand forbids an import an older library lacks (passes);tests/test_pinned_copy_columns.py(thesiblings.pypadding rule, no relation) passes;tests/test_family_members_not_a_list.pynames the code and pins its printable words through the holder's three scripts andfamily.py(passes unchanged); #1310'stests/test_refusal_paths_shown_more.pyruns these scripts too (passes). No^id:-style regex reads these two scripts' text: the files that read them as text or bytes (tests/test_family.py:1565,tests/test_adopt_make_bootstrap_followups.py,tests/test_update_shape_kept_helper.py) look at other strings; all three pass at this head on git 2.43.0 (35 ids: 35 passed; 185 ids: 185 passed; 113 ids: 113 passed), run alone underflockwhere over 100 ids.Rows
52 new rows in
tests/test_family_root_scripts_paths_shown.py, in #1310's style (a_repositoryandFAMILY_SCRIPTScome fromtests/test_refusal_paths_shown_more.py,NAMES,LIBRARY,older_libraryfromtests/test_load_yaml_refusals.py, the folder helpers fromconftest):test_each_refusal_names_the_holder_as_shown_path_names_it, 5 runs x 4 names (20): each asserts exit 2, no traceback, nothing on stdout, exactly one line on stderr that isREFUSED family-members-unreadable: <the path, named as shown_path names it><the words after>, and no U+202E, no ESC and no line startingWARNING forged-line. The 5 runs arebootstrap.py's two lines, the same two throughsiblings.py, andvalidate-family.py's one.test_a_holder_typed_relative_is_named_absolute_and_spelled, 3 runs x 4 names (12): the same assertions with--roottyped relative to the working folder, for one refusal of each script. The refusal names the absolute path, spelled: not the text as typed.test_each_copy_spells_the_path_beside_an_older_library, 5 runs x 4 names (20): the first row's assertions with the holder'srepo_shape.pyfrom before scripts/repo_shape.py:load_yamlnames the file with{path}as it was typed in its three refusals, so a bidi control, an ESC or a line feed in a--plan,--rootor--policypath reaches the terminal, whereshown_pathand_shownspell one (see #1152, #1115) #1168 (51a9c5f10), as 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'sCOPIESrows run it. That library already definesshown_path, so these rows do not forbid a copy from importing it; the row that does istests/test_pinned_copy_text.py'stest_no_pinned_script_imports_what_an_older_library_lacks.The new file is ASCII. Every row skips by name where its folder name cannot be made (
unsafe_folder; the ESC and line-feed names also byconftest.POSIX_NAMESon Windows). The new file shares no run of 5 or more non-blank lines with another file undertests/orscripts/of this tree, and none with itself (measured); against #1327'stests/test_family_root_paths_shown.py, which is on another branch, the longest shared run is 6 lines (imports and the sharedassertlines).Run at
daaa5ad8a: the head's test file in the detached treen1317c-mut, whosebootstrap.pyandvalidate-family.pyare #1310's (sha2568a3752cf7987andd379d5800e93, equal togit show daaa5ad8a:<path>), git 2.43.0,-rfEs:test_each_refusal_..., 5 sites x U+202E, ESC, line feed (15)test_a_holder_typed_relative_..., 3 sites x U+202E, ESC, line feed (9)test_each_copy_spells_..., 5 sites x U+202E, ESC, line feed (15)39 of the 52 new rows fail at daaa5ad, every row over a name that does not print, and the 13 printable controls pass.
Mutants
Each applied alone in the detached tree
n1317c-muton this head's two files, the 52 rows run, git 2.43.0,-rfEs; both files put back from saved copies and their sha256 checked after each (7cacaeb167faand497296534dd2). 14 mutants, 14 killed, none survived. The rivals (R) are applied to_shownin both files at once.bootstrap.py'smembers: 5line (:2008) back to{manifest_path}bootstrap.py'smembers: [5]line (:2014) back to{manifest_path}validate-family.py's line (:4853) back to{manifest_path}_shownof both files asrepr(str(path)), a printable path too_shownof both as an escaper of the line feed and the ESC only (no quotes)_shownof both spelling (repr) only a path that holds a line feed or an ESC, so U+202E stays raw_shownof both without the bidi controls (repronly where a character is not printable and not U+202E)bootstrap.py's first line namesmanifest_path.name, the file alone, not the pathvalidate-family.py's line namesmanifest_path.namebootstrap.py's second line namesmanifest_path.parent, the holder's folder, notfamily.yamlbootstrap.py's first line: "expected a list" to "expected a sequence"bootstrap.py's second line: "a member is not a mapping" to "a member is not a dict"validate-family.py's line: "expected a list" to "expected a sequence"bootstrap.py's second line given aRemediation:line it never hadEach site's revert (S1-S3) is killed by its own rows (the first row, the relative row that reaches it and the older-library row) and by no other site's. S1 and S2 also fail the
siblings.pyrows, which reach the same two lines. R1 fails the 13 printable controls (quotes added), R2b and R3 the 13 U+202E rows; R2 fails every row over a name that does not print, since it spells without quotes. T1-T3 fail the printable rows too, so the row asserts the path named, not just that something is spelled. W1-W4 fail printable rows too, so the words around the path are pinned (W4 adds a line, which the exact-one-line assertion catches).Runs
Every run through the lane's runner: a stub
ghfirst on PATH (and the suite's ownghguard ahead of it),GH_TOKEN=bogus, an emptyGH_CONFIG_DIR,GIT_SSH_COMMAND=false,GIT_CONFIG_GLOBAL=/dev/null, a blank git identity, git-filter-repo 2.47.0 (CI's pin;--versionsaysa40bce548d2c) on PATH, CPython 3.12.3 (CI runs 3.14; no row asserts text that depends on the version),-rfEs, at most 100 ids a call, one basetemp per call; the files of more than 100 ids ran alone underflock. The head was committed before any gate (the tree was clean).The gate list, 9 calls, 796 ids a leg: the new file; the files that name the code or run these scripts and that #1310 touches (
tests/test_family_members_not_a_list.py,tests/test_refusal_paths_shown_more.py,tests/test_pinned_copy_text.py);tests/test_pinned_copy_columns.py;tests/test_cli_reference.pyandtests/test_agents_md_codes.py; and the hygiene files andtests/test_no_auto_maintenance.py.git 2.43.0, head
1020728f2:git 2.47.1 (
L/tools/git247/bin/git), head1020728f2:Skips, named:
tests/test_no_auto_maintenance.py:222, 2 on each git, "the session began with GIT_CONFIG_GLOBAL set, and its file includes that one". No other skip.On a local merge with main. Main moved to
dcf63b8b9and changedvalidate-family.pyandtests/test_validate_family_unreadable.py(#1263). The head merged with main in the detached treen1317c-mut(a local merge commit, never pushed; its tree is the merge-tree'smainline below), and run there on both gits,-rfEs:git 2.43.0:
git 2.47.1:
One lane-set run (#1299's lesson) of the new file on git 2.43.0 under
LANES_LANE=openRepoShape-5: 52 passed (52 ids).Merges
Main and the open PRs' heads were read fresh when the branch was pushed. The head is #1310's head plus one commit, so the merge with #1310's head is the head's own tree. The open PRs that touch these two files are #1310 (the base) and #1319 (
validate-family.py); the others listed touch a file the new test file imports from (tests/conftest.py,tests/test_load_yaml_refusals.py) or that #1310 owns. #1327 (the first part of #1317:scripts/family.pyand its own test file, no file of this PR) is listed for information; its head and this one merge clean (rc=0, last line below).Push read back: git ls-remote origin refs/heads/fix/1317-family-root-scripts-shown gives 1020728 (a new branch; pushed with an explicit refspec, no -u, no force)
Main moved to
a6f1374b0(#1304, which touchesscripts/repo_shape.py,scripts/shape_materialize.pyandadopt-project.py) after this branch was pushed. When this PR opened, the head merged with it cleanly (git merge-tree --write-tree, rc=0, tree075bac71c9f6caff50872909dbe91e15fc839e54).Known limits
siblings-script-missing's remedy,member-unknown's lines and the callers 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 lists under "Read, not probed" stay as they are. 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 Scope paragraph calls them a decision to make, 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 inside their shell quotes 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 first place that spells one. None of the three lines here is pasted.scripts/family.py's own refusal texts. They are 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 first part (scripts/family.py:family-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 #1327), a separate PR on main; this PR does not touchscripts/family.py.bootstrap.pynorvalidate-family.pyhas another refusal text that names the holder's path raw. What is left raw is pasted lines invalidate-family.py, which name the holder throughshlex.quote(str(root)); that quoting lets an ESC, a line feed or U+202E through. They are candidate CN1 below.family-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 #1327 (L/q/v128/land/rv1317-report.md) are Brett Heap's to rule and are untouched here. They name lines ofscripts/family.py, at scripts/family.py:family-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 #1327'sd5a4fe6b4(scripts/family.py:family-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 #1327's head is nowaa1c71e79, which changes only its test file, so they hold there too; the lines in this PR's tree, which is 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'sscripts/family.py, are a few lines earlier): C1,family-members-unrecognised(Family.rewritten,:697-698) names<holder>/family.yamlraw; C2,member-git-dir-cached(:6636-6637) and_deletion's "It is this directory:" line (:6556) name the holder's store path raw; C3, the pasted remedies offamily-branch-not-utf8(:1212-1213) andfamily-index-locked(:10294-10295) are raw on purpose under Tracking: setup, scaffold, family and the shared helpers, creating projects and families #459 and belong to 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 Scope decision but are not listed there; C4, three remedy tails offamily.py's refusals are pinned by no test.templates/family-root/scripts/validate-family.pynames the holder throughshlex.quote(str(root))in pasted lines: THE LOCKSTEP RULE (_lockstep) and_switch_line, which endmember-commit-unresolvable's refusal and the gitlink findings;_bump_toinmember-id-malformed;member-duplicate-id;_mounted_by_handinmember-gitlink-unnamed;_removal_staged_saidinmember-gitlink-removal-staged; and the closing findings line. They belong with 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 Scope question on pasted lines, which does not list them.Part of #1317
Lane: openreposhape-5 (openRepoShape-5)
🤖 Generated with Claude Code
Summary by Sourcery
Safely spell holder manifest paths in all family-root
family-members-unreadablerefusals while preserving existing refusal text and behavior.Bug Fixes:
family-members-unreadablerefusals from emitting unsafe root paths containing bidi controls, escape characters, or line feeds directly to the terminal.Tests: