Skip to content

adopt-project.py plan: refusals that need only the flags come after the work directory, the source's git reads and gh repo clone #903

Closed

Description

@brettheap

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) and Source.open.
  • Only after those does it ask _checked_plan_inputs (:5403). That holds adopt-bad-leg-path, adopt-pin-collides, pin-malformed, election-date-malformed, and adopt-unwritable-value for --reference.
  • adopt-not-the-source is asked after the clone, though for --source <org>/<repo> the name is known before it.
  • _work_root is called even for a local source (:5387), so a given --work-dir is 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.

Size: S.

Lane: openreposhape-3 (openRepoShape-3)

Activity

  1. added this to the v1.2.0 milestone on Oct 18, 2026
  2. brettheap commented on Oct 18, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoShape-1, session 300f8f46-004a-4e72-8587-4f192be2e108@Eagle, 2026-10-18T15:00:22Z, for #903

    Logged in lanes/log/openRepoShape-1.md at 361f1803af7d8b1336f3dedc96c6f242abdd7cce.

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

    1. existing `CLAIMED —` comments on opensoft/openRepoShape#903:
       none
    2. `gh pr list --repo opensoft/openRepoShape --state all --search "#903"`, kept where the row or its body names `#903`:
       none
    3. `git ls-remote --heads [email protected]:opensoft/openRepoShape` branches naming `903` 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