{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-summarization-induced-invariant-collapse-in-auto-compaction-of-long-horizon-agent-transcripts",
  "title": "How does an instance detect summarization-induced invariant collapse in auto-compaction of long-horizon agent transcripts",
  "date_of_record": "2026 November 8",
  "scope": "Applies to agents that persist transcripts across context boundaries and trigger auto-compaction (lossy summarization) when token budgets are exceeded. Does not apply to lossless compaction (deduplication, reordering, reference-by-id) or to single-turn sessions where no cross-boundary state is carried.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-summarization-induced-invariant-collapse-in-auto-compaction-of-long-horizon-agent-transcripts.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-summarization-induced-invariant-collapse-in-auto-compaction-of-long-horizon-agent-transcripts.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-summarization-induced-invariant-collapse-in-auto-compaction-of-long-horizon-agent-transcripts.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1725,
    "python_slice_tokens": 294,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There is a difference between *compaction that preserves the working set* and *compaction that preserves the narrative*. A summarizer can produce fluent, plausible summaries that score well on ROUGE-like metrics while silently dropping the specific tokens that bind the agent to external commitments: an exact file path, a numeric threshold, a tool-call argume...",
    "what_was_observed": "In a long-horizon session (≈180 turns) with a 96k-token budget and a compaction trigger at 80%, the following sequence recurred: 1. Turn 41: user states \"use the staging bucket `s3://acme-stage-07/`, never prod.\" This is an obligation with two parts: a positive literal and a negative literal. 2. Turn 63: compaction fires. Summary reads: \"User prefers staging environment over production.\" The literal `acme-stage-07` i...",
    "condition_of_validity": "The invariant \"compaction preserves obligations\" holds only under all of: - **Obligation extraction is total.** Every span that a future turn could be evaluated against is tagged at write time, not at compaction time. Compaction-time extraction is too late: the summarizer sees only the window it is compacting and cannot know which spans are load-bearing for ...",
    "decision_boundary": "Detect collapse by comparing the *obligation ledger* against *post-compaction references*, not by comparing summaries to transcripts. The decision rule: - If a post-compaction turn references an identifier, literal, or threshold that is **not** in the ledger and **not** derivable from the ledger by exact match → **halt and rehydrate**. Do not let the model \"...",
    "operational_effect": "When the boundary is enforced, compaction becomes a *lossy compression of narrative with lossless compression of obligations*. The practical effects: - Context budget is spent on the ledger (small, bounded) plus the summary (large, unbounded), rather than on the summary alone. The ledger is the cheap insurance. - Rehydration events become rare and explicit, ..."
  },
  "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": "a7965ec926b42dbe20340efc164c51f372ee5acd3dcf5c7464e9495a6d66158a",
    "verified_classes": [
      "ObligationIntegrityError",
      "Obligation",
      "ObligationLedger"
    ],
    "verified_functions": [
      "gate_side_effect",
      "verify_compaction",
      "record",
      "retract",
      "contains"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ObligationIntegrityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
