Repository navigation
Description
(lane openRepoShape-1, 2026-10-11T21:44:54Z)
Found by this lane's adversarial review of the #183 branch (fix/adopt-root-kept-symlinks at 04792d2), its N2. That branch handles symlinks, and this is a plain file. Pre-existing on main 39ac59c.
What is wrong. The shape writes files into three directories of the assembly root: .github/workflows/validate.yml, contracts/*.yaml and scripts/*.py. A source can hold a plain FILE at one of those directory names, and a plan can keep it in the root:
planasks about a file named.github(leg: null).plansends a file namedcontractsto spec and a file namedscriptsto code, and a person can answerroot.
check says plan ok. execute creates and pushes both legs, and then the materializer dies in a Python traceback: NotADirectoryError for .github, FileExistsError for contracts and scripts.
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' ' ')"
}
run_case 'a plain file .github (plan asks), answered root' 'printf "a plain file\n" > .github' '.github'
run_case 'a plain file contracts (plan says spec), answered root' 'printf "a plain file\n" > contracts' 'contracts'
run_case 'a plain file scripts (plan says code), answered root' 'printf "a plain file\n" > scripts' 'scripts'Observed on main 39ac59c:
== a plain file .github (plan asks), answered root
plan ok
execute exit 1:
NotADirectoryError: [Errno 20] Not a directory: '<T>/work/Northwind/.github/workflows'
leg repositories: Northwind-code.git Northwind-spec.git
== a plain file contracts (plan says spec), answered root
plan ok
execute exit 1:
FileExistsError: [Errno 17] File exists: '<T>/work/Northwind/contracts'
leg repositories: Northwind-code.git Northwind-spec.git
== a plain file scripts (plan says code), answered root
plan ok
execute exit 1:
FileExistsError: [Errno 17] File exists: '<T>/work/Northwind/scripts'
leg repositories: Northwind-code.git Northwind-spec.git
On the #183 branch's pushed head (04792d2), each case ends in a clear refusal instead of a traceback, but still after both legs: execute exit 2 with, for example, REFUSED materialize-blocked: .github/workflows/validate.yml cannot be written: .github is a file, not a directory.
Why it matters.
- Both leg repositories are created and pushed before the run stops. Against GitHub those are two real repositories, and a corrected re-run meets them as
leg-remote-exists. - On main the stop is a traceback that names no plan entry.
- The conflict is visible in the plan before anything is made: the planned root keeps a file where the shape needs a directory. It is the same failure mode adopt-project.py accepts a leg mount path that collides with a directory the shape writes, such as
--spec-path contracts, so the adoption fails after both legs are pushed (main: at the first bootstrap) #172 and adopt-project.py: a source entry the plan keeps at the root at a leg mount path (a submodule, directory or file namedspecorcode) passescheckasplan okand dies at the mount after both leg remotes are pushed, so the re-run meetsleg-remote-exists#191 closed for other paths:plan ok, then a failure after the legs exist.
Where (main 39ac59c):
scripts/shape_materialize.py:1304-1322,place().path.exists()is false for.github/workflows/validate.ymlunder a file.github, so it callspath.parent.mkdir(parents=True, exist_ok=True), which raisesNotADirectoryError, orFileExistsErrorwhen the file is the parent itself.scripts/shape_materialize.py:1144,assembly_root_paths(): the list of paths the shape writes, whose directories are.github/workflows/,contracts/andscripts/.adopt-project.pyholds the two leg mount paths to it (adopt-project.py accepts a leg mount path that collides with a directory the shape writes, such as--spec-path contracts, so the adoption fails after both legs are pushed (main: at the first bootstrap) #172;_shape_collisionsatadopt-project.py:1060, through theshape_path_collisionsit shares with the scaffold since scaffold-project.py accepts a leg path that collides with a path the shape writes (--spec-path contracts,--code-path project.yaml), creates all three repositories and pushes both legs, then dies: #172's shape half on the scaffold side #197,scripts/shape_materialize.py:1217), but never a path the plan keeps in the root.adopt-project.py'scheck(_entry_findings) has no finding for a root-kept file at a directory prefix of a shape path.
What would fix it.
checkreports a root-kept entry that is a file at a directory prefix of any path inassembly_root_paths()(.github,.github/workflows,contracts,scripts). The FINDING names the entry and the shape path it blocks. Its remediation: send the entry to a leg,dropit, or rename it in the source and re-runplan.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.- 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's
materialize-blockedstays as the materializer's own defence.
Related. #183 and #178: the symlink half; that branch's refusal is the after-the-legs half of this. #172 (PR #198): assembly_root_paths(). #168: execute refuses what check finds. The companion issue on the collision directory shape/, 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:53Z, for #263
Logged in
lanes/log/openRepoShape-5.mdat754009998e30cf74e6b87836b1ebea6cc852197a.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`…
adopt-project.py: `check` finds, and `execute` refuses before any leg…
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…
shape_materialize.py: where a symlink leads the shape's copy is #262'…