{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-critical-state-when-hierarchical-summarization-compacts-a-context-window-across-multiple-checkpoint-generations",
  "title": "Why does an instance lose critical state when hierarchical summarization compacts a context window across multiple checkpoint generations",
  "date_of_record": "2026 November 17",
  "scope": "Applies to agent runtimes that compact context by recursively summarizing older segments into checkpoints under a hard token budget, where checkpoints themselves may be re-summarized in later generations. Does not apply to append-only context with no lossy re-summarization, nor to retrieval-augmented systems where the original tokens remain addressable via an index.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-critical-state-when-hierarchical-summarization-compacts-a-context-window-across-multiple-checkpoint-generations.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-critical-state-when-hierarchical-summarization-compacts-a-context-window-across-multiple-checkpoint-generations.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-critical-state-when-hierarchical-summarization-compacts-a-context-window-across-multiple-checkpoint-generations.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1470,
    "python_slice_tokens": 264,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct quantities in a compaction pipeline: **semantic retention** (does the summary preserve the meaning of the source?) and **invariant retention** (does the summary preserve the exact constraints, identifiers, and preconditions that downstream steps *depend on*?). Hierarchical summarization optimizes the first and silently destroys the sec...",
    "what_was_observed": "A long-running planning agent accumulated a 340k-token working context across ~40 turns. At the 200k budget ceiling, the runtime compacted the oldest 60% into a Generation-1 checkpoint (~4k tokens). At the next ceiling, Generation-1 was folded into a Generation-2 checkpoint. By Generation-3, the following had occurred: - A hard constraint (\"the `schema_migrate` job must reach `v7` before any write to `orders`\") survi...",
    "condition_of_validity": "The failure requires all of the following to hold simultaneously: 1. **Lossy re-summarization across ≥2 generations.** A single compaction pass is comparatively safe because the summarizer still sees the original tokens. The dangerous regime is G(n) → G(n+1), where the summarizer's input is already a lossy artifact and it cannot distinguish \"this detail was ...",
    "decision_boundary": "The operative rule: **hierarchical summarization may compress narrative and reasoning, but must never be the sole custodian of invariants.** The boundary is between *descriptive* state (what happened, what was discussed, what was tried) and *prescriptive* state (what must be true, what must never happen, exact identifiers). Descriptive state is safe to re-su...",
    "operational_effect": "When this boundary is respected, hierarchical compaction remains safe at arbitrary depth: descriptive context shrinks without bound while the invariant ledger stays constant-size and verbatim. When it is violated, the system exhibits **silent, delayed, generation-correlated failure**: reliability degrades as a function of compaction depth, not as a function ..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "30b946480d686259fadc7cc5c19608374c3a3c72532fefabf12a56027220e482",
    "verified_classes": [
      "InvariantLossError",
      "Invariant",
      "Checkpoint"
    ],
    "verified_functions": [
      "compact"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "InvariantLossError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
