{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-lossy-auto-compaction-from-silently-erasing-retrieval-resolvable-commitments",
  "title": "Which invariants prevent lossy auto-compaction from silently erasing retrieval-resolvable commitments",
  "date_of_record": "2026 December 1",
  "scope": "Applies to long-running LLM agents that auto-compact their working context into a summary and rely on an external retrieval index to recover dropped detail. Does not cover stateless single-turn calls or agents whose entire context fits below the compaction threshold.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-lossy-auto-compaction-from-silently-erasing-retrieval-resolvable-commitments.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-lossy-auto-compaction-from-silently-erasing-retrieval-resolvable-commitments.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-lossy-auto-compaction-from-silently-erasing-retrieval-resolvable-commitments.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1740,
    "python_slice_tokens": 396,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two categorically different things a compaction summary can drop. The first is *redundant surface detail*: verbatim tool outputs, chain-of-thought scaffolding, intermediate reasoning that has already been consumed. Losing this is benign because retrieval can reconstruct it, or because nothing downstream depends on it. The second is a *commitment*: ...",
    "what_was_observed": "During a multi-turn agent session that crossed the compaction threshold three times, the following trace was captured: 1. Turn 12: agent records constraint C = \"all monetary values must be rounded to 2 decimals and tagged `currency:USD`.\" This lives in context as a plain sentence. 2. Turn 31: context hits 92% saturation. Auto-compaction summarizes turns 1–30 into ~800 tokens. The summarizer, optimizing for coherence,...",
    "condition_of_validity": "The invariant holds — and the failure is real — only when all three of the following are simultaneously true: - **Compaction is lossy but assumed recoverable.** The system prompt or design doc asserts \"detail is preserved in retrieval,\" so neither the summarizer nor the agent treats eviction as a hard loss. - **The summary and the raw source share a retrieva...",
    "decision_boundary": "The operational rule is a **pointer-or-preserve** boundary applied at compaction time, per dropped item: - If an item is *detail* (reconstructable, no downstream obligation), it may be dropped **only if** the summary records a retrieval key: a stable identifier, the source turn range, and a one-line descriptor sufficient to formulate a retrieval query. Examp...",
    "operational_effect": "Enforcing pointer-or-preserve changes three things in the running system: 1. **Summary schema gains a mandatory `dropped[]` array** with retrieval keys. A summary without this array is rejected by the compaction gate — the agent does not proceed on an unkeyed summary. 2. **Retrieval namespacing separates source from paraphrase.** Factual queries search the s..."
  },
  "matched_failure_symptoms": [
    "CONTEXT_DRIFT_OR_ATTENTION_DILUTION"
  ],
  "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": "850cfe2fcb85336a2eaf5763139ba85bb4dc3076dbb6df200aef3f752eb7245e",
    "verified_classes": [
      "CompactionIntegrityError",
      "ItemKind",
      "ContextItem",
      "CompactionSummary"
    ],
    "verified_functions": [
      "build_summary",
      "gate_compaction",
      "resume_check"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CompactionIntegrityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
