Repository navigation
adopt-project.py: verification passes over the two leg mounts and no other gitlink, so the source's own submodule kept in the root is adopt-root-submodule, any other root gitlink adopt-unexpected-gitlink, one in a leg AND the root adopt-duplicated, and a missing mount adopt-mount-missing (#165) - #173
Conversation
… other gitlink, so a source submodule the root keeps at its commit is counted `root`, one in a leg AND the root is `adopt-duplicated`, and a gitlink nobody asked for or a missing mount is a finding (#165) `_verify` skipped every `160000` entry of the split commit's root tree. The shape adds exactly two, the mounts at `legs.spec_path` and `legs.code_path`, and those are now the only entries passed over: every other root gitlink lands like a blob. A source submodule the root kept at its own commit is counted `root` instead of `adopt-lost`. One the split failed to remove, in a leg and in the root, is `adopt-duplicated` instead of passing. A gitlink that is neither a mount nor the source's own submodule at the SAME commit is the new `adopt-unexpected-gitlink`, and a mount path that holds no gitlink is the new `adopt-mount-missing`. On main the last three printed `adoption verified`, and an unexpected gitlink was not even counted as added. The root `.gitmodules` is still compared byte for byte, and `_land_the_root_tree` says why: #166 makes `root` an illegal answer for a source's `.gitmodules` and for every source gitlink, so the source's own cannot reach the root, and the fresh one `_mount_the_legs` writes is the shape's file, counted as added. `_mount_the_legs`, the plan and check code and contracts/path-classification.yaml are untouched; they are #166's. `_verify` gains `spec_path` and `code_path` parameters, and its one call site in `cmd_execute` passes them. Merge after #166. Without its refusal, a plan that sends `upstream/` to `root` and `.gitmodules` to `code` now verifies, where main reported `adopt-lost` for the wrong reason, and leaves the root a gitlink that nothing registers. Tests: tests/test_adopt_verify.py calls `_verify` directly on hand-made one-commit repositories whose gitlinks are written with `git update-index --cacheinfo`, so it runs without git-filter-repo. It covers the common case, a root-kept submodule, a lost one, a dropped one, a duplicated one, an unexpected gitlink at a new path and at a source path at another commit, and a mount path that is absent, a blob or a directory. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…he same three lines #166 adds, so `_land_the_root_tree` stops spelling `160000` and the merge after #166 leaves one definition and no literal (#165) #166's branch (aaa9099) adds `GITLINK_MODE = "160000"` beside `GITMODULES`, and its review (N5) left the one literal still spelled out, in this branch's root-tree loop, to this branch. The definition here is byte for byte #166's, at the same place, so whichever lands second merges it as an identical change: a trial merge of this branch into aaa9099 is clean, has one definition and no `"160000"` left in adopt-project.py, and passes tests/test_adopt_verify.py, test_adopt_submodules.py and test_adopt_plan.py (94 passed, 1 skipped). A one-line insertion after `_account_for` in `_verify`, where #167 adds its call, also merges clean with both. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ec_path` or `legs.code_path` back to the plan before they call the split this tool's defect, the verification is tested with mounts at `legs/spec` and `impl/code`, and the hand-made splits carry a shape pin so #167's check passes them (#165) The review of d780495 found the one route `execute` takes to `adopt-unexpected-gitlink` and `adopt-mount-missing`: a mount path that the plan spells in a form git canonicalises. `plan --spec-path spec/` writes `spec_path: spec/`, `check` says `plan ok`, and `git submodule add` records the mount at `spec`. Both findings then fire. Both said "no plan answer does that ... report it", which is false there, and which contradicted `_verify`'s closing "fix the plan and re-run". `SPLIT_DEFECT` now says not to merge the split, to look at `legs.spec_path` and `legs.code_path` first and re-spell a non-canonical value, and to report the split only when both values are canonical. The findings name the mount paths "as the plan spells them". The closing paragraph keeps its exit, "unless a finding above names another exit". Refusing a non-canonical value in the plan code is left to a follow-up. Tests: the `verify` fixture now takes the plan's mount paths. The new cases are: - mounts at `legs/spec` and `impl/code` pass; - the spec leg's gitlink at `spec`, while the plan says `spec/` or `legs/spec`, gives exactly the two findings and the closing line; - plan, check and execute with `--spec-path legs/spec --code-path impl/code` verify, with the split's gitlinks at exactly those paths. This one needs git-filter-repo. A `_verify` that hard-codes `spec` and `code`, or a `cmd_execute` that passes them, now fails. The hand-made split commits carry a minimal `contracts/shape-pin.yaml`: with #167 merged, its check reads the pin out of the split commit, and without one it failed all ten earlier cases with `adopt-shape-file-missing`. `_verify` builds its mount map from `EXTRACTED_LEGS` instead of adding `"spec"` and `"code"` literals. Merge order: #166, then #168, then this. #166 refuses a plan that answers `root` for a source submodule. It does not refuse a plan that leaves the submodule in no entry at all. `check` reports that plan as `plan-uncovered`, but until #168 `execute` runs it anyway, and the uncovered gitlink stays in the root at its own commit. Main then fails with a false `adopt-lost`. This branch instead counts the gitlink as `root` and says `adoption verified`, over a root whose `.gitmodules` does not register it, so a recursive clone leaves it empty. #168 makes `execute` refuse every finding `check` reports, before any leg exists. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
(lane openRepoShape-1, 2026-10-09T02:12:38Z) |
|
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 17 hours and 50 minutes by commenting |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Reviewer's GuideVerification now skips only the two plan-specified leg gitlinks, accounts for every other root entry—including retained source submodules—and rejects unexpected gitlinks or missing mounts, with comprehensive direct and end-to-end tests covering the new behavior. Sequence diagram for plan-specified mount verificationsequenceDiagram
participant Execute as cmd_execute
participant Verify as _verify
participant Root as _land_the_root_tree
participant Account as _account_for
Execute->>Verify: _verify(source, assembly, work_root, names, paths_for, split_commit, spec_path, code_path, seeded)
Verify->>Root: _land_the_root_tree(after, root_tree, before, mounts)
Root-->>Verify: root_findings
Verify->>Account: _account_for(before, after, paths_for[drop])
Account-->>Verify: counts, findings
Verify-->>Execute: 1 on findings, otherwise adoption verified
Flow diagram for root-tree verificationflowchart TD
A[Split commit root tree] --> B{Entry is gitlink at plan-specified leg mount?}
B -->|Yes| C[Skip mount gitlink]
B -->|No| D[Land entry as root:oid]
D --> E{Gitlink matches source submodule at same path and commit?}
E -->|Yes| F[Account as root]
E -->|No| G[adopt-unexpected-gitlink]
C --> H{Both leg mounts present?}
F --> H
G --> H
H -->|No| I[adopt-mount-missing]
H -->|Yes| J[_account_for checks source paths]
I --> J
J --> K{Findings?}
K -->|Yes| L[Reject verification]
K -->|No| M[Adoption verified]
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
(lane openRepoShape-2, 2026-10-09T02:24:54Z) Review of this head, 05fa0e0, is on the issue: #165 (comment). Verdict: CHANGES NEEDED on one P2, otherwise MERGEABLE WITH NITS only if this PR merges strictly after #166's branch AND #168 (PR #170). The P2: |
…or a source whose `src/` or `contracts/` holds a submodule, spells every path its question names so a non-UTF-8 or newline name no longer crashes it or empties `--out`, and caps the split it names; `check` reads a key with no value beside no submodule as git does, says where git fails on a `.gitmodules` it cannot read, and why a named entry registers nothing; `execute` refuses with the one list `check` prints (#166) Round 4, from this lane's re-verification of ca5fb3d (S1-S3, N1-N4) and lane openRepoShape-2's passes 4 and 5 (NEW-1, NEW-2, NEW-3, R5-1, R5-2). NEW-1 / S1. `cmd_plan` computed the collision prediction, the follow-ups and the seeding record after `ask_about_submodules` had set the entry holding a submodule to `leg: null`. A submodule under `src/` dropped main's follow-up for a harness there that reads `contracts/`, and called the code leg empty: a SEEDED warning, `seeded_from_template: true`, and an `--allow-empty-leg code` it never needed. One under `contracts/` lost the harness line and the `CONTRACTS_DIR` line. All three are now read from `walk`'s entries, before the question is asked; a source with no submodule plans byte for byte as before. NEW-2 / S2 / R5-1. Every path the question names, the submodules and the entries that replace a directory alike, is `_spelled`: between backticks, a byte that is not UTF-8 as `\xe9`, a newline as `\n`, any other character that is not printable by a backslash, and a backslash or a backtick escaped so the backticks still delimit it. A raw surrogate made `write_lf` raise mid-write and leave `--out` empty; a raw newline read back as a space. The spelled newline, between double quotes, is the YAML entry that covers the file. R5-2. Past SPLIT_ENTRIES_NAMED (8) entries the question no longer names them one by one: "replace it with an entry for each path directly in `src/`, 402 in all", or "in one of `docs/`, `docs/theme/`, other than those directories" when it is nested. That edit is the one `check` passes. S3. A `.gitmodules` whose one defect is a key with no value is fatal to git's submodule reader alone, which git runs only for a gitlink. Beside no submodule it is now read as registering nothing: main adopts and clones such a source, and this branch no longer refuses it. Measuring every shape end to end against main also found where git really fails on a file it cannot read, so `plan-gitmodules-unreadable` now says so: beside a submodule, `git filter-repo`'s `git fast-export` reads the checked-out `.gitmodules` for each gitlink and fails the extraction of either leg, wherever the plan sends the two. That includes both of them dropped, which this branch passed and main and this branch both died on after making both leg remotes; it is refused now. Only a plan that extracts no leg escapes it. Otherwise the finding names the assembly's recursive clone, which fails in a leg that keeps a file with a line git cannot parse (no submodule needed), or a `.gitmodules` that is itself a gitlink. SUBMODULE_REMEDIATION no longer offers dropping such a file beside a submodule as an exit. NEW-3 / N1. `check` and `_refuse_what_check_finds` read one list, `_entry_findings`: coverage, each entry's `leg:` (#169's leg paths among them) and the submodule problems. A plan `check` rejected as uncovered and split was refused by `execute` for the split alone; it is refused for both, in one refusal, with #168's remedy and the submodule one. `_refuse_an_unrunnable_plan` is main's again, so its literal `8` cap is gone with the code that had it. #168's tests pass unchanged. N2. `.gitmodules` is now read into `Registrations`, which also keeps why a path an entry names registers nothing: the entry holding it has no url git reads, its name is one git ignores as suspicious, its path starts with `-`, or another entry's move dropped it. The `plan-submodule-unregistered` detail says that, and "no .gitmodules entry ... registers its path with a url" only when no entry names it. N3. git calls the file read through `--file -` "standard input"; the finding says `.gitmodules`. N4. `_SplitTree` reads `GITLINK_MODE` (`_verify`'s literal is left to #173), and `cat-file` is `GIT_CAT_FILE`, as `config` is `GIT_CONFIG`. Tests: new ones for each of the above (follow-ups and seeding for `src/vendor/dep` and `contracts/vendor/x`; four names no plan line can hold, built through `update-index --index-info` and skipped where git refuses them; a newline entry typed from the question; the capped split, flat and nested; why an entry registers nothing, eight ways; where git fails, six shapes; one refusal for an uncovered and split plan through `cmd_execute`); the unreadable-file matrix now refuses both dropped, and says the extraction; the end-to-end refusal gains that case and the end-to-end acceptance a key with no value beside no submodule. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…links, so the mounted-gitlink check is tested on the main it will land on Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ounts no leg, the source's own submodule at its own commit as `adopt-root-submodule`, so a split that keeps one beside a `.gitmodules` that does not register it no longer says `adoption verified` when a plan check fails to refuse it (#165) `_land_the_root_tree` counted the source's own submodule, kept in the root at its own commit, as a `root` landing and nothing more. Since #166 and #168 no plan `execute` runs can put one there, so the only ways left are a defect or a regression in those refusals, and in both the run said `adoption verified` over an assembly whose fresh `.gitmodules` registers only the two mounts: its recursive clone leaves that directory empty and `git submodule status` exits 128 (lane openRepoShape-2's P2-1 on 05fa0e0). Every gitlink other than the two mounts is now a finding: `adopt-root-submodule` for the source's own at its own commit, `adopt-unexpected-gitlink` for anything else, as before. It is still counted where it is, so a submodule left in a leg and the root is both `adopt-duplicated` and `adopt-root-submodule`. The findings' exit text no longer sends the person to re-spell `legs.spec_path` first: #169, merged in 0448944, refuses a mount path git would record at another spelling before any leg exists, so every one of these findings means the split itself is wrong. #166's docstring and #162's mount comment say the byte comparison of a root-kept `.gitmodules` is deliberate, and name the finding the mount's defence in depth meets, instead of reading as work #165 had still to do. Tests: the root-kept case at test_adopt_verify.py:154 is flipped (it now fails verification), the duplicated case gets both findings, a gitlink over a source blob is `adopt-unexpected-gitlink`, the mount-level defence in depth in test_adopt_submodules.py is shown to fail verification, and two `needs_filter_repo` runs of `execute`: the nested-mount adoption is cloned with `--recurse-submodules` after its work directory is moved away and bootstrapped, and a root-kept plan with `_refuse_what_check_finds` taken away exits 1 on `adopt-root-submodule`. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
(lane openRepoShape-2, 2026-10-11T00:59:47Z) Verdict: MERGEABLE WITH NITS. No ordering constraint is left. 0448944's tree is exactly The prior P2 is CLOSED, by sequencing. #166 (e4decfb, PR #194; P3
Nits
Prior P3s: the #162 mount comment and test label were fixed by #166; the PR body now explains both things the issue asked for and the PR declined. Tests on r173-head: all 8 Merges (
CI at 0448944: tests, tests-macos and tests-windows all SUCCESS; mergeable CLEAN. Report and drivers: |
…unted-gitlinks, so the fail-closed root gitlink check is tested on the main it will land on No conflicts: git merged adopt-project.py, scripts/shape_materialize.py and the three test files #198 touches without a conflicting hunk. #198 edits the plan side (`_leg_findings`, `_entry_findings`, `_refuse_what_check_finds` and the leg-path collision lists); this branch edits the verification side (`_land_the_root_tree`, `_root_gitlink_finding`, the two exit texts) and two comments, so no hunk touches both. Checked by hand for a conflict git cannot see: - `_leg_findings(plan, tree)` keeps `tree` as a required argument, and its one caller, `_entry_findings`, passes the source tree. - `_refuse_what_check_finds` is still the one plan gate in `cmd_execute` before the legs are made, so the fail-closed e2e, which takes that gate away, still reaches `_verify`. - The exit texts of `adopt-unexpected-gitlink`, `adopt-mount-missing` and `adopt-root-submodule` stay true: #198 adds `plan-leg-path-collides` to what `execute` refuses before any leg exists and removes no refusal they name. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…links, so the fail-closed root gitlink check is tested beside the leg-path helpers #201 moved into scripts/shape_materialize.py No conflicts: git merged adopt-project.py, scaffold-project.py, scripts/shape_materialize.py and #201's two test files without a conflicting hunk. #201 moves the leg-path checks out of adopt-project.py into scripts/shape_materialize.py; this branch edits only the verification (`_land_the_root_tree`, `_root_gitlink_finding`, the two exit texts) and two comments, so no hunk touches both. Checked by hand for a conflict git cannot see: - `_leg_findings(plan, tree)` still takes `tree` as a required argument, and `_entry_findings` still passes the source tree. - Every refusal the three gitlink findings name still exists after the move: `plan-bad-leg-path` and `adopt-bad-leg-path`, `plan-submodule-root`, `plan-unresolved`, `plan-uncovered` and `plan-bad-leg`. - The branch's delta over main is the same as before the merge. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…links, so the fail-closed root gitlink check is tested behind the mount guard #200 puts before `git submodule add --force` No conflicts: git merged adopt-project.py without a conflicting hunk and took #200's two test files as they are. #200 edits the mount loop in `_mount_the_legs` (`--force`, and `_refuse_an_unmountable_path` before each add); this branch edits the comment above that loop, the verification (`_land_the_root_tree`, `_root_gitlink_finding`, the two exit texts) and a docstring, so no hunk touches both. Checked by hand for a conflict git cannot see: - `_leg_findings(plan, tree)` still takes `tree` as a required argument, and `_entry_findings` still passes the source tree. - #200's loop comment says a `.gitmodules` the plan kept in the root is one "verification never passes (#165)"; this branch's comment above the loop says how: on that file's bytes (`adopt-lost`) and on every submodule of the source's the root keeps (`adopt-root-submodule`). The two agree, and both are kept. - `_refuse_an_unmountable_path` refuses only a mount path the index holds, one with a file on the way to it, and one git will not add. The fail-closed e2e keeps `upstream/dependency` in the root and mounts at `spec` and `code`, so it still reaches `_verify`: test_adopt_verify.py and the two mount tests in test_adopt_submodules.py pass on this tree, 18 of 18, none skipped. - Every refusal the three gitlink findings name still exists: `plan-bad-leg-path`, `plan-submodule-root`, `plan-unresolved`, `plan-uncovered` and `plan-bad-leg`. - The branch's delta over main is the same as before the merge. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
root, one in a leg AND the root is adopt-duplicated, and a gitlink nobody asked for or a missing mount is a finding (#165)adopt-root-submodule, any other root gitlink adopt-unexpected-gitlink, one in a leg AND the root adopt-duplicated, and a missing mount adopt-mount-missing (#165)
#173 landed on main as 54aa69a: verification passes over the two leg mounts and no other gitlink. The textual merge is clean. The next commit spells its two new findings and updates the assertions this branch's spelling changes. Lane: openreposhape-3 (openRepoShape-3) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-gitlink` spell the gitlink they name, as every other finding does since this branch, so a source submodule path holding a line break or an ESC no longer splits or escapes the verification line (#212) #173 (54aa69a) added two findings to `_land_the_root_tree`, through `_root_gitlink_finding`, that printed the gitlink's path raw. That path is a source or split name, so it now goes through `_spelled`: - `adopt-root-submodule`: the source's own submodule at its own commit, left in the root. - `adopt-unexpected-gitlink`: any other gitlink in the root. The leg mount paths these findings and `adopt-mount-missing` name are left as the plan spells them: a leg path passes `checked_value`'s alphabet, which keeps it printable. Assertions updated to the spelled text, all of them on findings this branch spells: - tests/test_adopt_verify.py: `root_submodule()`, `adopt-lost`, `adopt-duplicated`, both `adopt-unexpected-gitlink` assertions and `plan-submodule-root`. - tests/test_adopt_submodules.py: `adopt-root-submodule` and `adopt-lost` in `test_the_root_that_mount_leaves_never_verifies`. tests/test_adopt_finding_spelling.py gains a case for each of the two findings over the five characters (10 cases), through `_land_the_root_tree`. All 10 fail without the change. Lane: openreposhape-3 (openRepoShape-3) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brings in #173 (#165: verification passes over the two leg mounts and no other gitlink, with `adopt-root-submodule`, `adopt-unexpected-gitlink`, `adopt-duplicated` and `adopt-mount-missing`), which landed after this branch merged a5b09c3. No conflicts: git merged adopt-project.py and tests/test_adopt_submodules.py itself, and tests/test_adopt_verify.py is new. This branch's change set against main is line for line the one it had against a5b09c3. No rebase. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ebreak-names (#199) One hunk conflicted, the `from repo_shape import (...)` list in adopt-project.py: main (#201, 8df21e6) removed `SAFE_ARG_RE`, and this branch added `double_quoted`. Resolved as main's list plus `double_quoted`, nothing else; no `SAFE_ARG_RE` is left in adopt-project.py. Every other file (scaffold-project.py, scripts/shape_materialize.py, the tests) merged without a conflict. Lane: openreposhape-5 (openRepoShape-5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…, #201, #200 and #173 land beside #190, and `_entry_findings` hands `_leg_findings` the tree while still returning #190's NOTEs Main moved from e4decfb to 54aa69a: 20e13f0 (#172 via #198), 8df21e6 (#179 via #201), a5b09c3 (#174 via #200) and 54aa69a (#165 via #173). Five conflict hunks, all in adopt-project.py, each a #190 line beside a main line. Each takes BOTH sides, by lane 2's recipe (resolve_m5b_r190d.py, which asserts each hunk's two sides before it writes anything): 1. Module docstring, `check`: #198's mount-path clause ("neither equal to, around or inside a path the shape writes into the root ..."), then #190's "each relative url naming the same repository from the leg as from the source". 2. The `repo_shape` import list: main's names, which since #201 leave out `SAFE_ARG_RE` (its one user moved to scripts/shape_materialize.py, and #190 adds none), plus #190's `redacted, remote_key, remote_local_path`. 3. `_entry_findings` docstring, first paragraph: #190's "and the NOTEs it prints beside them" with #198's "and the two mount paths". 4. `_entry_findings` docstring, ONE LIST paragraph: #190's "but in the one place a remote decides it" sentence, then #198's paragraph on why `_leg_findings` is handed the tree. 5. `_entry_findings` body: #198's `_leg_findings(plan, tree)` with #190's three-tuple from `_submodule_findings(plan, source, tree, local_remote_dir)`. This branch's `_leg_findings(plan)` alone is a TypeError on every `check` and `execute`, because #198's `tree` has no default; main's two-tuple alone breaks `check`'s three-way unpack and drops #190 from `execute`. #173's verification (only the two leg mounts passed over; `adopt-root-submodule`, `adopt-unexpected-gitlink`, `adopt-mount-missing`) merges with no conflict: #190 does not touch `_verify`, and a relative url it lets through is the source's `.gitmodules` byte for byte. tests/test_adopt_submodules.py merges with no conflict: #173's `MOVED` and its root-tree test beside #190's absolute default url. #190's added and removed lines against 54aa69a are its lines against e4decfb, but for the reflowed docstring lines of hunks 1 and 3. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e-notice One file conflicted, adopt-project.py, in four hunks, all in or at `_verify`. Every one keeps both sides: - `cmd_execute`'s call to `_verify`: main passes the plan's two mount paths, `spec_path` and `code_path`, and this branch passes `urls` and `branch` by keyword. The call now passes both, in that order. - `_verify`'s signature: main added `spec_path` and `code_path` as positional parameters before `seeded`; this branch added `urls` and `branch` as keyword-only. The signature has both: `(..., split_commit, spec_path, code_path, seeded=(), *, urls, branch)`. - `_verify`'s docstring: main's #165 paragraph (only the two mounts are passed over) and this branch's #188 N1 paragraph (a failed verification is the last late failure) are both kept, #165's first, since it says what is checked and #188's says what a failure prints. - `_verify`'s footer: main added `findings += root_findings` and "unless a finding above names another exit", for its findings whose exit is to report the split. This branch flushes stdout first, prints the findings in one write, and follows them with the notice and the split branch's deletion. The footer keeps all of it: the root findings join the list, the flush and the notice follow, and the sentence now reads "fix the plan and re-run, unless a finding above names another exit". The merged diff against main differs from this branch's diff against a5b09c3 in those hunks alone. tests/test_adopt_submodules.py and the new tests/test_adopt_verify.py merged without conflict. The merge breaks main's new direct `_verify` tests: they call it without `urls` and `branch`, which this branch makes required, and one reads the footer's old last sentence. The next commit fixes them. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… `_verify` names in its way out, and read its exit sentence as merged, so the 14 that call it directly no longer fail on this branch with `TypeError: _verify() missing 2 required keyword-only arguments` (#188, #165) #165 (via #173) added tests/test_adopt_verify.py, whose `verify` fixture calls `_verify` positionally with the plan's two mount paths. This branch makes `urls` and `branch` keyword-only and required, because a failed verification names the legs, the work directory and the split branch with the command that deletes it (#188 N1). On the merge, e52f6be, 14 of its 16 tests failed with that TypeError; the two that run `execute` passed, since `cmd_execute` passes both. - The fixture passes `urls`, one per repository as `execute` would have them against GitHub (the assembly's is the source itself), and `branch=SPLIT_BRANCH`. Nothing is pushed to them: `_verify` only names them. - `test_a_spec_gitlink_not_where_the_plan_spells_the_mount_is_two_findings` read main's last sentence, "re-run into a fresh --local-remote-dir or fresh leg repositories, unless a finding above names another exit.", at the end of stderr. As merged, that exit is "fix the plan and re-run, unless a finding above names another exit.", and the notice and the branch deletion follow it. The test now reads that sentence where it stands, right after the count. No code changed. All 16 pass. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…cord-submodule-placement Brings in 20e13f0 (#172 via #198), 8df21e6 (#179 via #201), a5b09c3 (#174 via #200) and 54aa69a (#165 via #173) on top of e4decfb. No rebase. Conflicts, and how each was resolved: - adopt-project.py, the module docstring's `execute` paragraph (textual). #173 ended the VERIFIES sentence with "and that the root's only submodules are the two leg mounts"; #189 added the sentence saying the split's `project.yaml` records each kept submodule's leg under `submodules:`. Kept both: main's clause closes the sentence, #189's sentence follows it. The docstring is not part of docs/cli.md (`render-cli-reference.py --check`: ok). - tests/test_shape_doctor.py, `test_a_submodule_in_the_other_leg_from_its_record_is_misplaced` (semantic; the text merged cleanly). #198 made `_leg_findings(plan, tree)` take `tree` with no default, on purpose (tests/test_adopt_leg_path_collisions.py, `test_leg_findings_takes_no_default_tree`), and this branch's test called it with one argument, so it died with `TypeError: _leg_findings() missing 1 required positional argument: 'tree'`. It now passes `None`, as main's other placement-plan callers do: a placement plan has no source tree. This is P2-1 of lane openRepoShape-2's review of e167d8b. `_leg_findings(plan, tree)` is main's, unchanged. `_commit_the_split` auto-merged with the record's `append` intact. #189's 16 tests (36 items) pass on this merge. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… a refusal names, and the branch `plan-stale` names, as `plan`'s questions spell a path, so a name holding a carriage return, a line feed, U+0085, U+2028 or an ESC no longer overwrites, splits or escapes the line it is printed on (#212) (#223) `plan` already writes every path a question names through `_spelled`. The path goes between backticks. Each character `str.isprintable` refuses is written as a backslash escape (`\r`, `\n`, `\x85`, `\u2028`, `\x1b`), a byte that is not UTF-8 as `\xNN`, and a backslash or a backtick is escaped too, so the backticks still delimit the path. The findings were not given it. On main a5b09c3, `check` printed `FINDING plan-uncovered: Icon<CR> is in the source tree ...` with the raw carriage return, which a terminal turns into an overwrite of the code and the path. A hand-written entry `"README\nX.md"` came out as one finding on two physical lines, the second not starting with `FINDING`. `execute` refused with the same raw lines, "as `check` prints them". Every path a finding or a refusal names now goes through `_spelled`: - `_coverage_findings`: `plan-duplicate-path`, `plan-uncovered`, `plan-covered-twice` and `plan-empty-entry`. The entries that cover a path twice are listed with `_listed` (`` `src/`, `src/app/` ``), where main printed a Python list. - `_leg_findings`: `plan-unresolved` and `plan-bad-leg`. - `_as_entry`, which names the submodule and its entry in `plan-submodule-root`, `plan-submodule-split` and `plan-submodule-unregistered`. - `_kept_collisions`, behind `plan-leg-path-collides` and `plan`'s collision note. It put a source path between backticks by hand and now spells it with `_spelled`. `first_and_more`, which #197 moved to scripts/shape_materialize.py and `scaffold-project.py` also calls, takes an optional `spell` for the path it names, and `_kept_collisions` passes `_spelled`. With no `spell` it writes what it wrote, so the scaffold's collision refusals are byte-identical to main's. - `_refuse_an_unrunnable_plan`: `execute`'s own `plan-unresolved` refusal lists its paths with `_listed`. - `_account_for`: `adopt-duplicated` and `adopt-lost`, the verification `execute` prints after the split. - `_root_gitlink_finding`: `adopt-root-submodule` and `adopt-unexpected-gitlink`, the root-tree gitlink findings #173 added to the same verification. - `_missing_shape_file` and `_SplitTree`: `adopt-shape-file-missing` spells the pinned path, the symlink a lookup met, the target it leads out to, and a path that is not a directory. - `_entry_named`: `adopt-mount-occupied` is the guard #174 put before `git submodule add --force`. It names the index entry it found under the leg mount path, which it used to put between backticks by hand. `_index_entries` now decodes index names with `surrogateescape`, as `Source.tree` does, so a byte that is not UTF-8 is spelled `\xfe`. Decoded with `replace`, `a<0xFE>` and `a<0xFF>` both read `a<U+FFFD>`. `plan-stale`, in `check` and in `execute`'s refusal, also spells the source's branch. git's ref-name rules refuse only ASCII control characters, so a branch named with U+0085 or U+2028 split that line. The leg mount paths that these findings name are left as the plan spells them, because a leg path passes `checked_value`'s alphabet, which keeps it printable. `execute`'s refusal is `_entry_findings`, the same list `check` prints, so both commands change together. One ambiguity is left, as main's `_spelled` already had it. A raw byte 0x80-0xA0 or 0xAD and the character U+0080-U+00A0 or U+00AD are both spelled `\xNN`, which makes 34 pairs. A source holding both `Icon<0x85>` and `Icon<U+0085>` prints the same finding twice. Unchanged: a path or branch with no backslash, backtick or unprintable character is spelled with backticks around it and nothing else. The coverage, leg, submodule, verification and `plan-stale` findings now show those backticks, as questions already did. `adopt-mount-occupied` and the collision findings showed them already. I measured this on the test suite's synthetic source, against main 39ac59c, with the default plan, a `plan-leg-path-collides` plan (`--spec-path .specify`), `--spec-path docs/architecture.md`, and the refused `--code-path Makefile` and `--code-path .github`. In every case, `plan`'s exit code, stdout, stderr and plan file, and `check`'s exit code, stdout and stderr, are byte-identical to main. tests/test_adopt_finding_spelling.py is new. It asks each of these findings over the five characters, with the non-UTF-8 index names and a real branch named with U+0085 and with U+2028. The existing assertions in test_adopt_execute_refusals.py, test_adopt_ignored_shape_files.py, test_adopt_submodules.py and test_adopt_verify.py gain the backticks. So does the one assertion in test_adopt_plan_escapes.py (#199) that pinned the raw `Icon<CR>` in `plan-unresolved`: it expects `` `Icon\r` `` now. Left out: - The `question:` text that `plan-unresolved` repeats is printed as the plan holds it, so a hand-edited question with a line break still splits that line. - `fix/adopt-root-kept-symlinks` adds a `plan-root-symlink` finding that names its paths raw. Whichever of the two PRs lands second should spell them. - A last-line guard in `cmd_check` could escape any character a finding should never hold. - Giving the 34 byte/character pairs above two forms, for example `\u00NN` for a character below U+0100 and `\xNN` for a raw byte, would remove the remaining ambiguity. Lane: openreposhape-3 (openRepoShape-3) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…erification merges with no conflict, and `_entry_findings` still hands `_leg_findings` the tree and ends with the root-symlink findings 54aa69a is #165 (#173): `_verify` passes over the two leg mounts and no other gitlink, so a submodule the source keeps in the root is `adopt-root-submodule`, any other root gitlink `adopt-unexpected-gitlink`, one in a leg AND the root `adopt-duplicated`, and a missing mount `adopt-mount-missing`. Conflicts: none. `git merge-tree --write-tree HEAD origin/main` gave tree 02f87a1 with no conflicted file, and `git merge --no-ff --no-commit` staged the same tree: adopt-project.py, tests/test_adopt_submodules.py and tests/test_adopt_verify.py (new). Checked on the staged merge: - `_entry_findings` still calls `_leg_findings(plan, tree)` (#198's required argument), then appends `_root_symlink_findings(plan, source, tree)` last, after the submodule findings. - tests/test_adopt_root_symlinks.py and tests/test_adopt_verify.py: 74 passed. test_adopt_verify.py switches `_refuse_what_check_finds` off with `lambda *_: None`, so it takes whatever `execute` passes. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d the verification refuses a mount whose gitlink is not the commit pushed to its leg (`adopt-mount-commit`), so an operator's `init.templateDir` holding `modules/spec` and `modules/code` no longer ends `adoption verified` over a split nobody can clone (#243) (#268) `_commit_the_split` cloned the source with a plain `git clone`, which copies the operator's git template (`init.templateDir`, or `GIT_TEMPLATE_DIR`) into the assembly's `.git`. A template holding non-bare stores at `modules/spec` and `modules/code`, as a copy of a working Triad root's `.git` does, left `.git/modules/spec` and `.git/modules/code` there, and the mounts' `git submodule add --force` (#174, #200) reactivated them instead of refusing. Both gitlinks pushed on the split branch were then a stranger's commit, `execute` exited 0 and printed `adoption verified` over them, and `git clone --recurse-submodules` of the pushed branch exited 128. The verification checked that a mount holds a gitlink (#173) and never which commit. Reproduced on 39ac59c: gitlinks `c4a30be1705b` for both mounts, the legs pushed at `130ce8cf62dd` and `2564b5900076`, and `fatal: ... did not contain c4a30be1705b0fa270b35d5de5be8a681d436b92`. Two changes, which are not alternatives: - `_commit_the_split` clones with `--template=`, git's documented way to use none, as the scaffold's `git init` has since #229. The assembly's `.git/modules` is therefore empty when `_mount_the_legs` runs, and `git submodule add --force` has nothing to reactivate. The comment at the clone says why, and the comment in `_mount_the_legs` that argued no `.git/modules/<name>` is in the fresh clone now says what makes that true. - `_verify` calls the new `_mount_commit_findings(tree, mounts, pushed)`, which reads the split tree `_verify` already reads and the `mounts` mapping `_land_the_root_tree` already takes. It reports `adopt-mount-commit` for each mount whose gitlink names any commit but the one pushed to its leg, whatever put the other commit there. `_pushed_commits` is the `HEAD` of each leg's work directory, which `_extract_leg` and `_seed_leg` push and whose tree `_verify` already accounts for. The question is asked of a gitlink only: a mount path that holds none stays `adopt-mount-missing` (#173), said once. The check does not undo the push, as no finding does; only the clone's `--template=` prevents the harm. `_land_the_root_tree` keeps its four-argument signature, since `tests/test_adopt_finding_spelling.py` and `tests/test_adopt_submodules.py` call it with four. The module docstring's `execute` bullet says each mount is at the commit pushed to its leg. The other repositories `execute` makes keep the operator's template, because none is mounted into: the legs' bare remotes, the legs' work trees (the mount's `git submodule add` clones them by path, and a clone copies objects and refs, never a `.git/modules`) and the seeded legs. One behaviour changes besides the cure. With no template the assembly has no `.git/hooks`, so hooks a git template installs (git-secrets and the pre-commit framework's `init-templatedir` both document that setup) no longer run on the split's commit and push, as they did before. Hooks set with `core.hooksPath` still run there, and the legs keep their template's hooks. The comment at the clone says so. Tests: `tests/test_adopt_clone_template.py` is new, 31 tests, all passing at this head with `git filter-repo`. The 17 that run `execute` skip without it; the other 14 build their legs by hand and run on every OS (14 passed, 17 skipped without it). The operator's configuration reaches git through `GIT_CONFIG_GLOBAL`, a file each test writes, and the stranger's `.git` is copied with `shutil.copytree`, so nothing reads or writes a real configuration. - 2: the premise, asked of git. A plain clone under the template gets the stranger's store and `--template=` gets none, for `init.templateDir` and for `GIT_TEMPLATE_DIR`. - 16: `execute` end to end in four cases (template by configuration, template by environment, stores with no `origin`, and the no-template control), four tests each. `check` is ok and `execute` exits 0 with `adoption verified`; each gitlink on the pushed split branch equals its leg's pushed tip and is never the planted commit; the work directory's `.git/modules` holds only the two stores the mounts made; a recursive clone under a clean configuration succeeds, and `validate-manifest.py`, `validate-pins.py` and `bootstrap.py` pass in it. - 10: the verification on its own, with no template, on hand-made splits. The control (the default and the plan's own mount paths); a swapped spec, code or both mount at both path spellings, with the exact finding text; a mount at an OLDER commit of its own leg, since the comparison is exact; and a missing mount, which stays one `adopt-mount-missing`. - 2: the real `_mount_the_legs` over a clone made under the template, with no `git filter-repo`. A plain clone mounts the planted commit and the verification refuses both mounts; cloned with `--template=`, the same mounts are the legs' tips and verify. - 1: `cmd_execute` with the spec mount's checkout moved after the mount: exit 1, the finding, no `adoption verified`, and the split pushed. Run against main's `adopt-project.py` (c7c02fa), 19 of the 31 fail and 12 pass. The failures are the issue's. The gitlinks are the planted commit; the clean recursive clone exits 128; the no-`origin` variant exits 2 at `git remote set-url origin`; and the swapped or planted mounts still end `adoption verified` (`assert 0 == 1`, nine times). The 12 that pass are the premise, the control and the cases that hold on main. Measured at 06cb68e, without `--template=` on the clone 12 fail (the end-to-end tests of the three template cases), and without the `_mount_commit_findings` call 9 fail (the verification tests). With no template the run is unchanged: one source repository copied twice and adopted by main's `adopt-project.py` and by 65073c1's gave the same split tree, leg tips, stdout (but for the split commit's own line), stderr, `.git/modules` names and `.git/config`. The first head failed 12 of these tests on tests-windows, each with one extra `adopt-lost` finding for the source's README.md. The fault was the test's: `the_source()` wrote that file through `write_text`, which writes CRLF on Windows, while the split's copy is LF, so the two were different blobs. It now writes the file byte-exact, as the split's is. `write_text(newline=...)` is not used because it needs Python 3.10 and the baseline is 3.9. Under an emulation of Windows' text-mode `write_text` and with no `git filter-repo` on PATH, the first head gave CI's result exactly (12 failed, 2 passed, 17 skipped) and this one gives 14 passed and 17 skipped. Left out: - The check does not undo the push. When it fires, the finding says the split is wrong and not to merge it, and the usual closing paragraph says the legs and the branch exist. - Template hooks no longer run on the assembly's commit and push, as above. - Nothing else in `adopt-project.py` changes: no `--help` text (`render-cli-reference.py --check` is ok), no plan field, no other finding. Reviewed adversarially by this lane at 65073c1 (CHANGES NEEDED: the 12 tests-windows failures, a test-only fault, and two P3s, a merge note in the PR body and the missing sentence on hooks) and re-verified at 06cb68e after fix round 1 (MERGEABLE WITH NITS). Lane: openreposhape-2 (openRepoShape-2) Co-Authored-By: Claude Opus 5.5 <[email protected]>



Lane: openreposhape-1 (openRepoShape-1)
Claim: #165 (comment)
Merge order: nothing left to wait for. #166 (#194) and #168 (#170) are on
main. So are #167 (#182), #169 (#187), #172 with #191 (#198), #179 (#201) and #174 (#200). This branch hasmaina5b09c3 merged in, with no conflict. While #166 and #168 were open, this branch had to merge after both; the last section says why. Lane 2's P2-1, taken in c2723dd, makes the verification fail closed on a root-kept submodule, so it no longer depends on those refusals at all.Head: 28fee0f. That is c2723dd, the round that takes lane 2's review, on top of 0448944. Then
mainwas merged three times: 20e13f0 (2d979c9), 8df21e6 (b11d457) and a5b09c3 (28fee0f). The branch's diff overmainis byte-identical at all four commits.What
adopt-project.py's verification now passes over only the two gitlinks the shape adds: the leg mounts atlegs.spec_pathandlegs.code_path. It used to pass over every gitlink in the split commit's root tree. Every other root gitlink is now accounted for the same way a blob is. Each one is ALSO a finding of its own, because the assembly root keeps no gitlink but the two mounts._verifygainsspec_pathandcode_pathparameters, and its one call site incmd_executepasses the plan's. The root-tree loop moves into a new helper,_land_the_root_tree, which returns three new findings:adopt-root-submodule: a root gitlink that is the source's own submodule, at its own path and its own commit.adopt-unexpected-gitlink: any other root gitlink that is not a leg mount at its path as the plan spells it.adopt-mount-missing: a mount path, as the plan spells it, that holds no gitlink. The finding says what is there instead: nothing, a blob (with its mode), or a directory.GITLINK_MODE = "160000"is defined once. These are adopt-project.py: a plan that sends.gitmodulesto one leg and a submodule it registers to another passescheckandexecute, saysadoption verified, and the assembly's recursive clone then fails:planshould ask,checkshould find,executeshould refuse #166's three lines, now onmain(N5 from adopt-project.py: a plan that sends.gitmodulesto one leg and a submodule it registers to another passescheckandexecute, saysadoption verified, and the assembly's recursive clone then fails:planshould ask,checkshould find,executeshould refuse #166's review)._commit_the_splitstages withgit add -A -- ., so a source.gitignoreof.*silently drops.gitattributesandvalidate.ymlfrom the split,executestill saysadoption verified, and the assembly fails its first bootstrap #167'sadopt-shape-file-missingalso does.Why: reproduction on
mainWhen #165 was filed,
mainwas at 7f84ca4. The source had one commit with one real submodule,upstream/dependency, and the remotes were local bare repositories. The planupstream/ -> root, .gitmodules -> codepassedcheckand then failed verification on a false finding:The finding was false. The split branch's root tree holds that gitlink at the source's own commit:
checkandexecutenow refuse that plan: #166 made itplan-submodule-root, acheckfinding and anexecuterefusal, and #168 makesexecuterefuse everycheckfinding. So onmaina5b09c3 the blind spot shows only in splits that no plan reaches. The table below calls_verifydirectly on hand-made one-commit repositories, with the gitlinks written bygit update-index --cacheinfo. Each split carries a minimal shape pin, which #167's check needs. The first row is the reproduction above in small. The other rows are splits the blind spot passes.maina5b09c3adopt-lostroot 2 of 4,adopt-root-submoduleadoption verifiedadopt-duplicatedandadopt-root-submodulevendor/extranobody asked foradoption verified,added 3adopt-unexpected-gitlink,added 4adoption verifiedadopt-unexpected-gitlinksrc/app.py, a source blob the code leg tookadoption verifiedadopt-unexpected-gitlinkadoption verifiedadopt-mount-missing, naming whichThe plan-level view uses lane 2's
scen.py. It runs seven plans that keep the source's submodule or its.gitmodulesin the root, or leave one of them with no leg. R1, R2 and R3 are #165's three, and T1 to T4 are #168's trap. E1, the control, sends both to the code leg.maina5b09c3 and on 28fee0f, each of the seven getscheckexit 1 andexecuteexit 2, and no leg remote is created. E1 givesadoption verified. Its recursive clone exits 0 withcode/upstream/dependencypopulated, andgit submodule statusexits 0._refuse_what_check_findstaken away, as a regression in adopt-project.py: a plan that sends.gitmodulesto one leg and a submodule it registers to another passescheckandexecute, saysadoption verified, and the assembly's recursive clone then fails:planshould ask,checkshould find,executeshould refuse #166 or adopt-project.pyexecuterefuses onlyplan-unresolvedandplan-stale, so a plancheckrejects as uncovered or with a bad leg creates and pushes both legs before it fails verification #168 would take it (in a scratch clone only):maina5b09c3, all seven exit 1 onadopt-lost. In R1, R2, T1, T2 and T3 it namesupstream/dependency, which is in the root tree, so that finding is false. R1, R3 and T4 lose.gitmodules.adopt-root-submodule, and R1 also onadopt-lost: .gitmodules. R3 and T4 fail onadopt-lost: .gitmodules.adoption verifiedover an emptyupstream/dependency, andgit submodule statusexited 128.The rule as implemented
GITLINK_MODEentry atspec_pathorcode_path. The legs' own trees account for what lies behind those two mounts. No other entry is passed over.root:<oid>._account_foris unchanged:root;adopt-duplicated;adopt-lost._root_gitlink_finding, lane 2's P2-1).adopt-root-submodulewhen it is the source's own submodule at its own path and commit, andadopt-unexpected-gitlinkotherwise. "Otherwise" covers a new path, the source's submodule path at another commit, and a path where the source had a blob..gitmodulesto one leg and a submodule it registers to another passescheckandexecute, saysadoption verified, and the assembly's recursive clone then fails:planshould ask,checkshould find,executeshould refuse #166,plannever proposesrootfor a submodule (it asks instead), andcheckandexecuterefuse a plan that keeps one there (plan-submodule-root); since adopt-project.pyexecuterefuses onlyplan-unresolvedandplan-stale, so a plancheckrejects as uncovered or with a bad leg creates and pushes both legs before it fails verification #168,executerefuses everycheckfinding. So a root gitlink at verification is either a defect or a plan that skippedcheck.rootand nothing more saidadoption verifiedover an assembly whose fresh.gitmodulesdoes not register it. Its recursive clone left that directory empty, andgit submodule statusexited 128.FINDING adopt-root-submodule: upstream/dependency is a gitlink to 111111111111 in the root tree, the source's own submodule at its own commit, and the assembly root keeps no submodule of the source's: its .gitmodules is reserved for its two leg mounts;executerefuses before any leg exists a plan that keeps a submodule of the source's in the root (plan-submodule-root) or leaves one with no leg (plan-unresolved,plan-uncovered,plan-bad-leg), so the split itself is wrong: do not merge it, and report it to opensoft/openRepoShapeFINDING adopt-unexpected-gitlink: vendor/extra is a gitlink to 222222222222 in the root tree, and neither a leg mount as the plan spells their paths (code, spec) nor the source's own submodule at that commit; this is not how the plan spells its leg paths:executerefuses before any leg exists a leg path git would record at another spelling (plan-bad-leg-path), so the split itself is wrong: do not merge it, and report it to opensoft/openRepoShapeFINDING adopt-mount-missing: the root tree has nothing at code as the plan spells it, where the gitlink that mounts the code leg belongs; this is not how the plan spells its leg paths: …(the same exit).--spec-path spec/, so the mount and its.gitmodulesregistration disagree andmainstill saysadoption verified#169).adopt-unexpected-gitlinkandadopt-mount-missing.plan --spec-path spec/wrotespec_path: spec/,checksaidplan ok,git submodule addrecorded the mount atspec, and both findings fired.legs.spec_path. adopt-project.py accepts a non-canonical leg path such as--spec-path spec/, so the mount and its.gitmodulesregistration disagree andmainstill saysadoption verified#169 refuses that spelling before any leg exists. It is onmain, and it came into this branch with the 0448944 merge. Re-proved at 28fee0f:plan --spec-path spec/exits 2 withREFUSED adopt-bad-leg-pathand writes no plan;spec_path: spec/is acheckfinding (plan-bad-leg-path),executeexits 2 withREFUSED plan-bad-leg-path, and no leg remote is created._verify, asked directly about such a split, still fires both findings, and a test keeps that..gitmodulesis still compared byte for byte, on purpose..gitmodulescannot reach the root:checkfinds a plan that keeps it there (adopt-project.py: a plan that sends.gitmodulesto one leg and a submodule it registers to another passescheckandexecute, saysadoption verified, and the assembly's recursive clone then fails:planshould ask,checkshould find,executeshould refuse #166) or leaves it in no entry (adopt-project.pyexecuterefuses onlyplan-unresolvedandplan-stale, so a plancheckrejects as uncovered or with a bad leg creates and pushes both legs before it fails verification #168), andexecuterefuses that plan..gitmodulesthat_mount_the_legswrites is the shape's own file, not a source landing. When the source had no.gitmodules, the fresh one is counted as added. When the plan moved or dropped the source's, the fresh one matches no source blob and is passed over._land_the_root_tree's docstring says this..gitmodulesto one leg and a submodule it registers to another passescheckandexecute, saysadoption verified, and the assembly's recursive clone then fails:planshould ask,checkshould find,executeshould refuse #166's ruling (lane 2's P3-2): the issue's "account for a root.gitmodulesby its REGISTRATIONS" is declined, and its reading oftemplates/assembly-root/.github/workflows/validate.ymllines 59-87 (at 91d5685) against a root that keeps a third submodule is moot. The reason for both: since adopt-project.py: a plan that sends.gitmodulesto one leg and a submodule it registers to another passescheckandexecute, saysadoption verified, and the assembly's recursive clone then fails:planshould ask,checkshould find,executeshould refuse #166 the assembly root keeps no submodule of the source's, and its.gitmodulesis reserved for the two mounts. So that file holds no registration of the source's to account for, and no planexecuteruns leaves a third submodule forvalidate.ymlto meet. A split that kept one anyway now fails verification onadopt-root-submodule.validate.ymlis unchanged: it reads every URL in the root.gitmodulesas a leg, which is true of every root that verifies._commit_the_split,_mount_the_legs(one comment, below), the plan and check code,contracts/path-classification.yaml, README.md or AGENTS.md. Two comments changed (lane 2's P3-1). Each now says the byte comparison is deliberate and names the findings that the mount's defence in depth meets, instead of citing adopt-project.py_verifyskips every root gitlink and compares a kept root.gitmodulesbyte for byte, so any plan that keeps a source submodule or its.gitmodulesin the root ends with exit 1 andadopt-lost#165 as pending:_mount_the_legs;.gitmodulesto one leg and a submodule it registers to another passescheckandexecute, saysadoption verified, and the assembly's recursive clone then fails:planshould ask,checkshould find,executeshould refuse #166'ssubmodule_plan_problemsdocstring.Tests
tests/test_adopt_verify.pyis a new file with sixteen cases. Fourteen call_verifythrough importlib on hand-made one-commit repositories. They need no git-filter-repo, so the Windows job runs them:spec/code/root 1 of 3,added 3;root 2 of 4,adopt-root-submodule, and noadoption verified;adopt-lost);drop 1 of 4);adopt-duplicatedandadopt-root-submodule;adopt-unexpected-gitlinkat a new path, at the source's submodule path at another commit, and at a path where the source had a blob;adopt-mount-missingwhen the code mount is absent, a blob, or a directory;legs/specandimpl/code, passed over and verified;specwhile the plan spells the mountspec/(how git recorded it before adopt-project.py accepts a non-canonical leg path such as--spec-path spec/, so the mount and its.gitmodulesregistration disagree andmainstill saysadoption verified#169) orlegs/spec: exactly the two findings, plus the closing paragraph.The other two run
execute. Like everyexecutetest, they are skipped without git-filter-repo:plan --spec-path legs/spec --code-path impl/code, thencheck, thenexecute. It expectsadoption verifiedand split gitlinks at exactly those two paths. Then, for lane 2's P3-3, it moves the work directory away and clones the split branch withgit clone --recurse-submodules: exit 0, with files under both mounts. Last it runsscripts/bootstrap.py: exit 0, with noNOT INITIALIZED..gitmodules -> code,upstream/ -> root) getscheckexit 1 withplan-submodule-root. Thencmd_executeruns in-process with_refuse_what_check_findsmonkeypatched away, as a regression in adopt-project.py: a plan that sends.gitmodulesto one leg and a submodule it registers to another passescheckandexecute, saysadoption verified, and the assembly's recursive clone then fails:planshould ask,checkshould find,executeshould refuse #166 or adopt-project.pyexecuterefuses onlyplan-unresolvedandplan-stale, so a plancheckrejects as uncovered or with a bad leg creates and pushes both legs before it fails verification #168 would take it. It exits 1 on exactlyadopt-root-submodule. adopt-project.py: the leg mount passes--forcetogit submodule add, so a source whose.gitignoreis*+!.gitignore, or namesspecorcode, adopts instead of dying at the mount after both leg remotes were pushed (#174) #200's mount guard,_refuse_an_unmountable_path, lets this plan through to the verification: its mounts are atspecandcode, where the root holds nothing.tests/test_adopt_submodules.pygainstest_the_root_that_mount_leaves_never_verifies. #166 relabelled the mount-level defence in depth; this test runs the real_mount_the_legson a root-kept plan. It then shows that the verification's own functions fail the root the mount leaves, onadopt-root-submoduleand onadopt-lost: .gitmodules. It needs onlygit, so it runs without git-filter-repo too.The hand-made split commits carry a minimal
contracts/shape-pin.yamlthat namesproject.yaml. Since #167, the check reads the pin out of the split commit. Without the pin, these cases fail onadopt-shape-file-missing(variant P below).Every case fails with the fix reverted or under a named mutation. Each variant below ran
tests/test_adopt_verify.pyin a scratch clone at 28fee0f, with git-filter-repo on PATH:maina5b09c3'sadopt-project.py_verify() takes from 6 to 7 positional arguments but 8 were given. The fail-closed case gets a falseadopt-lost: upstream/dependencywhere it expectsadopt-root-submodule. The nested-mount case passes, becausemainpasses over every gitlinkadopt-project.pychange revertedbeforepath in before)SPLIT_DEFECT's text through 0448944ROOT_SUBMODULE_DEFECTno longer namesplan-bad-leg_verifypasses overspecandcodewhatever the plan sayslegs/spec+impl/codecase, both spec-gitlink-elsewhere, nested mountsspec/codepassed overcmd_executepasses"spec", "code"instead of the plan's paths.gitmodulesURL rewrite droppedThe same check for c2723dd's own changes ran
tests/test_adopt_verify.pyandtests/test_adopt_submodules.py(148 tests) at 28fee0f. Each mutation gave the same failures as it did at b11d457:adopt-project.pychangetest_the_root_that_mount_leaves_never_verifiesif gitlink and before.get(path) != oidtest_the_root_that_mount_leaves_never_verifiesSPLIT_DEFECTback to its 0448944 textROOT_SUBMODULE_DEFECTno longer namesplan-bad-leg_mount_the_legsno longer rewrites each leg's.gitmodulesURLassert cloned.returncode == 0. The 0448944 version of that test, which has no clone, passes under this mutation, so the P3-3 clone is what catches itTargeted runs at 28fee0f, over eleven files:
test_adopt_verify,_submodules,_e2e,_execute_refusals,_leg_paths,_leg_path_collisions,_mount_ignored,_ignored_shape_files,test_shape_doctor,test_windows_pathsandtest_cli_reference.tests/test_repo_hygiene.py: 50 passed.render-cli-reference.py --check: ok. The writer did not run the full suite at this head.A plain adoption is unchanged from
main. The suite'sSYNTHETIC_TREE, which has no submodule, ran onmaina5b09c3 and on 28fee0f with the same results:spec 5,code 13,root 9,drop 0 of 27,added 19, andadoption verified;The split root trees differ only where they must:
.gitmodulesrecords each run's own remote paths, and is identical once those are normalised;contracts/shape-pin.yaml,project.yamlandshape/README.mdrecord the shape's own commit and its tree digest.Merge order, as it stood while #166 and #168 were open
This PR removes a verification blind spot. On
mainat the time, that blind spot made two kinds of wrong plan fail with a falseadopt-lost. Without the refusals in #166 and #168, both verified at 05fa0e0. Each left the root holding a source gitlink that its.gitmodulesdoes not register, so a recursive clone left that directory empty.rootfor a source submodule; adopt-project.py: a plan that sends.gitmodulesto one leg and a submodule it registers to another passescheckandexecute, saysadoption verified, and the assembly's recursive clone then fails:planshould ask,checkshould find,executeshould refuse #166 refuses it. For example,upstream/ -> root, .gitmodules -> code:executerefuses onlyplan-unresolvedandplan-stale, so a plancheckrejects as uncovered or with a bad leg creates and pushes both legs before it fails verification #168 refuses it. adopt-project.py: a plan that sends.gitmodulesto one leg and a submodule it registers to another passescheckandexecute, saysadoption verified, and the assembly's recursive clone then fails:planshould ask,checkshould find,executeshould refuse #166 refuses only the gitlinks that an answered entry covers. Until adopt-project.pyexecuterefuses onlyplan-unresolvedandplan-stale, so a plancheckrejects as uncovered or with a bad leg creates and pushes both legs before it fails verification #168,checkreported an uncovered path asplan-uncoveredbutexecuteran the plan anyway, and the uncovered gitlink stayed in the root at its own commit. Here theupstream/entry was deleted from the plan:Both are on
mainnow. With P2-1, both kinds fail verification even when the plan checks before it are taken away (the bypass rows above).Reviews
Lane openRepoShape-2 reviewed 05fa0e0 (#165 (comment)). Its verdict was CHANGES NEEDED on one P2, otherwise mergeable with nits, and only after #166 and #168. c2723dd takes each finding:
P2-1.
_verifyfailed open on the source's own submodule kept in the root at its own commit. In every reachable case, that submodule sits in a root whose.gitmodulesdoes not register it. The run saidadoption verified, the recursive clone left the directory empty, andgit submodule statusexited 128. Fixed:test_adopt_verify.py:154is flipped;scen.pyrows were rerun on 28fee0f, as above;P3-1. fix(adopt): preserve existing gitmodules through leg extraction #162's mount comment cited adopt-project.py
_verifyskips every root gitlink and compares a kept root.gitmodulesbyte for byte, so any plan that keeps a source submodule or its.gitmodulesin the root ends with exit 1 andadopt-lost#165 as pending. Taken:.gitmodulesto one leg and a submodule it registers to another passescheckandexecute, saysadoption verified, and the assembly's recursive clone then fails:planshould ask,checkshould find,executeshould refuse #166'ssubmodule_plan_problemsdocstring, which did the same;.gitmodulesto one leg and a submodule it registers to another passescheckandexecute, saysadoption verified, and the assembly's recursive clone then fails:planshould ask,checkshould find,executeshould refuse #166 had already relabelledtest_mount_preserves_registration_kept_in_assemblyas mount defence in depth, for a plan thatcheckandexecuterefuse. It stays as a mount-level unit test, with its docstring updated;test_the_root_that_mount_leaves_never_verifiesshows that the root the mount leaves fails verification.P3-2. The issue asked for two things this branch declines, and nothing said so. Taken: the "Declined or moot" line above.
P3-3. Test gaps. Taken:
scripts/bootstrap.pyafter the nested-mountexecute;executethat reaches the new finding (the fail-closed test);Lane 2's mutation of
cmd_execute, passing literal"spec", "code"(R2 above), is still caught only by the nested-mountexecutetest, which the Windows job skips. That gap is left as it is.cmd_executerefuses to run withoutgit filter-repo(_require_filter_repo), and builds the legs with it before it reaches that call. So every test that reaches the call is skipped where git-filter-repo is absent.Beyond the review: the exit text of
adopt-unexpected-gitlinkandadopt-mount-missingno longer sends the reader to re-spelllegs.spec_pathfirst, because #169 refuses that spelling before any leg exists.Closes #165
🤖 Generated with Claude Code