Repository navigation
Description
This was generated by AI during triage.
Problem
When a pull request changes during a Review run, the run's committed fixes are never published. They stay in a retained Review worktree, which then keeps that pull request out of every later review --author Pass. Nothing releases it: the author's new commits don't, and neither does the Pass firing every two minutes. The pull request is never reviewed again until someone deletes the worktree and local branch by hand.
This happened to both waiting pull requests on one host on 2026-11-10 (thirdshift 0.27.0, a private repository, one thirdshift review --author <login> crontab line every two minutes):
- Author pushed during the run. The run captured head
76f529d,review-and-addresscommitted two fixes on top, and the author pushed87597e2while the session ran. Delivery failed withthe branch moved during Review runand warnedretaining checkout /tmp/thirdshift-review-… and local branch … at c79aabb…: the worktree has unpushed commits. - Pull request made draft during the run.
review-and-addresssucceeded with a fix commit, then the run ended withpull request … is a draftand the same retention warning. The author later marked it ready and pushed five more commits.
From then on, conflicts::eligible (src/processes/review/conflicts.rs) found a pull_request_conflict for each and skipped them. Because the retained branch no longer descends from the pull request's current head, the recovery described in the guide ("its captured head is the PR's current head") can never apply. One failure notification went out per conflict state (#1780). After that, the hold appeared only as a suppressed skip; #1962.
Related, but not the same: #1800 is about a stale head at the start of a run. Here the head was current at the start and moved during the session.
Proposed behavior (for triage to decide)
When the pull request's current head has moved past the retained worktree's captured head, and the worktree holds only clean committed fixes descending from that captured head (no uncommitted edits, no unfinished Git operation, same ownership token):
- Try to carry the fixes forward. Rebase or cherry-pick the fix commits onto the new head in the worktree. If that applies cleanly, deliver them as recovery does today, or rerun review on the new head with the fixes in place.
- Otherwise release them. Save the fixes durably, as a patch or bundle beside the Command log and named in the Activity log, and post the patch, or a pointer to it, as a pull request comment if that fits ADR 0015 / Trusted-account rules. Then remove the worktree and local branch so the next Pass reviews the new head.
Anything outside that narrow shape (dirty tree, foreign branch, changed ownership) stays preserved for the Day shift, as today.
Decisions needed
- Carry forward (1) at all, or always release (2)? A rebase onto someone else's newer commits means fixes the author hasn't seen land on top of their work.
- Does the draft case behave the same way, or should a draft pull request keep its retained worktree until it is marked ready?
- Where should the saved fixes live, and for how long?
Workaround
Delete the retained worktree and its local branch on the host. conflicts::eligible clears the suppression file on the next Pass.
Activity
JacobStephens2 commentedon Nov 10, 2026
Prevention counterpart: #1974 proposes a quiet period before a Review Pass takes a pull request, which would avoid most of these cases. This issue still covers the ones that get through.
JacobStephens2 commentedon Nov 11, 2026
Investigation summary
Confirmed the mechanism for #1961 on selected Base
main, commit960513a91e3ca30df2dbfce46b625e91833d0e7c(0.28.0).src/processes/review/delivery.rs:245refuses publication when the PR head differs from the captured head. Draft eligibility checks also stop delivery.src/worktree/ownership.rs:209preserves worktrees containing unpushed commits.src/worktree/review_recovery.rs:310requires exact equality between the recorded captured head and the current PR head before recovery. Ancestry alone cannot authorize recovery, even if the newer head includes retained commits.src/processes/review/conflicts.rsrejects that checkout during later author Passes. Its suppression record controls notifications; it provides no recovery or expiry.Two qualifications: a draft made ready again can recover if its head remains unchanged. Also, the conflict fingerprint includes the current PR head, so subsequent pushes can re-enable notification without releasing the checkout.
Existing regression tests passed for moved-head/draft delivery refusal, conflict suppression, same-head recovery, and changed-head recovery refusal. The private-host incidents themselves were not inspected.
Recommended direction
Save committed fixes privately and verify the archive before releasing a clean, positively owned worktree and factory-created local branch. Preserve uncertain ownership, unfinished operations, dirty work and pre-existing local branches. Archive failure must leave the original work intact. Keep automatic carry-forward as a separate policy decision. Public patch publication needs an explicit policy consistent with ADR 0015; retained work can include Security-review fixes.
This remains distinct from #1800 (stale head at acquisition), #1962 (visibility of held PRs), and #1974 (quiet-period prevention). Keep #1961 open for the decisions and proposed split below.
Questionnaire
For the Day shift: #1961's blocking mechanism is confirmed locally. The repository defines preservation guards but does not settle the following recovery policy.
logs.dirand retained until manually removed? Specify a different location or retention period if needed; this determines when cleanup is safe.JacobStephens2 commentedon Nov 11, 2026
Another instance on 2026-11-11, thirdshift 0.27.2, on lima-thirdshift:
f3499cda"Address review of the Quota wait" (6 files), then failed withpull request changed during Review run. A Spec run on orchestrate was delivering the same pull request.retaining checkout /tmp/thirdshift-review-hKBqk9 and local branch issue-1994 at f3499cda…: the worktree has uncommitted changes. The only "change" was an untracked.review-logs/directory the session had written for its own build and test output, so the session's own scratch files are enough to retain a worktree.retained Review worktree captured a different pull request head.Cleaned up by hand on 2026-11-11 at about 11:30 EST. The commit is kept as local branch
salvage/review-2004-f3499cda, the logs are in~/.thirdshift/salvage/review-2004-f3499cda/on that host, the worktree was removed and localissue-1994was deleted.The cause in this case, a Review Pass taking a pull request that a live Spec run is still delivering, is filed separately: #2037.
JacobStephens2 commentedon Nov 19, 2026
Two more instances on 2026-11-18 (thirdshift 0.37.0, lima-thirdshift): Review runs on #2281 and #2286 ended
failedwith retained checkouts, because their pull requests were merged mid-run. Prevention is split out: #2290 (Spec-run Ticket PRs slip past the admission holds) and #2291 (stop a Review run when its pull request is merged or closed).