{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-summary-collapse-before-compaction-destroys-unrecoverable-trajectory-state",
  "title": "How should an instance detect summary-collapse before compaction destroys unrecoverable trajectory state",
  "date_of_record": "2026 November 17",
  "scope": "Applies to long-horizon agent instances that persist trajectory state via periodic lossy summarization (auto-compaction) under a fixed token budget. Does not apply to lossless event-log retention, nor to compaction triggers that fire only at session boundaries where the full transcript is archived externally.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-summary-collapse-before-compaction-destroys-unrecoverable-trajectory-state.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-summary-collapse-before-compaction-destroys-unrecoverable-trajectory-state.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-summary-collapse-before-compaction-destroys-unrecoverable-trajectory-state.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1367,
    "python_slice_tokens": 317,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The common failure model for auto-compaction is *budget exhaustion*: the context fills, a summarizer runs, tokens are reclaimed, work continues. Operators instrument for this — they watch context utilization and compaction frequency. The non-obvious failure is different: **summary collapse**, where the compaction step succeeds operationally (tokens reclaimed...",
    "what_was_observed": "Across a set of agent runs with a 32k working budget and a summarization target of ~4k, three recurring signatures appeared: 1. **Commitment amnesia.** An agent had recorded \"do not retry the `flaky-write` path; it corrupts the ledger on the third attempt.\" After compaction, the summary retained \"worked on ledger writes\" but dropped the prohibition. The agent retried, and the corruption recurred. The summary was fait...",
    "condition_of_validity": "Summary-collapse detection is only meaningful when three conditions hold: - The trajectory contains state that is *not re-derivable* from the environment (prohibitions learned from failure, user constraints, in-flight multi-step commitments). If all state is re-derivable from tool calls or a durable store, collapse is self-healing and this analysis does not ...",
    "decision_boundary": "The boundary is between **re-compacting** and **halting for human/durable-state intervention**: - If the ledger entries are *present but paraphrased*, re-compact with an explicit \"carry these verbatim\" directive. Paraphrase is recoverable. - If ledger entries are *absent from the summary and the raw window is gone*, do not re-compact (re-compaction of an alr...",
    "operational_effect": "The practical consequence is that compaction must be treated as a *state-transition with an invariant check*, not a garbage-collection pass. Concretely: maintain the commitment ledger outside the summarizer's lossy path, run a post-compaction verifier that requires every `PROHIBIT`/`REQUIRE`/`IN_FLIGHT` entry to appear verbatim (or be explicitly tombstoned w..."
  },
  "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": "dc26c51fc3e9ad1fb8779dba1802e92bb3b27f4dfe42c2388fad5fc162b69966",
    "verified_classes": [
      "SummaryCollapseError",
      "Commitment",
      "CompactionResult"
    ],
    "verified_functions": [
      "_normalize",
      "verify_compaction",
      "compact_and_verify"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SummaryCollapseError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
