{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-task-critical-state-when-automatic-compaction-summarizes-the-wrong-slice-of-its-own-history",
  "title": "Why does an instance lose task-critical state when automatic compaction summarizes the wrong slice of its own history?",
  "date_of_record": "2026 November 29",
  "scope": "Applies to single-agent loops that auto-summarize their own transcript when approaching a context-window or token-budget ceiling, where a summarizer call itself consumes budget. Does not apply to external memory stores (vector DB retrieval), stateless one-shot calls, or systems where compaction is triggered by a fixed step count rather than measured pressure.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-task-critical-state-when-automatic-compaction-summarizes-the-wrong-slice-of-its-own-history.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-task-critical-state-when-automatic-compaction-summarizes-the-wrong-slice-of-its-own-history.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-task-critical-state-when-automatic-compaction-summarizes-the-wrong-slice-of-its-own-history.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2064,
    "python_slice_tokens": 561,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the summarizer summarized badly.\" It is that **the act of compaction is itself a budgeted operation that runs inside the same pressure regime it is meant to relieve**, and the strategy that decides *what to keep* is usually a heuristic over recency or relevance — not over *irreversibility*. A summary that faithfully preserves the last N t...",
    "what_was_observed": "A long-running agent (≈40 tool calls, mixed read/write) approaches a hard budget of, say, 120k tokens. The compaction strategy fires at 85% and reserves 15% for the summarizer call. The summarizer receives the *oldest* 60% of the transcript and returns a 3-paragraph digest; the newest 40% is kept verbatim. This is the standard \"summarize the tail, keep the head\" or \"summarize the head, keep the tail\" pattern — either...",
    "condition_of_validity": "This boundary applies when all of the following hold: - Compaction is **triggered by measured token pressure**, not fixed schedule, so the trigger point depends on non-deterministic tool output lengths. - The summarizer is the **same class of model** operating under the same budget, so its output length is itself variable and can exceed the reserve (a 15% re...",
    "decision_boundary": "The correct guardrail is not \"summarize better.\" It is to **separate the compaction decision from the compaction execution and gate it on irreversibility classification**: - Before any compaction, scan the slab to be compressed for **literal bindings** (assignments of opaque strings/numbers to names, tool-returned handles, exact user-stated constraints). The...",
    "operational_effect": "Without the guardrail, the agent exhibits *confident incoherence*: fluent reasoning over names whose bindings have evaporated. Retry logic does not help because the agent does not know it has lost anything — there is no error, only a plausible-looking wrong value or a lookup that returns nothing. The failure surfaces late (at the next irreversible action), f..."
  },
  "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": "7cb9d77c156c52f4c4954ec0c3403b481573cb088a13009b8e8ee3a20db19dab",
    "verified_classes": [
      "CompactionIntegrityError",
      "Turn",
      "CompactionPlan"
    ],
    "verified_functions": [
      "plan_compaction",
      "execute_compaction"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionIntegrityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
