Skip to content

Pickup moves on to the next Ready issue when it loses a reservation - #1577

Merged
JacobStephens2 merged 2 commits into
issue-1564from
issue-1570
Oct 28, 2026
Merged

JacobStephens2 merged 2 commits into
issue-1564from
issue-1570

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

A Pickup run that loses the origin reservation (ADR 0017), or whose selection went stale once it held the reservation, now moves on to the next Ready issue in its pickup.order. It is skipped only when no Ready issue it can reserve is left.

 run_through
   gates → Sweep, Claim limit, ready_issue(order, None)
-  reserve(ready) or skip IssueUnavailable(#n)
+  loop
+    reserve(ready)                    # take ref, refresh; a stale one's ref is released
+      ok   → break and dispatch
+      none → step "#n is reserved by another Pickup run or is no longer Ready; check refs/…/pickup/n"
+             ready_issue(order, past: Some(n))   # list again, search only past #n
+               none → skip NoneReservable { tried }
  • ready::first(.., past) / Search::past starts the search after the issue already tried, so lines for issues passed over are not printed twice. A Spec that was tried still keeps its Tickets silent. PickupOrder::comes_after holds the order rule in one place, and the InMemory test double uses it too.
  • The new skip reason is no Ready issue on <owner>/<repo> it can reserve, past #7 and #9; check refs/heads/thirdshift/pickup/7, refs/heads/thirdshift/pickup/9 on origin if one stays reserved. It still exits 0, sends no Run notification and makes no Claim.
  • Docs updated in docs/guide.md (step 6 and the skip paragraph, with site/docs/index.html regenerated), the Pickup run entry in GLOSSARY.md, ADR 0017 (amended in place) and site/how-it-works/.

Closes #1570

Evidence

  • Before: on issue-1564, run_through skips with Skipped::IssueUnavailable as soon as reserve returns None. A second Ready issue is never tried. That is the behaviour docs/grill-with-docs/1532-keep-working-the-backlog.md cites.
    After: new and extended tests, all passing:
pickup_race (tests/pickup_run.rs), extended
  TwoIssues             #7, #9 Ready; both hosts select #7 → loser says #7 is reserved, takes #9
                        sessions = {#7: 1, #9: 1}; #9 in-progress; one Run notification (the loser's)
  Issue / Spec          one Ready issue → loser exits 0, last line "…it can reserve, past #7; check …"
                        no Run notification; #7's labels, refs and PRs untouched by the loser
  FailedWinnerThenNext  winner fails and restores Ready → loser's refresh sees the Claim, takes #9
an_issue_that_stopped_being_ready_once_reserved_is_released_and_the_next_taken
a_ready_issue_another_host_reserved_is_passed_over_for_the_next_in_its_order   (both orders; other host's ref kept)
with_every_ready_issue_reserved_elsewhere_the_pass_is_skipped_with_no_notification
the_next_ready_issue_tried_is_reserved_recording_the_host_holding_it
a_rejected_reservation_of_the_next_ready_issue_fails_before_any_claim_or_session
an_uncertain_push_reserving_the_next_ready_issue_retains_it_without_dispatching
pickup::tests  passed over for the next / highest-first downward / skip naming each tried / reservation error fails
ready::tests   search past an issue (both orders; issue no longer listed; past the last; Ticket of a tried Spec)
  • cargo test --test pickup_run: 112 passed. cargo test --bin thirdshift: everything passes except 22 sandbox::tests, which fail on this host with sandbox failed to start: socat is not on PATH. This change does not touch src/sandbox.rs.
  • npm test --prefix site: 51 passed. npm run docs:check --prefix site: exit 0. cargo clippy --all-targets -- -D warnings: clean.
  • Integration suites that share the changed seams: architect_run 91, pickup_model 4, security_run 123 and status 74, all passing. A full cargo test --test '*' sweep was not completed here. bug_origins failed on this host for reasons outside this change (tomllib is missing from Python, and sandbox tests need socat), and the sweep hung in experiments, so I stopped it. CI covers the rest.

Merge Danger

Door: two-way

No data or ref format changes. Reservations are taken and released exactly as before, once per issue tried.

Blast Radius: Pickup

A Pickup run may now make more reservation pushes and more Ready issue listings per pass, at most one of each per Ready issue it fails to reserve. The skip reason in the Activity log changed wording, from #n is reserved… to no Ready issue on … it can reserve, past #n; check ….

Review

Reviewed with thirdshift-code-review against issue-1564. Standards raised 8 findings, all judgement calls; Spec raised 2, neither claiming wrong behaviour. Fixed: S1 (one order rule), S3 and S4 (one name: unreservable), S7 (ADR wording and amendment marker), S8 ("another Pickup run"), P1 (the race now checks the Run notification) and P2 (the skip reason keeps the reservation refs for the Activity log).

Coverage: both reviewers read every changed file. site/docs/index.html is generated from docs/guide.md; docs:check passed, and both reviewers also read its diff. No changed file was left unread.

Unaddressed findings

Standards

  • S2 (Data Clumps / Shotgun Surgery: past threaded through Outside::ready_issue, with Security passing None). Declined. src/ready.rs:1-6 says any run asks whether a repository has a Ready issue "against the very same definition". A separate Pickup-only search method would add a second seam to that one definition. The only cost is that Security and Architect pass None.
  • S5 (Primitive Obsession: pickup_race's bool tuple grows to five, tests/pickup_run.rs:322-325). Declined. The tuple shape predates this change, and A Pickup run that loses a reservation takes the next Ready issue #1570 asks for the existing pickup_race to be extended, not reshaped. A restructure belongs in its own test refactor.
  • S6 (Middle Man: the search_ordered test helper only calls search_past). Declined. The reviewer called it acceptable, since it saves editing the existing call sites.

Spec

None.

Security

None. Reviewed the diff against the merge base, plus the reservation (src/pickup/reservation.rs) and Ready search (src/ready.rs) code it relies on. Every issue tried still goes through the Trusted account check, both when it is selected and when it is refreshed after being reserved. If an issue's selection went stale, its reservation is released before the next issue is tried. Another host's reservation is never touched. The loop is bounded because each search only looks past the issue just tried. Ref names are built only from issue numbers (u64).

Built with claude 2.1.312 · claude-opus-5-5 · high

Security review outcome

No unaddressed introduced findings.

…1570)

A Pickup run that loses the origin reservation, or whose selection went
stale once reserved, releases any reservation of its own and searches again
past that issue in pickup.order. It is skipped only once no Ready issue it
can reserve is left, with exit 0 and no Run notification.
…ation in race

Standards S1, S3, S4, S7, S8 and Spec P1, P2.
@JacobStephens2
JacobStephens2 merged commit 5d9ee83 into issue-1564 Oct 28, 2026
18 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-1570 branch October 28, 2026 23:50
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.

1 participant