Repository navigation
update-shape.py: prepare asks the shape pin's source_repository: 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
Conversation
…once, before the upstream opens and with `--upstream` passed too, refusing a path or a value that is no `owner/repo` in the pin's name; shape-doctor.py answers as it did (#1203) `prepare` read the pin's `source_repository:` and used it two ways. With no `--upstream` it was the upstream `open_upstream` opened, and a value naming something in the working directory that is no repository (`contracts`, `scripts/repo_shape.py`) was `update-upstream-not-a-repo: --upstream contracts exists but is not a git repository`, a flag nobody passed. With `--upstream` passed it was never asked: a value ending in a line feed went into `apply`'s commit subject and the `gh pr create` line it prints, both broken by it, exit 0 (#1166's review, findings 3 and 9). `pin_source` now asks it once, in `prepare`, before the upstream is opened, whichever way the run reaches the upstream, under the codes these values had: something there that holds no repository is `update-upstream-not-a-repo`, a value `REPOSITORY_RE` does not take whole is `update-upstream-unresolvable`, and `checked_value`'s is `unsafe-value`, each naming the pin and its field. A path is refused with `--upstream` passed too, and a clone kept at a path that is not spelled `owner/repo` is refused with no `--upstream` (main opened it in place): the pin records the name `apply` commits and opens its pull request with. The remedy no longer offers `--upstream` a path, which asks the field too. An `owner/repo` spelling that is a repository where the command runs is taken, as it was. `open_upstream` asks `--upstream` alone again. `shape-doctor.py` passes `prepare(..., ask_source=False)` at its two calls: it reads a refusal out of `prepare` as its own checkout unable to answer, so asking there turned a hand-edited field into CANNOT ANSWER, exit 3, with a `git fetch --all` NEXT (measured). Its rows are main's. Closes #1203 Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… the `ask_source` keyword the doctor now passes, so the rows that raise an `OSError` out of the comparison raise it again (#1203) `shape-doctor.py` calls `prepare(args, ask_source=False)` since the commit before this one, and the stand-in took one argument, so its three rows ended in a `TypeError` instead of the error they raise. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideUses of the APIHave the doctor ask the pin source when evaluating the pins gate, but skip that question for shape currency so its existing answer is preserved; treat refusals and OS read errors as inability to ask.
ImplementationCentralize validation of the pin’s source repository in
TestsExercise pin-source validation across both upstream routes, including path handling, malformed and unsafe values, filesystem edge cases, and refusal before upstream processing.
Verify the doctor retains its gate finding when source validation refuses or cannot read the pin value, and that currency counts remain unchanged.
Update doctor test doubles and upstream stand-ins to match the changed
Align existing line-break validation tests and refusal remediation expectations with pin-source validation occurring even when
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
(lane openRepoShape-5, 2026-11-08T18:42Z) Independent review of #1269 (#1203) by rv1269, lane 5's opus reviewer, which wrote none of it: NOT READY at Independent review of #1269 (#1203) for lane openRepoShape-5, by rv1269 (opus), at 86c1e6e: NOT READY The fix itself holds: the rows, mutants, gates, merge-trees and the writer's three choices all check out. Two SHOULD findings block it. Each is a small defect the PR introduces, with a fix of one to three lines that I measured. There are no MUST findings. The three choices
SHOULDS1. A pin value
S2. The doctor's second opt-out, in
NIT
Measured
Merge-trees
FilesEverything is in
Both of my worktrees are clean and left in place (no
I made no commits, pushes or GitHub writes, and touched neither of the writer's trees. Lane: openreposhape-5 (openRepoShape-5) |
…`~<unknown user>/...` or over 255 bytes is nothing there and is refused in the pin's name, the doctor's `pins` row asks the field, a folder-named value is told where to run (#1203) Review of PR #1269 (rv1269), two SHOULDs and the NITs it asked for: - S1: `Path(declared).expanduser()` raised `RuntimeError` for `~<user>/...` with no such user, a traceback with exit 1, the code `check` uses for "behind". `_named_here` keeps the bare path, so the name question refuses it `update-upstream-unresolvable` in the pin's name, with or without `--upstream`. - N1: a first part over 255 bytes made `stat` raise `ENAMETOOLONG`, which was `update-unreadable` naming neither the pin nor the field. That errno is nothing there; every other refused `stat` is raised as it was. - S2: `refusals_ahead` no longer passes `ask_source=False`. Where `check` refuses the pin's field, the `pins` row said `check` reports the copies `merged-away` and the `apply` it prints drops their rows; it exits 2 and does neither. `check_shape_currency` keeps the opt-out. - N2: the `update-upstream-not-a-repo` remedy of a pin's value says to run from a directory where nothing is at that path. - N3: `REPOSITORY_RE`'s comment no longer says it is for the pin "where no `--upstream` is passed". - N4: the doctor guard row holds the `shape currency` row to main's `ok`. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…user` cannot expand is looked up as the bare path, so a folder of that name where the command runs is `update-upstream-not-a-repo` in both routes (#1203) S1 of the review of PR #1269 asks the guard to "keep the bare path". The row holds that half: a guard that returned "nothing there" instead gave the same answer for every value but this one. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
(lane openRepoShape-5, 2026-11-08T20:40Z) Delta check of #1269's fix round, Delta check of #1269 (#1203) for lane openRepoShape-5, by rv1269b (sonnet), 86c1e6e..c792615: READY All findings are NITs. S1, S2 and N1 to N4 hold, with a measured one-line fix for each of the two new NITs. No MUST or SHOULD. I made no commits, pushes or GitHub writes, and no subagents. Findings1. The delta is what the body says.
The two stand-in files ( 2. S1 holds. I ran real
3. N1 holds.
4. S2 holds. I ran rv1269's probe-2 setup: two collision copies merged away, plus a hand-edited value.
5. N2 holds.
6. N3 and N4. I checked N3 by reading. N4's assert is what kills the doctor-asks mutant D1 (below). On main, 7. Rows and mutants (Python 3.12.3, git 2.43.0). Every mutant ran alone on the writer's 53-test selection, restored with a sha256 check of the four files (
NIT A. A raw NUL byte after
NIT B. The doctor's
NIT C. The Merges section is stale again. The body names main Not changed: the live body is the writer's text plus Sourcery's regenerated summary after the footer. Body-guard exits 0 and GatesHead
Skips, the same on both gits and the same as the body:
The live PR's Merge-trees
Disclosures
FilesEverything is in
Worktrees Lane: openreposhape-5 (openRepoShape-5) |
…h a NUL byte after the `~` is nothing there and is refused in the pin's name, and the `pins` row keeps the gate's finding where `prepare` raises an `OSError`, a row for each (#1203) Second review of PR #1269 (rv1269b), NITs A and B: - A: `Path(declared).expanduser()` raises `ValueError: embedded null byte` for a raw NUL byte after the `~`, which `_named_here` did not catch (it caught `RuntimeError` only): a traceback, exit 1, in both routes. It now catches `(RuntimeError, ValueError)` and keeps the bare path, which no file has the name of, so the name question refuses the value `update-upstream-unresolvable` in the pin's name. A row in each route. - B: `refusals_ahead` caught `Refusal` only from `prepare`, since the doctor began to ask the pin's field. A value `locked/x` with an unsearchable `locked` in the doctor's directory raises the `OSError` of `pin_source`'s `stat` out of `prepare`, and the `pins` row read `could not be run: [Errno 13] ...` where it had kept the gate's finding. It now catches `(Refusal, OSError)` and returns None. A row, with real modes. - The pin-edit lines of the existing S2 doctor row move into `source_written_as`, which the new row uses too. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
Re-check of #1269 (#1203) for lane openRepoShape-5, by rv1269c (sonnet), at 52e5c18: READY There is no MUST and no SHOULD. I found two NITs, and neither blocks landing. I made no commits, pushes or GitHub writes, and used no subagents. My The head is FindingsNIT 1. The Merges section of the body is stale again. This is the same class as rv1269b's NIT C. It matters only at the landing refresh.
NIT 2 (observation, not a defect). The surviving mutant
What I checked1. NIT A (
2. NIT B (
3. Nothing else changed: holds. The measurements:
4. Gates (head
5. The body (live, 30,981 chars, read with
Merge-treesI ran
Disclosures
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 5 days and 6 hours by commenting |
…ame the file as `shown_path` does, and validate-pins.py, family.py and shape-doctor.py read either spelling (#1168) (#1274) `repo_shape.load_yaml` names the file it refuses as `shown_path` names a path, in all three of its refusals (`yaml-unreadable` twice, `yaml-unparsable`), and so does `policy-unreadable` on the next line of `NamingPolicy.load`. A U+202E, an ESC or a line feed in a typed `--plan`, `--path-policy`, `--policy`, `--project` or `--root` path no longer reaches the terminal raw from any of the six tools that hand `load_yaml` such a path (eight runs: `adopt-project.py` reads two flags, `validate-repository-naming.py` two). A printable path prints byte for byte as on main. Every reader that finds the path at the start of a refusal's detail by its text keeps working, beside a `repo_shape.py` from before this change or after it. Probed at `51a9c5f10` with a stub `gh` first on PATH, `GH_TOKEN=bogus`, an empty `GH_CONFIG_DIR`, `GIT_SSH_COMMAND=false` and an empty global git config: a folder `pl<U+202E>an` holding a file that is not this reader's YAML (`a: 1` then `: b`). Each run exits 2 with one line, the U+202E in it raw: ``` REFUSED yaml-unparsable: <D>/pl<U+202E>an/<file>: line 2: empty keys are not supported ``` - `adopt-project.py check --plan` (and `execute --plan`, the same `Plan.load`); - `adopt-project.py plan --path-policy`; - `validate-repository-naming.py --policy` and `--project`; - `bump-leg.py --root` (`<root>/project.yaml`); - `family.py bump --family-root` (`<root>/family.yaml`); - `update-shape.py check --root` (`<root>/contracts/shape-pin.yaml`); - `validate-manifest.py --root`, as a root carries it. On this branch the same eight runs say `'<D>/pl\u202ean/<file>'`. The rows below hold all eight, with U+202E, an ESC and a line feed in turn, and a printable name. The readers that find the path in the detail by its text, on main: `validate-pins.py`'s `_load` tests `exc.detail.startswith(f"{path}: ")`; `family.py`'s `_read_member_project` swaps `str(manifest_path)` for `<repo> @ <commit>:project.yaml`; `repo_shape.link_declarations` swaps `str(path)` for `shown_path(path)`. Beyond the issue's list, a grep of every shipped `.py` for a detail read by its prefix found two more, both in `shape-doctor.py`: `naming_script_refusal` (`detail.startswith(f"{shape / NAMING_COPY}: ")`) and the `manifest-kinds` row (`exc.detail.removeprefix(f"{path}: ")`). Measured with only `repo_shape.py` changed: `validate-pins.py` named a root that is not printable by its whole spelled path in place of `project.yaml`; `family.py` named the deleted clone in place of the member when `TMPDIR` is not printable (probed with an ESC in the clone's folder); the doctor no longer knew its own policy's refusal, and its `manifest-kinds` row quoted the whole path again. Each is held below. - `scripts/repo_shape.py`, `load_yaml`: `named = shown_path(path)`, used at the three sites; `NamingPolicy.load`'s `policy-unreadable`: `shown_path(path)`. Same module, no new import. The words after the path are unchanged. - `templates/assembly-root/scripts/validate-pins.py`, `_load`: the prefix is looked for raw and as the gate's own `_shown` spells it (`_shown` is written in the gate, not imported, under the skew rule), and either is named relative to the root. - `scripts/family.py`, `_read_member_project`: the swap to `shown` takes the spelled path, then the raw one. - `shape-doctor.py`: `naming_script_refusal` asks both prefixes (`policy-wrong-kind` still names the policy raw); the `manifest-kinds` row takes the path off with a new `less_the_path`, in either spelling. - `repo_shape.link_declarations` is unchanged: its `replace(str(path), named)` finds nothing to swap in a spelled detail and the `why` reads as it did (a row says so). - `tests/test_load_yaml_refusals.py`: the rows below, added to the file that already holds `load_yaml`'s refusals (#192), not a new file. No refusal code, remediation or word after the path changes, and a printable path is named as before. `README.md`, `docs/cli.md`, the handbook and `AGENTS.md` hold none of `cannot be read (`, `not UTF-8 at byte`, `yaml-unparsable`, `yaml-unreadable` or `policy-unreadable`; the release notes of v1.0.0, v1.1.1 and v1.2.0 name the codes as the record of those releases, with printable paths, and stay as they are; the 46 files under `tests/` that hold them are all in the gates below. **`scripts/repo_shape.py` and `templates/assembly-root/scripts/validate-pins.py` are shape copies.** Every assembly root carries both, and every family holder carries `repo_shape.py`, so `update-shape.py check` shows each as `upstream-changed` in every project until `apply` re-copies it and re-pins, as #827 and #919 did. `family.py` and `shape-doctor.py` run from a checkout of the standard and are not copied. A root re-copies its pinned files one row at a time (`update-shape.py apply --accept-local` keeps a copy), so `validate-pins.py` and `repo_shape.py` may be of different ages. Rows, each a real run of the root's own gate over a root under a folder holding the character: | gate | library | the refusal names | row | |---|---|---|---| | this branch | this branch | `project.yaml` | `test_the_gate_names_the_file_from_the_root_beside_this_library` | | this branch | before #1168 (`51a9c5f10`, raw) | `project.yaml` | `test_the_gate_names_the_file_from_the_root_beside_an_older_library` | | before #1168 | this branch | the whole path, spelled, nothing raw | `test_an_older_gate_beside_this_library_names_the_whole_path_spelled` | | before #1168 | before #1168 | `project.yaml` | main | The third order is the one no change here can reach: that gate's own code asks the raw prefix alone. It still prints nothing raw, and it names `project.yaml` again once the gate is re-copied. A printable root is named `project.yaml` in all four. The two older copies are read with `git show 51a9c5f:...`, a skip where a checkout lacks that history (CI checks out with `fetch-depth: 0`), so `test_the_gates_load_takes_either_prefix` also holds both halves in process with no history. `family.py` and the doctor always import their own checkout's `repo_shape.py`, so they cannot meet another age; they read both spellings all the same, so no reader of the prefix depends on which library it meets, and their rows run beside each. `adopt-project.py` spells the paths it prints itself with its own `_shown` (backticks, #1115, and #1152's PR #1177 for `--plan`), and `load_yaml` now spells with `shown_path` (`repr`, quotes). Measured, for one plan path: | path holds | `adopt-project.py` `_shown` | `shown_path` | |---|---|---| | U+202E | `` `/d/pl\u202ean/plan.yaml` `` | `'/d/pl\u202ean/plan.yaml'` | | ESC | `` `/d/x\x1b[31m/plan.yaml` `` | `'/d/x\x1b[31m/plan.yaml'` | | a line feed | `` `/d/a\nb/plan.yaml` `` | `'/d/a\nb/plan.yaml'` | | a byte that is not UTF-8 | `` `/d/caf\udce9/plan.yaml` `` | `'/d/caf\udce9/plan.yaml'` | | a quote and an ESC | `` `/d/it's\x1b/plan.yaml` `` | `"/d/it's\x1b/plan.yaml"` | | a trailing space | `` `/d/trail /plan.yaml ` `` | `/d/trail /plan.yaml ` | | nothing unusual | `/d/plain/plan.yaml` | `/d/plain/plan.yaml` | **Decision: `shown_path` in `load_yaml`, and the two styles stand.** The escapes are the same; only the delimiters differ, and `_shown`'s extra cases (a trailing space, backticks at both ends) are printable, so neither is a hole. A run never shows both for the plan: `check` and `execute` over an unparsable plan each print exactly one line, the `load_yaml` refusal, and stop (measured). `shown_path` is what the other five tools print for the same refusal, and what the three pinned validators' own `_shown` print (`test_the_pinned_scripts_spell_a_path_as_the_library_does` holds them equal). One spelling for `adopt-project.py` too would mean a spelling parameter on a function in a shape copy, or re-raising at `Plan.load` and `PathPolicy.load`, in a file #1177 is changing next to those lines and 20 other open PRs touch, for a difference of quote marks. 112 rows in `tests/test_load_yaml_refusals.py`: 101 new, and the 11 that were there (#192). Run on main's code: this branch's rows in the detached tree at `51a9c5f10`, with main's version of each changed file swapped in, each put back with a sha256 check (measured on the 109 rows at `e39b5d7e3`, and again on all 112 at `136b38d12`: the table is the second run, and the three rows the review round added are the only change). | rows | on main's 4 files | main's `repo_shape.py` only | main's `validate-pins.py` only | main's `family.py` only | main's `shape-doctor.py` only | |---|---|---|---|---|---| | each refusal, U+202E / ESC / line feed x absent / not UTF-8 / unparsable (9) | 9 fail | 9 fail | pass | pass | pass | | `policy-unreadable`, 3 names (3) | 3 fail | 3 fail | pass | pass | pass | | each of the 8 tools x 3 names (24) | 24 fail | 24 fail | pass | pass | pass | | older gate beside this library, 3 names (3) | 3 fail | 3 fail | pass | pass | pass | | gate beside this library, 3 names, real run (3) and in process (3) | pass | pass | 6 fail | pass | pass | | family member manifest beside this library, 3 names (3) | pass | pass | pass | 3 fail | pass | | doctor's own policy in the naming script's output, 3 names x 2 refusals (6) | 2 fail (line feed) | 2 fail (line feed) | pass | pass | 6 fail | | doctor's `manifest-kinds` row beside this library, 3 names (3) | pass | pass | pass | pass | 3 fail | | a path typed relative, `adopt-project.py check --plan`, 3 names (3) | 3 fail | 3 fail | pass | pass | pass | | total failing of 112 | 44 | 44 | 6 | 3 | 9 | 60 of the 101 new rows fail on main's code: the 44 above with main's four files, and 16 more that read the path back (the gate 6, `family.py` 3, the doctor 4 + 3) with main's reader beside this branch's library, the skew this change would otherwise open. The other 41 new rows pass in every column, as do the 11 that were there. They are the controls the brief asks for: a printable path in each refusal (3), in `policy-unreadable` (1) and through each tool (8), which prints byte for byte as on main; the four readers beside a library older than #1168 (gate real run 4, gate in process 4, `family.py` 4, `manifest-kinds` 4) and beside this one for a printable path (6); `link_declarations` (4), which reads as it did; and the doctor finding `policy-wrong-kind` raw (3). Mutants M5, M8, M10, M12, M13 and M14 each fail some of them; the `link_declarations` rows guard only that its `why` did not move, which nothing in this change can move (M16). The doctor's two line-feed rows fail on main's four files too: a raw line feed splits the naming script's line before the doctor reads it. Each applied alone in the detached tree, the 109 rows of `e39b5d7e3` run, the file put back and its sha256 checked against the branch's (all 17 matched). 15 killed, 2 survived. The review round adds M18 and M19, both killed by its three new rows (below). | mutant | killed by | |---|---| | M1 `cannot be read` back to `{path}` | the in-process `absent` rows (3) | | M2 `not UTF-8 at byte` back to `{path}` | the in-process `not-utf-8` rows (3) | | M3 `yaml-unparsable` back to `{path}` | 31 rows: the in-process `unparsable` rows (3), the 24 tool rows that are not printable, the older gate's (3) and the doctor's line-feed `load-yaml` row | | M4 `policy-unreadable` back to `{path}` | the three `policy-unreadable` rows, and the doctor's line-feed row | | M5 `validate-pins.py`: the raw half of the prefix test dropped | gate beside an older library (3), `_load` with an older library (3) | | M6 `validate-pins.py`: the spelled half dropped | gate beside this library (3), `_load` with this library (3) | | M7 `family.py`: the spelled swap dropped | family with this library (3) | | M8 `family.py`: the raw swap dropped | family with an older library (3) | | M9 doctor `naming_script_refusal`: the spelled prefix dropped | its `load-yaml` and `not-a-mapping` rows that are not printable (6) | | M10 doctor `naming_script_refusal`: the raw prefix dropped | `policy-wrong-kind` named raw, U+202E and ESC (2) | | M11 `less_the_path`: the spelled prefix dropped | `manifest-kinds` with this library (3) | | M12 `less_the_path`: the raw prefix dropped | `manifest-kinds` with an older library (3) | | M13 `load_yaml`'s `named` always `repr`, a printable path too | 24 rows: the printable rows of each refusal (3) and each tool (8), the four #192 rows that assert `str(refusal).startswith(f"REFUSED yaml-unreadable: {path}")`, and printable rows of the readers | | M14 `policy-unreadable` always `repr` | its printable row and the doctor's printable `not-a-mapping` row (2) | | M15 `validate-pins.py`'s spelled half as `repr(str(path))` in place of `_shown(str(path))` | **survived, equivalent**: for a path that is not printable the two are the same text, and a printable one is caught by the raw half first | | M16 `link_declarations`' `replace(str(path), named)` removed | **survived, equivalent**: the detail already holds `shown_path`'s spelling, so the swap finds nothing to swap; the row `test_a_link_manifest_is_named_in_why_as_it_was` is there to say the output did not move | | M17 `less_the_path` returns the detail whole | `manifest-kinds`, both libraries (6) and its printable rows (2) | | M18 `load_yaml`'s `named` from `Path(path).absolute()` (rv1274's X5, which survived the 109 rows) | the relative-path rows (3), and no other of the 112 | | M19 the same from `Path(path).resolve()` | the same 3 | Every run through the lane's runner: a stub `gh` first on PATH (and the suite's own `gh` guard ahead of it), `GH_TOKEN=bogus`, an empty `GH_CONFIG_DIR`, `GIT_SSH_COMMAND=false`, `GIT_CONFIG_GLOBAL=/dev/null`, a blank git identity, git-filter-repo 2.47.0 (CI's pin; `--version` says `a40bce548d2c`) on PATH, Python 3.12.3 (CI runs 3.14; no row asserts text that depends on the version). The gate list, 53 files, 4591 tests: the new rows; the hygiene five (`test_path_guard_hygiene`, `test_repo_hygiene`, `test_agents_md_codes`, `test_cli_reference`, `test_pinned_copy_text`) and `test_no_auto_maintenance`; the 46 files under `tests/` that hold `cannot be read (`, `not UTF-8 at byte`, `yaml-unparsable` or `yaml-unreadable`; every `validate-pins` file (`test_pin_validator`, `test_validate_pins_lockstep_lines`, `test_validate_pins_without_git` beside those the grep found); and for the doctor and `family.py` readers, `test_shape_doctor`, `test_doctor_validator_verdicts`, `test_naming_policy`, `test_family_py_unreadable` and `test_validate_family_unreadable`. One run of more than 100 tests at a time. | run | git | head | result | |---|---|---|---| | the gate list | 2.43.0 | `0e5f95db5` | 4579 passed, 12 skipped, 0 failed (40:38) | | the gate list | 2.47.1 | `e39b5d7e3` | 4586 passed, 5 skipped, 0 failed (46:43) | | the new rows, the hygiene five, `test_no_auto_maintenance` | 2.43.0 | `e39b5d7e3` | 546 passed, 2 skipped, 0 failed | | `tests/test_load_yaml_refusals.py` | 2.43.0 | the change before the commit | 109 passed | | the same, on main's code (5 swaps) and under 17 mutants | 2.43.0 | `51a9c5f10` + this change | as in the tables above | | `tests/test_load_yaml_refusals.py` (112), the hygiene five and `test_no_auto_maintenance` (439), 14 runs of at most 100 | 2.43.0 | `136b38d12` | 549 passed, 2 skipped, 0 failed | | the same | 2.47.1 | `136b38d12` | 549 passed, 2 skipped, 0 failed | `e39b5d7e3` differs from `0e5f95db5` by one comment in `tests/test_load_yaml_refusals.py` (the commit was amended before it was pushed), so the 2.43.0 gate list stands for it, with the small run above on the final head. The 12 skips on 2.43.0: the reftable backend needs git 2.45 (7), the session's `GIT_CONFIG_GLOBAL` (2), a PowerShell line printed only on Windows (3). On 2.47.1, 5: the last two kinds. `136b38d12` (the review round) changes `tests/test_load_yaml_refusals.py` alone: three rows added and one row's setup moved out of a `pytest.raises` block. The gate list at `136b38d12` is 4594 tests; its other 52 files are not run again, and the new file, the hygiene five and `test_no_auto_maintenance` are, on both gits (the two rows added to the table above). Their 2 skips, on both gits: `test_no_auto_maintenance.py:222`, the session began with `GIT_CONFIG_GLOBAL` set. `git merge-tree --write-tree` (git 2.47.1) of the head `136b38d12` with main and with the head of each open PR on a file this changes, main fetched and heads read with `gh pr list` at about 16:20Z on 2026-11-09. The table of 2026-11-08, at `e39b5d7e3`, differs in three rows: #1172 was open, #1269 was at `c792615f4`, and #1164 (at `74096eb47`) conflicted in `tests/test_path_guard_hygiene.py`, which this does not touch, and is clean at its new head. | with | head | result | |---|---|---| | main | `ebb87168a` | clean. Main moved since `51a9c5f10`: in `scripts/family.py` (#1117's remedies, not `_read_member_project`) and, since the last table, in `shape-doctor.py` (the `members` row), `bootstrap.py`, `validate-family.py`, `siblings.py`, `adopt-project.py` and `tests/conftest.py`; a grep of its production changes since `8e6f53268` finds no new reader of a `load_yaml` detail. The predicted merge, checked out alone, passes the 112 rows, `test_pinned_copy_text`, `test_family_py_unreadable`, `test_validate_family_unreadable`, main's touched `family.py` tests (`test_family_add_member_id`, `test_family_bump_to_checks`, `test_remove_add_remedies_family_root`) and `test_adopt_plan_source_branch_shown`: 411 passed on git 2.43.0 | | #1266 (`scripts/repo_shape.py`) | `09697e9c5` | clean | | #1171 (`scripts/repo_shape.py`, `adopt-project.py`) | `8162b874e` | clean; it leaves `shown_path` as it is | | #1249 (`scripts/repo_shape.py`) | `3146c3ca5` | clean | | #1177 (`--plan`'s `_shown`) | `5208e874e` | clean | | #1263, #1248, #1239 (`validate-pins.py`; #1248 also `shape-doctor.py`) | `9ef8f0ab5`, `1b747f7ab`, `fff421456` | clean | | #1269 (`shape-doctor.py`) | `52e5c1883` | clean | | #1201, #1164 (`scripts/family.py`) | `24b6a0af6`, `16ff93917` | clean | | #1264 (`scripts/family.py`) | `43d2e8b26` | `docs/handbook.html` conflicts, which this does not touch; against main alone it conflicts there and in five more files (`scripts/family.py` and four tests), the same six with this change merged in, and the five conflict blocks of `family.py` are identical with and without it | #1172 was open in the last table and has merged since: its change is in the main row. Two independent reviews of `e39b5d7e3` (rv1274, then rv1274b, which continued it after a reboot) found no MUST and called the PR READY. What each point of theirs came to, in `136b38d12` (tests only; no production file changed): - **SHOULD, the refusals #1168 names and this PR leaves raw:** filed as #1279. It lists eight "unreadable" and "not a mapping" refusals that still name the path as typed, measured at `e39b5d7e3` with their sites, and two sites not probed; the Limits below name the same family. Nothing in this change touches those lines. - **NIT 1, the dead raw halves:** kept. `family.py` and `shape-doctor.py` import their own checkout's `repo_shape.py`, so the raw swap in `_read_member_project` and the raw prefix in `less_the_path` run only when a row swaps in an older library in process. They are harmless, they make each reader independent of which library it meets (the version mix above), and the doctor's raw prefix in `naming_script_refusal` is live, since `policy-wrong-kind` still names the policy raw. - **NIT 2, no row typed a relative path:** done. rv1274's mutant X5 (`load_yaml` naming `Path(path).absolute()`) survived the 109 rows, since every tool row types a path under `tmp_path`, which is absolute. `test_a_path_typed_relative_is_named_as_typed_and_spelled` (3 rows: U+202E, ESC, a line feed) runs `adopt-project.py check --plan` with the path typed relative to the working directory and holds the refusal to the path as typed, relative and spelled. On main's `repo_shape.py` all 3 fail; X5 and its `.resolve()` twin each fail exactly those 3 of the 112 rows; every restore matched its sha256 (git 2.43.0). The tools handed a file keep the path as typed (`adopt-project.py check --plan` and `plan --path-policy`, `validate-repository-naming.py --policy` and `--project`, measured); the four handed a root (`bump-leg.py`, `family.py bump`, `update-shape.py`, `validate-manifest.py`) make it absolute before `load_yaml` sees it, so one tool of the first kind is the row. - **NIT 3, Sonar python:S5778:** done. `unparsable(root / "project.yaml")` ran inside the `pytest.raises` block of `test_the_gates_load_takes_either_prefix`, beside `gate._load`. The file is made first, so only `gate._load` runs inside the block; the row's 8 ids and their verdicts are the same. - **NIT 4, stale counts:** done. The open PRs touching `adopt-project.py` (20 others than #1177, as of 16:20Z), the merges table (main `ebb87168a`, every head read fresh), and the counts of rows and mutants above (112 rows, 101 new, 44 failing on main's four files; M18 and M19 added). They also checked, and asked nothing of this change: no reader of a `load_yaml` detail is left outside the five it changes, the gate's `_shown` equals `shown_path`, and neither shape copy's digest is stored anywhere in the tree. - **An older `validate-pins.py` beside this `repo_shape.py`** names a root that is not printable by its whole spelled path, not `project.yaml`, until the gate is re-copied (the version-mix table). Nothing raw. - **`policy-wrong-kind`**, the line after `policy-unreadable` in `NamingPolicy.load`, still names the policy raw: the brief kept the scope to the three `load_yaml` refusals and `policy-unreadable`. It is the same one-line change, and the doctor already reads either spelling. - **The "not a mapping" lines in other files** still name the path raw: `plan-unreadable` (`adopt-project.py`, which #1177 spells), `path-policy-unreadable` and `path-policy-wrong-kind` (`scripts/path_classify.py`), `bump-leg-manifest-unreadable` (`bump-leg.py`), `manifest-unreadable` (`validate-repository-naming.py`, which #1267 and #1236 are changing), `manifest-missing` and `manifest-unreadable` (`validate-manifest.py`), `update-pin-unreadable` (`update-shape.py`) and the doctor's own `policy-raised`. Follow-up candidates. - **Not probed:** the two `bootstrap.py`, `siblings.py`, `validate-family.py` and `shape_advisory.py`. By reading, each hands `load_yaml` `<root>/<one set name>`; where it does not swallow the refusal (two of `siblings.py`'s three do), it prints the detail whole (`bootstrap.py` through `spelled`, which leaves a spelled path as it is), so each now says the spelled path. - `link_declarations`' swap now finds nothing to swap. It is left in place: removing it is a further change to a shape copy for no change in output (mutant M16). Review: rv1274 and rv1274b, lane 5's independent opus reviewers, which wrote none of #1274 (rv1274 stopped for the reboot of 2026-11-08 with no MUST; rv1274b finished its review): READY at `e39b5d7e` with no MUST (issuecomment-6742338962); its SHOULD is the follow-up #1279, and its NITs 2-4 are fixed in `136b38d1`. Then rv1274c, lane 5's independent sonnet reviewer, which wrote none of it: READY at `136b38d1`, H0 of this landing, with no finding (issuecomment-6745586545). CI (Brett Heap's ruling 27 and his fast-refresh ruling of 2026-10-15T22:48:35Z): H0 136b38d passed tests, tests-git-bash and SonarCloud; the head 52a140c is a clean update-branch merge of main 150e401, with tests-git-bash and SonarCloud green; and the local gate passed on its predicted squash tree 2fb87fe over main 150e401: the load_yaml_refusals, adopt_check_throwaway_repos, adopt_e2e, adopt_execute_refusals, adopt_make_bootstrap_followups, adopt_make_reads_first, adopt_pins, adopt_plan_source_branch_shown, adopt_template_values, adopt_tracking_branch, bump_leg_branch_and_push_line, chain_link_fold, doctor_unreadable_paths, doctor_unreadable_pin, family, family_dry_run, path_guard_hygiene, pin_source_unreadable, pinned_root_git_unreadable, root_git_unreadable, stdout_encoding, update_shape_apply_lines_and_headers, update_shape_header_comments, update_shape_merged_away, update_shape_unreadable, validate_family_unreadable, validate_pins_spelled_and_named, pinned_copy_text, no_auto_maintenance, repo_hygiene, agents_md_codes, cli_reference sets, 2432 passed, 6 skipped. Landed on Brett Heap's word of 2026-10-23T13:10:26Z, relayed to every lane by lane 3 (#473 issuecomment-6365697123): "merge v1.2.1 PRs once reviewed and green". Closes #1168 Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>



Goal
update-shape.pyasks the shape pin'ssource_repository:once, whichever way a run reaches the upstream, and refuses a value that is noowner/repoin 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).What held on main
Measured on main
be21751c3(Python 3.12.3, git 2.43.0, a stubghfirst on PATH, a bogus token, no network). This branch's rows ran against main'supdate-shape.pyandshape-doctor.pyin a scratch worktree, and two probes ran main's tool directly.--upstream, run from the root.source_repository: "contracts"wasREFUSED update-upstream-not-a-repo: --upstream contracts exists but is not a git repository, exit 2. So werescripts/repo_shape.py,contracts/shape-pin.yamland~/notes(a folder underHOME). A clone kept at~/shapewas opened in place:checkexit 1, the copies compared.id:, a date or arepository:ending in a line feed is refused by name, and a pin'ssource_repository:that is no path orowner/reponame is named as the pin's (#1139) #1166 already names in the pin (a line feed, a trailing space,has space/x) still had the remedy "or pass--upstreama path to a clone of openRepoShape".--upstream <a local clone>passed. The pin's value was never asked, and every value above gavecheckexit 1 with its report.apply --yes --at <B> --branch shape/fu-lfover"opensoft/openRepoShape\n"exited 0 and made this commit:Re-sync the shape copies to opensoft/openRepoShape, then a line feed, then@ 4032a512eb2e. Thegh pr createline it printed was split inside its--titlequotes.--upstream "opensoft/openRepoShape\n"both bad: the refusal named the flag.What changed
update-shape.py: a newpin_source(pin, pin_path).prepareasks 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:update-upstream-not-a-repo. The value is looked up the wayopen_upstreamlooks up--upstream:expanduser, relative to the working directory.REPOSITORY_REdoes not take the whole value (fullmatch):update-upstream-unresolvable.checked_valuerefuses it:unsafe-value.<root>/contracts/shape-pin.yaml: `source_repository:`.id:, a date or arepository:ending in a line feed is refused by name, and a pin'ssource_repository:that is no path orowner/reponame is named as the pin's (#1139) #1166 the second one said "which is neither a path on this machine nor anowner/reponame". It now says "which is not anowner/reponame", because a path is never what the pin holds.--upstreama path, since passing one no longer gets past the question. For the name refusals it reads: "writesource_repository:in the pin as theowner/repoits shape was copied from,opensoft/openRepoShapefor this standard's. It is asked with--upstreampassed too, becauseapplynames it in its commit and its pull request; a path to a clone goes to--upstream." Theupdate-upstream-not-a-reporefusal 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--upstreamagain. validate-manifest.py, validate-family.py, family.py and update-shape.py: anid:, a date or arepository:ending in a line feed is refused by name, and a pin'ssource_repository:that is no path orowner/reponame is named as the pin's (#1139) #1166'spin_pathand its two pin-named branches moved intopin_source. Both functions use_holds_a_repositoryas their one repository question.prepare(args, *, ask_source=True).shape-doctor.py'scheck_shape_currencycall passesask_source=False. Itsrefusals_aheadcall asks the field (S2 of the review round, below).Refusalout ofprepareas its own checkout being unable to answer.update-shape.py's comment above_ABSENT_ERRNOSdocuments this.source_repository:turned theshape currencyrow from exit 1 (behind) into CANNOT ANSWER, exit 3. Its NEXT wasgit -C <standard> fetch --all, and itswhywas "this checkout of the standard does not carry the commit the pin names".check_shape_currencythe doctor answers as it does on main. Where the root is behind, the doctor's NEXT isupdate-shape.py check, which refuses the field in the pin's name.tests/test_update_shape_pin_source.pyis 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'spinsrow over a hand-edited source (S2) and over a source thatcheckcannot 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: validate-manifest.py, validate-family.py, family.py and update-shape.py: anid:, a date or arepository:ending in a line feed is refused by name, and a pin'ssource_repository:that is no path orowner/reponame is named as the pin's (#1139) #1166'sWRITE_THE_PINremedy and the unresolvable words are updated.test_an_upstream_passed_with_a_line_feed_is_named_as_passednow 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: thetemporariesstand-in wrapsopen_upstream(spec).Review round (rv1269: two SHOULDs)
rv1269 (opus) found this PR NOT READY at
86c1e6ea2on 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) andc792615f4(one more row).~<unknown user>/...was a Python traceback, exit 1.Path(declared).expanduser()raisesRuntimeError: 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 alsocheck's "behind" code. With--upstreampassed this was new (main exited 1 with a report); with none, main crashed too._named_here(declared)looks the value up asopen_upstreamdoes and, whereexpanduserraises, keeps the bare path. Nothing is there, so the name question refuses itupdate-upstream-unresolvablein the pin's name, in both routes. The scaffolded value is unchanged.86c1e6ea2):test_a_tilde_user_who_is_not_there_is_refused_in_the_pins_name, andtest_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, isupdate-upstream-not-a-repo), each in both routes.update-unreadable ... (File name too long), with a permissions remedy, naming neither the pin nor the field._named_heretakesENAMETOOLONG, and only that errno, as nothing there. Every other refusedstatis raised as it was."r" * 300 + "/has space"isupdate-upstream-unresolvableand"r" * 300 + "/x"isunsafe-value(checked_valuerefuses over 255 characters), each in the pin's name and in both routes (4 rows, each failing at86c1e6ea2); andtest_any_other_refused_stat_of_the_pins_value_is_raised_as_it_was, a control that passes at86c1e6ea2too: aPermissionErrorout of thestatis raised out ofpin_source.refusals_aheadopt-out made apinsrow sentence false.source_repository: "has space/x", thepinsrow said "update-shape.py checkreports themmerged-away, and theapplyit prints drops their pin rows", and its NEXT was thatcheck, which exits 2 withupdate-upstream-unresolvableand reports nothing.ask_source=Falseis dropped atrefusals_aheadonly.preparerefuses, sorefusals_aheadreturns None, as its docstring says it does wherepreparerefuses, and thepinsrow keeps the gate's finding.check_shape_currencykeeps 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_againstill passes and still assertsmerged_awayand thecheckNEXT. rv1269's mutant R1 (refusals_aheadasks) is now the code.tests/test_update_shape_merged_away.py::test_the_pins_row_keeps_the_gate_where_check_refuses_the_pins_source, failing at86c1e6ea2. It also holds thatcheckexits 2update-upstream-unresolvable, and that theshape currencyrow still counts the two rowsmerged-away, with no CANNOT ANSWER.opensoft/openRepoShapefolder is now measured (Limits, below). The remedy ofupdate-upstream-not-a-repofor 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_PINstays what validate-manifest.py, validate-family.py, family.py and update-shape.py: anid:, a date or arepository:ending in a line feed is refused by name, and a pin'ssource_repository:that is no path orowner/reponame is named as the pin's (#1139) #1166's rows and the name refusals say.opensoft/openRepoShape, in both routes (failing at86c1e6ea2: no such sentence); and the same pin with--upstreamrun from a folder where nothing is at that path, exit 1 as the scaffolded pin gives (a control).REPOSITORY_REno longer says it is the pin's value "where no--upstreamis passed".test_the_doctor_does_not_call_a_hand_edited_source_the_standardsalso asserts theshape currencyrow's status isok, main's answer (measured on main's code in the scratch worktree,ok). Mutant D1 below is what only that assert kills.Rows failing at
86c1e6ea2'supdate-shape.pyandshape-doctor.py(this round's tests, the scratch worktree detached atc792615f4): 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~/notesin both), the 4 S1 rows, the 4 N1 rows, the 2 N2 rows, and the S2 row. The controls that pass at86c1e6ea2are the N1PermissionErrorrow, the N2 run-elsewhere row, and the N4 assert.Second review round (rv1269b: three NITs)
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).~in the pin's value was a traceback, exit 1.Path('~a<NUL>b/x').expanduser()raisesValueError: embedded null byte, which_named_heredid not catch: it caughtRuntimeErroronly. Plain or quoted in the pin, in both routes. It is contrived, since the pin file would be binary. With no--upstreammain crashed the same way; with one passed, main exited 1 with a report, so there it was new.except (RuntimeError, ValueError), keeping the bare path. A NUL in the bare path is nothing there (_mode_ofalready answers a NUL in a name that way), so the name question refuses the valueupdate-upstream-unresolvablein the pin's name, exit 2. rv1269b's mutant Y3 is the code now.c792615f4):test_a_nul_byte_after_a_tilde_is_refused_in_the_pins_name. Its NUL byte is built withchr(0).pinsrow could read "could not be run" in one narrow case.locked/x, and an unsearchablelockedin the directory the doctor runs in. Since S2 the doctor asks the field inrefusals_ahead, andpin_source'sstatoflocked/xraisesPermissionError.refusals_aheadcaughtRefusalonly, so the row readcould 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 2update-unreadablethere. The verdict, the exit and theshape currencyrow did not change.except (Refusal, OSError): return Noneinrefusals_ahead, so the row keeps the gate's finding. Its docstring and comment say so. rv1269b's mutant Z1 is the code now.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:lockedis mode 000 and is given back in afinally, and the row skips on Windows and as root, astests/test_bump_leg_unopenable.pydoes. It also holds thatcheckexits 2update-unreadable: locked/x, and that theshape currencyrow still counts the two rowsmerged-away, with no CANNOT ANSWER.Rows failing at
c792615f4'supdate-shape.pyandshape-doctor.py(this round's tests, the scratch worktree at52e5c1883): 3 failed, 53 passed of 56 tests. The 3 are the rows above: 2 for NIT A and 1 for NIT B.The decision: a pin that names a path, with
--upstreampassedRefused.
preparegives the upstream in both routes. The READMEShape:line is compared with it, andapplywrites it into its commit subject, its pull request's title and the lines it prints.{{SHAPE_REPOSITORY}}. So refusing one costs no root that a tool made.--upstreamis passed:contracts,scripts/repo_shape.py,~/notes) isupdate-upstream-not-a-repo, with or without--upstream.owner/repo(~/shape,/srv/shape) isupdate-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.owner/repospelling 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 aboveopensoft/openRepoShape. With no--upstreamit is opened in place.Rows failing on main
Command: this branch's
tests/test_update_shape_pin_source.py(36 rows), five tests oftests/test_value_pattern_line_break.py(the selection the mutants use, 18 ids), and the S2 and NIT B rows oftests/test_update_shape_merged_away.py(56 tests), run against main's (be21751c3)update-shape.pyandshape-doctor.py, in the scratch worktree detached at52e5c1883.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
PermissionErrorrow, which fails on main because there is nopin_source) and the second round's 3 (NIT A: 2, NIT B: 1). The first round's 21: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 ... existsfor the three paths, and validate-manifest.py, validate-family.py, family.py and update-shape.py: anid:, a date or arepository:ending in a line feed is refused by name, and a pin'ssource_repository:that is no path orowner/reponame is named as the pin's (#1139) #1166's old remedy for the other three;upstream-a-clone: exit 1 and a report.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.id:, a date or arepository:ending in a line feed is refused by name, and a pin'ssource_repository:that is no path orowner/reponame is named as the pin's (#1139) #1166'stest_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:
--upstreamreachesopen_upstreamwithopensoft/openRepoShape(in-process, with a stand-in that opens the local upstream);owner/repoclone where the command runs is opened in place;shape currencyrow is noenvironmentrow and the doctor does not exit 3, and its status isok;--upstreampassed, run from a folder where nothing is atopensoft/openRepoShape, is exit 1 over the upstream one commit on.Mutants
Setup:
52e5c1883. All the mutants below were run again on this head, the review round's and the first round's too, because_named_hereandrefusals_aheadchanged.tests/test_update_shape_pin_source.py(36 rows), five tests oftests/test_value_pattern_line_break.py(validate-manifest.py, validate-family.py, family.py and update-shape.py: anid:, a date or arepository:ending in a line feed is refused by name, and a pin'ssource_repository:that is no path orowner/reponame is named as the pin's (#1139) #1166's threeupdate-shape.pyrows and the two pattern tests, 18 ids), and the S2 and NIT B rows oftests/test_update_shape_merged_away.py. The D1 runs are the doctor guard row alone.restored=yesfor all 32 mutants, for the control run with no mutant, and for the two swaps of main's andc792615f4's production files). At the end the worktree was clean at52e5c1883.expandusermoved into_named_hereandpin_source; M7 now names the(RuntimeError, ValueError)guard.This round's mutants:
RuntimeErroralone (the inverse of rv1269b's Y3, which is the code now)ValueErroralone~<unknown user>), both routesRefusalalone (the inverse of rv1269b's Z1, which is the code now)OSErroralone, noRefusal(Refusal, PermissionError)statis refusedEACCES, aPermissionError, so a narrower catch cannot be told fromOSErrorby a real mode;OSErroris what rv1269b's Z1 catches, and it covers any other errnorefusals_ahead, theOSErrorcatch keptThe review round's mutants, run again:
RuntimeErrorandValueError)return None)ENAMETOOLONGtest removedOSErrortaken as nothing therePermissionErrorrow and the NIT B rowrefusals_ahead(the inverse of rv1269's R1, which is the code now; theOSErrorcatch kept)~/notes(both routes each), the two N2 rows, the bare-path rows~/shape, the tilde, NUL and long-name rows, named-first, #1166's twoshape currencyrow asks the field and calls a refusal a plain FINDING (exit 1, noenvironment)The first round's mutants, run again:
--upstreamrouteupstream-a-clonerow, checked_value, named-first, apply, the S1, N1, N2, S2 and NIT B rows, and the NUL row of that route--upstreamrouteno-upstreamrow, #1166's three pin rows, the doctor row, the S1, N1, N2, S2 and NIT B rows, and the NUL row of that routefullmatchput back tomatchREPOSITORY_REends in\Zsince #1166, somatchandfullmatchagree on every string (rv1269 checked 66,430)matchandREPOSITORY_RE's\Zput back to$~/notes, both routes; the bare-path and N2 rows~/shapeboth routes, theowner/repoclone where it runschecked_valuedroppedunsafe-valuerowsexpanduser~/notesboth routesno-upstreamrow 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 routeshape currencycall asks the fieldask_sourcedefaults to Falserv1269b's own mutants (its
mutate2.py), run on this head:_named_heretakesENOENTwhere it tookENAMETOOLONGEACCEStaken as nothing there tooPermissionErrorrow and the NIT B row_named_herereturns the candidate where nothing is thereor not args.upstreamdropped fromprepare's conditionask_source=Falsepassesupstream=too (rv1269's R2).resolve()dropped from the path question_holds_a_repositoryfollow a link asresolve()doesRuns
Gates ran on the commit
52e5c1883(dirty=0), with a stubghfirst on PATH,GH_TOKENbogus, an emptyGH_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 --versionprintsa40bce548d2c). 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./usr/bin/git):tests/test_update_shape*.pyfiles (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) andtest_no_auto_maintenance: 1360 tests, one run. 1355 passed, 5 skipped in 830.98s (the review round: 1352; this round adds the 3 rows).shape-doctor.pychanged: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_collisionsandtest_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 --versionprinted into every log):test_update_shape_add_symlink.py:832(junctions are NTFS's), 2test_no_auto_maintenance.py:222(the session began withGIT_CONFIG_GLOBALset) and 3test_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.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 atc792615f4with the same counts on both gits. On 2.47.1 the writer's gate A ran as 17 runs under 100 tests.e1692c147and86c1e6ea2: gate A 1339 passed, 5 skipped and gate B 824 passed, 3 skipped, on both gits. A first doctor run on 2.47.1, ate1692c147, had failed three rows oftest_doctor_unreadable_pin.py: their stand-in forpreparetook one argument and the doctor now passesask_source.86c1e6ea2widens the stand-in. rv1269 re-ran both gates at86c1e6ea2with the same counts.c792615f4and the mutants above ran on git 2.43.0.Merges
Run with
git merge-tree --write-tree <other> 52e5c1883(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):2fde6c3d0: tree35c270e2. Main is 15 commits past this branch's basebe21751c3. shape_advisory.py and shape-doctor.py: a leg'sAGENTS.mdthis user cannot read leaves whether it is a leg unknown, sothe way inoffers neither command and points atwhat is here, andthe other way inand the Triad row are silent (#1110) #1159, shape-doctor.py, validate-pins.py and validate-manifest.py: a root whose own.gitthis user cannot read is named.git: cannot be read (<reason>), so the doctor never reads it as DRIFTED, and both pinned validators refuse it, exit 2 (#1146) #1147 and bootstrap.py, validate-family.py and siblings.py: a root or holder whose.gitthis user cannot read is refusedgit-repo-unreadable, exit 2, not a traceback ornot-a-git-repo, and the doctor'smembersrow names it once, never drift (#1148) #1172 have merged (bootstrap.py, validate-family.py and siblings.py: a root or holder whose.gitthis user cannot read is refusedgit-repo-unreadable, exit 2, not a traceback ornot-a-git-repo, and the doctor'smembersrow names it once, never drift (#1148) #1172 at 2026-11-09T14:01Z as2fde6c3d0, which is main now), so they are no longer listed. bootstrap.py, validate-family.py and siblings.py: a root or holder whose.gitthis user cannot read is refusedgit-repo-unreadable, exit 2, not a traceback ornot-a-git-repo, and the doctor'smembersrow names it once, never drift (#1148) #1172's change toshape-doctor.pylies well away fromrefusals_ahead, and its merge with this head is clean.shape:orfiles:is no block header, as it is none to the reader (#1220) #1231aca00dfd9(update-shape.py):ba12a305.applyputs its REFUSED and ROLLED BACK report, and a failed push's account of the commit that stands, on stderr when nobody reads stdout any more, and a broken pipe on acopiedline is rolled back and raised as itself, not calledupdate-write-failed(#1218) #1241ab137eb5f(update-shape.py,tests/test_update_shape_unreadable.py):052a989f.HEADthis user cannot open is named in the gate's words,spec: .git/modules/spec/HEAD: cannot be read (<reason>)orspec/.git/HEAD: ..., so thelegsandmembersrows read INVALID with the gate's line and never DRIFTED, andplacementnever calls the leg "not a git repository" (#1222) #12481b747f7ab(shape-doctor.py):9c022d62.id:that is no project id ismember-id-malformedin every mode, and so is a mounted member's ownproject.yamlid:, with thebumpthat writes the row from that file (#1204) #12730657e3964(tests/test_value_pattern_line_break.py):9da0792f.load_yaml's three refusals andpolicy-unreadablename the file asshown_pathdoes, and validate-pins.py, family.py and shape-doctor.py read either spelling (#1168) #1274e39b5d7e3(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.pyand five test files) mentionsopen_upstream,pin_path,prepare(,source_repository,WRITE_THE_PIN,REPOSITORY_RE,refusals_ahead,ask_source,pin_source,expanduser,ENAMETOOLONGor this round's_named_here,source_written_asandNUL_AFTER_TILDE(read fromgit diffagainst each merge base). One name is shared: #1241 uses aneeds_a_modemark intests/test_update_shape_unreadable.py, and this round'sneeds_a_modeis defined intests/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.Limits
source_repository:itself, as on main: where the pin names the standard's commit, its row isok. Naming it on the pin's side would mean teachingpin_restore, whose history walk reads pins withcheck_pin, the same question, and the path half of that question reads the working directory. That is a follow-up candidate, not this PR.open_upstreamdoes for--upstream. Soscripts/repo_shape.pyis refused when run from the root, and taken as anowner/reponame when run from elsewhere. For any one directory, both routes give the same answer.opensoft/openRepoShapewhere the command runs (an unpacked archive, say) refuses the scaffolded pin with--upstreampassed. On main only the run with no--upstreamrefused it. Measured by rv1269 and by this round's rows: the refusal isupdate-upstream-not-a-repoin 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 (--upstreamroute: exit 1).shape currencyrow, over a hand-edited source and merged-away copies, still namesupdate-shape.py checkas its NEXT, and thatcheckrefuses in the pin's name (exit 2). The row answers as on main by design (the first bullet). Thepinsrow, which states whatcheckreports, asks the field since the review round.--upstream ~<unknown user>/xon the command line is still aRuntimeErrortraceback out ofopen_upstream(measured in process), as on main, and an argv value whose first part is over 255 bytes isupdate-unreadablenaming that path. Both name the value a person passed, not the pin. A follow-up candidate, not this PR.REPOSITORY_REtakes.and..as an owner, so../shapeisowner/repo-shaped. Unchanged.Closes #1203
Lane: openreposhape-5 (openRepoShape-5)
🤖 Generated with Claude Code
Summary by Sourcery
Validate shape pin source repositories consistently before upstream operations and preserve accurate shape-doctor findings when validation cannot be performed.
Bug Fixes:
Enhancements:
Tests: