Repository navigation
Description
This was generated by AI during triage.
From a 2026-11-11 check of the fleet's open pull requests (thirdshift 0.27.2 on every host).
Agent Brief
Category: bug
Summary: A review --author Pass takes a pull request while a live Ticket run or Spec run is still delivering it, on this or another host. The Delivery's next push makes the Review run fail with pull request changed during Review run, and its committed fixes are stranded in a retained Review worktree (#1961).
Current behavior:
- A Review run reserves the pull request:
Reservation::take(src/processes/review.rsaround line 226) createsrefs/thirdshift/reservations/<PR number>and refuses a pull request labelledin-progress. - A Ticket run or Spec run reserves its issue (
refs/heads/thirdshift/pickup/<issue>) and Claims the issue within-progress. It takes no reservation and adds no label on its pull request. - Neither checks the other's reservation. During Delivery (the Repair loop and CI watch), the pull request's head has no agent review, so the Review Pass treats it as waiting.
Observed on 2026-11-11, with review --author JacobStephens2 on lima-thirdshift every 15 minutes:
| Pull request | Live Command delivering it | Review run on lima | Outcome |
|---|---|---|---|
| #2004 (Spec #1994) | Spec run on orchestrate, Repair and CI watch | 09:46–10:14 EST | pull request changed during Review run. Commit f3499cda "Address review of the Quota wait" (6 files) never pushed. Worktree /tmp/thirdshift-review-hKBqk9 and local branch issue-1994 retained. Later Review Passes skipped #2004 (retained Review worktree captured a different pull request head) until removed by hand. |
| #2021 (#2016) | Ticket run on stephens | 10:16–10:50 EST | pull request changed during Review run. |
| #2024 (#2018) | Ticket run on thirdshift.app, CI watch | started 11:01 EST, still running at 11:30 | — |
Each Review session costs 20–40 minutes of Harness use, and its work is lost whenever the Delivery pushes again.
Desired behavior:
A Review Pass passes over a pull request while a live Command is delivering it, and takes it once that Command has ended, so a Review run never races a Ticket run's or Spec run's Delivery. It logs the pass-over reason (e.g. #2024 is being delivered by a live Ticket run for #2018), as other per-candidate skips are logged.
Choose the mechanism in triage. Options:
- The Review Pass treats a pull request as held while any of its closing issues has a
refs/heads/thirdshift/pickup/<issue>reservation onorigin, or carriesin-progress. - Ticket runs and Spec runs also take
refs/thirdshift/reservations/<PR number>for the length of Delivery, so the existingReservation::takerefusal applies.
Option 2 also protects the other direction, where a Delivery starts while a Review run holds the pull request. Option 1 needs no change to Ticket runs.
review <PR URL> typed by hand keeps its current behavior, or warns.
Key interfaces:
src/processes/review.rsandsrc/processes/review/conflicts.rs: candidate eligibility.src/reservation.rs: reservation refs for issues and pull requests.docs/guide.md, Review runs: say which pull requests a Review Pass passes over.
Acceptance criteria:
- With a Ticket run's issue reservation on
originfor the pull request's closing issue,thirdshift review --author <login>does not take that pull request. It takes the next eligible one, or skips with a reason naming the pull request and the Command holding it. - The same holds for a Spec PR whose Spec is reserved by a live Spec run.
- Once the reservation is released, the next Review Pass takes the pull request.
- A pull request with no closing issue behaves as now.
- Tests run through the CLI against the fake
gh, with twothirdshiftprocesses.
Out of scope:
- Publishing or recovering fixes stranded by a moved head (Review run: a pull request that changes mid-run strands its fixes in a retained worktree and is never reviewed again #1961).
- Skip reasons for retained worktrees (Review Pass: name pull requests held by retained Review worktrees in the skip reason and Needs you #1962).
- Waiting for an author's pushes to settle (Review Pass: wait until a pull request's head has been quiet before reviewing it #1974). That covers human pushes; this issue covers a live thirdshift Command.
Activity
JacobStephens2 commentedon Nov 11, 2026
Agent Brief
Confirmed against selected Base commit 482507a (thirdshift 0.29.0). Keep this as one bug issue.
Diagnosis and evidence
Review Pass admission in src/processes/review.rs:39 checks the PR's reservation and eligibility, but never checks its closing issues. src/review/reservation.rs:21 reserves the PR number in both the legacy Pickup namespace and the PR reservation namespace, then checks the PR's labels. Neither reservation covers a differently numbered closing issue.
Pickup holds its issue reservation through dispatch and Claim ending (src/pickup.rs:260). Direct Ticket and Spec commands make an issue Claim without a Pickup reservation (src/run.rs:321). Consequently, checking issue refs alone would miss direct commands.
A scratch harness using the existing Scenario support, real Git, fake gh and two thirdshift processes reproduced Review completing from a separate clone while a direct Ticket run, a direct Spec run, or a Pickup-dispatched Ticket run remained in CI watch. Their linked issues still carried in-progress; the Pickup case also held its issue reservation. A separate case confirmed that a held closing-issue reservation alone does not prevent Review admission.
Chosen implementation
Use option 1 with both signals: a Review Pass passes over a PR whenever any linked closing issue has an in-progress Claim or an issue reservation on its origin. Preserve explicit review behavior.
Add a focused, paginated closing-issue lookup using the existing GraphQL query and URL parsing in src/github/review.rs:345 and :493. Check the linked issues during Pass selection and recheck after acquiring the PR reservation, before worktree inspection or sessions. Inspect reservation refs read-only; never acquire, release or expire another Command's issue reservation. Preserve repository identity when checking refs so unrelated repositories' issue numbers cannot collide. Failed observations must not authorize admission.
Log the skipped PR, the holding issue/Command and the observed Claim or reservation, then continue to the next candidate. Identify a Ticket or Spec run only when supported by evidence. Retain existing PR reservation cleanup.
This chooses the issue's proposed admission guard. It addresses a Command already delivering when Review selects its PR; it does not establish mutual exclusion against a Delivery started after Review. Existing captured-head checks remain necessary.
Acceptance and validation
Add permanent CLI regressions in tests/review_pass.rs using two processes and separate clones sharing a bare origin: live Ticket and Spec Delivery, reserved and direct-command paths, selection of the next eligible PR, an explanatory all-held skip, and selection after the issue Claim/reservation ends. Cover multiple closing issues, pagination, a PR without closing issues, and unchanged explicit-URL behavior. Retained reservations remain held until operator recovery, consistent with ADR 0017.
Update docs/guide.md's Review runs section, regenerate site/docs/index.html, and update GLOSSARY.md and the Review Pass description in site/index.html. Search the other hand-written site pages for affected descriptions. Run focused tests and scripts/affected-tests main.
Local validation passed: scratch reproduction 4/4; review_pass 14/14; existing a_changed_pr_stops_before_posting_recommendations regression 1/1. The affected-test selector reported no changed files.
Related issues #1961, #1962, #1974 and #1800 cover recovery, retained-worktree diagnostics, settling delays and stale initial heads respectively; this issue is distinct.
JacobStephens2 commentedon Nov 11, 2026
Handing back after the Console Stop at 12:33 EST, at the Day shift's request. The Agent Brief above still stands. The next Pickup continues on the preserved branch.