skip to content
Replays

Post-Completion Records

Post-Completion Record Tails

A record-maintenance run that preserves finished-run artifacts written after the last ordinary run-record commit.

Gantry milestones

0 milestones 0 tasks

16 execute

A record-maintenance run that preserves finished-run artifacts written after the last ordinary run-record commit.

12h 38m total 14m 21s per task

This run closed a record loss path at the end of Gantry runs. The plan bundled the retroactive backfill commands, the worktree reclamation guard, the late final record commit, the documentation, and focused tests into one run-record maintenance slab. The digest keeps one high-level brief for the slab while the ledger exposes smaller sprint commits underneath it. The sprint gates stayed green, and the stress arrived after the branch had been built: the merge boundary recorded an unfinished merge and a failed resolve stage before the work later appeared in the measured merge commit.

How this walkthrough is structured

Feature

What did the run build and ship?

The current tree has the record-tail backfill module, singular and plural CLI verbs, worktree reclamation protection, a late final record commit path, tests, and user-facing documentation.

Build

How did Gantry structure the work?

The run treated post-completion records as a single maintenance boundary, small enough to split by command, guard, lifecycle, and documentation while still proving the loss path end to end.

Milestone 1

Backfill post-completion run-record tails and protect reclamation

The current tree still has the promised slab. `src/engine/record_tail.rs` audits and applies post-completion record tails, `src/commands.rs` exposes the backfill verbs, `src/commands/artifact_reclamation.rs` reports and protects unrecorded tails, and `src/engine/run/finish.rs` includes the late final record path. The documentation in `docs/agents/cli.md` and `manual/cli.md` still tells operators how the commands and reclamation guard behave.

The milestone brief carried the full run-record maintenance problem rather than a cosmetic command addition. Its boundary joined three obligations: preserve missing runtime-record files, keep reclamation from deleting them, and reduce the forward gap for new runs. The ledger beneath it split those obligations into green sprint gates, so the fresh agents mostly received one contract each. The only recorded pressure sits after those units, where final integration failed outside a sprint.

Record Tail Backfill Core

`src/engine/record_tail.rs` remains the center of the feature. It models complete, backfillable, skipped, and failed audits, checks live ownership and unsafe dirt, detects path boundary violations, and commits selected record paths with post-completion provenance. The module's contribution is still visible rather than folded away.

This sprint carried the core comparison and apply contract. The cut was holdable because it could stay inside the record-tail domain: inspect the retained runtime directory, compare it with the canonical record, classify the result, and commit only audited record paths. The run facts show its execute and gate stages stayed green, which fits a contained library boundary. A later retry of the enclosing slab did not change that this unit's own gate passed.

Backfill Record CLI

`src/commands.rs` still exposes `gantry backfill-record` and `gantry backfill-records`. The singular command resolves a named run and the plural command enumerates a registry, while both call the shared record-tail reporting path. The help text and CLI specification also retain the verbs.

This sprint attached the core contract to the command surface. The work was bounded by nearby run-management verbs: resolve one run for the singular form, sweep a registry for the plural form, honor dry-run classification, and report each outcome without broadening the write. Its stages stayed green, so the command layer did not force a replan or repair.

Reclamation Record Tail Guard

`src/commands/artifact_reclamation.rs` still carries `WorktreeRecordTailState` and the skip reason for an unrecorded post-completion record tail. `gantry worktrees` reports protected tails and tells the operator to run `gantry backfill-records` before reclamation. The guard protects the tail rather than silently backfilling or deleting it.

This sprint made the backfill work matter before cleanup could destroy the evidence. Its boundary was reclamation planning, not record writing: classify a retained checkout's record tail, surface the skip reason, and name the backfill remedy. The sprint passed through its own gate, which says the guard fit the existing reclamation planner.

Late Final Record Commit

`src/engine/run/finish.rs` still closes late run state after the durable merge path has enough information to record completion. The code path preserves the rule that the shared checkout is mutated only after the merge is proved, while final run-record material is committed as late as the engine can honestly do it. Tests under `src/engine/run/tests/finish.rs` still cover the finish behavior.

This sprint handled the forward lifecycle part after the backfill and reclamation paths existed. The task was narrow: move the last honest record commit later in the finish path without moving project commit ownership or changing merge semantics. Its execute and gate stages stayed green, leaving the later integration failure outside the lifecycle unit itself.

Document Backfill Workflow

The command reference still documents the new record-maintenance verbs and the reclamation interaction. `docs/agents/cli.md` explains the singular and plural backfill commands, dry-run behavior, no-op handling, active-run skips, failure reporting, and the explicit worktree remedy. `manual/cli.md` keeps the short operator-facing command summary.

This sprint was propagation once the behavior existed. The brief required users to discover the verbs, their dry-run and sweep behavior, and the new worktree skip reason. Its gate stayed green, which matches documentation scoped to already-built contracts rather than a second implementation surface.