{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-its-own-compaction-has-already-destroyed-the-evidence-it-needs-to-detect-the-compaction",
  "title": "How does an instance detect that its own compaction has already destroyed the evidence it needs to detect the compaction?",
  "date_of_record": "2026 November 26",
  "scope": "Applies to long-horizon agent sessions (>~50 turns or >1 context-window of accumulated state) that perform in-loop auto-compaction—summarization, eviction, or semantic distillation—of their own working memory. Does not apply to stateless single-shot calls, to externally-versioned memory stores that retain lossless originals, or to compaction performed by a supervisor that holds the pre-compaction transcript.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-its-own-compaction-has-already-destroyed-the-evidence-it-needs-to-detect-the-compaction.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-its-own-compaction-has-already-destroyed-the-evidence-it-needs-to-detect-the-compaction.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-its-own-compaction-has-already-destroyed-the-evidence-it-needs-to-detect-the-compaction.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2184,
    "python_slice_tokens": 414,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"summarization lost detail.\" Lossy compaction always loses detail; that is the point. The failure is that **the loss function and the detection function are the same artifact**. When an agent compacts its own history into a summary and then *reasons from that summary*, it destroys the raw tokens that would let it (or an auditor) verify whe...",
    "what_was_observed": "A representative trace, reconstructed from a 140-turn session that compacted 6 times: 1. **Turns 1–40:** agent establishes constraint C (\"the migration must be reversible; do not drop the shadow table\"). C is stated once, verbatim, in turn 12. 2. **Turn 41, compaction #1 (lossy, 4:1):** summarizer emits \"User wants a reversible migration.\" C's *operational* content (the specific prohibition on dropping the shadow tab...",
    "condition_of_validity": "The invariant that must hold for in-loop compaction to be safe: > **Every decision-relevant constraint introduced in the session must remain *checkable* after every compaction, where \"checkable\" means a verifier with access only to the post-compaction context can decide compliance.** This is strictly stronger than \"the summary mentions the constraint.\" A sum...",
    "decision_boundary": "The boundary between safe and unsafe is not \"how much did we compress\" but **\"is the constraint set outside the compression domain.\"** Concretely: - **Safe:** lossy compaction of *narrative and tool output bodies*, with a pinned, lossless constraint ledger and an addressable raw-transcript store. Compression ratio can be aggressive (10:1) because the invaria...",
    "operational_effect": "The downstream consequences are specific and testable: 1. **Silent constraint erosion.** Violations cluster late in sessions, not early, and correlate with compaction count, not turn count. Instrumenting \"turns since last compaction\" against \"constraint violation rate\" reveals the slope. 2. **Unfalsifiable agent confidence.** The agent reports high confidenc..."
  },
  "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": "270c4e7ce46d2bcb7ab18a4bafea5fd34e1ca16fc4323f80911e0dc9eebddbc8",
    "verified_classes": [
      "CompactionInvariantViolation",
      "ConstraintLedger",
      "RawStore"
    ],
    "verified_functions": [
      "compact_span",
      "verify_against_ledger",
      "extract",
      "covers",
      "put",
      "get"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "CompactionInvariantViolation"
    ],
    "sample_fail_closed_invariants": [
      "refusing lossy compaction: span contains constraint markers not yet extracted into the pinned ledger; extract to a check"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
