---
digest: >
  v0.31.0 delivers the CV9.E2 Stabilization & Robustness epic: the memory
  pipeline now fails safely and observably instead of corrupting state or
  losing memories silently. One poison-pill conversation can no longer halt
  all pending extraction; search degrades to lexical-only when embeddings
  are unavailable; extraction is idempotent across partial failure; and
  every model-in-the-loop surface that embeds untrusted transcript content
  — extraction, scene synthesis, shadow, consolidation, and conversation
  titles/tags/summaries — is now fenced against content-mediated prompt
  injection. It also lands the model-in-the-loop reliability backlog from
  the AI Engineering Audit: explicit call timeouts, model-pin overrides
  with a reachability probe, metadata-default cost observability, and an
  `eval --all` release gate with a model-upgrade playbook. CV9.E2.S2
  (external extension runtime surface) is deferred to a later increment.
---

# v0.31.0 — Stabilization & Robustness

**Date:** 2026-07-23

## Highlights

- **Extraction survives failure.** A failing conversation (provider outage,
  oversized or poison-pill transcript, auth error) is isolated and
  quarantined instead of crashing the batch and starving every conversation
  queued behind it. Extraction is idempotent across partial failure — a
  retry re-spends nothing and duplicates no rows.
- **Search degrades, it does not break.** When embeddings are unavailable
  (no key, provider down), search falls back to lexical-only ranking rather
  than returning nothing or recency noise. Every LLM and embedding call is
  now bounded by an explicit timeout.
- **Untrusted content is fenced everywhere it enters a prompt.** The
  transcript is data, not instructions — enforced across extraction, scene
  synthesis, shadow observations, consolidation, and conversation
  title/tags/summary generation, each with an adversarial eval probe.
  Model-chosen identity writes are constrained by a target-layer allowlist.
- **The mirror can now account for itself.** LLM calls record
  role/model/tokens/latency/estimated cost by default (metadata only, never
  bodies unless opted in); embedding calls and provenance are logged; a
  spend summary and consult ledger make cost visible.
- **Behavior is now gated, not hoped.** An `eval --all` runner plus a
  model-upgrade playbook make a prompt or model-pin change a checked
  migration: no green run (or recorded waiver) means no release.
- **Reliability details:** reinforcement reinforces only on genuine context
  loads (not internal machinery); the search access-count N+1 is collapsed
  to one batched query; a retrieval-relevance instrument measures whether
  the ranker surfaces the right memories; model pins accept env overrides
  with a `runtime diagnose` reachability probe.

## Where We Started

Mirror Mind already worked across its runtimes, but its behavior at the
edges was undefined. A single conversation that reliably failed extraction
could halt all pending extraction *forever*, silently, burning an LLM call
every session start. Search had no offline story. Nothing bounded an LLM
call's latency. The transcript — user- and third-party-controlled content —
flowed into extraction, scene, shadow, consolidation, and title/tags/summary
prompts unfenced, so an embedded instruction could steer what the mirror
stored or displayed. And the system recorded almost nothing about what it
did or what it cost, which is at odds with the project's own "evidence over
vibes" posture. The [AI Engineering Audit](../project/ai-engineering-audit.md)
named these as the model-in-the-loop reliability gap: the capability
discipline had outrun the reliability discipline.

## What Changed

This release closes the bulk of **CV9.E2 — Stabilization & Robustness**, the
operational-hardening epic, together with the audit's P0 tier and most of
its P1/P2 findings:

- **Failure isolation & idempotency (AI-01, AI-02, AI-03):** explicit
  per-role call timeouts; per-conversation isolation with attempt-counting
  and quarantine; staged embeddings so partial failure persists nothing.
- **Safe degradation & signal integrity (AI-04, AI-12):** lexical-only
  search fallback; reinforcement that fires only on genuine context loads.
- **Boundary hardening & injection defense (AI-15, AI-16, AI-22, AI-23,
  AI-25, D-009):** value validation and caps on extracted memories;
  transcript fencing across all five model surfaces; a target-layer
  allowlist on identity writes; reported-speech recognition in the
  injection-resistance judge.
- **Observability & cost (AI-07, AI-09, AI-10, AI-13, AI-14):** metadata-
  default LLM-call logging with a single cost authority; embedding
  provenance and call logging; extraction-status legibility; an N+1
  collapse; a deterministic retrieval-relevance instrument.
- **The eval gate (AI-11):** persisted eval runs with trend, adversarial
  probes for every model surface, and an `eval --all` runner wired as a
  release gate with a model-upgrade playbook.
- **Product & tooling:** the 1.0 intelligence-flag posture is decided and
  documented (AI-20); Ariad Builder reads Delivery-Story-grammar roadmaps
  (CV20.DS13); and extension install/uninstall is env-aware and guarded
  against symlink and catalog-truncation defects.

The journey-and-≥4-messages extraction precondition (AI-21) is now
documented as intended product behavior — a deliberate noise filter and
data-minimization boundary — rather than invisible behavior.

## Conscious Exclusions

- **CV9.E2 is substantially, not fully, complete.** `CV9.E2.S2` (external
  extension runtime surface parity) remains open and is deferred to a later
  increment; this MINOR release marks the epic milestone, not its final
  story.
- **Model-behavior release gate — waiver recorded.** `prompts.py` changed in
  this release, so `eval --all` was run on the release candidate: **11/12
  evals pass**. The single failure is `routing`, which is the known,
  documented **D-005** debt (stale persona fixtures in `evals/routing.py`),
  unrelated to any behavior shipped here — every prompt-touching surface
  (extraction, scene, shadow, consolidation, title/tags, summary) passes its
  threshold. The gate is satisfied by conscious waiver, per the development
  guide's model-behavior release rule.
- **1.0 intelligence-flag posture holds:** two-pass and LLM summarization
  stay off by default; reception stays on. This release does not change that
  posture (AI-20).

## Next Horizon

CV9 continues toward its Mirror Mind 1.0 done condition — the remaining
stabilization work including CV9.E2.S2, boundary hardening, and the
conversation-metadata lifecycle apply path. In parallel, the CV22 TypeScript
core port proceeds behind the database seam, inheriting each of these fixes
on its next merge from `main`.
