{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reconcile-token-budget-eviction-against-in-flight-tool-call-reservations-before-admitting-a-new-turn",
  "title": "Where must an instance reconcile token-budget eviction against in-flight tool-call reservations before admitting a new turn?",
  "date_of_record": "2026 November 28",
  "scope": "Applies to any agent runtime that enforces a hard context-token ceiling by evicting or compacting history while tool calls are concurrently outstanding (MCP `tools/call`, A2A task handoffs, or function-calling with async latency). Does not apply to fully synchronous single-turn inference where no tool result is pending at admission time.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-token-budget-eviction-against-in-flight-tool-call-reservations-before-admitting-a-new-turn.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-token-budget-eviction-against-in-flight-tool-call-reservations-before-admitting-a-new-turn.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-token-budget-eviction-against-in-flight-tool-call-reservations-before-admitting-a-new-turn.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1784,
    "python_slice_tokens": 340,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A context budget governor has two distinct token populations that are frequently conflated: **resident tokens** (already materialized in the prompt) and **reserved tokens** (promised to a tool call whose result has not yet returned). The eviction decision is usually computed against `resident`, because that is the only quantity the tokenizer can measure. But...",
    "what_was_observed": "A planner agent issued three parallel `tools/call` requests (a file read, a schema lookup, a search) at turn *T*. The governor, on admission of turn *T+1* (a user nudge arriving before results returned), measured resident tokens at 91% of a 128k ceiling and evicted the oldest 22k tokens. Eviction policy was LRU-by-recency with a \"keep last user message + system prompt\" pin. The evicted span included the *assistant to...",
    "condition_of_validity": "The failure requires the conjunction of four conditions, and the guardrail below is only necessary when all four hold: - **C1 — Asynchrony:** at least one tool call is outstanding (issued, not returned) at the moment an eviction is triggered. - **C2 — Unpinned call block:** the originating assistant call block is eligible for eviction (not pinned by policy)....",
    "decision_boundary": "The governor must maintain a **reservation ledger** keyed by `tool_call_id`, and the admission test must be: where `reserved` is the sum of upper-bound token estimates for all outstanding calls (estimated from the call's argument schema and a per-tool p95 result size, not from the eventual actual size, which is unknown). Two boundaries follow: - **Boundary A...",
    "operational_effect": "With the reservation ledger and the two boundaries enforced, the observed failure modes collapse: - Fabricated bindings disappear because call blocks survive until their results are admitted. - Silent re-derivation disappears because the model sees the result bound to its originating call and does not re-issue. - The 400-class transport rejection disappears ..."
  },
  "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": "f0bf5fff9378e073aa6bb86384f390ad250a3814d8dbcaf8fd57265d03a2cb1c",
    "verified_classes": [
      "ReservationOrphanError",
      "ContextGovernor"
    ],
    "verified_functions": [
      "reserved_tokens",
      "admit_turn",
      "evict",
      "drain",
      "register_call",
      "admit_result"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ReservationOrphanError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
