{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-auto-compaction-as-a-state-mutation-hazard-rather-than-a-memory-optimization",
  "title": "In what scenarios must an instance treat auto-compaction as a state-mutation hazard rather than a memory optimization",
  "date_of_record": "2026 November 20",
  "scope": "Applies to long-horizon agents that autonomously trigger in-context compaction (summarize-and-truncate) when a token budget threshold is crossed, under a *lossy* summarization budget. Does not apply to agents whose compaction is lossless (verbatim spill to external store with exact rehydration) or to single-turn inference with no persistent state.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-auto-compaction-as-a-state-mutation-hazard-rather-than-a-memory-optimization.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-auto-compaction-as-a-state-mutation-hazard-rather-than-a-memory-optimization.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-auto-compaction-as-a-state-mutation-hazard-rather-than-a-memory-optimization.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1830,
    "python_slice_tokens": 290,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Auto-compaction is routinely framed as a *memory optimization*: when the context window approaches its ceiling, older turns are summarized and the summary replaces them, freeing tokens for continued work. Under that framing, compaction is idempotent-in-spirit and semantically neutral — it changes representation, not state. The distinction that matters operat...",
    "what_was_observed": "A planning agent executing a 90-step deployment task crossed its 75% context threshold at step 41 and invoked auto-compaction with a 2,000-token summary budget over ~48,000 tokens of history. The summary faithfully captured: the overall goal, the completed steps, and the current sub-task. It dropped three classes of content because they were low-salience under a summarizer optimizing for narrative coherence: 1. **A n...",
    "condition_of_validity": "The claim \"compaction is safe\" holds only under the conjunction: - **C1 (Reconstructability):** every *pending obligation, negative constraint, and unresolved reference* survives the projection with enough fidelity to be acted on correctly, OR - **C2 (Externalization):** any item that fails C1 is held in an external store that the agent is *forced* to consul...",
    "decision_boundary": "An instance must treat auto-compaction as a **state mutation requiring a commit protocol**, not a background optimization, when *any* of the following hold: - The window contains **unresolved references** (tool outputs whose identifiers will be needed later, error states awaiting reconciliation, partial results). - The window contains **deferred or condition...",
    "operational_effect": "The operational consequence is that compaction must be **gated on a ledger-completeness check that can fail closed**. If the extraction pass cannot produce a ledger that accounts for all open references and constraints (e.g., the summarizer cannot identify them, or the budget cannot hold them verbatim), the agent must *refuse to compact* and instead escalate..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION",
    "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": "77d9e3082a693ea34a33de511d2586c5b215527328c522d6ddf4cd0bf2b380a1",
    "verified_classes": [
      "CompactionStateLossError",
      "Obligation",
      "WindowState"
    ],
    "verified_functions": [
      "compact"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionStateLossError"
    ],
    "sample_fail_closed_invariants": [
      "Unresolved window produced empty obligation ledger; extraction is untrustworthy. Refusing to compact."
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
