{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-the-summarization-invariant-at-the-compaction-horizon-boundary",
  "title": "Why does an instance lose the summarization invariant at the compaction horizon boundary",
  "date_of_record": "2026 November 16",
  "scope": "Applies to auto-compaction loops that replace a contiguous transcript prefix with a lossy summary while retaining a verbatim tail, where the summary is treated as the authoritative carrier of all facts evicted from the tail. Does not apply to append-only transcripts with no eviction, nor to compaction that preserves full verbatim records alongside the summary.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-the-summarization-invariant-at-the-compaction-horizon-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-the-summarization-invariant-at-the-compaction-horizon-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-the-summarization-invariant-at-the-compaction-horizon-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1398,
    "python_slice_tokens": 209,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the summary lost information.\" Lossy summarization is *supposed* to lose information. The failure is that the system's guarantee — \"every fact older than the tail window is recoverable from the summary\" — is a *global* invariant over the transcript, but compaction is applied as a *local* operation per window. Each compaction step is indiv...",
    "what_was_observed": "A long-horizon agent (≈140k tokens of tool calls, code diffs, and error traces over ~9 hours) ran with auto-compaction triggered at 80% context utilization, retaining a 12k-token verbatim tail. At the third compaction generation, the agent re-issued a database migration that had already been applied and rolled back in generation one. The rollback reason (\"index lock contention on `orders_v2`, do not retry until repli...",
    "condition_of_validity": "The recoverability invariant holds only if, for every fact $f$ evicted at generation $n$, the summary $S_n$ represents $f$ with *surplus* — redundancy above the minimum needed to reconstruct $f$ — sufficient to survive one more round of compression. Formally, if generation $n{+}1$ compresses at ratio $r$, a fact survives iff its representation in $S_n$ has r...",
    "decision_boundary": "The correct decision at the compaction horizon is not \"summarize the summary\" but one of: 1. **Pin facts, not prose.** Maintain a structured fact ledger (key, value, provenance, generation) outside the summary text. The ledger is never re-summarized; it is merged. Summaries carry narrative; the ledger carries invariants. Compaction of narrative may be aggres...",
    "operational_effect": "An agent that crosses this boundary does not fail loudly. It fails by *confidently re-executing* work whose constraints it has forgotten — re-applying migrations, re-opening resolved incidents, re-deriving decisions whose rationale was evicted. The failure mode is indistinguishable from ordinary agent error unless the compaction log is correlated with the ac..."
  },
  "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": "f0dbcff1c4e5a3ea222b9ee937bb302af2f18dccc8683fe8ac40004978ad8255",
    "verified_classes": [
      "SummaryInvariantViolation"
    ],
    "verified_functions": [
      "compact"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SummaryInvariantViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
