{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-auto-compaction-the-pre-compaction-tool-call-receipt-gap",
  "title": "When must an instance refuse auto-compaction: the pre-compaction tool-call receipt gap",
  "date_of_record": "2026 November 26",
  "scope": "Applies to long-horizon agent sessions where a runtime periodically summarizes or truncates the context window (\"auto-compaction\") while tool calls are in flight or have unacknowledged side effects. Does not apply to stateless single-turn inference, or to compaction performed strictly between turns with an empty pending-call set.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-auto-compaction-the-pre-compaction-tool-call-receipt-gap.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-auto-compaction-the-pre-compaction-tool-call-receipt-gap.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-auto-compaction-the-pre-compaction-tool-call-receipt-gap.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1633,
    "python_slice_tokens": 225,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Most compaction literature treats the context window as a *lossy cache*: summarize older tokens, keep recent tokens, accept some information loss, continue. That framing is correct only when the evicted region contains no *unsettled commitments* — tokens whose meaning depends on an external effect that has not yet been reconciled with the model's own record ...",
    "what_was_observed": "A research agent running a 40-step data-collection loop against an internal billing API. The runtime's auto-compaction triggered on a token threshold (92% of window) with a policy of \"summarize the oldest 70% of turns, retain the last 30% verbatim, prepend a rolling summary.\" Trace of the failure: 1. Turn 23: agent emits `billing.charge(customer=C-8841, amount=1200, idempotency_key=null)`. The runtime dispatches it. ...",
    "condition_of_validity": "Receipt-gated compaction is required if and only if all three hold: 1. **The tool set contains at least one non-idempotent or weakly-idempotent effect.** Idempotency here means *keyed* idempotency (server-side dedup on a supplied key), not \"calling twice is usually fine.\" A charge with `idempotency_key=null` is non-idempotent regardless of HTTP semantics. 2....",
    "decision_boundary": "The runtime must make a binary decision at each compaction trigger: - **If `pending_calls == ∅`:** compact on token threshold. Summarize freely. No receipt obligations. - **If `pending_calls ≠ ∅`:** *defer* compaction until either (a) every pending call receives a receipt, or (b) a hard ceiling (e.g., 99% window) forces action, in which case compact the *old...",
    "operational_effect": "With receipt-gating and a pinned commitment block, the double-charge trace becomes impossible: at turn 29 the agent sees `{call_id: 23a, tool: billing.charge, idempotency_key: <generated>, receipt: null}` and either waits or retries *with the same key*, which the billing API dedups. The summarizer never sees the receipt, so it cannot paraphrase it into ambig..."
  },
  "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": "07fedb6f8f908f1a6146285b4b0e1f064a1eb5ad1594750c8618c5c2289e57eb",
    "verified_classes": [
      "UnsettledCommitmentCompactionError"
    ],
    "verified_functions": [
      "compact_context"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "UnsettledCommitmentCompactionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
