Repository navigation
adopt-project.py check passes a plan that keeps the source's own shape/ in the root, and place() then writes the shape's collision copy onto it after both legs are pushed: a real shape/README.md is overwritten while execute prints "nothing was overwritten" and ends adopt-lost, and a shape/Makefile/ directory or a file named shape is a traceback #262
Description
(lane openRepoShape-1, 2026-10-11T21:44:09Z)
Found by this lane's adversarial review of the #183 branch (fix/adopt-root-kept-symlinks at 04792d2): the no-symlink half of its B2, out of that branch's scope. Pre-existing on main 39ac59c, and identical on 04792d2 but for the third case below.
What is wrong. When the source already holds a path the shape writes (README.md, Makefile, .gitignore, ...), the materializer writes the shape's copy beside it under shape/. place() never asks whether that collision path is itself taken. A source can keep its own shape/ in the root: plan sends a shape/ directory to a leg by extension majority, and the person answers root. check then says plan ok, both legs are created and pushed, and then:
- A real
shape/README.mdis overwritten by the shape's README.executeprintsbeside shape/README.md (... nothing was overwritten), pushes the split branch with the overwritten file, and its verification endsadopt-lost. - A
Makefilebeside a real directoryshape/Makefile/: the copy lands on the directory, andexecutedies in anIsADirectoryErrortraceback. - A plain file named
shape:executedies in aFileExistsErrortraceback. (On 04792d2 this case isREFUSED materialize-blocked, still after both legs.)
SHAPE=<openRepoShape checkout>
export GIT_AUTHOR_NAME=T [email protected] GIT_COMMITTER_NAME=T [email protected]
run_case() { # $1 = a label; $2 = what the source adds beside README.md, src/ and docs/; $3 = the plan entry kept in the root
TMP=$(mktemp -d)
git init -q -b main "$TMP/Thing" && cd "$TMP/Thing" || exit 1
mkdir src docs && printf 'print(1)\n' > src/app.py && printf '# Spec\n' > docs/spec.md
printf '# Thing\n' > README.md && sh -c "$2" && git add -A && git commit -qm init
echo "== $1"
python3 "$SHAPE/adopt-project.py" plan --source "$TMP/Thing" --project Northwind --org testorg \
--elected-by 'T H' --elected-on 2026-09-02 --out "$TMP/plan.yaml" >/dev/null
python3 - "$TMP/plan.yaml" "$3" <<'EOF'
import re, sys
plan, path = sys.argv[1], sys.argv[2]
text = open(plan).read()
text = re.sub(rf"(?m)^( - path: {re.escape(path)}\n leg: )\S+$",
r'\1root\n resolution: "the source keeps it in the root"', text)
open(plan, "w").write(text)
EOF
python3 "$SHAPE/adopt-project.py" check --plan "$TMP/plan.yaml" | tail -1
python3 "$SHAPE/adopt-project.py" execute --plan "$TMP/plan.yaml" --yes \
--local-remote-dir "$TMP/remotes" --work-dir "$TMP/work" > "$TMP/out" 2> "$TMP/err"
echo "execute exit $?:"
grep -E '^ beside' "$TMP/out"; grep -E '^REFUSED|^FINDING|^[A-Za-z]*Error' "$TMP/err" | sed "s#$TMP#<T>#g"
echo "leg repositories: $(ls "$TMP/remotes" | tr '\n' ' ')"
if git rev-parse -q --verify adopt/three-repo-shape >/dev/null; then
echo "the split branch's shape/README.md starts: $(git show adopt/three-repo-shape:shape/README.md | head -1)"
fi
}
run_case 'a real shape/README.md, shape/ answered root' 'mkdir shape && printf "# Our shape notes\n" > shape/README.md' 'shape/'
run_case 'a Makefile and a real directory shape/Makefile/, shape/ answered root' 'printf "all:\n\techo hi\n" > Makefile && mkdir -p shape/Makefile && printf "x\n" > shape/Makefile/notes.md' 'shape/'
run_case 'a plain file named shape, answered root' 'printf "a file named shape\n" > shape' 'shape'Observed on main 39ac59c:
== a real shape/README.md, shape/ answered root
plan ok
execute exit 1:
beside shape/README.md (the source already has README.md; nothing was overwritten)
FINDING adopt-lost: shape/README.md (16d42eb05931) is in no leg, not in the root tree, and not listed as drop
leg repositories: Northwind-code.git Northwind-spec.git
the split branch's shape/README.md starts: # Northwind
== a Makefile and a real directory shape/Makefile/, shape/ answered root
plan ok
execute exit 1:
IsADirectoryError: [Errno 21] Is a directory: '<T>/work/Northwind/shape/Makefile'
leg repositories: Northwind-code.git Northwind-spec.git
== a plain file named shape, answered root
plan ok
execute exit 1:
FileExistsError: [Errno 17] File exists: '<T>/work/Northwind/shape'
leg repositories: Northwind-code.git Northwind-spec.git
In the first case the source's own shape/README.md (# Our shape notes) is gone from the split: the pushed branch carries the shape's README in its place. In every case both leg repositories exist and are pushed on main.
Why it matters.
- The first case overwrites a file of the source's own in the split commit and says, on the line before, that nothing was overwritten. The plan's own follow-up says it too: "merge shape/README.md into README.md: ... the shape's copy was written beside it and NOTHING was overwritten". Only the verification notices.
- The other two end in a Python traceback that names no plan entry.
- In all three, both leg repositories exist and are pushed when the run stops. Against GitHub those are two real repositories, and a corrected re-run meets them as
leg-remote-exists. - The README promises the opposite: "Ambiguous is an answer, and nothing is overwritten" (
README.md:766), and a colliding shape file "is written undershape/and the collision becomes a follow-up for a human to merge" (README.md:775-777).
Where (main 39ac59c):
scripts/shape_materialize.py:1304-1322,place(). Whentarget/relexists, it writescollision_dir/relwithout asking whether that path exists, is a directory, or lies under a file.path.parent.mkdir(parents=True, exist_ok=True)then raises for a file namedshape.scripts/shape_materialize.py:17-25: the module docstring's promise that a collision is written beside the original and never overwrites.adopt-project.py:169(COLLISION_DIR = "shape"), and:2741-2746, which materializes with it and prints thebeside ... nothing was overwrittenline for every collision.adopt-project.py:1404-1427,_predict_collisions:planalready predicts each collision copy's path,shape/<path>, fromassembly_root_paths()(scripts/shape_materialize.py:1144), to write the follow-ups. It never asks whether the root keeps that path, andcheckpredicts nothing.
What would fix it.
checkpredicts the collision copies asplace()will make them, as_predict_collisionsalready does forplan: every path inassembly_root_paths()that the planned root already holds moves toshape/<path>. It then reports a FINDING when a copy's path, or a directory above it, is something the planned root keeps.executerefuses the same plan before any leg exists, through 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's list.place()refuses, never writes, when its collision path is taken: defence in depth, as the materialize_assembly_root writes the shape files through a root-kept symlink to anywhere on disk, and crashes with a traceback on a link loop, after both legs are pushed #183 branch does for symlinks.
Related. #183 and #178: the symlink half of this. On the #183 branch's pushed head (04792d2) the first two cases above are unchanged, and the third is REFUSED materialize-blocked after both legs; that branch's check follows the collision copies only for symlinks. #172 (PR #198): assembly_root_paths(). The companion issue on a plain file kept at a directory the shape writes, filed beside this one.
Not claimed.
🤖 Generated with Claude Code
Activity
brettheap commentedon Oct 11, 2026
CLAIMED — lane openRepoShape-5, session e62c2fd7-176d-429d-89fb-0653dd08ad5f@Eagle, 2026-10-11T23:22:36Z, for #262
Logged in
lanes/log/openRepoShape-5.mdatff5d260f35b3a1e64a478ee0f0bb6cf26e9cdcee.The three reads (lane-collision-protocol Rule 1):
adopt-project.py: `check` asks, of a disk that ignores case, whether …
adopt-project.py: the shared case phrase is imported as `_CASE_ASIDE`…
Merge origin/main (71b58a1) into fix/adopt-template-values-utf8: #313'…
shape_materialize.py: `render` substitutes in one pass and refuses on…
Merge origin/main 71b58a1 into fix/adopt-relative-submodule-url: #262/#…
Merge origin/main (71b58a1: #238 via #287, #196 via #231, #254 via #281…
Merge origin/main (71b58a1) into fix/adopt-plan-quote-yaml-keywords
Merge origin/main (71b58a1) into fix/adopt-late-failure-notice
tests: main's check-skipped materializer test reads the refusal `exec…
Merge origin/main 71b58a1 into fix/adopt-root-kept-symlinks: #204, #203…
adopt-project.py: a symlink kept AT the copy under `shape/` of a path…
shape_materialize.py: where a symlink leads the shape's copy is #262'…
adopt-project.py: `check` says a symlink that leads the shape's copy …
tests/test_adopt_root_symlinks.py: the module docstring says where th…
adopt-project.py: a symlink with an empty target is left to #303's `p…
adopt-project.py: `check` follows each declared pin's file, `contract…
adopt-project.py: `check` follows each symlink the plan keeps where t…
adopt-project.py: `check` names what the clone's `.git` holds as git …
adopt-project.py, shape_materialize.py and tests: a named bad link le…