{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-treats-a-lossy-compaction-summary-as-a-lossless-restore-source",
  "title": "What happens when an instance treats a lossy compaction summary as a lossless restore source",
  "date_of_record": "2026 November 27",
  "scope": "Applies to long-running single-agent sessions that auto-compact their context window by summarizing evicted turns and later \"restore\" detail by retrieving the raw turns from an external store. Does not apply to sessions whose full transcript is always resident in-context, or to pure RAG where no prior turn is ever evicted.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-treats-a-lossy-compaction-summary-as-a-lossless-restore-source.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-treats-a-lossy-compaction-summary-as-a-lossless-restore-source.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-treats-a-lossy-compaction-summary-as-a-lossless-restore-source.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2209,
    "python_slice_tokens": 450,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two different operations that both get called \"compaction,\" and conflating them produces the failure. *Eviction* is a lossy, irreversible projection of the transcript into a bounded summary: it preserves gist and drops referents. *Restore* is a retrieval of the original bytes from a backing store keyed by turn identity. The invariant that must hold...",
    "what_was_observed": "A coding agent ran a 90-minute session against a repository. At turn ~40 the context manager hit its high-water mark (85% of the window) and triggered compaction. The compactor summarized turns 1–28 into a 600-token digest and evicted them, retaining a `turn_id → sha256` index into the raw-turn store. The digest read, in part: > \"User asked to migrate the `billing` module from the legacy `Invoice` model to the new `L...",
    "condition_of_validity": "The invariant \"summaries carry intent, raw turns carry referents\" holds only while three conditions are met simultaneously: 1. **Referent marking.** The compactor must tag, per summary clause, whether the clause *abstracts over* a referent (identifiers, exact values, error codes, tool arguments, version numbers, file paths, confirmed scopes) or merely *narra...",
    "decision_boundary": "The boundary is not \"summary vs. no summary.\" It is **referent-bearing vs. gist-bearing**, and it must be decided at compaction time, not at use time, because the information needed to decide is destroyed by compaction. Concretely, at compaction time, for each clause the compactor emits: - If the clause names or abstracts over an identifier, exact value, err...",
    "operational_effect": "With the invariant enforced, the turn-61 agent hits a hard stop: its proposed `apply_config`/migration write cites `restore_required` referents from turns 12 and 19, the restore returns the two raw turns, the agent sees the exact edge-case column names and the 409 version conflict it had summarized away, and the down-path it writes is correct. The cost is on..."
  },
  "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": "85d1a3809dd8c71b4a62100b138ede4bc9310910d68a8bbc18a001b2cc4a8458",
    "verified_classes": [
      "CompactionRestoreError",
      "RawTurn",
      "SummaryClause",
      "CompactionSummary",
      "RawTurnStore"
    ],
    "verified_functions": [
      "gate_write",
      "sha256",
      "restore_required_ids",
      "__init__",
      "restore"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CompactionRestoreError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
