Checkpoint a Gantry Run Without Ending It
Bank a long run's finished work to master, then resume the rest.
0 milestones 4 sprints
1h 40m total 8m 50s per sprint
29.2M tokens in 214.9k tokens out
$30.63 nominal cost
This job made a long Gantry run checkpointable. Instead of waiting for the terminal finish to land work and remove the scratch worktree, an operator can ask a run to merge the units already proven, keep the branch and ledger, and resume later for the remaining work.
The run was cut as a contract-first feature: add the engine command, make the owner engine honor it, expose the command line, then document the workflow. The current tree still carries that shape, although later refactors moved the engine implementation into the build module and widened partial merge from its original map scope into a driver capability.
How this walkthrough is structured
Feature
What did the run build and ship?
Gantry can now land completed run work before final completion, through the same conflict-aware merge machinery used at the ordinary finish, while preserving the state resume needs.
Build
How did Gantry structure the work?
The decomposition kept the command contract, owner-engine behavior, command surface, and documentation separate, with the engine finalize step exposing the only boundary that had to be replanned.
Engine Partial-Merge Command
0 agents 3m 21s wall time 9.4k tokens out $2.09 nominal cost
The command contract is still visible in the tree. `EngineCommand::MergePartial` documents a live owner's request to merge completed work and stop resumably, the attach codec still maps it through the command wire enum, and command consumers that are not responsible for run control still pass or ignore it explicitly. This unit left the message shape that both the CLI and TUI now send.
This was the smallest contract the rest of the feature could share: one engine command variant and a wire representation for the attach transport. A fresh agent did not need to reason about merge semantics yet, only about the command enum, the tagged codec, and exhaustive matches that should keep ignoring the new variant where no behavior belonged. The sprint stayed green, which fits the cut: it established a stable type and round-trip test before any caller or handler leaned on it.
Partial Merge Execution
0 agents 31m 42s wall time 124.1k tokens out $14.45 nominal cost
The original monolithic engine file has since been split, but the behavior remains recognizable. The engine demux raises a `MergePartial` latch, the map driver observes it as a distinct pool outcome, and `finish_partial` keeps the worktree, branch, and ledger while using the shared merge core and the no-op guard for nothing-to-merge cases. The map smoke tests still exercise the live merge, no-op request, idempotent second request, and resume afterward.
This sprint carried the hard engine behavior: turn the command into a latch, quiesce a map worker pool without admitting more work, finalize through the normal conflict-safe merge path, and stop without destroying resume state. Its first execution did not finish, then the resumed attempt passed the gate. Review then forced a re-plan because the shared merge routine had landed as context-bound methods, so the next sprint had to reach it by constructing the right context rather than calling a standalone helper.
Gantry Merge Command
0 agents 14m 19s wall time 55.3k tokens out $8.40 nominal cost
The public command is still implemented in the CLI. `gantry merge <name>` resolves a run, checks that the persisted driver supports partial merge, sends `MergePartial` to a live owner over attach, or performs an offline merge on disk when no owner is present. The original map-only command has been generalized through driver capability registration, so this sprint's surface survives with broader supported drivers.
After the re-plan, the command surface had a sharper boundary than the original brief assumed. It had to parse like the other bare-first-argument run verbs, resolve a named run, confirm before writing to the home branch, and then branch on liveness without owning a live run's lock. The sprint completed cleanly because the engine merge and its context-bound access pattern were already established.
Command Documentation
0 agents 2m 28s wall time 6.3k tokens out $1.42 nominal cost
The exact file this sprint edited has been reduced to an index, so the contribution is no longer isolated there. The documentation itself is still present in the CLI reference: it describes `gantry merge <name>`, the resumable state it preserves, the live-owner attach path, the stopped-run offline path, driver capability checks, and the confirmation prompt. Later documentation updates also reflect the broader driver support that arrived after this job.
The final unit was intentionally thin: document the shipped command after the code paths were settled. Its brief asked for the run-management entry, the abort-midway to merge to resume workflow, the live versus offline behavior, the original scope limit, and the confirmation flag. There was no run stress here; the value of the cut was that the documentation agent could describe finished behavior rather than predict it.