Repository navigation
Keep the PR mergeable: merge the Base branch and conflict Repair - #17
Merged
Merged
Conversation
Once the PR is confirmed, thirdshift fetches origin/<base> and merges it into the Issue branch, never rebasing, then pushes. A conflicting merge is left in progress and handed to a conflict Repair session (logged as …-repair-1.jsonl with the run's timestamp); the run fails if that session leaves the merge unfinished. The test origin now rejects non-fast-forward pushes, so no rebase or force-push can reach it unnoticed, and the fake claude can run a different script per session and records whether a merge is in progress. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Repair that aborts the merge left no MERGE_HEAD and passed as a success with the PR still conflicting; now the run also requires origin/<base> to be an ancestor of the Issue branch. Merging passes --ff so a user's merge.ff=only can't break a clean merge. From review: rename merge_base to merge_base_branch (it isn't git merge-base), share Git's command setup, run sessions through one closure, and push via Worktree::push. The clean-merge test now pushes first so the merge push must be a fast-forward. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # src/run.rs
JacobStephens2
added a commit
that referenced
this pull request
Sep 25, 2026
Resolve src/main.rs and src/run.rs against the pre-flight checks (#15/#16) and the Base branch merge and conflict Repair (#17). Keep main's run structure and carry the progress lines into it: the session log line moves into run_session, the push line into Worktree::push, and the newly built steps (merging the Base branch, starting a Repair) print their lines as issue #10 asks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JacobStephens2
added a commit
that referenced
this pull request
Sep 25, 2026
Brings in pre-flight checks (#16), the README (#15) and merging the Base branch with conflict Repair (#17) on top of the Failed run path. - run.rs: preflight::check replaces the inline origin check; the Repair session and final push sit inside implement(), so a failed Repair goes down the Failed run path. The session log reported on failure is the most recent one (repair-1 if it ran). - main.rs: parse the Issue URL up front (exit 2) as main does, then install the interrupt handler and report a FailedRun. - github.rs: main's gh_json/string_field helpers, plus isDraft, is_open, mark_ready and convert_to_draft. - failed_run.rs: reuses Worktree::merge_in_progress. - tests/mergeable.rs: a failed Repair is now a Failed run, so it prints the open PR's URL and sends the PR back to draft. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 tasks done
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
After the PR is confirmed, thirdshift merges the Base branch into the Issue branch. It never rebases. A conflicting merge goes to a conflict Repair session.
Worktreegainsmerge_base_branch,ensure_base_branch_mergedandpush.Gitgainssucceeds, for commands whose exit status is the answer.claudecan run a different script per session (claude-script.sh.<n>), and it records whether a merge is in progress.receive.denyNonFastForwards, so a rebase or force-push fails any scenario.Out of scope: repeating the merge-then-CI loop, CI watching and the Repair cap belong to #9. The Failed run path (failure commit, draft demotion) belongs to #5.
Evidence
tests/mergeable.rscovers these scenarios through the CLI:mainwithout the implementation, 4 of the first 5 scenarios failed. Only "base unchanged" passed. The abort case would have exited 0.cargo testpasses all 14 tests, andcargo clippy --all-targets -- -D warningsandcargo fmt --checkare clean.Merge Danger
Door: two-way
The only thing this pushes to origin is a merge commit on the Issue branch, and that is always a fast-forward.
Blast Radius: runs
Every Run now fetches and merges the Base branch before it reports success. A Run whose conflict Repair fails now exits non-zero. Until #5 lands, that exit leaves the PR as it is.
Unaddressed findings
Standards
run.rs, not in one deeper module. I agree with the reviewer's own advice to wait for CI watching, CI-fix Repair and the Repair cap #9's loop and CI-fix Repair, because deepening now would be speculative."repair-1"stays a literal. CI watching, CI-fix Repair and the Repair cap #9 adds the Repair counter, and that is the point where aSessionKindtype pays for itself.claude: left as is on purpose. The fake observes the merge state independently of the code under test.Spec
Closes #8
🤖 Generated with Claude Code