{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-prove-that-compaction-is-reversible-before-it-may-drop-the-original-turns",
  "title": "Where must an instance prove that compaction is reversible before it may drop the original turns",
  "date_of_record": "2026 November 27",
  "scope": "Applies to long-horizon agents that replace older conversation turns with a lossy summary plus a retrieval index over the evicted spans, then continue reasoning against the compacted view. Does not apply to lossless token-window truncation, to external memory stores that are never re-read into the active prompt, or to single-shot calls with no eviction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-prove-that-compaction-is-reversible-before-it-may-drop-the-original-turns.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-prove-that-compaction-is-reversible-before-it-may-drop-the-original-turns.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-prove-that-compaction-is-reversible-before-it-may-drop-the-original-turns.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2814,
    "python_slice_tokens": 526,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *compaction as a display optimization* and *compaction as a state transition*. In the first framing the summary is a convenience: the original tokens still exist somewhere and the agent's behavior is unchanged whether or not it reads them. In the second framing—the one every real long-horizon agent drifts into—the summ...",
    "what_was_observed": "A coding agent operating over a multi-hour session compacted 41k tokens of tool-call history into a 900-token summary plus a vector index over the evicted spans. The summary recorded: \"Migration `0042_add_tenant_id` was applied and the schema was verified.\" This is true at the level of intent. What the summary omitted was the *exact* constraint name and the *exact* column ordering that the migration produced, both of...",
    "condition_of_validity": "Compaction with retrieval-backed restoration is valid only when all three of the following hold simultaneously. Drop any one and the reversibility invariant is violated. **Condition 1 — Register bridging.** For every evicted span, the summary must contain a *retrieval key* expressed in the register the agent will query in, and that key must be *distinctive* ...",
    "decision_boundary": "The boundary the agent must evaluate at compaction time is whether a candidate span is *decision-bearing* or *display-bearing*. Display-bearing spans (acknowledgements, intermediate progress, redundant confirmations) may be dropped with a plain summary and no key. Decision-bearing spans (exact identifiers, exact orderings, exact numeric outputs, exact error ...",
    "operational_effect": "When the invariant holds, compaction is a genuine state transition that preserves decision-equivalence: the agent's future behavior against the compacted view matches its behavior against the full history for every decision-bearing fact, because every such fact is reachable via a key the agent can formulate. When it fails, the failure is *silent and confiden..."
  },
  "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": "60e6e4dca90ad4f322ae09b92c58f27f6e07fa81cace48040ff2b7fed6a73900",
    "verified_classes": [
      "CompactionReversibilityError",
      "Span",
      "Summary",
      "Index"
    ],
    "verified_functions": [
      "assert_reversible",
      "compact",
      "resolve_key"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 7,
    "raised_exceptions": [
      "CompactionReversibilityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
