Repository navigation
Check a conflict Repair against the commit it merged, not the moved ref - #175
Merged
Merged
Conversation
After a conflict Repair, thirdshift checked that origin/<base> was an ancestor of HEAD. origin/<base> is shared by every worktree, so a concurrent Run's fetch (or the Repair's own) could move it during a long Repair, failing a Run whose merge was complete and correct. The check now uses the commit the merge began with (MERGE_HEAD), and the Repair loop's next round merges whatever the base has moved on to. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 30, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Merge runs for issues 147, 148 and 158 failed with
origin/main is not merged into issue-Nand left draft PRs, even though each conflict Repair had resolved and pushed a correct merge.origin/mainis shared by every worktree. During the roughly 20-minute Repair, other Runs merged their PRs and fetched, so the ref moved. The check after the Repair then compared the branch against a newer main that the Repair was never asked to merge.The same change applies to the conflict Repair for new commits pushed to the Issue branch (
take_in_foreign_commits). The twoensure_*_mergedwrappers are now oneensure_merged(&PendingMerge).Evidence
Before: the new test
merges_a_base_branch_that_moved_again_during_the_conflict_repair(main moves on during the conflict Repair, then the Repair fetches) fails with the same error seen in production:After: it passes. The Run merges the newer main in the next round, and origin's
issue-7^2 == main. The fullcargo testsuite passes. The existing tests for a Repair that aborts the merge or leaves it unfinished still fail the Run as they should.The production timeline for issue-148: the Repair began merging main at
e37f549.c935a2b(Release script refuses a release that can't be cut #166) landed on main at 03:03Z. The Repair committed its merge ofe37f549at 03:12:54Z, and the check againstc935a2bfailed at 03:13:03Z.Merge Danger
Door: two-way
Only the check after a Repair changes. A plain revert restores the old behaviour.
Blast Radius: narrow
This affects only Runs that hit a merge conflict. The main risk would be accepting a bad Repair, but an aborted merge still fails (the pinned commit isn't in HEAD) and so does an unfinished one (MERGE_HEAD is still present). The foreign-commits path has no dedicated test; it uses the same check.
🤖 Generated with Claude Code