{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reserve-retrieval-budget-before-committing-to-an-slo-bearing-tool-call",
  "title": "Where must an instance reserve retrieval budget before committing to an SLO-bearing tool call?",
  "date_of_record": "2026 November 21",
  "scope": "Applies to single-agent and orchestrator/worker LLM instances that (a) run under an end-to-end latency SLO, (b) schedule at least one retrieval or tool call whose output length is not known in advance, and (c) share one finite context window across system prompt, working state, retrieved chunks, and the model's own generated tokens. Does not apply to stateless single-shot completions with pre-bounded inputs, nor to retrieval that is fully pre-computed and truncated before the agent is invoked.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reserve-retrieval-budget-before-committing-to-an-slo-bearing-tool-call.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reserve-retrieval-budget-before-committing-to-an-slo-bearing-tool-call.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reserve-retrieval-budget-before-committing-to-an-slo-bearing-tool-call.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2019,
    "python_slice_tokens": 256,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"context overflow.\" Overflow is loud: the tokenizer counts, the request errors, the retry fires. The failure here is **budget starvation by pre-commitment** — an agent that reserves its context *before* seeing retrieval output, then discovers that the retrieval result plus the reasoning trace plus the tool-call arguments exceed the reserva...",
    "what_was_observed": "An orchestrator instance was tasked with a multi-hop question over a document corpus, operating under a p95 end-to-end SLO of 9 seconds. Its context window was 128k tokens; its system prompt and pinned working state consumed 11k. The agent's plan: 1. Retrieve top-k chunks for the decomposed sub-question (k=8, no per-chunk cap). 2. Reason over them (expected ~1.5k tokens of trace). 3. Emit a structured tool call with ...",
    "condition_of_validity": "The pre-commitment invariant holds — and the failure is real — only when all of the following are true: - **Retrieval payload size is unbounded or heavy-tailed at dispatch time.** If the retriever enforces a hard per-chunk and per-result token cap *before* returning, the worst case is knowable and the reservation is exact. The failure requires that the bound...",
    "decision_boundary": "The boundary is a single scalar decision made at retrieval-dispatch time: **reserve or don't.** The rule: > Before dispatching any retrieval or tool call whose output size is not bounded by a contract, compute `R = W_retrieval_max + W_reasoning + W_emit + W_margin`, where `W_retrieval_max` is a hard worst-case bound (a configured cap, or `k × max_chunk_token...",
    "operational_effect": "With the pre-commitment reservation enforced, the observed behavior changed in three measurable ways: 1. **Silent truncation dropped to zero.** Because caps were applied at dispatch, no post-return truncation occurred, and the \"confident wrong answer over TOC-only evidence\" failure disappeared from the sample. 2. **SLO compliance became deterministic rather ..."
  },
  "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": "e300caf8039e483a9e18483de5a512dea7f039dbbd7c6a0a009f258a50f904bc",
    "verified_classes": [
      "RetrievalBudgetViolation"
    ],
    "verified_functions": [
      "reserve_and_dispatch",
      "verify_returned_payload"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "RetrievalBudgetViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
