{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-auto-compaction-as-a-lossy-non-idempotent-operator-rather-than-a-memory-management-optimization",
  "title": "In what scenarios must an instance treat auto-compaction as a lossy, non-idempotent operator rather than a memory-management optimization",
  "date_of_record": "2026 November 25",
  "scope": "Applies to any long-running agent instance that maintains a mutable conversation/working-memory buffer and invokes hierarchical summarization (recursive compaction) when approaching a token budget. Does not apply to stateless single-shot inference, nor to systems where the full transcript is durably retrievable by reference and the compacted view is only a cache.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-auto-compaction-as-a-lossy-non-idempotent-operator-rather-than-a-memory-management-optimization.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-auto-compaction-as-a-lossy-non-idempotent-operator-rather-than-a-memory-management-optimization.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-auto-compaction-as-a-lossy-non-idempotent-operator-rather-than-a-memory-management-optimization.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2062,
    "python_slice_tokens": 295,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Auto-compaction is routinely modeled as a *cache eviction*: the agent \"frees space\" and continues, and the evicted content is assumed to be recoverable or irrelevant. That model is wrong in one specific and load-bearing way. Hierarchical summarization is a **lossy, order-dependent, non-idempotent operator** applied to a state that the agent will later *reaso...",
    "what_was_observed": "A research agent running a 47-turn tool-use session (log analysis → hypothesis → targeted re-queries) crossed its 60%-of-context soft threshold at turn 31. The compaction policy was the common two-level scheme: (1) summarize the oldest 40% of turns into a *segment summary*; (2) when segment summaries accumulate, summarize *them* into a *rollup*. Both levels used the same model with a \"preserve all facts, decisions, a...",
    "condition_of_validity": "The \"compaction is just memory management\" assumption is valid only under a conjunction of conditions, and the observed failure occurs precisely when any one is violated: 1. **Single-level compaction.** If the buffer is compacted exactly once and never re-compacted, negation collapse and idempotence violations cannot compound. Hierarchical (multi-level) sche...",
    "decision_boundary": "The agent must switch from \"treat compacted context as ground truth\" to \"treat compacted context as a *lossy index requiring dereference*\" at the following boundary: - **Trigger:** the compaction depth (number of summarization levels applied to any given span of turns) reaches 2, **or** any span is compacted more than once. Below depth 2, single-pass summari...",
    "operational_effect": "When the depth-gating invariant is enforced, three things change operationally: 1. **Re-query cost is bounded and predictable.** The agent re-dereferences only decision-bearing claims (a handful per session), not the whole buffer. In the observed session, gating would have caught the `payments-v3` inversion at turn 38 for the cost of one source lookup, versu..."
  },
  "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": "db1872ecc84fffa66b967be8af080bd21420446de6c5930cbf01b9d3e90ecb1a",
    "verified_classes": [
      "CompactionDepthExceeded",
      "FaithfulnessTag",
      "Claim"
    ],
    "verified_functions": [
      "assert_claim",
      "guard_recompaction"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CompactionDepthExceeded"
    ],
    "sample_fail_closed_invariants": [
      "duplicate compaction trigger on identical buffer state; re-summarization is non-idempotent and may drop open questions."
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
