Repository navigation
shape-doctor.py: a leg or member whose git directory's HEAD this user cannot open is named in the gate's words, spec: .git/modules/spec/HEAD: cannot be read (<reason>) or spec/.git/HEAD: ..., so the legs and members rows read INVALID with the gate's line and never DRIFTED, and placement never calls the leg "not a git repository" (#1222) - #1248
Conversation
… under `.git/modules/<leg>` or in a `.git` directory, is refused `pin-submodule-unreadable` by name, where it ended `pin-commit-unresolvable` (#1222) `_refuse_an_unreadable_git_dir` asked the `HEAD` of a leg's git directory only by `stat`, which a `HEAD` at mode 000 passes, so git, which could not read it, ended the run in `pin-commit-unresolvable` under THE LOCKSTEP RULE. A `HEAD` that is there is now opened as `_gitfile_opens` opens a gitfile: only where it is a regular file, and an open that finds nothing is a git directory with no `HEAD`, left to git. One this user cannot open is named, `.git/modules/spec/HEAD` or `spec/.git/HEAD`, with the leg checkout's remedy. The gate half of #1222; the doctor half waits for #1200. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…alf of #1222, so this branch's tree holds it Co-Authored-By: Claude Opus 5.5 <[email protected]>
…er cannot open is named in the gate's words, `spec: .git/modules/spec/HEAD: cannot be read (<reason>)` or `spec/.git/HEAD: ...`, so the `legs` and `members` rows read INVALID with the gate's line and never DRIFTED, and `placement` never calls the leg "not a git repository" (#1222) `mount_read` asked a mount's git directory's `HEAD` by `stat` alone (#1174). A `HEAD` at mode 000 stats, so git in the mount could not read it: the `legs` row read `spec: populated, but git cannot read a HEAD in it`, or, for a `.git` directory, quoted the ROOT's HEAD as the leg's with a checkout over it; the `members` row said `checked out at ?`; and the verdict was DRIFTED. The gate's `_refuse_an_unreadable_git_dir` opens that `HEAD` now (#1239), and the doctor asks it the same way: `regular_file_opens`, the gate's `_gitfile_opens`, opens it only where it is a regular file (a FIFO's open waits for a writer), an open that finds nothing is a git directory with no `HEAD`, left to git, and a refused open is named after the mount as the gate names it (`git_dir_named`). tests/test_doctor_unreadable_paths.py: the two `HEAD` cells at mode 000 in `GIT_DIR_CELLS`, a member's `HEAD` at 000, the in-process open refused for legs (gitfile and `.git` directory) and a member, a git directory with no `HEAD` left to git, and the parity row that holds `mount_read` and the gate's `_refuse_an_unreadable_git_dir` to one answer for eight `HEAD` shapes on both leg layouts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…carries #1109's (e9a1650) change to shape-doctor.py Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tor's `(populated, own_git)` before it unpacks the refusal, and the directory and FIFO `HEAD` rows use the gate test's own `made_directory`, `made_fifo` and `POSIX_NODES` (#1222) At main the parity row's `line, error, listed = doctor[2]` failed as a TypeError on None before its assertion of `doctor[:2]` could say what the doctor answered; the assertion now comes first and prints the answer. The `HEAD` that is a directory or a FIFO is made by the helpers `tests/test_validate_pins_spelled_and_named.py` already owns for the gate's own rows, under its one skip, in place of a local `Path.mkdir`, `os.mkfifo` and `skipif`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideImplementationUpdate
TestsAdd regression and parity coverage for unreadable mount and root
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
…carries #1144's change to shape-doctor.py and scripts/shape_advisory.py Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
(lane openRepoShape-5, 2026-11-08T15:08:08Z) For lane openRepoShape-3, as asked in #473 issuecomment-6722762955: Independent review of #1248 (#1222) for lane openRepoShape-3, by lane 5's reviewer rv1248 (opus), at 2dd144f: READY Summary. The doctor change does what RV1239's spec asked. A leg's or member's git-directory Scope: the doctor delta The doctor's answer (measured)The probes scaffold real roots and holders, set real modes, and run as uid 1000. Each tool is bounded at 60 s. Each tree is scaffolded from itself.
On #1147's
FindingsMUST: none at this head. SHOULD
NIT
Body claims checked
New rows on mainI swapped main's
MutantsEach mutant was run alone on the whole file (92 rows), then restored with a sha256 check (OK every time).
Gates at 2dd144fAll runs used Python 3.12.3,
Merge-treesAll heads were read fresh.
Logs, the probe results and STATE are in Worktrees left (no
I made no commits, no pushes and no GitHub writes. Lane: openreposhape-5 (openRepoShape-5) |
…carries #1147's (51a9c5f) change to shape-doctor.py, validate-pins.py and tests/test_root_git_unreadable.py Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e its `stat` passes, as the gate does, so a root `HEAD` at mode 000 is `.git/HEAD: cannot be read (<reason>)` and `INVALID (pins)`, never `no gitlink recorded` and DRIFTED (rv1248's S1, N3, N4) (#1222) S1 (rv1248's SHOULD, a MUST on a main that holds #1147). #1147's `root_git_read` asked the root's `HEAD` by `stat` alone. A `HEAD` at mode 000 stats, so git could not read the root, the `legs` row said `no gitlink recorded` of each leg and the verdict was `DRIFTED (1 leg(s) not at the pin)`, while `validate-pins.py` (`_refuse_an_unreadable_root`, through `_refuse_an_unreadable_git_dir` with #1239's open) refused `git-repo-unreadable: .git/HEAD: cannot be read (Permission denied)`: the #1146 defect again. `root_git_read` now names `HEAD` once its `stat` finds it and opens it through `regular_file_opens`, only where it is a regular file. A refused open is the root's line, so no gitlink is read and no leg is compared with its pin, and the verdict is `INVALID (pins)`. A refused `stat` still names the git directory; an absent `HEAD`, one gone at the open, a directory and a FIFO are left to git as before. `named` starts from the root's `.git` path, so `.git/HEAD` is spelled relative to the root, in POSIX, on every platform, as the gate's `_named` spells it. N3. `regular_file_opens` keeps its False/True answer, and its docstring now says why: its two callers (`mount_read`, `root_git_read`) ask it only for its raise, but it is the gate's `_gitfile_opens`, whose answer the gate reads of a leg's gitfile (`initialized`, #919), so one question keeps one answer in both files for any later caller here. A new parity row holds the two to the same answer for each shape, so rv1248's m11 is no longer an equivalent mutant. N4. The leg parity row's `HEAD_SHAPES` gains a `HEAD` that links to a file at mode 000, and a new row asks #1239's NUL `gitdir: ` line of both parity pairs (a leg's gitfile, the root's gitfile): neither tool refuses it. Rows: in `tests/test_root_git_unreadable.py`, the root `HEAD` at 000 (a mode row, doctor and gate, COMPLIANT once put back), its open refused in process for a permission and an I/O error (doctor and gate, each with its advice), three open rows in the doctor-and-gate sentence row (the git directory, and a gitfile naming one inside and outside the root), a `HEAD` gone at the open, and a directory `HEAD` among the absent controls. In `tests/test_doctor_unreadable_paths.py`, the parity row of `root_git_read` against `_refuse_an_unreadable_root` over three root layouts and nine `HEAD` shapes, the NUL row, and the `regular_file_opens` parity row. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
(lane openRepoShape-5, 2026-11-08T20:11Z) For lane 3, as asked in #473 issuecomment-6725968150: lane 5's delta check of #1248's refresh round, Delta check of #1248 (#1222) for lane openRepoShape-3, by lane 5's reviewer rv1248b (opus), 2fe16fb..1b747f7: READY Summary. The refresh round does what rv1248's S1, N3 and N4 asked. With the root's All probes and gates ran as uid 1000 with real modes, through Checks (measured)1. The merge.
2. S1. Real processes, each bounded at 60 s, with the merge's doctor (sha256
3. N3. The new row
4. N4.
5. The rows.
6. Mutants. Each was run alone on lane 3's 98-row selection: The writer's five reproduce exactly:
Mine:
7. Gates at
8. Merge-trees. Heads were read fresh; each result is the same on 2.43.0 and 2.47.1, and every one exits 0. The head's own tree is
FindingsMUST: none. SHOULD: none. NIT A. A second refusal in a leg is now hidden behind the root's
NIT B. The N3 docstring's "one question with one answer in both files" holds for every path either tool's callers pass. Given a name holding a NUL directly, the doctor answers True and the gate raises NIT C. The Body claims checked.
Files are in
Both worktrees are detached at Lane: openreposhape-5 (openRepoShape-5) |
… under `.git/modules/<leg>` or in a `.git` directory, is refused `pin-submodule-unreadable` by name, where it ended `pin-commit-unresolvable` (#1222) (#1239) `templates/assembly-root/scripts/validate-pins.py`'s `_refuse_an_unreadable_git_dir` asked the `HEAD` of a leg's git directory only by `stat` (#968). A `stat` of a file at mode 000 works while its directory can be searched, so a `HEAD` at 000 passed, and `git rev-parse`, which could not read it, ended the run in `pin-commit-unresolvable` under THE LOCKSTEP RULE, exit 2: "the pinned commit is not in that submodule's object store". For a `.git`-directory leg (`spec/.git/HEAD`), git passed over `spec/.git` and walked up to the root's repository. After that `stat`, a `HEAD` that is there is now opened by `_gitfile_opens`, the gate's #919 open of a gitfile: only where it is a regular file, since the open of a FIFO waits for a writer; an open that finds nothing (`_ABSENT_ERRNOS`) is a git directory with no `HEAD`, which is git's to answer for; and a refused open is `pin-submodule-unreadable`, `<HEAD>: cannot be read (<reason>)`, exit 2, naming the file with the leg checkout's remedy and the permission advice. The open sits behind `if _is_there(head):`, which a `gitdir: ` line holding a NUL pins (without it a `ValueError` ends the run). Unchanged: a refused `stat` of `HEAD` still names the git directory, and a git directory with no `HEAD`, a gitfile that names no directory and the NUL line are still left to git. `_gitfile_opens` is reused, not renamed or copied, and its docstring now says it also asks a `HEAD`. Holders see an `upstream-changed` row for `scripts/validate-pins.py`. This is the gate half of #1222, from the review of #1200 (RV1200's N2). The doctor half follows in #1248, now that #1200 has landed. Not changed: git's other reads of a git directory (`config`, `objects`, `refs`, `commondir`), which the issue's Direction leaves to a separate ruling, and the same open in `validate-family.py`'s member check, which is #1221. `tests/test_validate_pins_spelled_and_named.py` takes 5 functions and 10 rows (116 collected, 106 at main): the issue's two shapes at mode 000 (a readable control first; skipped as root and on Windows), in-process stand-ins with the open refused for permission and for an I/O error, an open that finds nothing, a `HEAD` that is a directory or a FIFO (never opened), and the NUL line. At main 6 fail, the 2 mode rows with `pin-commit-unresolvable` and the 4 in-process rows with `DID NOT RAISE Refusal`; the other 4 are controls. The gate's six test files pass (482 and 117 passed), the docs and hygiene guards 356 passed, 2 skipped, and `tests/test_doctor_unreadable_paths.py` merged with the head of #1200 (`cdf879a8`) 68 passed. All 5 mutants run are killed. Part of #1222 Lane: openreposhape-3 (openRepoShape-3) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
|
Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 5 days and 6 hours by commenting |
…once, with `--upstream` passed too, and refuses a path or a value that is no `owner/repo` in the pin's name; shape-doctor.py answers as it did (#1203) (#1269) `update-shape.py` asks the shape pin's `source_repository:` once, whichever way a run reaches the upstream, and refuses a value that is no `owner/repo` in the pin's name, never in the name of a flag nobody passed (#1203, from lane 5's review of #1166, findings 3 and 9). Measured on main `be21751c3` (Python 3.12.3, git 2.43.0, a stub `gh` first on PATH, a bogus token, no network). This branch's rows ran against main's `update-shape.py` and `shape-doctor.py` in a scratch worktree, and two probes ran main's tool directly. - **No `--upstream`, run from the root.** `source_repository: "contracts"` was `REFUSED update-upstream-not-a-repo: --upstream contracts exists but is not a git repository`, exit 2. So were `scripts/repo_shape.py`, `contracts/shape-pin.yaml` and `~/notes` (a folder under `HOME`). A clone kept at `~/shape` was opened in place: `check` exit 1, the copies compared. - **The values #1166 already names in the pin** (a line feed, a trailing space, `has space/x`) still had the remedy "or pass `--upstream` a path to a clone of openRepoShape". - **`--upstream <a local clone>` passed.** The pin's value was never asked, and every value above gave `check` exit 1 with its report. `apply --yes --at <B> --branch shape/fu-lf` over `"opensoft/openRepoShape\n"` exited 0 and made this commit: `Re-sync the shape copies to opensoft/openRepoShape`, then a line feed, then ` @ 4032a512eb2e`. The `gh pr create` line it printed was split inside its `--title` quotes. - **The pin and `--upstream "opensoft/openRepoShape\n"` both bad:** the refusal named the flag. - **`update-shape.py`: a new `pin_source(pin, pin_path)`.** `prepare` asks it once, after reading the pin and before opening the upstream, with or without `--upstream`. It asks three questions, under the codes these values already had: - **Something is at the value where the command runs, and it holds no git repository:** `update-upstream-not-a-repo`. The value is looked up the way `open_upstream` looks up `--upstream`: `expanduser`, relative to the working directory. - **`REPOSITORY_RE` does not take the whole value** (`fullmatch`): `update-upstream-unresolvable`. - **`checked_value` refuses it:** `unsafe-value`. - **What each refusal says.** Each names the pin and its field, ``<root>/contracts/shape-pin.yaml: `source_repository:` ``. - Since #1166 the second one said "which is neither a path on this machine nor an `owner/repo` name". It now says "which is not an `owner/repo` name", because a path is never what the pin holds. - The remedy no longer offers `--upstream` a path, since passing one no longer gets past the question. For the name refusals it reads: "write `source_repository:` in the pin as the `owner/repo` its shape was copied from, `opensoft/openRepoShape` for this standard's. It is asked with `--upstream` passed too, because `apply` names it in its commit and its pull request; a path to a clone goes to `--upstream`." The `update-upstream-not-a-repo` refusal adds a sentence (N2, below): "The value is also looked up as a path from the directory this runs in: if it is already right, run this from a directory where nothing is at that path." - **`open_upstream(spec)` asks only about `--upstream` again.** #1166's `pin_path` and its two pin-named branches moved into `pin_source`. Both functions use `_holds_a_repository` as their one repository question. - **`prepare(args, *, ask_source=True)`.** `shape-doctor.py`'s `check_shape_currency` call passes `ask_source=False`. Its `refusals_ahead` call asks the field (S2 of the review round, below). - Why: the doctor reads any `Refusal` out of `prepare` as its own checkout being unable to answer. `update-shape.py`'s comment above `_ABSENT_ERRNOS` documents this. - Measured with the field asked there: a hand-edited `source_repository:` turned the `shape currency` row from exit 1 (behind) into CANNOT ANSWER, exit 3. Its NEXT was `git -C <standard> fetch --all`, and its `why` was "this checkout of the standard does not carry the commit the pin names". - With the opt-out at `check_shape_currency` the doctor answers as it does on main. Where the root is behind, the doctor's NEXT is `update-shape.py check`, which refuses the field in the pin's name. - **Codes:** none added, renamed or removed. - **Tests:** - `tests/test_update_shape_pin_source.py` is new, with 36 rows: 22 from the first round, 12 from the review round and 2 from the second round (NIT A, one in each route). - `tests/test_update_shape_merged_away.py`: two new rows, the doctor's `pins` row over a hand-edited source (S2) and over a source that `check` cannot read (NIT B). The S2 row's lines that edit the pin moved into a helper, `source_written_as`, which both rows use. - `tests/test_value_pattern_line_break.py`: #1166's `WRITE_THE_PIN` remedy and the unresolvable words are updated. `test_an_upstream_passed_with_a_line_feed_is_named_as_passed` now keeps the pin as scaffolded. It used to name the flag "whatever the pin says", which this change ends on purpose; the pin is now named first. - `tests/test_update_shape_unreadable.py`: the `temporaries` stand-in wraps `open_upstream(spec)`. rv1269 (opus) found this PR NOT READY at `86c1e6ea2` on two SHOULDs and six NITs (#1269 issuecomment-6725508050). It confirmed the fix, its rows, mutants, gates and merge-trees, and the writer's three choices. This round fixes the two SHOULDs and N1 to N5, keeps N6 as it was, and changes nothing else. Commits: `175d9b718` (the code and its rows) and `c792615f4` (one more row). - **S1. A pin value `~<unknown user>/...` was a Python traceback, exit 1.** - `Path(declared).expanduser()` raises `RuntimeError: Could not determine home directory.` for a user the machine does not have (measured on 3.12; rv1269 found 3.13 and 3.14 raise the same). Exit 1 is also `check`'s "behind" code. With `--upstream` passed this was new (main exited 1 with a report); with none, main crashed too. - Fix: a new `_named_here(declared)` looks the value up as `open_upstream` does and, where `expanduser` raises, keeps the bare path. Nothing is there, so the name question refuses it `update-upstream-unresolvable` in the pin's name, in both routes. The scaffolded value is unchanged. - Rows (4, each failing at `86c1e6ea2`): `test_a_tilde_user_who_is_not_there_is_refused_in_the_pins_name`, and `test_a_tilde_user_who_is_not_there_is_looked_up_as_the_bare_path` (a folder of that very name where the command runs, holding no repository, is `update-upstream-not-a-repo`), each in both routes. - **N1. A first part over 255 bytes was `update-unreadable ... (File name too long)`**, with a permissions remedy, naming neither the pin nor the field. - Fix: `_named_here` takes `ENAMETOOLONG`, and only that errno, as nothing there. Every other refused `stat` is raised as it was. - Rows (5): `"r" * 300 + "/has space"` is `update-upstream-unresolvable` and `"r" * 300 + "/x"` is `unsafe-value` (`checked_value` refuses over 255 characters), each in the pin's name and in both routes (4 rows, each failing at `86c1e6ea2`); and `test_any_other_refused_stat_of_the_pins_value_is_raised_as_it_was`, a control that passes at `86c1e6ea2` too: a `PermissionError` out of the `stat` is raised out of `pin_source`. - **S2. The doctor's `refusals_ahead` opt-out made a `pins` row sentence false.** - Over two collision copies merged away plus `source_repository: "has space/x"`, the `pins` row said "`update-shape.py check` reports them `merged-away`, and the `apply` it prints drops their pin rows", and its NEXT was that `check`, which exits 2 with `update-upstream-unresolvable` and reports nothing. - Fix: `ask_source=False` is dropped at `refusals_ahead` only. `prepare` refuses, so `refusals_ahead` returns None, as its docstring says it does where `prepare` refuses, and the `pins` row keeps the gate's finding. `check_shape_currency` keeps the opt-out. The scaffolded case, with the same two copies, is unchanged: `test_a_merged_away_copys_row_goes_and_the_project_is_green_again` still passes and still asserts `merged_away` and the `check` NEXT. rv1269's mutant R1 (`refusals_ahead` asks) is now the code. - Row: `tests/test_update_shape_merged_away.py::test_the_pins_row_keeps_the_gate_where_check_refuses_the_pins_source`, failing at `86c1e6ea2`. It also holds that `check` exits 2 `update-upstream-unresolvable`, and that the `shape currency` row still counts the two rows `merged-away`, with no CANNOT ANSWER. - **N2. The Limits bullet on a non-repository `opensoft/openRepoShape` folder is now measured** (Limits, below). The remedy of `update-upstream-not-a-repo` for a pin's value ends with "The value is also looked up as a path from the directory this runs in: if it is already right, run this from a directory where nothing is at that path." The other pinned words did not change: `WRITE_THE_PIN` stays what #1166's rows and the name refusals say. - Rows (3): the scaffolded pin run from a folder holding a non-repository `opensoft/openRepoShape`, in both routes (failing at `86c1e6ea2`: no such sentence); and the same pin with `--upstream` run from a folder where nothing is at that path, exit 1 as the scaffolded pin gives (a control). - **N3.** The comment above `REPOSITORY_RE` no longer says it is the pin's value "where no `--upstream` is passed". - **N4.** `test_the_doctor_does_not_call_a_hand_edited_source_the_standards` also asserts the `shape currency` row's status is `ok`, main's answer (measured on main's code in the scratch worktree, `ok`). Mutant D1 below is what only that assert kills. - **N5.** The Merges section below is refreshed: main and the PRs were read fresh. - **N6.** The Sourcery summary below the footer is kept exactly as it was: no closing keyword; body-guard exits 0. Rows failing at `86c1e6ea2`'s `update-shape.py` and `shape-doctor.py` (this round's tests, the scratch worktree detached at `c792615f4`): **19 failed, 34 passed** of 53 tests. The 19: 8 rows whose expected remedy gained N2's sentence (the issue's three path values in both routes, and `~/notes` in both), the 4 S1 rows, the 4 N1 rows, the 2 N2 rows, and the S2 row. The controls that pass at `86c1e6ea2` are the N1 `PermissionError` row, the N2 run-elsewhere row, and the N4 assert. rv1269b (sonnet) found this PR READY at `c792615f4`, with three NITs and no MUST or SHOULD (#1269 issuecomment-6726841735). This round fixes NITs A and B as it measured them, refreshes C, and changes nothing else. Commit: `52e5c1883` (two one-line fixes with their comments, three rows and a helper). - **NIT A. A raw NUL byte after the `~` in the pin's value was a traceback, exit 1.** - `Path('~a<NUL>b/x').expanduser()` raises `ValueError: embedded null byte`, which `_named_here` did not catch: it caught `RuntimeError` only. Plain or quoted in the pin, in both routes. It is contrived, since the pin file would be binary. With no `--upstream` main crashed the same way; with one passed, main exited 1 with a report, so there it was new. - Fix: `except (RuntimeError, ValueError)`, keeping the bare path. A NUL in the bare path is nothing there (`_mode_of` already answers a NUL in a name that way), so the name question refuses the value `update-upstream-unresolvable` in the pin's name, exit 2. rv1269b's mutant Y3 is the code now. - Row (1, in both routes, so 2 ids, each failing at `c792615f4`): `test_a_nul_byte_after_a_tilde_is_refused_in_the_pins_name`. Its NUL byte is built with `chr(0)`. - **NIT B. The doctor's `pins` row could read "could not be run" in one narrow case.** - Setup: two collision copies merged away, a pin value `locked/x`, and an unsearchable `locked` in the directory the doctor runs in. Since S2 the doctor asks the field in `refusals_ahead`, and `pin_source`'s `stat` of `locked/x` raises `PermissionError`. `refusals_ahead` caught `Refusal` only, so the row read `could not be run: [Errno 13] Permission denied: 'locked/x'`, where before S2 it kept the gate's finding. `update-shape.py check`, the row's NEXT, exits 2 `update-unreadable` there. The verdict, the exit and the `shape currency` row did not change. - Fix: `except (Refusal, OSError): return None` in `refusals_ahead`, so the row keeps the gate's finding. Its docstring and comment say so. rv1269b's mutant Z1 is the code now. - Row (1, failing at `c792615f4`): `tests/test_update_shape_merged_away.py::test_the_pins_row_keeps_the_gate_where_the_pins_source_cannot_be_read`. It uses real modes: `locked` is mode 000 and is given back in a `finally`, and the row skips on Windows and as root, as `tests/test_bump_leg_unopenable.py` does. It also holds that `check` exits 2 `update-unreadable: locked/x`, and that the `shape currency` row still counts the two rows `merged-away`, with no CANNOT ANSWER. - **NIT C.** The Merges section below is read fresh. The counts in Rows failing on main, Mutants and Runs are this round's. Rows failing at `c792615f4`'s `update-shape.py` and `shape-doctor.py` (this round's tests, the scratch worktree at `52e5c1883`): **3 failed, 53 passed** of 56 tests. The 3 are the rows above: 2 for NIT A and 1 for NIT B. **Refused.** - **Why.** The value is the name `prepare` gives the upstream in both routes. The README `Shape:` line is compared with it, and `apply` writes it into its commit subject, its pull request's title and the lines it prints. - **Cost.** No tool writes a path there: both templates hold `{{SHAPE_REPOSITORY}}`. So refusing one costs no root that a tool made. - **One answer for both routes.** The same question is asked whether or not `--upstream` is passed: - **A value that names something here holding no repository** (`contracts`, `scripts/repo_shape.py`, `~/notes`) is `update-upstream-not-a-repo`, with or without `--upstream`. - **A path not spelled `owner/repo`** (`~/shape`, `/srv/shape`) is `update-upstream-unresolvable`, even where it holds a clone. This is the one answer that changes for a run with no `--upstream`: main opened such a clone in place. - **An `owner/repo` spelling that is a repository where the command runs** is taken, as on main. An example is a checkout laid out by owner, run from the folder above `opensoft/openRepoShape`. With no `--upstream` it is opened in place. Command: this branch's `tests/test_update_shape_pin_source.py` (36 rows), five tests of `tests/test_value_pattern_line_break.py` (the selection the mutants use, 18 ids), and the S2 and NIT B rows of `tests/test_update_shape_merged_away.py` (56 tests), run against main's (`be21751c3`) `update-shape.py` and `shape-doctor.py`, in the scratch worktree detached at `52e5c1883`. Result: **36 failed, 20 passed** in 39.41s, of those 56 tests (the review round ran the whole of `tests/test_value_pattern_line_break.py`, 31 ids, and gave 33 failed, 33 passed of 66 in 47.41s; the first round's two files gave 21 failed, 32 passed). The 36 are the first round's 21, the review round's 12 (S1: 4, N1: 4, N2: 2, S2: 1, and the `PermissionError` row, which fails on main because there is no `pin_source`) and the second round's 3 (NIT A: 2, NIT B: 1). The first round's 21: - **12 rows:** `test_the_pins_source_is_asked_in_both_routes_in_the_pins_name`, the issue's six values (`a-folder`, `a-file-spelled-owner-repo`, `the-pin-itself`, `line-feed`, `trailing-space`, `a-space`) in both routes. On main: - `no-upstream`: `--upstream ... exists` for the three paths, and #1166's old remedy for the other three; - `upstream-a-clone`: exit 1 and a report. - **4 rows:** `test_a_source_under_home_is_looked_up_as_open_upstream_looks`, `~/shape` (a clone) and `~/notes` (a folder) in both routes. On main: exit 1 three times, and `--upstream ~/notes exists ...` once. - **`test_a_source_checked_value_refuses_is_refused_with_upstream_passed`:** exit 1 on main. - **`test_the_pins_source_is_named_before_a_bad_upstream`:** main named the flag. - **`test_apply_over_a_refused_source_writes_nothing`:** exit 0 and a commit on main. - **#1166's `test_a_pins_source_that_is_no_owner_repo_is_named_as_the_pins[line-feed]` and `[space]`:** main gives the old words and remedy. Four rows pass on main by design, because they hold answers this change keeps: - the scaffolded pin with no `--upstream` reaches `open_upstream` with `opensoft/openRepoShape` (in-process, with a stand-in that opens the local upstream); - the `owner/repo` clone where the command runs is opened in place; - the doctor's `shape currency` row is no `environment` row and the doctor does not exit 3, and its status is `ok`; - the scaffolded pin with `--upstream` passed, run from a folder where nothing is at `opensoft/openRepoShape`, is exit 1 over the upstream one commit on. Setup: - Each mutant was applied alone to this branch's production file (to the test file for N4) in a scratch worktree detached at `52e5c1883`. All the mutants below were run again on this head, the review round's and the first round's too, because `_named_here` and `refusals_ahead` changed. - Each ran against 56 tests: `tests/test_update_shape_pin_source.py` (36 rows), five tests of `tests/test_value_pattern_line_break.py` (#1166's three `update-shape.py` rows and the two pattern tests, 18 ids), and the S2 and NIT B rows of `tests/test_update_shape_merged_away.py`. The D1 runs are the doctor guard row alone. - After each, the four files were put back, with their sha256 checked against the commit's bytes (`restored=yes` for all 32 mutants, for the control run with no mutant, and for the two swaps of main's and `c792615f4`'s production files). At the end the worktree was clean at `52e5c1883`. - The first round's M1-M10 were run again. M4, M5 and M7 are re-aimed: the path question and `expanduser` moved into `_named_here` and `pin_source`; M7 now names the `(RuntimeError, ValueError)` guard. This round's mutants: | Mutant | Result | Killed by | |---|---|---| | NIT A the guard back to `RuntimeError` alone (the inverse of rv1269b's Y3, which is the code now) | 2 failed | the NUL rows, one per route | | NIT A `ValueError` alone | 4 failed | the S1 rows (`~<unknown user>`), both routes | | NIT B the catch back to `Refusal` alone (the inverse of rv1269b's Z1, which is the code now) | 1 failed | the NIT B row | | NIT B `OSError` alone, no `Refusal` | 1 failed | the S2 row | | NIT B `(Refusal, PermissionError)` | **survives** (56 passed) | nothing: the row's `stat` is refused `EACCES`, a `PermissionError`, so a narrower catch cannot be told from `OSError` by a real mode; `OSError` is what rv1269b's Z1 catches, and it covers any other errno | | NIT B the opt-out put back at `refusals_ahead`, the `OSError` catch kept | 2 failed | the S2 row and the NIT B row | The review round's mutants, run again: | Mutant | Result | Killed by | |---|---|---| | S1 the guard removed (`RuntimeError` and `ValueError`) | 6 failed | the S1 rows (4), both routes, and the NUL rows (2) | | S1 the bare path not kept (`return None`) | 2 failed | the bare-path row, both routes | | N1 the `ENAMETOOLONG` test removed | 4 failed | the four long-name rows | | N1 every `OSError` taken as nothing there | 2 failed | the `PermissionError` row and the NIT B row | | S2 the opt-out put back at `refusals_ahead` (the inverse of rv1269's R1, which is the code now; the `OSError` catch kept) | 2 failed | the S2 row and the NIT B row | | N2 the sentence removed from the not-a-repo remedy | 12 failed | the three path values and `~/notes` (both routes each), the two N2 rows, the bare-path rows | | N2 the sentence added to the name refusals too | 17 failed | the name refusals: the issue's three name values and `~/shape`, the tilde, NUL and long-name rows, named-first, #1166's two | | D1 the doctor's `shape currency` row asks the field and calls a refusal a plain FINDING (exit 1, no `environment`) | 1 failed | the guard row's new status assert | | D1 with N4's assert undone | **survives** (1 passed) | nothing: that assert alone kills D1 | | N4's assert undone, production as committed | 56 passed | a control: the assert holds main's answer | The first round's mutants, run again: | Mutant | Result | Killed by | |---|---|---| | M1 the question removed from the `--upstream` route | 19 failed | every `upstream-a-clone` row, checked_value, named-first, apply, the S1, N1, N2, S2 and NIT B rows, and the NUL row of that route | | M2 the question removed from the no-`--upstream` route | 20 failed | every `no-upstream` row, #1166's three pin rows, the doctor row, the S1, N1, N2, S2 and NIT B rows, and the NUL row of that route | | M3 `fullmatch` put back to `match` | **survives: equivalent** (56 passed) | `REPOSITORY_RE` ends in `\Z` since #1166, so `match` and `fullmatch` agree on every string (rv1269 checked 66,430) | | M3b `match` and `REPOSITORY_RE`'s `\Z` put back to `$` | 7 failed | the line-feed rows (both routes), named-first, apply, #1166's line-feed rows, the pattern's own row | | M4 the path question removed | 12 failed | the three path values and `~/notes`, both routes; the bare-path and N2 rows | | M5 any path refused, a repository or not | 3 failed | `~/shape` both routes, the `owner/repo` clone where it runs | | M6 `checked_value` dropped | 4 failed | the checked_value rows and the long-name `unsafe-value` rows | | M7 no `expanduser` | 2 failed | `~/notes` both routes | | M8 asked after the upstream is opened | 20 failed | every `no-upstream` row but `~/shape`, named-first, the doctor row, #1166's three, the S1, N1, N2, S2 and NIT B rows, and the NUL row of that route | | M9 the doctor's `shape currency` call asks the field | 3 failed | the doctor row, the S2 row and the NIT B row | | M10 `ask_source` defaults to False | 19 failed | as M1 | rv1269b's own mutants (its `mutate2.py`), run on this head: | Mutant | Result | Killed by | |---|---|---| | Y1 `_named_here` takes `ENOENT` where it took `ENAMETOOLONG` | 4 failed | the four long-name rows | | Y2 `EACCES` taken as nothing there too | 2 failed | the `PermissionError` row and the NIT B row | | Y4 the not-a-repo remedy's last words changed | 12 failed | the rows that pin the remedy | | Y7 `_named_here` returns the candidate where nothing is there | 26 failed | the rows that read nothing-there as a path, in both routes | | Y5 `or not args.upstream` dropped from `prepare`'s condition | **survives: unreachable** (56 passed) | nothing: the only caller that passes `ask_source=False` passes `upstream=` too (rv1269's R2) | | Y6 `.resolve()` dropped from the path question | **survives: equivalent** (56 passed) | nothing: rv1269b read it as equivalent, since both stats of `_holds_a_repository` follow a link as `resolve()` does | Gates ran on the commit `52e5c1883` (dirty=0), with a stub `gh` first on PATH, `GH_TOKEN` bogus, an empty `GH_CONFIG_DIR`, a blank git identity, `GIT_SSH_COMMAND=false`, `GIT_CONFIG_GLOBAL=/dev/null`, Python 3.12.3 and git-filter-repo 2.47.0 (`git filter-repo --version` prints `a40bce548d2c`). A first writer ran gate A on 2.43.0 and was stopped for a workstation reboot in gate B; a second writer ran the rest, at the same head. - **git 2.43.0** (`/usr/bin/git`): - **Gate A**: the 20 `tests/test_update_shape*.py` files (this PR's new one among them), `tests/test_value_pattern_line_break.py`, the hygiene five (`test_path_guard_hygiene`, `test_repo_hygiene`, `test_agents_md_codes`, `test_cli_reference`, `test_pinned_copy_text`) and `test_no_auto_maintenance`: 1360 tests, one run. **1355 passed, 5 skipped** in 830.98s (the review round: 1352; this round adds the 3 rows). - **Gate B**, run because `shape-doctor.py` changed: `test_shape_doctor`, `test_doctor_unreadable_pin`, `test_doctor_next_is_a_command`, `test_doctor_partial_clone`, `test_doctor_pin_restore_merges`, `test_shape_pin_files_not_a_list`, `test_pin_source_env_collisions` and `test_bom_reads`: 827 tests, by node id in 10 runs of at most 90. **824 passed, 3 skipped** (1194s in all, summed over the runs; the review round: 824 passed, 3 skipped). - **git 2.47.1** (built from kernel.org's tarball, first on PATH, `git --version` printed into every log): - **Gate A**, in 16 runs of at most 90 ids each, so that no run held the slot for over 100 tests: **1355 passed, 5 skipped** (787s in all), the same count as on 2.43.0. - **Gate B**, in 10 runs of at most 90: **824 passed, 3 skipped** (1192s in all), the same count as on 2.43.0. - **The ids** of both gates were collected at this head (1360 and 827, identical to the first writer's lists, which were collected at the same head). - **The skips are the same on both gits:** 3 `test_update_shape_add_symlink.py:832` (junctions are NTFS's), 2 `test_no_auto_maintenance.py:222` (the session began with `GIT_CONFIG_GLOBAL` set) and 3 `test_shape_doctor.py:10516` (the PowerShell line is printed, and powershell.exe exists, only on a Windows host). The new NIT B row ran, as uid 1000; it skips only as root or on Windows. - **The review round's runs**, on `c792615f4`: gate A 1352 passed, 5 skipped (699s on 2.43.0) and gate B 824 passed, 3 skipped (1045s), by the writer; rv1269b re-ran both at `c792615f4` with the same counts on both gits. On 2.47.1 the writer's gate A ran as 17 runs under 100 tests. - **The first round's runs**, on `e1692c147` and `86c1e6ea2`: gate A 1339 passed, 5 skipped and gate B 824 passed, 3 skipped, on both gits. A first doctor run on 2.47.1, at `e1692c147`, had failed three rows of `test_doctor_unreadable_pin.py`: their stand-in for `prepare` took one argument and the doctor now passes `ask_source`. `86c1e6ea2` widens the stand-in. rv1269 re-ran both gates at `86c1e6ea2` with the same counts. - **The rows on main, the rows at `c792615f4` and the mutants** above ran on git 2.43.0. Run with `git merge-tree --write-tree <other> 52e5c18` (git 2.43.0) at 2026-11-09T14:14:11Z, at heads read fresh just before the push. All are clean (exit 0, no conflict line): - main `2fde6c3d0`: tree `35c270e2`. Main is 15 commits past this branch's base `be21751c3`. #1159, #1147 and #1172 have merged (#1172 at 2026-11-09T14:01Z as `2fde6c3d0`, which is main now), so they are no longer listed. #1172's change to `shape-doctor.py` lies well away from `refusals_ahead`, and its merge with this head is clean. - #1231 `aca00dfd9` (`update-shape.py`): `ba12a305`. - #1241 `ab137eb5f` (`update-shape.py`, `tests/test_update_shape_unreadable.py`): `052a989f`. - #1248 `1b747f7ab` (`shape-doctor.py`): `9c022d62`. - #1273 `0657e3964` (`tests/test_value_pattern_line_break.py`): `9da0792f`. - #1274 `e39b5d7e3` (`shape-doctor.py`): `a570550a`. Main, #1248 and #1274 touch `shape-doctor.py`. None of the added or removed lines of any of these heads, against its merge base with this head, in the seven files this PR touches (`update-shape.py`, `shape-doctor.py` and five test files) mentions `open_upstream`, `pin_path`, `prepare(`, `source_repository`, `WRITE_THE_PIN`, `REPOSITORY_RE`, `refusals_ahead`, `ask_source`, `pin_source`, `expanduser`, `ENAMETOOLONG` or this round's `_named_here`, `source_written_as` and `NUL_AFTER_TILDE` (read from `git diff` against each merge base). One name is shared: #1241 uses a `needs_a_mode` mark in `tests/test_update_shape_unreadable.py`, and this round's `needs_a_mode` is defined in `tests/test_update_shape_merged_away.py`, so each file has its own. The rows on the merged tree with current main are left to the landing gate. Lane 3 says the later lander takes the refresh. - **The doctor does not name a hand-edited `source_repository:` itself**, as on main: where the pin names the standard's commit, its row is `ok`. Naming it on the pin's side would mean teaching `pin_restore`, whose history walk reads pins with `check_pin`, the same question, and the path half of that question reads the working directory. That is a follow-up candidate, not this PR. - **The path question reads the working directory**, as `open_upstream` does for `--upstream`. So `scripts/repo_shape.py` is refused when run from the root, and taken as an `owner/repo` name when run from elsewhere. For any one directory, both routes give the same answer. - **A folder holding no repository at `opensoft/openRepoShape` where the command runs** (an unpacked archive, say) refuses the scaffolded pin with `--upstream` passed. On main only the run with no `--upstream` refused it. Measured by rv1269 and by this round's rows: the refusal is `update-upstream-not-a-repo` in the pin's name, in both routes, and its remedy now ends by saying to run it from a directory where nothing is at that path. That run answers as the scaffolded pin does (`--upstream` route: exit 1). - **The doctor's `shape currency` row, over a hand-edited source and merged-away copies,** still names `update-shape.py check` as its NEXT, and that `check` refuses in the pin's name (exit 2). The row answers as on main by design (the first bullet). The `pins` row, which states what `check` reports, asks the field since the review round. - **`--upstream ~<unknown user>/x` on the command line** is still a `RuntimeError` traceback out of `open_upstream` (measured in process), as on main, and an argv value whose first part is over 255 bytes is `update-unreadable` naming that path. Both name the value a person passed, not the pin. A follow-up candidate, not this PR. - **`REPOSITORY_RE` takes `.` and `..` as an owner**, so `../shape` is `owner/repo`-shaped. Unchanged. Review: rv1269, lane 5's independent opus reviewer, which wrote none of #1269: NOT READY at `86c1e6ea` on two SHOULDs (issuecomment-6725508050), both fixed in `c792615f`. Then rv1269b, lane 5's independent sonnet reviewer, which wrote none of it: READY at `c792615f` with NITs A-C (issuecomment-6726841735), fixed in `52e5c188`. Then rv1269c, lane 5's independent sonnet reviewer, which wrote none of it: READY at `52e5c188`, H0 of this landing (issuecomment-6745471925). CI (Brett Heap's ruling 27 and his fast-refresh ruling of 2026-10-15T22:48:35Z): H0 52e5c18 passed tests, tests-git-bash and SonarCloud; the head a31f0cf is a clean update-branch merge of main e22f295, with tests-git-bash and SonarCloud green; and the local gate passed on its predicted squash tree af35c58 over main e22f295: the doctor_unreadable_pin, update_shape_merged_away, update_shape_pin_source, update_shape_unreadable, value_pattern_line_break, adopt_execute_refusals, adopt_filter_repo_origin_url, adopt_one_byte_locale, adopt_pins, adopt_plan_and_remote_paths_spelled, adopt_plan_source_branch_shown, adopt_spelled_names, adopt_template_values, chain_link_fold, clone_url_bytes, family, non_utf8_name_helpers, pin_source_unreadable, pinned_copy_text, stdout_encoding, update_shape_apply_lines_and_headers, update_shape_header_comments, update_shape_messages, validate_pins_spelled_and_named, path_guard_hygiene, no_auto_maintenance, repo_hygiene, agents_md_codes, cli_reference sets, 1866 passed, 4 skipped. Landed on Brett Heap's word of 2026-10-23T13:10:26Z, relayed to every lane by lane 3 (#473 issuecomment-6365697123): "merge v1.2.1 PRs once reviewed and green". Closes #1203 Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ame the file as `shown_path` does, and validate-pins.py, family.py and shape-doctor.py read either spelling (#1168) (#1274) `repo_shape.load_yaml` names the file it refuses as `shown_path` names a path, in all three of its refusals (`yaml-unreadable` twice, `yaml-unparsable`), and so does `policy-unreadable` on the next line of `NamingPolicy.load`. A U+202E, an ESC or a line feed in a typed `--plan`, `--path-policy`, `--policy`, `--project` or `--root` path no longer reaches the terminal raw from any of the six tools that hand `load_yaml` such a path (eight runs: `adopt-project.py` reads two flags, `validate-repository-naming.py` two). A printable path prints byte for byte as on main. Every reader that finds the path at the start of a refusal's detail by its text keeps working, beside a `repo_shape.py` from before this change or after it. Probed at `51a9c5f10` with a stub `gh` first on PATH, `GH_TOKEN=bogus`, an empty `GH_CONFIG_DIR`, `GIT_SSH_COMMAND=false` and an empty global git config: a folder `pl<U+202E>an` holding a file that is not this reader's YAML (`a: 1` then `: b`). Each run exits 2 with one line, the U+202E in it raw: ``` REFUSED yaml-unparsable: <D>/pl<U+202E>an/<file>: line 2: empty keys are not supported ``` - `adopt-project.py check --plan` (and `execute --plan`, the same `Plan.load`); - `adopt-project.py plan --path-policy`; - `validate-repository-naming.py --policy` and `--project`; - `bump-leg.py --root` (`<root>/project.yaml`); - `family.py bump --family-root` (`<root>/family.yaml`); - `update-shape.py check --root` (`<root>/contracts/shape-pin.yaml`); - `validate-manifest.py --root`, as a root carries it. On this branch the same eight runs say `'<D>/pl\u202ean/<file>'`. The rows below hold all eight, with U+202E, an ESC and a line feed in turn, and a printable name. The readers that find the path in the detail by its text, on main: `validate-pins.py`'s `_load` tests `exc.detail.startswith(f"{path}: ")`; `family.py`'s `_read_member_project` swaps `str(manifest_path)` for `<repo> @ <commit>:project.yaml`; `repo_shape.link_declarations` swaps `str(path)` for `shown_path(path)`. Beyond the issue's list, a grep of every shipped `.py` for a detail read by its prefix found two more, both in `shape-doctor.py`: `naming_script_refusal` (`detail.startswith(f"{shape / NAMING_COPY}: ")`) and the `manifest-kinds` row (`exc.detail.removeprefix(f"{path}: ")`). Measured with only `repo_shape.py` changed: `validate-pins.py` named a root that is not printable by its whole spelled path in place of `project.yaml`; `family.py` named the deleted clone in place of the member when `TMPDIR` is not printable (probed with an ESC in the clone's folder); the doctor no longer knew its own policy's refusal, and its `manifest-kinds` row quoted the whole path again. Each is held below. - `scripts/repo_shape.py`, `load_yaml`: `named = shown_path(path)`, used at the three sites; `NamingPolicy.load`'s `policy-unreadable`: `shown_path(path)`. Same module, no new import. The words after the path are unchanged. - `templates/assembly-root/scripts/validate-pins.py`, `_load`: the prefix is looked for raw and as the gate's own `_shown` spells it (`_shown` is written in the gate, not imported, under the skew rule), and either is named relative to the root. - `scripts/family.py`, `_read_member_project`: the swap to `shown` takes the spelled path, then the raw one. - `shape-doctor.py`: `naming_script_refusal` asks both prefixes (`policy-wrong-kind` still names the policy raw); the `manifest-kinds` row takes the path off with a new `less_the_path`, in either spelling. - `repo_shape.link_declarations` is unchanged: its `replace(str(path), named)` finds nothing to swap in a spelled detail and the `why` reads as it did (a row says so). - `tests/test_load_yaml_refusals.py`: the rows below, added to the file that already holds `load_yaml`'s refusals (#192), not a new file. No refusal code, remediation or word after the path changes, and a printable path is named as before. `README.md`, `docs/cli.md`, the handbook and `AGENTS.md` hold none of `cannot be read (`, `not UTF-8 at byte`, `yaml-unparsable`, `yaml-unreadable` or `policy-unreadable`; the release notes of v1.0.0, v1.1.1 and v1.2.0 name the codes as the record of those releases, with printable paths, and stay as they are; the 46 files under `tests/` that hold them are all in the gates below. **`scripts/repo_shape.py` and `templates/assembly-root/scripts/validate-pins.py` are shape copies.** Every assembly root carries both, and every family holder carries `repo_shape.py`, so `update-shape.py check` shows each as `upstream-changed` in every project until `apply` re-copies it and re-pins, as #827 and #919 did. `family.py` and `shape-doctor.py` run from a checkout of the standard and are not copied. A root re-copies its pinned files one row at a time (`update-shape.py apply --accept-local` keeps a copy), so `validate-pins.py` and `repo_shape.py` may be of different ages. Rows, each a real run of the root's own gate over a root under a folder holding the character: | gate | library | the refusal names | row | |---|---|---|---| | this branch | this branch | `project.yaml` | `test_the_gate_names_the_file_from_the_root_beside_this_library` | | this branch | before #1168 (`51a9c5f10`, raw) | `project.yaml` | `test_the_gate_names_the_file_from_the_root_beside_an_older_library` | | before #1168 | this branch | the whole path, spelled, nothing raw | `test_an_older_gate_beside_this_library_names_the_whole_path_spelled` | | before #1168 | before #1168 | `project.yaml` | main | The third order is the one no change here can reach: that gate's own code asks the raw prefix alone. It still prints nothing raw, and it names `project.yaml` again once the gate is re-copied. A printable root is named `project.yaml` in all four. The two older copies are read with `git show 51a9c5f:...`, a skip where a checkout lacks that history (CI checks out with `fetch-depth: 0`), so `test_the_gates_load_takes_either_prefix` also holds both halves in process with no history. `family.py` and the doctor always import their own checkout's `repo_shape.py`, so they cannot meet another age; they read both spellings all the same, so no reader of the prefix depends on which library it meets, and their rows run beside each. `adopt-project.py` spells the paths it prints itself with its own `_shown` (backticks, #1115, and #1152's PR #1177 for `--plan`), and `load_yaml` now spells with `shown_path` (`repr`, quotes). Measured, for one plan path: | path holds | `adopt-project.py` `_shown` | `shown_path` | |---|---|---| | U+202E | `` `/d/pl\u202ean/plan.yaml` `` | `'/d/pl\u202ean/plan.yaml'` | | ESC | `` `/d/x\x1b[31m/plan.yaml` `` | `'/d/x\x1b[31m/plan.yaml'` | | a line feed | `` `/d/a\nb/plan.yaml` `` | `'/d/a\nb/plan.yaml'` | | a byte that is not UTF-8 | `` `/d/caf\udce9/plan.yaml` `` | `'/d/caf\udce9/plan.yaml'` | | a quote and an ESC | `` `/d/it's\x1b/plan.yaml` `` | `"/d/it's\x1b/plan.yaml"` | | a trailing space | `` `/d/trail /plan.yaml ` `` | `/d/trail /plan.yaml ` | | nothing unusual | `/d/plain/plan.yaml` | `/d/plain/plan.yaml` | **Decision: `shown_path` in `load_yaml`, and the two styles stand.** The escapes are the same; only the delimiters differ, and `_shown`'s extra cases (a trailing space, backticks at both ends) are printable, so neither is a hole. A run never shows both for the plan: `check` and `execute` over an unparsable plan each print exactly one line, the `load_yaml` refusal, and stop (measured). `shown_path` is what the other five tools print for the same refusal, and what the three pinned validators' own `_shown` print (`test_the_pinned_scripts_spell_a_path_as_the_library_does` holds them equal). One spelling for `adopt-project.py` too would mean a spelling parameter on a function in a shape copy, or re-raising at `Plan.load` and `PathPolicy.load`, in a file #1177 is changing next to those lines and 20 other open PRs touch, for a difference of quote marks. 112 rows in `tests/test_load_yaml_refusals.py`: 101 new, and the 11 that were there (#192). Run on main's code: this branch's rows in the detached tree at `51a9c5f10`, with main's version of each changed file swapped in, each put back with a sha256 check (measured on the 109 rows at `e39b5d7e3`, and again on all 112 at `136b38d12`: the table is the second run, and the three rows the review round added are the only change). | rows | on main's 4 files | main's `repo_shape.py` only | main's `validate-pins.py` only | main's `family.py` only | main's `shape-doctor.py` only | |---|---|---|---|---|---| | each refusal, U+202E / ESC / line feed x absent / not UTF-8 / unparsable (9) | 9 fail | 9 fail | pass | pass | pass | | `policy-unreadable`, 3 names (3) | 3 fail | 3 fail | pass | pass | pass | | each of the 8 tools x 3 names (24) | 24 fail | 24 fail | pass | pass | pass | | older gate beside this library, 3 names (3) | 3 fail | 3 fail | pass | pass | pass | | gate beside this library, 3 names, real run (3) and in process (3) | pass | pass | 6 fail | pass | pass | | family member manifest beside this library, 3 names (3) | pass | pass | pass | 3 fail | pass | | doctor's own policy in the naming script's output, 3 names x 2 refusals (6) | 2 fail (line feed) | 2 fail (line feed) | pass | pass | 6 fail | | doctor's `manifest-kinds` row beside this library, 3 names (3) | pass | pass | pass | pass | 3 fail | | a path typed relative, `adopt-project.py check --plan`, 3 names (3) | 3 fail | 3 fail | pass | pass | pass | | total failing of 112 | 44 | 44 | 6 | 3 | 9 | 60 of the 101 new rows fail on main's code: the 44 above with main's four files, and 16 more that read the path back (the gate 6, `family.py` 3, the doctor 4 + 3) with main's reader beside this branch's library, the skew this change would otherwise open. The other 41 new rows pass in every column, as do the 11 that were there. They are the controls the brief asks for: a printable path in each refusal (3), in `policy-unreadable` (1) and through each tool (8), which prints byte for byte as on main; the four readers beside a library older than #1168 (gate real run 4, gate in process 4, `family.py` 4, `manifest-kinds` 4) and beside this one for a printable path (6); `link_declarations` (4), which reads as it did; and the doctor finding `policy-wrong-kind` raw (3). Mutants M5, M8, M10, M12, M13 and M14 each fail some of them; the `link_declarations` rows guard only that its `why` did not move, which nothing in this change can move (M16). The doctor's two line-feed rows fail on main's four files too: a raw line feed splits the naming script's line before the doctor reads it. Each applied alone in the detached tree, the 109 rows of `e39b5d7e3` run, the file put back and its sha256 checked against the branch's (all 17 matched). 15 killed, 2 survived. The review round adds M18 and M19, both killed by its three new rows (below). | mutant | killed by | |---|---| | M1 `cannot be read` back to `{path}` | the in-process `absent` rows (3) | | M2 `not UTF-8 at byte` back to `{path}` | the in-process `not-utf-8` rows (3) | | M3 `yaml-unparsable` back to `{path}` | 31 rows: the in-process `unparsable` rows (3), the 24 tool rows that are not printable, the older gate's (3) and the doctor's line-feed `load-yaml` row | | M4 `policy-unreadable` back to `{path}` | the three `policy-unreadable` rows, and the doctor's line-feed row | | M5 `validate-pins.py`: the raw half of the prefix test dropped | gate beside an older library (3), `_load` with an older library (3) | | M6 `validate-pins.py`: the spelled half dropped | gate beside this library (3), `_load` with this library (3) | | M7 `family.py`: the spelled swap dropped | family with this library (3) | | M8 `family.py`: the raw swap dropped | family with an older library (3) | | M9 doctor `naming_script_refusal`: the spelled prefix dropped | its `load-yaml` and `not-a-mapping` rows that are not printable (6) | | M10 doctor `naming_script_refusal`: the raw prefix dropped | `policy-wrong-kind` named raw, U+202E and ESC (2) | | M11 `less_the_path`: the spelled prefix dropped | `manifest-kinds` with this library (3) | | M12 `less_the_path`: the raw prefix dropped | `manifest-kinds` with an older library (3) | | M13 `load_yaml`'s `named` always `repr`, a printable path too | 24 rows: the printable rows of each refusal (3) and each tool (8), the four #192 rows that assert `str(refusal).startswith(f"REFUSED yaml-unreadable: {path}")`, and printable rows of the readers | | M14 `policy-unreadable` always `repr` | its printable row and the doctor's printable `not-a-mapping` row (2) | | M15 `validate-pins.py`'s spelled half as `repr(str(path))` in place of `_shown(str(path))` | **survived, equivalent**: for a path that is not printable the two are the same text, and a printable one is caught by the raw half first | | M16 `link_declarations`' `replace(str(path), named)` removed | **survived, equivalent**: the detail already holds `shown_path`'s spelling, so the swap finds nothing to swap; the row `test_a_link_manifest_is_named_in_why_as_it_was` is there to say the output did not move | | M17 `less_the_path` returns the detail whole | `manifest-kinds`, both libraries (6) and its printable rows (2) | | M18 `load_yaml`'s `named` from `Path(path).absolute()` (rv1274's X5, which survived the 109 rows) | the relative-path rows (3), and no other of the 112 | | M19 the same from `Path(path).resolve()` | the same 3 | Every run through the lane's runner: a stub `gh` first on PATH (and the suite's own `gh` guard ahead of it), `GH_TOKEN=bogus`, an empty `GH_CONFIG_DIR`, `GIT_SSH_COMMAND=false`, `GIT_CONFIG_GLOBAL=/dev/null`, a blank git identity, git-filter-repo 2.47.0 (CI's pin; `--version` says `a40bce548d2c`) on PATH, Python 3.12.3 (CI runs 3.14; no row asserts text that depends on the version). The gate list, 53 files, 4591 tests: the new rows; the hygiene five (`test_path_guard_hygiene`, `test_repo_hygiene`, `test_agents_md_codes`, `test_cli_reference`, `test_pinned_copy_text`) and `test_no_auto_maintenance`; the 46 files under `tests/` that hold `cannot be read (`, `not UTF-8 at byte`, `yaml-unparsable` or `yaml-unreadable`; every `validate-pins` file (`test_pin_validator`, `test_validate_pins_lockstep_lines`, `test_validate_pins_without_git` beside those the grep found); and for the doctor and `family.py` readers, `test_shape_doctor`, `test_doctor_validator_verdicts`, `test_naming_policy`, `test_family_py_unreadable` and `test_validate_family_unreadable`. One run of more than 100 tests at a time. | run | git | head | result | |---|---|---|---| | the gate list | 2.43.0 | `0e5f95db5` | 4579 passed, 12 skipped, 0 failed (40:38) | | the gate list | 2.47.1 | `e39b5d7e3` | 4586 passed, 5 skipped, 0 failed (46:43) | | the new rows, the hygiene five, `test_no_auto_maintenance` | 2.43.0 | `e39b5d7e3` | 546 passed, 2 skipped, 0 failed | | `tests/test_load_yaml_refusals.py` | 2.43.0 | the change before the commit | 109 passed | | the same, on main's code (5 swaps) and under 17 mutants | 2.43.0 | `51a9c5f10` + this change | as in the tables above | | `tests/test_load_yaml_refusals.py` (112), the hygiene five and `test_no_auto_maintenance` (439), 14 runs of at most 100 | 2.43.0 | `136b38d12` | 549 passed, 2 skipped, 0 failed | | the same | 2.47.1 | `136b38d12` | 549 passed, 2 skipped, 0 failed | `e39b5d7e3` differs from `0e5f95db5` by one comment in `tests/test_load_yaml_refusals.py` (the commit was amended before it was pushed), so the 2.43.0 gate list stands for it, with the small run above on the final head. The 12 skips on 2.43.0: the reftable backend needs git 2.45 (7), the session's `GIT_CONFIG_GLOBAL` (2), a PowerShell line printed only on Windows (3). On 2.47.1, 5: the last two kinds. `136b38d12` (the review round) changes `tests/test_load_yaml_refusals.py` alone: three rows added and one row's setup moved out of a `pytest.raises` block. The gate list at `136b38d12` is 4594 tests; its other 52 files are not run again, and the new file, the hygiene five and `test_no_auto_maintenance` are, on both gits (the two rows added to the table above). Their 2 skips, on both gits: `test_no_auto_maintenance.py:222`, the session began with `GIT_CONFIG_GLOBAL` set. `git merge-tree --write-tree` (git 2.47.1) of the head `136b38d12` with main and with the head of each open PR on a file this changes, main fetched and heads read with `gh pr list` at about 16:20Z on 2026-11-09. The table of 2026-11-08, at `e39b5d7e3`, differs in three rows: #1172 was open, #1269 was at `c792615f4`, and #1164 (at `74096eb47`) conflicted in `tests/test_path_guard_hygiene.py`, which this does not touch, and is clean at its new head. | with | head | result | |---|---|---| | main | `ebb87168a` | clean. Main moved since `51a9c5f10`: in `scripts/family.py` (#1117's remedies, not `_read_member_project`) and, since the last table, in `shape-doctor.py` (the `members` row), `bootstrap.py`, `validate-family.py`, `siblings.py`, `adopt-project.py` and `tests/conftest.py`; a grep of its production changes since `8e6f53268` finds no new reader of a `load_yaml` detail. The predicted merge, checked out alone, passes the 112 rows, `test_pinned_copy_text`, `test_family_py_unreadable`, `test_validate_family_unreadable`, main's touched `family.py` tests (`test_family_add_member_id`, `test_family_bump_to_checks`, `test_remove_add_remedies_family_root`) and `test_adopt_plan_source_branch_shown`: 411 passed on git 2.43.0 | | #1266 (`scripts/repo_shape.py`) | `09697e9c5` | clean | | #1171 (`scripts/repo_shape.py`, `adopt-project.py`) | `8162b874e` | clean; it leaves `shown_path` as it is | | #1249 (`scripts/repo_shape.py`) | `3146c3ca5` | clean | | #1177 (`--plan`'s `_shown`) | `5208e874e` | clean | | #1263, #1248, #1239 (`validate-pins.py`; #1248 also `shape-doctor.py`) | `9ef8f0ab5`, `1b747f7ab`, `fff421456` | clean | | #1269 (`shape-doctor.py`) | `52e5c1883` | clean | | #1201, #1164 (`scripts/family.py`) | `24b6a0af6`, `16ff93917` | clean | | #1264 (`scripts/family.py`) | `43d2e8b26` | `docs/handbook.html` conflicts, which this does not touch; against main alone it conflicts there and in five more files (`scripts/family.py` and four tests), the same six with this change merged in, and the five conflict blocks of `family.py` are identical with and without it | #1172 was open in the last table and has merged since: its change is in the main row. Two independent reviews of `e39b5d7e3` (rv1274, then rv1274b, which continued it after a reboot) found no MUST and called the PR READY. What each point of theirs came to, in `136b38d12` (tests only; no production file changed): - **SHOULD, the refusals #1168 names and this PR leaves raw:** filed as #1279. It lists eight "unreadable" and "not a mapping" refusals that still name the path as typed, measured at `e39b5d7e3` with their sites, and two sites not probed; the Limits below name the same family. Nothing in this change touches those lines. - **NIT 1, the dead raw halves:** kept. `family.py` and `shape-doctor.py` import their own checkout's `repo_shape.py`, so the raw swap in `_read_member_project` and the raw prefix in `less_the_path` run only when a row swaps in an older library in process. They are harmless, they make each reader independent of which library it meets (the version mix above), and the doctor's raw prefix in `naming_script_refusal` is live, since `policy-wrong-kind` still names the policy raw. - **NIT 2, no row typed a relative path:** done. rv1274's mutant X5 (`load_yaml` naming `Path(path).absolute()`) survived the 109 rows, since every tool row types a path under `tmp_path`, which is absolute. `test_a_path_typed_relative_is_named_as_typed_and_spelled` (3 rows: U+202E, ESC, a line feed) runs `adopt-project.py check --plan` with the path typed relative to the working directory and holds the refusal to the path as typed, relative and spelled. On main's `repo_shape.py` all 3 fail; X5 and its `.resolve()` twin each fail exactly those 3 of the 112 rows; every restore matched its sha256 (git 2.43.0). The tools handed a file keep the path as typed (`adopt-project.py check --plan` and `plan --path-policy`, `validate-repository-naming.py --policy` and `--project`, measured); the four handed a root (`bump-leg.py`, `family.py bump`, `update-shape.py`, `validate-manifest.py`) make it absolute before `load_yaml` sees it, so one tool of the first kind is the row. - **NIT 3, Sonar python:S5778:** done. `unparsable(root / "project.yaml")` ran inside the `pytest.raises` block of `test_the_gates_load_takes_either_prefix`, beside `gate._load`. The file is made first, so only `gate._load` runs inside the block; the row's 8 ids and their verdicts are the same. - **NIT 4, stale counts:** done. The open PRs touching `adopt-project.py` (20 others than #1177, as of 16:20Z), the merges table (main `ebb87168a`, every head read fresh), and the counts of rows and mutants above (112 rows, 101 new, 44 failing on main's four files; M18 and M19 added). They also checked, and asked nothing of this change: no reader of a `load_yaml` detail is left outside the five it changes, the gate's `_shown` equals `shown_path`, and neither shape copy's digest is stored anywhere in the tree. - **An older `validate-pins.py` beside this `repo_shape.py`** names a root that is not printable by its whole spelled path, not `project.yaml`, until the gate is re-copied (the version-mix table). Nothing raw. - **`policy-wrong-kind`**, the line after `policy-unreadable` in `NamingPolicy.load`, still names the policy raw: the brief kept the scope to the three `load_yaml` refusals and `policy-unreadable`. It is the same one-line change, and the doctor already reads either spelling. - **The "not a mapping" lines in other files** still name the path raw: `plan-unreadable` (`adopt-project.py`, which #1177 spells), `path-policy-unreadable` and `path-policy-wrong-kind` (`scripts/path_classify.py`), `bump-leg-manifest-unreadable` (`bump-leg.py`), `manifest-unreadable` (`validate-repository-naming.py`, which #1267 and #1236 are changing), `manifest-missing` and `manifest-unreadable` (`validate-manifest.py`), `update-pin-unreadable` (`update-shape.py`) and the doctor's own `policy-raised`. Follow-up candidates. - **Not probed:** the two `bootstrap.py`, `siblings.py`, `validate-family.py` and `shape_advisory.py`. By reading, each hands `load_yaml` `<root>/<one set name>`; where it does not swallow the refusal (two of `siblings.py`'s three do), it prints the detail whole (`bootstrap.py` through `spelled`, which leaves a spelled path as it is), so each now says the spelled path. - `link_declarations`' swap now finds nothing to swap. It is left in place: removing it is a further change to a shape copy for no change in output (mutant M16). Review: rv1274 and rv1274b, lane 5's independent opus reviewers, which wrote none of #1274 (rv1274 stopped for the reboot of 2026-11-08 with no MUST; rv1274b finished its review): READY at `e39b5d7e` with no MUST (issuecomment-6742338962); its SHOULD is the follow-up #1279, and its NITs 2-4 are fixed in `136b38d1`. Then rv1274c, lane 5's independent sonnet reviewer, which wrote none of it: READY at `136b38d1`, H0 of this landing, with no finding (issuecomment-6745586545). CI (Brett Heap's ruling 27 and his fast-refresh ruling of 2026-10-15T22:48:35Z): H0 136b38d passed tests, tests-git-bash and SonarCloud; the head 52a140c is a clean update-branch merge of main 150e401, with tests-git-bash and SonarCloud green; and the local gate passed on its predicted squash tree 2fb87fe over main 150e401: the load_yaml_refusals, adopt_check_throwaway_repos, adopt_e2e, adopt_execute_refusals, adopt_make_bootstrap_followups, adopt_make_reads_first, adopt_pins, adopt_plan_source_branch_shown, adopt_template_values, adopt_tracking_branch, bump_leg_branch_and_push_line, chain_link_fold, doctor_unreadable_paths, doctor_unreadable_pin, family, family_dry_run, path_guard_hygiene, pin_source_unreadable, pinned_root_git_unreadable, root_git_unreadable, stdout_encoding, update_shape_apply_lines_and_headers, update_shape_header_comments, update_shape_merged_away, update_shape_unreadable, validate_family_unreadable, validate_pins_spelled_and_named, pinned_copy_text, no_auto_maintenance, repo_hygiene, agents_md_codes, cli_reference sets, 2432 passed, 6 skipped. Landed on Brett Heap's word of 2026-10-23T13:10:26Z, relayed to every lane by lane 3 (#473 issuecomment-6365697123): "merge v1.2.1 PRs once reviewed and green". Closes #1168 Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…annot open, under `.git/modules/<path>` or in a `.git` directory, is refused `member-unreadable` by name, where it ended `member-commit-unresolvable` with a fetch (#1256) (#1263) `templates/family-root/scripts/validate-family.py`'s `_refuse_an_unreadable_git_dir` asked the `HEAD` of a member's git directory only by `stat` (#1221, copied from the leg gate's #968). A `stat` of a file at mode 000 works while its directory can be searched, so a `HEAD` at 000 passed, and `git rev-parse`, which could not read it, ended the run in `member-commit-unresolvable`, "the pinned commit ... is not in that member's object store", with a `git fetch` that cannot help. It did so for an absorbed member (`.git/modules/members/IRRS/HEAD`, `fatal: not a git repository`) and for a checkout's own `.git` directory (`members/IRRS/.git/HEAD`). After that `stat`, a `HEAD` that is there is now opened by `_gitfile_opens`, as #1239 opens a leg's: only where it is a regular file, since the open of a FIFO waits for a writer; an open that finds nothing (`_ABSENT_ERRNOS`) is a git directory with no `HEAD`, which is git's to answer for; and a refused open is `member-unreadable`, `<HEAD>: cannot be read (<reason>)`, exit 2, naming the file with the member checkout's remedy (`_unreadable`) and the advice for the cause. The file is named as #1246 names the git directory, relative to the holder and in POSIX spelling, `.git/modules/<path>/HEAD` for an absorbed member and `<path>/.git/HEAD` for a checkout's own `.git` directory, and whole (`str(found / "HEAD")`) where the git directory is outside the holder, a linked worktree's, so that a Windows path keeps one separator. Unchanged: a refused `stat` of `HEAD` still names the git directory; a git directory with no `HEAD`, a gitfile that names no directory and a `gitdir:` line holding a NUL are still left to git. `_gitfile_opens` and `_member_git_dir` stay word for word with `validate-pins.py`'s `_gitfile_opens` and `_leg_git_dir` (compared by `ast.unparse`, docstrings dropped). `_refuse_an_unreadable_git_dir` is not a copy, as in #1246, since it names the part relative to the holder, but its `HEAD` block is the gate's, with the family's `_is_a(head, _any_kind)` where the gate has `_is_there(head)`. Holders see an `upstream-changed` row for `scripts/validate-family.py`. Not changed: a `HEAD` that is a FIFO, which still hangs the run in git's own open (`git rev-parse` opens it, this check does not, and the leg gate is the same after #1239); `objects/` or `config` at 000 in a member's git directory, which still say `member-commit-unresolvable` with a fetch remedy, as the leg gate's do, since only `HEAD` is asked; and the holder's own `HEAD`, which is #1172's area. The doctor's `members` row for this case is #1248's. `tests/test_validate_family_unreadable.py` gains 8 functions and 18 rows (102 in the file): the issue's two shapes at mode 000, each passing again with the mode back (skipped as root and on Windows), a linked worktree's `HEAD` named whole, in-process stand-ins with the open refused for permission and for an I/O error, `_check_member_tree` asked alone, an open that finds nothing, a parity row that holds the family gate's line to the leg gate's for the same `HEAD`, a directory and a FIFO `HEAD` that are never opened, and the NUL line. At the bytes before this change 12 of the 18 fail and 6 pass, the 6 being controls. With `tests/test_family.py` and `tests/test_validate_family_typed_states.py` in one pytest, since the new module imports `family` from `test_family`, it gave 257 passed at the reviewed head `9ef8f0ab` (258 at the restacked head, with a row main added to `test_family.py`); there the hygiene guards gave 356 passed, 2 skipped, and the template-text files 421 passed. All 3 mutants run (the open dropped, `HEAD` named before its `stat`, the regular-file guard dropped) are killed. Closes #1256 Lane: openreposhape-3 (openRepoShape-3) Co-Authored-By: Claude Opus 5.5 <[email protected]>



What changed
A v1.2.1 follow-up from lane 3's independent reviews (#1222). It lands under Brett Heap's v1.2.1 merge word (2026-10-23T13:10:26Z) once reviewed and green.
It completes #1222 after #1239, the gate half. This branch MERGES #1239's head
fff42145with a merge commit (bfbeed4a, onto main50869f38, where #1200 landed), so its tree holds the gate it mirrors, and then merges main three times, each time without conflict:bd3e9c14(bd68c0cf), which brings #1109's change toshape-doctor.py;b1f45fa7(2dd144f5), which brings #1144's change toshape-doctor.pyandscripts/shape_advisory.py; and81eaf757(2fe16fb1), which brings #1147 (51a9c5f1):root_git_read,_refuse_an_unreadable_rootandtests/test_root_git_unreadable.py. It carries #1239's commits until #1239 lands: until then its diff also showstemplates/assembly-root/scripts/validate-pins.pyandtests/test_validate_pins_spelled_and_named.py. Lane 3 lands #1239 first, then refreshes this branch. The doctor half is three commits,shape-doctor.py(+71 -9),tests/test_doctor_unreadable_paths.py(+372 -32) andtests/test_root_git_unreadable.py(+124 -3) against main:930373c9:regular_file_opens, the open ofHEADinmount_read, and the rows below;69b96f48: the parity row asserts the doctor's(populated, own_git)before it unpacks the refusal, so at main it fails on the answer, not as a TypeError; and the directory and FIFOHEADrows usemade_directory,made_fifoandPOSIX_NODESfromtests/test_validate_pins_spelled_and_named.py, in place of local copies;1b747f7a: the refresh round, rv1248's S1, N3 and N4:root_git_readopens the root's own.git/HEADas the gate does. See "Refresh round" below.The "Measured", "Tests" and "Mutants" sections are the first round's, at
2dd144f5. This round's are under "Refresh round".The defect.
mount_read, the one question thelegs,leg shape files,placementandmembersrows share, asked a mount's git directory'sHEADbystatalone (#1174). AHEADat mode 000 stats, so git, run in the mount, could not read it:spec: populated, but git cannot read a HEAD in it, with the lockstep gate as the NEXT, andplacementsaidspec: it is not a git repository;.git-directory leg: git passed over the leg's.gitto the ROOT's repository, so thelegsrow quoted the root's HEAD as the leg's,spec: checked out at <root HEAD>, pinned at <pin>, with asubmodule update --checkoutover it, andplacementsaidgitanswers from the root;members/IRRS: checked out at ?, pinned at <pin>;HEADthis user cannot open, under.git/modules/<leg>or in a.gitdirectory, is refusedpin-submodule-unreadableby name, where it endedpin-commit-unresolvable(#1222) #1239) refusespin-submodule-unreadable.The change.
regular_file_opens(path)is the doctor's copy of the gate's_gitfile_opens, asgit_dir_ofis its copy of_leg_git_dir(shape-doctor.py: a leg whose git directory this user cannot read (.git/modules/specat mode 000) is counted as off its pin, so the verdict is DRIFTED for a leg at its pin, andplacementcalls it not a git repository #1174). It openspathonly where it is a regular file, since the open of a FIFO waits for a writer. An open that finds nothing (refused_readis None:ABSENT_ERRNOS,ABSENT_WINERRORS) answers False. A refused open is raised. Anything that is no regular file answers True and is not opened.mount_read, aftergit_dir_of, aHEADthat is there (is_a, thestatit asked before) is named as the gate names it (git_dir_named) and opened withregular_file_opens. A refused open is the mount'smount_cannot_be_readline,spec: .git/modules/spec/HEAD: cannot be read (Permission denied)orspec/.git/HEAD: cannot be read (Permission denied).own_gitis then False, sohead_ofnever runs in the mount, and the rows do what shape-doctor.py and shape_advisory.py: a path in the root this user cannot reach is named on every Python, never read as absent or stood in for by the template, a root it cannot search is refused first, and a row that could not ask is never DRIFTED #975 and shape-doctor.py: a leg whose git directory this user cannot read (.git/modules/specat mode 000) is counted as off its pin, so the verdict is DRIFTED for a leg at its pin, andplacementcalls it not a git repository #1174 made them do: this doctor again as the NEXT, the gate's advice as the WHY, no drift, and the verdict is thepinsrow's INVALID (thefamilyrow's for a holder).statofHEADstill names the git directory (spec: .git/modules/spec,spec/.git); a git directory with noHEAD, a gitfile that names none, and aHEADthat is no regular file are left to git as before;git_dir=False(leg shape files) asks nothing of the git directory, so that row still compares the leg's files.Decided here.
is_a-family helper (EveryPath.is_file()/is_dir()/exists()guard in the shipped tools answers False to any OSError on Python 3.14 (3.12 and 3.13 raise PermissionError), so a directory this user cannot search reads as ABSENT: validate-pins.py skips its workflow@<sha>check, update-shape.py sayscopy-missingandupdate-pin-missing("adopt the project") for files that are there, the doctor says DRIFTED (5 copy-missing), and bump-leg.py's remaining guards, and every other tool's, skip or misreport instead of refusing by name #430's rule,tests/test_path_guard_hygiene.py). The parity row below holds the two to one answer.regular_file_openssays what it asks of any file; the gate's_gitfile_openskeeps its name, as validate-pins.py: a leg git directory'sHEADthis user cannot open, under.git/modules/<leg>or in a.gitdirectory, is refusedpin-submodule-unreadableby name, where it endedpin-commit-unresolvable(#1222) #1239 decided.is_aofHEAD, as the gate'sif _is_there(head): named = named / "HEAD"does, so a refusedstatstill names the directory (mutant m5).Measured
A probe scaffolds a real assembly root, and a family holder, from the tree under test, sets the
HEAD, and runsshape-doctor.py --jsonand the root's ownscripts/validate-pins.py, each bounded at 60 s. "Main" is50869f38;mount_readand the helpers it calls are byte-identical atbd3e9c14and atb1f45fa7(refused_readthrough the end ofmount_read: 8673 bytes, sha256693721576ad5ec3d...at all three). "Here" is this head,2dd144f5; the probe gave the same rows at69b96f48, commits and paths aside. Main's gate has no #1239..git/modules/spec/HEADat 000.legs:spec: populated, but git cannot read a HEAD in it, with the lockstep gate as the NEXT;placement:spec: it is not a git repository; the gate:pin-commit-unresolvable.legs:spec: .git/modules/spec/HEAD: cannot be read (Permission denied), so no HEAD in it is compared with the pin, with this doctor again as the NEXT;placementsays the same line; the gate:REFUSED pin-submodule-unreadable: .git/modules/spec/HEAD: cannot be read (Permission denied)..git-directory leg,spec/.git/HEADat 000.legs:spec: checked out at bb2ce64e53b0, pinned at 5434824945fd, the ROOT's HEAD, withgit -C <root> submodule update --init --recursive --checkout -- specas the NEXT;placement:spec: it is not a repository of its own -- `git` answers from <root>; the gate:pin-commit-unresolvable.legsandplacement:spec/.git/HEAD: cannot be read (Permission denied); the gate:REFUSED pin-submodule-unreadable: spec/.git/HEAD: cannot be read (Permission denied)..git/modules/members/IRRS/HEADat 000.members/IRRS: checked out at ?, pinned at f9ec4e17a5db.members/IRRS: .git/modules/members/IRRS/HEAD: cannot be read (Permission denied), so no HEAD in it is compared with the pin, with this doctor again as the NEXT.HEAD: COMPLIANT, and the gate passes.HEAD: git's answer, DRIFTED withspec: populated, but git cannot read a HEAD in it, and the gate'spin-commit-unresolvable.HEAD, on both layouts: the doctor and the gate each HUNG past 60 s. Herepsshows the gate'sgit rev-parseinwait_for_partner, git's own open of the FIFO, and the doctor's python inpoll_schedule_timeout, not in an open of its own.Tests
tests/test_doctor_unreadable_paths.pygains 24 rows:HEADcells at mode 000 inGIT_DIR_CELLS, and a member'sHEADat 000;.gitdirectory, and a member;HEAD, left to git;HEADshapes on both leg layouts, 16 rows.One pytest at a time on Python 3.12.3, at this head
2dd144f5, with-rs, under a stubgh(exit 97) first on PATH, thengit-filter-repo==2.47.0(CI's pin) from a venv of its own,GH_TOKEN=bogus, an emptyGH_CONFIG_DIR,GIT_SSH_COMMAND=falseandGIT_CONFIG_GLOBAL=/dev/null:tests/test_doctor_unreadable_paths.pywithtests/test_validate_pins_spelled_and_named.py, in one pytest, since the first imports from the second:208 passed in 68.01s.tests/test_doctor_unreadable_paths.pywithtests/test_doctor_unreadable_pin.py, whosesourcesfixture it imports, andtests/test_doctor_plan_overrides.py, shape-doctor.py: a gitlink beside a.gitmodulesthe leg's index tracks and this disk lacks is named from the index's copy, which git reads, with its own way out that restores the file first (git restore .gitmodules), as #1080 names one beside other sections (#1093) #1109's:215 passed in 178.91s, its twogit filter-reporows among them.test_repo_hygiene,test_path_guard_hygiene,test_no_auto_maintenance,test_agents_md_codes,test_cli_reference,test_update_add_codes_documented,test_readme_windows_quoting_sentenceandtest_doctor_next_is_a_command:461 passed, 2 skipped in 176.18s. Both skips aretest_no_auto_maintenance.py:222, "the session began with GIT_CONFIG_GLOBAL set", from theGIT_CONFIG_GLOBAL=/dev/nullthese runs set.tests/test_shape_doctor.pywithtests/test_doctor_unreadable_paths.pyand shape-doctor.py and shape_advisory.py: a.gitor an agent file linked into a folder this user cannot search is said once inwhat is hereoragent files,<name>: cannot be read (<reason>), never absent; a.gitoffers no way in (#1110) #1144'stests/test_doctor_unsearchable_links.py, which import its fixtures, in one pytest:563 passed, 3 skipped in 770.90s, itsgit filter-reporows among them. All three skips aretest_shape_doctor.py:10516, "the PowerShell line is printed, and powershell.exe exists, only on a Windows host".Mutants
Each mutant is applied to
shape-doctor.py, run against the #1222 rows oftests/test_doctor_unreadable_paths.py(-k "head or git_directory or left_to_git or git_dir", 52 rows), then restored and checked withcmp(clean each time). They were run at930373c9. The two merges of main left the code they touch byte-identical:refused_readthrough the end ofmount_readis 10349 bytes with sha2567a91fa445d7a7264...at930373c9, at69b96f48and at this head2dd144f5. So they were not run again.shape-doctor.pyswapped in: 13 failed, 39 passed. The 13 are exactly the new refusal rows; the controls pass.HEAD: 13 failed. KILLED.HEADopened whatever it is, with noregular_file_opens: 6 failed. KILLED.is_aguard before the name and the open: 11 failed. KILLED.Refresh round (rv1248's S1, N3, N4)
This round is where
root_git_readgets the open. #1147 landed on main as51a9c5f1, so main hasroot_git_read, which asked the root's own.git/HEADbystatalone. rv1248 (#1248 issuecomment-6723136323) found2dd144f5READY with no MUST, and said its S1 becomes a MUST at this refresh. This round merges main81eaf757(merge commit2fe16fb1, tree918ac27d, the tree merge-tree predicted) and adds one commit,1b747f7a:root_git_read, once thestatof the root'sHEADfinds it,HEADis named and opened throughregular_file_opens, only where it is a regular file. This is what the gate's_refuse_an_unreadable_rootasks through_refuse_an_unreadable_git_dirwith validate-pins.py: a leg git directory'sHEADthis user cannot open, under.git/modules/<leg>or in a.gitdirectory, is refusedpin-submodule-unreadableby name, where it endedpin-commit-unresolvable(#1222) #1239's open..git/HEAD: cannot be read (<reason>). Thelegsrow then says no gitlink is read and no leg is compared with its pin, and the verdict isINVALID (pins).statstill names the git directory. An absentHEAD, one gone at the open, a directory and a FIFO are left to git as before.namednow starts from the root's.gitpath, not a barePath(".git"), so.git/HEADis spelled relative to the root, in POSIX, on every platform, as the gate's_namedspells it. A bare relative path would print.git\HEADon Windows.regular_file_openskeeps its False/True answer. Its docstring now says that its two callers (mount_read,root_git_read) ask it only for its raise, and that the answer is kept because it is the gate's_gitfile_opens, whose answer the gate reads of a leg's gitfile (initialized, validate-pins.py and repo_shape.py:--rootand gh's stderr are printed raw, a non-file in a pin's place is called absent, and a leg's.gitgitfile at mode 000 passes #919). A new row holds the two to one answer for each shape, so rv1248's m11 is no longer an equivalent mutant (m5 below).HEADthat is a symbolic link to a file at mode 000. A new row asks validate-pins.py: a leg git directory'sHEADthis user cannot open, under.git/modules/<leg>or in a.gitdirectory, is refusedpin-submodule-unreadableby name, where it endedpin-commit-unresolvable(#1222) #1239's NULgitdir:line of both parity pairs, a leg's gitfile and the root's.Measured. A probe scaffolds a real assembly root from the tree under test, sets the root's
.git/HEAD, and runsshape-doctor.py --root <root> --jsonand the root's ownscripts/validate-pins.py, each bounded at 60 s, as uid 1000 with real modes. "Before" is the merge2fe16fb1; "after" is this head..git/HEADat 000.DRIFTED (1 leg(s) not at the pin), andlegssaysspec: no gitlink recorded, so this leg is not mounted as a submodule at all; code: no gitlink recorded, .... The gate exits 2:REFUSED git-repo-unreadable: .git/HEAD: cannot be read (Permission denied).INVALID (pins), andlegssays.git/HEAD: cannot be read (Permission denied), so no gitlink is read and no leg is compared with its pin. The gate is unchanged.placementisokboth times: each leg's repository under.git/modules/has aHEADof its own, which git reads..git/HEADa symbolic link to a file at 000: the same as at 000, before and after.HEAD, and aHEADthat is a directory: git's answer. The doctor says DRIFTED withno gitlink recorded, the gatepin-gitlink-absent, and neither tool refuses it.HEAD: the doctor and the gate each HUNG past 60 s, in git's own open.psshowsgit rev-parse --show-toplevelandgit ls-files -sinwait_for_partner, not either tool's own open. This is the FIFO case under "Out of scope".Rows. 49 net new: 143 rows in the two files at
2fe16fb1, 192 here.tests/test_root_git_unreadable.py, 9 rows:.git/HEADat 000, a mode row that runs the doctor and the gate and is COMPLIANT once the mode is put back;HEADgone at the open, left to git;HEADamong the absent controls, for both rows that read them.tests/test_doctor_unreadable_paths.py, 40 rows:root_git_readagainst_refuse_an_unreadable_root, over three root layouts (a git directory, a gitfile naming one inside the root, one naming one outside it) and nineHEADshapes (readable, mode 000, the open refused, an I/O error, gone at the open, none, a directory, a FIFO, a link to a file at 000). For each, the doctor's line and the gate's refusal agree on whether the root is refused and on the file named, word for word;gitdir:row, one per parity pair;regular_file_opensagainst_gitfile_opensrow, over the nine shapes.Before: the merge's
shape-doctor.pyswapped in under the new rows gives18 failed, 174 passed in 81.66s. The 18 that fail are exactly the new refusal rows: the mode row, the two in-process stand-ins, the three open rows, and the 12 refusing cells of the root parity row. Every control, the N3 row and the N4 rows pass, as they should.Mutants. Each mutant is applied to this head's
shape-doctor.pyalone, run againsttests/test_root_git_unreadable.pywith the three new rows oftests/test_doctor_unreadable_paths.py(98 rows, in one pytest), then restored and checked withcmp(clean each time).HEADnamed before itsstat: 14 failed, 84 passed. KILLED.head.open("rb")in place ofregular_file_opens): 7 failed, 91 passed. KILLED.regular_file_opens's lastTrueflipped toFalse: 1 failed, 97 passed. KILLED by the new parity row.Gates. All runs are at this head
1b747f7a, one pytest at a time, on Python 3.12.3 and git 2.43.0, with-rs. The stubgh(exit 97) is first on PATH, thengit-filter-repo==2.47.0(CI's pin) from a venv of its own. The environment setsGH_TOKEN=bogus, an emptyGH_CONFIG_DIR,GIT_SSH_COMMAND=false,GIT_CONFIG_GLOBAL=/dev/nullandEMAIL.tests/test_root_git_unreadable.pywithtests/test_doctor_unreadable_paths.py, in one pytest, since the second imports from the first:192 passed in 82.92s.tests/test_validate_pins_spelled_and_named.py:116 passed in 24.99s.tests/test_shape_doctor.py, in the background with a log:446 passed, 3 skipped in 677.94s. All three skips aretest_shape_doctor.py:10516, "the PowerShell line is printed, and powershell.exe exists, only on a Windows host". Nogit filter-reporow skipped.test_repo_hygiene,test_agents_md_codes,test_git_output_decoding,test_stdout_encoding,test_cli_reference,test_no_auto_maintenance):343 passed, 3 skipped in 65.17s. The skips aretest_stdout_encoding.py:285, "the default this is about is Windows' own", and twicetest_no_auto_maintenance.py:222, "the session began with GIT_CONFIG_GLOBAL set", from theGIT_CONFIG_GLOBAL=/dev/nullthese runs set.validate-pins.pyis a pinned template copy (test_pinned_copy_text,test_template_text_placeholders,test_template_values_single_pass):421 passed in 87.35s.Merges
One
gh pr listof the open PRs at 18:58Z: besides #1239, three others touchshape-doctor.pyortemplates/assembly-root/scripts/validate-pins.py, and none touchestests/test_root_git_unreadable.pyortests/test_doctor_unreadable_paths.py.git merge-tree --write-treeof this head1b747f7a(tree01432f28) with each head, read fresh:81eaf757: exit 0, tree01432f28, this head's own, since the branch holds it.9252ef20, which moved during the gates: exit 0, treed3cd704f. Its one new commit touchesscripts/family.py,README.md,docs/handbook.htmland three family tests, none of this PR's files, so this round did not merge main again.HEADthis user cannot open, under.git/modules/<leg>or in a.gitdirectory, is refusedpin-submodule-unreadableby name, where it endedpin-commit-unresolvable(#1222) #1239fff42145: exit 0, tree01432f28, this head's own, since the branch holds it..gitthis user cannot read is refusedgit-repo-unreadable, exit 2, not a traceback ornot-a-git-repo, and the doctor'smembersrow names it once, never drift (#1148) #1172ba81fd7d: exit 0, treea120638f.HEADthis user cannot open, under.git/modules/<path>or in a.gitdirectory, is refusedmember-unreadableby name, where it endedmember-commit-unresolvablewith a fetch (#1256) #12639ef8f0ab: exit 0, tree016e1572.prepareasks the shape pin'ssource_repository:once, with--upstreampassed too, and refuses a path or a value that is noowner/repoin the pin's name; shape-doctor.py answers as it did (#1203) #126986c1e6ea: exit 0, tree58c35143.The merge of main gave the tree merge-tree predicted for it:
81eaf757gave918ac27d(2fe16fb1).Out of scope
HEADthat is a FIFO hangs, at main and here, in the doctor AND in the gate, in git's own open ofHEAD, not in either tool's (measured above). Neither tool opens aHEADthat is no regular file, as the issue's Direction says, so this PR adds no wait; refusing such aHEADbefore git runs would be a new ruling for the gate and the doctor together.config,objects,refs,commondir): the issue's Direction says widening to them is a separate ruling.validate-family.py's member check, which is validate-family.py: a member whose.gitfile or git directory this user cannot read passes_checked_outand is refusedmember-commit-unresolvable, which says the pinned commit is missing, wherevalidate-pins.pynames the unreadable part #1221 (validate-family.py: a member whose.gitfile this user cannot open, or whose git directory (its own.git, or the one its gitfile names) this user cannot search, is refusedmember-unreadablenaming that part, and no longermember-commit-unresolvable, which said the pinned commit was missing and prescribed a fetch (#1221) #1246). For a member whose git directory'sHEADis at mode 000, the holder's gate still saysmember-commit-unresolvable, since validate-family.py: a member whose.gitfile this user cannot open, or whose git directory (its own.git, or the one its gitfile names) this user cannot search, is refusedmember-unreadablenaming that part, and no longermember-commit-unresolvable, which said the pinned commit was missing and prescribed a fetch (#1221) #1246 asks only the member's.git. Neither validate-family.py: a member whose.gitfile this user cannot open, or whose git directory (its own.git, or the one its gitfile names) this user cannot search, is refusedmember-unreadablenaming that part, and no longermember-commit-unresolvable, which said the pinned commit was missing and prescribed a fetch (#1221) #1246 nor this PR covers thatHEADcase, so it is a follow-up (rv1248's N2).Known limit (rv1248b's NIT A, kept as a limit)
Lane 5's delta check rv1248b found this refresh round READY, with no MUST or SHOULD (issuecomment-6726511606). It measured one two-fault case:
.git/HEADand a leg's ownHEAD(or its git directory) are both at mode 000.placementnow names the root's line (spec: read through the root's repository, and .git/HEAD: cannot be read (Permission denied)), where the merge named the leg's own line. Mending the root'sHEADthen shows the leg's own refusal on the next run.INVALID (pins)either way, and the gate also reports the root first.HEAD. Lane 3 keeps it out of this round, as shape-doctor.py, validate-pins.py and validate-manifest.py: a root whose own.gitthis user cannot read is named.git: cannot be read (<reason>), so the doctor never reads it as DRIFTED, and both pinned validators refuse it, exit 2 (#1146) #1147 kept similarplacementtext as a known limit. It is a follow-up candidate.Closes #1222
Lane: openreposhape-3 (openRepoShape-3)
🤖 Generated with Claude Code
Summary by Sourcery
Align shape-doctor's git HEAD readability checks with the validation gate so unreadable repositories produce consistent diagnostics and INVALID verdicts.
Bug Fixes:
Enhancements:
Tests: