- Status: draft
- Date: 2026-02-21
- Scope: ADR 0026 response content continuity substrate
Implement a bounded response-content continuity layer so follow-up turns can reliably transform prior outputs without bloating working memory or conversation history.
Primary outcomes:
- Prior response payloads are retrievable by stable
content_ref. conversation_historyremains compact and metadata-first.- Follow-up intents that depend on prior content become deterministic.
conversation_historystores compact summaries and minimal provenance references, not full response payloads.- Follow-up requests that require prior substance (reformat/rewrite/extract) can fail even when prior call succeeded.
- Generated code sometimes duplicates payloads into ad hoc context keys, causing inconsistent behavior.
- Follow-up transform success for valid immediate prior content: from unstable baseline to
>= 95%. - False negative "no prior content" outcomes: reduce by
>= 80%in targeted scenarios. - Prompt growth impact from content continuity: keep median increase within
<= 5%by using refs, not full payloads.
- State continuity (role profile key/shape enforcement) remains unchanged.
- Tool/artifact lifecycle and promotion policy remain unchanged.
- Existing external-data provenance compactness in history remains unchanged.
- Tests:
- content-store unit tests (insert, retrieve, evict, bounds),
- history linkage tests (
content_refattached to successful outcomes), - acceptance tests for multi-turn content follow-up scenarios.
- Traces/logs:
- content-store write/read/eviction counters,
content_refpresence inoutcome_summary,- follow-up success/failure with reason.
- Thresholds:
- ref resolution hit rate
>= 95%for non-evicted refs, - boundedness invariant: store never exceeds configured max entries/bytes.
- ref resolution hit rate
- Observation window:
>= 30follow-up calls across>= 3sessions before retention tuning is finalized.
- Prompt footprint regresses materially (
> 15%median increase) -> slim prompt ref rendering. - Frequent
content_ref_not_foundwithin short-window follow-ups (> 10%) -> raise retention window and adjust eviction policy. - Memory/storage pressure beyond configured budget -> reduce defaults and tighten compaction.
- No vector-search/embedding retrieval in this rollout.
- No durable global archive across all sessions by default.
- No automatic semantic summarization pipeline over all stored content.
- Preserve separation of concerns:
- state continuity (
context) vs - event continuity (
conversation_history) vs - executable continuity (artifact store) vs
- response content continuity (new store).
- state continuity (
- Store is bounded and deterministic (no unbounded growth).
- History references content by ID; history does not inline full payloads.
- Typed failures for missing refs; never fabricate prior content.
- Stored content body is JSON-safe serialized resolved
Outcome.valueby default, not full outcome envelope. - Depth-aware retention defaults apply: depth-0 store-on-success; depth>=1 store by opt-in or parent reference.
Goals:
- Define content-store schema and retention policy contract.
- Capture baseline follow-up failure modes.
Implementation:
- Define
content_refformat andContentStoreEntryschema. - Define runtime config knobs: max entries, max bytes, optional TTL.
- Freeze stored-payload boundary: JSON-safe serialized
Outcome.valuesnapshot semantics, fallback serialization mode, metadata fields. - Define depth-aware retention policy contract for depth-0 vs depth>=1 calls.
- Capture baseline traces for follow-up flows across assistant/calculator/debate.
Phase Improvement Contract:
- Baseline snapshot: follow-up flows fail due to missing prior payload substance.
- Expected delta: baseline evidence captured with reproducible scenarios.
- Observed delta: to be recorded after phase validation.
Exit criteria:
- Schema, payload boundary, and retention policy definitions accepted.
- Baseline trace set stored and indexed.
Goals:
- Add runtime-managed content store with deterministic bounds.
- Attach
content_refmetadata to successful call outcomes.
Implementation:
- Implement
ContentStoremodule/service (session-scoped default). - Store successful outcome payloads and compute digest/size metadata.
- Add
content_ref,content_kind,content_bytes,content_digestto history summary. - Enforce depth-aware write policy (default store depth-0; gated depth>=1 writes via explicit opt-in/parent reference).
- Add config defaults and runtime configuration docs.
Phase Improvement Contract:
- Baseline snapshot: no retrievable full response payload linked from history.
- Expected delta: every eligible successful call has a resolvable
content_ref. - Observed delta: to be recorded after phase validation.
Exit criteria:
- Unit and integration tests for storage/linking are green.
- Boundedness and eviction invariants verified.
- Depth-aware retention behavior validated for assistant + debate-style nested flows.
Goals:
- Enable generated code to retrieve stored content via refs.
- Teach follow-up flows to resolve references before fallback behavior.
Implementation:
- Add runtime helper for content resolution (read-only).
- Update prompts with explicit reasoning sequence for content follow-ups:
- detect follow-up intent,
- identify candidate history record,
- resolve
content_ref, - use
content_kind/content_bytesto decide summary-only vs full fetch, - fetch via
content(ref)when required.
- Add fallback policy for missing refs (
content_ref_not_found/low_utility). - Add acceptance tests:
- "format prior algorithm in markdown",
- "summarize previous debate answer",
- "rewrite previous explanation for beginners".
Phase Improvement Contract:
- Baseline snapshot: follow-up transformations fail despite prior successful turn.
- Expected delta: targeted follow-up transformations resolve and operate on prior payload content.
- Observed delta: to be recorded after phase validation.
Exit criteria:
- Acceptance scenarios pass consistently.
- No prompt bloat beyond target threshold.
- Follow-up traces show explicit ref-resolution chain instead of summary-only failure loops.
Goals:
- Add operational visibility and tune retention.
- Harden behavior under stress and eviction boundaries.
Implementation:
- Emit content continuity fields in logs and report docs.
- Add counters: writes, hits, misses, evictions, expired refs.
- Tune defaults using observation window evidence.
- Integrate retention-policy mutations into ADR 0025 proposal/authority governance path.
- Update docs with troubleshooting and expected failure semantics.
Phase Improvement Contract:
- Baseline snapshot: no direct visibility into content-follow-up hit/miss dynamics.
- Expected delta: measurable, tunable content continuity metrics available.
- Observed delta: to be recorded after phase validation.
Exit criteria:
- Metrics dashboards/reports show stable hit rate and bounded resource usage.
- Governance path is exercised for at least one retention-policy adjustment proposal.
- Documentation updated and linked in docs index.
- Unit tests:
- content entry normalization,
- retention and eviction,
- ref resolution behavior.
- Integration tests:
- history linkage,
- prompt rendering with compact ref metadata,
- runtime helper access control.
- Acceptance tests:
- assistant, calculator, debate content-follow-up scenarios.
- Regression tests:
- ensure no regressions in existing history/provenance semantics.
- Risk: store growth and memory pressure.
- Mitigation: strict bounds, deterministic eviction, configurable defaults.
- Risk: prompt bloat via excessive ref metadata.
- Mitigation: keep prompt representation compact and bounded.
- Risk: role-specific flows bypass new substrate.
- Mitigation: acceptance coverage across assistant/debate/calculator.
- Risk: stale refs after eviction create user confusion.
- Mitigation: typed miss errors + concise repair guidance in prompts.
- Risk: depth>=1 churn evicts useful top-level content.
- Mitigation: depth-aware defaults + parent-reference selective retention.
- ADR 0026 acceptance criteria are met and evidenced.
- Follow-up content transformations pass at target success rate in observation window.
- Store boundedness and prompt-size constraints hold in stress tests.
- Documentation and UL updates are merged and indexed.