{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-refuse-to-compact-a-context-window-that-contains-an-in-flight-tool-call-warrant-and-how-does-premature-compacti",
  "title": "Under what conditions must an instance refuse to compact a context window that contains an in-flight tool-call warrant, and how does premature compaction silently invalidate downstream verification?",
  "date_of_record": "2026 November 25",
  "scope": "Applies to long-horizon agents that (a) maintain a bounded context window under an auto-compaction policy, (b) emit tool calls whose results are consumed by a later verification or audit step, and (c) persist a compacted summary as the canonical state for resume. Does not apply to stateless single-turn inference or to agents whose entire trajectory fits within one window with no resume path.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-compact-a-context-window-that-contains-an-in-flight-tool-call-warrant-and-how-does-premature-compacti.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-compact-a-context-window-that-contains-an-in-flight-tool-call-warrant-and-how-does-premature-compacti.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-compact-a-context-window-that-contains-an-in-flight-tool-call-warrant-and-how-does-premature-compacti.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1973,
    "python_slice_tokens": 264,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Auto-compaction is routinely treated as a *memory-pressure* operation: when the token count crosses a threshold, summarize the oldest span and continue. This framing conflates two structurally different things living in the same transcript — **narrative state** (what the agent has reasoned about, which is lossy-compressible) and **evidentiary state** (the ex...",
    "what_was_observed": "A planner/executor/auditor pipeline ran a 40-step task against an external API. The executor issued a mutating call at step 27 (`transfer_funds`, args hashed to `w:9f2a…`) with a signed warrant `W27` minted by the planner and a pending auditor check scheduled for step 31. At step 29 the context crossed the 82% threshold and the auto-compactor fired. It summarized steps 1–28 into a 900-token digest. The digest faithfu...",
    "condition_of_validity": "The invariant that must hold: **a compaction pass may only consume a span whose every tool-call warrant has been (a) consumed by its designated verifier and (b) recorded as verified in a durable ledger outside the context window.** Formally, for any span `S` selected for compaction, `∀ call c ∈ S : status(c.warrant) ∈ {VERIFIED, EXPIRED_UNCONSUMED}`. An in-f...",
    "decision_boundary": "The boundary between safe and unsafe compaction is drawn at the **warrant-consumption frontier**, not at the token threshold. Concretely: - **Below the frontier (all warrants consumed):** summarize freely; narrative compression is lossless with respect to verification because nothing downstream depends on the exact bytes. - **At the frontier (a warrant is IS...",
    "operational_effect": "Enforcing the frontier invariant changes three operational properties: 1. **Peak token usage rises.** Agents must budget headroom for in-flight spans that cannot be compacted. A pipeline that previously ran at an 82% watermark now needs to tolerate 90–95% transiently, or must shrink its in-flight window by verifying more eagerly (moving the frontier forward ..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "4634190572709aef7059a70bd2d2e94eef56d2c2a66d1d8133015f0ab874bf61",
    "verified_classes": [
      "WarrantState",
      "Warrant",
      "UnsafeCompactionError"
    ],
    "verified_functions": [
      "assert_span_compactable",
      "compact_span"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "UnsafeCompactionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
