skip to content
Replays

Unified Merge Routine

One Partial Merge Path

Make stopped and live partial merge behave the same across every modern run pattern.

Gantry milestones

1 milestones 4 tasks 9 agents

3 plan 3 execute 4 review

173k peak context

161k median execute

Make stopped and live partial merge behave the same across every modern run pattern.

1h 2m total 10m 15s per task

2m 52s plan 30m 43s execute 15m 12s review

67 edits 337 commands

codex harness

Partial merge had grown as a set of pattern-shaped exceptions. Some run forms could ship a safe prefix, others were refused for reasons that came from their historical driver names, and the stopped path still had to decide which pattern-owned boundary it was allowed to land. That made the operator command hard to explain and made the default build pattern miss the same capability already present elsewhere.

This run collapsed the feature to one contract. A modern pattern pin is enough to expose partial merge, a live request is carried by the engine until a safe stop, and a stopped merge lands the committed run-branch tip rather than sweeping dirty work or choosing a routine by pattern shape. The run record is slightly irregular around the committed-tip sprint, but the current tree still carries the shared capability, merge path, menu text, and documentation that the milestone set out to leave behind.

How this walkthrough is structured

Feature

What did the run build and ship?

Gantry now exposes partial merge as a modern pattern-run capability, with live and stopped paths both described around the committed run-branch tip.

Build

How did Gantry structure the work?

The cut used one milestone to remove pattern-specific merge choices, prove live safe stops, pin the committed-tip boundary, and then update the user-facing contract.

Milestone 1

Generalize Merge Logic

3 tasks 10 agents 57m 27s wall time 173k peak context

The milestone is visible in the current tree as a single partial-merge story across code and docs. Pattern pins expose the capability, the generic runner observes the merge request latch, stopped merges call the shared offline branch-tip routine, and the Gantry menu names the action as merging the committed tip. The old header selector is absent from the pattern spec, while the goal pattern still keeps its ordinary live channel state. Later work has moved surrounding display and documentation, but the universal contract remains standing.

This wrapper unit carried the whole architectural change: partial merge had to stop being selected by pattern headers while the unrelated live request channel stayed intact. That was large enough to need child sprints because it touched pattern schema, runtime capability reads, live stop behavior, offline merge mechanics, command behavior, and documentation. The top-level ledger shows the milestone finished green after the child work, while the captured run facts end at the final merge boundary rather than a completed merge event. As a build cut, the milestone worked by turning a cross-pattern policy into a sequence of contracts that later sprints could consume.

Unify Merge Contract

3 agents 28m 56s wall time 173k peak context 1 replan

The tree still reads partial merge from the persisted modern pattern pin rather than from a pattern-name switch. `PatternRunCapabilities` marks readable pattern runs as supported, cold projection carries that capability into run views, and tests cover bundled and user-authored patterns without using a map-specific answer. Bundled pattern files no longer declare an offline routine selector. Goal's `partial_merge` channel remains as live pattern state, which preserves the distinction this sprint was meant to keep.

This sprint was asked to remove the capability model that made partial merge depend on routine names and pattern shape. A fresh agent could hold that because the brief kept the work at the contract boundary: pattern definitions, capability reporting, and tests that formerly expected asymmetry. The run facts show a re-plan attached to this sprint before its implementation settled, which is where the cut learned enough to adjust the remaining work. Its gates and review then passed, so later sprints could treat the pattern-independent surface as established.

Live Merge Contract

2 agents 11m 9s wall time 161k peak context

Live merge requests now travel through the shared engine command demux into a merge latch that production worlds can read. The generic pattern runner turns a resumable stop reached under that request into `finish_partial`, so the owner performs the merge while the worktree and ledger remain usable for resume. The command path for a live run attaches to the owner, sends the same merge command, and streams the merge-stage events rather than attempting to write under another process. Current docs describe that live requests stop at engine safe points regardless of shape.

This piece narrowed the live side of the contract after the capability surface existed. Its charge was not to replace the offline merge, but to make every running pattern honor the same request and stop at a safe engine boundary. That was a bounded slice for a fresh agent because the previous sprint had already removed the opt-in vocabulary. The run facts show a clean execute, gate, review, and confirmation gate here, so the live safe-point proof did not force a retry or re-plan.

Committed Tip Landing

The committed-tip rule is now in the offline partial merge routine. It checks whether the run branch has commits beyond the home branch, reports a no-op without fabricating work, and merges that branch tip through the clean offline path under the checkout lock. Uncommitted project changes are explicitly not swept into the stopped merge; the live path has a separate check because map-style artifacts may be finalized by the owner. The finish tests still cover a stopped build-shaped run landing committed work from a partly finished milestone while leaving draft work behind.

This sprint was the stopped-run boundary: land committed run-branch work and leave dirty trailing work alone. The ledger records it as already satisfied with a green gate rather than as a normal implementation commit, and the run facts do not carry a separate stage row for it. That makes the build record thin, but the brief's boundary is still clear: replace pattern-selected ledger targets with one offline committed-tip rule. The absence of a retry here reads as a proof handoff, not as evidence that the behavior was unimportant.

Command Docs Alignment

2 agents 9m 21s wall time 101k peak context

The command surface now describes `gantry merge` as merging committed branch-tip work and keeping the run resumable. The TUI action is labelled `Merge committed tip`, enabled from the shared capability and disabled separately for unsupported or attached front-ends. Pattern documentation says partial merge is not a header selector, and the driver contract names the shared partial-merge path as a pattern-independent run contract. Some surrounding examples have been edited since, but the public language no longer presents separate offline routines for build, map, goal, loop, or ralph shapes.

The final child sprint consumed the runtime contracts and cleaned up the surfaces a user would actually see. Its scope was deliberately outward-facing: command refusal branches, menu projection, bundled pattern text, and reference documentation. The run facts show it executed, gated, reviewed, and gated again without a red outcome, which fits a propagation sprint built on earlier contracts. It closed the milestone by removing stale descriptions rather than changing the merge core again.