Repository navigation
Foreign commits in a Merge run: merge them in, review them with a review Repair - #99
Merged
Merged
Conversation
In a Merge run, each round of the Repair loop first fetches the Issue branch from origin and merges any Foreign commits in, logging each one. A conflict goes to a conflict Repair; a review Repair then runs /thirdshift:code-review from the head the Run last knew as its own. Foreign commits that arrive while CI runs send the Run round again instead of on to the merge. Review Repairs count against the Repair cap and Foreign-commit rounds against the round budget, shared with Base branch moves. A normal Run is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Name the shared budget for what it counts, upstream moves, and keep the normal Run's "merged it again" message. Give the Issue branch's origin ref one home in Worktree::upstream, and share the fixed-point lookup in the tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
In a Merge run, each round of the Repair loop now takes in Foreign commits first, and has them reviewed before they can be merged. A normal Run is unchanged.
repair-<i>numbering, counts against the cap of 5 Repairs, and gets a Resume throughSessions::runlike any session.MAX_BASE_MOVESis nowMAX_UPSTREAM_MOVES, shared by Base branch moves and Foreign-commit rounds. The failure message staysorigin/<x> kept moving: merged it again 5 times.Evidence
a_merge_refused_because_the_head_moved_is_a_failed_run: a Foreign commit pushed during CI made the Self-merge fail withHead branch was modified, and the Run ended as a Failed run.After: new tests in
tests/merge_run.rs, all passing (cargo test: every suite green, clippy clean):Merge Danger
Door: two-way
A binary change you can revert. Nothing persistent is migrated.
Blast Radius: Merge-runs
Only a Merge run fetches the Issue branch and starts review Repairs. The one change that also touches normal Runs is when thirdshift pushes after a Repair: it now pushes in the next round rather than straight away, and the existing tests cover that path.
Unaddressed findings
Standards
merge_new_commits/ensure_new_commits_mergedbeside the base-branch ones): kept. Callers name what they merge without building ref strings, and the shared privatemerge/ensure_merged/mergedhold the logic.merging new commit.Goalchecks in the Repair loop: there are two, both on the one question "is this a Merge run?". A new abstraction wouldn't pay for itself.count_upstream_move(upstream, why)data clump:upstreamnames the ref in the exhaustion error andwhyis the progress line, so they are different messages.conflict_repair(issue, branch, branch, pr_url)repeats an argument: the first names the branch being merged from origin, the second the one being merged into. They happen to match for Foreign commits.Spec
origin/<branch>on its own, and thirdshift then sees nothing new. Spotting that needs the Run to track which commits are its own, which is left as a follow-up. Telling the agent not to pull would change the prompts a normal Run sends.origin/<branch> has new commits; merging them in: kept, to match theorigin/<base> moved …; merging it againline, which also marks a spent upstream move.Closes #94
🤖 Generated with Claude Code