Skip to content

thirdshift pickup: take the lowest-numbered Ready issue and run it #282

Closed

Description

@JacobStephens2

Parent

#212

What to build

A new command, thirdshift pickup, that starts a Pickup run: one pass, with no Issue URL, that takes the lowest-numbered Ready issue in the repository and starts a Spec run or a Run on it, exactly as thirdshift <Issue URL> would from the same clone.

pickup is a command only as the first argument. It takes merge, no-merge, parallel <n>, base-fix, no-base-fix, email [<address>], no-email and base <branch>, each at most once, with or without dashes, and nothing else: no focus and no --plan-only. base <branch> names the Base branch as it does for architect, and the dispatched run takes it.

The pass makes the preflight checks an Architect run makes, then tries the same per-repository lock an Architect run takes, so each is skipped while the other runs. It then lists the repository's open issues labelled ready-for-agent, lowest number first, and takes the first that is a Ready issue.

This Ticket implements the core of the Ready issue rule: labelled ready-for-agent, carrying none of the Unready Ticket labels, and never started (no Issue branch for it on origin, and no pull request from one, open, merged or closed). The rest of the rule is the next Ticket.

The issue is dispatched as a Spec run when it has sub-issues and a Run otherwise, with the flags given and the User config for the rest. parallel <n> applies to a Spec run and is ignored, with no error, when the issue is not a Spec. The dispatched run's ending is the Pickup run's: its exit code, its pull request's URL alone on stdout, its last line on stderr.

A pass is skipped, exit 0 with stdout empty and one line of reason on stderr, when the lock is held or when there is no Ready issue. The Run notification for a Pickup run is a later Ticket: until then the dispatched run behaves as it would by hand.

Acceptance criteria

  • With two Ready issues, thirdshift pickup runs the lower-numbered one and leaves the other untouched.
  • A Ready issue with no sub-issues is run as a Run, and one with sub-issues as a Spec run, each ending as that run does by hand: exit code, stdout and last stderr line.
  • A progress line names the issue taken before it is dispatched.
  • An issue without ready-for-agent is never taken.
  • An issue labelled ready-for-agent and also ready-for-human, needs-info, wontfix or needs-triage is not taken.
  • An issue with an Issue branch on origin, or with a pull request from one in any state, is not taken.
  • An issue labelled in-progress is not taken.
  • With no Ready issue, the pass exits 0 with stdout empty and a line saying so, and starts no session.
  • While an Architect run or another Pickup run on the repository holds the lock, the pass exits 0 with stdout empty and a line saying so; an Architect run started while a Pickup run holds it is skipped the same way, and its reason covers both.
  • merge, no-merge, base-fix and no-base-fix, and the User config's defaults, reach the dispatched run.
  • parallel <n> reaches a dispatched Spec run, and is ignored without error for an issue that is not a Spec.
  • base <branch> makes that branch the Base branch of the dispatched run, from a clone on another branch.
  • A focus, --plan-only, a repeated or contradictory flag, or any other argument is an argument error, exit 2.
  • The preflight checks an Architect run makes stop the pass before any label changes.
  • thirdshift help lists the command, and the README has a short section on it.
  • End-to-end cases in a new test file cover the above, with the fake gh gaining what they need, such as listing issues by label.

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an AFK agent

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions