Repository navigation
openRepoShape --doctor, the form AGENTS.md names first and the one --install gives a person, prints every NEXT command as a path into its temporary clone of the standard, which its EXIT trap deletes before the person can paste the command, so each one fails with can't open file; and it refuses --json and --placement-plan, which AGENTS.md's doctor steps 7 and 4 use #500
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-01), re-verified on main 437a360. Lane 4 claims it.
What is wrong. AGENTS.md's compliance section opens with "openRepoShape --doctor [<path>] — or ./shape-doctor.py --root <path> from a checkout" (AGENTS.md:205-206). README says that, installed, "it clones the standard into a temporary directory first" (README.md:1105-1115). Then AGENTS.md says:
- step 3: a FINDING "carries the exact next command … Run the one the row names" (:226-232);
- step 4: run
shape-doctor.py --root <path> --placement-plan <file>(:239-241); - step 7: use
--json(:258-259).
Installed, every NEXT names a file under $TMPDIR/tmp.XXXX/shape/. "Installed" means no checkout beside the command, which is what openRepoShape --install places. The command deletes that directory as it exits, so pasting any of those NEXT lines fails with python3: can't open file …: [Errno 2] No such file or directory, exit 2. The --upstream that the shape currency NEXT passes is the same deleted clone. And --doctor refuses every argument except the path, so --json and --placement-plan cannot be asked for at all.
Reproduction. Offline, on Linux. $U is a checkout of main 437a360.
- The one file
$U/openRepoShapeis copied to$R/bin/, with nothing beside it, as--installwould place it. OPENREPOSHAPE_REPO=$U, so the standard is cloned from a local path and never from GitHub;TMPDIR=$R/tmp.- A
ghthat exits 97 stands first on PATH (themachinerow asks it--versionandauth status);GIT_ALLOW_PROTOCOL=fileis set, and git reads an empty global config.
- A plain repository
$R/plainrepo: one commit, no manifest.$R/bin/openRepoShape --doctor $R/plainrepo:standard <R>/tmp/tmp.eYSPsRzNqg/shape NEXT python3 <R>/tmp/tmp.eYSPsRzNqg/shape/adopt-project.py plan --source <R>/plainrepo --project plainrepo NEXT python3 <R>/tmp/tmp.eYSPsRzNqg/shape/setup-project.py --preflight # it names each missing prerequisite and offers to install it, on a typed yes NOT A SHAPE ROOT (exit 2) - After it exits,
$R/tmpholds 0 entries. - Each NEXT, pasted as printed:
Exit 2 each.
python3: can't open file '<R>/tmp/tmp.eYSPsRzNqg/shape/adopt-project.py': [Errno 2] No such file or directory python3: can't open file '<R>/tmp/tmp.eYSPsRzNqg/shape/setup-project.py': [Errno 2] No such file or directory - A project scaffolded with local remotes, with its pinned
.gitignoreedited and committed: the verdict isDRIFTED, and theshape currencyNEXT ispython3 <R>/tmp/tmp.TwP4HtqAFh/shape/update-shape.py check --root <R>/Atlas --upstream <R>/tmp/tmp.TwP4HtqAFh/shape # then apply …. Afterwards$R/tmpagain holds 0 entries. --doctor $R/plainrepo --json, and--doctor $R/plainrepo --placement-plan $R/pp.yaml, each give:Exit 2 each.REFUSED: --doctor takes a path and nothing else; it reads a repository and writes nothing. To scaffold, drop --doctor. To check this machine, run: openRepoShape --preflight
Run from a checkout (python3 $U/shape-doctor.py --root …), the same rows name files under $U that exist, and --json and --placement-plan are shape-doctor.py's own flags (shape-doctor.py:5394-5400).
Why. At 437a360:
- The clone is deleted on exit.
workdirsetstrap 'rm -rf -- "$WORKDIR"' EXIT(openRepoShape:112-117).shape_checkoutclones the standard into$WORKDIR/shape(:329-350).run_doctorrunsshape-doctor.pyfrom that clone and then returns: "RUN, neverexec: the EXIT trap that removes a cloned checkout belongs to THIS process" (:379-410, the comment at :400-401). So the trap removes the clone. - Every printed command is built from that clone. The doctor builds each command it prints from
ctx.shape, the standard it was run from:- the way in (shape-doctor.py:4948-4950);
- machine (:4761);
- shape currency, its
--upstreamincluded (:2500-2519); - CANNOT ANSWER's
git -C <standard> fetch --all(:2438); - placement (:3649-3654);
- agent files (:3982-3990) and the template-validator lines (:1259);
- naming (:1606).
- The flags are refused. The argument loop refuses anything beside the path (openRepoShape:463-471). Its comment says
--jsonis "deliberately not plumbed through here while the mode is one path wide". - Tests pin both halves.
test_the_shim_from_stdin_clones_the_standard_firstasserts that the clone does not outlive the run (tests/test_shape_doctor.py:2067-2092).test_the_shim_doctor_takes_a_path_and_nothing_else(:2098) pins the refusal. No test pastes a NEXT from an installed run.
Proposed fix (for review on the PR). Options for Brett:
- Keep the standard in a stable cache. Clone into a per-user cache, for example
${XDG_CACHE_HOME:-~/.cache}/openRepoShape/<ref>, fetch it on each run and never delete it, so every NEXT names files that exist. Cost: a directory the person did not ask for, and rules for when it is stale. - Keep this run's clone and say so. Drop the EXIT trap for
--doctor, and have the report's last line name the directory and say it is safe to delete. Cost: one temporary directory left behind per run. - Print NEXT lines that do not depend on the clone. The shim tells the doctor how its standard is reached (an env var, say), and the doctor then names
openRepoShape …forms, or "from a clone of openRepoShape: …". Cost: every row's NEXT gets two spellings, and the other tools (update-shape.py,adopt-project.py) have no installed form today.
In each option, --json and --placement-plan <file> are passed through to shape-doctor.py, with a relative <file> resolved against the directory the person ran from. AGENTS.md:205-206 then says what the installed form gives (#483's text).
How to test. Extend the shim tests in tests/test_shape_doctor.py:
- Run the installed form (
bash -s -- --doctor, withOPENREPOSHAPE_REPOa local path) on a plain repository and on a drifted project. - After the shim has exited, run every NEXT as pasted (the part before
#), and assert that none fails withcan't open file. --jsongives the same rows as the checkout's--json, and--placement-plan <file>writes that file and nothing else.- Adjust the two tests named in Why to the chosen option.
Why v1.0.0. openRepoShape --doctor is the form AGENTS.md and README name first, and the only one a person has who installed the command and holds no checkout. AGENTS.md's step 3 is "run the command the row names", and from the installed form no row's command can run. P2 rather than P1 because it fails loudly, creates nothing, and the checkout form named in the same sentence works. Proposed P2.
Parent: #460 (doctor).
Activity
brettheap commentedon Oct 12, 2026
CLAIMED — lane openRepoShape-4, session bf1c72df-1c56-4ac9-aace-3ddd139d7ea3@Eagle, 2026-10-12T23:32:21Z, for #500
Logged in
lanes/log/openRepoShape-4.mdatb0030200baceef99ff1002fd7883b6123b0d9d20.The three reads (lane-collision-protocol Rule 1):
Merge origin/main into fix/installed-doctor-keeps-clone: the handbook…
openRepoShape --doctor: the kept clone's last line no longer claims N…
Merge origin/main into fix/installed-doctor-keeps-clone: main moved to …
Merge origin/main (d52b100, #462's `--reuse-empty-repo` change) into …
docs/release-notes/v1.0.0.md: brought up to main d41cc29, so section …
Merge origin/main (89c6a6c) into fix/installed-doctor-keeps-clone: th…
Merge origin/main (173c00e) into fix/adopt-project-must-be-source-nam…
Merge origin/main (cf118ff, #513) into fix/update-shape-accept-local-…
Merge origin/main (8beb3d9, #512) into fix/adopt-gitattributes-lf-blo…
Merge main 8beb3d9 into fix/adopt-plan-quote-yaml-keywords (#181)