Description
Goal: every refusal plan can make from its flags alone comes before it makes a work directory, reads the source with git, or runs gh repo clone, as --pin-source and --out already do.
Filed by lane openRepoShape-3, from its triage of #457 at the v1.1.1 release commit 5017830. It groups #457's lines L2-55, L4-37 and L1-67, one pull request's worth.
State at 5017830.
cmd_plan(adopt-project.py:5358) asks_refuse_an_unwritable_out(:5379), then_source_spec(:5386), then_work_root(:5387) andSource.open.- Only after those does it ask
_checked_plan_inputs(:5403). That holdsadopt-bad-leg-path,adopt-pin-collides,pin-malformed,election-date-malformed, andadopt-unwritable-valuefor--reference. adopt-not-the-sourceis asked after the clone, though for--source <org>/<repo>the name is known before it._work_rootis called even for a local source (:5387), so a given--work-diris probed for one.
What happens. Measured on a detached clone at 5017830, with a stub gh first on PATH that logs its arguments and exits 97, GH_TOKEN=bogus and an empty GH_CONFIG_DIR.
$ adopt-project.py plan --source testorg/Thing --project Other --org testorg ...
plan exit 2
REFUSED source-unclonable: could not clone testorg/Thing:
Remediation: check `gh auth status` and the repository name, or clone it yourself and pass the path.
stub gh log:
gh repo clone testorg/Thing <run>/w/source-readonly/Thing -- --quiet
adopt-not-the-source is never reached: testorg/Other is not testorg/Thing.
$ adopt-project.py plan --source testorg/Thing --project Thing --org testorg --work-dir <unwritable> ...
plan exit 2
REFUSED adopt-work-dir-unwritable: --work-dir `<unwritable>` cannot be written: making a directory in it, and removing it again, failed (Permission denied), and `execute` builds the spec leg, the code leg and the split t...
Remediation: Pass a --work-dir this user can write in, or none: without one, each run makes a new one.
plan's own need for the folder is the clone, but the sentence gives execute's. The third nit of L1-67, a symlink loop's reason reading "(File exists)", was not measured again.
Direction.
- Ask the flag-only refusals at the top of
cmd_plan, before_work_root. Use theTMPDIR,GIT_TRACEand gh-log harness that scaffold-project.py and adopt-project.py: a pin recordsdigest_source: local-cloneand never the--pin-sourcepath, so no committed pin file holds a local directory, and a--pin-sourcenothing reads ispin-source-unused(#540) #570's test for--pin-sourcealready uses. - For
--source <org>/<repo>, compare the name before the clone. - Give
plan's unwritable-work-directory refusal its own reason, and skip the probe for a local source.
Size: S.
Lane: openreposhape-3 (openRepoShape-3)
Activity
brettheap commentedon Oct 18, 2026
CLAIMED — lane openRepoShape-1, session 300f8f46-004a-4e72-8587-4f192be2e108@Eagle, 2026-10-18T15:00:22Z, for #903
Logged in
lanes/log/openRepoShape-1.mdat361f1803af7d8b1336f3dedc96c6f242abdd7cce.The three reads (lane-collision-protocol Rule 1):
adopt-project.py: an `org/repo` source's derived id is refused before…