{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-compact-the-rehydration-fidelity-invariant-for-lossy-summarization-under-retrieval-augmented-context-recovery",
  "title": "When must an instance refuse to compact: the rehydration-fidelity invariant for lossy summarization under retrieval-augmented context recovery",
  "date_of_record": "2026 December 1",
  "scope": "Applies to any agent that bounds context growth by summarizing older turns (lossy compaction) and later restores detail by retrieval-augmented rehydration from an external store. It does not apply to exact-copy context offload (verbatim spill to disk with full-fidelity reload) or to stateless single-turn inference, where no compaction boundary exists.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-compact-the-rehydration-fidelity-invariant-for-lossy-summarization-under-retrieval-augmented-context-recovery.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-compact-the-rehydration-fidelity-invariant-for-lossy-summarization-under-retrieval-augmented-context-recovery.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-compact-the-rehydration-fidelity-invariant-for-lossy-summarization-under-retrieval-augmented-context-recovery.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2319,
    "python_slice_tokens": 450,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different operations that both look like \"shrinking the context,\" and conflating them is the root of the failure: - **Compaction** is a *lossy projection* of the live working state into a shorter summary. It is a one-way information bottleneck. Whatever the summarizer's prompt, model, and sampling do not preserve is gone from the a...",
    "what_was_observed": "A long-running support-triage agent compacted at a 70% context watermark. Compaction was implemented as a rolling summarization call: the oldest 40% of turns were replaced by a 300-token summary, and the raw turns were written to a vector store keyed by conversation ID. At turn 212 the agent was asked to apply a discount code a user had supplied at turn 9. The trace: 1. Turn 9 raw text: `code: SAVE-7Q2X (expires 2025...",
    "condition_of_validity": "Compaction-then-rehydration is only sound when **all** of the following hold at the moment of compaction, not at the moment of retrieval: 1. **Addressability:** every raw span summarized is persisted under a stable, content-addressed key (hash of the span text plus conversation ID plus turn range), and the summary records that key set. A summary without a ma...",
    "decision_boundary": "The decision is not \"compact or don't compact.\" It is **which spans are compactable**, and the boundary is drawn per-span by a recoverability predicate evaluated before the summarization call: - **Compactable (lossy OK):** spans whose content is *narrative* — rationale, chit-chat, intermediate reasoning that will not be referenced by exact token later. These...",
    "operational_effect": "When the invariant holds, the agent's failure mode on a dropped fact is *detectable*: the summary manifest points at a span key, retrieval either returns the exact span or returns empty, and empty is treated as a continuity gap that surfaces to the user or triggers escalation. The agent's uncertainty is *represented*, not hidden. When it does not hold, the a..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "e080d5dfbad22af75c9012973fd4827a10796473aa8ef014d2b9be26f8696929",
    "verified_classes": [
      "RehydrationFidelityError",
      "CompactionRefusedError",
      "RawSpan",
      "SummaryManifest"
    ],
    "verified_functions": [
      "compact",
      "rehydrate_and_audit",
      "resume_task",
      "content_hash"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "CompactionRefusedError",
      "RehydrationFidelityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
