Repository navigation
AGENTS.md, README and scaffold-project.py --help: say that a --spec-path or --code-path that is, holds or lies inside a file the shape writes, and a --pin of spec, code or shape or of one product twice, are refused before anything is created, and name those three in the pin refusal's remediation, so an agent briefed from AGENTS.md can say so before it runs the scaffold (#288) - #309
Merged
Merged
Conversation
…ath or --code-path over a path the shape writes, and a --pin of spec, code or shape or of one product twice, are refused before anything is created, and name those three in the pin refusal's remediation, so an agent briefed from AGENTS.md can say so before it runs the scaffold (#288) Two refusals protect the scaffold from dying after both legs are pushed, and neither was in a document. `scaffold-leg-path-collides` (#197) refuses a `--spec-path` or `--code-path` that is, holds or lies inside a path the shape writes into the assembly root. `scaffold-pin-collides` (#241) refuses a `--pin` whose product lowercases to `spec`, `code` or `shape` (the shape writes `contracts/<product>-pin.yaml` for those three itself) and one product pinned twice (one file holds one pin). Both fire at the plan, before the typed `yes` and before anything is created, and neither change touched a `.md` file, so an agent briefed from AGENTS.md could not say beforehand that `--pin code@<sha>`, a repeated `--pin` or `--spec-path contracts` would be refused. AGENTS.md's own "each one names what to run instead" was untrue of both: the remedy is to pass a different value. - **AGENTS.md.** Section 2 gains two sentences after "each one names what to run instead": two refusals name a VALUE to change, `scaffold-leg-path-collides` (the defaults `spec` and `code` pass) and `scaffold-pin-collides`, both before anything is created. Both codes are spelled as the tool prints them, from running each once on main with `--dry-run`, a local remote directory and a `gh` that exits 97. "Scaffolding a project that DECLARES descent" gains one sentence for the pin half. - **README.** Three lines in the paragraph where `--pin` is written up say the same two pin facts. They name no code: AGENTS.md carries each code once. - **`--help`.** `--spec-path` and `--code-path` had no `help=`, so `docs/cli.md` listed them as bare lines. Each now says what the flag is, its default, and that a path the shape writes is refused. `--pin`'s "Repeatable." is "Repeatable, once per product.", the sentence an operator reads before passing one product twice. `docs/cli.md` is regenerated by `scripts/render-cli-reference.py`, never edited. - **The pin refusal's remediation** names `spec`, `code` and `shape`, in any case, as names no product can be pinned under. For a repository truly called one of them, "name the product for the repository it pins" was no remedy at all, because no spelling of that name can be pinned. Words only: no refusal's logic, order or code changes. `tests/test_scaffold_pin_collisions.py` asserts the remediation word for word, so its copy moves with it. - **Two caps and a hash move, because both files sat exactly at their caps.** `tests/test_repo_hygiene.py` raises AGENTS.md's from 464 to 471 and README.md's from 1416 to 1419, each with its dated entry. The handbook footer's `README.md blob` is re-taken (`git hash-object README.md`) and moves ALONE, as `test_the_handbook_follows_the_readmes_outline` allows for a README change that touches nothing the page says: `docs/handbook.html` never names `--pin`. Its "For AI assistants" section repeats "each one names what to run instead" and is left as it was. Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…usals name a value to change instead of a command, so it no longer repeats AGENTS.md's old "each one names what to run instead" as if it held for `scaffold-leg-path-collides` and `scaffold-pin-collides` (#288) The page's rules for assistants quote AGENTS.md ("Read a refusal rather than retrying: each one names what to run instead"). The previous commit on this branch qualified that sentence in AGENTS.md, because two refusals name a VALUE to change and no command, so the page's copy had become the absolute sentence with an undocumented exception that #288 exists to remove. It now says the same in the page's voice: each one names what to run instead, except two that name a value to change, a `--spec-path` or `--code-path` over a path the shape writes and a `--pin` the shape cannot write, both before anything is created. The codes are left to AGENTS.md, which the section already links as the full text. The footer's history names #288 beside #207's, as #222 did for its own page edit. `README.md blob` in the footer is unchanged: this commit moves no byte of README.md, and `git hash-object README.md` still equals it. `tests/test_repo_hygiene.py`, the only test that reads the page, passes over these bytes. Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 21 hours and 49 minutes by commenting |
Reviewer's GuideThis documentation-focused PR surfaces existing scaffold path and pin collision refusals in the pre-run guidance, CLI help, generated reference, and remediation text without changing refusal behavior, ordering, or implementation logic. File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
… say precisely what the two path-collision refusals refuse (a leg path over a FILE the shape writes, one product pinned twice in any case or under any owner), that SOME refusals name a value to change rather than a command, and what an agent does then (#288) The review of 72d1cc2 found five sentences saying more or less than the tool does, each of the kind #288 exists to remove: a claim stated without its exception or its edge. - **A leg path over a FILE, not over any "path" (SHOULD-1).** `--spec-path`'s and `--code-path`'s `--help` said a path that "lies inside one the shape writes ... such as `contracts`" is refused, which reads as refusing `contracts/x`. The tool accepts `contracts/x` and `.github/x`: the refusal's list is `assembly_root_paths()`, files, and a path is refused only when it is one of them, holds one (`contracts` holds `contracts/spec-pin.yaml` and three more) or lies inside one (`project.yaml/x`). `--help`, and so `docs/cli.md`, and AGENTS.md section 2 now say "a FILE the shape writes", with `project.yaml` as the example that IS one and `contracts` as the directory that holds several. - **"Two refusals name a VALUE" was a count that is false (SHOULD-2).** `scaffold-bad-leg-path`, `scaffold-bad-id`, `scaffold-no-elector` and `pin-malformed` name a value to change too. AGENTS.md section 2 and the handbook now say each refusal names what to run instead, "or, for some, the VALUE to change", and name the two that can be foreseen from the flags one was given, both before anything is created. Each code is still named once, in AGENTS.md. - **One product pinned twice (NIT-1).** The tool refuses `openGlass` with `OpenGlass` and `openGlass` with `Acme/openGlass`, because the file is `neutral_pin_path`'s, lowercased and owner-free. AGENTS.md, README and `--pin`'s help now say "in any case or under any owner" (AGENTS.md names both examples; `--help` says the same name in another case, or under another owner, is the same product). - **The agent's act (NIT-2).** Section 2 gave facts and no act, and read as a contradiction ("each one names what to run instead. Two name a VALUE"). It now says: relay the refusal and ask the human for the value; never choose another yourself. It also says once that `setup.sh` takes the three flags after `--`, which it hands straight to `scaffold-project.py` (setup-project.py: `scaffold_args` appends the passthrough, and `plan_and_confirm` runs the scaffold with `--dry-run` before the typed `yes`). - **The caps (NIT-3).** The two new entries in `tests/test_repo_hygiene.py` use the em dash their neighbours use. AGENTS.md's cap is re-counted: 471 to 477 (section 2 now ten lines more than on main, the descent paragraph three), the entry rewritten to match. README.md stays at 1419; its entry names "in any case or under any owner". The handbook footer's `README.md blob` is re-taken, because README.md moved. Words only: no refusal's logic, order or code changes. The remediation text is as it was in 23b590a. Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…e lines in section 2 and four in "Scaffolding a project that DECLARES descent", as `git diff ede15ce 3fd3669 -- AGENTS.md` adds them, not ten and three (#288) The entry added by 3fd3669 gave the 464 -> 477 raise as "Thirteen lines: ten in section 2 ... and three in ... DECLARES descent". The total and the cap are right; the split was not. Counted from the diff, net of what each hunk removes: section 2 is +11 -2 (nine more lines, the paragraph going from two lines to eleven) and the descent paragraph is +9 -5 (four more). 9 + 4 = 13, 464 + 13 = 477, and `wc -l AGENTS.md` is 477. Words only: the cap, the total and every other byte stay as they were. Lane: openreposhape-4 (openRepoShape-4) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
This was referenced Oct 12, 2026
This was referenced Oct 12, 2026
brettheap
added a commit
that referenced
this pull request
Oct 12, 2026
The one conflict is the AGENTS.md cap in tests/test_repo_hygiene.py. #309 landed first (464 -> 477, its dated entry kept as it is), so this branch's entry is now the step from main's 477 lines to 481 and the cap is 481, the line count of the merged AGENTS.md (checked with wc -l after the merge). Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
brettheap
added a commit
that referenced
this pull request
Oct 12, 2026
…, #253 via #264, #302 via #318, #288 via #309, #279 via #310, #306 via #311, #334 via #336, #239 via #269, #243 via #268, #321 via #335) into fix/adopt-record-submodule-placement Brings in the twelve commits from c7c02fa to a1b3a4b on top of 71b58a1, merged by sha. No rebase. Among the files this branch changes: 346079d (#216) and e43fa95 (#243) change adopt-project.py; 34ecbc2 (#260) changes scripts/shape_materialize.py; 87373a6 (#306) changes shape-doctor.py and tests/test_shape_doctor.py; 7491530 (#288) changes AGENTS.md and tests/test_repo_hygiene.py. Two conflicts, each resolved keeping both sides: - adopt-project.py, the module docstring's `execute` paragraph. #243 ends "the root's only submodules are the two leg mounts, each at the commit pushed to its leg."; this branch follows "two leg mounts." with "The split's `project.yaml` records the leg each source submodule kept in a leg was answered into, under `submodules:`, for `shape-doctor.py` to check it against." The merge has #243's sentence, then this branch's, re-wrapped to the paragraph's width. The module docstring is not in `--help` (docs/cli.md holds neither sentence). - tests/test_repo_hygiene.py, `test_agents_md_is_short_enough_to_be_read`. Each side moved the AGENTS.md cap from 464 and wrote a paragraph saying why: #288 to 477, for thirteen lines, and this branch to 472, for eight. AGENTS.md itself merged cleanly and holds both: 485 lines, main's 477 plus this branch's +9 -1. The merge keeps #288's paragraph word for word, then this branch's, renumbered "2026-10-12: 477 -> 485" because it now follows #288's, and asserts `<= 485`. `git merge-tree --write-tree` of the two parents gives the same tree in every file but these two. Checked: - adopt-project.py: `_commit_the_split` was changed by both sides, in hunks that do not touch. #243 clones the assembly with `--template=`; this branch builds `append` with the `submodules:` record. The merged function holds both, and each side's text is unchanged. Every other definition one side changed is that side's text. - shape-doctor.py: #306 changes `validator_row` and `run_validator`. This branch's placement functions, F1's `gitmodules_the_record_answers` among them, are this branch's text. - No top-level name is bound twice in adopt-project.py, scaffold-project.py, scripts/repo_shape.py, scripts/shape_materialize.py, shape-doctor.py, validate-manifest.py, update-shape.py, scripts/family.py or scripts/bump-leg.py. Each merged module's names are the base's plus what either side added. - AGENTS.md is main's plus exactly this branch's changed lines. - The branch's diff against main is #189 alone: 12 files, +1694 -157. That is +1670 at 27d039b, plus F1's fix and test (+23), plus the one line the docstring re-wrap adds. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap
pushed a commit
that referenced
this pull request
Oct 12, 2026
…ate-pins.py conflicted in seven hunks where #312's PinSources replaced the keyed_sources/default_source parameters, kept #312's side in all seven and added #275's env_shared and shared parameters, the neutral-pin-source-collides finding and its docstring paragraph on top The one conflict was templates/assembly-root/scripts/validate-pins.py, in resolve_neutral_pin_source (signature and docstring), _recompute_neutral_pin_digest (signature and its resolver call), _check_one_neutral_product_pin (signature and its call) and _check_neutral_product_pins (docstring and body). #312 landed (8cdca5e) with the same file blob as the PR head implQ resolved against, so the resolution is implQ's: every hunk keeps #312's PinSources, its 3-tuple return and its _note_unused_pin_sources call, and adds #275's env_shared parameter (rule 2 reads no variable another pin shares), the shared frozenset, the skip hint that omits a shared variable, and _report_pin_source_collisions. scaffold-project.py merged without a conflict over #309's remediation text. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
brettheap
pushed a commit
that referenced
this pull request
Oct 12, 2026
…project.py keeps both imports and lists #270's `plan-unwritable-value` before #314's `plan-manifest-invalid`, after the submodule findings, and scaffold-project.py keeps #314's `--tracking-branch` help beside #309's leg-path help Two files conflicted, in three hunks; every other file merged clean. - adopt-project.py, the imports: #314 imports `MANIFEST_INVALID_REMEDIATION`, `manifest_value_problems`, `misread_placeholders`, `refuse_manifest_values` and `refuse_unstorable_names` from `shape_materialize`, and #270 (f795cf7) imports `unwritable_reason` at the same place. Both are kept. - adopt-project.py, `_entry_findings`: #314 put `_manifest_findings` before the submodule findings, and #270 put `_value_findings` after them. The list is now the coverage and leg findings, then the submodule findings, then #270's `plan-unwritable-value`, then #314's `plan-manifest-invalid`, and the remediations follow in that order. `_refuse_what_check_finds` refuses under the FIRST finding's code. So a value that both rules judge (a lone surrogate, a line break or a bidi control in `visibility:` or `elected_on:`) is refused by `execute` as `plan-unwritable-value`, which #270's hand-edited-value test asks for. That is also the order `plan` already has, because `_checked_plan_inputs` refuses `adopt-unwritable-value` before `_refuse_unholdable_values` asks the validator anything. The validator's finding describes the manifest the value would be written into, which is a consequence of the bad value; the byte, the break or the control is the thing to retype. Both findings are still listed, and both are refused before any leg exists. The docstring says so, and the position main documented for #270's findings (after the submodules) is kept. - scaffold-project.py, `main`'s parser: #314 gave `--tracking-branch` its help text, and #309 (7491530) gave `--spec-path` and `--code-path` theirs. All three are kept. `scripts/render-cli-reference.py --check` passes on the merged tree, and the generator rewrites `docs/cli.md` byte for byte as it merged. No generated output changed. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap
added a commit
that referenced
this pull request
Oct 12, 2026
…elector's fallback are refused before anything exists when no file can hold them, so a byte that is not UTF-8 no longer creates repositories before a traceback (#282) (#351) **What #282 still gets wrong on main (c7c02fa).** #284 (b30595c) spells each of the three quoted placeholders in `project.yaml` with `repo_shape.double_quoted`. So the manifest now reads back whatever was typed. The README, each `AGENTS.md` and each first commit's message still take the value as it stands. Every row of the issue was re-run on c7c02fa with local bare remotes only: 76 cases across `--elected-by`, `--reference`, `--name`, `GIT_AUTHOR_NAME` and `git config user.name` (given as `GIT_CONFIG_COUNT` config). In every case that scaffolded, the project's reader and PyYAML 6.0.3 read the manifest back as typed (0 misreads, 0 raises). What was still wrong: - **A byte that is not UTF-8.** The scaffold exits 1 with a `UnicodeEncodeError` traceback from `write_lf`. Through `--elected-by`, `--reference` or `GIT_AUTHOR_NAME`, both legs are pushed by then and the assembly root is created empty. Through `--name`, all three repositories are created first. Through `git config user.name` it raises `UnicodeDecodeError` from `git_out`'s strict decode in `_elector`. That one happens under `--dry-run` too, before anything is created. The issue does not list this case. - **A line break: LF, CR LF, U+0085, U+2028, U+2029.** The scaffold exits 0. The value goes raw into the README, which gains a line. Through `--name` it also goes raw into the root `AGENTS.md` (2 extra lines) and each leg's `AGENTS.md` (1). With LF or CR LF, each commit message's first line becomes `Seed the spec leg of Ada`; U+0085, U+2028 and U+2029 sit in that line raw. The `manifest ok:` line that the project's own `validate-manifest.py` prints is split as well. - **A control character (U+0001, ESC, DEL, TAB), or a bidi embedding, override or isolate (U+202E, U+2066/U+2069).** The scaffold exits 0, and the value is raw in the README (and, for `--name`, in each `AGENTS.md` and each commit message). **The change.** - `scaffold-project.py` `_identity` asks `unwritable_reason` about the three values, beside `election_date`. Any value that fails is refused as `scaffold-unwritable-value`. The refusal is one sentence per value: the flag, the value as Python's `repr` spells it, the files it is written into, and why. All failing values go into one refusal. It comes before a work directory or a remote exists, and `--dry-run` refuses the same. The only process that can run first is the read-only `git config user.name` that finds the elector when neither `--elected-by` nor `GIT_AUTHOR_NAME` gives one: ``` REFUSED scaffold-unwritable-value: --name is 'Jos\udce9', which the scaffold writes into the assembly root's `project.yaml` and `README.md`, each repository's `AGENTS.md` and each first commit's message, and it holds a byte that is not UTF-8. ``` An elector the flag did not supply is named by its source: `--elected-by (not given, so GIT_AUTHOR_NAME)` or ``--elected-by (not given, so `git config user.name`)`` (`_elector_named`, in `_elector`'s order). The second is the wording #270's `plan` uses. - `_elector` decodes `git config user.name` with `surrogateescape`, the way argv and the environment are decoded. A byte that is not UTF-8 there is then refused by name, not raised. `adopt-project.py` already reads git with this pattern (`git_out(..., binary=True).decode("utf-8", "surrogateescape")`). - `scripts/shape_materialize.py` gains `BIDI_CONTROLS` and `unwritable_reason`: see "Composition with PR #270" below. **Each row of the issue.** | row | `project.yaml` | README / `AGENTS.md` / commit messages | where it stands | |---|---|---|---| | a backslash (`CORP\nick`, also through `GIT_AUTHOR_NAME` and `git config user.name`; `C:\docs\notes\new.md`) | fixed on main by b30595c (#284): `"CORP\\nick"`, read back exactly | raw, as typed, on its own line (Markdown keeps a backslash before a letter literal, and the path is inside backticks) | fixed on main by b30595c | | a double quote (`Joe "JJ" Smith`) | fixed on main by b30595c: `"Joe \"JJ\" Smith"`, read back exactly | raw, as typed | fixed on main by b30595c | | a line break: LF, CR LF, U+0085, U+2028, U+2029 | parses on main since b30595c (escaped, read back exactly) | split on main | **fixed by this branch**: refused | | a byte that is not UTF-8 (all five ways in) | escaped on main since b30595c; not where it failed | traceback on main: `write_lf` raised on the root README or, for `--name`, the spec leg's `AGENTS.md`; `git config user.name` raised in `git_out` | **fixed by this branch**: refused | | a control character: U+0001, ESC, DEL (TAB too) | PyYAML's `ReaderError` fixed on main by b30595c (escaped) | raw on main | **fixed by this branch**: refused | | a bidi control: U+202E, U+2066, U+2069 | escaped on main since b30595c | raw on main (`README.md:9`) | **fixed by this branch**: refused | No row is left open. On this head, the 60 cases with an unwritable value exit 2 under both `--dry-run` and a real run. Each prints one `scaffold-unwritable-value` refusal and makes no bare remote, with 0 tracebacks. The other 16 cases scaffold, exit 0: the backslash, the Windows path, the double quote, and a Persian name joined with U+200C ZERO WIDTH NON-JOINER. Each reads back exactly, and the README gains no line. **Files outside YAML.** `README.md` (`:1` name, `:9` elector, `:10` reference in backticks), the root `AGENTS.md` (`:3`, `:13`), each leg's `AGENTS.md` (`:1`), and the three first commits' messages take the value raw. A backslash and a double quote break none of them: the file holds the typed text, and the line count is unchanged. Every other row is now refused before any of them is written. `--name` also goes into the GitHub description via `gh repo create`, which is not run here. **Composition with #270 (lane 2, #255), now landed as f795cf7.** #270 added `unwritable_reason` and `BIDI_CONTROLS` to `scripts/shape_materialize.py`, and this branch adds the same hunk byte for byte at the same place (after `is_trailer`). The merge of this branch with main ab623dd (e5804e0, made by `gh pr update-branch`) is clean, and its `scripts/shape_materialize.py` holds one `def unwritable_reason` and one `BIDI_CONTROLS`. The two tools refuse the same values in the same words, and the two comments in `scaffold-project.py` that say `adopt-project.py` asks the same question are now true. **Composition with PR #314 (lane 5, `fix/scaffold-manifest-values`).** No duplication. #314 asks the project's reader and `validate-manifest.py` about the rendered manifest, after the values table is built. This branch asks whether a value is text a file can hold, earlier, in `_identity`. Each refuses values the other passes: a blank `--elected-by ' '` is #314's, and `Ada\nLovelace` is this branch's. The merge with ab66bc0 is clean. On the merged tree, #314's own tests fail in 5 places, all on a value both PRs refuse: `--elected-by` of a bare TAB, `\x0b`, `\x1c` or U+2028, which is blank to the validator and unwritable here. This branch refuses those first, as `scaffold-unwritable-value`, where #314's tests expect `scaffold-manifest-invalid` or `scaffold-manifest-`. The failing tests are `test_a_value_the_validator_refuses_is_refused_before_anything_is_made[elected-by-tab]`, `test_a_dry_run_refuses_what_the_validator_refuses[elected-by-tab]` and `test_a_blank_that_is_also_a_line_break_is_refused_too[\x0b|\x1c|\u2028]`. Whichever of the two lands second applies a four-line patch to `tests/test_scaffold_manifest_values.py` (lane 5 holds it), which expects `scaffold-unwritable-value` for those four values. With it applied, the merged tree passes: see Evidence. **Merge-tree** (`git merge-tree --write-tree HEAD <ref>`, fetched 2026-10-12): | ref | tip | result | |---|---|---| | origin/main | c7c02fa, and 346079d (#228 landed since: adopt files only) | clean | | PR #270 | 72bb869 | clean, one `unwritable_reason` | | PR #314 | ab66bc0 | clean (5 of #314's tests need the patch above) | | PR #309 (lane 4) | 2ea1717 | clean | | PR #316 (lane 5, `render` single pass) | 9469148 | clean | | PR #266 (lane 2) | b2b42f8 | clean | | lane 1 `fix/adopt-record-submodule-placement` | 3e86200 | clean | | lane 1 `fix/adopt-late-failure-notice` | 918e8f2 | clean | | lane 1 `fix/adopt-root-kept-symlinks` | 6c44591 | CONFLICT in `adopt-project.py`, which this branch does not touch; the branch conflicts with origin/main alone the same way | | lane 1 `fix/adopt-plan-quote-yaml-keywords` | e337f44 | the same: CONFLICT in `adopt-project.py`, also against origin/main alone | | lane 5 siblings `fix/pin-source-env-collisions` c32a228, `fix/family-init-values` 14e2d68, `fix/yaml-flow-brackets-surrogates` 38738cf, `docs/adopt-execute-exits` d3f71d6 | | clean | | lane 2 local `fix/scaffold-tracking-branch-ref-format` (#283) | a03abcf | clean | **Evidence.** - New `tests/test_scaffold_free_text_values.py`, 113 cases: - each of the 12 unwritable values through each flag, dry and real (72), under a guard that fails the test if any process starts; - all three bad values named in one refusal; - each value through `GIT_AUTHOR_NAME` (12), with no process started; - `git config user.name` with LF, U+202E, ESC and a byte that is not UTF-8, dry and real (8). The last is skipped on Windows, whose environment is UTF-16; - the flag winning over the fallbacks; - 15 dry runs that must not refuse; - one real scaffold of a backslash, a quote and U+200C, through `--name`, `--reference` and `GIT_AUTHOR_NAME` (the test does not use the `--elected-by` flag). It reads back exactly, and the README lines, each leg's `AGENTS.md` and the commit subjects stay single (the root `AGENTS.md` is not checked by this test); - a byte that is not UTF-8 through each flag as a child process's argv (3). - That file on head: 113 passed. On c7c02fa: 97 failed, 16 passed. The 16 are the 15 dry runs and the real scaffold of text, which hold on main since #284 by design. - Mutation probes (each reverts one part, in a throwaway worktree; every one makes at least two tests fail): - no refusal call: 97 failed; - strict decode of `git config user.name`: 2; - `_elector_named` always `--elected-by`: 20; - elector field dropped: 47; - `--reference` dropped: 26; - `--name` dropped: 26; - no line-break check: 39; - no surrogate branch: 13; - no bidi branch: 17; - no control branch: 30; - refusing every `Cf` (over-refusal): 4, the U+200C cases. - Targeted on head 8f43c96 (`git-filter-repo` 2.47.0 on PATH): `tests/test_scaffold_free_text_values.py tests/test_scaffold_e2e.py tests/test_scaffold_pin_and_reuse.py tests/test_scaffold_leg_paths.py tests/test_scaffold_leg_path_collisions.py tests/test_scaffold_pin_collisions.py tests/test_scaffold_referent_chain_links.py tests/test_scaffold_mount_ignored.py tests/test_scaffold_ignored_shape_files.py tests/test_template_quoted_values.py tests/test_naming_policy.py tests/test_reference_default.py tests/test_reuse_visibility.py tests/test_stdout_encoding.py tests/test_repo_hygiene.py tests/test_cli_reference.py`: 801 passed, 1 skipped (`test_stdout_encoding.py:286`, Windows' own default). - Merged trees: - with #270, this file plus `test_adopt_template_values.py`: 191 passed; - with #314 plus the compose patch, this file plus `test_scaffold_manifest_values.py`, `test_scaffold_e2e.py`, `test_template_quoted_values.py` and `test_cli_reference.py`: 343 passed. Without the patch (on a5ef3f5, which differs from 8f43c96 only in an import's place and a docstring): 5 failed, 338 passed, the five above; - with #316, this file plus `test_template_quoted_values.py` and `test_template_values_single_pass.py`: 344 passed. **Left out, with follow-up candidates.** - **`adopt-project.py plan` dies the same way on a `git config user.name` that is not UTF-8.** With no `--elected-by`, it exits 1 with `UnicodeDecodeError` from `git_out` (c7c02fa, and with #270 merged). `_elector` in `adopt-project.py` reads it strictly. It is adopt's half and #270's ground, so it is not touched here. - **A `--local-remote-dir` path that is not UTF-8.** The scaffold creates the three bare remotes, then raises in `write_lf` on `{{ASSEMBLY_CLONE_URL}}` in a leg's README (reproduced on this head). It is the test path only. #270 refuses the same for adopt's clone URL (`_refuse_an_unwritable_clone_url`). Here it is a separate, small issue. - **A `GIT_AUTHOR_NAME` of whitespace alone.** The scaffold falls past it to `git config user.name` for the elector. `env_commit` then hands it to git unchanged, and git refuses to commit (`fatal: name consists only of disallowed characters`) after the remotes are created. Seen on c7c02fa while testing; not this issue's input. - **Markdown syntax in the values** (`*`, `` ` ``, `[`, `\*`) renders as Markdown in the README and `AGENTS.md`. The files hold the typed text, and escaping it would print backslashes in a plain read, so it is not changed. - No `--help` text changed, so `docs/cli.md` is not regenerated. The module docstring's first line, the help description, is unchanged. **Review.** An adversarial review of 8f43c96 found 0 blockers, 0 should-fix and 5 nits (APPROVE WITH NITS): - **#270 copy:** it re-checked the copied hunk byte for byte (same sha256) and found one definition in every merge, in either landing order. - **Probes:** 63 values went through all five sources, dry and real; 320 cases were refused with no work directory, remote or traceback, and nothing was found landing broken. - **Order with #314:** the #314 patch is complete (219 passed with it), and the order of the two refusals is sensible. - **Nits handled in this body:** the "before any process" claim (N1) and wording (N5). - **Nits left for a fix round:** - three mutants of this branch's copy of `unwritable_reason` that only #270's unit table catches (N2); - the argv child-process test with no Windows skip (N3), which Windows CI then passed; - naming the elector's fallback the same way as #314 on the merged tree (N4). Reviewed adversarially: no blocker or should-fix, five nits (two corrected in this message's text, one settled by Windows CI, two left as small follow-ups). CI is green on Linux, macOS and Windows, with SonarCloud passing, at e5804e0 (8f43c96 merged with main ab623dd); main's later #245 (161c6c9) touches none of this branch's files. Closes #282 Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap
added a commit
that referenced
this pull request
Oct 12, 2026
… of main's commits merge with no conflict, among them #243's template-less clone of the assembly and #216's literal `git grep` in adopt-project.py, and #260's one-pass `render` in shape_materialize.py origin/main moved 71b58a1 -> 8cdca5e. It was merged by sha, as the coordinator asked for e43fa95 or later: - c7c02fa (#299 via #315), scripts/family.py; - 346079d (#216 via #228), adopt-project.py: `plan`'s follow-up `git grep`; - 34ecbc2 (#260 via #316), scripts/shape_materialize.py: `render` substitutes in one pass; - 86da808 (#253 via #264), scripts/bump-leg.py; - 6f4ce47 (#302 via #318), scripts/family.py; - 7491530 (#288 via #309), AGENTS.md, README, docs and scaffold-project.py's --help; - 7591455 (#279 via #310), tests/conftest.py: `git()` takes its default identity as `-c` config; - 87373a6 (#306 via #311), shape-doctor.py; - 8a14ac9 (#334 via #336), tests/test_update_shape_landing.py; - c1b6732 (#239 via #269), update-shape.py; - e43fa95 (#243 via #268), adopt-project.py: the assembly root is cloned with `--template=`, and the verification refuses a mount whose gitlink is not the commit pushed to its leg (`adopt-mount-commit`); - a1b3a4b (#321 via #335), tests/test_git_output_decoding.py; - 8cdca5e (#295 via #312), the template's scripts/validate-pins.py. `git merge-tree` and this merge give the same tree, 07e6b49. adopt-project.py, scripts/shape_materialize.py and tests/test_adopt_ignored_shape_files.py auto-merge. In the last of these main's 346079d and this branch's 86a5e30 change different cases. Checked on the merged tree: - AST (fin183g/names.py, base 71b58a1): no top-level name is bound twice in adopt-project.py, scaffold-project.py, scripts/repo_shape.py or scripts/shape_materialize.py, and none is loaded but bound nowhere. Main changed the signature of no function this branch calls. - Every sentence 86a5e30 changed is still there: in `_through`, in `_link_parts`, in `_verify`'s `_resolve` (which e43fa95's `adopt-mount-commit` leaves as it was), and in the three test files. - `_commit_the_split` now clones the assembly with `--template=`. The next commit, F3, reads what that clone holds in its own `.git`, which is why F3 comes after this merge. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap
added a commit
that referenced
this pull request
Oct 12, 2026
…refused `gh pr create`, and step 7 keys its way out to the exit it prints, so an `IS pushed` exit 2 is finished by hand, not re-run into a second pair of legs (#304) (#371) AGENTS.md step 7 told an assistant that any non-zero exit of `adopt-project.py execute` is "to fix the plan and re-run into fresh legs". That is the way out of a failed verification, exit 1. In GitHub mode `execute` has two more non-zero exits, both exit 2, and both come after both legs and the split branch are pushed: - `gh pr create` refused: `The branch IS pushed. Open the pull request by hand:` and the command. `execute` returned before `_verify`, so no table was printed and the pull request to open by hand was for a split nothing had checked. - The topic will not set: after `adoption verified`, `The split IS pushed and the pull request IS open. Set the topic by hand:` and three commands. On either, the way out is the printed command, and "re-run into fresh legs" abandons a finished adoption for a second pair of legs. No test reached either function, because `--local-remote-dir`, the path every test takes, skips both (`if not local:`). - **AGENTS.md step 7**, four lines longer (477 -> 481 on origin/main, the cap raised with a dated entry in `tests/test_repo_hygiene.py`; #309 landed first and its `464 -> 477` entry is kept as it is). It keys the advice to the exit the tool prints: exit 1 keeps its content (the source is untouched, fix the plan, re-run into fresh legs); exit 2 saying `IS pushed` (GitHub only, `gh pr create` or the topic refused) comes after both legs and the split are pushed and verified, so finish with the command it prints and never re-run into fresh legs. - **`adopt-project.py`, behaviour (fix round 1, below):** a refused `gh pr create` no longer returns before the verification. The by-hand command is printed after the table, and only when the table passed. - **`adopt-project.py`, the module docstring's EXIT CODES paragraph.** It gave exit 2 one meaning, "the question could not be asked". It now names the two exit 2s that come after the push and the verification, in the tool's own words, and says that a failed verification outranks both. `--help` carries none of it, so `docs/cli.md` is unchanged (`scripts/render-cli-reference.py --check`: `docs/cli.md is what the generator produces`). - **`tests/test_adopt_github_exits.py` (new, 11 tests).** The issue's reproduction as a test: a `#!/bin/sh` `gh` that refuses one command (the pattern of `tests/test_scaffold_leg_paths.py`, `WINDOWS_SKIP`) and a throwaway global git config rewriting `https://github.com/` to bare repositories under `tmp_path`, so no network. Each exit is asserted as exit 2 with its REFUSED block and its by-hand command word for word, a table, both legs and the split branch pushed; the command comes after the table in a merged stream; a verification that really fails gives exit 1 with a refused pull request and no command to open one. Step 7's anchors (`IS pushed`, `gh pr create`, the topic) and the EXIT CODES paragraph are asserted against what the tool prints, so rewording either side alone fails a test. The issue's second "what would fix it" bullet. Reproduced on d3f71d6 first (a source with its own `contracts/shape-pin.yaml` kept in the root fails the verification for real, nothing in the tool replaced): | scenario, GitHub mode, merged stdout+stderr | before (d3f71d6) | after | |---|---|---| | `gh pr create` refused, split verifies | exit 2; no table; `Open the pull request by hand` (line 19) | exit 2; table (27), `adoption verified` (33), then `Open the pull request by hand` (37), the last thing printed | | `gh pr create` refused, split FAILS verification | exit 2; `Open the pull request by hand` for a split that is wrong, never verified | exit 1; the finding and the footer; `No pull request was opened, and none should be: the split above did not pass verification.`; no command to open one | | topic refused, either | unchanged | unchanged (exit 2 / exit 1) | **The order, and why.** The split is pushed, then `gh pr create` is tried; a refusal prints its REFUSED block at once (what failed); the topic is not tried; `_verify` runs; then the by-hand lines are printed or withheld by what `_verify` said. Evidence for each step: - *The by-hand text has to come after the verdict.* The command is only right for a split that passed; a failed one must not get it (the brief), and a person who sees only the REFUSED block above, which names the exact `gh pr create ...` that was tried, may paste it. So `_open_it_by_hand` runs after `_verify`, and a failed split gets the sentence above in its place. - *It flushes stdout first.* Under a pipe stdout is block-buffered and the table is on it. In the merged logs above (stdout to the same file as stderr), every stderr line lands ahead of every stdout line on d3f71d6: the topic's by-hand commands print at line 7 of 26, before the table at 20. A test (`..._comes_after_the_table`) fails without the flush. - *The topic is not tried after a refused pull request*, as before (it returned early). Its by-hand message says the pull request IS open, so printing it would be false; the stub `gh` lets a topic through, and a test asserts it is never set on this path. - *Verifying first and opening the pull request only on a pass* was considered and not done: it reorders every successful run's output (the pull request line moves below `adoption verified`, and `_verify`'s `NEXT: review the pull request` is printed first), and it is not "the code path the topic case uses". It would fix something real, below. The code reuses the topic's path, with no second verification: `cmd_execute` already ran `_verify` after the topic step; the early `return 2` is gone, `_open_the_pull_request` prints the REFUSED block and returns False as before, and the by-hand lines moved to a small `_open_it_by_hand` called once the verdict is known. The exit is `2 if the pull request was refused or the topic failed`, and a failed verification outranks both with exit 1. **Tests for it** (`tests/test_adopt_github_exits.py`, 7 tests, all end to end through the real CLI): - `test_each_exit_after_the_push_is_exit_2_with_a_command_to_finish_by_hand[gh-pr-create-refused]` now expects the table, `adoption verified`, no pull request line, the topic never set; - `..._the_command_to_open_a_refused_pull_request_comes_after_the_table`: merged stream, table < `adoption verified` < by-hand, which is the last thing printed; - `..._a_failed_verification_outranks_a_refused_pull_request`: exit 1, the finding, no `Open the pull request by hand`, no `IS pushed`; - `..._the_same_source_verifies_when_gh_opens_the_pull_request`: its control, exit 0. Driving a real failing verification was practical (a source's own pin kept in the root, the way #188's tests do it), so nothing is injected. **Fails before, passes after:** the 5 changed or new tests fail on d3f71d6 (the step 7 reading, the EXIT CODES reading, the pr-create run, the order run, the failed-verification run); the topic run and the control pass there, as they should. **Mutation probes of the new hunk**, each failing at least one new test: restoring the early `return 2` (3 fail); ignoring the verdict in `_open_it_by_hand` (the failed-verification test); removing the flush (the order test); trying the topic after a refusal (the pr-create run); returning 0 for a refused pull request (2 fail); AGENTS.md or the docstring back to d3f71d6 (their readings). **S1, a closed stdout (should).** `_open_it_by_hand` flushed stdout with `sys.stdout.flush()`, which raises BrokenPipeError when nobody reads stdout any more (`execute ... | head`, `| true`), so the run ended in a traceback and the command to open the pull request, which main printed, was never printed. It now calls `_flush_stdout()`, which is lane 1's #188 helper under the same name and shape (`contextlib.suppress(OSError)`), at the same place in the file and with the same text, so the two merge to one definition. A test drives the real CLI with a stdout whose reading end is closed: the command is on stderr, there is no traceback, and the exit is 120, Python's own for a stdout it cannot flush as it exits, which main gave and 16aa9ff gave too (so the exit does not tell them apart; the traceback and the missing command do). | `pr` scenario, stdout closed (`\| true`) | c7c02fa (main) | 16aa9ff | this head | |---|---|---|---| | by-hand command | printed | **not printed, traceback in `_open_it_by_hand`** | printed | | exit | 120 | 120 (Python's, for the stdout it cannot flush as it exits) | 120 | **S1, the other case, NOT built here.** If the verification itself raises (a `git` that will not list a tree, a full disk), the by-hand line is still lost: a `CommandFailed` gives exit 2 with two REFUSED blocks and no word that the legs and the split are pushed, an `OSError` a traceback with exit 1, which step 7 reads as "a failed verification". #188's `_verify` catches those, reports them with its notice and the branch to delete, and exits 2; composed, both give `REFUSED verifying the split`, the notice, and "No pull request was opened, and none should be". That needs #188's handler, so it is its to compose, not this PR's to build. **S2.** origin/main is merged into the branch (merge commits c519f57 and a92fcad, no rebase or force). The one conflict was the AGENTS.md cap: #309's `464 -> 477` entry is kept as it is, this PR's entry is now `477 -> 481` and the cap is 481, the real `wc -l AGENTS.md` after the merge (477 on main, and step 7 grows from 5 lines to 9). The composition section above is refreshed against the current heads. **Nits.** - **N1.** The dated entry uses the file's em dash, and the five-versus-four sentence and "(fix round 1)" are gone: it describes the change, not the branch's history. - **N2.** `NEXT: review the pull request on <root>` moved out of `_verify` into `_next_steps(names)`, which `cmd_execute` calls only when no pull request was refused. After a refused one, the by-hand command is the next step and the last line. Under `--local-remote-dir` it is unchanged (see "Left out"). - **N3.** The printed command now works without a terminal. `gh pr create` without `--title` and `--body` asks for them, and where there is no terminal it exits 1 before any request (`must provide --title and --body ... when not running interactively`; the review ran it offline with a bogus token, an empty config directory and an `.invalid` host, and this fix round did not run `gh` at all), so an assistant told by step 7 to "finish with the command it prints" could not. The tool already knew both, so `_pull_request_command` builds the arguments once, `_open_the_pull_request` runs them, and `_open_it_by_hand` prints the same list, shell-quoted. A test reads back the arguments the stub `gh` was refused with and compares them with the parsed printed command; nothing runs the printed command. Two costs, stated: the body is the split commit's message, which lists every moved path, so for a large repository the printed command is as long as that list (the REFUSED block above it already prints the same text unquoted); and the quoting is POSIX, as #188's printed `git ... --delete` already is. `_open_it_by_hand`'s signature is now `(repositories, names, tracking, branch, message, passed)`, which the #188 note carries. - **N4.** The EXIT CODES paragraph said `execute` "has two more exit 2s". It now says it has other exit 2s once the leg repositories exist (a refused push, a refused mount) and that two of them are GitHub mode's alone. - **N5.** The follow-up claiming #188's `_flush_stdout()` covers the topic's by-hand commands printing above the table was false; it is corrected above ("Left out"). - **N6.** Nothing to do: the coordinator lands with an explicit squash message. - **N7.** Wording only, for the #188 composition: "was not verified" would be exact where #188's `_verify` could not verify at all. It is in the note on #188. - **N8.** The end-to-end environment keeps the real `gh` unreachable. `subprocess` goes on to the next PATH directory when the program it found cannot be executed (a `noexec` temp directory gives EACCES), and the next `gh` would be the operator's. So the run's environment now carries `GH_TOKEN=bogus-token-for-tests` and `GH_CONFIG_DIR` an empty directory, and PATH is the stub first and then the inherited PATH WITH every directory that holds a `gh` taken out (`without_a_real_gh`), which finds `git` and `python` because the directories are taken out only when each of `git`, `git-filter-repo`, `python3`, `python`, `sh`, `env`, `sed`, `tr`, `uname` and `cat` is found at the same place without them. Where it is not (`/usr/bin` on Linux holds `gh` beside `git`, and Homebrew's `bin` beside the `git` a run is meant to use), PATH is returned whole and the token and the config directory are what keep the real `gh` from acting. The stub records the token and config directory it was run with, and a test holds them to the bogus token and the empty directory. **Tests.** `tests/test_adopt_github_exits.py` is 11 tests now. On a throwaway worktree at 16aa9ff with this file: **5 failed, 6 passed**. Failing there: the EXIT CODES reading (N4), `[gh-pr-create-refused]` (N2), the order test (N2, N3), the printed-command test (N3) and the closed-stdout test (S1). Passing there, as they should: step 7, `[the-topic-will-not-set]`, the failed-verification test and its control, and the `without_a_real_gh` unit test and the environment test (N8: nothing in 16aa9ff's production code to fail, the environment is the test's). **Mutation probes** (15, each reverted by path in a throwaway worktree): the unguarded flush back, the flush removed, `_flush_stdout` not suppressing, the printed command cut to the old form, unquoted, run without the body, `NEXT` always or never said, the EXIT CODES paragraph reverted, the cap back to 477, the token or the config directory dropped from the environment, and `without_a_real_gh` either keeping every directory or dropping the shared ones: each is caught by at least one test, and a title with the leg names swapped, which no test caught at first, is caught by the title assertion added for it. - **Reproduction** (the issue's script, unchanged but for temp paths, on c7c02fa, git 2.43.0): both loops exit 2 with every message the issue quotes; the first printed no `VERIFICATION` table. - **Every non-zero exit of `execute`**, with line numbers, is tabulated in the lane's report. Also run: first `gh repo create` refused (exit 2, nothing created), second refused (spec leg exists, empty), split push refused by a hook (exit 2, legs pushed), and the naive re-run after the topic exit (refused at `gh repo create`, as a taken name is). - **Targeted tests on the head (c5a8a55, origin/main a1b3a4b merged in):** - `tests/test_repo_hygiene.py tests/test_cli_reference.py tests/test_adopt_github_exits.py`: 74 passed. - `tests/test_adopt_e2e.py tests/test_adopt_plan.py`: 75 passed, 1 skipped (`SHAPE_MEDXEHR_CLONE` is unset: the MedxEHR-backed plan test needs a read-only clone of MedxSoft/MedxEHR). - `tests/test_adopt_execute_refusals.py tests/test_adopt_verify.py`: 53 passed. - `tests/test_git_output_decoding.py` (origin/main's text-mode guard, which reads test files like this PR's): 67 passed. - `scripts/render-cli-reference.py --check`: `docs/cli.md is what the generator produces`. - origin/main, #184 (`fix/adopt-report-filter-repo-failure`, f416e13), #245 (`fix/adopt-relative-submodule-url`, d72544c, which now contains #309), and the lane-5 siblings F (69c54c9), K (21fbea4), L (8f43c96), M (14e2d68), Q (a30091f) and U (233dc71): all clean. #309 and #268 have landed; the one conflict with #309, the AGENTS.md cap in `tests/test_repo_hygiene.py`, is resolved in the merge commit (`477 -> 481`, cap 481 = `wc -l AGENTS.md`). - **#188** (`fix/adopt-late-failure-notice`, 918e8f2): conflicts in AGENTS.md (step 7) and in six regions of `adopt-project.py`, all in code this PR rewrote and #188 edits (nine regions in all, and three of those are #188's own against origin/main since #268 landed, so they are not this PR's). Not resolved in either branch. The note for lane 1, with the joined step 7 (482 lines, cap 482), the join of each region and the one patch #188's tests need, is posted on #188: the two `[...-pull-request]` parametrizations of `test_a_gh_step_after_the_split_gets_its_by_hand_exit` call `_open_the_pull_request` alone and look for the by-hand text, which is `_open_it_by_hand`'s now. Checked on a throwaway tree (87373a6, where #188 merges clean, plus this PR's diff plus #188, joined by hand, never committed): 106 passed over `tests/test_adopt_github_exits.py`, the whole of `tests/test_adopt_late_failure.py`, `tests/test_adopt_verify.py` and the cap test; without the one test patch exactly those two parametrizations fail. `_flush_stdout()` and the two imports are the same text on both branches, at the same place, so they merge to one definition. - `fix/adopt-record-submodule-placement` (#189, 3e86200), `fix/adopt-root-kept-symlinks` (6c44591), `fix/adopt-plan-quote-yaml-keywords` (e337f44): conflict in `adopt-project.py` (and, for #189, the cap line) in exactly the same regions with this PR absent (`git merge-tree origin/main <ref>`: 1 + 1, 3 and 3 conflict regions either way); none of them is this PR's. With #189 (cap 472, +8) as well the cap would be 489; arithmetic only. `README.md`, `docs/handbook.html` and `docs/cli.md` are not touched here, so the handbook's README-blob footer does not move. **At opening** (origin/main 8cdca5e, which merges clean): lane 1 has since moved `fix/adopt-plan-quote-yaml-keywords` to d38e143, which now merges clean, and #189 to 27d039b. - **README.md and docs/handbook.html: unchanged.** Neither states the rule: README's adoption section and the handbook's `#adopt` say that `execute` verifies and never say what a non-zero exit means; their "re-run" / "clean re-run" sentences are the scaffold's (`#partway`, lane 4's #309 territory). Changing the README would also move the handbook's machine-checked `README.md blob` footer for no gain. - **The verification footer and `--help`.** The footer (`_verify`, exit 1) is true for the exit it describes, and `tests/test_adopt_verify.py` holds its text; #188 rewrites it. `--help` carries no exit-code text. - **`NEXT: review the pull request on <root>` under `--local-remote-dir`** is still printed, as it always was, with no pull request ever opened. This PR stops saying it after a refused pull request (fix round 2); a local run is a test or rehearsal path, and its NEXT block is the only clone-and-bootstrap guidance it has. - **Candidate follow-ups, not done:** - GitHub mode opens the pull request BEFORE it verifies, so a failed verification leaves a pull request open for the wrong split (probed, a source's own pin kept in the root: `pull request .../pull/1` printed, then the finding, exit 1). Verify, then open, would avoid it, at the cost of reordering every successful run's output. - After a refused pull request the topic is not tried and the by-hand text does not list the three `gh repo edit` commands, so a person who opens the pull request by hand still has no topic set. - The topic's by-hand commands print above the table in a merged log (line 21 of 26 with #188 composed, line 7 on main): `_set_the_topic` prints them before `_verify` runs, so #188's `_flush_stdout()` only stops them jumping ahead of the leg lines. `_set_the_topic`'s docstring ("the caller reports it after the table") is false on main and stays false with #188. Printing them after the verification, the way this PR does for the pull request, would make it true. - **No remediation on three exit 2s** (a refused `gh repo create`, a refused split push, a failed `git filter-repo`): on c7c02fa each prints a REFUSED block or, for the last, nothing at all (probed: exit 2, empty stderr, two leg repositories left). #184 and #188 are the open PRs on these. An adversarial review of 16aa9ff found 2 should-fix items and 8 nits. Fix round 2 addresses all of them. A re-verification of c5a8a55 found 0 blockers, 0 should-fix items and 4 nits: - the end-to-end environment still passes `GH_HOST` and the enterprise tokens through; - this body's composition tips had moved (refreshed above); - two counts in lane 1's composition note were off (corrected before posting); - the `not verified` half of the `NEXT` condition has no test. No probe ran the real `gh`: every probe used a stub first on PATH, a bogus `GH_TOKEN` and an empty `GH_CONFIG_DIR`. Reviewed adversarially: the first review asked for changes (two should-fix, eight nits), and a fix round addressed all ten. The re-verify approved with four nits, left as follow-ups: the end-to-end environment passes `GH_HOST` and the enterprise tokens through, the composition section was stale at that day's heads, two sentences of the #188 note were imprecise, and the `not verified` half of the new `NEXT` condition has no test. CI is green on Linux, macOS and Windows, with SonarCloud passing, at 34b9500 (c5a8a55 merged with main 161c6c9). Closes #304 Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 12, 2026
brettheap
added a commit
that referenced
this pull request
Oct 12, 2026
…r and validate-manifest.py about the manifest's values before anything exists, so `--id null`, `--tracking-branch true` and a blank `--elected-by` are refused (#258, #261) (#314) Both tools fill `templates/assembly-root/` from values a person typed or edited into a plan, and the new project then reads the result with two programs of its own: its YAML reader (`repo_shape`) and its `scripts/validate-manifest.py`. Neither tool asked either of them. Now each is asked, before a work directory or a remote exists and under `--dry-run` alike, and a value the project cannot hold is refused with the value named and the reason given. - **#258, the scaffold.** `id:` and `tracking_branch:` are written bare. `--id null` and `--id true` scaffolded three repositories whose first bootstrap failed `manifest-id`; `--tracking-branch true`, `007` or `null` pushed every repository on the branch as typed while bootstrap read the manifest back as `True`, `7` or `main` and put each leg on a local branch the remotes do not have, with no upstream, exit 0. Now `scaffold-manifest-misread` names the value and what the reader makes of it. - **#261, both tools.** A blank `--elected-by`, `--reference` or `--name`, `--elected-on 2026-W41-6` or `20261011` (read by `date.fromisoformat` from Python 3.11), `--org test+org`, and a plan edited to `visibility: secret` or `elected_by: null` were accepted, and `adoption verified` or a scaffold exit 0 followed. Now the scaffold says `scaffold-manifest-invalid`, `adopt-project.py plan` says `adopt-manifest-invalid`, `check` makes a `plan-manifest-invalid` FINDING of each, and `execute` refuses it through `check`'s own list (#168), before a leg repository exists. The sentence quotes the validator's own finding, so the words are its words. - **Names that cannot be directories.** A `--project` of 247 to 250 characters died in `Path.exists` with `OSError: File name too long` and a traceback under `--local-remote-dir` (scaffold from 247, adopt `execute`); `plan` admitted 251 to 255 that `check` refused as `unsafe-value: legs.spec`. `scaffold-name-too-long` and `adopt-name-too-long` refuse the first before anything exists, and `plan` now holds the three derived names to `checked_value` as `check` does. - **A validator that cannot be asked.** A copy of the standard whose `templates/assembly-root/scripts/validate-manifest.py` is missing, does not load, lacks what is asked of it (`DATE_RE`, `_findings`) or raises, is `manifest-validator-unusable` and not a traceback: it names the file, says the defect is the copy's and that nothing was created. A failed load is not cached. - `scripts/shape_materialize.py` (the one module both tools import, in no copy list): `manifest_misreads` renders each template line that carries a value and reads it with `parse_yaml`; `manifest_invalid` renders `project.yaml` from the whole substitution table and runs the validator the template ships, loaded from that file (no bytecode written into the template tree, `sys.path` put back); `refuse_manifest_values` and `manifest_value_problems` compose them; `misread_placeholders` names the placeholders `manifest_misreads` would refuse; `election_date` admits only what the validator's own `DATE_RE` admits, on every Python; `refuse_unstorable_names` holds a name to 255 bytes, `.git` included under `--local-remote-dir`, and shows a name too long at both ends. A placeholder is what `PLACEHOLDER_RE` finds in a line, not a second copy of its alphabet. - `scaffold-project.py`: `_refuse_unholdable_manifest` after the substitution table is built and before the plan is printed, the name rule before anything asks `gh api`; `--help` for `--id`, `--elected-by` and `--tracking-branch` says the rule. - `adopt-project.py`: `_flag_plan`, `_manifest_values` (the table `execute` renders from, asked of `_template_values` and not copied), `_manifest_findings` in `_entry_findings`, `_refuse_unholdable_values` in `cmd_plan`, the name rule in `_repository_urls`. - `docs/cli.md`: regenerated (four help paragraphs). - `tests/test_scaffold_manifest_values.py` (106 tests), `tests/test_adopt_manifest_values.py` (79). The templates write `id:`, `elected_on:`, `visibility:`, `tracking_branch:` and the leg paths bare, and the project's reader reads `null`, `true` and `007` as None, True and 7. Either the tool refuses what the project would misread, or the template quotes the placeholder (#259, which Brett has not decided). This refuses, because: 1. Every neighbouring fix refuses and none quotes: #225 (`--spec-path 2026`: "refused rather than quoted in the templates"), #181 (`adopt-manifest-misread`), #266, #251 (a chain link that is not a name). A scaffold that quoted while `adopt-project.py plan` refuses `--tracking-branch 007` would disagree with it about whether `007` is a branch. 2. Quoting changes the bytes of every new project's `project.yaml` and leg pins for every tool that renders them (the scaffold and adopt `execute`), and #259 asks for that to be decided once. (`family.py init` renders `templates/family-root/`, not these lines; it has the same defects in its own file and is #307.) 3. The question is asked of the TEMPLATE: each line is rendered and read as the project reads it, so the day a placeholder is quoted those values read back and nothing here refuses them, with no edit. `test_quoting_the_template_would_make_the_refusal_go_away` holds that. 4. A value that is a legal git branch name and that YAML reads as a boolean or null is not silently retyped: it is refused, with the reading named. **A behaviour change for input that used to work.** `--tracking-branch 2026` and `1.5` worked by accident (`str(2026)` gives `2026` back, and every reader of `tracking_branch` does `str()`: `bootstrap.py`, `update-shape.py`, `bump-leg.py`); they are refused as `adopt-project.py plan` refuses them on #181. #259's quoting would allow them again. The refusal's remediation says so in the true terms: it says only what holds of every value refused (the project's reader reads back something other than what was typed), names the failures that do hold (an id that is not text fails `validate-manifest.py`; `007` as a branch reads back as `7`), says that `2026` or `1.5` as a branch work today only because the tools that read it turn the number back into text and are still numbers to the project's reader, and gives the way forward, a value the reader takes for text (`atlas`, `release-2026`, `v2`). It no longer says the first bootstrap would fail, which is false of exactly those two values. The rule is the validator's own: `manifest_validator()` loads `templates/assembly-root/scripts/validate-manifest.py` from the template it ships, and `election_date` asks its `DATE_RE`. The alternative, moving the predicates into `scripts/repo_shape.py`, is a shape copy: every project in the estate would meet an `upstream-changed` row on its next `update-shape.py check` for a question no project asks of itself (the argument `shape_materialize` already makes for the leg-path rule and the commit trailers). Loading the file leaves the validator the one place the rule is written, and any rule it learns is asked here with no edit (`test_the_election_date_asks_the_validator_not_a_copy_of_its_rule`). Reproduction scripts: the issues' own loops (`repro258.sh`, `repro261.sh`), local remotes only. ``` base c3f4987 == --id null: scaffold exit 0 ... bootstrap exit 1 FINDING manifest-id: id is None == --tracking-branch 007: scaffold exit 0 ... bootstrap exit 0 spec leg on 7, upstream: fatal: no upstream configured for branch '7' == scaffold --elected-by ' ': exit 0, bootstrap exit 1: FINDING manifest-elected-by: elected_by is empty == adopt plan --org=test+org: check plan ok, execute exit 0, 1 x 'adoption verified'; bootstrap exit 1: manifest-leg-repository == adopt --project of 247 characters: execute exit 1 OSError: [Errno 36] File name too long this branch == --id null: scaffold exit 2, REFUSED scaffold-manifest-misread: --id is 'null', which is written into project.yaml as `id: null`, where the project's own YAML reader reads it back as no value at all and not as that text. == --tracking-branch 007: scaffold exit 2, REFUSED scaffold-manifest-misread: --tracking-branch is '007' ... reads it back as the number 7 == scaffold --elected-by ' ': exit 2 REFUSED scaffold-manifest-invalid: --elected-by is ' ', which the project's own validate-manifest.py refuses: manifest-elected-by: elected_by is empty. ... == adopt plan --org=test+org: plan exit 2 REFUSED adopt-manifest-invalid: --org is 'test+org' ... manifest-leg-repository ... == adopt --project of 247 characters: execute exit 2 REFUSED adopt-name-too-long ``` Each row is in the logs named in the report; every row of the two issues, and the extra rows lane 2 added to #258 (`--id 2026` and `007`, `--project Null` and `True`, `--tracking-branch TRUE`, `Null` and `1.50`), is a test that fails on c3f4987 (130 of the 170 new tests fail there: the rest assert what must still work, such as `release-1` and `v1.2.3`, or hold the API). Targeted runs on this head, all with the venv `git-filter-repo` 2.47.0 on PATH: | run | result | |---|---| | test_scaffold_e2e, _pin_and_reuse, test_naming_policy, test_manifest_validator, test_adopt_plan, test_adopt_execute_refusals, test_repo_hygiene, test_cli_reference, test_adopt_entry_paths, test_adopt_finding_spelling, test_adopt_gitmodules_values, test_yaml_flow_quotes, test_load_yaml_refusals, test_adopt_plan_escapes, test_pin_validator, test_neutral_pin_validator, and the two new files (170 of the tests) | 1087 passed, 1 skipped (`SHAPE_MEDXEHR_CLONE` unset) | | `tests/test_shape_doctor.py`, its own stream | 242 passed, 3 skipped (the PowerShell line, a Windows host only) | Mutation probes: each hunk reverted in a throwaway worktree, at least one new test fails for each of the eighteen of the first round and the ten of the second (the date rule, the scaffold gate, the misread scan, the validator question, the bytecode and `sys.path` guards, both name rules, adopt `plan`, the one list `check` and `execute` read, the grouping by value, the attribution, the leg-path and non-text filters, the list-`legs` guard, the no-revision guard, the unclassifiable-names guard; and the remediation wording, `misreads_elsewhere`, the placeholder pattern, `_line_shown`, the name tails and the three validator guards). Reach: every tracked YAML file (14) loaded with `repo_shape.load_yaml` on c3f4987 and on this head, parsed results identical (nothing here touches the reader; 7 are unrendered templates the reader refuses on both). Writers of the constructs: `scaffold-project.py` and `adopt-project.py execute` (assembly root); the family holder's writer is #307's. Nothing ran on Windows or macOS before this PR's CI: the new tests pass bytes and never `text=True` to git, write plans with `newline="\n"`, and the ones that copy the standard (`a_copy_of_the_standard`) copy a tree the way `tests/test_family.py` does. | against | result | the merged tree, run in a throwaway worktree and never committed | |---|---|---| | origin/main d82a83e | clean: this head contains it. Main was merged five times (49c21fa b421e6b, 567ee20 c0ed615, f45edf4 34ecbc2, 4b8da3d ab623dd, c578557 d82a83e); each conflict at the tail of `_entry_findings` was resolved by keeping every group, and on this head the tail is `findings + split + unwritable_findings + value_findings + moved`, with the remediations in the same order (see the merges below) | the runs below the merges are this tree | | origin/fix/render-single-pass 552763d (#260) | clean | 364 passed: the two new files, `test_template_values_single_pass.py`, `test_template_quoted_values.py` | | origin/fix/adopt-check-shape-paths 8a496d5 (P) | clean | 284 passed: the two new files, `test_adopt_root_shape_paths.py` | | origin/fix/leg-path-yaml-scalars b2b42f8 (#266) | clean | 722 passed: the two new files, `test_leg_path_yaml_scalars.py`, `test_adopt_leg_paths.py` | | origin/fix/adopt-plan-quote-yaml-keywords e337f44 (#181) | CONFLICT, two hunks in `adopt-project.py` `_entry_findings`: its docstring and its last statement | keep both and `misreads_elsewhere=True` (below): 1050 passed, 1 skipped: the two new files, `test_adopt_plan_yaml_quoting.py`, `test_adopt_leg_paths.py`, `test_adopt_plan.py`, `test_adopt_execute_refusals.py`, `test_cli_reference.py` | **With #181, and who does what.** Both branches add a findings group to `_entry_findings`. Keeping both, with #181's misread group just before this branch's (on this head, `findings + split + unwritable_findings + misread + value_findings + moved`), gives two findings for a plan value that is TEXT and that the template writes bare, which the reader reads back as a number or a boolean (`elected_on: "20261011"`, `visibility: "true"`, `id: "007"`): #181's `plan-manifest-misread` and this branch's `plan-manifest-invalid`, the second saying the retyped `id is 7`. `_manifest_findings(plan, misreads_elsewhere=True)` leaves such a value to the misread rule, by the placeholders `shape_materialize.manifest_misreads` refuses, so it is judged once. It is False here because with nothing else asking the misread question the validator's finding is the only one: always leaving such a value out makes this branch alone accept `id: "007"` at `check`, which it refuses, and 13 tests of this branch fail with it on. **Whoever lands second passes `misreads_elsewhere=True` at the one call in `_entry_findings`**; nothing is lost in either order, and `test_a_text_value_the_reader_misreads_is_one_finding_in_the_list_check_prints` fails for each of the three values on a merge that has not (two findings), and passes on one that has. Run on a throwaway merge with #181's e337f44: the three pairs are three single findings, and the other 16 rows of the 19-row plan and `check` driver are unchanged. Re-pointing #181's own gate at `shape_materialize.manifest_misreads` (one definition for both tools, which #258 asks) is the same person's job and is not done here: lane 1's branch is not this PR's. `#266` fires first at the scaffold (its leg-path rule, before the manifest gate), at adopt `plan` and at `check`, so the two messages about a leg path never disagree once it lands. `#260` makes a value holding a `{{KEY}}` acceptable as typed (see the first left-out item). - `adopt-project.py`'s misread side is #181's: `--tracking-branch 007` at `plan`, a plan edited to a non-text value (`id: 007` read as the number 7), and a value carrying a line break (`elected_on: "2026-09-02\nfoo: bar"`). This branch already refuses `--id true` and `--id 007` at `plan`, and `id: "007"`, `visibility: "true"` and `elected_on: "20261011"` at `check` and `execute`, through the validator's `manifest-id`, `manifest-visibility` and `manifest-elected-on`. - Leg paths (`--spec-path 2026`): #225's, now #266. `plan` refuses one through the validator's `manifest-leg-path` (it passes no `ignore`), and `check` ignores that code because it reports a leg path in the leg-path rule's own words (`ignore=LEG_PATH_CODES`), so a hand-edited `spec_path: "2026"` still checks `plan ok` on this branch as it did on main. #266 judges it first everywhere. - `scripts/family.py init`: the same defects in the holder; verified here (`--created-by ' '`, `--created-on 20261011` and `--id null` exit 0 and the holder's `validate-family.py` is red; `--tracking-branch true` is silent). **#307.** - `--pin null@<sha>` and a `--pin` product the reader misreads (the scaffold writes `neutral_product_pins` and a pin file product bare): not asked; #181 does adopt's. - `--org`: the scaffold's `gh repo create` still fails for a name longer than GitHub's 100 characters, at the first leg, before anything exists; that is GitHub's limit and not the validator's. - A refusal that depends on `--pin` without `--pin-source` is reached after `_declaration` has read the forge with `gh api` (a read); the leg-path and name rules come before it (the review's NIT-8). Remaining nits of the adversarial review that are not fixed here, one line each: - NIT-1: `plan` and `check` disagree about `--spec-path 2026` on this branch alone (see the second item above), and the scaffold's sentence names no flag for `--spec-path true`; #266's rule fires first everywhere once it lands. - NIT-2: `check` exits 2 with one REFUSED and no findings for a bad `org:` (`unsafe-value`) or an unparseable `elected_on:` in a plan with no `reference:` (`election-date-malformed`, naming `--elected-on` about a plan key); both are better verdicts than main's `plan ok`, but refusals and not FINDINGs. - NIT-6: before #260 lands, a value that holds a `{{KEY}}` is refused as `template-unsubstituted` (a defect of the tool), under `--dry-run` too; main accepted the dry run and wrote the wrong text or died after the push. With #260 both are accepted as typed. - NIT-8: with `--pin` and no `--pin-source`, a misread `--id null` is reached only after the forge read (above). - Two mutants of the review survive and are judged equivalent: `_reading_of`'s `len(parsed) == 1` and `key in values` in `_sentences_of`. An adversarial review of ca21b57 approved with nits. It had three should-fixes, none a code defect: - The misread remediation gave a false reason for `--tracking-branch 2026` and `1.5`. - A conflict with main in `_entry_findings`, and a stale body. - Double findings once lane 1's #181 lands. Fix round 1 (7defac7) handles all three and four nits. Its re-verification found no blocker or should-fix. It confirmed that taking the review's #181 suggestion unconditionally would drop this branch's only finding for `id: "007"`, `visibility: "true"` and `elected_on: "20261011"`. The `misreads_elsewhere` flag is therefore the handover: whichever of this PR and #181 lands second passes `True` at the one call in `_entry_findings`, and the guard test fails if it does not. A seeded run of 1324 edited plans on the flagged merge with #181 left no value with no finding and none with two. Two new nits are left: - A template validator whose `_findings` returns something other than a list still ends in a traceback. - The flag's call site in `_entry_findings` has no comment pointing at the handover. Tests on all three OSes passed at 7defac7, but SonarCloud's quality gate failed on its security rating for new code: `pythonsecurity:S8705` at `shape_materialize.run()`. That is the agentic argument-injection family #119 marked a false positive. The only new call into `run()` was `git rev-parse HEAD` in this tool's own checkout, with constant arguments. Fix round 2 (cf3e8d3) removes it, and a second git call with it. **SonarCloud still flags the same S8705 on cf3e8d3**, so that call was not its cause. The finding sits wholly inside `run()`, and PR #316 carries the same one with no new caller of `run()`. It needed no disposition in the end: main itself carried the identical finding until 13:01:12Z on 2026-10-12, opened by a `bump-leg.py`-only commit and closed by a `validate-pins.py`-only commit, and this PR's one analysis (11:55:50Z) was charged with it as new. SonarCloud passes from 4b8da3d on, with no change to `run()` or its callers. - `plan` and `check` ask the project's own validator about the manifest with a fixed, well-formed placeholder commit and tree digest. The question starts no process; the commands still read the source with `git`. The validator holds both to their form and compares them with nothing. - A second call went with it: `_template_values` also ran `tree_digest(SHAPE_ROOT, commit)` (`git ls-tree -r` over the whole standard) on every `plan` and `check`. The table body moved to `_template_table`, which runs nothing. `execute` still builds its table with the real commit and digest, which a new test asserts. - Both commands now refuse a blank `--elected-by` from a tree with no `.git` exactly as in a checkout, which fixes the review's NIT-9. There are 16 new tests: 14 fail on the previous `adopt-project.py`. - Main c0ed615 is merged (567ee20), with no conflict. - A fresh re-verification of the round found the code correct. `execute`'s 29-key table and its 50 pushed files are identical to 7defac7's. An audit hook saw 0 process starts in the manifest question. 14 of the 16 tests fail on 7defac7, and all nine mutants of the round are caught. Fix round 3 (ab66bc0) changes no behaviour: - It corrects a stale comment that pointed at `_template_values`. - It replaces two lane-private review ids that had been committed in a test. - It splits eight composite assertions SonarCloud flagged (`python:S9073`). - It defines the validator's path once (`MANIFEST_VALIDATOR`, `python:S1192`). Targeted runs: 289, 102 and 176 passed, and the suite collects (3499). **Four later merges of main, and the #351 compose commit.** - **4b8da3d merges main ab623dd.** It brought #270 (f795cf7), which asks whether a file can hold a value at all: `adopt-unwritable-value` at `plan`, and `plan-unwritable-value` at `check` and `execute`. - Some values are judged by both #270 and this branch. Examples: a lone surrogate, a line break or a bidi control in `visibility:` or `elected_on:`, and a control character or a line break in `elected_by` or `reference`, which the validator then reads as blank. - For such a value, #270's finding comes first, so `execute` refuses under #270's code. Both findings are listed, and both refuse before any leg exists. - #270's own hand-edited-value tests pin that order: three of them fail when it is reversed. - Why this order: #270 names the byte, the break or the control the person must retype. The validator describes the manifest that value would be written into, which is a consequence of it. - #309's `--spec-path` and `--code-path` help is kept beside this branch's `--tracking-branch` help. - **c578557 merges main d82a83e.** It brought #245 (161c6c9). #245 splits the submodule findings, puts its relative-url findings last, and returns `check`'s NOTEs as a third value. - This branch's group stays after #270's and before #245's, so the tail of `_entry_findings` is `findings + split + unwritable_findings + value_findings + moved`. - Two of this branch's tests now unpack that third value. - `_repository_urls` keeps `adopt-name-too-long` in #245's shape. - **The same merge brought #351 (#282).** Its `_identity` refuses an `--elected-by`, `--reference` or `--name` that no file can hold, as `scaffold-unwritable-value`, before this branch asks the validator. So the scaffold and adopt refuse in the same order. - a5438a5 applies the compose patch written with #351, unchanged. - Five of this branch's scaffold test cases now expect #351's refusal: `--elected-by` TAB in two tests, `\x0b`, `\x1c` and U+2028. - Without the patch, the merged tree fails exactly those five. - **ba58838 and c6f441b merge main 1f90a0f and 92e29d9** through `gh pr update-branch`, with no conflict. They bring #371 (a983e6a), #354 (8325d05), #380 (1f90a0f) and #377 (92e29d9). **A behaviour change since the head first approved (f45edf4).** `plan --reference $'\t'` and `plan --elected-by ' \n'` were refused as `adopt-manifest-invalid` and are now refused as `adopt-unwritable-value`. `plan --elected-by 'Bob\u202e'`, which f45edf4 planned, is now refused too. The same holds for `check` and `execute` on a value both rules judge: the code is now #270's. No test of this branch pins the old code, and the new order is the one #270's tests require. Targeted runs on a5438a5, with `git-filter-repo` 2.47.0 on PATH and the checkout's git identity blanked, are below. | run | files | result | |---|---|---| | this branch and #351 | `test_adopt_manifest_values.py`, `test_scaffold_manifest_values.py`, `test_scaffold_free_text_values.py` | 298 passed | | #270 | `test_adopt_template_values.py` | 77 passed, 1 skipped (`:223`: this checkout's own git config names a user, which outranks the test's `GIT_CONFIG_GLOBAL`; it passes in an export of the tree) | | #245 | `test_adopt_relative_submodule_url.py`, `test_adopt_gitmodules_values.py`, `test_adopt_submodules.py` | 352 passed | | the doctor | `test_shape_doctor.py` | 255 passed, 3 skipped (the PowerShell line, a Windows host only) | | neighbours | `test_scaffold_leg_path_collisions.py`, `test_cli_reference.py`, `test_repo_hygiene.py`, `test_scaffold_pin_collisions.py`, `test_adopt_clone_template.py`, `test_adopt_ignored_shape_files.py`, `test_adopt_literal_names.py`, `test_template_quoted_values.py`, `test_template_values_single_pass.py` | 506 passed | The same five runs were repeated on c6f441b, the landing head. #377's `test_adopt_entry_paths.py` and `test_adopt_plan_escapes.py` were added to the neighbours. Results: 298 passed; 77 passed and 1 skipped; 361 passed; 255 passed and 3 skipped; 644 passed. Reviewed adversarially (APPROVE WITH NITS, 0 blockers, 3 should-fixes); fix round 1 handles the three and four nits, and its re-verification found no blocker or should-fix. Fix round 2 validates with a placeholder commit, so the manifest question starts no process; its re-verification found the code correct. Fix round 3 is nits only. CI is green on Linux, macOS and Windows, with SonarCloud passing, at c6f441b (main 92e29d9 merged in). The combined tree with main 45e01f4 passed `test_agents_md_codes.py`, `test_shape_doctor.py` and `test_adopt_manifest_values.py` locally (391 passed, 3 skipped). A re-verification of the merge with ab623dd (4b8da3d) confirmed the merge, the refusal order and the composition. Its one nit, two stale sentences about the order, is fixed here. Closes #258 Closes #261 Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap
added a commit
that referenced
this pull request
Oct 12, 2026
…ut family.yaml before creating anything, `--dry-run` too, so `--id null`, `--tracking-branch true`, a blank `--created-by` and `--created-on 20261011` are refused (#307) (#397) `family.py init` rendered `templates/family-root/family.yaml` from `--id`, `--org`, `--name`, `--created-by`, `--created-on` and `--tracking-branch` and pushed it. The holder reads that file with its own YAML reader and its own `scripts/validate-family.py`, and `init` asked neither anything. Every row of #307 reproduces on c7c02fa (the issue's own script, with a stub `gh`): `--dry-run` and the real run both exit 0 for all 15 rows, and - `--created-by ' '`, `--created-on 20261011` / `2026-W41-6` / `tomorrow`, `--id null|true|false`, `--org null`, `--name 'Contoso Group'` leave a holder whose `validate-family.py` exits 1 from its first commit. `init` cannot be run again over it (`family-remote-exists`, no `--force`). - `--tracking-branch true`, `007`, `null`, `2026` exit 0 with `validate-family.py` exit 0 (it has no rule about `tracking_branch`), the holder pushed on that branch, `family.yaml` reading back as `True`, `7`, `None`, `2026`, and `update-shape.py apply --branch` printing `gh pr create --base True` / `--base 7` / `--base main` (for `null`) / `--base 2026`. **What changed.** `scripts/family.py` asks two questions about the manifest `init` is about to write, right after the substitution table is built: before the plan is printed, before the `--dry-run` return, before `_create_holder_remote` (which is where `gh repo create` runs against GitHub). Both refuse, name the flag, and say nothing was created. - `family_manifest_misreads` renders each line of the TEMPLATE that carries one of the values, reads it back with the holder's own reader (`repo_shape.parse_yaml`) and refuses a value that does not come back as the same text: `family-manifest-misread`. This is what catches `--id null`, `--org null`, `--created-on 20261011` and the silent `--tracking-branch true|007|null|2026`. A line the refusal quotes is shown the way Python spells it where it holds a line break or an escape, so a value cannot forge a second line of the refusal. - `family_manifest_invalid` renders the whole `family.yaml` and runs the validator the template ships over it, loaded from `templates/family-root/scripts/validate-family.py` (`Report` and `_check_envelope`), never re-implemented: `family-manifest-invalid`, in the validator's own words. This is what catches a blank `--created-by`, `--created-on 2026-W41-6` / `tomorrow` and `--name 'Contoso Group'`, and whatever the validator learns next. A misread is reported first and alone, because the validator's finding about it (`id is None`) is its consequence. A validator that is missing, broken, raising or exiting, whose `Report` has no `findings`, or that answers with a finding that is not text, is `family-validator-unusable`, not a traceback and not a zero. - A value no flag supplied is named by where it came from (`--id (not given, so --family lowercased)`). - `init --help` and `docs/cli.md` (regenerated, `render-cli-reference.py --check` ok) say what is held to what. No template is edited. A refused value is refused, not quoted or corrected. **Fix round 1 (the review of 14e2d68).** The first review found one broken test elsewhere in the suite and four claims no test guarded. This round is one commit on top of 14e2d68 (tests, plus one change to `scripts/family.py` for the validator that cannot be asked); the first commit is not amended. - **`tests/test_stdout_encoding.py` (the blocker).** The `family-init-dry-run` row ran `init --name <non-ASCII> --dry-run` and asserted the name is printed in the plan. The holder's own `validate-family.py` refuses that name (`naming-unclassified`: a family holder is one CamelCase token), so `init` now refuses it before the plan prints. That is this PR working as intended, so the TEST changed and the refusal did not: the row drops `--name`. The plan still prints the non-ASCII `--created-by` on its `created by` line, so the constrained stdout still has a value to escape (`created by 日本 ...` under `cp1252`, the characters themselves under UTF-8), and the row still fails if `family.py main` stops calling `escape_what_stdout_cannot_encode`. On the first head the old row failed (`1 failed`); the row as it is now passes on this head, and on this head merged with origin/main. - **A validator that cannot be asked.** The in-process call now sits in one `try` that also catches `SystemExit` and reads `report.findings` there, and a finding that is not text is refused by name. Three cases used to escape the refusal: a `Report` with no `findings` (an `AttributeError` traceback), a finding that is not a string (a `TypeError` from the regular expression) and a `_check_envelope` that calls `sys.exit(0)` (`init` exited 0, having printed and created nothing). Each is now `family-validator-unusable`, exit 2, nothing created; one test per case over a deliberately broken copy of the template, and one run at the command line for the exit. - **`_line_shown`.** A value with a line break, an ESC and a would-be forged line (`x\nFINDING forged: y\x1b[2J`, and a CR, U+2028 and U+0085 variant) is one escaped sentence: asserted on `family_manifest_misreads` itself, through `main` and what it prints (in process, so no argv crosses to Windows), and at the command line (skipped on Windows before any call, since argv is UTF-16 there; the in-process rows hold it on every OS). - **Two more guarded hunks.** The `sys.path` restore (also when the validator fails to load) and the comment-line skip each had a surviving mutant; each now has a test that kills it. The bytecode flag's restore is guarded by the same tests. - **The bytecode test** asked the REAL template's `__pycache__` before and after, so any stale `validate-family*.pyc` there failed it whatever the code did. It runs over a copy of the template made without a `__pycache__`, with the flag cleared first so that it is `family_validator` that must set it, and a control shows that importing the same file that way does write a `.pyc`. **How this composes with #259 (Brett ruled to quote the placeholders).** The misread check never says which lines are bare: it renders the real template line and reads it back. So once `fix/template-quoted-placeholders` (PR #395, first head 233dc71) quotes `id:`, `org:`, `created_on:`, `visibility:` and `tracking_branch:`, `--id null`, `--org null` and `--tracking-branch true|007|null|2026` read back exactly, the first question refuses nothing, and no edit is needed here. What the validator refuses stays refused: `--created-on 20261011` becomes `family-manifest-invalid` (`family-created-on`) instead of a misread, and a blank `--created-by` and `--name 'Contoso Group'` are unchanged. Proved three ways, all in `tests/test_family_init_values.py`: - the same values through a copy of the template with the placeholder forced quoted: accepted, and `parse_yaml(render(...))` reads the exact text back; - an end-to-end run of a forged one-commit checkout of `scripts/`, `templates/` and `contracts/` whose `family.yaml` is forced quoted: `init` exits 0, the holder's own `validate-family.py` exits 0, `family.yaml` reads back as typed, and the branch pushed is the typed one (a second forged checkout forced bare: refused, nothing created); - the tests that read the real template's own quoting to say what to expect: run here with the real template as it is, and on a tree with #259's branch merged in (below), so the file passes whichever of this and #259 lands first. **Once #259 is on main, 19 rows skip for good and one sentence goes unreached.** With the template quoted, the 16 end-to-end rows of `test_init_asks_the_holders_own_programs_before_anything_is_created` whose quoted answer is "the run is fine" and the 3 of `test_an_id_the_family_name_would_derive_is_named_by_where_it_came_from` skip with a message that says why (the 8 `test_a_quoted_value_is_held_as_typed` rows un-skip and pass), and nothing fails. `MANIFEST_MISREAD_REMEDIATION`'s "family.yaml writes a value like these unquoted" is then text no real template reaches; a template that writes one bare (the forged bare checkout the tests use) still does. Nothing is changed here for it: whichever of this and #259 lands second can drop the dead rows and reword that sentence in the same PR. **Same helpers as #314 (#261)?** #314's `manifest_misreads` / `manifest_invalid` are hard-wired to the assembly root (`project.yaml`, its templated list, `validate-manifest.py`'s `_findings`) and were not on main when this PR was written, so this PR writes the smallest version the family needs, in `scripts/family.py` (not `shape_materialize.py`, which #266, #270, #314 and #316 all edit). They differ only in the template, the validator's entry point and the sentence that names the file. #314 landed first (3ef059c), and this PR leaves both sets of helpers as they are: **unifying them is left to a follow-up on #459's checklist (#459 (comment) **Evidence, refreshed when this PR was opened (head abb27e6).** Main had then moved to 28bdc84: #345 landed as 3ae0109, #350 as 0f67f7b, and lane 3's `single-repository.yaml` as 28bdc84. The review's re-verify of abb27e6 ran on the head merged with 28bdc84: clean, with the six init, encoding, CLI-reference and family files at 305 passed / 9 skipped, and `test_family.py` with #345's `test_family_dry_run.py` at 126 passed. Merge-tree was also clean against #259's 3894aa8 (PR #395) and #314's 4b8da3d. The results below were taken before that; main has moved since. - Reproduction, before and after, with the issue's script: on c7c02fa every row exits 0; on this branch all 13 failing rows now exit 2 on `--dry-run` and on the real run, with no holder, no remote directory and nothing pushed; the two controls (`--tracking-branch main`, `--name ContosoGroup`) are unchanged. `--tracking-branch 2026` is refused too, as #314 does for the scaffold: it worked only because every reader calls `str()` on the number. - `tests/test_family_init_values.py`: 125 tests, 103 of them fail on c7c02fa; on this branch 117 pass and 8 skip (the 8 rows that need the real template to be quoted, which they run against the day it is). On 14e2d68, the first head, the 4 tests of this round that guard a code change are the ones that fail (the three validator cases and the exit at the command line); the rest guard what 14e2d68 already did. - Mutations: fifteen of the change in the first round (drop the call, move it after the `--dry-run` return, move it after the remote is created, empty either question, ignore the template's quoting, ignore the template's validator, drop the not-given naming, drop a finding no flag owns, write bytecode into the template, let a validator's `SystemExit` through at load, ask the validator first, drop the unusable-validator checks), and eight more in this round, each killed by a new test: `_line_shown` always in backticks (9 fail), the `sys.path` restore dropped (2), the bytecode flag's restore dropped (2), the comment skip dropped (1), `findings` read outside the `try` (1), the non-text check dropped (1), `SystemExit` let through the run (2, one a zero at the command line), and `main` without `escape_what_stdout_cannot_encode` (the `family-init-dry-run` row of `test_stdout_encoding.py`). The write-bytecode mutation is now killed by the new bytecode test. - Targeted runs on the head of this branch, abb27e6 (Linux, Python 3.12.3, git 2.43.0, git-filter-repo 2.47.0): `test_family_init_values.py test_family.py test_stdout_encoding.py test_cli_reference.py`: 276 passed, 9 skipped (the 8 rows that need a quoted template, and one Windows-only row). - Merged with origin/main at 161c6c9 (which has #316, #317, #318, #245 and #349): `test_family_init_values.py test_family.py test_family_add_refusals.py test_family_add_excludes.py test_family_member_path.py test_stdout_encoding.py test_cli_reference.py` 407 passed, 9 skipped; `test_shape_doctor.py` 255 passed, 3 skipped (the PowerShell row, which needs a Windows host); `test_update_shape_add.py test_update_shape_pr_base.py test_template_values_single_pass.py test_scaffold_ignored_shape_files.py` 223 passed (with the git identity blanked, because the standard's own checkout sets a `user.name` that scaffold and adopt tests read). Main then moved to 0f67f7b (#350 landed, which changes the validator this reads, and a scaffold PR): `test_family_init_values.py test_stdout_encoding.py test_cli_reference.py test_validate_family_duplicates.py` on this branch merged with it: 197 passed, 9 skipped. - Merge-tree (`git merge-tree --write-tree`), all clean: origin/main at 0f67f7b; #345 (abaaf3c, which landed as 3ae0109); #314 (4b8da3d); and `fix/template-quoted-placeholders` (3894aa8, #259). This branch + origin/main + #345 + #259's branch together are clean too, and `test_family_init_values.py test_family.py test_stdout_encoding.py test_cli_reference.py test_family_dry_run.py test_validate_family_duplicates.py test_template_text_placeholders.py` there: 442 passed, 20 skipped (the 19 rows above, which skip because #259 quotes the template, and one Windows-only row). #345 changes `cmd_bump`, `cmd_remove` and `build_parser`, not `cmd_init`; #350 (landed) added member-name checks to the validator and left `_check_envelope` and `Report`, the two names this change asks, as they are. #314 at 4b8da3d did not merge with origin/main by itself then (`adopt-project.py`, from what landed after its last merge), so it was not composed with the rest, but it was clean against this branch alone. #309, #312, #316, #317, #318 and #350, which the first round merged against or named, have landed. - `--created-by '{{ORG}}'`: on c7c02fa `init` created the remote and then died with `template-unsubstituted` once the worktree was rendered. Merged with main, #316's one-pass `render` writes the value as typed: `init` exits 0, `family.yaml` records `created_by: "{{ORG}}"` and the holder's own `validate-family.py` is green. This change does not touch it and does not refuse it. (On this branch alone, without #316, the pre-flight render refuses it before anything exists, with the same `template-unsubstituted` text.) **Left out.** - `AGENTS.md`, `README.md`, `docs/handbook.html`: no prose change (#309 has landed since; `init --help` carries the sentence). - A calendar check of `--created-on` (`2026-13-45` passes the validator's `DATE_RE`): the validator's rule, not copied here. - A branch git itself refuses (`a..b`, `x.lock`): #283. - `--org test+org` passes `validate-family.py`; not claimed. - `--created-by` with an ESC or OSC is printed raw by the plan's `created by` line on c7c02fa and here: not part of this change. - No run against GitHub (the `gh repo create` ordering is proved in-process, with every step that would reach GitHub replaced by one that fails the test), none on macOS or Windows. Reviewed adversarially at 14e2d68 (CHANGES NEEDED: 1 blocker, 1 should-fix, 6 nits). The blocker was a test elsewhere in the suite that the new refusal turned red, `tests/test_stdout_encoding.py`'s `family-init-dry-run` row; the should-fix was the line-escaping hunk (`_line_shown`), which no test guarded. Fix round 1 (abb27e6) changed that test and not the refusal, guarded `_line_shown` and the two other surviving mutants, closed the three ways a broken validator escaped `family-validator-unusable`, and rewrote the bytecode test over a copy of the template. Its re-verification at abb27e6 found every finding closed: APPROVE WITH NITS (0 blockers, 0 should-fixes, 2 nits, both about this description and the commit trailer and not about the code: the trailer names Opus 5.5 below, and the description's merge-tree and composition paragraphs are refreshed above). CI is green on Linux, macOS and Windows, with SonarCloud passing, at d216ba8 (main 8782333 merged in). Closes #307 Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap
added a commit
that referenced
this pull request
Oct 13, 2026
…d `open_glass` share one `SHAPE_PIN_SOURCE_<PRODUCT>`, so `--pin` refuses the pair and `validate-pins.py` notes a declared one and reads the variable for neither (#275) (#409) `pin_source_env_name` turns every character outside `[A-Z0-9_]` into `_`, so `open-glass`, `open_glass` and `open.glass` are three legal product names, with three pin files (`contracts/<product lowercased>-pin.yaml`), and one variable, `SHAPE_PIN_SOURCE_OPEN_GLASS`. On ab623dd (this branch's main parent; the same rows reproduce on c7c02fa), with the issue's own probe against local bare remotes and a `gh` that exits 97: | step | ab623dd | this head (6494714) | |---|---|---| | `scaffold-project.py --pin open-glass@<A> --pin open_glass@<B>` | exit 0, three repositories | exit 2 `scaffold-pin-collides`, nothing created | | `validate-pins.py`, no source, on a project that already declares the pair | exit 0, both skips offer `SHAPE_PIN_SOURCE_OPEN_GLASS` | exit 0, one `note neutral-pin-source-collides`; the skips offer `--pin-source <product>=<path>` and a sibling checkout only | | `SHAPE_PIN_SOURCE_OPEN_GLASS=<open-glass>` | `neutral-pin-source-unreadable` for `open_glass`, exit 1 | exit 0, the note; the variable is read for neither pin, so each pin is read from its own source or skipped | | `SHAPE_PIN_SOURCE_OPEN_GLASS=<open_glass>` | `neutral-pin-source-unreadable` for `open-glass`, exit 1 | the same | | `--pin-source open-glass=... --pin-source open_glass=...` | exit 0 | both pins recompute, exit 0, the note | **What changed.** Every variable name is kept: an operator may have set one and the docs name them. What is done instead: - `scripts/repo_shape.py`: `pin_source_env_collisions(products)` is the one pure answer, `{variable: [products]}` for each variable two or more distinct products share. Distinct means distinct PIN FILES (`pin_product_key`, `lower()`, which is what `contracts/<product lowercased>-pin.yaml` is named by), so a product typed twice or in two cases is #241's file collision and never this one. `pin_source_env_shared` is the set of those keys. - `scaffold-project.py`: `_refuse_colliding_pins` (left where it is) names each variable's `--pin` arguments as typed after #241's file sentences, in the same `scaffold-pin-collides` refusal. Dry run and real run say the same no, before any process starts and ahead of the leg-path refusal. #241's wording and remediation are unchanged when only a file collides. A NEW pair is still refused, so the situation is not created anew. - `templates/assembly-root/scripts/validate-pins.py`: one NOTE per variable, `neutral-pin-source-collides`, naming every product and the variable, the keyed `--pin-source <product>=<path>` that reads each pin, and that which declaration stays is the human's decision. It is never a finding and never moves the exit code. A product whose variable is shared does not read it (rule 2 of `resolve_neutral_pin_source`), and its skip hint offers the keyed `--pin-source <product>=<path>` and not the variable or the bare form. A variable one product has to itself reads and is offered exactly as before. - `scripts/repo_shape.py`, the two chain readers: `link_pins_from_trees` does not read a variable two links of one chain share, and the `declared-unverified` hint stops naming it. Only a hand-written chain can have two such links, since scaffold takes every link but the first from the naming policy's alphanumeric `open<Product>` form. Each reader of `pin_source_env_name`, decided: | site | decision | |---|---| | `scaffold-project.py --pin` | refuse (above) | | `validate-pins.py` rule 2 and the skip hint | a note, and the variable is neither read nor offered for a shared product | | `repo_shape.py` `resolve_link_source` (via `link_pins_from_trees`) | skip the variable when another link of the chain shares it | | `repo_shape.py` `_chain_link_findings` hint | omit the variable for a shared link | | `adopt-project.py --pin`, `plan`, `check`, `execute` | not in this PR, see below | **Fix round 1 (from the review of 34dbd86).** **The design change: a declared pair is a NOTE and not a finding. This is the lane coordinator's decision, and Brett may reverse it.** The first round made `neutral-pin-source-collides` a FINDING. Main through ab623dd scaffolds such a project (`--pin open-glass@A --pin open_glass@B` exits 0), and `update-shape.py apply` runs the NEW `validate-pins.py` over the rewritten root, so for a project already declaring the pair the finding ended every apply as `REFUSED update-validators-red`, rolled back, for this update and every later one, until a person deleted a true declaration of descent. AGENTS.md tells an agent never to edit "a pinned file, a digest or a manifest to make a row go green", and the finding's remediation was exactly that, so the person was locked out. The coordinator chose the review's option (b): it is a NOTE now. The guard stays (the variable is read for neither pin), each pin still verifies from its own source, scaffold still refuses a new pair, and `validate-pins.py` says the rest in one line. To put the finding back, restore 34dbd86's `report.finding(...)` call in `_report_pin_source_collisions` (it is not a word swap for `report.advise`: `advise` takes one string, `finding` a code and a detail), give the finding the remediation 34dbd86 had, and turn the tests that expect the note (and `test_a_project_declaring_a_colliding_pair_takes_a_shape_update`) back into exit 1; the first round's versions of all of them are on 34dbd86. - **Proved on a real old project.** Main (ab623dd) scaffolded the pair into local bare remotes; `update-shape.py apply` to the first round's head 34dbd86 exited 2 `REFUSED update-validators-red` and rolled back (`git branch` shows only `main`); to this head it exits 0, the project's validator passes and prints the note, and the doctor's `pins` row is `ok` before and after. The doctor prints `passes` for a validator that exits 0 and does not echo its stdout, so the note itself is visible in `update-shape.py apply`'s output and in `validate-pins.py`'s, and the verdict moves for no reason but the update (`COMPLIANT, SHAPE BEHIND` to `COMPLIANT`). It is now a test: `test_a_project_declaring_a_colliding_pair_takes_a_shape_update`, over local stand-ins beside the project, so no `gh` is asked. - **Collisions by the variable.** Pairs were decided by `casefold()`, but the pin file is `lower()`. `openß`/`openss`, `openſ`/`opens`, `openfi`/`openfi` and `openς`/`openσ` (the letters are U+00DF, U+017F, U+FB01 and U+03C2 beside U+03C3) share a variable and have two pin files, and were never found. They are now, from the pin-file fold (`pin_product_key`). A pool of 31 names is checked pairwise against `neutral_pin_path` and `pin_source_env_name` themselves, and no single product is ever a collision. They are reachable only from a hand-written `project.yaml`. - **Windows.** The guard's only test needed the `#!` `gh` stub and was skipped on Windows. `test_a_shared_variable_answers_for_neither_pin_with_no_gh` puts a checkout of each pin beside the project, names one in the variable, and needs no `gh`: on ab623dd it is `neutral-pin-source-unreadable`, here each pin reads its own sibling. The hint and the non-ASCII rows are tested in-process, with no skip and no filesystem. - **The hint.** For a product two pins share, the skip hint offers the keyed `--pin-source <product>=<path>`: the bare form answers for every pin with no more specific source, so with two pins it gives the other the finding this issue is about. - **Trailers and title.** The trailers of the earlier commits (a30091f and 34dbd86 name Sonnet 5.5) are settled in this message, which carries Opus 5.5. The PR title now names `repo_shape.py`. - `scaffold-project.py` is not touched this round: `fix/adopt-pin-writes-pin-file` moves that code, and the change would only conflict with it. **Left out.** - `adopt-project.py` is untouched. Its half arrives with #273's PR, which moves scaffold's pin machinery into a shared module and routes adopt through `pin_source_env_collisions`. Once it lands, the one place that still keys by `casefold()` (`pin_variable_collisions` in `scripts/shape_materialize.py`) should read `pin_product_key`; it cannot differ for an ASCII `--pin`, which is all `PIN_ARG_RE` takes. - `scaffold-project.py`'s own `_colliding_pin_variables` also keys its argument lists by `casefold()` and one docstring there still says the project's validator reports the pair "as a finding"; both go with the code when #273 moves it. #312's `PinSources` keys `--pin-source` by `casefold()` too, so `openß=` and `openss=` are one key there; that is #312's. - A product in `neutral_product_pins:` and a chain link in `naming.referent_chain` that share a variable are read by two validators in one process, and neither sees both sets. Not detected here. - The doctor does not print a passing validator's stdout, so its `pins` row does not carry the note. Not changed: it would add a file to this PR. - No `--help` text changed, so `docs/cli.md` is untouched. `README.md` is at its line cap and its blob is pinned by `docs/handbook.html`, so the one README sentence this wants needs a regenerated handbook and waits for its own change. - `validate-pins.py` and `repo_shape.py` ship into projects, so every project's `shape-pin.yaml` reads `upstream-changed` for both until `update-shape.py apply`, which now succeeds for a project that declares such a pair. **Evidence.** All on the head (6494714), with git-filter-repo 2.47.0 on PATH, a `gh` that cannot be reached (a stub first on PATH, `GH_TOKEN` bogus, an empty `GH_CONFIG_DIR`), and the repository-local `user.name` blanked at command-line scope, as the standard's checkout sets one that two scaffold tests read. - `tests/test_pin_source_env_collisions.py` is 137 tests and passes on this head. Laid over 34dbd86, 50 fail and 87 pass: the note and update tests, the non-ASCII rows, the hint, the sibling guard, and `pin_product_key` itself (which 34dbd86 does not have); the scaffold refusals, the chain readers and the controls hold on both. - Targeted, run on ad6f569, whose tree differs from this head in `tests/test_pin_source_env_collisions.py` only (the last edits made one comparison read the committed blob and wrapped one line): the new file, `test_pin_validator`, `test_neutral_pin_validator`, `test_cli_reference`, `test_manifest_validator`, `test_naming_policy` and `test_repo_hygiene` **445 passed**; the scaffold pin, collision, referent-chain, leg-path and e2e files **245 passed**; `tests/test_update_shape*.py` **218 passed, 3 skipped** (junctions, NTFS only); `tests/test_shape_doctor.py` **254 passed, 3 skipped** (the PowerShell line, a Windows host only). - On this head itself: the new file, `test_repo_hygiene`, `test_cli_reference`, `test_pin_validator` and `test_neutral_pin_validator` **244 passed**. - This head merged with origin/main a983e6a, in a throwaway worktree: the new file, `test_pin_validator`, `test_neutral_pin_validator`, the scaffold pin, collision, referent-chain and e2e files, the whole doctor file and `test_cli_reference` **590 passed, 3 skipped** (the PowerShell line); the new file alone, in its final form, **137 passed**. origin/main had moved twice since; the merge-tree below is against it. - Twelve mutation probes, each hunk reverted alone: all caught. The note-to-finding one is caught by the update test (a committed mutant, since the test clones the repository's HEAD) and the guards by the sibling test, run with every test that needs a `#!` stub deselected as a Windows runner would; the hint one by an in-process test. - Nothing ran on macOS or Windows before this PR's CI. **Merge-tree, as computed during the fix round on 2026-10-12** (every sha and head is the one it had then; main and the other branches have moved since). `git merge-tree --write-tree` of this head (6494714) against origin/main 1f90a0f is clean, and so is the merge of origin/main a983e6a, which the merged-tree runs above used. #312, #309, #270, #268, #228, #245 and #351 have landed. The rest were computed on ad6f569 (the same tree but for one test file) against a983e6a. Open PRs touching this branch's files, all clean against the head: #314, #355 and #373 (`scaffold-project.py`), #343 (`validate-pins.py`), #390 (`repo_shape.py`) and #394 (`repo_shape.py`, which conflicts with origin/main by itself). The other 25 open PRs and the lane-5 branches `fix/adopt-check-link-and-manifest`, `fix/scaffold-free-text-values`, `fix/family-init-values`, `docs/adopt-execute-exits`, `fix/yaml-flow-brackets-surrogates` and `fix/adopt-pin-writes-pin-file` (#273's, 7a94b6b, also clean for this head) are clean too. #356, #382 and `fix/adopt-record-submodule-placement` conflict with origin/main and not with this head; #358, `fix/adopt-late-failure-notice` and `fix/adopt-plan-quote-yaml-keywords` conflict with both, with origin/main by themselves, so they are not this branch's. Neither are the five PRs below #200 that origin/main has not landed (#94, #96, #98, #100 and #161), which conflict with it too. The PR set is read from the refs under `refs/pull/` that origin/main's history has no `(#n)` subject for, not from GitHub, so a closed one may be in it. **One conflict, with `fix/link-source-values` (#338, 40762ca) in `scripts/repo_shape.py`, four hunks.** Not resolved in either branch; take both sides: (1) `resolve_link_source`'s signature, `default_source=None, env_shared: bool = False, *, tried: list | None = None`; (2) its docstring, both paragraphs; (3) `link_pins_from_trees`'s docstring, both paragraphs; (4) its call, `default_source, pin_product_key(name) in shared, tried=asked)` followed by #338's `if tried is not None: tried[name] = asked`. The auto-merged `resolve_link_source` body already composes: a shared variable is never an `env` candidate and so never appears in #338's `tried`. **Known limits after the re-verification (APPROVE WITH NITS, 0 blockers, 0 should-fixes, 3 nits, at 6494714).** For the four non-ASCII pairs this change now detects (`ß`/`ss`, `ſ`/`s`, `fi`/`fi`, `ς`/`σ`), the keyed `--pin-source <product>=<path>` form does NOT separate the two pins: #312's source lookup folds both keys into one, so one pin can get a false `unreadable` finding. A sibling checkout does separate them. Only a hand-written `project.yaml` can declare such a pair. The doctor's `pins` row still prints only "passes" for a validator that passes, so it does not carry the collision note; that needs `shape-doctor.py`, and is left for a follow-up. The wording for restoring the finding is under "Fix round 1" above: it is 34dbd86's `report.finding(...)` call, not a word swap. Reviewed adversarially at 34dbd86 (CHANGES NEEDED: 0 blockers, 2 should-fixes, 5 nits). The first should-fix was the finding itself, which locked a project that already declares the pair out of every `update-shape.py apply`; the second was a description that had gone stale. Fix round 1 (6494714) made the pair a NOTE, which is the coordinator's decision and one Brett may reverse (the way back is above), keyed collisions by the pin file's own fold, gave the guard a test that runs on Windows, and made a shared product's skip hint offer the keyed `--pin-source`. Its re-verification at 6494714 found every finding handled: APPROVE WITH NITS (0 blockers, 0 should-fixes, 3 nits: the keyed form and the non-ASCII pairs, the doctor's silence about the note, and the wording for restoring the finding, each stated above). CI is green on Linux, macOS and Windows, with SonarCloud passing, at b70a07d (main a73b4e9 merged in). Its merge with main 5a25387 passed the targeted set (the six pin and scaffold test files, `tests/test_validate_pins_unreadable_workflow.py`, `tests/test_ruleset_hint_tracking_branch.py` and `tests/test_shape_doctor.py`): 850 passed, 3 skipped. Closes #275 Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap
added a commit
that referenced
this pull request
Oct 13, 2026
… writes its pin file as the scaffold does, so an adopted root passes `validate-pins.py` (#273); a `--pin-source` that cannot answer is `pin-source-unreadable` (#339) (#508) **Brought up to date after #409 squash-landed** by merging origin/main (9736424, #409's squash) as f9ed46f. Its `scaffold-project.py` conflict was resolved to this branch's side once `git diff b70a07d 9736424 -- scaffold-project.py` (#409's final head against its squash) came out empty. So the file is the one tested on this branch plus main's own later changes to it, and holds nothing of #409's; details below. This branch carries #275's adopt half. It was built on `fix/pin-source-env-collisions`, PR #409 (#275's scaffold half and its fix round), merged at 6494714 as 583f647, over the earlier 5690235 (34dbd86). After 6494714, #409 only merged main, five times, up to its final head b70a07d, and none of those merges has a hand edit (`git show --remerge-diff` is empty for each). Adopt's refusal of two products that share a source variable goes through #409's function, so this branch lands after #409. It was never rebased. `git diff b70a07d 9736424` is empty for each file #409 touched: `scaffold-project.py`, `scripts/repo_shape.py`, `templates/assembly-root/scripts/validate-pins.py` and `tests/test_pin_source_env_collisions.py`. What f9ed46f resolves, four files with one hunk each: - **`scaffold-project.py`.** - The conflict hunk is main's block from `PIN_COLLISION_REMEDIATION` through `_pin_collision_remediation`, which #409's squash edits: it adds `PIN_VARIABLE_REMEDIATION`, `_colliding_pin_variables` and `_pin_collision_remediation` and changes `_refuse_colliding_pins`. This branch moved all of that to `scripts/shape_materialize.py`. The hunk takes this branch's side. (The merge commit's message says "re-adds"; this is the exact account.) - #409's auto-merged import of `PIN_SOURCE_ENV_PREFIX, pin_source_env_collisions` is dropped, because nothing in the file uses either name any more. - It is not `git checkout --ours` of the whole file. Main changed the file beyond #409 since this branch last merged it: #355's `--tracking-branch` check (6c2a371) and a73b4e9's `RULESET_HINT`. Those lines stay. - The result is the file `git merge-tree` gives for this branch with main before the squash (518010b). Its diff from the file tested here has the same patch-id as main's own 3ef059c..518010b change to it. - **`templates/assembly-root/scripts/validate-pins.py`.** Main's side, which is #409's final blob, with main's #359 workflow reader in it. This branch had no change of its own to the file beyond #409. - **`adopt-project.py`, `_commit_the_split`.** - Main: #445 wraps the function in its late-failure `try`, and #394 builds an `append` with the plan's submodule record. - This branch: its only edits there were a comment and `neutral_pins=_recorded_pins(plan)` on the materializer call. - Both now sit on main's call inside the `try`: `append=append, neutral_pins=_recorded_pins(plan)`. - **`docs/cli.md`.** It is regenerated with `scripts/render-cli-reference.py`, and `--check` is ok. It differs from main's only in the `--pin`, `--pin-owner` and `--pin-source` help of `adopt-project.py plan`. `scripts/repo_shape.py`, `templates/assembly-root/scripts/validate-pins.py` and `tests/test_pin_source_env_collisions.py` are main's blobs, which are #409's: this branch adds nothing to them. Nothing of #409 is lost. Its scaffold behaviour is `shape_materialize.refuse_colliding_pins` and `pin_variable_collisions`, keyed by #409's `pin_product_key`. **73d65c6, after the merge.** - **The change.** `_read_pins` reads `plan.get("pins")` where it read `plan.data.get("pins")`. - **Why.** #445's `tests/test_adopt_late_failure.py` hands `_commit_the_split` a `SplitPlan` as its plan, a `dict` that adds `entries`. On f9ed46f, three of its tests stopped at "committing the split" with `AttributeError: 'SplitPlan' object has no attribute 'data'` (3 failed, 83 passed in that file). - **Nothing else changes.** `Plan.get` with no default returns `plan.data.get(key)` exactly, so a loaded plan reads as before. `adopt-project.py plan --pin` took a NAME only (`--pin openGlass`) and refused a trailing `@<commit>`. `plan`, `check` and `execute` each exited 0, and `execute` printed `adoption verified`. The manifest then listed the name in `neutral_product_pins:` with no `contracts/<product>-pin.yaml` beside it, and on its first run the adopted root's own `validate-pins.py` refused it as `neutral-pin-missing`. #273's table, reproduced on c7c02fa with the issue's own commands (local bare remotes, and a stub `gh` that exits 97): | `--pin` | c7c02fa | this branch | |---|---|---| | `openGlass` | `execute` exit 0, `- openGlass`; clone's `validate-pins.py` exit 2 `neutral-pin-missing` | `plan` exit 2 `pin-malformed`, with the scaffold's remediation (`--pin openGlass@<40 hex>`); no plan is written | | `opensoft/openGlass` | exit 0, `- opensoft/openGlass`; exit 2 `neutral-pin-missing` for `contracts/opensoft/openglass-pin.yaml` | `plan` exit 2 `pin-malformed` | | `spec` | exit 0; `validate-pins.py` exit 0, reading the leg's `contracts/spec-pin.yaml` as the neutral pin | `spec@<sha>` is `adopt-pin-collides` at `plan` | | `shape` | exit 0; `contracts/shape-pin.yaml` read as the neutral pin | `shape@<sha>` is `adopt-pin-collides` at `plan` | | `openGlass@<sha>`, `opensoft/openGlass@<sha>` | `plan` exit 2 `adopt-pin-malformed` | `plan`, `check` and `execute` exit 0, and `gh` is called 0 times. `contracts/openglass-pin.yaml` is written and the manifest lists `- openGlass`. In the clone, `validate-manifest.py` exits 0, and `validate-pins.py` exits 0 with `openGlass: pin commit … digest recomputes` | Brett ruled for decision 1's first option ("go with your recommendation on #273"): adopt takes the scaffold's pin and writes the scaffold's pin file. That reverses the NAME-only `--pin` from #6, and the comment that described it is replaced with the new contract. - **One implementation.** The scaffold's pin code moved into `scripts/shape_materialize.py`, next to `neutral_pin_path` and the materializer that writes the file. What moved: - `PIN_ARG_RE`, `parse_pin`, `pin_digest_from_source` and `pin_digest_from_gh`; - `declared_pin_values`, `declared_pin_products` and `PIN_COLLISION_REMEDIATION` (in #309's wording); - from #275's branch, `PIN_VARIABLE_REMEDIATION` and the variable check; - `_refuse_colliding_pins`, split into the pure `pin_collisions` and `pin_variable_collisions`, and `refuse_colliding_pins(refusal=...)`, which raises one refusal for both. The code did not move verbatim. `_refuse_colliding_pins` became the three functions above; `pin_digest_from_source` was rewritten for #339 (below); and fix round 1 changed three of them (below): `pin_variable_collisions` keys each pin by #275's `pin_product_key`, `pin_digest_from_source` spells a path that is not printable, and `pin_digest_from_gh` refuses a missing `gh`. The scaffold's behaviour is otherwise unchanged. `scaffold-project.py` imports what it calls under its old names. Lane 5's review ran 34 scaffold cases (every pin refusal, the `gh` stub's four modes, dry and real successes) on 34dbd86 and on this branch at 7a94b6b. rc, stdout, stderr, the `gh` log and the files made were identical, apart from the shape's own commit and digest and #339's row. Its pin tests and #275's pass as they are. `tests/test_git_output_decoding.py`'s exemption for `pin_digest_from_gh` follows the function to its new file. - **`plan`.** `--pin`, `--pin-owner` and `--pin-source` mean what they mean for the scaffold. `plan` reads the digest from `--pin-source` or `gh api`, and records product, repository, commit, digest and `digest_source` in the plan, so `check` and `execute` read no network for a pin. `plan` refuses: - a name with no `@<commit>`, as `pin-malformed`. That includes an empty `--pin ''`, which adopt used to drop and now refuses, as the scaffold always has; - `spec`, `code` and `shape`, in any case, as `adopt-pin-collides` (#273 decision 4), in the scaffold's sentence and remediation (#241, #309); - one product given twice, the same way, whether it is a repeat or two names that share one file (decision 5); - two products that one `SHAPE_PIN_SOURCE_<PRODUCT>` names, such as `open-glass` and `open_glass`, the same way, through #275's check; - a leg path over a pin's file, as `adopt-leg-path-collides`; - a `--pin-source` path that `check` would refuse in `digest_source:` (fix round 1), as `adopt-unwritable-value`. It is asked only when a `--pin` records the path; - with no `gh` on PATH and no `--pin-source`, `gh-not-found` (fix round 1). - **`check` and `execute`.** These are new `check` findings, and `execute` refuses each one before any leg exists. They come from `_leg_findings`, the list `check` and `_refuse_what_check_finds` share: - `plan-pin-unrecorded`: a name alone (an old plan's `pins: [openGlass]`, or a hand edit), or an entry missing its commit or digest; - `plan-pin-malformed`; - `plan-pin-collides`, which covers two pins at one file, a pin at a file the shape writes, and two products that share one source variable; - `plan-root-holds-pin`: a source path kept in the root at the pin's file. The materializer would write the shape's pin beside it under `shape/`, and `validate-pins.py` would read the source's file instead. How each finding ends: - `plan-pin-unrecorded` and `plan-pin-malformed` end with the `plan --pin <product>@<40 hex commit>` that records the pin whole. - `plan-pin-collides` ends with re-running `plan` with each product once, or, for two products that share a source variable, with one product of each such group. - `plan-root-holds-pin` ends with the kept path's own remedy: send that entry to a leg, `drop` it, or rename it in the source and re-run `plan`. A leg moved over a pin's file in the plan is `plan-leg-path-collides`. - **Also part of #386: its `pins:` row.** A hand-edited `pins:` that is not a list (a name such as `pins: openGlass`, a number, a mapping, a quoted string) is now `plan-pin-malformed` in `check` (`` `pins:` is 'openGlass', not a list of pins ``), and `execute` refuses it before any leg exists. - Where: `_read_pins` in `adopt-project.py`; the test row is `plan-pin-malformed-not-a-list` in `tests/test_adopt_pins.py`. - Before: on main, `check` said `plan ok` for the name, the mapping and the string, and gave a traceback for the number (reproduced by lane 5's review on cb7063f). #386 records that `execute` then wrote the name as eight one-letter pins. - Not fixed here: #386's other keys, `allow_empty_legs:`, `paths:`, `legs:` and `source:`, so #386 stays open. Lane 2's #435 takes all of #386, `pins:` included, and its `pins:` rule keeps only text items where this branch writes mappings; whichever lands second reconciles them (#435 (comment), and "Where the meaning meets" below). - **`execute`.** It writes each pin through `materialize_assembly_root(neutral_pins=...)`. The manifest lists the product with the owner stripped (decision 3), so the entry and the file agree. - **Docs.** `--help` is updated and `docs/cli.md` regenerated (`render-cli-reference.py --check` ok). `pin_digest_from_source` caught only `Refusal`. A directory that is no clone is git's own failure, so it was always `pin-source-unreadable`, exit 2. A path `subprocess.run` cannot enter never reaches git: it is a `FileNotFoundError`, `NotADirectoryError` or `PermissionError` out of `cwd=`, and nothing caught it. `scaffold-project.py --pin ... --pin-source <that>` ended `--dry-run` and the real run alike in a traceback, exit 1. Since the move above, `adopt-project.py plan --pin` reads its digest through the same function and ended the same way. Both reach it through `declared_pin_values`, and `check` and `execute` read no source, so that call is the only reader. The issue's table, run on ab623dd for the scaffold and on d806e8f for `adopt-project.py plan` (adopt has no `--pin-source` on ab623dd), then on this head. `gh` is a stub that logs and exits 97, with `GH_TOKEN` bogus and an empty `GH_CONFIG_DIR`; it was called 0 times in every run: | `--pin-source` | before | this branch | |---|---|---| | a directory that is not a clone | `pin-source-unreadable`, exit 2 | unchanged | | a path that does not exist | `FileNotFoundError` traceback, exit 1 | `pin-source-unreadable`, exit 2: `<path> could not answer for opensoft/openGlass @ <40 hex>: no such directory` | | a file | `NotADirectoryError`, exit 1 | exit 2, `... it is a file, not a directory` | | under a parent this user cannot enter | `PermissionError`, exit 1 | exit 2, `... Permission denied` | | a symlink loop (not in the issue) | `RuntimeError` out of `Path.resolve()` on 3.12, exit 1 | exit 2, `... Too many levels of symbolic links` | The real run and `--dry-run` give the same stdout and stderr, and nothing exists afterwards (no remote directory, no work directory; for adopt, no plan file). What changed, in `scripts/shape_materialize.py` only: - `pin_digest_from_source` catches `OSError` as well as `Refusal` and raises the existing `pin-source-unreadable` with its remediation unchanged. The message names the path and the reason. - `stat()` judges the source inside the guard, as #312 does in `validate-pins.py`, and the sentences are that file's: a missing path, or one beneath a file, is "no such directory"; a file is "it is a file, not a directory"; any other `OSError`, from `stat()` or from git's `cwd=`, is the system's own reason (`strerror`). It is not `exists()`/`is_dir()`, which before 3.14 swallow only a missing path. A source `stat()` can read but `cwd=` cannot enter, a directory with no search bit, fails in `tree_digest` and the same guard answers it. - `declared_pin_values` resolves the path through a guarded `_resolved_pin_source`. `Path.resolve()` raises a `RuntimeError` on a symlink loop before 3.13 (an `OSError` since), before the digest was asked for. As typed, `stat()` meets the loop and says so. - A source that answers is read exactly as before: a relative path resolves against the working directory, a symlink to a clone is followed, `digest_source` reads `local-clone (<path as typed>)`, and the digest is `tree_digest`'s. `tests/test_pin_source_unreadable.py` (46 tests in the #339 commit; fix round 1 adds 17 for S1 and moves one, below) runs each case through `scaffold-project.py --dry-run`, its real run and `adopt-project.py plan`: missing, a file, beneath a file, relative and missing, a parent and a source with no search bit (skipped on Windows and as root, by a mark, so before any fixture builds a directory), a 300-character name, a symlink loop (skipped on Windows) and a directory that is no clone. Each asserts exit 2, the refusal naming the path and the reason, its remediation, no traceback and nothing created. It also holds `--dry-run` and the real run to the same stdout and stderr, checks the path is printed escaped under an ASCII stderr and as a surrogate when it is not UTF-8, and checks that a relative source and a symlink to a clone read as before. The session `gh` guard fails any test whose run called `gh`. origin/main ab623dd reached this branch through implQ's branch: 34dbd86 is a30091f merged with ab623dd. One file conflicted there, `templates/assembly-root/scripts/validate-pins.py`, in seven hunks, because #312 (8cdca5e) replaced `keyed_sources` and `default_source` with `PinSources` and #275 added `env_shared` and `shared`. #312's blob is the same at its PR head, at the squash and at ab623dd, so it landed the file implQ resolved against. The resolution keeps #312's side in all seven and adds #275's on top: | # | hunk | resolution | |---|---|---| | 1 | `resolve_neutral_pin_source` signature | #312's `sources: PinSources` and 3-tuple return, plus #275's `env_shared: bool = False` | | 2 | its docstring tail | #312's `Returns (path, how, typed)` text, plus #275's "Rule 2 is skipped when `env_shared`" paragraph | | 3 | `_recompute_neutral_pin_digest` signature | #312's `sources`, plus #275's `shared: frozenset[str]` after `report` | | 4 | the `resolve_neutral_pin_source(...)` call inside it | #312's 3-tuple unpack, plus `env_shared = product.casefold() in shared` and the extra argument | | 5 | `_check_one_neutral_product_pin` signature | #312's `sources`, plus #275's `shared` | | 6 | its call of `_recompute_neutral_pin_digest` | `sources, report, shared` | | 7 | `_check_neutral_product_pins` docstring and body | #312's `PinSources(...)` and `_note_unused_pin_sources`, plus #275's paragraph, `_report_pin_source_collisions(products, report)` and `shared = frozenset(pin_source_env_shared(products))` | This branch's own merge of 34dbd86 (5690235) had no conflict, and neither had its merge of #409's fix round, 6494714 (583f647). That fix round made `neutral-pin-source-collides` a note and keyed "one product" by `repo_shape.pin_product_key`. At 421e4e5, `templates/assembly-root/scripts/validate-pins.py`, `scripts/repo_shape.py` and `tests/test_pin_source_env_collisions.py` were byte-identical to the tree `git merge-tree` gives for 6494714 with origin/main 3ef059c (blobs 5604007, 091966b, 5220787), so this branch added nothing to those three files beyond #409. The 34dbd86 merge brought in #335, #312, #317, #270 (f795cf7), #344 and #349 with no conflict. Earlier merges of origin/main (87373a6, for #309's reworded constant, and e43fa95) are unchanged. Fix round 1 merged origin/main three more times: - **cd1fc79 (2bcfa69).** It brought #245, #351, #350, #345, #372, #371, #354, #380, #377 and the rest since ab623dd, with no conflict. - **45e01f4 (4098b61).** It brought #396's `tests/test_agents_md_codes.py`. That test finds `scaffold-pin-collides` as a string constant of `scripts/shape_materialize.py`, which `SHIPPED` lists. - **3ef059c (421e4e5), #314.** One conflict, one hunk in `adopt-project.py`. This branch's `_refuse_an_unrecordable_pin_source` and #314's section "The project must be able to hold what `execute` writes into it (#261)" were added at the same place; both are kept. Where the two meet, lane 5's earlier recipe applies: - `_flag_plan` builds each pin as the `PIN_FIELDS` mapping `plan` writes, not `list(pins)` of products. So the plan `plan` asks the validator about is the plan it writes. - #314's `test_plan_asks_what_check_asks_of_the_same_keys` plans `--pin openGlass@<commit> --pin-source <stand-in>` where it planned the name alone, which `plan` now refuses. Then f9ed46f, after #409 squash-landed, and 73d65c6 after it (top of this description). On the merged tree exactly one test failed: `tests/test_adopt_template_values.py::test_check_finds_and_execute_refuses_a_hand_edited_value[pins-surrogate]`. It plans, then hand-edits the plan to `pins: ["openX\ud800"]`, a name-only pin with a lone surrogate. Before this branch the refusal's headline was `REFUSED plan-unwritable-value`. A name-only pin in a plan is now `plan-pin-unrecorded` (#273), so `check` has a second, independent finding for that very plan, and the headline is the first finding's: ``` REFUSED plan-pin-unrecorded: 2 finding(s) ... FINDING plan-pin-unrecorded: `pins:` entry 1, 'openX\ud800', is a name with no commit and no digest ... FINDING plan-unwritable-value: a `pins:` item is 'openX\ud800', which `execute` writes into the assembly root's `project.yaml`, and it holds a lone surrogate ... ``` Nothing about #270's contract changed. The lone surrogate is still found as `plan-unwritable-value`, listed under the refusal, and `execute` still refuses before any leg exists. `check` builds `_leg_findings`, where `_pin_findings` sits, before it calls `_value_findings`, so the pin finding comes first. d806e8f changes one assertion for that row, `pins` only: the headline is `REFUSED plan-pin-unrecorded: ` where it was `PLAN_REFUSED`. The other 15 rows and the finding assertions, including the `plan-unwritable-value` line, are untouched. Lane 5's review of 7a94b6b found 3 should-fix and 5 nits. Each is answered here: - **#409's `pin_product_key` (review N1).** The merge of #409's fix round could not carry it, because this branch had moved the function that used it out of `scaffold-project.py`. `pin_variable_collisions` now keys each pin by that function, where it casefolded. `openß` and `openss` are two pin files and one `SHAPE_PIN_SOURCE_OPENSS`, and a casefold named each of the two pins twice. No `--pin` or recorded `pins:` entry `PIN_ARG_RE` admits can spell either, so the test asks the function directly. `refuse_colliding_pins`' docstring now says, in #409's words, that the root's `validate-pins.py` only notes such a pair. - **S1, a `--pin-source` path that is not printable.** `pin_digest_from_source` names the path as typed unless it is not printable (`str.isprintable`), and then as Python's `repr` spells it (`shown_source`). That covers the refusal's head and git's own reason, which names the directory it ran in. Printed raw, an ESC reached the terminal, and a line break or a carriage return began a line of the path's choosing, a forged `REFUSED` line among them, from the scaffold and from adopt. The traceback #339 replaced had shown a `repr`. A printable path is named byte for byte as before. - **S2, no `gh` on PATH.** `pin_digest_from_gh` refuses as `gh-not-found`, exit 2, as `repo_shape.tree_digest_from_gh` names it, and offers `--pin-source`. It was a `FileNotFoundError` traceback, exit 1, from the scaffold and, new with this branch, from `adopt-project.py plan --pin`. - **S3, a hand-edited `commit:` or `tree_sha256:`.** The lane's decision is to accept it and document it (option (c)); no behaviour changed. A pair that disagrees passes `check` and `execute` (`adoption verified`), because neither reads a network for a pin, by design. The adopted root's own `validate-pins.py` then exits 1 with `neutral-pin-digest-mismatch` wherever it can read the product. `check` now says so once, after the pins it will write: "each pin as `plan` read it, not read again here: the root's own `validate-pins.py` recomputes its digest wherever it can read the product". Options (a), `execute` recomputes before it creates the legs, and (b), `check` recomputes from a clone still on the machine, are filed as #449. - **N2, a `--pin-source` that `plan` cannot record.** `plan` asks `check`'s question (`one_printable_line`) of the path it records in each pin's `digest_source:`, before any digest is read. It refuses one that fails as `adopt-unwritable-value`, in #270's words (`unwritable_reason`), or as "an invisible formatting character" where those name nothing. Before, it was planned, exit 0, and printed raw in the report. `check` then refused it as `plan-pin-malformed` and said to re-run the same `plan`. The report's `pin` line and `check`'s `write` line now spell the digest's source with `_shown`. The scaffold half is pre-existing (a line break in the path is written into the pin file; a byte that is not UTF-8 dies after all three repositories exist) and is filed as #450. - **N3, six hunks no test guarded.** Each now has a test that fails when it alone is reverted: - the two name guards (a `pins:` name holding an ESC and a forged line); - the lower-casing of the commit and the digest (an upper-cased hand edit); - the `digest_source` printability check; - the not-text check (`commit: 1234567` unquoted); - the gitlink filter (a submodule kept where the pin is written is `plan-submodule-root` alone). - **N4.** This body. - **N5, #339's third decision.** A `--pin-source` that nothing reads is still silent, now in adopt too. This PR does not decide it. #451, filed, lays out refuse, note and leave, so closing #339 loses nothing. Lane 5's second review, of 421e4e5, found no blocking item, 2 should-fix items and 3 nits. The two should-fix items are this body: the landing after #409 (above) and #386 (above). The code needed no change for them. f63d1ed adds two tests and no code: - **n1. `plan` asks nothing of a `--pin-source` no `--pin` records.** With the `args.pin and` guard dropped, such a path holding an ESC or a zero-width joiner was refused in a sentence naming no file ("`execute` writes into , and ..."), and every test still passed. `test_a_pin_source_no_pin_records_is_not_asked_about` holds the plan to exit 0 and `pins: []`, with the path named nowhere in the plan or the report. The ESC row is POSIX-only by the file's `POSIX_NAMES` mark; the zero-width joiner row runs everywhere. It holds #451's answer today, silence, so a decision there changes this test on purpose. - **n2. A printable `--pin-source` is printed as it is.** With `_spelled` in place of `_shown` in `plan`'s `pin` line, every test still passed. `test_a_printable_pin_source_is_printed_as_it_is` holds `plan`'s `pin` line, and `check`'s `write` line for the plan `plan` wrote, to their exact text, ending `(local-clone (<path>))` with no backtick. - **n3** needs a code change and is left out (below). **Fix round 2, on f63d1ed.** Each run had a `gh` stub first on PATH (it logs and exits 97), `GH_TOKEN` bogus, an empty `GH_CONFIG_DIR`, `git-filter-repo` 2.47.0 next on PATH, and the identity blanked with `GIT_CONFIG_COUNT`; the session `gh` guard came first inside each run. - **The pin set: 812 passed, 2 skipped.** It covers adopt pins, adopt plan, #339's file, #275's tests, the pin and neutral-pin validators, git output decoding, adopt template values, CLI reference, scaffold pin and reuse, scaffold pin collisions, #314's two files and #396's file. The skips are `test_adopt_plan.py:403` (no MedxEHR clone) and `test_adopt_template_values.py:223` (this host reads `git config user.name` from the repository, not from `GIT_CONFIG_GLOBAL`). That is fix round 1's 809 passed, plus the three new rows. - **Shape doctor and scaffold leg-path collisions: 369 passed, 3 skipped** (the PowerShell line exists only on a Windows host). - **Mutation probes**, each one line changed in a throwaway worktree, over `tests/test_adopt_pins.py` and `tests/test_pin_source_unreadable.py` less the five end-to-end adoptions: - the `args.pin and` guard dropped: 2 failed, both n1 rows; - `plan`'s `pin` line `_spelled`: 1 failed, the n2 test; - `check`'s `write` line `_spelled`: 2 failed, the n2 test and `test_an_upper_cased_hand_edit_is_written_lower_cased`; - `plan`'s `pin` line raw: 1 failed, the no-break-space test that already guarded that hunk. **On the merged tree, 73d65c6** (the merge f9ed46f and the `_read_pins` commit), with the same harness: - **The pin set** above, with #445's `test_adopt_late_failure.py`, `test_adopt_git_reads.py` and `test_adopt_filter_repo_failure.py` and #387's `test_adopt_empty_symlinks.py` and `test_adopt_root_manifest.py`: **988 passed, 2 skipped**. The skips are the two above. - **Shape doctor, scaffold leg-path collisions and the adopt suites:** **967 passed, 3 skipped** (the PowerShell line). The adopt suites are e2e, execute refusals, verify, root shape paths (#387's too), leg-path collisions, clone template, ignored shape files and submodules. - **On the merge alone, f9ed46f** (the same tree as before the `_read_pins` commit): `tests/test_adopt_late_failure.py` gave 3 failed, 83 passed, the three `AttributeError` rows above. - `render-cli-reference.py --check` is ok on the merged tree. pyflakes reports the same four warnings on `adopt-project.py`, `scaffold-project.py` and `scripts/shape_materialize.py` as before the merge. **Fix round 1, on 421e4e5.** Each run had `git-filter-repo` 2.47.0 on PATH and the identity blanked with `GIT_CONFIG_COUNT`. A `gh` stub that logs and exits 97 was first on PATH, with `GH_TOKEN` bogus and an empty `GH_CONFIG_DIR`, and the session `gh` guard came first inside each run. - **The pin set:** 809 passed, 2 skipped (the same files and skips as above). - **Doctor and scaffold:** 782 passed, 3 skipped (the PowerShell line exists only on a Windows host). It covers shape doctor, scaffold leg-path collisions, scaffold e2e, referent chain links, naming policy, repo hygiene and #351's free-text values. - **The adopt suites:** 882 passed. It covers e2e, execute refusals, verify, spec-only, leg paths, root shape paths, plan escapes, leg-path collisions, clone template and submodules. - **Before the #314 merge,** on 74ce4d9's tree: the first two sets gave 577 passed, 2 skipped and 782 passed, 3 skipped. On 2bcfa69's tree (the merges alone, before the fix) they gave 542 passed, 2 skipped and 782 passed, 3 skipped. After the 45e01f4 merge, `tests/test_agents_md_codes.py`, repo hygiene and CLI reference: 110 passed. - **Lane 5's second review** also ran 421e4e5 merged with main cb7063f and with 53bee5b: the pin set, the manifest-value set, and the doctor set with #357's `tests/test_doctor_validator_rows.py`. All passed, with only the skips above. Proof that fix round 1's tests test something: - **On 2bcfa69's tree,** with this head's two test files laid over it, 31 of the new rows fail: - S1: 17; - N2 and its report spelling: 7; - S2: 3; - the `pin_product_key` port: 2; - `check`'s S3 line: 1; - the not-UTF-8 `adopt plan` row: 1. The N3 rows pass there, as they must: they guard hunks this branch already had. - **Mutation probes.** Each hunk was reverted alone, in a throwaway worktree, and both test files were run: 18 of 18 were caught. - **The port:** the casefold keying (2 fail); the casefold lookup alone (2). - **S1:** the path named raw (13); git's reason named raw (2); every path `repr`'d, printable or not (27). - **S2:** no `except` (3). - **N2:** no `plan` check (11); only #270's question asked (1); the formatting-character reason said otherwise (1); the report's `pin` line raw (1); `check`'s `write` line raw (1). - **S3:** the line dropped (1). - **N3:** the `_pin_fix` name guard (1); the `_read_pins` path guard (1); the lower-casing (1); the `digest_source` check (1); the not-text check (1); the gitlink filter (1). - **The issue rows reproduced.** S1, S2 and N2 were reproduced on 2bcfa69's tree and shown gone on the fix (a probe driving both tools; `gh` was called 0 times). **Before fix round 1.** Runs were on 7a94b6b, with `git-filter-repo` 2.47.0 first on PATH and the repository-local `user.name` blanked with `GIT_CONFIG_COUNT` (a workstation whose standard checkout sets one fails `test_the_scaffold_refuses_with_no_elector` on main itself; CI sets none). 7a94b6b differs from ffd1297 in `tests/test_pin_source_unreadable.py` only, so the three suites that do not read that file ran on ffd1297: - the new file: 46 passed; - adopt pins, adopt plan, git output decoding: 172 passed, 1 skipped (the MedxEHR clone is absent); - scaffold pin and reuse, pin collisions, e2e, referent chain links, neutral pin and pin validators, #275's tests, naming policy, repo hygiene, CLI reference, scaffold leg-path collisions: 571 passed; - shape doctor: 254 passed, 3 skipped (the PowerShell line exists only on a Windows host); - the new file with repo hygiene, git output decoding and CLI reference, once more after the last edit: 176 passed. Earlier on 5690235 and d806e8f, before the #339 commit: the adopt suites (e2e, execute refusals, verify, spec-only, leg paths, root shape paths, plan escapes, leg-path collisions, clone template) 740 passed, and `tests/test_adopt_template_values.py` with #273's other adopt tests 489 passed, 2 skipped. They were not re-run on 7a94b6b: the #339 diff touches `pin_digest_from_source` and the call in `declared_pin_values`, which those suites reach through `test_adopt_pins.py` only. Nothing was run on macOS or Windows. Proof the new tests test something: - **On d806e8f.** 38 of the 46 fail, each on the traceback and its exit 1. The 8 that pass are the unchanged behaviour: the not-a-clone refusal (4 rows) and the valid-source rows (4). - **Mutation probes.** Ten hunks reverted one at a time, each failing at least one new test: the `OSError` catch (16 fail), the catch narrowed to `OSError` only (21), the missing-path clause (9), the clause narrowed to `FileNotFoundError` (3), the `S_ISDIR` judgement (3), the loop guard (4), no resolve at all (3), the old `.resolve()` call (4), the reason as `str(exc)` (12), and the file sentence as the OS's (3). - #273's own 52 tests still fail on c7c02fa (51 fail or error; the one that passes checks the test's own table), and its 18 mutation probes were each caught. **Re-verified after the merge.** An independent re-verification of f9ed46f and 73d65c6 found the code correct: - #409 is carried whole. A 30,000-case fuzz of `--pin` lists through #409's final refusal and this branch's port differed in 0 cases. - `scaffold-project.py` equals the tested file plus main's own changes that are not #409's (same patch-id). - `_commit_the_split` keeps #445's `try` and #394's `append`. - `_read_pins` reads a loaded plan as before. Its findings were all in this description (the #506 bullet and three stale facts), now fixed. Runs on the head and on its merge with main 48585e6: 988 passed, 2 skipped; and 967 passed, 3 skipped. `git merge-tree --write-tree` was run at 01:48Z on 2026-10-13, comparing hunks per file. Each PR head, fetched from `refs/pull/<n>/head` with no `gh`, was merged with 73d65c6 and with origin/main 9736424 alone. Two sets were asked about: - every PR this description listed before that main does not now contain; - every PR numbered above #468 whose head main does not contain: #473, #474, #490, #491, #493, #494, #495, #496, #497, #503, #504 and #505. **Open state, read with `gh` by the coordinator at 02:00Z and refreshed at 02:25Z after a re-verification on main 48585e6.** Every pull request named below is open. #184, #94, #96, #98, #100 and #161 are closed, and #465 landed as 48585e6. `fix/adopt-plan-quote-yaml-keywords` has no pull request. #506 (`fix/scaffold-reuse-seeded-legs`) opened after this list was made, and the re-verification reads it. - **Landed since the last draft of this list:** #343, #346, #355, #358, #373, #378, #382, #387, #394, #397, #401, #404, #409, #419, #452, #456, #465, #466 and #484. #394's `_commit_the_split` conflict and #401's `docs/cli.md` conflict are both resolved in f9ed46f, above. - **Clean, 20:** #266, #347, #356, #374, #376, #384, #395, #453, #467, #468, #473, #474, #490, #491, #493, #494, #495, #497, #503 and #505. #453, #468 and #491 were updated onto main since the first read and now merge clean. #507 (lane 5's #486-#488) shares only the generated `docs/cli.md` with this branch and merges clean with it. - **Conflicting with main alone, and this branch adds no hunk:** - #402: `shape-doctor.py` 5; - #496: `shape-doctor.py` 10 and `tests/test_shape_doctor.py` 1. **Conflicts this branch adds:** - **#435** (3efcc7a, lane 2's `fix/adopt-plan-field-types`, for #386). - It adds 2 hunks in `adopt-project.py`: 5 here, against 3 with main alone. They are `render_plan`'s `pins:` line and `Plan.pins`. - Keep this branch's `_pin_lines` and `_pin_products`. The rest is under "Where the meaning meets". - **#504** (37ef29a, `fix/adopt-root-kept-symlinks`). - It adds 1 hunk in `adopt-project.py`: 2 here, against 1 with main alone. It is the materializer call in `_commit_the_split`. - Keep both arguments and both comments: `append=append, neutral_pins=_recorded_pins(plan), spell=_spelled`. - **#506** (119d8c4, `fix/scaffold-reuse-seeded-legs`). - It adds 1 hunk in `scaffold-project.py`. With main alone, #506 conflicts only in `docs/handbook.html`. - #506 inserts `LEG_TEMPLATES` right after `declared_pin_products`, which this branch moved out, and rewrites `_reusable_remotes` further down. Keeping both sides breaks the file with an unterminated string literal. - Keep only #506's `LEG_TEMPLATES` block. Drop #506's `declared_pin_values`/`declared_pin_products`, which moved here, and this branch's three-line `_reusable_remotes` opener, which #506 rewrites below. Resolved that way, pyflakes is clean and #506's scaffold tests pass (88). - **`fix/adopt-plan-quote-yaml-keywords`** (ed9968f; a branch with no pull request). - It adds 2 hunks in `adopt-project.py`: 3 here, against 1 with main alone. - One is `render_plan`'s `pins:` line. Keep `_pin_lines`, which already sends product, repository and `digest_source` through `y`. - The other is `_refuse_unholdable_values`' signature. Keep `pins: dict`, with that branch's `_validator_judged` and `_named_as_read` above it. - `fix/adopt-late-failure-notice` is no longer on origin. #445, the late-failure notice, is on main and merged here. **Where the meaning meets:** - **#435 and #386.** The coordinator has said this on #435: #435 (comment) - #435's `_plan_key_findings` (`plan-bad-pins`) keeps only text items in `pins:`, and its `PINS_REMEDIATION` tells a person to write `pins: [openGlass]`. - This branch writes each pin as a mapping, and it makes a name alone `plan-pin-unrecorded`. - Read from #435's code, not run: on a tree with both, the plan `plan --pin` writes is `plan-bad-pins` in `check`. - Whichever lands second reconciles them, with three changes: - `_plan_key_findings` takes this branch's mappings, or leaves `pins:` items to `_read_pins`; - a `pins:` that is not a list gives one finding, not both `plan-bad-pins` and `plan-pin-malformed`; - `PINS_REMEDIATION` says the mapping `plan` writes. - Until that is done, `tests/test_adopt_pins.py::test_a_plan_with_a_whole_pin_checks_ok` fails. - **#314.** It landed, and it is merged here (above). - **`fix/adopt-plan-quote-yaml-keywords`.** Its pin tests are written against the name-only `--pin`. They need the `name@commit` form, and their expected `pins: [...]` line becomes `_pin_lines`'s mapping. - **Two unwritable values are refused in two runs (lane 5's second review, n3).** `plan --elected-by 'A<LF>B' --pin openGlass@<sha> --pin-source <a path holding an ESC>` refuses the elector alone, exit 2. Re-run with the elector retyped, it refuses the source; #270's refusal names every unwritable value at once. Reproduced on 421e4e5, with `gh` called 0 times. One refusal would need a code change, not made here: - `_refuse_an_unrecordable_pin_source` would split into a function that returns the sentence; - `_checked_plan_inputs` would ask it before #270's `unwritable_values` raise, and raise one `adopt-unwritable-value` that names both, with both remediations; - a test would add the two-value row. N2's question is `one_printable_line`, not `unwritable_reason`, so it cannot simply join #270's list. - **Docs.** The README, AGENTS.md and `docs/handbook.html` are unchanged, because none of them calls adopt's `--pin` a name. A sentence saying adopt now takes the scaffold's `--pin` is a follow-up. It costs an AGENTS.md line-cap raise, and a README edit forces the handbook's README blob to change. - **A product spelled `null`, `true` or `false`.** The scaffold already accepts `--pin null@<sha>`: it exits 0 and builds a root whose `validate-pins.py` exits 1 `neutral-pin-entry-malformed`. Adopt's `plan` writes `product: null` through `y`, and `check` then finds `plan-pin-malformed` and refuses it before any leg exists. The one fix for both tools is in `parse_pin`, and it would change the scaffold's behaviour. - **Wording shared with the scaffold.** `digest_source` is written bare into the pin file, so a `--pin-source` path holding ` #` is cut short there. `templates/assembly-root/contracts/neutral-product-pin.yaml` and `validate-pins.py`'s `neutral-pin-missing` remediation name only the scaffold as the writer. Two comments in `scripts/repo_shape.py` still name the scaffold's `pin_digest_from_gh`, in a digest-pinned shipped copy. - **Filed as follow-ups:** - #449: S3, a hand-edited `commit:` or `tree_sha256:` that disagrees, with options (a) and (b); - #450: the scaffold half of N2, a `--pin-source` path no file can hold; - #451: #339's third decision (N5), a `--pin-source` that nothing reads. - **`validate-pins.py` prints a `--pin-source` path raw** in `neutral-pin-source-unreadable`, the twin of S1. It is a shipped template that #409 and other open PRs edit, so it is left for its own change. No issue is filed for it yet. - **Windows and macOS** were not run here; CI ran both (below). Two assertions that depend on what Windows answers for a path (a name past the filesystem's limit, a path beneath a file) check only the refusal and its remediation there. Fix round 1's rows that need a control character or a byte that is not UTF-8 in a path, or a symlink to `git`, are skipped on Windows by a mark, and so is fix round 2's ESC row. The rows for a no-break space and a zero-width joiner run everywhere, and so does the in-process `gh-not-found` test. Reviewed independently by lane 5 at 7a94b6b (3 should-fix, 5 nits: fix round 1) and at 421e4e5 (0 blockers, 2 should-fix, 3 nits: fix round 2). After #409's squash, the re-verification of f9ed46f and 73d65c6 found the code correct; its 1 should-fix and 3 nits were in this description and are fixed. GitHub's update-branch then merged main twice (33bae3f, 2170526), with no hand edit. CI's tests, tests-macos and tests-windows and SonarCloud all passed at 2170526 (main cac6bb2 merged in). On that head merged with main 57c85e9 (#490, #474 and #468, none of which touches this branch's files), the pin and adopt set with `tests/test_update_shape_landing.py` gave 1112 passed, 2 skipped, and the doctor, adopt end-to-end, unfinished-merge and bootstrap set gave 1056 passed, 3 skipped (the doctor's PowerShell line, which exists only on a Windows host). Closes #273 Closes #339 Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Lane: openreposhape-4 (openRepoShape-4)
Claim: #288 (comment)
What
The scaffold's two path-collision refusals are now in the documents an agent reads before it runs the tool, stated at the precision the tool has:
scaffold-leg-path-collides(scaffold-project.py accepts a leg path that collides with a path the shape writes (--spec-path contracts,--code-path project.yaml), creates all three repositories and pushes both legs, then dies: #172's shape half on the scaffold side #197) refuses a--spec-pathor--code-paththat is, holds or lies inside a FILE the shape writes into the assembly root (project.yamlis one;contractsholdscontracts/spec-pin.yamland three more;contracts/xis accepted). The defaultsspecandcodepass.scaffold-pin-collides(scaffold-project.py--pin spec@<sha>(orcode@,shape@, or two--pins whose products differ only by case) passes--dry-run, then creates all three repositories, pushes both legs and dies withREFUSED materialize-collision, because the pin'scontracts/<product>-pin.yamlis a file the shape already writes #241) refuses a--pinwhose product lowercases tospec,codeorshape(the shape writes those pin files itself) and one product pinned twice, in any case or under any owner (openGlasswithOpenGlassorAcme/openGlass), because one file holds one pin.Both fire at the plan, before the typed
yesand before anything is created. No behaviour changes: no refusal's logic, order or code.AGENTS.mdsetup.shtakes the three flags after--, and gives the act: relay the refusal, ask the human for the value, never choose another yourself. "Scaffolding a project that DECLARES descent": the pin half, with the any-case/any-owner clause. Cap 464 -> 477 (+13: nine lines in section 2, four in the descent section)README.md--pinis written up, the same two pin facts (no code names). Cap 1416 -> 1419scaffold-project.py--spec-pathand--code-pathget ahelp=(what the flag is, its default, that a path that is, holds or lies inside a FILE the shape writes is refused);--pin's "Repeatable." is "Repeatable, once per product (the same name in another case, or under another owner, is the same product).";PIN_COLLISION_REMEDIATIONnamesspec,codeandshape, in any case, as names no product can be pinned underdocs/cli.mdscripts/render-cli-reference.py(diff is the three help edits only)docs/handbook.htmlREADME.md blobre-taken for the final README.mdtests/test_scaffold_pin_collisions.pytests/test_repo_hygiene.pyWhy
Neither #197 nor #241 touched a
.mdfile, so a human or agent learned of either only by hitting it, and AGENTS.md section 2's "each one names what to run instead" is untrue of both: the remedy is to pass a different value. A repository genuinely namedspec,codeorshapecannot be pinned by any spelling of its name, and the refusal's old advice ("name the product for the repository it pins") never said so.Four commits, one change
23b590a: the whole change as first written, the handbook footer's blob re-taken.72d1cc2: the handbook's copy of AGENTS.md's "each one names what to run instead", which commit 1 had made over-stated.3fd3669: the review of 72d1cc2 (MERGEABLE WITH NITS, two SHOULDs):--helpand AGENTS.md said "a path the shape writes" and read as refusingcontracts/x, which the tool accepts: now "a FILE the shape writes";scaffold-bad-leg-path,scaffold-bad-id,scaffold-no-electorandpin-malformedname a value too): now "for some, the VALUE to change", in AGENTS.md and the handbook;--pin's help);setup.shafter--;2ea1717: the AGENTS.md cap entry's split of the 13 added lines, which said ten in section 2 and three in the descent section, now says nine and four, asgit diff ede15ce 3fd3669 -- AGENTS.mdcounts them (+11 -2 and +9 -5). The total and the cap are unchanged.Use the squash message in
squash-body.md, not a concatenation of the four.Not here
adopt-project.py planhas its own--spec-pathand--code-pathwith nohelp=.scaffold-project.py(nothing fails today if one is misspelled).Tests
Both refusals were run on the unmodified tree and on each change (local remote directory, a
--pin-sourceclone, aghshim that exits 97 and never called,--dry-run); the codes in AGENTS.md are the ones printed, andcontracts/x,.github/x,project.yaml/x,openGlasswithOpenGlassand withAcme/openGlasswere each run to confirm the sentences about them.At 3fd3669:
env GIT_AUTHOR_NAME=t GIT_AUTHOR_EMAIL=t@t GIT_COMMITTER_NAME=t GIT_COMMITTER_EMAIL=t@t PATH=<gh shim>:<git-filter-repo 2.47.0 venv>/bin:$PATH /usr/bin/python3 -m pytest tests/test_cli_reference.py tests/test_repo_hygiene.py tests/test_scaffold_pin_collisions.py tests/test_scaffold_leg_path_collisions.py -q --basetemp=<scratch>: 200 passed, 0 failed, 0 skipped.scripts/render-cli-reference.py --checkexits 0. At 2ea1717, which changes only a comment intests/test_repo_hygiene.py, that file alone: 50 passed, 0 failed, 0 skipped. At 23b590a, withtests/test_scaffold_pin_and_reuse.py,tests/test_scaffold_leg_paths.pyandtests/test_scaffold_mount_ignored.pyadded: 289 passed.Closes #288
🤖 Generated with Claude Code