Skip to content

Prevent duplicate Pickup runs across machines - #788

Merged
JacobStephens2 merged 5 commits into
mainfrom
issue-712
Oct 19, 2026
Merged

JacobStephens2 merged 5 commits into
mainfrom
issue-712

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

select Ready issue + Claim generation
  reserve issue on origin → busy: skip
  recheck Ready + active Claim + generation → stale: skip
  Run / Spec run
    preserve work → end Claim → release owned reservation

Origin arbitrates competing Pickup hosts before either touches an Issue branch or PR. Reservation commits contain no source files or ancestry.

Closes #712

Evidence

Test seams: the thirdshift pickup CLI against independent clones sharing origin and GitHub; the origin reservation interface against real Git repositories.

  • Before: the two-clone race started a second implement session. Review reproductions also exposed unrelated local files in the reservation and duplicate dispatch after a failed winner restored Ready.
    After: deterministic regressions pass for standalone issues, Specs, successful/failed winners, stale listings with active Claim history, and local-only files. The race tests disable settling on both hosts.
  • Passing checks: cargo check, cargo fmt --check, cargo clippy --all-targets -- -D warnings, and the complete cargo test --no-fail-fast run (2 ignored tests). All 74 Pickup integration tests pass.

Review: Standards found one duplication smell, addressed. Spec found two behavior defects; both were reproduced and fixed, with the regressions retained. Both axes read all 15 paths in the pinned main...HEAD review diff, including upstream reconciliation. Unread changed files: none. Generated-output exclusions: none.

Unaddressed findings

  • Standards: none.
  • Spec: none.
  • Security: none. Guidance review covered all 13 paths in 7fd5d27f6adcd4bef4e8f1bdb2916b1756ae7757...HEAD and supporting code; no introduced security findings. Sandboxed cargo test --offline --test pickup_run -- --test-threads=4: 74 passed, with external networking disabled.

Security review outcome

No unaddressed introduced findings.

Merge Danger

Door: two-way

Blast Radius: Pickup

All Pickup hosts must upgrade to honor reservations. A crash can leave a reservation for the Day shift to release after confirming the owner stopped; no automatic expiry can take work from a slow host. Direct Issue URL commands keep their existing behavior. Recovery is documented in ADR 0017.

Built with codex · gpt-6.1-sol · high

@JacobStephens2
JacobStephens2 merged commit d569463 into main Oct 19, 2026
18 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-712 branch October 19, 2026 02:19
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.

Two machines' Pickup runs can take the same Ready issue at once

1 participant