Repository navigation
adopt-project.py: the split force-stages every file the shape wrote past a source .gitignore such as .*, and the verification fails on any file contracts/shape-pin.yaml names that the split commit lacks, so a hidden .gitattributes no longer passes as adoption verified and then fails the first bootstrap (#167) - #182
Conversation
…ast a source `.gitignore` such as `.*`, and the verification fails on any file `contracts/shape-pin.yaml` names that the split commit lacks, so a hidden `.gitattributes` no longer passes as `adoption verified` and then fails the first bootstrap (#167) `_commit_the_split` staged the assembly root with `git add -A -- .`, which honours the source's `.gitignore`. With the common `.*` + `!.gitignore` it skipped every new dot-file the shape wrote -- `.gitattributes` and `.github/workflows/validate.yml` -- so the split commit lacked two files its own `contracts/shape-pin.yaml` pins, `execute` still printed `adoption verified` because `_verify` accounts only for the SOURCE's paths, and the assembly's first `make bootstrap` refused with `FINDING shape-copy-missing: contracts/shape-pin.yaml: .gitattributes is pinned but absent`. The staging is now `_stage_the_split`: `git add -A -- .` as before, for the deletions the mount made and edits to tracked files, then `git add -f --` over exactly the paths `materialize_assembly_root` returned in `written` -- where each landed, a collision copy under `shape/` included, in the POSIX spelling `root_key` gives on every platform. Never `-f .`: a file the source itself ignored stays out. `_verify` gains one line, after `_account_for`: `_shape_file_findings` reads the pin out of the SPLIT COMMIT with `repo_shape.parse_yaml` and reports `FINDING adopt-shape-file-missing` for every pinned path that commit's tree does not hold (a gitlink is not the file), so the gap fails `execute` instead of the first bootstrap. The commit, never the disk: the assembly's working tree still has the ignored file. A pin that is absent is that same finding; one that is not a `files:` list of paths is `adopt-shape-pin-unreadable`, never a vacuous pass. `_verify`'s signature and root-tree loop are untouched (#165 edits them). Tests (tests/test_adopt_ignored_shape_files.py): the staging on a hand-made assembly with stray ignored files planted in it, and the argv on a Windows-keyed `written`; the new check on hand-made split commits, including a pinned file present only on disk, a missing or malformed pin and a gitlink at a pinned path -- all without git-filter-repo; and, under git-filter-repo, a source with no submodules and the `.*` ignore adopted end to end (with and without a `.gitattributes` of its own), whose split holds every pinned file and whose recursive clone bootstraps; `execute` run in process with ignored files dropped into the assembly as the shape is written, which commits none of them; and `execute` with the staging put back as it was, which exits 1 naming both files. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ps in the root is staged where it landed and found there by the verification, the way the first bootstrap finds it, and every shape-file finding names the plan answer or a defect report instead of a hand-staged `git add -f` (#167) A source that tracks `ci/workflows/ci.yml` and a symlink `.github -> ci`, both kept in the root, adopted and bootstrapped on main: the shape's workflow is written THROUGH the link, to `ci/workflows/validate.yml`, and `validate-pins.py` opens the pinned `.github/workflows/validate.yml` through the clone's link. 119d666 broke it twice. Its forced add died with `fatal: pathspec '.github/workflows/validate.yml' is beyond a symbolic link` after the legs were pushed, and its check, run on main's bootstrapping split, called that file missing. Staging: `_stage_the_split` passes each written path through `_where_it_landed`. A path with no symlink on the way is passed as it is, never resolved, so nothing that verified before changes spelling. One with a symlink inside the assembly is staged where the links lead, `ci/workflows/validate.yml`. One whose link leads out of the assembly is not staged, and the verification reports it. Verification: `_SplitTree` reads the split commit the way a checkout does. A pinned path, the pin's own included, is followed through the tree's own symlink entries (mode 120000, the blob is the target), each target read from the link's own directory, the last component too. `..` is taken only from a directory and never above the root, an absolute target leads out, and the 41st link is a loop (Linux's MAXSYMLINKS). Each of these is a finding naming the link, never a hang and never a quiet pass. On the review's own adoptions the check now agrees with bootstrap everywhere: 0 findings on main's symlinked split a06bcbd33ae9 (bootstrap 0), the same findings as before on the splits whose bootstrap fails. The findings (review S1, N1, N2): once the add is forced a `.gitignore` cannot keep a shape file out, so the `.gitignore` diagnosis and the `git add -f` / push advice are gone. That advice contradicted the footer printed under it and AGENTS.md step 7, and it fails in every case still reachable. `SHAPE_FILE_EXIT` gives the two exits that remain. If the plan kept the source's own file at a shape path in the root (its own `contracts/shape-pin.yaml` most often, the shape's then beside it under `shape/`), or a symlink on the way to one, send that path to a leg or `drop` it and re-run into fresh legs. Otherwise the split itself is wrong: do not merge it, and report it to opensoft/openRepoShape. The tail names the refusal bootstrap actually gives: `shape-pin-missing` for the pin itself, `shape-copy-missing` for a file it names. `adopt-shape-pin-unreadable` now says what to do too. Tests (tests/test_adopt_ignored_shape_files.py): - With no git-filter-repo and no disk symlinks, so they run on Windows: the tree resolution through a linked directory, a linked file, a chain read from each link's own directory, and the pin itself behind a link. Six links that lead nowhere are each one finding: absolute, above the root, a self-link, a loop of two, `..` through a missing directory, and dangling. A thread bounds each lookup, so a loop fails the test rather than hanging the run. - `files: []` is now a pin parameter (N3). The message assertions now require the two exits and forbid `gitignore`, `git add` and `push`. - With a disk symlink (skipped on Windows): the staging of a file written through `.github -> ci`, and a link out of the assembly that is not staged. - Under git-filter-repo: the review's symlinked source, adopted, verified, cloned recursively and bootstrapped. And the source's own pin kept in the root (N4): `execute` exits 1 with exactly one finding, carrying the plan answer and no `git add`. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… to a regular file of the split tree, mode 100644 or 100755, which is what a checkout's `is_file()` finds, rather than to any entry that is not a mount (#167) `_SplitTree.blob_at` used to accept any entry at the resolved path except a gitlink. The two are equivalent today, because `_resolve` follows every symlink, the last one included, so the resolved entry can never be a link. But a regression that stopped following the last link would then have counted the link entry itself as the pinned file, and `test_a_pinned_path_is_found_through_the_split_trees_symlinks[a-linked-file]` would still have passed. Naming the two regular-file modes says what the check means and turns that regression into a failing test. `mounts` stays, for `..` out of a mounted leg's directory. Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
(lane openRepoShape-1, 2026-10-09T03:40:26Z) |
|
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 16 hours and 22 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 GuideUpdates adoption execution so shape-written files cannot be silently omitted by the source Sequence diagram for adoption staging and verificationsequenceDiagram
participant Execute
participant Materializer
participant Git
participant Verifier
participant SplitTree
Execute->>Materializer: materialize_assembly_root()
Materializer-->>Execute: Materialized.written
Execute->>Git: git add -A -- .
Execute->>Git: git add -f -- written paths
Execute->>Git: env_commit()
Git-->>Execute: split_commit
Execute->>Verifier: _shape_file_findings(assembly, split_commit)
Verifier->>Git: cat-file blob contracts/shape-pin.yaml
Verifier->>SplitTree: blob_at(pinned path)
SplitTree-->>Verifier: regular-file presence or finding
Verifier-->>Execute: adoption verified or findings
Flow diagram for shape-file verification outcomesflowchart TD
A[Split commit created] --> B[Read contracts/shape-pin.yaml from split commit]
B --> C{Valid non-empty files list?}
C -- No --> D[adopt-shape-pin-unreadable]
C -- Yes --> E[Resolve each pinned path through split-tree symlinks]
E --> F{Leads to regular file?}
F -- Yes --> G[Verification continues]
F -- No --> H[adopt-shape-file-missing]
D --> I[SHAPE_FILE_EXIT]
H --> I
G --> J[adoption verified if no other findings]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
|
(lane openRepoShape-2, 2026-10-09T07:54:18Z) This head, b635473, was reviewed by lane openRepoShape-2 before the PR opened; the findings are on the issue: #167 (comment). Verdict MERGEABLE WITH NITS: #167 fixed, the symlinked-root regression fixed, merges clean with main, #166 and #165. Still open from that review: the pin-collision case (a source keeping its own |
Lane: openreposhape-1 (openRepoShape-1) Co-Authored-By: Claude Opus 5.5 <[email protected]>



Lane: openreposhape-1 (openRepoShape-1)
Claim: #167 (comment)
What
adopt-project.py executenow commits every file the shape wrote into the assembly root, even when the source's.gitignorehides it. Its verification also fails when a filecontracts/shape-pin.yamlnames is missing from the split commit. Before this, a source with the common.*+!.gitignoregot a split without.gitattributesand.github/workflows/validate.yml,executestill printedadoption verified, and the assembly's firstmake bootstraprefused.This is head
b635473, the first push (119d666) plus a round that took the adversarial review's findings (below). The branch is based on7f84ca4;mainhas since moved tob18cca9(#168, merged as #170).Why
_commit_the_splitstaged the assembly root withgit add -A -- ., which follows the source's.gitignore, so every new dot-file the shape wrote was skipped._verifychecks only the source's own paths, so nothing noticed the gap. Reproduced on7f84ca4: a source whose.gitignoreis.*+!.gitignore, with no submodules, taken throughplan,checkandexecute --local-remote-dir, thengit clone --recurse-submodulesandscripts/bootstrap.py:The same run on this branch, re-run at the head:
(The reproduction script prints a command's lines before its exit code, so
adoption verifiedisexecute's, printed aboveexecute exit 0.)The fix
Staging:
_stage_the_split. It runsgit add -A -- .as before, which stages the mount's deletions and any edit to a tracked file. Then it runsgit add -f --on exactly the pathsmaterialize_assembly_rootreturned inMaterialized.written. That list records where each file was actually written, including a copy written beside a source file undershape/and the Makefile with the adopt block. The paths use the forward-slash formroot_keygives on every platform, which git also accepts on Windows. It never runs-f ., so a file the source itself ignored stays out.Each path is staged as
_where_it_landedspells it: unchanged when no symlink is on the way to it, the path the assembly's own symlinks lead to when one is, and not staged at all when the link leads out of the assembly. A path with no link on the way is never resolved, so Windows never gets a respelled one.Verification:
_shape_file_findings. It reads the pin from the split commit (not from disk) withrepo_shape.parse_yamland checks every listed path against that commit's tree. It has to read the commit because the working tree still holds the ignored file, so a disk check would miss the gap. Each missing path is one finding.A pinned path is looked up the way the first bootstrap's
validate-pins.pyopens it, by_SplitTree: through the tree's own symlinks (mode120000, the blob is the target), each target read from the link's own directory,..taken only from a directory and never above the root, an absolute target leading out, and more than 40 hops (Linux'sMAXSYMLINKS) a loop. The path counts as present only when it leads to a regular file of the tree (100644or100755), which is what a checkout'sis_file()finds. A gitlink at a listed path, or a link left unfollowed, does not count.A missing pin is reported with the same finding id. A pin that is not a
files:list of paths, an empty list included, is reported asadopt-shape-pin-unreadablerather than passing as if it listed nothing. The check covers presence only;validate-pins.pystill checks the digests at the first bootstrap.One remediation,
SHAPE_FILE_EXIT. Once the files are forced, a source.gitignorecan no longer hide one, so the finding fires for a plan answer (the source's own file at a shape path, most often its owncontracts/shape-pin.yaml, or a symlink on the way to a shape path, kept in the root) or for a defect of the tool. Both findings now say so, and nothing else:_verifychanges by exactly one line,findings += _shape_file_findings(assembly, split_commit)after_account_for. Its signature and root-tree loop are untouched because #165 changes them.Review findings taken
An adversarial review of
119d666(it reproduced the fix's own table, found six correct adoptions byte-identical tomain, and ran the four-way merges) found one blocker, one coordination blocker, one should-fix and seven nits. What was done with each:ci/workflows/ci.ymland a tracked.github -> ci, both answeredroot) adopts and bootstraps onmain, but died on119d666atgit add -fwithpathspec '.github/workflows/validate.yml' is beyond a symbolic link, after the legs were pushed. The new check also called that file missing inmain's own bootstrapping split.mainhandles it. The staging follows the assembly's symlinks (item 1 above) and the check follows the tree's (item 2). On the review's own runs:119d666gave execute 2;b7083cagives check 0, execute 0adoption verified, clone 0, bootstrap 0, and the check gives 0 findings onmain's own splita06bcbd33ae9. A link out of the tree, a loop and a dangling link are findings, never a hang or a quiet pass.adopt-shape-file-missingremediation (.gitignorehid it;git add -f, commit and push the split branch) named a cause this commit makes impossible, prescribed a command that fails in every case still reachable, and contradicted AGENTS.md step 7 and the footer_verifyprints under it.SHAPE_FILE_EXITabove: the plan answer with the footer's own exit, else a defect report. No.gitignore,git add -for push advice.validate-pins.pysaysshape-pin-missingthere.shape-pin-missingfor the pin,shape-copy-missingfor a pinned file.adopt-shape-pin-unreadablenamed no exit.SHAPE_FILE_EXIT.files: []survived 15 of 15.files: []is a parameter ofa_pin_that_is_not_a_list_of_paths_fails_closed; it fails under that mutant (MM4 below).a_source_pin_kept_in_the_root_fails_verification_with_the_plan_answer: the source keeps its owncontracts/shape-pin.yamlin the root,executeexits 1 with one finding namingsrc/app/main.py, the plan answer and the defect exit, and the split's pin is the source's own bytes. Onmainthe review's equivalent run (own-pin-moved) gotexecute0 and then a bootstrap that refused."160000"should beGITLINK_MODE._verifylists the split tree twice (once itself, once in_shape_file_findings): one extragit ls-tree -r.plan --spec-path contractsand--code-path scriptspassplanandcheck, then fail at staging after both legs are pushed (onmain, at the first bootstrap). Pre-existing, and the branch is strictly better.Dependencies
_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's05fa0e0must be onmainbefore this branch, or with it. 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'stests/test_adopt_verify.pybuilds split commits by hand with nocontracts/shape-pin.yamland calls_verify; this branch's added line then adds a finding to every run. The two merge textually clean and the merged tests are red.05fa0e0(PR adopt-project.py: verification passes over the two leg mounts and no other gitlink, so the source's own submodule kept in the root isadopt-root-submodule, any other root gitlinkadopt-unexpected-gitlink, one in a leg AND the rootadopt-duplicated, and a missing mountadopt-mount-missing(#165) #173,fix/adopt-verify-mounted-gitlinks) gives that fixture a one-row shape pin ("the hand-made splits carry a shape pin so adopt-project.py_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's check passes them"). Measured at this head in a scratch merge:b635473+05fa0e0,tests/test_adopt_verify.pyandtests/test_adopt_ignored_shape_files.py: 44 passed. The same merge with 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's test file from before the pin row (d780495): 10 failed intests/test_adopt_verify.py."160000"literal switches toGITLINK_MODEwhen this branch is updated withmainafter 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.GITLINK_MODE = "160000"is defined by 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 branch (and by 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's); this branch writes the literal once, in_SplitTree.__init__, beside_verify's existing one. Whichever lands second makes the switch; it is two digits of text, not a behaviour.git merge-treeofb635473with the current heads exits 0 against each of:mainb18cca9; 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#16505fa0e0(PR adopt-project.py: verification passes over the two leg mounts and no other gitlink, so the source's own submodule kept in the root isadopt-root-submodule, any other root gitlinkadopt-unexpected-gitlink, one in a leg AND the rootadopt-duplicated, and a missing mountadopt-mount-missing(#165) #173); 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 #166794828c(fix/adopt-split-submodule-plan); adopt-project.py accepts a non-canonical leg path such as--spec-path spec/, so the mount and its.gitmodulesregistration disagree andmainstill saysadoption verified#1692c1f926(fix/adopt-canonical-leg-paths).Tests
tests/test_adopt_ignored_shape_files.py(new; 30 test items, 21 of them run without git-filter-repo, so they also run on the Windows job):.gitignoreis.*: the shape's paths (one of them undershape/) are staged, three stray ignored files planted in the assembly are not, and the README edit and the mount's deletion are still staged. A second test checks the git command line built from a Windows-keyedwritten: forward slashes, and never a bare.after-f. A third has a real symlink on the disk: a path written through.github -> ciis staged atci/workflows/, and one through a link out of the assembly is not staged (it skips onwin32, where a tracked symlink is a plain file).files:, a row without a path, not parseable,files: []) and a gitlink at a listed path are each reported.git update-index --cacheinfo), so no platform needs a symlink privilege: four layouts are found (a linked directory, a linked file, a chain read from each link's own directory, the pin itself behind a link), and six lead nowhere and are findings (an absolute link, a link above the root, a link to itself, a loop of two, through a name that is not a directory, a dangling link). The lookup runs under a 60-second thread bound, so a loop fails the test and cannot hang the run..*ignore, run with and without a tracked.gitattributesof its own (in the second case the shape's copy goes toshape/.gitattributes, which.*hides again): every pinned file is in the split, and the recursive clone bootstraps.win32):executeadopts, the split holds the120000link and the workflow where it leads, and the recursive clone bootstraps.executerun in process, with ignored files written into the assembly right after the shape's files (the only way an ignored file can be on disk when the split is staged): none of them is committed, and the source's own untracked ignored files are untouched.executerun in process with the staging put back as it was onmain: it exits 1 and names both missing files.Revert table
Each test item was run against the original code and against deliberately broken versions (mutants) of the fix, one at a time, over the whole new test file at
b635473. Every item fails onmain, except the two B1 end-to-end tests, which pass there by design (mainadopts that source) and are the guard against the regression119d666introduced. Every item fails under at least one mutant that breaks its own part of the fix.7f84ca4'sadopt-project.py). R0: this round reverted (119d666'sadopt-project.py).git add -f -- .; MS1 staging not resolved through symlinks; MS2 a link out of the assembly still staged._verifyline removed; R2b the check reports nothing; M4 presence read from the disk, the pin still from the commit; M6 every listed path reported; M7 a malformed pin passes; M8 a missing pin passes...at the root stays at the root; MV5 no directory check on..; MV6 targets read from the root, not from the link's directory; MV8 the last link not followed; MV10 a gitlink counts as a file (the old M5)..gitignore/git add -fremediation; MM2 the missing-pin tail says shape-copy-missing; MM3 the unreadable finding without its exit; MM4files: []accepted.R1, R2, R2b, M3, M4, M6, M7 and M8 are the first push's mutants, re-measured at
b635473(their code was reshaped by the round); MS, MV and MM are the round's own. Notes:[a-dangling-link]is a regression guard on the finding's message, and no single-line mutant isolates it from the others.[a-linked-file]passes on119d666, whose check counted the link entry itself as the file, and fails under MV8 only because of the regular-file mode requirement. MV2 fails after two 60-second thread timeouts and does not hang. The one guard left unmutated is "no symlink on the way means pass the path as it is": it is invisible on POSIX by design, because it exists so that Windows never respells a path.Test runs
python3 -m pytest tests/test_adopt_ignored_shape_files.py tests/test_adopt_e2e.py tests/test_adopt_spec_only.py tests/test_adopt_submodules.py tests/test_windows_paths.py tests/test_cli_reference.py -q -p no:cacheprovider, run atb635473:/home/brett/.local/binremoved from PATH, so nogit filter-repo, as on the Windows jobAll 43 skips read "git filter-repo is not installed": 9 in the new file, all 19 of
test_adopt_e2e.py, all 13 oftest_adopt_spec_only.py, 2 oftest_adopt_submodules.py. The full suite has not been run on this branch.README.md, AGENTS.md and
tests/test_adopt_submodules.pyare unchanged.Closes #167
🤖 Generated with Claude Code
Summary by Sourcery
Make project adoption verify and commit every shape-pinned file so ignored or symlinked files cannot cause a later bootstrap failure.
New Features:
Bug Fixes:
Enhancements:
Tests: