---
digest: >
  v0.31.3 is a maintenance patch that makes the Ariad Delivery Story plan
  lifecycle's artifacts trustworthy. The `ARTIFACTS_MATERIALIZED` surface claimed
  an `index.md` update and a `test-guide.md` creation that `plan-delivery-story`
  never wrote (AF-002, AF-006), and the DS `plan.md` was both thinner than the
  method's own `plan_contract` and regenerated on approval, silently overwriting
  authored planning work (AF-003). The release drives the surface from the
  writer's real result, materializes the full package without clobbering
  authored content, scaffolds every `plan_contract` section, and — after a
  six-lens technical review chose pure-preserve over a surgical status patcher —
  removes mutable status from the document so approval preserves the authored
  plan instead of rewriting it. Approval now also flags any contract section left
  unfilled. The recurring decision: never duplicate state that already has a
  source of truth, and let a test guard any place two artifacts must agree.
---

# v0.31.3 — Ariad DS-Plan Artifact Integrity

**Date:** 2026-07-22

## Highlights

- Fixes phantom `ARTIFACTS_MATERIALIZED` rows: `plan-delivery-story` and
  `approve-delivery-story-plan` reported an `index.md` update and a
  `test-guide.md` creation that never touched disk (AF-002, AF-006). The surface
  is now built from the writer's real return manifest, so every reported path
  exists with a truthful `created`/`existing` label.
- Materializes the full Delivery Story package: `plan.md` is upserted, while
  `index.md` and `test-guide.md` are scaffolded only when absent, so
  hand-authored or Expand-generated content is never overwritten.
- Scaffolds every `plan_contract` required output in `plan.md` — Scope,
  Non-Goals, Acceptance Behavior, Validation Route, and Implementation Contract —
  guarded by a contract-drift test so the template and the method's declared
  contract cannot silently diverge (AF-003).
- Makes the authored plan durable: mutable status (`Status`, Approval Gate,
  Boundary) was removed from the `plan.md` template, and
  `approve-delivery-story-plan` now preserves the document instead of
  regenerating it. Approval state lives only in the Builder delivery cursor and
  the `DELIVERY_STORY_PLAN_CHECKPOINT` surface.
- Adds a non-blocking completeness advisory: approval lists any contract section
  still carrying its scaffold `Pending` placeholder under "Sections still
  pending".
- Records conscious exclusions: approval warns rather than hard-blocks on
  unfilled sections, and the artifact-path code-segment sanitization (D-012)
  remains open.

## Where We Started

A separate Builder session planning Delivery Story DS-37 noticed that the
DS-plan lifecycle's `ARTIFACTS_MATERIALIZED` surface listed three artifacts —
`index.md`, `plan.md`, `test-guide.md` — while only `plan.md` ever reached disk.
On every `plan-delivery-story` and `approve-delivery-story-plan` call the surface
claimed a `test-guide.md` that did not exist and an `index.md` "update" that
never happened. Deterministic Ariad surfaces exist precisely so the Navigator can
trust them instead of inferring state from prose, and the surface is also
rendered verbatim into the agent's own context on resume — so a phantom artifact
does not merely mislead a human, it poisons the model's ground truth. These
became AF-002 and AF-006 in the Ariad dogfooding ledger.

The same ledger carried AF-003: the generated `plan.md` held only metadata, an
objective, and a child list — none of the `plan_contract` outputs the method
itself declares. Every Delivery Story plan was born structurally incomplete
relative to the runtime's own contract.

## What Changed

The surface bug was fixed first, and its root cause set the theme for the whole
release: two sources of truth. The writer wrote files; the reporter independently
re-derived what it *assumed* had been written. Any time two code paths compute
the same fact separately, they drift. The fix made the writer return exactly what
it did and had the surface render that manifest — collapsing the entire
surface-not-equal-disk class for DS-plan. Materialization also became
no-clobber: `index.md` and `test-guide.md` are scaffolded only when absent, and a
preserved file is reported with the established `existing` status rather than a
false "updated".

AF-003 then unfolded in three moves, each pulled and reviewed in turn. First, the
`plan.md` template gained a scaffolded section for every `plan_contract` output,
with a contract-drift test that reads the live method definition and fails if the
template ever falls behind. Grounding that change surfaced a design fork the
handoff had not: because `approve-delivery-story-plan` regenerated `plan.md` from
the report, anything a driver authored into those new sections would be clobbered
on approval — the same failure class as the phantom artifacts, one file over.

That fork went to a six-lens technical review — quality-assurance drafting, then
engineer, database-architect, devops-engineer, ai-engineer, prompt-engineer, and
security-engineer. The review converged, against the original surgical-patch
lean, on **pure-preserve**: rather than teach approval to rewrite the document
carefully, stop duplicating mutable state into it at all. Mutable status was
removed from the `plan.md` template — the delivery cursor and the checkpoint
surface already own approval state — and approval now preserves the file. The
authored plan survives byte-for-byte, with no markdown parser, no anchor-collision
seam, and no new failure surface. A final increment made approval list any
section still left as a `Pending` placeholder, so an incomplete plan cannot pass
approval unnoticed, while leaving the Navigator free to approve a deliberately
thin plan.

Throughout, the section definitions were consolidated into a single source used
by both the renderer and the completeness detector, so they cannot drift — the
same principle that fixed the original surface bug, applied to the document
itself.

## Conscious Exclusions

- **Warn, not block.** Approval surfaces unfilled sections but does not refuse
  approval. Ariad checkpoints inform; the Navigator retains authority to approve
  a plan with legitimately thin sections. A hard-block or soft-block mode is left
  as a future increment.
- **No content-diff on `updated`.** `plan.md` is labeled `updated` by prior
  existence rather than a byte-level diff. It is genuinely rewritten on
  `plan-delivery-story`, so the label is truthful; reporting `unchanged` on a
  byte-identical rewrite across every lifecycle artifact remains a separate
  enhancement.
- **D-012 — code-segment path sanitization.** The artifact directory is derived
  from the work-item code, which is still only lower-cased and dot-split rather
  than run through `kebab_slug`. This release only adds fixed filenames inside an
  already-used directory, so it widens no path surface; the latent seam carried
  from v0.31.2 stays recorded, not fixed here.

## What We Learned

The same lesson arrived three times in one release. A surface that re-derives what
a writer did, a document that carries a copy of cursor state, and a detector that
hardcodes the renderer's text are all the same shape: a second copy of a fact that
already has an owner, free to drift. Each was fixed not by smarter
synchronization but by removing the duplication — the writer returns its own
result, the document stops carrying status, the sections live in one table. Where
two artifacts genuinely must agree, a test that reads the source of truth turned
out cheaper than vigilance. The review also earned its keep: it inverted the
release's central decision, replacing a status patcher that would have added a
parser with a deletion that removed the problem entirely.

## Next Horizon

The Delivery Story plan lifecycle is now trustworthy end to end: it materializes
truthfully, scaffolds completely, preserves authored work, and flags
incompleteness. Visible from here are the follow-ups this release consciously
deferred — an optional validating or blocking mode for plan completeness, the
content-diff refinement that would let every artifact report `unchanged`, and the
D-012 code-segment sanitization the next time artifact-path derivation is
touched.
