Repository navigation
Description
This was generated by AI during triage.
Problem
When starting a Review run, github.review_pull_request samples snapshot.head from GitHub's pull request REST object (node["head"]["sha"]) and launch.fetch fetches both &snapshot.branch and &snapshot.head:
src/processes/review/conflicts.rs:let snapshot = github.review_pull_request(pr)?; launch.fetch(&[&snapshot.branch, &snapshot.head])?; let conflict = SkillWorktree::pull_request_conflict(launch, &snapshot.branch, &snapshot.head)?;
src/processes/review.rs:launch.fetch(&[ &snapshot.branch, &snapshot.base, &snapshot.head, &snapshot.base_head, ])?; let mut worktree = SkillWorktree::on_pull_request(&launch, &snapshot.branch, &snapshot.head)
However, neither conflicts::eligible nor SkillWorktree::on_pull_request (acquisition::inspect_review / Acquisition::inspect) checks that the fetched remote-tracking ref refs/remotes/origin/<snapshot.branch> (fetched_origin(&snapshot.branch, ...)) actually points to snapshot.head.
If refs/heads/<branch> on origin has moved ahead of the head.sha reported by GitHub's pull request API—either because GitHub's PR metadata lagged behind a push to origin/<branch> or because a push landed between github.review_pull_request and launch.fetch—the Review run:
- Creates the review worktree and local branch
refs/heads/<branch>at the stalesnapshot.headcommit (behindrefs/remotes/origin/<branch>). - Runs every review, security, and validation session (
code-review,security-review,process-step-3) on the stale commit. - Fails at the very end in
Delivery::push_fixes(src/processes/review/delivery.rs) when--force-with-lease=refs/heads/<branch>:<snapshot.head>is rejected byorigin:git push --no-verify --force-with-lease=refs/heads/marketing/group-signup-email-card:8abc3e0a6a147e489882ec970e156d1d376d8f60 origin 437e1188b6711dbbe6ef093e98e589ea2d9a0e4f:refs/heads/marketing/group-signup-email-card failed: error: failed to push some refs to 'https://github.com/Educational-Travel-Adventures/tourbot.git' To https://github.com/Educational-Travel-Adventures/tourbot.git ! [rejected] 437e1188b6711dbbe6ef093e98e589ea2d9a0e4f -> marketing/group-signup-email-card (stale info) - Retains the review worktree with new commits parented on the stale
snapshot.head, producing a two-headed divergence between the retained local branch andorigin/<branch>that cannot be fast-forwarded or automatically recovered by Recover retained Review fixes and skip unchanged local conflicts #1787.
Observed incident (Educational-Travel-Adventures/tourbot#2060)
- At
09:54–10:44, Review run20261105T095401-0500~MM5zYQxi5VURKHICreviewed PR Exclude Suspended time from Slow and Silent #2060 at8abc3e0a6, committed fixes (c4262be01,4fc9a72ac), and failed inprocess-step-3before pushing, retaining/tmp/thirdshift-review-Pn08bZand local branchmarketing/group-signup-email-cardat4fc9a72ac. - At
11:01:49,4fc9a72acwas pushed from the Launch directory toorigin/marketing/group-signup-email-cardand the retained worktree/branch was removed. - GitHub updated
refs/heads/marketing/group-signup-email-cardto4fc9a72ac, but GitHub's PR object (pulls/2060head.sha/refs/pull/2060/head) failed to resync and remained stuck at8abc3e0a6. - At
12:20, Review run20261105T122002-0500~qZDSwMTgoBLZ2xkzsampledsnapshot.head = 8abc3e0a6, fetchedorigin/marketing/group-signup-email-card(4fc9a72ac), checked out8abc3e0a6anyway, spent 1h 07m 55s generating new review commits (cb106ee8c,437e1188b) on top of8abc3e0a6, and failed atDelivery::push_fixeswith(stale info), leaving/tmp/thirdshift-review-Rn12ZNdiverged fromorigin/marketing/group-signup-email-card.
Direction
Verify after launch.fetch (in acquisition::inspect_review / Acquisition::inspect, shared by SkillWorktree::pull_request_conflict and SkillWorktree::on_pull_request) that fetched_origin(branch) equals the expected PR start (snapshot.head):
- If
refs/remotes/origin/<branch>does not matchsnapshot.head, refuse acquisition before creating the worktree or starting any session. - Because
conflicts::eligiblecallsSkillWorktree::pull_request_conflict, an unattendedthirdshift review --authorPass will skip the PR while GitHub's PRhead.shaandorigin/<branch>disagree, suppress repeated failure notifications via~/.thirdshift/review-conflicts/while the fingerprint (including the observedorigin/<branch>head) is unchanged, and automatically clear the suppression oncesnapshot.headandorigin/<branch>converge.
Activity
JacobStephens2 commentedon Nov 10, 2026
Investigation summary
Confirmed on selected Base dbdd894.
The real CLI, using local Git repositories and the repository's fake GitHub/Harness adapters, accepted a stale PR head despite a newer fetched origin branch. Three sessions ran: review, security review and final validation. Delivery then failed with
stale info, retaining two fix commits divergent from one newer origin commit. Origin remained unchanged. An author Pass with --recommend-only also reviewed the stale commit and created no conflict suppression record. A matching-head control delivered successfully.Diagnosis
src/github/review.rs:324 captures head.sha. src/processes/review.rs:235 fetches the branch and captured commits, but src/worktree/acquisition.rs:48 and :161 compare local branch state against the captured head without requiring equality with the fetched origin branch. src/worktree/review_recovery.rs:395 consequently reports no conflict for an absent local branch. Its fingerprint has no explicit fetched-origin-head component. src/processes/review/delivery.rs:228 ultimately pushes with the captured-head lease, correctly rejecting the mismatch.
Recommended work
Require exact equality between the captured PR head and the fully qualified fetched origin branch before Review acquisition creates a checkout or adopts retained work. Diagnose both expected and observed commits. Keep this check Review-specific: generic acquisition also creates fresh Issue branches without an origin counterpart. Preserve existing ownership checks and the Delivery lease.
Author Pass admission should skip mismatches, continue to later eligible PRs, notify once per unchanged fingerprint, include the observed origin head in that fingerprint, and clear suppression when the heads converge. Cover explicit runs, absent/equal local branches, retained worktrees and matching-head success. Update Review fixtures that currently omit an origin feature branch, plus the manual and relevant hand-written site pages.
This is distinct from open #1961, which concerns movement during a session. After simulated API convergence, the already-diverged checkout still failed recovery before another session because its captured head differed. Preventing new divergence does not repair existing retained work.
Recommend ready-for-human for the requested Ticket split; no publication was performed.
Questionnaire
For the Day shift shaping #1800: the stale-head acquisition bug is reproduced locally; no production access is needed to confirm the code defect.