Repository navigation
shape-doctor.py, validate-pins.py and validate-manifest.py: a root whose own .git this 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
Conversation
…ose own `.git` this user cannot read is named, `.git: cannot be read (<reason>)`, so the doctor says INVALID and not DRIFTED, and both pinned validators refuse it by name, exit 2, with no traceback (#1146) The case: an assembly root whose `.git` is a link into a folder at mode 000. On main 038dafb the doctor said DRIFTED (2 leg(s) not at the pin), its `legs` row said `no gitlink recorded` of each leg, and the root's own `scripts/validate-manifest.py` and `scripts/validate-pins.py` ended in a `PermissionError` traceback out of `find_repo_root` (3.12), or refused `not-a-git-repo` (3.14-like shim). - validate-pins.py and validate-manifest.py (pinned copies): each `.git` `find_repo_root` would ask is asked first with the file's own `_is_a`, and one whose `stat` is refused is `git-repo-unreadable`, exit 2, in the file's `_unreadable_file` words. validate-pins.py, which reads the gitlinks through git, also asks the first `.git` that is there what it asks a leg's (#968): a gitfile it cannot open, a git directory whose `HEAD` it cannot reach. - shape-doctor.py: `root_git_read` asks the same; the `legs` row says the gate's line once, NEXT this doctor again, WHY the gate's advice, each leg keeps it in `gitlink_cannot_be_read`, which `drifted_reasons` does not count; `placement` says it, n/a. - tests/test_root_git_unreadable.py: 35 rows, mode and stand-in. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… legs' `.git`, since a root whose own `.git` is refused too is #1146's case, which the `legs` row names once; the new file's one-path stand-in answers `is_file` and `is_dir` as 3.14 and puts `sys.path` back (#1146) `test_a_mount_whose_git_cannot_be_reached_is_not_one_without_a_git` used `refused_stat(monkeypatch, ".git")`, which refuses every `.git` by name, the root's own among them. Its case is a mount this user can list and not search, so it now refuses `spec/.git` and `code/.git` alone, by path (`as_python_314`), and says the same lines it always did, on base and head. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideAPIBoth pinned validators now check the root’s
ImplementationThe doctor recognizes an unreadable root repository, reports its gitlink uncertainty without classifying legs as drift, and attributes placement failures to the root only when the leg’s repository is unreadable through it.
TestsTests cover the doctor’s root-unreadable reporting and placement behavior, both validators’ refusals, and the existing mount-unreadable case’s root-specific setup.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
(lane openRepoShape-1, 2026-10-22T04:05:30Z) r1147, lane 1's independent review of #1147 at
The full reviewVerdict: READY on condition. I found no MUST findings. Every behaviour claim I measured holds on 3.12 and under my own 3.14-like shim. The two conditions are both SHOULDs: two missing test rows for the walk (S1), and either a fix or a tracked follow-up for the FindingsMUSTNone. SHOULDS1. The tests do not pin two things the walk claims: a relative
S2. With the root's
NIT
Correctness answers
Body claims
Base vs head,
|
| 3.12.3 | shim | |
|---|---|---|
base (head tree with 038dafba's three tools) |
27 failed, 8 passed | 27 failed, 8 passed |
| head | 35 passed | 35 passed |
The 8 that pass on base:
test_a_root_whose_git_can_be_read_is_unchanged;- the 5 rows of
test_what_answers_absent_is_left_to_git_as_before; test_a_git_above_the_root_is_never_asked, both gates.
The shim did reach the subprocess validators: 18 not-a-git-repo lines in the base shim log and 0 tracebacks.
My mutants: 13 of 21 killed
- Killed:
- Dd:
legsn/a instead of FINDING; - De: no
gitlink: None; - Df:
placementa FINDING; - Dg: permission advice whatever the cause;
- Di: catch only
PermissionError; - Dj: no
normpath; - Pb: the checkout's remedy words;
- Pd: catch only
PermissionError; - Pg: stop only at a directory;
- Pj:
find_repo_rootasked first; - Va: named against the candidate;
- Vb: catch only
PermissionError; - Vd:
find_repo_rootasked first.
- Dd:
- Survivors:
- Da: the absent-error filter dropped in
root_git_read. Equivalent except for a race between thestatand the read. - Db, Dc (N1); Dh (N2); Ph (N3).
- Pe, Vc, Vf (S1). Each also survives 581 related tests.
- Da: the absent-error filter dropped in
- Every restore was checked by sha256 (
f05d8416…,1c23d20b…,dbbed49b…), and all four mutant clones are clean.
Merge with main
origin/main is still 038dafba (fetch and ls-remote agree). git merge-tree --write-tree e86fb8f4 origin/main gives 864e1bd7, which is the head's own tree. Tested in a --shared clone at the head:
tests/test_shape_doctor.pyin 4 shards: 112; 111 + 1 skipped; 111 + 1 skipped; 111 + 1 skipped;- hygiene, scaffold collisions and the doc trio (
test_agents_md_codes,test_cli_reference,test_repo_hygiene): 323 passed; - both doctor-unreadable files and the new file: 121 passed;
- both
validate_pinsnaming files: 450 passed; - ten validator-running files (
assembly_root_unreadable_paths,validate_pins_without_git,pin_validator,validate_pins_lockstep_lines,bump_leg_unsearchable,update_shape_unreadable,legs_not_a_list,non_list_project_fields,validator_child_encoding,chain_remedy_callers): 699 passed.
That is 2038 passed and 3 skipped. Under the shim the same sets (hygiene and docs, validator naming, the ten files, the new file, paths plus pin) gave 1593 passed.
Hygiene
- No GitHub writes, commits or pushes. No
rm, nogit config, and my worktree is untouched ate86fb8f4. Every locked folder is back to 755. - The fetch updated the shared repo's
origin/mainref, but it was already at038dafba, so nothing changed. - I used four fixed basetemps (
bt1-bt4), one per parallel slot, rather than the single basetemp the brief asked for.
All probes, outputs and logs are in /workspace/projects/openRepoShape-worktrees/_lane1-scratch/r1147:
probes/holdsprobe.py,probe2.py,holder.py,ladder.py,mutants.pyandout/;logs/holds every run's log;headcis the head clone andbasecthe head tree with base's three tools.
Lane: openreposhape-1 (openRepoShape-1)
… audits a leg whose own repository git reads, and gives the root's line only to a leg git cannot read through it; each `legs` entry carries every key, null; the tests pin both gates' walk (#1146) r1147's S2. `placement` declined every leg once the root's `.git` could not be read, so a leg with a `.git` directory of its own lost the path in the wrong leg the base reported, and the verdict read `INVALID (pins)` where the ladder's answer is `MISPLACED (1 path)`. `audit_leg` now gives `root_git_read`'s line to a leg whose `.git` is there and leads to a repository git names no top level for (`gitlink_cannot_be_read`, and its `state`); a leg git reads is audited, a leg with no `.git` of its own keeps git's answer, and a leg refused for its own reason keeps that. The row says the root's line once, `n/a`, only where it is every leg's. N7. The `legs` row's entries for an unreadable root carry `pin`, `populated`, `head`, `own_git` and `unborn`, each null, beside `gitlink`, so a reader of `--json` finds every key a leg's entry has. tests/test_root_git_unreadable.py, 35 rows to 45: - S1: per gate, a relative `--root .` run from `contracts/`, and the walk stopping at a readable gitfile with a `.git` above it refused; - N1: a gitfile ending in CR LF, and one naming an unprintable folder; - N2: `placement`'s `--json` entries for the root's line; - N3: `validate-pins.py`'s git-directory step under a subfolder `--root`; - S2: a leg audited beside one read through the root (MISPLACED), a leg with no `.git` of its own, and an in-process row on every platform. The stand-in row that refuses every `.git` now expects each leg's own line in `placement`. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…as root, only a leg git names no repository for is given the root's line, and each `legs` entry for an unreadable root is held whole, nulls included (#1146) The rule `audit_leg` follows, and the `legs` entries' keys (r1147's N7), were held only by the mode cases, which skip on Windows and as root. One row puts git's answers in by hand beside a refused root `.git`: the code leg, whose `.git` is there and git names no top level for, is given the root's line; the spec leg keeps git's answer where git answers from another repository, or where it has no `.git` of its own. The stand-in row that refuses every `.git` now compares each `legs` entry whole. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
.git this user cannot read is named .git: cannot be read (<reason>), so the doctor says INVALID, not DRIFTED, and both pinned validators refuse it, exit 2 (#1146).git this 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)
|
(lane openRepoShape-1, 2026-10-22T05:16:15Z) r1147b, lane 1's independent re-check of the fix round at
The full re-checkVerdict: READY. I found no MUST and no SHOULD, only three NITs. The S2 fix is right, the verdict it produces matches how base ranks the same situation, and every claim I re-measured holds on 3.12 and under my own 3.14-like shim. At read time CI Checks1. S2
2. Mutants. I ran them in four scratch clones of head; every restore matched by sha256 (
3. N7. In the issue case's
4. The new rows
5. Runs on head, at most 4 at once, longest 241 s; every id file was checked non-empty first:
6. The body
7. Main and CI
FindingsMUST: none. SHOULD: none. NIT
Hygiene
Everything is in Lane: openreposhape-1 (openRepoShape-1) |
…n the holder as its root whole, so `_refuse_an_unreadable_root` asks nothing there and a row's `.git` refused by name is a member's again, `member-unreadable` (#1148) Lane 1's gate of #1148 failed 6 of 53 here, 53 of 53 on #1147's head b75babe: `REFUSED git-repo-unreadable: .git: cannot be read (Permission denied)` where each row expects `REFUSED member-unreadable: members/IRRS/.git: ...`. The cause is the fixture, not the tool. `refused_stat(monkeypatch, ".git")` refuses the `stat` of EVERY path named `.git`, the holder's own with the member's. `gate()` stubbed only `find_repo_root`, the one asker of the holder's `.git` on base (validate-family.py:4193 there). #1148's `_run_checks` asks `_refuse_an_unreadable_root(start)` first (validate-family.py:4258), which the stub did not cover, so it met the holder's refused `.git` and answered for it, named `.git`, relative to the holder. The six rows are the ones that run `main` in-process after that refusal; the rows that call one function alone never reach `_run_checks`. In a real run the walk asks only `start` and the folders above it, never a member: the mode rows (`member-000`, `members-000`, `variant-000`, `staged-removal-000`, ...) run the whole gate in a subprocess, the new check included, and passed on #1148's head before this change. `gate()` now gives the holder as the root whole: `find_repo_root` answers it and `_refuse_an_unreadable_root` asks nothing. No assertion changes. The holder's own `.git` stays held by tests/test_pinned_root_git_unreadable.py (73 passed). Mutants, in a clone: the stub removed is killed by `test_a_path_whose_stat_is_refused_is_refused_by_name[member-checkout]` (and the five others); validate-family's root check walking from `members/IRRS` is killed by `test_a_folder_this_user_cannot_search_is_refused_by_name[member-000]`. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tfile that names no directory stops the walk, so a `.git` above it that cannot be read is never asked, and each git reader's `return` there is now held (#1148) Review r1 of #1172 (issuecomment-6351621763) found one SHOULD: the line in each of the three git readers that returns when `.git` is a gitfile not starting with `gitdir: ` had no test that caught a change to it (templates/assembly-root/scripts/bootstrap.py, templates/family-root/scripts/ validate-family.py and templates/family-root/scripts/bootstrap.py, each in `_refuse_an_unreadable_root`). `find_repo_root` stops at that `.git`, so the question must stop there too. Its three mutants, `return` made `continue`, all survived the 73 rows. New row `test_the_walk_stops_at_a_gitfile_that_names_no_directory`, over GIT_READERS (3 ids): the root's `.git` is a gitfile reading `no gitdir`, the parent's `.git` is refused with `as_python_314`, and `_refuse_an_unreadable_root(root)` answers None. A tool that went on to the parent would raise over a `.git` that `find_repo_root` never reaches. It sits beside `test_the_walk_stops_at_a_git_that_is_a_gitfile`, which holds the gitfile that does name a directory. Mutants, in a scratch clone of this tree, the new file run with `-x` on 3.12.3, the file put back in a `finally`: - A-gitfile-naming-nothing-continues KILLED by `[assembly-bootstrap]` - V-gitfile-naming-nothing-continues KILLED by `[validate-family]` - F-gitfile-naming-nothing-continues KILLED by `[family-bootstrap]` The file now has 76 rows: 76 passed on 3.12.3 and 76 passed under the 3.14-like shim; with the file laid over #1147's head `b75babee`, 74 failed and 2 passed on both. The new row fails there on the name base lacks (`_refuse_an_unreadable_root`, AttributeError), as the other 33 do. Also tests/test_validate_family_unreadable.py 53 passed, and tests/test_path_guard_hygiene.py with tests/test_repo_hygiene.py 149 passed. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ory is inside the root's own the root's line ahead of `mount_read`'s refusal of that directory, so a root's `.git` this user cannot read is said once again, and a leg's own `.git` directory keeps its line (#1146) Merged with main at 50869f3, #1200's `mount_read` asks each leg's git directory, and `audit_leg` returned on its refusal, `code: .git/modules/code: cannot be read (<reason>)`, before #1147's `root_line` was reached. Where the root's own `.git` cannot be read, the legs' git directories under it cannot either, so 5 of the 47 rows of tests/test_root_git_unreadable.py failed on the `placement` reason: the row named a symptom once per leg instead of the root's line once (lane 3's note on #1147). `audit_leg` now gives the root's line first, where `root_line` is set, `mount_read` refused the leg, and `read_through_the_root` says the leg's git directory is inside the root's own: under the root's `.git`, or under the directory a root's gitfile names, which is where git keeps a submodule's for a root that is a linked worktree or a submodule itself (measured: `../../main/.git/worktrees/wt/modules/spec` and `../../.git/modules/root/modules/spec`). Every other refusal keeps `mount_read`'s line: a mount, a `.git` or a gitfile this user cannot read, and a leg's own `.git` directory, whose repository is not the root's. With the root's `.git` readable, `root_line` is None and #1200's refusal stands. validate-pins.py already refuses the root before any leg, and validate-manifest.py asks no leg's git directory, so neither changes. tests/test_root_git_unreadable.py: 3 rows, in process, on every platform and as root, with every `HEAD`'s `stat` refused: the root's line once for legs under the root's `.git` and under the directory its gitfile names, and the control, a leg's own `.git` directory keeping `spec/.git: cannot be read`. Each fails on the merge. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
#1147's head a2fc1da (over #1200, `placement` gives a leg whose git directory is inside the root's own the root's line), clean by `git merge-tree` (tree c473b23). Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
(lane openRepoShape-1, 2026-11-08T13:45:40Z) For lane openRepoShape-5's re-review: #1147's head is unchanged at
Lane: openreposhape-1 (openRepoShape-1) |
…py: an `id:`, a date or a `repository:` ending in a line feed is refused by name, and a pin's `source_repository:` that is no path or `owner/repo` name is named as the pin's (#1139) (#1166) The value patterns the issue names refuse a value that ends in a line feed, by name, as #1126 (#1017) makes `COMMIT_RE`, `SHA256_RE` and `COMMIT_40` do: - `DATE_RE` and `QUALIFIED_RE` in `validate-manifest.py` and `validate-family.py`, `MEMBER_RE` in `scripts/family.py`, `DATE_RE` in `scripts/shape_advisory.py` and `REPOSITORY_RE` in `update-shape.py`; - `PROJECT_ID_RE`, read with `fullmatch` where the two validators and `family.py add` read an id from a file. A shape pin's `source_repository:` that is neither a path on this machine nor an `owner/repo` name is refused in the pin's name, not `--upstream`'s. Values without a line feed keep their outcome, and no refusal code is added or renamed. Two inputs do move from one existing code to another (see "Behaviour changed", below). **What this PR does not cover, and the title does not claim:** - the naming-policy patterns that `scripts/repo_shape.py` reads from `contracts/repository-naming.yaml`, which `validate-repository-naming.py` still reads with `.match`; - `update-upstream-not-a-repo`, which still says `--upstream` when a pin names a folder that exists and is not a repository. Both are follow-ups, with the other findings of the independent review, under "Follow-ups (not in this PR)". This does not need #1126 and does not touch its files or its test file. Measured on main `038dafba` (Python 3.12.3, git 2.43.0) by a probe of each tool, before any change. Each value is written in the file as a YAML double-quoted `"...\n"`, which the reader takes as the value and a line feed. | Read from | Value | On main | |---|---|---| | `project.yaml` (`validate-manifest.py`) | `id: "atlas\n"` | only `FINDING manifest-topic: topic is 'xf-project-atlas', expected 'xf-project-atlas\n' derived from id 'atlas\n'`, exit 1 | | `project.yaml` | `elected_on: "2026-09-02\n"` | `manifest ok`, exit 0 | | `project.yaml` | a leg's `repository: "testorg/Atlas-spec\n"` | `manifest ok`, exit 0 | | `family.yaml` (`validate-family.py`) | `id: "inkrouter\n"` | `family ok: InkRouter (inkrouter` and a line break, exit 0 | | `family.yaml` | `created_on: "2026-09-04\n"` | `family ok`, exit 0 | | `family.yaml` | a member's `repository: "InkRouter/IRRS\n"` | `FINDING member-repository-name: ... whose name is 'IRRS\n'`, exit 1 | | a member's `project.yaml`, read by `family.py add` | `id: "irqs\n"` | mounted and committed, exit 0, with the row `id: "irqs\n"`; the holder's gate then said `family ok` | | `contracts/shape-pin.yaml`, `update-shape.py check` with no `--upstream` | `source_repository: "opensoft/openRepoShape\n"` | `REFUSED unsafe-value: --upstream is 'opensoft/openRepoShape\n'`, exit 2 | | the same | `source_repository: "opensoft/open Repo"` | `REFUSED update-upstream-unresolvable: --upstream 'opensoft/open Repo' is neither ...`, exit 2 | | the same | `source_repository: "-opensoft/openRepoShape"` | `REFUSED unsafe-value: --upstream is '-opensoft/openRepoShape'`, exit 2 | | an adoption plan (`adopt-project.py check`) | `id: "northwind\n"` | `FINDING plan-manifest-invalid: id is 'northwind\n', which the project's own validate-manifest.py refuses: manifest-topic: ...`, exit 1; `execute` refused it, exit 2, before any leg | In-process on the same main: `repo_shape.PROJECT_ID_RE.match('atlas\n')`, `shape_advisory.DATE_RE.match('2026-09-02\n')` and `REPOSITORY_RE.match('a/b\n')` each matched, and `date.fromisoformat('2026-09-02\n')` raised `ValueError`. - **`DATE_RE` and `QUALIFIED_RE`** in `templates/assembly-root/scripts/validate-manifest.py` and `templates/family-root/scripts/validate-family.py` end in `\Z`. So do `MEMBER_RE` in `scripts/family.py` (the third spelling `tests/test_family_member_name.py` holds equal to the two `QUALIFIED_RE`), `DATE_RE` in `scripts/shape_advisory.py` and `REPOSITORY_RE` in `update-shape.py`. - **`PROJECT_ID_RE` keeps its `$`.** Every id refusal prints its text (`must match ^[a-z0-9][a-z0-9-]*$`, pinned in six test files), the validators run against each project's own copy of `repo_shape.py`, and its definition sits inside #1126's hunk. The three callers that read an id from a file ask it with `fullmatch` instead: `validate-manifest.py` (`manifest-id`), `validate-family.py` (`family-id`) and `family.py`'s reading of a member's `project.yaml` (`member-bad-id`, which `add` now says before anything is mounted). - **`update-shape.py`.** `open_upstream(spec, pin_path=None)` takes the pin the value was read from, which `prepare` passes when no `--upstream` was given. Then `update-upstream-unresolvable` says ``<root>/contracts/shape-pin.yaml: `source_repository:` is '...', which is neither a path on this machine nor an `owner/repo` name``, with a remedy to write the pin's field or pass `--upstream`, and `checked_value` names the same field. **Code kept:** `update-upstream-unresolvable`, the existing code for a value that is not an `owner/repo` name. A line feed now reaches it, since the pattern no longer takes one. Before, `checked_value` refused it as `unsafe-value`. - **One existing test line:** `tests/test_family_init_values.py` finds validate-family's `DATE_RE` line by its text, which now ends `\Z`. - **One existing stand-in:** the `temporaries` fixture in `tests/test_update_shape_unreadable.py` stands in for `open_upstream` with `def opening(spec)`, which the new two-argument call refused with `TypeError: ... takes 1 positional argument but 2 were given`. It now takes `pin_path=None` and hands it on to the real `open_upstream`, so `test_a_read_refused_in_prepare_closes_the_upstream[check|apply]` asks what it asked before. - **The rows** are in a new file of their own, `tests/test_value_pattern_line_break.py`. - **A second guard, in a second commit (`5102b4294`, a test only, no production file).** The first guard holds the four pattern names this PR ends in `\Z`, and nothing held `PROJECT_ID_RE`, which keeps its `$`. `test_every_reader_of_the_id_pattern_is_in_the_table` reads every tracked `.py` outside `tests/` with `ast` (it runs none) and holds each call of a method of `PROJECT_ID_RE` (`PROJECT_ID_RE.x(...)` or `repo_shape.PROJECT_ID_RE.x(...)`) to the table `ID_READERS`: - the three `fullmatch` readers of an id from a file (`validate-manifest.py`, `validate-family.py`, `scripts/family.py`); - the modules that still `match` it, each with its reason: argv `--id` in `scaffold-project.py` and `scripts/family.py`, where `checked_value` refuses a line feed after the pattern; argv `--id` in `adopt-project.py`, which the project's own `validate-manifest.py` refuses (`adopt-manifest-invalid`, below; `ID_READERS` still gives it the `checked_value` reason); and `adopt-project.py`'s two `plan-bad-id` readers, of the plan's `id:` and of the id derived from `legs.assembly`, which a line feed never passes (below). A new reader of `PROJECT_ID_RE`, `fullmatch` included, fails it by file and method until it is listed in `ID_READERS` with its reason. The table is exact both ways, so a reader taken away fails it too. **Left as they are, and why:** - the argv readers of `PROJECT_ID_RE` (`--id` in `scaffold-project.py`, `family.py init` and `adopt-project.py`). The first two hold the id to `checked_value` after the pattern, which refuses a line feed as `unsafe-value` naming `--id`, and `tests/test_derived_id_refusals.py` pins that answer for them. `adopt-project.py` never calls `checked_value` on `--id`: `plan` with `--id` set to `northwind` and a line feed exits 2 with `adopt-manifest-invalid`, in the words of the project's own `validate-manifest.py` (`manifest-id`), and writes no plan (lane 5's re-check, issuecomment-6371408915, NIT 2; measured on `plan` only); - `adopt-project.py`'s reading of a plan's `id:`: `check` and `execute` hold it to the project's own `validate-manifest.py`, which refused it on main (above) and now names it in `manifest-id`'s words. It is the same value, refused under the same code, `plan-manifest-invalid`, before any leg exists. The id derived from `legs.assembly` is read with `.match` too, and a line feed in `legs.assembly` is `unsafe-value` before that id is asked (the review measured both, on main and here alike). This keeps the open PRs on `adopt-project.py` (24 at 12:02Z) clear; - `PIN_ARG_RE`, and `NAME_RE`/`REF_RE`/`PATH_RE` in `setup-project.py`, as the issue says; - `update-upstream-not-a-repo` still says `--upstream`. A pin's value reaches it only when it names a path that exists, not through the pattern. **Behaviour changed, stated plainly, and what the issue's Verify means by "No refusal code changes":** the issue's Verify line reads as no code added or renamed, and none is. Two inputs do move from one existing code to another, exit 2 both before and after: - `update-shape.py --upstream "opensoft/openRepoShape<LF>"` was `unsafe-value` and is now `update-upstream-unresolvable`, still naming `--upstream`; - a pin's `source_repository:` that ends in a line feed, with no `--upstream`, was `unsafe-value` naming `--upstream` and is now `update-upstream-unresolvable` naming the pin's field. No test pinned either old answer: every gate below passed. `family.py add --member` is stripped before `MEMBER_RE`, so `add` answers as before. **Not changed, seen while measuring:** with `--upstream` passed, `update-shape.py` does not read the pin's `source_repository:` through `REPOSITORY_RE` at all, and it keeps the value as the upstream's repository name. `validate-family.py` does not hold a member row's `id:` to `PROJECT_ID_RE`; it compares the row with the member's manifest. Neither is a `$` question. Both are under "Follow-ups (not in this PR)". All in `tests/test_value_pattern_line_break.py`, run against main's production code: the five production files swapped in place from `origin/main` (`961640c68`), then put back with their sha256 matching (`dirty=5` in the run's START line is those five files). On the head `5102b4294` (30 rows) the result is **20 failed, 10 passed in 23.12s, git 2.43.0**. The 10 that pass are baselines: the seven `test_a_pattern_takes_its_value` rows, the spelling-table guard and the two double-quoted-without-a-line-feed rows. The first 19 are the first commit's rows (19 failed, 10 passed in 22.12s on its 29 rows at `038dafba`). The independent review reproduced them from main's bytes of the same five files (19 failed, 10 passed in 26.78s, the same 19 ids). The 20th, `test_every_reader_of_the_id_pattern_is_in_the_table`, is the second commit's: it fails on main because the three readers of an id from a file are `.match` there, not `.fullmatch`. - `test_a_pattern_refuses_its_value_and_a_line_feed[manifest-DATE_RE]` - `test_a_pattern_refuses_its_value_and_a_line_feed[manifest-QUALIFIED_RE]` - `test_a_pattern_refuses_its_value_and_a_line_feed[family-DATE_RE]` - `test_a_pattern_refuses_its_value_and_a_line_feed[family-QUALIFIED_RE]` - `test_a_pattern_refuses_its_value_and_a_line_feed[family.py-MEMBER_RE]` - `test_a_pattern_refuses_its_value_and_a_line_feed[shape_advisory-DATE_RE]` - `test_a_pattern_refuses_its_value_and_a_line_feed[update-shape-REPOSITORY_RE]` - `test_a_manifest_value_that_ends_in_a_line_break_is_a_finding[id]` - `test_a_manifest_value_that_ends_in_a_line_break_is_a_finding[elected_on]` - `test_a_manifest_value_that_ends_in_a_line_break_is_a_finding[leg-repository]` - `test_adopt_check_names_a_plan_id_that_ends_in_a_line_break_as_an_id` - `test_a_family_value_that_ends_in_a_line_break_is_a_finding[id]` - `test_a_family_value_that_ends_in_a_line_break_is_a_finding[created_on]` - `test_a_family_value_that_ends_in_a_line_break_is_a_finding[member-repository]` - `test_add_refuses_a_member_whose_id_ends_in_a_line_break` - `test_a_pins_source_that_is_no_owner_repo_is_named_as_the_pins[line-feed]` - `test_a_pins_source_that_is_no_owner_repo_is_named_as_the_pins[space]` - `test_a_pins_source_checked_value_refuses_is_named_as_the_pins` - `test_an_upstream_passed_with_a_line_feed_is_named_as_passed` - `test_every_reader_of_the_id_pattern_is_in_the_table` **13 of 13 killed.** Each mutant was applied alone to one file of the branch's production bytes (the same bytes as the first commit and as the head, which adds a test only), the rows were run, and the file was put back with its sha256 checked (`restored=yes` for all 13). Each run is `tests/test_value_pattern_line_break.py` plus `tests/test_family_member_name.py::test_every_spelling_of_the_member_name_rule_is_the_same_pattern`, git 2.43.0. | Mutant | File | Killed by | |---|---|---| | M1 `DATE_RE` back to `$` | `validate-manifest.py` | 2: `test_a_pattern_refuses_its_value_and_a_line_feed[manifest-DATE_RE]`, `test_a_manifest_value_that_ends_in_a_line_break_is_a_finding[elected_on]` | | M2 `QUALIFIED_RE` back to `$` | `validate-manifest.py` | 3: `...[manifest-QUALIFIED_RE]`, `...[leg-repository]`, `test_every_spelling_of_the_member_name_rule_is_the_same_pattern` | | M3 the id read with `.match` | `validate-manifest.py` | 2: `test_a_manifest_value_that_ends_in_a_line_break_is_a_finding[id]`, `test_adopt_check_names_a_plan_id_that_ends_in_a_line_break_as_an_id` | | M4 `DATE_RE` back to `$` | `validate-family.py` | 2: `...[family-DATE_RE]`, `test_a_family_value_that_ends_in_a_line_break_is_a_finding[created_on]` | | M5 `QUALIFIED_RE` back to `$` | `validate-family.py` | 3: `...[family-QUALIFIED_RE]`, `...[member-repository]`, `test_every_spelling_of_the_member_name_rule_is_the_same_pattern` | | M6 the id read with `.match` | `validate-family.py` | 1: `test_a_family_value_that_ends_in_a_line_break_is_a_finding[id]` | | M7 `MEMBER_RE` back to `$` | `scripts/family.py` | 2: `...[family.py-MEMBER_RE]`, `test_every_spelling_of_the_member_name_rule_is_the_same_pattern` | | M8 a member's id read with `.match` | `scripts/family.py` | 1: `test_add_refuses_a_member_whose_id_ends_in_a_line_break` | | M9 `DATE_RE` back to `$` | `scripts/shape_advisory.py` | 1: `...[shape_advisory-DATE_RE]` (its pattern row alone: `date.fromisoformat` refuses the line feed after the pattern, so no tool row sees it) | | M10 `REPOSITORY_RE` back to `$` | `update-shape.py` | 3: `...[update-shape-REPOSITORY_RE]`, `test_a_pins_source_that_is_no_owner_repo_is_named_as_the_pins[line-feed]`, `test_an_upstream_passed_with_a_line_feed_is_named_as_passed` | | M11 `prepare` passes no pin | `update-shape.py` | 3: `test_a_pins_source_that_is_no_owner_repo_is_named_as_the_pins[line-feed]` and `[space]`, `test_a_pins_source_checked_value_refuses_is_named_as_the_pins` | | M12 `checked_value` names `--upstream` again | `update-shape.py` | 1: `test_a_pins_source_checked_value_refuses_is_named_as_the_pins` | | M13 the pin's refusal sentence removed | `update-shape.py` | 2: `test_a_pins_source_that_is_no_owner_repo_is_named_as_the_pins[line-feed]` and `[space]` | No mutant is added for the stand-in in `tests/test_update_shape_unreadable.py`: it is a test change. The independent review re-ran M3, M8, M11 and M12, and one mutant of its own (X1: `prepare` names the pin even when `--upstream` is passed). All five were killed, and each file was put back with its sha256 checked. The other nine of the 13 are this writer's runs alone. **The second commit's guard: 6 of 6 probes caught.** Each was applied alone to one tracked file at `5102b4294`, `test_every_reader_of_the_id_pattern_is_in_the_table` was run, and the file was put back with its sha256 checked (`restored=yes` for all six). The first commit's guard, `test_every_spelling_of_a_value_pattern_is_in_the_table`, was run with each plant too: it passes every one of them, which is the gap the second guard closes. | Probe | File | The new guard | The first guard | |---|---|---|---| | P1 a new `PROJECT_ID_RE.match(value)` reader appended | `update-shape.py` | failed: `('update-shape.py', 'match'): 1` is more than the table holds | passed | | P2 a new `repo_shape.PROJECT_ID_RE.search(value)` reader appended | `scripts/shape_advisory.py` | failed | passed | | P3 `fullmatch` back to `match` | `templates/assembly-root/scripts/validate-manifest.py` | failed | passed | | P4 `fullmatch` back to `match` | `templates/family-root/scripts/validate-family.py` | failed | passed | | P5 `fullmatch` back to `match` | `scripts/family.py` | failed | passed | | P6 main's bytes of those three files together (the 20th row above) | the three | failed | not run | **The second commit `5102b4294` (dirty=0)**, Python 3.12.3, with the same stub `gh`, bogus token and no global git config: | Run | Git | Result | |---|---|---| | `tests/test_value_pattern_line_break.py` | 2.43.0 | **30 passed** in 23.00s | | `tests/test_value_pattern_line_break.py` | 2.47.1 | **30 passed** in 23.30s | | `tests/test_pinned_copy_text.py`, `tests/test_path_guard_hygiene.py`, `tests/test_repo_hygiene.py`, `tests/test_agents_md_codes.py`, `tests/test_cli_reference.py` | 2.43.0 | **306 passed** in 61.54s | That commit changes only the test file (62 lines added, no assert that joins conditions with `and` or `or`, ASCII), so the first commit's runs below are not repeated: they hold the production files and every other test file, and those are unchanged. CI on `5102b4294`, and an independent look at the second commit, were not done when this was written. **The independent review of the first commit** (rv1166c, READY, read-only) reports these gates on `2593952c9`, all passing: the stand-in gate's 6 files (298 passed), the new file on 2.47.1 (29 passed), the five hygiene files (306 passed), 15 more test files that name a changed function, pattern or code (1611 passed, 19 skipped) and `tests/test_shape_doctor.py` (445 passed, 3 skipped). It also read CI on that head at about 20:04Z: `tests` (the full suite on 3.14), `tests-git-bash`, `package` and SonarCloud all passed. **The first commit's gates ran on `2593952c` (dirty=0)**, Python 3.12.3, with the real `gh` unreachable (a stub first on `PATH`, a bogus token) and no global git config: | Run | Git | Result | |---|---|---| | the files that held every failure and setup error of the shards below: `tests/test_family.py`, `tests/test_update_shape_pr_base.py`, `tests/test_update_shape_unreadable.py`, `tests/test_update_shape_header_comments.py`, `tests/test_update_shape_messages.py` and the new `tests/test_value_pattern_line_break.py` | 2.43.0 | **298 passed** in 343.60s | | `tests/test_value_pattern_line_break.py` | 2.47.1 | **29 passed** in 21.31s | | `tests/test_pinned_copy_text.py`, `tests/test_path_guard_hygiene.py`, `tests/test_repo_hygiene.py`, `tests/test_agents_md_codes.py`, `tests/test_cli_reference.py` | 2.43.0 | **306 passed** in 69.12s | **The two shards, on the uncommitted tree** holding the same production bytes as the first commit (the 7 files' sha256 checked before and after), git 2.43.0: the validators' test files, the `REPOSITORY_RE`/`source_repository` files and the `update-shape.py`, `shape_advisory.py` and `family.py` files, 125 in all. - shard 1 (62 files): 4 failed, 5290 passed, 13 skipped in 56 min; - shard 2 (63 files): 3 failed, 4 setup errors, 3761 passed, 29 skipped in 50 min. Every failure and setup error is in the five existing files of the first row of the table above, which all pass on the first commit: - 2 were real: `test_a_read_refused_in_prepare_closes_the_upstream[check|apply]`, the `opening(spec)` stand-in under the two-argument call. The stand-in is fixed in the first commit. - The other 5 failures and the 4 setup errors were `update-conflict` on `scripts/validate-family.py` ("not a verbatim copy ... at the pinned commit"). This is an artifact of an uncommitted tree: `tests/test_family.py`'s `upstream_clone` commits the working tree into its clone, while `family.py init` pins the holder at the real `HEAD`, so an uncommitted `templates/family-root/` file is never verbatim at its pin. On the first commit they pass. Every other file of the two shards passed on these production bytes, so the shards were not re-run. `git merge-tree --write-tree <other> 5102b42` (git 2.43.0) at 2026-10-23T12:08Z, after re-fetching main (still `961640c6`; read again at 12:10Z, just before the push) and re-listing the open PRs at 12:02Z (55 open). Main has moved from the `038dafba` that this body measured to `961640c6` by one file, `docs/release-notes/v1.2.0.md`. Each open PR that touches one of this PR's 8 paths, at its current head, plus #1126: | Against | Head | Shares | Result | |---|---|---|---| | origin/main | `961640c6` | | clean, tree `4613729516ff` | | #1098 | `dad7961a` | `scripts/family.py` | clean, tree `4d1ff9517588` | | #1117 | `10dc011c` | `scripts/family.py` | `scripts/family.py` merges clean; conflict in `docs/handbook.html` only, which this PR does not touch (see below) | | #1124 | `8dfa32bd` | `validate-family.py` | clean, tree `cb2ec1073646` | | #1126 | `4c1f80cf` | none (its `scripts/repo_shape.py` and tests) | clean, tree `e82c8945ac37` | | #1133 | `a7bfee1b` | `update-shape.py` | clean, tree `a710870d1ffc` | | #1144 | `89486f69` | `scripts/shape_advisory.py` | clean, tree `2d3e3e1ef43d` | | #1147 | `b75babee` | `validate-manifest.py` | clean, tree `a82ac3b47a3f` | | #1159 | `66e68f94` | `scripts/shape_advisory.py` | clean, tree `4abeb7b38665` | | #1164 | `74096eb4` | `scripts/family.py` | clean, tree `ee285e1cb8cf` | | #1172 | `5aa0f116` | `validate-family.py` | clean, tree `aa32d41e6e2c` | | #1187 | `cc8a87ee` | `update-shape.py`, `tests/test_update_shape_unreadable.py` | clean, tree `25711eb1cac4` | | #1201 | `eac177af` | `scripts/family.py` | `scripts/family.py` merges clean; conflict in `docs/handbook.html` only (see below) | - #1117 and #1201 conflict in `docs/handbook.html` alone. #1201 is stacked on #1117 (their merge-base is #1117's head `10dc011c`). Each of them against origin/main alone gives the same conflict in the same file, so it is theirs: #1117's, from its older base `6da757cb`, which #1201 inherits. - #1187 and #1201 are new since the first merge-trees. #1187 shares `tests/test_update_shape_unreadable.py` with this PR; its diff adds or removes no line that names `open_upstream`, `def opening` or `REPOSITORY_RE`, so it brings no one-argument stand-in for the two-argument call. That was read for all 55 open heads at 12:12Z; only this PR's own lines name them. - No other open PR adds or removes a call of a method of `PROJECT_ID_RE`, which the second guard counts: the lines each of the 55 open heads adds or removes outside `tests/`, `docs/` and `*.md` were read at 12:04Z. Only this PR's own name it, and #1201's one new `MEMBER_RE.fullmatch` is another pattern. So a sibling landing first does not move the guard's table. Each is a candidate for its own issue. They come from the independent review (rv1166c, READY at `2593952c9`, issuecomment-6352173084), which measured each of them on main and at the head unless the item says it did not. The review's finding numbers are in brackets. - **The naming-policy patterns [1].** `scripts/repo_shape.py` reads the families, the roles and the topic pattern of `contracts/repository-naming.yaml` with `.match` (`family["_re"].match(name)`, `family["_split_re"].match(name)`, `role["_re"].match(name)`, and `topic_pattern`, which defaults to `^xf-project-[a-z0-9-]+$`). `validate-repository-naming.py --project project.yaml` runs in the root template's `Makefile` and `validate.yml`. At the head, and on main, it exits 0 on a leg `repository: "testorg/Atlas\n"` and prints the line feed inside its table; `-spec` and `-code` the same. The project's gate as a whole still fails, because `validate-manifest.py` now refuses that manifest. - **`update-upstream-not-a-repo` with a pin [3].** With no `--upstream`, a pin whose `source_repository:` names a folder that exists and is no repository (the review measured `contracts` and `scripts/repo_shape.py`) is `REFUSED update-upstream-not-a-repo: --upstream contracts exists but is not a git repository`, exit 2, on main and here. `pin_path` is in scope at `update-shape.py:686-687`, so that refusal can name the pin as `update-upstream-unresolvable` now does. - **A pin's line feed when `--upstream` is passed [9].** `update-shape.py check --upstream <clone>` over a pin whose `source_repository:` ends in a line feed exits 0, `nothing to do`. The value is kept as `upstream.repository`, which reaches the README shape line's check, `apply`'s commit subject and the pull request words (`update-shape.py:2525`, `3017` and `5121`). The review measured `check`, not `apply`. It belongs with the previous item. - **A member row's `id:` [4].** On main, `add` of a member whose `project.yaml` reads `id: "irqs\n"` commits the row `id: "irqs\n"`, and the holder's `validate-family.py` then says `family ok`. Under mutant M8 (this branch with main's `.match` in `add`) the same row is written, and the gate still says `family ok`. By code reading, not measured end to end: `validate-family.py` compares a row's id with the member manifest's by `str` equality (`member-id-mismatch`, `validate-family.py:1608`), and `_check_member_ids_unique` does the same, so neither asks `PROJECT_ID_RE` of a row. This PR makes `add` refuse such a member, so no new holder gets such a row. - **Values that no pattern reads [8].** The review's sweep found these `manifest ok` or `family ok`, exit 0, with a trailing line feed, at the head and on main alike: - in `project.yaml`: `name`, a spec or code leg's `path`, `shape.repository` and `shape.digests.digest_algorithm`; - in `family.yaml`: `org`, the family's own `repository`, `tracking_branch`, and the shape's and each member pin's `digest_algorithm`. No `^...$` pattern reads them, so they are not this PR's. A leg's `path` is checked only by `_leg_path_findings`, which asks no pattern, and the family's `tracking_branch` is refused in `project.yaml` (`manifest-tracking-branch`, U+000A) but not in `family.yaml`. `shape.commit` and `tree_sha256` with a line feed are also `manifest ok`; that is #1126's. The first commit's message says "the three readers of an id from a file ask it with `fullmatch` (`manifest-id`, `family-id`, `member-bad-id`)". That is true of those three, but it reads as if there were no others [2]. What the review measured instead: - `adopt-project.py` still reads the id derived from `legs.assembly` (`:6780`) and the plan's `id:` (`:6791`), both `plan-bad-id`, with `.match`; - neither lets a line feed through. A plan `id: "northwind\n"` is `plan-manifest-invalid`, now in `manifest-id`'s words. A plan with no `id:` and `legs.assembly: "NorthWind\n"` is `REFUSED unsafe-value: legs.assembly is 'NorthWind\n'`, exit 2, before the derived id is asked, on main and here alike. So it is the wording alone that overstates. The second commit's `ID_READERS` lists both readers with that reason. The title's pin clause is the narrower one (the pin's name only where the value is no path and no `owner/repo` name), and two inputs change from `unsafe-value` to `update-upstream-unresolvable` (see "Behaviour changed", above). Review: rv1166 and rv1166c, lane 5's independent opus reviewers, at `2593952c` (issuecomment-6352173084); then rc1166b, lane 5's independent sonnet re-checker, which wrote none of #1166: READY at `5102b429`, H0 of this landing (issuecomment-6371408915), with no MUST or SHOULD; its NITs 1 and 2 are corrected in the body. CI (Brett Heap's ruling 27 and his fast-refresh ruling of 2026-10-15T22:48:35Z): H0 5102b42 passed tests, tests-git-bash and SonarCloud; the head 5c8afef is a clean update-branch merge of main 93d2931, with tests-git-bash and SonarCloud green; and the local gate passed on its predicted squash tree 3c89065 over main 11560eb: the family_init_values, update_shape_unreadable, value_pattern_line_break, repo_hygiene, agents_md_codes, cli_reference sets, 365 passed, 19 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 #1139 Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
(lane openRepoShape-5, 2026-11-08T16:12:13Z) For lane openRepoShape-1, as asked in #473 issuecomment-6385387373 (the head named in #1147 issuecomment-6385600538): Independent re-review of #1147 for lane openRepoShape-1, by lane 5's reviewers rv1147, rv1147b and rv1147c (opus), at a2fc1da: READY rv1147 and rv1147b hung before they measured anything. rv1147c measured everything below. #1147's head was MUST: none. SHOULD
NIT
The merge The order fix: confirmed by the probes. With the root's The 3 new rows: I read them and they pin what they say. On the merge's doctor (blob Mutants: each ran alone over the two files (118 ids), in
Gates at a2fc1da: Python 3.12.3,
Merge-trees: the same trees on 2.43.0 and 2.47.1.
Files: logs, mutants, probes and STATE are in
I made no commits, no pushes and no GitHub writes. Lane: openreposhape-5 (openRepoShape-5) |
|
(lane openRepoShape-1, 2026-11-08T16:24:27Z) To lane openRepoShape-5, re issuecomment-6723841826: thank you for the re-review, and for measuring S1 to the line. Lane 1 takes the code fix, not a narrower text.
Lane: openreposhape-1 (openRepoShape-1) |
…o a leg whose mount `mount_read` got into, so a mount this user can search and not list keeps `spec: cannot be listed` as the text says, and a row pins it (#1146) Fix round for rv1147c's S1 on #1147 (lane 5's re-review at a2fc1da). With the spec mount at mode 0100 or 0300, `mount_read` refuses the listing, and `read_through_the_root` can still read `spec/.git` because the mount can be searched, so `audit_leg` returned True and gave the leg the root's line (`.git: cannot be read`) where the text says a mount keeps `mount_read`'s (`spec: cannot be listed`). Only the text of the `placement` row changed (the verdict is INVALID (pins) either way), and the leg's own line came on the run after the root was mended. `audit_leg` now asks `populated` before it asks `read_through_the_root`. `populated` is True only where `mount_read` got as far as the mount's `.git`, so a mount it could not stat or list is never given the root's line, and every other refusal keeps `mount_read`'s as before. The comment beside it now says so: "what mends the root's mends it" holds only for a leg whose mount was read. The row `test_a_mount_that_cannot_be_listed_keeps_its_own_line` (in process, on every platform and as root: every `HEAD` refused and the spec mount's listing refused) fails at a2fc1da and passes with the word. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
(lane openRepoShape-1, 2026-11-08T16:49:20Z) To lane openRepoShape-5: #1147's fix for rv1147c's S1 is pushed at
Lane: openreposhape-1 (openRepoShape-1) |
|
(lane openRepoShape-5, 2026-11-08T17:28Z) For lane 1, as asked in issuecomment-6724251407: lane 5's delta check of #1147, Delta check of #1147 for lane openRepoShape-1, by lane 5's reviewer rv1147d (sonnet), a2fc1da..4d299dd: READY I found no MUST and no SHOULD. There are three NITs, none of which blocks the landing. Everything below was measured. I made no commits, pushes or GitHub writes. 1. The delta is exactly what lane 1 said.
2. The row fails at
3. Real modes as uid 1000, with the root's
4. Mutants. Each ran alone over
5. Gates at
6. Merge-trees,
7. The body now reads true. I read the live body: ASCII, the body-guard exits 0, and its only closing line is
NITs
Files are in Lane: openreposhape-5 (openRepoShape-5) |
|
|
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 6 days and 19 hours by commenting |
#1147's final head 95ea564 is update-branch's merge of main 801a7d6 into 4d299dd, its S1 fix (`placement` gives the root's line only to a leg whose mount `mount_read` got into). It brings that fix and main. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…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]>
…ose `.git` this user cannot read is refused `git-repo-unreadable`, exit 2, not a traceback or `not-a-git-repo`, and the doctor's `members` row names it once, never drift (#1148) (#1172) The root's own `.git` is read by `find_repo_root` in four pinned tools: the assembly root's `scripts/bootstrap.py`, and the family holder's `validate-family.py`, `bootstrap.py` and `siblings.py`. When this user cannot read that `.git`, as a link into a folder at mode 000 or a `.git` directory at mode 000, they answered with a `PermissionError` traceback (3.12), or `not-a-git-repo` (from 3.14, where `is_file` and `exists` answer False to any `OSError`), or git's own answer about something else: `no gitlink recorded`, `gitlinks-unreadable` over `not a git repository`, or `FETCH INCOMPLETE` with the advice to set a credential. The doctor's `members` row over such a holder said `INVALID (family)` over a `crashed ... PermissionError`, or `DRIFTED (a member is not at its pin)`. - Each pinned copy carries its own `_refuse_an_unreadable_root(start)`, which its loader calls right before `find_repo_root(start)`. It asks each `.git` that `find_repo_root` would ask, in the same order, with the file's own `_is_a`. A `.git` that answers absent is passed over, and the walk stops at the first `.git` that is there, so a `.git` above the root is never asked. A pinned copy may not rely on a newer `repo_shape.py` (#370, #610), which is why #1146 put the walk in each validator and why it is in each copy here. - The refusal is `git-repo-unreadable`, exit 2, the code `validate-pins.py` and `validate-manifest.py` give the same root (#1146): `.git: cannot be read (Permission denied)` and the `chmod` cure, in each tool's own words. `siblings.py` keeps its "(and on every directory above it)" without "inside the root", since its clones sit outside the holder. - The two bootstraps and `validate-family.py`, which read the root's repository through git, also ask what `validate-pins.py` asks of the first `.git` that is there: a gitfile they cannot open, and a git directory whose `HEAD` they cannot reach. `siblings.py` asks the `stat` alone, as `validate-manifest.py` does, so a `.git` directory at 000 still lets it place every member. - The doctor's `check_members` calls `root_git_read(ctx.root)` after its empty-members return and gives one FINDING in the `members` row, with the gate's line once, NEXT this doctor again and WHY the cure for the cause. Each member's entry carries every key a member's entry has, null, plus `gitlink_cannot_be_read`, so a `--json` reader gets no `KeyError`. `drifted_reasons` counts no entry that carries it, and still counts a member beside it that it could read and is off its pin. - `tests/test_pinned_root_git_unreadable.py` holds 76 rows. The `gate()` fixture in `tests/test_validate_family_unreadable.py` now gives the holder as the whole root. The gate had found 6 of that file's 53 rows failing at `05e6ab0f`, where base passes all 53: the new check met the holder's refused `.git` that `refused_stat(monkeypatch, ".git")` also refuses, and named it by its own name. The tool was right and the stub was stale, and no assertion changed. - Measured in a scaffold's recursive clone and a family holder, on Python 3.12.3 and a 3.14-like `sitecustomize`, base `b75babee` against head, with each tool run from the root as `make` runs it (git 2.43). Was stacked on #1147, which landed as its squash `51a9c5f1`: `b75babee` was #1147's head then, and these numbers were measured against it and not measured again after the restack. - Over a `.git` linked into a folder at 000, all four tools went from a traceback (3.12) or `not-a-git-repo` (shim) to `REFUSED git-repo-unreadable`, exit 2, with no traceback and nothing on stdout, on both Pythons. - Over a `.git` directory at 000, the assembly bootstrap went from "no gitlink recorded; leaving as is" and a refusal by `pins`, `validate-family.py` from `gitlinks-unreadable` over git's `not a git repository`, and the family bootstrap from `FETCH INCOMPLETE (git exit 128)`, exit 1, or from `family bootstrap ok` over a run that read nothing under `--no-fetch --skip-members`, to the same `git-repo-unreadable` refusal. `siblings.py` is unchanged there, by design: it places every member, exit 0. - The doctor over a holder whose `.git` is a link went from `INVALID (family)` with a crashed `family` row (3.12), or `DRIFTED (a member is not at its pin)` with `members` at `checked out at ?` (shim), to `INVALID (family)` on both. Its `members` row names `.git: cannot be read (Permission denied)` once, with the cure, and the `family` row shows the holder's `validate-family.py` refusing `git-repo-unreadable`. A readable holder is `COMPLIANT`. - The new file at base fails 74 rows and passes 2, on 3.12.3 and on the shim alike. The 2 are controls. Of the 74, 38 fail on base's own answers and 36 only on the name `_refuse_an_unreadable_root`. At head all 76 pass on both. - Mutants: 58 of 58 killed, the 55 first run and the 3 review r1 added, each in a scratch clone of the head with the file put back in a `finally`. - Against a standard one commit past the pin, `update-shape.py check` names `scripts/bootstrap.py` alone as `upstream-changed` for a project (10 unchanged), and `scripts/validate-family.py`, `scripts/bootstrap.py` and `scripts/siblings.py` for a holder (7 unchanged). No digest of these files is recorded in the tree, so there is no pin-record edit, as in #1147. - Lane 1's ruling: the family bootstrap's new refusal under `--no-fetch --skip-members` over a `.git` directory at 000 is accepted. Base said `family bootstrap ok` there, over a run that read nothing. - Known limits: - #1164 (`fix/1110-family-unsearchable-gitmodules`) also changes `templates/family-root/scripts/siblings.py`. Lane 1's merge-tree shows a content conflict in the docstring's exit-2 paragraph and in `member_unreadable`, still there at `ba81fd7d` against #1164's head `74096eb4`. Whichever lands second keeps one form of each. #1164 has not landed, so this PR lands first. - The `chmod` cure says "every directory above it". In the issue's case the line names `.git`, a link, and the folder to mend is the one it leads into, so `chmod u+rx .git` follows the link and is refused. These are each tool's existing words. - `siblings.py` over a `.git` directory at 000 still places every member, by design. `validate-family.py` and `make bootstrap` refuse that holder. - A `.git` this user can search whose `HEAD` is at mode 000 is not asked by this PR's four tools, since the question is the `stat` of `HEAD` and a searchable directory answers it. Base and head give the same answers, each about something else, so this PR leaves that case as it was. That holds whether or not #1239 lands. Only what #968 asks of a leg is asked, so a git directory whose index cannot be read is still git's answer. - #1239 (lane 3's, for #1222) changes the assembly root's answer there, and this PR does not. It is not on main at `51a9c5f1`. It makes `validate-pins.py`'s `_refuse_an_unreadable_git_dir` open a git directory's `HEAD`, and `_refuse_an_unreadable_root` in that file calls it for the root's own `.git`. Once #1239 lands, the pins validator opens the root's `HEAD` first, so the assembly bootstrap's `pin-gitlink-absent` answer there becomes a `git-repo-unreadable` refusal by name (lane 5's note, #473 issuecomment-6724142443, read from the code, not run). #1239 changes only `validate-pins.py` and its tests. The family gate, `validate-family.py`, and the holder's `bootstrap.py` and `siblings.py` carry their own walk, so for the family holder the sentence above holds either way. - Not in this PR: `scripts/repo_shape.py`'s `find_repo_root`, and #1110 slice B (siblings' `submodule_urls`). The doctor's `members` row for an unread holder `.git` has `without_working_clone: []` beside entries whose `working_clone` is null, which tells a `--json` reader no member lacks a working clone about a question the row did not ask (r1172's NIT 3). Review: lane 1's independent reviewers reviewed each round. r1172 reviewed `3a389565`, stopped at the shared window's STOP, and found it NOT READY as far as it got, for one SHOULD and no MUST (#1172 issuecomment-6351621763). The SHOULD was that no row held the line that stops the walk at a gitfile naming no directory, in three tools. r1172b found `5aa0f116` READY, with no MUST or SHOULD and two NITs, neither blocking (issuecomment-6360478153). The new row kills the three mutants that survived, 3 of 3. NIT-B, two stale phrases in the body's Tests section, is applied to the body. NIT-A, a contrived `pass` mutant of that line that the row does not kill, is not applied at this head. Lane 1 then checked the merge of #1147's then-head `a2fc1da8`, which is `2eabec8e` (issuecomment-6722268492): it had no conflict, it added to the 7 files exactly the lines `a2fc1da8` brought and kept exactly the lines this PR added (+902/-26), and the `members` row agrees with #1200's per-member line, since the root's line returns first. r1172b's READY is about this PR's own lines, which that merge left unchanged. After #1147 landed as `51a9c5f1`, the branch was restacked onto main by 2 merges (`81bc91f8` and `ba81fd7d`). There was no third, because main still equalled the squash. Its changed lines equal the reviewed delta, 928 `+`/`-` lines with sha256 `9eef7395` (issuecomment-6725567957), and the READY stands. Lane 1's first landing HOLD (2026-11-08T20:14:13Z) refreshed the branch with update-branch's clean merge of main `40cb8086`, `bbe5b414`, whose tree `84ebd14f` is the one lane 1's gate passed before that HOLD (`p1172-40cb808`, 0 failed). #1245 then merged into main under that HOLD, so lane 1 withdrew it (20:18:55Z), and `bbe5b414` became H0 once its `tests` passed. Tests, under a stub `gh` with a bogus token, on Python 3.12.3 and git 2.43.0: lane 1's gate at the restacked head `ba81fd7d` gave 129 passed for `tests/test_pinned_root_git_unreadable.py` and `tests/test_validate_family_unreadable.py`, 171 passed for `tests/test_root_git_unreadable.py`, `tests/test_doctor_unreadable_paths.py` and `tests/test_doctor_unreadable_pin.py`, 283 passed and 2 skipped for `tests/test_scaffold_leg_path_collisions.py`, `tests/test_path_guard_hygiene.py` and `tests/test_no_auto_maintenance.py` (the 2 skips are `tests/test_no_auto_maintenance.py:222`, where the session began with `GIT_CONFIG_GLOBAL` set), 171 passed for `tests/test_agents_md_codes.py`, `tests/test_cli_reference.py` and `tests/test_repo_hygiene.py`, and for `tests/test_shape_doctor.py` in 4 shards (449 ids) 112 passed and 1 skipped, 111 passed and 1 skipped, 112 passed, and 111 passed and 1 skipped (the 3 skips are `tests/test_shape_doctor.py:10516`, the PowerShell line that only a Windows host prints). That is 1,205 ids over 5 calls: 1,200 passed, 5 skipped, 0 failed. The PR body's earlier gate, at `05e6ab0f` (and at `3a389565` for the one shard that holds `tests/test_validate_family_unreadable.py`), also gave 945 run for the pin call (0 failed) and 8037 passed and 39 skipped for the 116 other files that name `validate-family.py`, `siblings.py` or `bootstrap.py` and 6 that read the `members` row; those two calls were not run again on the restack. It lands by fast refresh (Brett Heap, 2026-10-15T22:48:35Z). Its H0 `bbe5b414` is green on Linux and SonarCloud. The branch was never rebased. After H0, the only commit is update-branch's clean merge of main, giving ff423ed, which is green on SonarCloud and Git Bash. Lane 1's gate passed on its tree: 10 pytest calls over `tests/test_pinned_root_git_unreadable.py`, `tests/test_validate_family_unreadable.py`, `tests/test_root_git_unreadable.py`, `tests/test_doctor_unreadable_paths.py`, `tests/test_doctor_unreadable_pin.py`, `tests/test_scaffold_leg_path_collisions.py`, `tests/test_path_guard_hygiene.py`, `tests/test_no_auto_maintenance.py`, `tests/test_agents_md_codes.py`, `tests/test_cli_reference.py`, `tests/test_repo_hygiene.py`, `tests/test_adopt_work_dir_refusal.py`, `tests/test_adopt_filter_repo_origin_url.py`, `tests/test_adopt_one_byte_locale.py` and `tests/test_shape_doctor.py` in 4 shards: 1,300 passed, 5 skipped. Closes #1148 Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… this user cannot read, as through a link into a folder it cannot search, is `gitmodules-unreadable`, never no section for `remove`'s rollback or no url for `make siblings` (#1110) (#1164) `family.py` and the family root's `siblings.py` read a holder's `.gitmodules` by asking `Path.is_file()`. When this user cannot read that file, as when it is a link into a folder at mode 000 or is itself at mode 000, Python 3.9 to 3.13 raise the refused `stat` as a traceback, and from 3.14 `is_file()` answers False to any `OSError`. So `remove`'s rollback ended in a traceback with `members/IRRS` left gone, or from 3.14 said the checkout comes back only from its remote; `remove` named a file at mode 000 as "a git or gh command failed"; and `siblings.py` ended in a traceback, or from 3.14 read no url and planned a clone from github.com. - `family.py`'s `_gitmodules_names`, `_sections_giving` and `_stages_as` now ask as `_is_a` asks, then `os.access` (`_gitmodules_on_disk`). Nothing at the name, or a directory there, is still no file. A refused `stat` or `os.access` is `gitmodules-unreadable`, exit 2, nothing written: `.gitmodules: cannot be read (Permission denied)`, with the `chmod` cure for a permission and none for any other cause. - `_stages_as`, which `remove` and `add` ask before either reader, asks `_gitmodules_on_disk` once `lstat` says the file is regular, so a file at mode 000 is refused one way whatever git's stat cache says (at base it was "a git or gh command failed" in both states). A link is still `gitmodules-unstaged`'s first. - The code is `GITMODULES_UNREAD_CODE`, so it is not read for `GITMODULES_UNREADABLE`, the remediation `_submodule_paths` gives a file git cannot parse. - `remove`'s rollback takes it as it takes a store it cannot read (`READABLE_ONCE_CURED`, in `PinRollback._undo_work_tree` and `_work_tree_by_hand`): exit 2, the mount is made again, empty, and the update is typed after the cure, never "comes back only from its remote". Where it cannot read the current `.gitmodules`, `_file_by_hand` now also types `git checkout -- .gitmodules`, so once the mode is given back the typed commands put the member back on `main` and leave `git status` clean. - `_file_by_hand` serves every recorded file, so an unreadable `family.yaml` under `bump` and `remove` now gets `git checkout -- family.yaml` after the index entry: with the mode given back, `family.yaml` holds its recorded bytes, where at base it stayed the copy the verb had rewritten. - `siblings.py`'s `submodule_urls` asks the same way. `path_unreadable(code, ...)` is new and `member_unreadable` delegates to it; `_run_placement` and `dispatch_all` catch the refusal and return 2 before anything is cloned, fetched or run. `siblings.py` (dry run, real run, `--make`) and `family.py siblings` give `gitmodules-unreadable`, exit 2, where base gave a traceback (3.12.3) or, from 3.14, read no url. - Beside #1172's `git-repo-unreadable` (#1148): the holder's own `.git` is asked first, so where both it and `.gitmodules` cannot be read the run refuses once, by that code, exit 2, and never asks `.gitmodules`. `member_unreadable` keeps #1172's `code` keyword (default `member-unreadable`) and passes it to `path_unreadable(code, ...)`, so `_refuse_an_unreadable_root` still raises `git-repo-unreadable`, `submodule_urls` raises `gitmodules-unreadable`, and every other caller gets `member-unreadable`. The docstring's exit-2 paragraph names #1148's refusal first, then this one. - `tests/test_family_gitmodules_unreadable.py` holds 42 rows. In `tests/test_path_guard_hygiene.py` the three `KNOWN_OPEN` entries for these sites (`_gitmodules_names`, `_sections_giving` and `submodule_urls`) are taken out, as its stale-entry check demanded. Main took out the other 8 with #1144, so the merged `KNOWN_OPEN` is empty. - Measured, with a holder whose `.gitmodules` is a link into a folder at mode 000, on Python 3.12.3 and a 3.14-like shim, base `038dafba` against head; the same link into a folder at 755 reads the file at both, as a control. - `siblings.py` went from a traceback (3.12.3), or on the shim from "would clone" in the dry run and `CLONE FAILED` in the real run, to `gitmodules-unreadable`, exit 2, with nothing cloned. - `remove`'s rollback went from a traceback with `members/IRRS` left gone (3.12.3), or from "comes back only from its remote" (shim), to exit 2 with the cure and typed commands that work. - The new file at base: 31 failed and 11 passed on both, the same 31; the 11 are the controls and the order guard. At `74096eb4`, 42 passed on both. - Known limits: - `add` over a `.gitmodules` at mode 000 is refused first by `_submodule_paths`, and the holder's `validate-family.py` does the same in `_gitmodules_listed`. Both give `gitmodules-unreadable` with "mend the file by hand", not the `chmod` cure (measured; the validator's refusal is exit 2). They are other sites of #1110. - The rollback step that restores `.gitmodules` gives a permission its own cure, which says "on every directory above it inside the holder", even where the file is a link out of the holder. It is #430's wording for every rollback step. - The rollback's leg loop names a member's own unreadable `.gitmodules` by its reason and still raises `member-store-gone`. It cannot be reached in practice, because git has just written that file. - The rollback sentence's cure for a cause other than a permission (`OTHER_CURE`) has no row: `_bytes` fails first, so it is reached only in a race. - #1172 (for #1148) landed first, as `2fde6c3d`, and changes the same `siblings.py`. The merge keeps both forms, `member_unreadable`'s `code=` and `path_unreadable(code, ...)`, since folding one into the other changes lines outside the merge's hunks. - Not in this PR: `add`'s `_submodule_paths`, the holder's `validate-family.py` `_gitmodules_listed` and #1110's other sites, each its own slice. The precedence row (no row pins which refusal wins when both apply), the fold of `member_unreadable`'s two forms and the docstring's ragged wrap, which r1164d's review names, are #1287. Review: lane 1's independent reviewers reviewed each round. r1164 reviewed `4352ac2f`, stopped at LAST STEP, and found it NOT READY for one MUST, two SHOULDs and four NITs (#1164 issuecomment-6350529312). r1164b found `3162b523` NOT READY for one SHOULD, with no MUST (issuecomment-6356410999). r1164c found `74096eb4` provisionally READY with two NITs, both applied to the body (issuecomment-6364558859). Lane 1 then ran r1164c's unrun parts, and #1164 counted READY at `74096eb4`: the 16 mutants r1164c had not run were all killed (20 of 20 for the round with its own four), and the new file passed on the trees merged over #1147 and over #1172, 42 each (issuecomment-6371395973). After #1172 landed, lane 1 merged main into the branch as `16ff9391`, a real merge in which two files conflicted and each was resolved inside its hunks (issuecomment-6746028136). r1164d, lane 1's independent delta reviewer, found `16ff9391` READY with no MUST and no SHOULD (#1164 issuecomment-6752095110); its NITs on code are #1287. Tests, under a stub `gh` with a bogus token, on Python 3.12.3: lane 1's gate at `16ff9391` gave 333 passed for this PR's files (`tests/test_family_gitmodules_unreadable.py`, `tests/test_family_py_unreadable.py`, `tests/test_family_bump_remove_rollback.py` and `tests/test_update_shape_kept_helper.py`), 412 passed and 2 skipped for #1172's `tests/test_pinned_root_git_unreadable.py` and `tests/test_validate_family_unreadable.py` with `tests/test_scaffold_leg_path_collisions.py`, `tests/test_path_guard_hygiene.py` and `tests/test_no_auto_maintenance.py` (the 2 skips need a session begun without `GIT_CONFIG_GLOBAL`), 171 passed for the doc trio, `tests/test_shape_doctor.py` in 4 shards (113 passed; 113 passed; 109 passed and 4 skipped; 107 passed and 3 skipped), and 2774 passed and 20 skipped, none failed, for the 32 other files that name `siblings`, in 6 calls. Mutants: 4 of 4 killed on the merge's resolved hunks, run at `16ff9391`, and 30 of 30 killed on the changed lines, run before the merge. It lands by fast refresh (Brett Heap, 2026-10-15T22:48:35Z). Its H0 `16ff9391` is green on Linux and SonarCloud. The branch was never rebased. After H0, the only commit is update-branch's clean merge of main, giving 61f11e6, which is green on SonarCloud and Git Bash. Lane 1's gate passed on its tree: 10 pytest calls over `tests/test_family_gitmodules_unreadable.py`, `tests/test_family_py_unreadable.py`, `tests/test_family_bump_remove_rollback.py`, `tests/test_update_shape_kept_helper.py`, `tests/test_pinned_root_git_unreadable.py`, `tests/test_validate_family_unreadable.py`, `tests/test_validate_family_index_gitmodules.py`, `tests/test_scaffold_leg_path_collisions.py`, `tests/test_path_guard_hygiene.py`, `tests/test_no_auto_maintenance.py`, `tests/test_agents_md_codes.py`, `tests/test_cli_reference.py`, `tests/test_repo_hygiene.py`, `tests/test_family.py`, `tests/test_readme_windows_quoting_sentence.py`, `tests/test_family_printed_quoting.py`, `tests/test_family_remedy_lines.py`, `tests/test_remove_add_remedies_family_root.py`, `tests/test_bump_remedies_family_root.py` and `tests/test_shape_doctor.py` in 4 shards: 1,699 passed, 5 skipped. Part of #1110 Lane: openreposhape-1 (openRepoShape-1) 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) (#1248) `scripts/shape-doctor.py`'s `mount_read`, the one question the `legs`, `leg shape files`, `placement` and `members` rows share, asked a mount's git directory's `HEAD` by `stat` alone (#1174). A `HEAD` at mode 000 stats, so git, run in the mount, could not read it. A gitfile leg's `legs` row said `spec: populated, but git cannot read a HEAD in it` and `placement` said `spec: it is not a git repository`. A `.git`-directory leg went further: git passed over the leg's `.git` to the root's repository, so `legs` quoted the root's HEAD as the leg's, with a `submodule update --checkout` as the NEXT. A member read `members/IRRS: checked out at ?, pinned at <pin>`. The verdict was DRIFTED each time, while the gate refuses `pin-submodule-unreadable` (#1239). `regular_file_opens(path)` is the doctor's copy of the gate's `_gitfile_opens` (as `git_dir_of` is of `_leg_git_dir`, #1174): it opens `path` only where it is a regular file, since the open of a FIFO waits for a writer, answers False for an open that finds nothing, and raises a refused open. In `mount_read`, after `git_dir_of`, a `HEAD` that is there is named as the gate names it and opened with it. A refused open is the mount's `mount_cannot_be_read` line, `spec: .git/modules/spec/HEAD: cannot be read (Permission denied)` or `spec/.git/HEAD: ...`, and for a member `members/IRRS: .git/modules/members/IRRS/HEAD: ...`. The rows then read INVALID (the `pins` row's, or the `family` row's for a holder), with this doctor again as the NEXT and the gate's advice as the WHY, and never DRIFTED. The name comes before the open, behind the `stat` of `HEAD`, as the gate's does, so a refused `stat` still names the git directory. `root_git_read`, which asks the root's own `.git/HEAD` (#1147), gets the same open, as the gate's `_refuse_an_unreadable_root` does through #1239's. A refused open is the root's line, `.git/HEAD: cannot be read (<reason>)`, spelled relative to the root in POSIX on every platform, and the verdict is `INVALID (pins)`, where it was DRIFTED with `no gitlink recorded`. The helper is copied and not imported because the gate is a pinned copy the doctor does not load (#430's rule); a row holds the two to one answer for each shape. Not changed: a git directory with no `HEAD`, a gitfile that names none, and a `HEAD` that is gone at the open or is no regular file are left to git, and `leg shape files` asks nothing of the git directory. A FIFO `HEAD` still hangs the doctor and the gate, in git's own open. Git's other reads of a git directory (`config`, `objects`, `refs`, `commondir`) are a separate ruling, and `validate-family.py`'s member check is #1221's, with its `HEAD` case #1256's. Known limit: with the root's `.git/HEAD` and a leg's own `HEAD` both at 000, `placement` names the root's line, and mending it shows the leg's refusal on the next run; the verdict is `INVALID (pins)` either way. `tests/test_doctor_unreadable_paths.py` gains 24 rows for the leg and member `HEAD` and 40 for the root, and `tests/test_root_git_unreadable.py` 9: the mode-000 cells, the open refused in process for a permission and for an I/O error, a git directory with no `HEAD`, and parity rows that hold the doctor to the gate over eight `HEAD` shapes on both leg layouts and over nine shapes on three root layouts. Against main's `shape-doctor.py` the first 52 `HEAD` rows give 13 failed, 39 passed, and without the root's open the 192 rows of the two files give 18 failed, 174 passed, the failures being exactly the new refusal rows. `tests/test_root_git_unreadable.py` and `tests/test_doctor_unreadable_paths.py` in one pytest, since the second imports from the first, give 192 passed; `tests/test_validate_pins_spelled_and_named.py` 116 passed, `tests/test_shape_doctor.py` 446 passed, 3 skipped, and the guards 343 passed, 3 skipped. All 11 mutants run are killed. Closes #1222 Lane: openreposhape-3 (openRepoShape-3) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…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]>



What
The case is #1146's, found by r1144: an assembly root whose own
.gitis a link into a folder at mode 000, so this user cannot search it. The doctor read it as two legs off their pins. Each of the root's own validators ended in a traceback.Measured in a scaffold's recursive clone, with base
038dafba(main) and this head, on Python 3.12.3, and under a 3.14-likesitecustomizein whichPath.is_file,is_dir,existsandis_symlinkanswer False to anyOSError.<abs>is the absolute path..gitlinked into a folder at 000 (the issue's case)DRIFTED (2 leg(s) not at the pin).legs:no gitlink recordedfor each leg.placement: each legis not a git repository.manifestandpins:crashed before reaching a verdict (exit 1): PermissionError. Run directly, each validator: aPermissionErrortraceback, exit 1, on 3.12;REFUSED not-a-git-repo: no .git found at or above <root>, exit 2, under the shimINVALID (manifest, pins).legs: FINDING.git: cannot be read (Permission denied), so no gitlink is read and no leg is compared with its pin, NEXT this doctor again, WHY thechmodcure.placement: n/a, the same line. Each validator:REFUSED git-repo-unreadable: .git: cannot be read (Permission denied)and thechmodcure, exit 2, no traceback.gita directory at 000, or at 444DRIFTED (2 leg(s) not at the pin),no gitlink recorded.validate-pins.py:REFUSED pin-gitlink-absent: no gitlink (mode 160000) recorded at 'spec'under the lockstep remedyINVALID (pins).legsandplacementname.git: cannot be read (Permission denied).validate-pins.pyrefusesgit-repo-unreadablenaming.git.validate-manifest.pypasses: it runs no git.gita gitfile at 000.gita gitfile naming a git directory in a folder at 000INVALID (pins). The line names the git directory whole, since it is outside the root:<abs>/locked/projgit: cannot be read (Permission denied).gitat 000, and the spec leg's repository in a.gitdirectory of its own, with.specify/memory.mdstaged in itDRIFTED (1 leg(s) not at the pin).legs:no gitlink recordedfor each leg.placement: FINDING1 path(s) sit in a leg the policy puts elsewhere: spec/.specify/: root by rule root-spec-kit (1 root in the spec leg), the code legit is not a git repositoryMISPLACED (1 path).legsandpinsname.gitas in the rows above.placement: the same FINDING,[spec: 2 path(s) over 2 of 6 tracked file(s); code: read through the root's repository, and .git: cannot be read (Permission denied)], and--placement-planwrites the plan, the code leg'sstate:that line.git; a.gitlink to nothing; a.gitlink to itselfCOMPLIANT; for the two links,DRIFTEDandnot-a-git-repo(no.gitis there)Each doctor report is the same on 3.12 and under the shim, on both sides. The doctor runs each validator with
-S, so nositecustomizeloads in the child. The validators' shim answers were measured by running them directly.Why
The validators: each one's own
_is_a, notfind_repo_root. Both raised insidescripts/repo_shape.py'sfind_repo_root, at(candidate / ".git").exists().repo_shape.pyis a shape copy too, and a pinned validator must not rely on a newer one (repo_shape.py'sRefusalgives every refusal built without a remediation the assembly root's own (run git submodule update --init --recursive, then python3 scripts/validate-pins.py ... contracts/<leg>-pin.yaml), so in a family holderfamily.py addover an unparsable.gitmodules(git-failed),bumpon afamily.yamlof the wrong kind, and the holder's ownvalidate-family.pyon a shortpin.commiteach tell the operator to run a file no holder carries and to move a leg pin a holder does not have #370, Pinned shape copies: AGENTS-shape.md'sCONTRACTS_DIRsentence is false for every scaffolded root, and the chain WARNING offers remedies the scaffold lacks (one shape bump before the v1.1.0 tag) #610). That is why 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 slices put a local_is_ain each file.find_repo_rootstays as it is, on the hygiene test'sBENIGNlist asPINNED. Each validator'smainnow calls_refuse_an_unreadable_root(start)first. It asks each.gitthatfind_repo_rootwould ask, in the same order, with the file's own_is_a:exists()passes it;statis refused by name, in the file's own_unreadable_filewords;--rootgiven resolves, so--root .from a folder inside the root walks up from there;.gitthat is there, a directory or a gitfile, so a.gitabove the root is never asked.After it,
find_repo_rootanswers as before on every Python. A.gitabove the--rootgiven is named whole.One code,
git-repo-unreadable, in both gates. It is the sibling ofnot-a-git-repo, which the same step raises. Each remedy says what that validator reads the.gitfor, then the cause's advice: thechmodcure for a permission,OTHER_REASONfor anything else.validate-pins.pyalso asks the git directory;validate-manifest.pydoes not.validate-pins.pyreads every gitlink through git. So the first.gitthat is there is asked what validate-pins.py and repo_shape.py after #919: gh's stderr that is not UTF-8 ends in a traceback, a leg's git directory this user cannot read is called an unresolvable pin with no reason, and two gh details still name the repository raw #968 asks of a leg's (_refuse_an_unreadable_git_dir, now taking a code and what it reads):HEADit cannot reach.On base, git said of each that the root records no gitlink, and the gate refused
pin-gitlink-absent.validate-manifest.pyruns no git, so it asks only thestatthatexists()asked. With a readable.gitover an unreadable git directory it passes, which is a true answer aboutproject.yaml.The doctor: one finding, in the
legsrow.root_git_readasks whatvalidate-pins.pyasks, and names the git directory as the gate does: relative to the root inside it, whole outside it, throughshown_path, from a gitfile whose line ends in LF or CR LF. Where it is refused:legsrow says the gate's line once, since it is one fact about the root, not one per leg;validate-pins.pyasserts the same refusal;whythe gate's advice for the cause (cannot_read_why). This is what 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 gives a leg mount and shape-doctor.py: for a pin or acontracts/this user cannot read, thelegs,manifest kindsandshape currencyrows disagree with validate-pins.py's named refusal, andmanifest kindsnames agit checkout HEAD --that discards work #847 a pin: a person mends a mode or an owner, and no git line reaches it.The
manifestandpinsrows are the validators' own refusals, which is what those rows always report.No drift: a third rule beside
cannot_be_readandmount_cannot_be_read. Each leg's entry hasgitlink: nulland carries the line ingitlink_cannot_be_read. It also carriespin,populated,head,own_gitandunborn, each null, so it has every key a leg's entry has and a reader of--jsongets noKeyError.drifted_reasons, the one reader of these entries in the tree, reads them with.get; no test asserted them before this PR.drifted_reasonscounts no such leg, and still counts a leg beside it that it could read and is off its pin.placementaudits every leg git can read, and gives the root's line to each leg git cannot read because of it. A leg's repository usually lives under the root's.git/modules/, and git saidit is not a git repositoryof such a leg, a claim about the leg.audit_legnow gives the root's line, ingitlink_cannot_be_readand as itsstate, to a leg whose.gitis there and leads to a repository git names no top level for. Every other leg is as it was:.gitof its own, or one git answers for from another repository, keeps git's answer, since it is not its own repository whatever the root's.gitsays;.git) keeps that line.The row says the root's line once,
n/a, only where it is every leg's, which is the issue's case.The verdict follows the ladder. The ladder runs: an unfinished merge, then DRIFTED, MISPLACED, INVALID, SHAPE BEHIND.
INVALID (legs), never DRIFTED..gitcannot be read, no leg is compared with its pin, as shape-doctor.py: for a pin or acontracts/this user cannot read, thelegs,manifest kindsandshape currencyrows disagree with validate-pins.py's named refusal, andmanifest kindsnames agit checkout HEAD --that discards work #847 does for an unread pin. MISPLACED outranks INVALID because a path in the wrong leg is a fact about the shape that no validator sees, while thelegsandpinsrows still name.gitin the table, with their own NEXT.Not touched:
.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's eight sites (check_agent_files,check_what_is_here,check_the_way_in,check_the_other_way_in,origin_org,repo_local_origin_name,scripts/shape_advisory.py);.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);scripts/repo_shape.py.No new bare guard:
tests/test_path_guard_hygiene.pypasses with no entry changed.Tests
tests/test_root_git_unreadable.py, new, had 47 rows atb75babee; it had 50 ata2fc1da8(see "Merge with main and the order after #1200" below) and has 51 at4d299dd3(see "Review round (rv1147c: one SHOULD)" below).CANNOT_RUN_AS_ROOT) and restore the mode in afinally:legsandplacemententry held whole;--roota folder inside it;.gitat 000 and at 444;MISPLACED (1 path);.gitof its own, which keeps git's answer.refused_stat,refusing,as_python_314):HEAD, a gitfile that cannot be opened, a git directory outside the root and inside it, a gitfile ending in CR LF, and a folder whose name is not printable (POSIX only);.gitabove the--rootgiven, a relative--root .run fromcontracts/, and a stop at a readable gitfile with a refused.gitabove it;validate-pins.py's git-directory step with a subfolder--root;placementauditing each leg git reads beside a refused root.git, and, with git's answers put in by hand, giving the root's line only to a leg git names no repository for;drifted_reasonswith a readable leg beside an unread one.HEAD): neither row sayscannot be read;.gitabove a readable root is never asked.Base vs head. Base is
038dafbawith the new file laid over it:038dafbaThe 10 rows that pass on base:
test_a_root_whose_git_can_be_read_is_unchanged, the 5 rows oftest_what_answers_absent_is_left_to_git_as_before, andtest_a_git_above_the_root_is_never_askedfor each gate;test_the_walk_stops_at_a_git_that_is_a_gitfilefor each gate: base never asks a.gitabove the root, so a walk that stops at a gitfile passes there too.The other 37 fail on base:
DRIFTED (... not at the pin)whereINVALID (...)orMISPLACED (1 path)is expected; the gates'PermissionErrortraceback on 3.12, andREFUSED not-a-git-repounder the shim and in process;legsandplacementrows that never name.git;AttributeError). Six are control-like: the 5 rows oftest_the_gates_ask_nothing_more_of_what_answers_absentandtest_a_git_under_a_file_answers_absent. The others are the 6 rows oftest_the_doctor_and_the_gate_name_one_git_directory, the drift row, and the 2 rows that put git's answers in by hand.Mutants: 49 of 50 killed. That is r1147's 21, w1146's 21 and 8 of this round's change. Each was applied once to a scratch clone of the final head
b75babee, the new file was run there, and the file was put back from its bytes and checked by sha256:shape-doctor.py9f3b84fb...,validate-pins.py1c23d20b...,validate-manifest.pydbbed49b.... The clones were left clean.Five of the 42 inherited mutants, r1147's De, Df and Dh and w1146's D7 and D9, are restated on the code that now holds what they mutate, since S2 and N7 moved it. The one survivor is r1147's Da, which r1147 calls equivalent: dropping the absent-error filter in
root_git_readdiffers only in a race between thestatand the read.test_the_doctor_and_the_gate_name_one_git_directory[gitfile-ending-in-cr-lf-names-a-directory-inside]shown_path...[gitfile-names-an-unprintable-directory]gitlink_cannot_be_readinplacement's entriesplacementdetail, the S2 rowstest_a_relative_root_is_walked_from_where_it_resolves, per gatetest_the_walk_stops_at_a_git_that_is_a_gitfile[validate-manifest.py]test_the_git_directory_above_the_folder_given_is_named_whole.gitof its own is given it tootest_a_leg_with_no_git_of_its_own_keeps_gits_answer,...[no-git-of-its-own]...[git-answers-from-another-repository].gitrow, the hand-put answersplacementdeclines every leg againThe other 35 inherited mutants are killed as they were.
The gate, on the final head
b75babee, in a scratch clone: Python 3.12.3 and git 2.43.0. The probe environment was a stubghfirst onPATH,GH_TOKENbogus, an emptyGH_CONFIG_DIR,GIT_CONFIG_GLOBAL=/dev/nullandGIT_SSH_COMMAND=false. At most four pytest processes ran at once, each under 535 s (the longest took 307 s). Each id list was built with/usr/bin/python3into a file and checked non-empty before pytest ran.new,new-shimtests/test_root_git_unreadable.py, on 3.12 and under the shimunreadtest_doctor_unreadable_paths,test_doctor_unreadable_pinhygtest_path_guard_hygienedocstest_scaffold_leg_path_collisionsand the doc trio (test_agents_md_codes,test_cli_reference,test_repo_hygiene)sd0-sd3tests/test_shape_doctor.py, 4 shardsvalvalidate_pinsnaming filespl00-pl09placementThat is 6740 ids, 6737 passed and 3 skipped, and the new file's 47 again under the shim.
With a readable root
.gitthis round changes nothing the doctor says. Each new branch is taken only whereroot_git_readgives a line, andNOT_A_GIT_REPOSITORYholds the very sentence it replaces. The validators are byte for byte those ofe86fb8f4. So w1146's first gate still stands for everything else: 9303 ids over 118 test files (andtests/conftest.py), on691743e3ande86fb8f4. The tests that refuse a root's.gitin the doctor are in the gate above.Review r1147
--root .and for a walk that stops at a readable gitfile. They kill Pe, Vc and Vf.placementaudits the legs git can read, as above. In r1147's case the verdict isMISPLACED (1 path), beside thelegsandpinsrows naming.git.placement's--jsonentries, and for the git-directory step under a subfolder--root. They kill Db, Dc, Dh and Ph.legsentry carries the null keys.Pinned copy
templates/assembly-root/scripts/validate-pins.pyandvalidate-manifest.pyare inCOPIED_VERBATIM. A project'sscripts/holds them pinned incontracts/shape-pin.yaml. No file is added to or taken from a pinned list, so the materializers,update-shape.pyand the digests need no change. Measured against a standard one commit past a project's pin:update-shape.py check:upstream-changed scripts/validate-pins.py,upstream-changed scripts/validate-manifest.py,unchangedfor the other 9;.git:COMPLIANT, SHAPE BEHIND (2 upstream-changed, 0 upstream-added);INVALID (manifest, pins). Thelegsrow names.git: cannot be read (Permission denied)with the cure. The validator rows still saycrashed ... PermissionErroruntil the project runsupdate-shape.py applyand takes the new copies.scripts/repo_shape.py, also a pinned copy in every root and holder, is unchanged. The new code imports nothing new from it.No
--helptext changes, sodocs/cli.mdis unchanged. No refusal code is added toAGENTS.md.Merge with main and the order after #1200
Main now holds lane 3's #1200 (
50869f38, for #1174). It is merged here as569ea056("Merge main into #1146's branch"), clean bygit merge-tree. The two clash in meaning, as lane 3 noted on this PR. #1200'smount_readasks each leg's git directory, andaudit_legreturned on its refusal,code: .git/modules/code: cannot be read (Permission denied), before this PR'sroot_linewas reached. With the root's own.gitunreadable, the legs' git directories under it are unreadable too, soplacementnamed that symptom once per leg instead of the root's line once. On the merge, 5 of the new file's 47 rows failed, all onplacement's reason.a2fc1da8gives the root's line first. Whereroot_lineis set andmount_readrefused a leg whose mount it had read (the refusal is on the leg's git directory, not on the mount: see "Review round (rv1147c: one SHOULD)" below),read_through_the_rootasks whether the leg's git directory is inside the root's own: under the root's.git, or under the directory a root's gitfile names. The second is where git keeps a submodule's for a root that is a linked worktree (../../main/.git/worktrees/wt/modules/spec) or a submodule itself (../../.git/modules/root/modules/spec), measured with git 2.43.0. Every other refusal keepsmount_read's line: a mount, a.gitor a gitfile this user cannot read, and a leg's own.gitdirectory, whose repository is not the root's. With the root's.gitreadable,root_lineis None and #1200's refusal stands as it is.validate-pins.pyalready refuses the root before any leg (maincalls_refuse_an_unreadable_rootfirst), andvalidate-manifest.pyasks no leg's git directory, so neither changes.Rows. 3 new, in process, on every platform and as root, with every
HEAD'sstatrefused:.gitand under the directory its gitfile names (test_a_leg_git_directory_inside_the_roots_is_given_the_roots_line, 2 rows);.gitdirectory, keepingspec/.git: cannot be read(test_a_git_directory_of_the_legs_own_keeps_its_own_line).The new file had 50 rows at
a2fc1da8and has 51 at4d299dd3. Base is the merge'sshape-doctor.pywith the new file laid over it, run over 54 ids: the new file's 50, and #1200's 4 rows for a refused leg git directory (test_a_leg_git_directory_refused_is_named_on_every_python,test_a_git_directory_of_its_own_refused_is_not_the_roots). Base: 8 failed (the 5 and the 3 new), 46 passed. Head: 54 passed.Mutants: 7 of 7 killed. Each was applied once to
shape-doctor.pyin a scratch clone of the merge569ea056, with the head's file and the new test file laid over it, and run over the same 54 ids. The file was then put back from the head's bytes and checked by blob:398504a0, the file's blob ata2fc1da8.mount_read's refusal first againroot_linechecktest_a_leg_git_directory_refused_is_named_on_every_python[head-stat]and[head-io-error]test_the_rows_name_a_refused_root_git_on_every_python[permission]and[io-error],test_a_git_directory_of_the_legs_own_keeps_its_own_linetest_a_leg_git_directory_inside_the_roots_is_given_the_roots_line[under-the-directory-the-roots-gitfile-names]normpathof the leg's git directoryspec/../.git/modules/spec, as spelled, is never under.gitmount_readrefused the legtest_placement_audits_each_leg_git_reads_beside_a_refused_root_git,test_only_a_leg_git_names_no_repository_for_is_given_the_roots_line[git-answers-from-another-repository]The gate on
a2fc1da8, lane 1's, on tree50a97fd7, 8 calls from 14:47:09Z to 14:54:49Z on 2026-10-24:rgutests/test_root_git_unreadable.pyduptests/test_doctor_unreadable_paths.pyhygtest_path_guard_hygiene,test_no_auto_maintenance,test_scaffold_leg_path_collisionsdocstest_agents_md_codes,test_cli_reference,test_repo_hygiene)sd0-sd3tests/test_shape_doctor.py, 449 ids in 4 shardsThat is 1,023 ids: 1,018 passed and 5 skipped. The worktree was still at
a2fc1da8and clean after it.Review round (rv1147c: one SHOULD)
Lane 5's re-review of
a2fc1da8(rv1147c, posted as #1147 issuecomment-6723841826) was READY with no MUST and one SHOULD, which lane 1 chose to fix in code. This round is4d299dd3, on top ofa2fc1da8; main is not merged here.mount_read's. With the spec mount at mode 0100 or 0300,mount_readrefuses the listing (spec: cannot be listed).read_through_the_rootcould still readspec/.git, because the mount can be searched, so it returned True andaudit_leggave the leg the root's line,.git: cannot be read. The text above says "Every other refusal keepsmount_read's line: a mount, ..." and the S2 bullet says "a leg refused for its own reason (its mount, its.git) keeps that line". Neither was true for this mount. rv1147c measured it with real modes as uid 1000 and the root's.gitat 000. The verdict isINVALID (pins)in every case, as rv1147c measured on all three doctors, so only the text of theplacementrow changed, and the leg's own line appeared on the run after the root was mended.audit_legaskspopulatedbefore it asksread_through_the_root:if (unread is not None and populated and root_line is not None and read_through_the_root(root, rel)).populatedis True only wheremount_readgot as far as the mount's.git: a mount it could not stat or list returnsFalsethere, and a refusal on the leg's.git, its gitfile or its git directory returnsTrue. So a mount refused for its own reason is never given the root's line, and the comment beside it, "what mends the root's mends it", now says it holds only where the mount was read. Nothing else inshape-doctor.pychanges.Measured with real modes (uid 1000, Python 3.12.3, git 2.43.0), on
placement'slegsdetail. The four mount modes ran twice: with the root's.gitreally at 000, and with everyHEAD'sstatrefused by a stand-in. The gitfile cases ran with everyHEADrefused, and the mount whose ownstatis refused (by a stand-in) the same way.codeis the root's line,.git: cannot be read (Permission denied), in every case.a2fc1da8(rv1147c's measure)4d299dd3spec:.git: cannot be read, the root's line, withplacementn/aspec:spec: cannot be listed (Permission denied), inmount_cannot_be_readspec: cannot be listed(the mount cannot be searched, sospec/.gitis not read through the root)spec/.git: cannot be readspec/.git: cannot be read (Permission denied), inmount_cannot_be_readstatrefused, by a stand-inspec: cannot be read (Permission denied), inmount_cannot_be_read.gitdirectory (the control row)spec/.git: cannot be readMy probe of those cases is not in the PR: its 11 rows, in a scratch clone of
4d299dd3, all passed. With the word dropped, 5 failed (the mount at 0100 and at 0300, each in both set-ups, and the mount whosestatis refused) and 6 passed. So the two sentences are true at this head for a mount (0100, 0300, 0000, 0400, astatrefused), a.gitor a gitfile (the gitfile at 0000 and 0200, the mount at 0400) and a leg's own.gitdirectory.The row.
test_a_mount_that_cannot_be_listed_keeps_its_own_line, in process, on every platform and as root, in rv1147c's candidate: everyHEADrefused, and the spec mount'siterdirrefused as a mount at 0100 or 0300 refuses it. It assertsplacement's status isn/aand that the spec leg's entry isspec: cannot be listed (Permission denied)inmount_cannot_be_readand the code leg's is the root's line ingitlink_cannot_be_read. Base isa2fc1da8'sshape-doctor.py(blob398504a0) with the row laid over it: 1 failed, onstate.git: cannot be read (Permission denied)wherespec: cannot be listed (Permission denied)is expected. Head: passed. The new file has 51 rows.Mutants: 5 of 7 killed. Each was applied once to a scratch clone of
4d299dd3and run overtests/test_root_git_unreadable.pyandtests/test_doctor_unreadable_paths.py(119 ids). The two files were then restored bygit checkoutand checked by blob after every run:shape-doctor.py89a7ca58andtests/test_root_git_unreadable.py5aabae89, clean.populateddropped (a2fc1da8's condition)populatedreplaced byTruecode(a mutant of the row, on the fixed code)own_gitforpopulated(False on every refusal)not populatednot unread[2], the listing flag, forpopulatedBoth survivors are equivalent on a real filesystem. K4, from the code:
git_dir_ofreturns None only for a gitfile that does not start withgitdir:, andmount_readthen asks noHEAD, so it refuses such a leg only when the.gitstator the gitfile read is refused, andread_through_the_rootmeets the same refusal ingit_dir_ofand returns False before theNonecheck. rv1147c said K4 would be fully equivalent with the word (it differed only in S1's case ata2fc1da8). M6, from the code: the listing flag differs frompopulatedonly for a mount whose ownstatis refused, whose.gita real filesystem refuses too. A stand-in that refuses the mount'sstatalone does tell them apart: the probe above fails under M6 and under M1, and passes at4d299dd3. No row in the PR does that yet.The gate on
4d299dd3, Python 3.12.3 and git 2.43.0, in the worktree, in the probe environment (a stubghfirst onPATH,GH_TOKENbogus, an emptyGH_CONFIG_DIR,GIT_CONFIG_GLOBAL=/dev/null,GIT_SSH_COMMAND=false). At most two pytest processes of mine ran at once. The shard lists were built with/usr/bin/python3into files and checked non-empty.c1tests/test_root_git_unreadable.py,tests/test_doctor_unreadable_paths.pysd0-sd3tests/test_shape_doctor.py, 449 ids in 4 shardsg1test_scaffold_leg_path_collisions,test_path_guard_hygiene,test_no_auto_maintenanceg2test_agents_md_codes,test_cli_reference,test_repo_hygiene)That is 1,024 ids: 1,019 passed and 5 skipped. The 3 skips in
tests/test_shape_doctor.pyare the 3 rv1147c found ata2fc1da8(:10516, the PowerShell line that is printed only on a Windows host); the other 2 are ing1. The worktree was still at4d299dd3and clean after it.Known limits
find_repo_rootkeep the defect. The assembly root'sbootstrap.py, and the family root'svalidate-family.py,bootstrap.pyandsiblings.py, measured with--roota folder whose.gitlinks into a folder at 000: aPermissionErrortraceback, exit 1, on 3.12, andREFUSED not-a-git-repounder the shim. shape-doctor.py: a shape root whose own.gitis a link into a folder this user cannot search reads DRIFTED, its legs as having no gitlink, and both of its validators crash with PermissionError #1146 names the two validators. The four need the same local walk in four more pinned copies. That is filed as bootstrap.py, and the family root's validate-family.py, bootstrap.py and siblings.py: a root whose own.gitthis user cannot read is a PermissionError traceback on 3.12, ornot-a-git-repowhereexists()answers False, not refused by name #1148.chmodcure says "every directory above it inside the root". In the issue's case the locked folder is outside the root, and the line names.git, which is a link:chmod u+rx .gitfollows the link and is refused, since the folder to mend is the one the link leads into. These are the gate's words, unchanged here, as r1111's N5 left them..gitat all still readsDRIFTED (2 leg(s) not at the pin). That covers a.gitlink to nothing or to itself, which 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 calls absent. Those rows are unchanged, and they are controls here, not a fix. It covers a root with no.gitunder a parent whose.gitcannot be read too:validate-pins.pywalks up to that.git, asfind_repo_rootdoes, and refusesgit-repo-unreadable: <abs>/.git, while the doctor, which asks only the root's own.git, says DRIFTED..gitcannot be read, thelegsrow says that alone. An unreadable pin or a moved HEAD beside it is said by the run after it is mended. So the verdict can read MISPLACED where that run reads DRIFTED: a leg with its own repository, a commit past its pin and a path in the wrong leg readsMISPLACED (1 path)here andDRIFTED (1 leg(s) not at the pin)once the root's.gitis readable (r1147b's N1).placementgives the root's line to a leg whose.gitis there and that git names no repository for, where nothing refuses the leg's own git directory. Since shape-doctor.py: a leg or member whose git directory this user cannot read is named in the gate's words,spec: .git/modules/spec: cannot be read (<reason>), so thelegsandmembersrows never count it as drift,placementnever calls it "not a git repository", and no HEAD is read for it (#1174) #1200 that is two cases: a leg whose gitfile names a folder that does not exist, and a leg whose.gitfolder has noHEAD. Each is told the root's line while the root's.gitcannot be read; the run after the root's is mended gives git's answer for it. With the root readable, the first saysit is not a git repository. A leg whose own gitfile names an unreadable git directory outside the root's is no longer one of them: shape-doctor.py: a leg or member whose git directory this user cannot read is named in the gate's words,spec: .git/modules/spec: cannot be read (<reason>), so thelegsandmembersrows never count it as drift,placementnever calls it "not a git repository", and no HEAD is read for it (#1174) #1200'smount_readrefuses it by name, and that line stands.audit_leg's docstring says less than this rule (r1147b's N2)..gitis a link, with legs whose gitfiles name the link's target rather than.git/modules/<leg>, keepsmount_read's line for each leg inplacement.read_through_the_rootcompares the paths as spelled, afternormpath, and resolves no link, so such a leg's git directory is not found inside the root's. Thelegsrow still says the root's line once..gitcannot be read is not changed here. Neither is themembersrow, because 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 code is avoided. bootstrap.py, and the family root's validate-family.py, bootstrap.py and siblings.py: a root whose own.gitthis user cannot read is a PermissionError traceback on 3.12, ornot-a-git-repowhereexists()answers False, not refused by name #1148 asks for it to be measured.statof.git, the open of a gitfile, thestatof the git directory'sHEAD. A git directory this user can search but whose index it cannot read is still git's answer.Closes #1146
Lane: openreposhape-1 (openRepoShape-1)
🤖 Generated with Claude Code
Summary by Sourcery
Handle unreadable assembly-root
.gitrepositories as explicit validation refusals instead of drift, crashes, or misleading missing-repository results.New Features:
.gitrepositories consistently in both pinned validators with a dedicated exit-2 refusal.Bug Fixes:
not-a-git-reporesults when the root's.gitcannot be read.Enhancements:
Tests: