{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-auto-compaction-trigger-heuristics-from-silently-destroying-unrecoverable-context-under-lossy-summarization-recovery",
  "title": "Which invariants prevent auto-compaction trigger heuristics from silently destroying unrecoverable context under lossy summarization recovery",
  "date_of_record": "2026 November 13",
  "scope": "Applies to systems that trigger context compaction (summarization, eviction, or token-budget truncation) automatically based on heuristic thresholds such as token utilization, turn count, or time-since-last-compaction. Does not apply to explicit, operator-initiated compaction where a human reviews the summary before it replaces the source, nor to lossless eviction (e.g., spill-to-disk with retrieval) where the original bytes remain addressable.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-auto-compaction-trigger-heuristics-from-silently-destroying-unrecoverable-context-under-lossy-summarization-recovery.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-auto-compaction-trigger-heuristics-from-silently-destroying-unrecoverable-context-under-lossy-summarization-recovery.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-auto-compaction-trigger-heuristics-from-silently-destroying-unrecoverable-context-under-lossy-summarization-recovery.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1414,
    "python_slice_tokens": 182,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **compaction as a reversible projection** and **compaction as a destructive overwrite**. A trigger heuristic answers only one question: *when* to compact. It does not answer *whether the compaction is recoverable*. Systems conflate these. A heuristic like \"compact when context utilization exceeds 80%\" fires identically...",
    "what_was_observed": "A long-running agent loop compacted on a fixed 80%-of-window utilization heuristic. On one turn, the summarizer was invoked over a context containing a critical negative constraint (\"do not re-use order ID 4471; it was voided\") alongside ~40k tokens of routine tool output. The summary retained the order-processing narrative but dropped the negation — a classic lossy-summarization failure mode, since summarizers prefe...",
    "condition_of_validity": "The no-auto-compaction-without-recovery invariant is valid — and the trigger heuristic is safe to act on — only when all of the following hold at the instant the heuristic fires: 1. **Retention invariant:** the full pre-compaction context is durably persisted and addressable by a stable key *before* the summary is committed as the active context. 2. **Reacha...",
    "decision_boundary": "The boundary is **reversibility of the compaction, not utilization level**. Concretely: - If retention + reachability + detectability + atomicity all hold → the trigger heuristic may fire automatically at any threshold; lossy summarization is tolerable because it is recoverable and auditable. - If any invariant fails → automatic triggering must be blocked re...",
    "operational_effect": "Honoring the invariant converts a silent, deferred, un-diagnosable corruption into a loud, immediate, recoverable halt. The cost is that context-full conditions under a broken recovery path now surface as errors instead of being papered over by destructive compaction — which is the correct trade, because the alternative is a system that appears healthy while..."
  },
  "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": "c9f2e9692b5f17c452cd04c98c3a225762fa0e38c979106b8ef1ceb4c8733187",
    "verified_classes": [
      "CompactionInvariantError"
    ],
    "verified_functions": [
      "assert_compaction_is_reversible",
      "maybe_auto_compact"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "CompactionInvariantError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
