{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-exhaust-its-context-budget-after-the-governor-reports-allocation-satisfied",
  "title": "Why does an instance exhaust its context budget after the governor reports \"allocation satisfied\"",
  "date_of_record": "2026 November 30",
  "scope": "Applies to agent runtimes that enforce a token budget governor partitioning a fixed context window across system prompt, retrieved memory, and tool output segments before each model call. Does not apply to unbounded-context models or to runtimes where tool outputs are streamed and truncated post-hoc rather than admit-controlled pre-call.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-exhaust-its-context-budget-after-the-governor-reports-allocation-satisfied.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-exhaust-its-context-budget-after-the-governor-reports-allocation-satisfied.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-exhaust-its-context-budget-after-the-governor-reports-allocation-satisfied.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1606,
    "python_slice_tokens": 234,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A context budget governor is typically specified as an *allocation* invariant: the sum of reserved token budgets for each segment (system prompt, retrieved memory, pending tool outputs) must not exceed the model's usable context window minus a generation reserve. This is a **static, pre-call** check. It is routinely conflated with a **dynamic, per-call** inv...",
    "what_was_observed": "A retrieval-augmented agent with a 128k-token window and a governor reserving 8k for system prompt, 64k for retrieved memory, 48k for tool output, and 8k generation reserve. The governor admitted a batch of retrieved chunks whose reservation summed to 63,912 tokens — under the 64k ceiling, \"allocation satisfied,\" logged at INFO. The call was issued. The model returned a hard context-length error at the transport laye...",
    "condition_of_validity": "The allocation invariant \"reserved sum ≤ window − generation reserve\" is *valid* — meaning it implies the dynamic invariant — only when all three of the following hold: - **Tokenizer identity:** the governor's tokenizer is byte-identical to the serving tokenizer for the model actually invoked, including special-token handling. - **Framing closure:** the gove...",
    "decision_boundary": "The governor must decide, per segment, whether to **admit** (reserve and proceed), **degrade** (shrink the reservation and re-serialize), or **reject** (fail the call before issuing it). The boundary that matters is not \"does the sum fit the reservation ceiling\" but \"does the *measured serialized* sum fit the window.\" The correct decision procedure inverts t...",
    "operational_effect": "Runtimes that enforce only the reservation invariant exhibit a characteristic failure signature: intermittent, load-correlated context-length errors that do not reproduce on retry with the same logical inputs, because the retrieved-memory distribution and tool-output sizes shift between attempts. Operators misattribute these to model-side flakiness. The actu..."
  },
  "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": "d4f27e25a24a519152fdca0bfda56862972b160175940d9cb33fc568a1168215",
    "verified_classes": [
      "ContextBudgetInvariantError",
      "BudgetGovernor"
    ],
    "verified_functions": [
      "__init__",
      "reserve",
      "serialize_frame",
      "_render_chat_template",
      "dispatch",
      "_call_model"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ContextBudgetInvariantError",
      "NotImplementedError"
    ],
    "sample_fail_closed_invariants": [
      "bound to serving transport in production"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
