Repository navigation
adopt-project.py and scaffold-project.py substitute the template placeholders one after another, so a free-text value holding another placeholder's token is expanded (--elected-by '{{SPEC_PATH}}' is recorded as elected_by: "spec") or, after the legs are pushed, refused as template-unsubstituted with "a defect in the substitution table of the tool you ran" #260
Description
(lane openRepoShape-1, 2026-10-11T21:40:34Z)
Found by this lane's re-verification of the #181 branch (fix/adopt-plan-quote-yaml-keywords at a0ff15b), out of that branch's scope. Pre-existing on main 39ac59c, and identical on the #181 branch.
What is wrong. render substitutes the placeholders one key at a time, each over the whole text, so text inserted by an earlier key is scanned again by every later one. A free-text value can therefore hold another placeholder's token: --elected-by and --reference in both tools, and the scaffold's --name.
- A token for a key that comes later in the table is expanded.
--elected-by '{{SPEC_PATH}}'is recorded aselected_by: "spec", and the run saysadoption verified. - A token for a key that came earlier, or one no key names, stays in the output. There
renderfinds it and raisestemplate-unsubstituted, with a remediation that blames the tool: "this is a defect in the substitution table of the tool you ran, not in your invocation".{{PROJECT}}has a value, and it is still refused as having none.
Neither tool asks about {{ in these values before it creates anything, and check passes the plan. Both refusals come after the legs are pushed.
SHAPE=<openRepoShape checkout>
export GIT_AUTHOR_NAME=T [email protected] GIT_COMMITTER_NAME=T [email protected]
for who in '{{SPEC_PATH}}' '{{NOPE}}'; do
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 && git add -A && git commit -qm init
echo "== adopt-project.py plan --elected-by '$who'"
python3 "$SHAPE/adopt-project.py" plan --source "$TMP/Thing" --project Northwind --org testorg \
--elected-by "$who" --elected-on 2026-09-02 --out "$TMP/plan.yaml" >/dev/null
echo "plan exit $?, the plan says $(grep '^elected_by:' "$TMP/plan.yaml")"
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>&1
echo "execute exit $?"; grep -E '^REFUSED|^Remediation|^adoption verified' "$TMP/out"
for leg in spec code; do
echo "Northwind-$leg.git holds: $(git -C "$TMP/remotes/Northwind-$leg.git" for-each-ref --format='%(refname:short)' refs/heads)"
done
if git rev-parse -q --verify adopt/three-repo-shape >/dev/null; then
git show adopt/three-repo-shape:project.yaml | grep '^elected_by:'
fi
done
echo "== scaffold-project.py --elected-by '{{PROJECT}}'"
TMP=$(mktemp -d)
python3 "$SHAPE/scaffold-project.py" --org testorg --project Atlas --elected-by '{{PROJECT}}' \
--elected-on 2026-09-02 --local-remote-dir "$TMP/remotes" --work-dir "$TMP/work" > "$TMP/out" 2>&1
echo "scaffold exit $?"; grep -E '^REFUSED|^Remediation' "$TMP/out"
for r in Atlas Atlas-spec Atlas-code; do
echo "$r.git holds: $(git -C "$TMP/remotes/$r.git" for-each-ref --format='%(refname:short)' refs/heads)"
doneObserved on main 39ac59c:
== adopt-project.py plan --elected-by '{{SPEC_PATH}}'
plan exit 0, the plan says elected_by: "{{SPEC_PATH}}"
plan ok
execute exit 0
adoption verified: every source path is in exactly one place
Northwind-spec.git holds: main
Northwind-code.git holds: main
elected_by: "spec"
== adopt-project.py plan --elected-by '{{NOPE}}'
plan exit 0, the plan says elected_by: "{{NOPE}}"
plan ok
execute exit 2
REFUSED template-unsubstituted: README.md: no value for ['{{NOPE}}']
Remediation: this is a defect in the substitution table of the tool you ran, not in your invocation.
Northwind-spec.git holds: main
Northwind-code.git holds: main
== scaffold-project.py --elected-by '{{PROJECT}}'
scaffold exit 2
REFUSED template-unsubstituted: README.md: no value for ['{{PROJECT}}']
Remediation: this is a defect in the substitution table of the tool you ran, not in your invocation.
Atlas.git holds:
Atlas-spec.git holds: main
Atlas-code.git holds: main
The scaffold's --reference '{{NOPE}}' fails the same way. --name '{{NOPE}}' fails one step earlier, rendering templates/spec-root/AGENTS.md after all three repositories exist and before either leg is pushed.
Why it matters.
- A value is recorded as something other than what the person gave. Above, the project's elector is recorded as
specinproject.yamland in the shape's README, underadoption verified. - The refusal comes after both leg repositories are created and pushed (by the scaffold, after all three are created). Its remediation tells the person the tool is broken, so they report a bug instead of changing the value. Meanwhile the repositories are left behind for the re-run to meet as
leg-remote-exists, which against GitHub means real repositories to delete first. {{is unlikely in a name. It is possible in a--referencethat quotes a templated path or a document that uses the same notation.
Where (main 39ac59c):
scripts/shape_materialize.py:928-938,render: the loop ofstr.replaceover the table, then thePLACEHOLDER_RE(:306) scan of the output, and the remediation at:935-937.adopt-project.py:2842-2891,_template_values.REFERENCE(:2864) andELECTED_BY(:2866) come afterPROJECT(:2854) and beforeSPEC_PATH(:2869).adopt-project.py:2741-2743: the refusal is raised from_commit_the_split, after_create_leg_remotes(:2794) and_build_the_legs(:2806).scaffold-project.py:1062-1090, the scaffold's table:PROJECT_NAME:1065,REFERENCE:1069,ELECTED_BY:1070.- The templates that carry the free text:
templates/assembly-root/README.md:9-10,templates/assembly-root/project.yaml:32,:42and:46, andtemplates/spec-root/AGENTS.md:1.
What would fix it. Substitute in one pass, so that a value is inserted literally and never scanned again: one PLACEHOLDER_RE.sub with a lookup in the table. Then look for leftovers among the tokens the TEMPLATE holds that the table lacks, which is the defect template-unsubstituted's remediation describes, and not in the output, which now carries the person's text. A test renders each free-text value as {{<every key>}} and {{NOPE}} and reads it back unchanged, in both tools.
Related. #181 (the same free-text values, its YAML half). No open issue or PR covers the substitution.
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:24:02Z, for #260
Logged in
lanes/log/openRepoShape-5.mdatdac421716ad85533865209ec474bb5b88d8c7077.The three reads (lane-collision-protocol Rule 1):
shape_materialize.py and adopt-project.py: a template validator that …
test_template_values_single_pass.py: `render`'s `.yml` spelling, its …
shape_materialize.py: `render` substitutes in one pass and refuses on…
Merge origin/main (a1b3a4b) into fix/adopt-plan-quote-yaml-keywords
adopt-project.py: the misread gate asks the materializer's own `rende…
Merge origin/main (a1b3a4b: #299 via #315, #216 via #228, #260 via #316…
Merge origin/main 8cdca5e into fix/adopt-root-kept-symlinks: thirteen…
scaffold-project.py and adopt-project.py ask the project's YAML reade…