Repository navigation
adopt-project.py: check recomputes each pin's digest at the plan's commit in the clone plan read it from, where that clone is still on the machine and is no partial clone, so a commit or a digest edited into the plan no longer checks ok and reaches the root as adoption verified over a red validate-pins.py (#449) - #589
Conversation
…commit in the clone `plan` read it from, where that clone is still on the machine, so a commit or a digest edited into the plan no longer checks ok and reaches the root as `adoption verified` over a red `validate-pins.py` (#449) Since #273, `plan --pin <product>@<40 hex>` reads the pin's digest (from `--pin-source <clone>`, or `gh api`) and records the product, the repository, the commit, the digest and `digest_source:` in the plan. `check` held each value to the form `plan` writes it in and to nothing else, so a commit or a digest edited into the plan after `plan` read them checked ok, `execute` wrote `contracts/<product>-pin.yaml` from them and said `adoption verified`, and the root's own `validate-pins.py` then found `neutral-pin-digest-mismatch` on its first run, after both legs existed. The comment `plan` writes above `pins:` already says such an edit is one nobody read; this makes it true where it can be, with no network (option (b) of #449). - Where `digest_source:` is `local-clone (<path>)` and something is still at that path, `check` recomputes the digest there at the plan's commit with `plan`'s own reader, `pin_digest_from_source`. A digest that differs is the FINDING `plan-pin-digest-mismatch`; a clone that cannot answer for the commit (it does not hold it, or the path is no clone any more) is the FINDING `plan-pin-source-unreadable`. Both are in `_entry_findings`, the one list, so `execute` refuses them before any leg exists. Where the digest recomputes, a NOTE says so. - Where nothing is at the path any more, where `gh api` read the digest, or where `digest_source:` names no clone, one NOTE per pin says the digest was NOT rechecked here and that the root's own `validate-pins.py` recomputes it wherever it can read the product. `gh` is never run; `execute --local-remote-dir` still needs no `gh`. - The digest is a function of the commit, so a commit and a digest both moved to another commit the clone holds are a pin of that commit and check ok, and an upper-cased pin is the same pin. A relative path is read from the current directory, as `plan` read it. - `check`'s report no longer prints "each pin as `plan` read it, not read again here", which is now false where the clone answered; the per-pin NOTE replaces it. The comment above `pins:` is unchanged. Tests (tests/test_adopt_pins.py, beside `test_a_plan_whose_pin_execute_cannot_write_is_found_and_refused`): the commit edited, the digest edited, an upper-cased edited commit and a commit the clone lacks are each found by `check` and refused by `execute` before any leg remote exists; a commit and a digest both moved to the other commit, and an upper-cased pin, check ok with the NOTE that the digest recomputes; the clone deleted, a `gh api` source and a source naming no clone each check ok with the NOT-rechecked NOTE and no `gh` call; and #449's own path through a real `plan --pin-source`. The control test's S3 sentence assertion becomes the NOTE. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nd names the directory a relative `--pin-source` is read from and both causes of `plan-pin-source-unreadable`, so a `git clone --filter` clone no longer makes `check` fetch over the network and the finding no longer states one cause as the only one (#449) The fix round of #449 (review r449, F1 to F3 and F5). - A partial clone is not asked (F2). `git` in a `git clone --filter` clone fetches an object it lacks from its promisor remote, so the recheck could reach the network, measured by r449 against a `tree:0` and a `blob:none` clone. `_a_partial_clone` reads the clone's own `--local` config (`extensions.partialclone` or a `remote.<name>.promisor`), which reads no network, and such a pin gets the NOTE that its digest was not rechecked. The cost: a `blob:none` clone that holds the commit is not rechecked either. - `plan-pin-source-unreadable` names both causes and each way out (F1). It stays a FINDING wherever something at the recorded path cannot answer (a missing commit, a directory that is no clone, a file), as `validate-pins.py` finds a source it reads that cannot answer. The text says the commit was edited, or the path no longer holds the clone `plan` read, and offers running `check` where `plan` ran, `git fetch` in that clone, or re-running `plan`. - A relative `--pin-source` is named with the directory it was read from (`_read_from_here`, F1 and F3): in the gone-clone NOTE ("is not at openGlass (read from this directory as <absolute>)"), the partial-clone NOTE, both findings, and the NOTE that the digest recomputes. - The comments and docstrings that say "no network" now say how that is true. Tests (tests/test_adopt_pins.py): a clone marked partial by its config alone gives the NOTE, with nothing fetched; a relative clone read from the directory `check` runs in is named with it, in the NOTE and in the finding; the `commit-absent` case asserts the new text; the gone-clone and control tests take the new NOTE. `adoption-plan.yaml` is the module constant `PLAN_NAME`, and the recompute test is parametrized by a bool (F5). Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 1 day and 8 hours by commenting |
Reviewer's Guide
Sequence diagram for local pin digest verificationsequenceDiagram
participant User
participant Adopt as adopt-project.py
participant Plan as Plan data
participant Clone as Source clone
participant Git as Local git
User->>Adopt: check or execute
Adopt->>Plan: _entry_findings
Adopt->>Plan: _pin_digest_findings
Adopt->>Plan: _why_not_rechecked
alt local clone exists and is non-partial
Adopt->>Clone: _a_partial_clone
Clone->>Git: git config --local --get-regexp
Git-->>Clone: clone configuration
Adopt->>Clone: pin_digest_from_source(commit, repository)
Clone->>Git: git ls-tree -r -z commit
Git-->>Clone: recomputed digest
alt digest differs
Adopt-->>User: FINDING plan-pin-digest-mismatch
else digest matches
Adopt-->>User: NOTE digest recomputes
end
else clone unavailable, partial, or gh-api source
Adopt-->>User: NOTE digest NOT rechecked here
end
alt execute and findings exist
Adopt-->>User: REFUSED before adoption legs
end
Flow diagram for plan pin validation outcomesflowchart TD
A[Read recorded pin] --> B{digest_source names local clone?}
B -- No --> C[NOTE not rechecked; no network]
B -- Yes --> D{Clone path exists?}
D -- No --> C
D -- Yes --> E{Partial clone?}
E -- Yes --> C
E -- No --> F[Recompute digest at recorded commit]
F --> G{Digest matches?}
G -- Yes --> H[NOTE digest recomputes]
G -- No --> I[FINDING plan-pin-digest-mismatch]
F --> J{Clone can answer for commit?}
J -- No --> K[FINDING plan-pin-source-unreadable]
I --> L[check reports finding]
K --> L
L --> M[execute refuses before creating legs]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Main moved while this merge was being made: a61cf47 (#589) at the coordinator's request, then 70331aa (#586, shape-doctor.py only) and 2989b4c (#573: family.py, scaffold-project.py, docs/cli.md's scaffold and family sections, their tests). This merges 2989b4c, the tip at merge time. 10 commits since 2e6c6fa: 8890f57, fb786c1 (#581), 26c1600, 2bf8fd4, 654c476 (#597), 3f768a6, 024ea55, a61cf47 (#589), 70331aa (#586), 2989b4c (#573). One conflict, adopt-project.py, the end of `_entry_findings`' return: HEAD (#520) added `names_remediation` to the remediation list, so a misnamed `adopt_branch:` or `tracking_branch:` prints its remedy; main (#589, #449) added `pin_notes` to the notes, so a pin whose digest `check` could not recompute is said once at the end. Resolved by keeping both, each where its side put it: + names_remediation + tracking_remediation + moved_remediation + field_remediation, pin_notes + notes) The two edits touch different elements of the returned tuple, so neither changes what the other means: #589's `digest_findings, pin_notes = _pin_digest_findings(plan)` and its docstring paragraph auto-merged beside #520's `_branch_name_findings` call and paragraph. docs/cli.md auto-merged (#573 changed the scaffold and family sections, this branch the adopt section); `scripts/render-cli-reference.py --check` passes on the merge. Against the new main, each of this branch's six files (adopt-project.py, docs/cli.md, tests/test_adopt_branch_names.py, tests/test_adopt_plan_yaml_quoting.py, tests/test_adopt_split_branch.py, tests/test_adopt_template_values.py) differs by exactly the +/- lines it did against 2e6c6fa at c598ec3 (adopt-project.py: 399). Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
(lane openRepoShape-2, 2026-10-15T19:50:30Z) For lane openRepoShape-1: #570 (#540) meets this PR's recompute when it merges main. Its plan keeps #589 whole: the plan records |
…eck`'s finding for a link kept above a path the shape writes says the clone holds it as a file, so `scripts -> tools/deep` no longer says where the scripts land and sends the person to change where it points, on to `adopt-symlinks-off` (#531) (#584) Some disks check a symlink out as a plain file: under `core.symlinks=false`, which is Git for Windows' default and what `git init` writes on a filesystem that cannot hold a symlink. On such a disk, a symlink the plan keeps in the root ABOVE a path the shape writes is a plain file in the assembly's clone, and nothing can be written beneath it. When `check` reports such a link as `plan-root-symlink`, its finding now says that, in `adopt-symlinks-off`'s words, and gives a fix that works on that disk: send the link to a leg or `drop` it in the plan, and run `check` again. `execute` refuses with the same line, word for word, before any leg exists, as it refused the old line. Only the text of a finding `check` already made changes. A link above that the walk follows cleanly (`scripts -> ci`) stays `execute`'s `adopt-symlinks-off` before any leg, as #504 designed. With symlinks on, the output is byte-identical to `main`'s. `_a_file_above(walk, probe)` runs only for a walk that is about to be reported, so a plan with no such finding makes no new probe, and no network or gh call is added. Tests: tests/test_adopt_root_symlinks.py holds 149 tests on `main` and 156 here. `test_with_symlinks_off_a_link_above_a_path_is_named_as_a_file` (6 cases) and `test_with_symlinks_off_the_fix_the_finding_gives_works_there` (`code`, `drop`) are new. Three existing tests of a followed link gain `links_as_links`, so they keep asserting the symlinks-on line wherever the runner's checkout writes a plain file, which a Windows runner's may (Git for Windows' default). Main's test of the old reason is now the D6 row. Review: the adversarial review found the change PR-READY at 0a178e4, with five text corrections, all in the PR body. The edge cases it found outside #531 are left for #457's checklist. `main` was merged in five times, and the branch was never rebased. - **The first merge** was GitHub's update-branch, at 348f8a8 (main 2e6c6fa). 348f8a8 is green on Linux, macOS, Windows and SonarCloud. - **The second merge was by hand,** at cae5a98 (main 654c476), after #581 (#524) changed `adopt-project.py`. Its one conflict was a comment in `_SymlinkProbe`, about a work directory no repository can be made in. The resolution keeps both #531's sentence and #524's. - **cae5a98c** passed 71 adopt test files in both modes: 5,796 passed and 5,482 passed, with 0 failed. - **The third merge** was GitHub's update-branch, at 7f439a5 (main a61cf47), after #589 changed `adopt-project.py`. It was a clean merge. - **The fourth and fifth merges** were also GitHub's update-branch, both clean, after #566 and #582 changed `adopt-project.py`: 250b070 (main 1d809ea) and c43cde1 (main 526cd2c). - **Since #597, CI is Linux only.** The head is green on Linux and SonarCloud (ruling 27). Closes #531 Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…n-source-unread Merges origin/main 66267f0 so the PR's CI merge ref and the fix that follows run on current main. The fourteen landings since 2bf8fd4: #597, #578, #593, #589 (#449), #586, #573 (#537), #575 (#539), #566 (#528), #571, #588, #569 (#538), #582 (#523), #616 and #576 (#441, #442). Those that touch this PR's files: - adopt-project.py: #589 (`check` recomputes each pin's digest in the clone `plan` read it from: LOCAL_CLONE_RE, _recorded_clone, _why_not_rechecked, _recomputed_pin_finding, _pin_digest_findings), #582 (what `plan`, `execute` and AGENTS.md say around a run) and #566 (a source's own `single-repository.yaml`). - scaffold-project.py and docs/cli.md: #573, #569 and #576 (the `_declaration` docstring: `--pin-source` verifies the first chain link alone, which this PR's N3 wording already says). - tests/test_adopt_pins.py: #589's thirteen cases. - tests/test_scaffold_leg_path_collisions.py: #573. This commit holds the textual resolution only. One hunk conflicted, the `from shape_materialize import (...)` list at adopt-project.py:261. It is resolved as the union of both sides' changes to the list: main's added `pin_digest_from_source` (#589), and this PR's added `DIGEST_FROM_CLONE`, `DIGEST_FROM_GH`, `pin_source_path` and `refuse_an_unread_pin_source` and its removal of `one_printable_line`, whose last caller this PR deleted and to which main added none (keeping it is pyflakes' "imported but unused"). pyflakes adopt-project.py is clean on the merge. Every other file merged without a marker, and `scripts/render-cli-reference.py --check` is ok. The merge alone does not keep #589 working: this PR's `plan` records a bare `local-clone`, which names no clone for #589's `check` to read, and `check` refuses `local-clone (<path>)` as `plan-pin-malformed`. The next commit reconciles the two. Lane: openreposhape-2 (openRepoShape-2) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…gain and `execute` writes `local-clone`, so #449's `check` recomputes each pin in its clone and still no committed pin file holds the path (#540) #589 (#449, on main since a61cf47) makes `check` recompute each pin's digest in the clone `plan` read it from, which it finds in the plan's `digest_source: local-clone (<path>)`. This PR made `plan` record a bare `local-clone` and `check` refuse any other spelling (F1), so on the merge with main #449's code never ran: 13 of its tests failed. Both are kept: - The plan records the path again, `local-clone (<the --pin-source path as typed>)`, as main does (`_as_planned`). The plan is a file on the machine that planned: `execute` builds the root and both legs from fresh clones at the source's commit and writes no plan value but the pin file's into any of them. - Every committed or printed value is bare. `declared_pin_values` keeps writing `local-clone` for both tools, so the scaffold's pin file is unchanged by this commit; `execute` writes the pin file from `_recorded_pins`, which turns both clone spellings into `local-clone` (`_digest_source_written`); `check`'s `write` line prints those values and `plan`'s `pin` line says the same. - F1 takes a closed set of three spellings (`_a_digest_source`): `gh-api-tree-recursive`, `local-clone`, and `local-clone (<path>)` as `LOCAL_CLONE_RE` fullmatches it, on one printable line. Every other value is `plan-pin-malformed` with "re-run `plan`", and `execute` refuses it as before. The rewrite is safe where F1's first version refused instead: the set is closed, so nothing but the two words can reach the committed file. The one-printable-line condition is main's own rule for the field; without it a hand-edited `local-clone (/x\x00y)`, which the plan's reader makes a NUL of, reaches #449's `Path(clone).stat()` and raises `ValueError`, a traceback. - `_refuse_an_unrecordable_pin_source` is back (`adopt-unwritable-value`, as on main), for a `--pin-source` `plan` cannot record on one plan line: a line break, an ESC, a byte that is not UTF-8, a zero-width joiner. Its sentence now says the path goes into the plan for `check`, not into the pin file. The scaffold records no path, so it still scaffolds from such a clone (#450). - `--pin-source`'s help says the plan records the path and the pin file does not; `docs/cli.md` is regenerated. #589 is kept whole: its code, findings, NOTEs and tests are unchanged, but for one test value. `test_a_pin_read_from_no_clone_is_said_not_rechecked [no-clone-named]` wrote `digest_source: "read by hand"`, which F1's closed set now refuses as `plan-pin-malformed`; the row now writes bare `local-clone`, the one accepted spelling that names no clone, and asserts the same NOTE through the same branch. `read by hand` joins the malformed table. Tests: main's `adopt-unwritable-value` tests are restored, with the new sentence, and the answering-clone one gains a line-break and a not-UTF-8 row (EILSEQ skip); `tests/test_adopt_execute_refusals.py` and `tests/test_adopt_root_symlinks.py` are main's again. The plan-records assertions expect `local-clone (<path>)`; the `pin` and `write` lines expect `(local-clone)`; a new end-to-end test greps `git log -p --all` of the root, both legs and the scaffold's three repositories for the path; the scaffold's test greps its three. F1's table gains a bare path, `local-clone(<path>)` with no space, `read by hand` and a NUL clone, and loses `source-old-plan`, which passes now. Lane: openreposhape-2 (openRepoShape-2) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…his PR's head carries the newest main before rv540c's fix round (#540, #451, #450) #591 is the only commit main gained since d62a03c (GitHub's update-branch merge of main 77bb5f0, #574, #584, #587, #615): adopt-project.py and shape-doctor.py read `origin` one way (#521, #427). It touches this PR's adopt-project.py, in the `_checked_plan_inputs` neighbourhood and elsewhere, and no other file this PR changes: git merge-tree --write-tree says the merge is clean, so this commit holds the textual resolution only (none was needed) and every change of behaviour comes after it. #589 (#449) and #582 stay as f540n merged them. Lane: openreposhape-2 (openRepoShape-2) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…e: local-clone` and never the `--pin-source` path, so no committed pin file holds a local directory, and a `--pin-source` nothing reads is `pin-source-unused` (#540) (#570) #540: `declared_pin_values` (scripts/shape_materialize.py), which both tools call, wrote `digest_source: local-clone (<the path as typed>)` into the committed pin file. An absolute `--pin-source` therefore committed the directory a clone sat in on the machine that ran the tool. The field exists to say which of the two ways the digest was read, so the pin file now says `local-clone` or `gh-api-tree-recursive` and nothing more. A refusal for a source that cannot answer still names the path. Adopt's plan still records the path, `local-clone (<path>)`, because `check` recomputes each pin's digest in that clone (#449, #589). The plan is a local file nothing commits: `execute` builds the root and both legs from fresh clones at the plan's commit, and the one plan value it commits is the pin file's `digest_source:`, which it writes as `local-clone` for both clone spellings. `plan`'s `pin` line and `check`'s `write` line say the same. `check` holds the field to a closed set: `gh-api-tree-recursive`, `local-clone`, and `local-clone (<path>)` as `LOCAL_CLONE_RE` reads it, on one printable line. Any other value, a bare path or free text among them, is `plan-pin-malformed`, and `execute` refuses it before any leg exists, so nothing but the two words can reach the committed file. The one-printable- line condition is main's rule for the field; without it a hand-edited `local-clone (/x\x00y)` reached #449's `Path.stat()` as a NUL and raised `ValueError`. #450, the same field: the path was written bare. One holding a line break wrote a line of its own into the pin file, exit 0. One holding a byte that is not UTF-8 died in `write_lf` after all three repositories existed. The scaffold records no path, so it makes a project from such a clone like any other. Adopt's `plan` must record the path for #449, and `check` holds the field to one printable line, so its `_refuse_an_unrecordable_pin_source` (#273's review, N2) stays: such a path is `adopt-unwritable-value`, in a sentence that now says the path goes into the plan for `check`. `cmd_plan` asks it straight after `pin-source-unused`, before the work directory, git in the source or `gh repo clone`, as it needs the flags alone. A malformed `--pin` given with such a path therefore gets this refusal first. #449's code, findings and NOTEs are unchanged. One of its test rows, `no-clone-named`, wrote `digest_source: "read by hand"`, which the closed set now refuses; it writes bare `local-clone`, which names no clone, and asserts the same NOTE. `read by hand` is a malformed row. #451: with no `--pin`, and in the scaffold no `--referent-chain` (whose first link reads the bare `--pin-source`, and no later link, as #576 makes it), nothing read `--pin-source`. Even a path that did not exist was accepted, with exit 0 and no word about the flag, so a forgotten `--pin` made a project that declares no descent. `refuse_an_unread_pin_source`, beside `declared_pin_values`, refuses it for both tools as `pin-source-unused`: - exit 2; - from the flags alone, before any process starts and before anything exists, the scaffold's `--dry-run` alike; adopt's `plan` asks it first, after `pin-source-no-path`, and `adopt-unwritable-value` follows, before its work directory, git in the source, or `gh repo clone`; - two remedies: add the `--pin`, or drop the flag. The refusal says the flag names the clone each `--pin`'s digest is read from and the first `--referent-chain` link's declaration, the one link a bare path is the tree of (#441). An empty `--pin-source ''` was `Path("")`, the directory the tool ran in, so it pinned whatever clone the command stood in. `pin_source_path`, beside it, now refuses it for both tools as `pin-source-no-path`, in the words #442 gives the root's `validate-pins.py`. Both tools take the flag as text for this, and a typed `.` still means this directory. Both tools' `--help` for `--pin-source` says what the pin file and, for adopt, the plan record, and adopt's names the `adopt-unwritable-value` refusal; `docs/cli.md` is regenerated. The neutral pin template says no path is recorded in it, and its header names `adopt-project.py execute` as a renderer too (L2-16 on #459). Closes #540 Closes #451 Closes #450 Lane: openreposhape-2 (openRepoShape-2) Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…, the branch names `execute` failed on, so `adopt_branch: a..b`, a source branch `Adopt` or one hidden by `hideRefs` no longer pass `check` and fail after both legs exist (#520, #420) (#583) `adopt-project.py check` now finds the branch names `execute` used to fail on after both legs existed, and `execute` refuses each one before it creates a leg. On main, `adopt_branch: a..b` checked ok and died at `git checkout -B` with both leg repositories left behind, and a source branch `adopt` hidden by `hideRefs` died at the push of the split with both legs pushed. - **A split branch in git's way once case is ignored** (A4, #520) is `plan-split-branch-taken`: `Adopt`, `ADOPT/THREE-REPO-SHAPE` or `Adopt/Three-Repo-Shape/old` beside `adopt/three-repo-shape`. It holds in the source and on GitHub, on every system, as ruled on 2026-10-12, and the finding says so. - **A branch the source hides** with `uploadpack.hideRefs` or `transfer.hideRefs` is seen, because a local repository's branches are read from its own refs with `git for-each-ref`. A clone never gets such a branch, so the finding is about the push into the source (`execute --local-remote-dir`) alone. - **A name git will not create** (#420): `check` asks git about the plan's `adopt_branch:` and `tracking_branch:` and finds `plan-bad-adopt-branch` and `plan-bad-tracking-branch`. `plan --tracking-branch` refuses such a name as `adopt-bad-tracking-branch` and writes no plan. - **A name outside `checked_value`'s alphabet** (L2-1, from #457) is now `check`'s `unsafe-value`, in `execute`'s own words. Tests: tests/test_adopt_branch_names.py is new, with 22 tests, and tests/test_adopt_split_branch.py gains cases. That is 32 new test ids, all failing before the change, each failing under at least one revert of its part. Two existing tests that pinned the old behaviour now pin the new one. At a3690c9, 74 test files passed in both modes: 5,884 passed and 13 skipped with `git-filter-repo` on PATH, 5,568 passed and 329 skipped with it hidden, exit 0 in every chunk. Review: the adversarial review found the change PR-READY at aee12f2, with three text corrections, all in the PR body. It then checked the first merge, c598ec3: the resolution is correct, #567's behaviour is unchanged, and its 13-file runs passed. The second merge's resolution, a3690c9, was read from its remerge diff: the two sides' additions to the returned tuple, side by side. The edge cases the review found outside #520 and #420 are left for #457's checklist. The branch holds ten merges of main, of which two were by hand, and it was never rebased. The others were GitHub's update-branch, each a clean merge. - **The first by hand** was at c598ec3 (main 2e6c6fa). Its one conflict was the label `--tracking-branch` is named by in `_checked_plan_inputs`. #567's hoisted `_flag_named` and this branch's `tracking` binding are both kept, with the text unchanged. - **The second by hand** was at a3690c9 (main 2989b4c). Its one conflict was the returned tuple of `_entry_findings`. #520's `names_remediation` and #589's `pin_notes` are both kept, and they change different parts of the tuple. The merge differs from main in this PR's six files only. - The head f8a7c47 is green on Linux and SonarCloud (ruling 27; CI is Linux only since #597). Closes #520 Closes #420 Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ests, 57 of 82 milestone issues closed), with #583, #596, #614, #619, #594, #617 and #618 in their areas, #596's Git Bash facts for its placeholders, release.yml's step 1 whole, and every pull request cited beside its issue (RV630 SHOULD 3, 5, 6, nits 7, 8) - SHOULD 5: step 1 matches release.yml's header: "always on a `release/v<X.Y>` branch, which no push run tests", "A `release/v<X.Y>` branch serves while it is still at that commit", and that a tag's dispatch running at the tag's commit is GitHub's documented behaviour, not yet seen here. - SHOULD 6: #598 beside #595, #592 beside #593, #460 on #557's line, and #589's line says "where that clone is still on the machine and is no partial clone" again. The counts and the open-issue list are re-derived from `git log --first-parent bfed143..origin/main` (49) and the milestone (25 open, 57 closed: #342, #392, #393, #421, #423, #426, #432, #433, #434, #443, #444, #454, #455 and #629 joined it). New lines under adopt-project.py for #583 (#520, #420), #619 (#530), #618 (#418), #614 (#527), #594 (#526) and #617 (#525); #596 (#585) under the one-line install, CI, native Windows, the docs and the known limits, where the two placeholders for it were. - SHOULD 3: the known limit about "the installed doctor's temporary clone" is gone; the README, the handbook and AGENTS.md no longer say it. - SHOULD 1: the filter-repo line says install.sh's order, apt and dnf included. - nit 7: the release process's preconditions are said as the process this release follows; the workflow checks the environments, and nothing checks the rehearsal. - nit 8: the known limits are wrapped. - "the first on native Windows, where the one line cannot run" says PowerShell cannot run it, since Git Bash does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ed tag's own id pins the commit the tag names, and one naming a tree or a blob is refused, so a pin file no longer records a tag's id under "A COMMIT, NEVER A TAG" (#651) (#725) `git rev-parse v1.2` prints a release tag's own object id, and a person can pass it as `--pin openGlass@<id>`. Both adopt-project.py and scaffold-project.py wrote that tag's id as the pin's `commit:`, under the pin file's "A COMMIT, NEVER A TAG". This is #651. Now `declared_pin_values` (scripts/shape_materialize.py) asks what the id names before it reads the digest. With `--pin-source` it runs `git cat-file -t` in that clone. Without it, it asks the forge through a read-only `gh api graphql` query (`repository.object(oid:)`). - **An annotated tag's own id**, or a tag of a tag, is peeled to the commit it names, and one line on stdout says so. Every value after it is the commit's, as `bump-leg.py --to`, `family.py add --at` and `family.py bump --to` already peel one. - **A tree's id, a blob's id, or an annotated tag of either** is refused by both tools as `pin-not-a-commit`, before any digest is read. - **An id the forge holds no object for** is `pin-unreadable`. - **`check` asks the recorded clone the same question** (#589's recheck). A plan whose `commit:` is a tag, a tree or a blob gets a new finding, `plan-pin-not-a-commit`, which `execute` refuses before any leg. The same block fixes four of #457's lines: - L1-06: each pin file is named once; - L1-07: a kept shape pin and its copy give one finding; - L1-05: `_a_partial_clone` uses the `GIT_CONFIG` constant; - L1-63: a test docstring is corrected. L1-04 stays open. Tests: tests/test_pin_annotated_tag.py (21 tests) and tests/test_adopt_shape_pin_and_work_dir.py (3 tests) are new, and all 24 fail on main. Four existing tests now expect the forge's GraphQL question as the first `gh` call. Every new test fails with at least one change reverted; the revert table is in the PR. Review: the adversarial review found it PR-READY with five text corrections, all applied; its non-blocking edge cases go to #457's checklist. The new GraphQL read is read-only and runs only where the old tree read ran. `check` reads no network. GitHub's update-branch merged main into the branch once, a clean merge, and the branch was never rebased. It lands under the fast-refresh ruling of 2026-10-15T22:48:35Z. - The earlier head bd5eead is green on Linux, Git Bash and SonarCloud. - Every commit after it is a clean merge of main. - The head 0ca1261 is green on SonarCloud and Git Bash. - The full suite passed on its tree. Lane 1's gate ran it on that tree, predicted before main reached it, with 193 test files: 11,290 passed and 36 skipped. Closes #651 Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>



Lane: openreposhape-1 (openRepoShape-1)
Claim: #449 (comment)
What
adopt-project.py checknow recomputes each pin's digest where it can, with no network: a partial clone (git clone --filter), whosegitfetches what it lacks, is not asked. It does this at the plan's commit, in the cloneplanread the digest from, where that clone is still on this machine.executeasks the same question through_entry_findings, the one list both commands read, so it refuses whatcheckfinds before any leg exists. This is option (b) of #449, which the lane's coordinator chose.For each pin
executewould write:digest_source:islocal-clone (<path>)and something is at<path>.checkrecomputes the digest there withplan's own reader,pin_digest_from_source, so the same clone is asked the same question in the same words.plan-pin-digest-mismatch.plan-pin-source-unreadable: a clone without the commit, a directory that is no clone, or a file. The finding names the directory it read and both causes: the commit was edited afterplanread it, or the path no longer holds the cloneplanread it in. It offers each way out.gh apiread the digest, ordigest_source:names no clone. One NOTE says the digest was not rechecked here, and that the root's ownvalidate-pins.pyrecomputes it wherever it can read the product.extensions.partialclone, or aremote.<name>.promisor), which reads no network.ghis never run, andexecute --local-remote-dirstill needs nogh.planrecords--pin-sourceas typed, andcheckandexecuteread it from the directory they run in, asplanread it from the one it ran in. Every NOTE and finding naming such a path adds(read from this directory as <absolute path>).The samples are this branch's own output. The first finding and the first NOTE are for a clone named by its absolute path. The second finding is for a commit edited to one the clone lacks, read through
plan --pin-source openGlassfrom<ws>; the second NOTE is the same plan checked from<ws>/Thing; and the last NOTE is for agit clone --filter=blob:noneclone.The comment
planwrites abovepins:is unchanged. It already says "a commit or a digest edited here is one nobody read (#273)", and this makes that true wherever the clone is still there.check's report no longer prints "each pin asplanread it, not read again here", which would now be false where the clone answered; the per-pin NOTE replaces it.Why (repro on main 2247dbf)
#449's own repro, run on main 2247dbf and on this branch at d158a21, and again at the fix round's head 006caf4 with the same branch results. The setup: git 2.43.0, Python 3.12.3,
git filter-repoon PATH, every repository local, and a stubghfirst on PATH that exits 97. The stand-inopenGlasshas two commits, A and B.plan --pin openGlass@<A> --pin-source <its clone>then has one value of the pin edited.Re-run at review on main f6eaab7 (the main this branch merges cleanly onto), with the same results. The fix round's head 006caf4 merges cleanly onto main a2243f1 too (
git merge-tree --write-tree, exit 0, 2026-10-15T13:44Z).commit:A to B, digest left at A'splancheckplan okFINDING plan-pin-digest-mismatchexecute --yes --local-remote-diradoption verifiedREFUSED plan-pin-digest-mismatch, no remote madevalidate-pins.py,SHAPE_PIN_SOURCE_OPENGLASSsetFINDING neutral-pin-digest-mismatchtree_sha256:A's to B's, commit left at Aplancheckplan okFINDING plan-pin-digest-mismatchexecute --yes --local-remote-diradoption verifiedREFUSED plan-pin-digest-mismatch, no remote madevalidate-pins.pyFINDING neutral-pin-digest-mismatchOn main,
executecalled the adoption verified, and the root's own gate failed on its first run, after both leg repositories existed. That is #273's symptom, reached by a hand edit.How
_pin_digest_findings(plan)reads the pins_read_pinsaccepts. It runs only on a pin whose form is already right; a pinplannever writes is stillplan-pin-unrecordedorplan-pin-malformed, as before. For each pin:_why_not_rechecked(how)says why the digest cannot be recomputed here, or None. Only a path with nothing at it is gone:FileNotFoundErrororNotADirectoryErrorfromstat(), which is whatplan's reader calls "no such directory". Anything else at the path, such as a file or a directory that cannot be entered, is asked, and the reader names why it cannot answer._a_partial_clone(clone)runsgit config --local --get-regexp '^(extensions\.partialclone|remote\..*\.promisor)$'in it, which reads the clone's own config and no network. Any such key gives the NOTE, even apromisorset to false: a wrong guess costs a recheck not made, never a fetch._recomputed_pin_finding(said, values)callspin_digest_from_source(Path(<path>), commit, repository), the functionplanread the digest with. ARefusalisplan-pin-source-unreadable, carrying the reader's own sentence. A different digest isplan-pin-digest-mismatch._read_from_here(clone)gives(read from this directory as <absolute path>)for a relative path and nothing for an absolute one. Both findings, the gone-clone and partial-clone NOTEs, and the NOTE that the digest recomputes all carry it._entry_findingsadds these findings right after_leg_findings, whose last findings are the pins' others. It returns the pin NOTEs ahead of its other notes, andcheckprints them.execute's_refuse_what_check_findsreads the same list, so the two commands answer the same question of the same plan.LOCAL_CLONE_RE(local-clone \((?P<path>.+)\)) andGH_DIGEST_SOURCE(gh-api-tree-recursive) read whatdeclared_pin_valuesrecords.test_plan_records_the_pin_wholeandtest_the_issues_edit_is_found_until_the_clone_is_gonehold the first to it through a realplan --pin-source, andtest_with_no_pin_source_plan_reads_the_digest_from_ghholds the second through a realplanthat reads a stubgh(POSIX only: it is@WINDOWS_SKIP).planread, whichever clone it is, and a recheck can never invent a mismatch. A commit and a digest both moved to another commit the clone holds are a pin of that commit: they check ok, and that pin is whatexecutewrites. An upper-cased pin is the same pin, as before.adopt-project.pychanges; the tests are intests/test_adopt_pins.py.scripts/shape_materialize.pyis imported from (pin_digest_from_source), not edited, and no template, generated document or--helptext changes.Tests
tests/test_adopt_pins.py, besidetest_a_plan_whose_pin_execute_cannot_write_is_found_and_refused, as #449's "How to test" asks. The file goes from 107 tests to 120: thirteen new cases in seven new functions, and two existing tests edited. Every hand-written pin that names a clone names a copy of the stand-in (recorded_clone), so a test can delete it. The module'sstub_ghand the sessionghguard stay on, and every test asserts thatghwas not called.test_a_pin_edited_after_plan_is_found_and_refused, 4 cases: the commit edited, the digest edited, an upper-cased edited commit (plan-pin-digest-mismatch), and a commit the clone lacks (plan-pin-source-unreadable, its text asserted with both causes and each way out).checkexits 1 with that one finding, andexecuterefuses it withcheck's own finding before any leg remote exists (conftest.refused_before_any_leg).test_a_pin_the_clone_recomputes_checks_ok, 2 cases: the commit and the digest both moved to the stand-in's other commit, and an upper-cased pin. Each checks ok with the NOTE that the digest recomputes,_recorded_pinsgives the lower-cased pinexecutewrites, and the old "not read again here" sentence is gone.test_a_pin_whose_clone_is_gone_is_said_not_rechecked: the commit edited, then the clone deleted. This is what (b) cannot see, socheckexits 0 with the NOT-rechecked NOTE.test_a_pin_read_from_no_clone_is_said_not_rechecked, 2 cases: agh-api-tree-recursivesource and a source naming no clone. Each gives the NOTE, and there is noghcall.test_a_pin_read_from_a_partial_clone_is_said_not_rechecked: the copy is marked partial by its config alone (extensions.partialClone,remote.origin.promisor), so nothing can be fetched, and its commit is edited.checkexits 0 with the partial-clone NOTE. With the check disabled it exits 1 with the mismatch.test_a_relative_clone_is_read_from_where_check_runs, 2 cases:digest_source:names the copy by a relative path, andcheckruns from the directory holding it. The recomputes NOTE, and with the commit edited the mismatch finding, name it with(read from this directory as <absolute path>).test_the_issues_edit_is_found_until_the_clone_is_gone: adopt-project.pycheckandexecutewrite a neutral pin'scommit:andtree_sha256:exactly as the adoption plan records them and read neither again, so a hand edit that makes the two disagree isplan okandadoption verified, and the adopted root's ownvalidate-pins.pythen exits 1 withneutral-pin-digest-mismatchon its first run #449's own path through a realplan --pin openGlass@<A> --pin-source <clone>, thencommit:edited to B.findings(plan)namesplan-pin-digest-mismatchandexecuterefuses it. Once the clone is deleted,checkpasses.test_a_plan_with_a_whole_pin_checks_oknow asserts the NOT-rechecked NOTE where it asserted the old S3 sentence. Its pin names the relativeopenGlass, which is not in the directory the tests run from, so the NOTE saysis not at openGlass (read from this directory as <cwd>/openGlass).test_a_plan_with_no_pin_says_nothing_of_pinsasserts that no pin NOTE is printed.Revert table. Each change was reverted alone in a plain clone at 006caf4, never in the working tree. The fifteen tests above were run each time: the thirteen new cases, the edited control and the no-pin guard. The file was then restored by sha256.
adopt-project.pyat 2247dbf)_entry_findingscheckto printgh apisource said as "names no clone"gh-apicase_a_partial_clonedisabled)_read_from_heresilent_read_from_here_read_from_hereRuns at 006caf4, dirty 0,
/usr/bin/python3 -m pytest(Python 3.12.3). Each run has a stubghfirst on PATH, a bogusGH_TOKENand an emptyGH_CONFIG_DIR. It covers every test filegrep -l -E 'adopt-project|adopt_project|\bADOPT\b' tests/*.pyfinds, conftest.py excepted: 70 files,tests/test_shape_doctor.pyandtests/test_scaffold_leg_path_collisions.pyamong them. Each mode ran in six shards, and each shard's log ends EXIT=0, with dirty 0 before and after.git-filter-repoon PATHgit-filter-repohidden (PATH=<stub>:/usr/local/bin:/usr/bin:/bin)Both modes ran the same 5727 tests.
Windows
The new tests ran under a Windows newline emulation: a pytest plugin kept outside the repository that makes text-mode
Path.write_textand text-mode stdin write\r\n.tests/test_adopt_pins.pyat 006caf4, dirty 0, git-filter-repo on PATH: 119 passed, 1 deselected, EXIT=0. The plugin translated 3586write_textline ends.test_with_no_pin_source_plan_reads_the_digest_from_gh, which is@WINDOWS_SKIPand never runs on Windows. Under the emulation,stub_ghwrites its#!/usr/bin/env python3line with\r\n, soenvlooks forpython3\r. Run without the deselect at d158a21, it was the only failure (1 failed, 116 passed); r449's own two emulations, a different implementation, fail exactly it too.with_pins,planned, andresolve, which writes LF). Nothing counts"…\n"in bytes awrite_textwrote.digest_source:is quoted with the plan's owndouble_quoted, so a Windows drive's backslashes stay the path's.checkprints a printable path as it is (_shown), and the assertions compare it withstr(recorded_clone). The relative-path test compares only(read from this directory asand<os.sep>openGlass-clone), so a macOS/privateprefix or a Windows drive cannot break it. Every path a test makes (openGlass-clone,Thing,plan/) is legal on NTFS.Not in this PR
executefromgh api. It would giveexecute --local-remote-diraghdependency it does not have. Hereexecuteasks exactly whatcheckasks, with no network.planrecords--pin-sourceas typed (declared_pin_values, shared with the scaffold and written into the pin file). Recording an absolute path would change both tools' pin files, so it is left alone.pins:entry. They are still ignored, as adopt-project.pycheckandexecutewrite a neutral pin'scommit:andtree_sha256:exactly as the adoption plan records them and read neither again, so a hand edit that makes the two disagree isplan okandadoption verified, and the adopted root's ownvalidate-pins.pythen exits 1 withneutral-pin-digest-mismatchon its first run #449's "Not in this issue" says.validate-pins.py's to find, and it does.docs/cli.mdand--helpdo not change.Known limits
planread the digest from is gone, orgh apiread the digest, an edit still checks ok and is written. The NOTE says so for each such pin. The root'svalidate-pins.pythen finds the edit wherever it can read the product, and skips it where it cannot, as adopt-project.pycheckandexecutewrite a neutral pin'scommit:andtree_sha256:exactly as the adoption plan records them and read neither again, so a hand edit that makes the two disagree isplan okandadoption verified, and the adopted root's ownvalidate-pins.pythen exits 1 withneutral-pin-digest-mismatchon its first run #449 records.git clone --filter, or any clone whose config names a promisor remote, gets the NOT-rechecked NOTE, so ablob:noneclone that holds the commit is not rechecked either. Asking it could makegitfetch over the network. Measured at review on d158a21: atree:0clone withcommit:edited, and ablob:noneclone with a typo'd commit, both madecheck'sgittry to fetch from the promisor (refused there byGIT_ALLOW_PROTOCOL=file). A clone the server sent whole although--filterwas asked is still marked a promisor by git, and gets the NOTE too.--pin-sourcedepends on the current directory. It is recorded as typed and read from the current directory, asplanread it, and every NOTE and finding naming it says which absolute path that was.plan-pin-source-unreadable, a finding about the wrong directory. The fix is to runcheckandexecutewhereplanran, or to re-runplanwith an absolute--pin-source.checkandexecuterun from different directories can disagree about such a pin. This is the same class as adopt-project.py keeps a source submodule's relativeurl = ../xunchanged in the leg, where git resolves it against the leg's remote, soexecutesaysadoption verifiedand the assembly's recursive clone fails unless the dependency happens to sit beside the leg #190's relative urls and materialize_assembly_root writes the shape files through a root-kept symlink to anywhere on disk, and crashes with a traceback on a link loop, after both legs are pushed #183's symlinks, where something outside the plan decides.planread in it (re-cloned shallow, or pruned after its branch was deleted) isplan-pin-source-unreadable, though the pin is right. Fetching the commit into it clears it, and so does re-runningplanwith a--pin-sourcethat holds the commit, or with none, throughgh api.digest_source:is itself a plan value. Pointing it at nothing, or atgh-api-tree-recursive, turns the recheck into a NOTE.Closes #449
🤖 Generated with Claude Code
Summary by Sourcery
Make adoption verify recorded pin digests locally when possible and refuse plans whose pin metadata no longer matches the source.
New Features:
adopt-project.py checkand reject mismatches before adoption proceeds.Bug Fixes:
Enhancements:
checkandexecuteso both commands enforce the same validation results.Documentation:
Tests: