Skip to content

Pickup passes over a Ready Spec whose Tickets are all closed, even when its Spec PR needs work #1964

Closed

Description

@JacobStephens2

This was generated by AI during triage.

From a 2026-11-10 investigation of why Spec #1901, labelled ready-for-agent, was not running anywhere in the fleet.

Agent Brief

Category: enhancement
Summary: A Pickup run passes over a Ready Spec with every Ticket is closed, even when its Spec branch is on origin and its Spec PR still needs work. Taking it by hand already does the right thing. Pickup should take it too.

Current behavior:

src/ready.rs passes over any Spec whose sub-issues are all closed, with Reason::TicketsClosed (the first read at about line 541, and again after reading its Tickets at about line 559). Neither check looks at whether a Spec branch or Spec PR exists, or whether the Spec was handed back with ready-for-agent.

Running the Spec by hand already covers this case (docs/guide.md, "Running the Spec again picks up where the last Spec run stopped"): with every Ticket closed, the Spec run goes straight to the Spec review and the Spec PR. It refuses only when there is no Spec branch (every Ticket is closed and there is no Spec branch; nothing to do, src/run.rs).

On 2026-11-10:

The pass-over came from #324 (55a824db) and was reworded in ccbd3f07 ("Say every Ticket is closed when a Spec's Tickets closed since its read"). Neither commit considered a handed-back Spec with an unfinished Spec PR.

Desired behavior:

A Pickup run takes a Ready Spec whose Tickets are all closed when its Spec branch is on origin, and dispatches the Spec run as thirdshift <Spec URL> would: the Spec review, then the Spec PR's Delivery and Repair loop.

With every Ticket closed and no Spec branch on origin, it still passes over the Spec with every Ticket is closed, so the Spec run never ends with nothing to do.

The Architect run's Ready-issue gate should agree with Pickup on which Specs count as Ready.

Key interfaces:

  • src/ready.rs: the two Reason::TicketsClosed checks consult whether the Spec branch exists on origin.
  • Whatever already reads the Spec branch for a Spec run's Continuation (ADR-0002).
  • docs/guide.md, the Pickup selection rules and the passed-over reasons ("Even with a hand-back, a Spec with every Ticket closed is passed over…"): says when such a Spec is taken.

Acceptance criteria:

  • A ready-for-agent Spec whose Tickets are all closed, with its Spec branch on origin, is selected by a Pickup run, and the dispatched Spec run reaches the Spec review without running any Ticket again.
  • The same Spec without a Spec branch on origin is passed over with every Ticket is closed, as now.
  • A Spec whose Tickets close between the candidate read and the Ticket read follows the same rule.
  • Reservation and Claim behave as for any other Ready issue.
  • Tests run through the CLI against the fake gh.

Out of scope:

Activity

  1. added
    enhancementNew feature or request
    needs-triageMaintainer needs to evaluate this issue
    in-progressA Claim: thirdshift has taken this issue
    and removed
    needs-triageMaintainer needs to evaluate this issue
    on Nov 10, 2026
  2. JacobStephens2 commented on Nov 11, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Agent Brief

    Confirmed on selected Base commit 6f4ba5d. Keep #1964 as one actionable Ticket; no split is needed.

    Diagnosis and evidence

    • src/ready.rs:541 and :559 reject every all-closed Spec, including one handed back with ready-for-agent and a resumable Spec branch. Allowing it through only the first check would still hit the later TicketsClosed or NoStartableTicket check.
    • src/run.rs:302 rejects all-closed Specs only when branch selection is Fresh. A Continuation already proceeds to Spec review and Delivery without rerunning closed Tickets.
    • A standalone CLI reproduction compiled from stdin using existing tests/support fixtures confirmed the exact mismatch: Spec Numbered Issue branches after a merged or closed PR #7 had closed Ticket Keeping the PR mergeable: merge the Base branch and conflict Repair #8, origin branch issue-7, an open Spec PR and a settled hand-back after its Claim ended. Pickup exited successfully with 'Numbered Issue branches after a merged or closed PR #7 every Ticket is closed' and no agent session. Running the same issue URL directly performed exactly one Spec review on issue-7, updated the existing PR and reran no Ticket. All writes were confined to fake GitHub and fixture repositories inside this worktree.
    • Pickup's post-reservation recheck uses ready::refresh (src/pickup.rs:205), which calls the same standing_of predicate. Architect uses ready::before_architect through src/pass.rs:237, so the correction belongs in shared readiness logic.

    Implementation

    Allow a genuine all-closed Spec through both rejection points and exempt that continuation from requiring a Startable Ticket when its resumable Spec branch exists on origin. Preserve trust, hand-back, settling, blocker, Claim, reservation and Claim-generation checks. Specs with open but unstartable Tickets must remain ineligible.

    Use ADR-0002-compatible continuation facts. src/branch.rs:198 shows that Started records historical evidence; it does not establish continuation eligibility. A PR without an origin branch must not qualify, and a retained branch whose latest PR is closed or merged must retain the existing Fresh-selection behavior. Check eligibility without acquiring a worktree. Preserve rejection when the later Ticket read is empty.

    Acceptance and validation

    Add CLI regressions against fake gh for all-closed continuations with an origin branch and either no PR or an open PR; assert Spec review/Delivery runs without any Ticket session. Cover Tickets closing between candidate and Ticket reads, selection and post-reservation refresh, Architect priority including settling, and absent hand-back. Retain no-branch, empty-list, open-but-unstartable and finished-PR protections. Reservation and Claim behavior must remain unchanged; follow the verify-pickup skill when modifying readiness.

    Update GLOSSARY.md definitions for Ready issue, Startable Ticket and Architect run; docs/guide.md Pickup rules, passed-over reasons and Architect gate descriptions; and relevant hand-written site wording, including site/how-it-works/index.html:238. Regenerate the manual from its source.

    Existing validation passed: 31 readiness unit tests, two all-closed Pickup CLI tests, and the direct all-closed Spec continuation CLI test. The standalone reproduction also passed. No source or Git-history changes were made.

  3. added
    ready-for-agentFully specified, ready for an AFK agent
    in-progressA Claim: thirdshift has taken this issue
    and removed
    in-progressA Claim: thirdshift has taken this issue
    ready-for-agentFully specified, ready for an AFK agent
    on Nov 11, 2026
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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions