Repository navigation
update-shape.py, validate-pins.py and shape-doctor.py: once an adopted root does its own follow-up "merge shape/.gitignore into .gitignore" and removes the merged copy, the copy's pin row is copy-missing, so the project's bootstrap.py and its validate check go red, apply refuses with a remedy (--accept-local) that is refused in the same words, and no tool removes the row, which leaves only undoing the merge or the hand edit of the pin that AGENTS.md forbids #502
Description
Lane: openreposhape-4 (openRepoShape-4)
(lane openRepoShape-4, 2026-10-12T23:17Z) Found by lane 4's v1.0.0 README/AGENTS.md audit (finding auU-03), re-verified on main 437a360. Lane 4 claims it.
What is wrong. An in-place adoption keeps the source's own .gitignore, Makefile and .gitattributes. It writes the shape's copies of them beside the originals under shape/, and PINS those copies: contracts/shape-pin.yaml gets a row shape/.gitignore. The plan's follow-up then says "merge shape/.gitignore into .gitignore: the source repository already has that name, so the shape's copy was written beside it and NOTHING was overwritten".
The docs pull in two directions:
- README says "a human merges them and usually drops the rows" (README.md:1065-1070).
- AGENTS.md says a file with no row is "none of your business — an adopted project merged some of them away on purpose" (AGENTS.md:278-280), and forbids editing "a pinned file, a digest or a manifest to make a row go green" (:229-231).
- The project's own
AGENTS-shape.mdsays "Never update a digest in place." (templates/assembly-root/AGENTS-shape.md:37-48).
After the merge, the natural last act is to remove the merged-away shape/.gitignore. Then:
- The project's own gate goes red.
validate-pins.py, whichbootstrap.pyand CI'svalidateworkflow both run, reportsFINDING shape-copy-missing: contracts/shape-pin.yaml: shape/.gitignore is pinned but absent. - The update tool has no exit.
update-shape.py checksayscopy-missingandREFUSAL AHEAD.applyrefusesupdate-conflictwith "re-run this with --accept-local on that path". With--accept-local shape/.gitignore, the refusal is identical. - The doctor sends the reader back to that tool. It says
DRIFTED (1 copy-missing)and names that samecheck/apply.
No tool removes the row. Two things turn the project green: restoring the merged-away copy, which undoes the follow-up, or deleting the row by hand, which is the edit AGENTS.md forbids and the one README's "drops the rows" describes.
(check also has four verdicts the docs never list: already-at-target, upstream-removed, unmapped and copy-missing (update-shape.py:239-256). Listing them is #483's text. This issue is the missing remedy.)
Reproduction. Offline, on Linux. $U is a checkout of main 437a360; git-filter-repo is on PATH; the remotes are local bare repositories; a gh that exits 97 stands first on PATH; GIT_ALLOW_PROTOCOL=file is set; git reads an empty global config; identities come from env. --yes stands in for the human's yes.
- A source
$R/Medxholdingspecs/a.md,src/a.py,README.md, and its own.gitignore(build/,*.log), in one commit. - Adopt it:
adopt-project.py plan --source $R/Medx --project Medx --org acmeexits 0. Its follow-ups includemerge shape/.gitignore into .gitignore: ….checkexits 0.execute --yes --local-remote-dir $R/remotes --work-dir $R/workexits 0 and verifies:spec 1 of 4,code 1 of 4,root 2 of 4 source paths.
- Merge the split branch into the source's
main(the pull request, merged). Clone the assembly with--recurse-submodulesand runpython3 scripts/bootstrap.py: exit 0. Line 51 ofcontracts/shape-pin.yamlis- path: shape/.gitignore, andvalidate-pins.pyexits 0. - Do the follow-up:
cat shape/.gitignore >> .gitignore; git rm shape/.gitignore; git commit -am "merge shape/.gitignore into .gitignore". python3 scripts/validate-pins.pyexits 1 withFINDING shape-copy-missing: contracts/shape-pin.yaml: shape/.gitignore is pinned but absent.python3 scripts/bootstrap.pyexits 1 with the same finding andbootstrap FAILED: pins (exit 1).update-shape.py check --root $R/MedxRoot --upstream $U, exit 1:copy-missing shape/.gitignore (pinned but absent from the root; a human decides whether it was deleted on purpose) REFUSAL AHEAD: `apply` will refuse while these are unresolved — shape/.gitignore NEXT python3 update-shape.py apply --root <R>/MedxRoot --upstream <U> --at 437a360a45da26f0e9da0f023a0504cd336aa91e --yes --branch shape/update-437a360a45da- That
apply, exit 2:REFUSED update-conflict: these files changed on BOTH sides, or cannot be compared, and a merge is a human's judgement rather than a byte copy: shape/.gitignore: pinned but absent from the root; a human decides whether it was deleted on purpose Remediation: merge each one by hand (the upstream bytes are `git show <target>:<source path>` in a shape clone), commit it, then re-run this with --accept-local on that path so the row is recomputed from what you merged. - The same
applywith--accept-local shape/.gitignore: identical output, exit 2. shape-doctor.py --root $R/MedxRoot, exit 1. It reportsFINDING pins … shape-copy-missingandFINDING shape currency … shape/.gitignore, whose NEXT is step 6'scheck, and the verdict isDRIFTED (1 copy-missing).- In throwaway copies of the root:
git checkout HEAD~1 -- shape/.gitignore(restoring the copy):validate-pins.pyexits 0;- deleting the
shape/.gitignorerow fromcontracts/shape-pin.yamlby hand:pins ok, exit 0.
Why. At 437a360:
- Adoption pins the collision copy where it landed.
placewrites a colliding copy undershape/(scripts/shape_materialize.py:1961-1995). The verbatim copies, among themMakefile,.gitignoreand.gitattributes(:411-436), are pinned at the path they landed on.collision_follow_upsays "merge {actual} into {intended}" and nothing about the row (:646-665). - A pinned path with no file is a conflict.
classifymarks any pinned path the root has no file at ascopy-missing(update-shape.py:551-556), which is one ofCONFLICTS(:254). - The refusal names an exit it does not honour.
_refuse_conflictsexempts onlybothunder--accept-local. Its docstring says the other conflict states,copy-missingamong them, "have no such exit", yet the remediation it prints for all four says to re-run with--accept-local(:2510-2534). - The project's own gate runs the check.
validate-pins.pyreports the row (templates/assembly-root/scripts/validate-pins.py:391-394).bootstrap.pyruns it (templates/assembly-root/scripts/bootstrap.py:80), and so does CI (templates/assembly-root/.github/workflows/validate.yml:200). - Nothing removes a row.
applyre-pins rows, or adds them with--add, and no other tool editscontracts/shape-pin.yaml.
Proposed fix (for review on the PR). Brett Heap ruled, 2026-10-12T23:16:24Z: "for auU-03, the pin row goes" (auU-03 is this issue's audit finding). When a shape/ collision copy has been merged away, its pin row is removed, not repointed at the merged file. What remains open is the MECHANISM: which tool, and which step, removes the row. Options for Brett:
checknames it,applydrops it.checkreports a merged-awayshape/copy as a verdict of its own, separate fromcopy-missing: for example, a pinned path under the collision directory whose original path (shape/X→X) the root holds.applythen removes that row in its re-pin commit behind the usual--yes, the same yes that covers every other row it moves.- An explicit per-path flag on
apply(a name like--drop <path>). It is accepted only for such a row, and refused for any other row with the reason.check's NEXT does not pre-fill it, and the row's detail names it. adopt-project.py, the tool that made the copy and its follow-up, removes the row. For example, a step run after the follow-ups are merged, which removes the rows of merged-awayshape/copies in one commit on a branch.
In each option:
- the doctor's
shape currencyandpinsrows name that step as their NEXT; update-conflict's remediation forcopy-missingstops naming--accept-local;- the plan's follow-up says what happens to the row.
A pinned copy deleted anywhere else (not a merged-away shape/ copy) is outside the ruling and stays copy-missing as it is today. README's "drops the rows" and AGENTS.md:278-280 then follow the mechanism (#483's text).
How to test.
- An adoption test (local remotes) whose source keeps
.gitignoreandMakefile: do both follow-ups, remove the copies, and drive the chosen mechanism end to end. Afterwardsbootstrap.py,validate-pins.pyand the doctor are green, the copies' rows are gone, and nothing else in the pin has moved. - A
copy-missingrow outsideshape/is still refused. apply --accept-localon acopy-missingrow gets that state's own remediation, not the one written forboth.- If
adopt-project.pychanges, runtests/test_shape_doctor.pyandtests/test_scaffold_leg_path_collisions.pytoo.
Why v1.0.0. Nearly every repository has a .gitignore. Adopting one and doing the follow-up the plan prints breaks the project's make bootstrap and its validate check on every pull request, and the only exits are undoing the follow-up or the hand edit the standard forbids. Proposed P1.
Parent: #458 (update-shape and bump-leg).
Related: #480 (a kept Makefile and make bootstrap), #501 (a NEXT that pre-fills a consent flag), #483 (the docs pass).
Activity
brettheap commentedon Oct 12, 2026
CLAIMED — lane openRepoShape-4, session bf1c72df-1c56-4ac9-aace-3ddd139d7ea3@Eagle, 2026-10-12T23:34:19Z, for #502
Logged in
lanes/log/openRepoShape-4.mdatc0b1d3e4b9518ad9839f842051888d1acaca9dfd.The three reads (lane-collision-protocol Rule 1):
update-shape.py and shape-doctor.py: the `copy-missing` remediation o…
Merge origin/main d41cc29 into fix/update-shape-accept-local-and-merg…
shape-doctor.py: the `pins` row names `update-shape.py check` for a m…
docs/release-notes/v1.0.0.md: brought up to main d41cc29, so section …
shape_materialize.py: the `.gitattributes`-symlink paragraph of `coll…
Merge origin/main (cf118ff, #513) into fix/update-shape-accept-local-…
Merge origin/main 8beb3d9 into fix/adopt-root-kept-symlinks: #502 add…
Merge origin/main (8beb3d9, #512) into fix/adopt-gitattributes-lf-blo…
shape_materialize.py: the follow-up for a source's own `.gitattribute…
Merge main 8beb3d9 into fix/adopt-plan-quote-yaml-keywords (#181)
Merge origin/main (3121945, #494) into fix/adopt-gitattributes-lf-blo…
tests.yml and adopt-project.py: the Windows job installs git-filter-r…
tests/test_repo_hygiene.py and tests/test_readme_sections.py: a handb…