skip to content
Replays

Resolving Merge Conflicts Off the Main Checkout

Move conflict resolution into the throwaway worktree so a failed merge never dirties your real tree.

Gantry milestones

0 milestones 2 sprints

Move conflict resolution into the throwaway worktree so a failed merge never dirties your real tree.

28m 41s total 9m 43s per sprint

9.2M tokens in 95.1k tokens out

$10.93 nominal cost

This job moved merge-conflict resolution out of the checkout a user works in. The run split the change at a practical boundary: teach the worktree type how to probe, integrate, verify, and recover around git merges, then replace the finish path that had been asking a resolver agent to work in the main checkout. At today's HEAD the behavior has kept growing around that foundation, but the central guarantee remains visible: main is not where the unfinished conflict is produced or repaired.

How this walkthrough is structured

Feature

What did the run build and ship?

Gantry now routes merge-back conflict work through the disposable worktree, grounds the result with the gate, and touches the home branch only after the integrated branch is clean.

Build

How did Gantry structure the work?

The cut isolated git primitives from finish-path control flow, so the worktree operations could be proven against throwaway repositories before the run-finish resolver depended on them.

Merge Safety Primitives

0 agents 8m 27s wall time 34.6k tokens out $3.27 nominal cost

The surviving code still centers this capability in the worktree module. It uses a merge-tree probe to classify conflicts without touching a working tree, integrates the home branch tip inside the run worktree, and checks whether the branch is cleanly integrable before the real merge. The rollback side has been refined since this job: the current snapshot is read-only, and give-up paths abort stray main-checkout merges without rewinding shared history or deleting unrelated untracked files. The tests still construct real repository conflicts to prove those contracts.

This sprint carried the low-level git work without asking the agent to reshape the build loop at the same time. Its brief was broad but coherent: answer whether a merge would conflict without dirtying main, integrate main into the run branch from the worktree, verify the result, and provide recovery primitives for the shared checkout. That was a fit for a fresh context because each operation could be tested against temporary repositories and explicit status checks. The run record shows no retry, no red gate, and no re-plan here; the boundary held at the plumbing layer.

Conflict Resolution Engine

0 agents 10m 59s wall time 43.1k tokens out $5.23 nominal cost

The old monolithic build file this sprint edited has since been split, so its contribution is no longer isolated by that filename. In the live finish module, conflict resolution runs as a build-role agent with the worktree as its working directory, and the prompt tells it not to touch another checkout. Afterward Gantry checks that the integration is resolved, runs the gate on the integrated worktree, verifies clean integrability, and then performs the merge into the home branch. The domain stage text and README still describe resolution as worktree-based rather than main-checkout work.

This sprint consumed the primitives and therefore carried the user-visible behavior change: stop resolving in main, run the resolver in the disposable worktree, re-run the real gate there, and merge home only after verification. The brief also required the stop path to leave a useful manual handoff by naming the worktree and branch where partial work remains. The run did not need a repair or re-plan, though this sprint did receive an extra green gate before landing. That extra grounding fits the risk: the work was not the git probe itself, but composing it into finish semantics.