Skip to content

Pass over a Spec that has no Startable Ticket - #921

Merged
JacobStephens2 merged 3 commits into
mainfrom
issue-884
Oct 21, 2026
Merged

JacobStephens2 merged 3 commits into
mainfrom
issue-884

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

A Pickup run now passes over a Spec that has no Startable Ticket, instead of Claiming it for a Spec run that can only fail.

 standing_of(candidate)            # src/ready.rs
   … every earlier Ready issue gate …
   if Spec and every Ticket closed  → "every Ticket is closed"
   if not settled                   → "not settled: …"
+  if Spec:
+    tickets = read Tickets         # only for Specs past every other gate
+    if none open                   → "every Ticket is closed"   (closed since the first read)
+    if none startable              → "has no Ticket that can start: #883 labelled needs-info; …"
   Ready

There is now one rule, used by both callers:

spec_run::unstartable(spec, ticket)   # Closed | OutsideRepo | Unready(label) | HasSubIssues | Blocked
  ├── TicketBoard::next_to_start      # plus "no blocker running", "not started this Spec run"
  └── ready::standing_of              # Pickup, Architect runs, and the refresh after reservation

Docs: docs/guide.md gets the new Ready issue condition and its passed-over line. GLOSSARY.md gets Startable Ticket and an updated Ready issue. docs/code-navigation.md is updated, and site/docs/index.html is regenerated.

Evidence

  • Before: with Spec Numbered Issue branches after a merged or closed PR #7 whose only open Ticket Keeping the PR mergeable: merge the Base branch and conflict Repair #8 is needs-info, thirdshift pickup took Numbered Issue branches after a merged or closed PR #7: it added in-progress, pushed issue-7, and the Spec run failed with Tickets not done: #8 (tourbot#880).
    After: tests/pickup_run.rs:
    • a_spec_whose_only_open_ticket_is_unready_is_passed_over_changing_nothing: exit 0, stderr #7 has no Ticket that can start: #8 labelled needs-info, GitHub state unchanged, no issue-7 on origin, no email.
    • a_spec_whose_open_tickets_are_all_blocked_names_why_each_cant_start: #8 blocked by #9; #9 labelled ready-for-human; #10 blocked by #30 (outside the Spec).
    • a_spec_with_one_startable_ticket_and_one_unready_ticket_is_taken.
    • a_handed_back_spec_with_no_startable_ticket_is_passed_over.
    • once_its_ticket_is_no_longer_unready_the_next_pass_takes_the_spec.
  • Inline tests in src/ready.rs cover:
    • each reason: outside the repository, has sub-issues, blocked outside the Spec;
    • the gate's place last in the reason order;
    • that Tickets are never read for a Spec that fails an earlier gate;
    • the race where Tickets close between the two reads, which still says every Ticket is closed. The review found this: both new tests failed with #7 has no Ticket that can start: before the fix.
  • cargo clippy --all-targets -D warnings is clean. The full cargo test passes (55 test binaries, 0 failed). npm run docs:check passes.

Merge Danger

Door: two-way

Nothing is written. Pickup only passes over more issues, and reverting restores the old behaviour.

Blast Radius: Pickup-and-Architect

A Spec with no Startable Ticket now waits for the Day shift instead of being Claimed and failed. Architect runs use the same Ready issue search, so such a Spec no longer counts as a Ready issue that holds them back. Pickup makes one extra GraphQL read (the Tickets query a Spec run already makes) for each Spec that passes every other gate. The Spec run's choice of next Ticket keeps its behaviour, now through the shared rule.

Unaddressed findings

Standards

  • Foreign issues are named differently in passed-over lines. The new line names a foreign Ticket by its URL. Reason::Ticket uses owner/repo#n. Declined: the new line matches how the Spec run names the same Ticket in its lines and Tickets checklist (TicketBoard::name in src/spec_run/ticket_board.rs). So the Pickup line and the Spec run's unready: outside the Spec's repository line refer to that Ticket the same way.
  • Duplicated blocked by join in Reason::Blocked and Unstartable::Blocked. Declined: they are one-line formats over different inputs. One takes u64 numbers; the other takes IssueUrls, with (outside the Spec) marking. A shared helper would need both shapes and simplify nothing.
  • Possible Feature Envy in spec_run::unstartable. Declined, as the reviewer also recommends. Ticket is the GitHub adapter's type, and the domain rule belongs with the Spec run that owns it.
  • Facts keeps both sub_issue_is_open and tickets (test fixture). Declined: when tickets is unset, InMemory::tickets derives startable Tickets from sub_issue_is_open. That keeps the existing src/ready.rs tests unchanged. The new tests build both from one list through spec_with.

Spec

  • TicketBoard::standing keeps its own order of unready reasons for the Tickets checklist. Declined: the issue asks that "Pickup's check and the Spec run's choice of next Ticket use the same rule". Both now call spec_run::unstartable. The checklist's standing mixes in states outside that rule (landed but still open, in a cycle, running, failed), so it stays where it is. This is reporting, not a decision a Spec or the Day shift must make, so no issue was filed.

Review coverage

site/docs/index.html was not read by either reviewer. It is generated output, excluded after cd site && npm run docs left no further diff and node generate-docs.mjs --check exited 0; its source, docs/guide.md, was reviewed. Every other changed file was read.

Closes #884

🤖 Generated with Claude Code

Built with claude · claude-opus-5-5 · medium

Security review outcome

No unaddressed introduced findings.

JacobStephens2 and others added 3 commits October 20, 2026 19:18
A Pickup run took a Spec whose open Tickets were all Unready or blocked,
Claimed it and pushed its Spec branch, only for the Spec run to fail with
nothing it could start. Pickup now reads a Spec's Tickets once it passes
every other gate, and passes it over with a line naming why each open
Ticket can't start. The rule is spec_run::unstartable, which the Ticket
board's choice of next Ticket uses too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Tickets read comes after the candidate read, so a Spec whose last
open Ticket closed in between was passed over with an empty "has no
Ticket that can start" line. Rename the line's helper to what it
returns, and the test helper that local closures shadowed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JacobStephens2
JacobStephens2 merged commit 2a9d713 into main Oct 21, 2026
19 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-884 branch October 21, 2026 00:11
@JacobStephens2 JacobStephens2 mentioned this pull request Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pass over a Spec that has no Ticket a Spec run could start

1 participant