Skip to content

scaffold-project.py and adopt-project.py plan: a --pin-source that nothing reads (no --pin, and for the scaffold no --referent-chain link) is accepted in silence, even a path that does not exist, so --dry-run says nothing was created. and plan writes a plan, each exit 0 with no word that the flag changed nothing, where the root's own validate-pins.py notes such a value since #295 #451

Closed

Description

@brettheap

Lane: openreposhape-5 (openRepoShape-5)

(lane openRepoShape-5, 2026-10-12T18:55:05Z)

Found by lane 5's review of fix/adopt-pin-writes-pin-file at 7a94b6b (the fix for #273 and #339), its N5. This is #339's third decision, which that PR leaves open, so that closing #339 loses nothing. The scaffold half is pre-existing (origin/main 45e01f4); the adopt half is new with that PR, which gives adopt-project.py plan the scaffold's --pin-source. Reproduced on both, and on that branch's fix-round head 74ce4d9. Not claimed.

What is wrong. --pin-source <path> is read by declared_pin_values for each --pin (the digest), and, in the scaffold, by link_pins_from_trees as the default source of each --referent-chain link. With neither, nothing reads it: the run neither stats the path nor says anything about it. A person who typed --pin-source meaning to pin, and forgot the --pin, gets a project that declares no descent and a clean exit, and the run's own output never mentions the flag. The project's validate-pins.py already says this of its own --pin-source (#295): note --pin-source <value>: not used — <why>. (_note_unused_pin_sources), a note and never a finding.

SHAPE=<checkout of fix/adopt-pin-writes-pin-file>   # the scaffold rows hold on main too
STUB=$(mktemp -d); printf '#!/bin/sh\nexit 97\n' > "$STUB/gh"; chmod +x "$STUB/gh"
export PATH="$STUB:$PATH" GH_TOKEN=bogus GH_CONFIG_DIR=$(mktemp -d)
export GIT_AUTHOR_NAME=T [email protected] GIT_COMMITTER_NAME=T [email protected]
D=$(mktemp -d)
python3 "$SHAPE/scaffold-project.py" --org testorg --project Atlas --elected-by 'T H' \
    --elected-on 2026-09-02 --pin-source "$D/no-such-clone" \
    --local-remote-dir "$D/remotes" --work-dir "$D/work" --dry-run | tail -n 1; echo "exit ${PIPESTATUS[0]}"
git init -q -b main "$D/Thing" && cd "$D/Thing" || exit 1
mkdir -p src/app specs/001 && printf 'print(1)\n' > src/app/main.py && printf '# spec\n' > specs/001/spec.md
printf '# Thing\n' > README.md && git add -A && git commit -qm seed && cd "$D" || exit 1
python3 "$SHAPE/adopt-project.py" plan --source "$D/Thing" --project Atlas --org testorg \
    --elected-by 'T H' --elected-on 2026-09-02 --out plan.yaml \
    --pin-source "$D/no-such-clone" > /dev/null; echo "exit $?"; grep -c no-such-clone plan.yaml

Observed, Python 3.12.3:

run origin/main 45e01f4 the #273 branch (74ce4d9)
scaffold-project.py --pin-source <missing> --dry-run, no --pin exit 0, --dry-run: nothing was created., no word of the flag the same
adopt-project.py plan --pin-source <missing>, no --pin exit 2, unrecognized arguments: --pin-source (no such flag) exit 0, plan written, the path in it 0 times, no word of the flag

What it should do. #339 asked; the author decides:

Whichever it is, it belongs in ONE place both tools call (scripts/shape_materialize.py, beside declared_pin_values, once the #273 PR lands), and the scaffold's --referent-chain must count as a reader, since a chain link with no keyed source reads the bare --pin-source (link_pins_from_trees).

How to test. In tests/test_pin_source_unreadable.py (#339's file, which drives scaffold-project.py --dry-run, its real run and adopt-project.py plan through one helper), add --pin-source <missing> with no --pin: under "refuse", exit 2 and nothing made; under "note", exit 0 with the one line, and the line absent when a --pin (or, for the scaffold, a --referent-chain) is given. The session gh guard stays the gh that fails if called: no row needs one.

Not in this issue.

Related: #339, #295, #273.

Activity

  1. added this to the v1.1.0 milestone on Oct 14, 2026
  2. brettheap commented on Oct 14, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-2, session 81650e29-c906-4fe8-96c9-55580bfe0c44@Eagle, 2026-10-14T22:28:19Z, for #451

    Logged in lanes/log/openRepoShape-2.md at 180f0f2a28b138f7a71aa12c8e6def50b014fff9.

    The three reads (lane-collision-protocol Rule 1):

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#451:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#451"`, kept where the row or its body names `#451`:
    508	adopt-project.py: `plan --pin` takes `product@<40 hex>` and `execute` writes its pin file as the scaffold does, so an adopted root passes `validate-pins.py` (#273); a `--pin-source` that cannot answer is `pin-source-unreadable` (#339)	fix/adopt-pin-writes-pin-file	MERGED
    3. `git ls-remote --heads [email protected]:opensoft/openRepoShape` branches naming `451` as a whole token:
       none
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions