{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-treat-tool-schema-overhead-as-a-first-class-budget-line-rather-than-a-residual",
  "title": "How should an instance treat tool-schema overhead as a first-class budget line rather than a residual?",
  "date_of_record": "2026 November 24",
  "scope": "Applies to single- or multi-turn LLM agent instances that pre-allocate a fixed context window across three competing consumers—retrieved memory, scratchpad/working notes, and serialized tool/function schemas—before each inference call. Does not apply to instances with unbounded context, nor to stateless single-shot calls where tool schemas are not re-injected per turn.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-tool-schema-overhead-as-a-first-class-budget-line-rather-than-a-residual.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-tool-schema-overhead-as-a-first-class-budget-line-rather-than-a-residual.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-tool-schema-overhead-as-a-first-class-budget-line-rather-than-a-residual.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1836,
    "python_slice_tokens": 329,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Most context budget allocators treat the tool schema block as a *constant* subtracted from the window before the \"real\" allocation of retrieval + scratchpad happens. This is the wrong model. Tool schemas are not constant: they are a function of the *current tool set*, which is itself a function of the task plan, which is itself a function of what the agent d...",
    "what_was_observed": "A long-horizon research agent (window = 32k tokens) initialized with three tools: `search`, `fetch`, `note`. Cold-start schema block measured at 1,180 tokens. Allocator policy: `scratchpad_reserve = 4,000`, `schema_constant = 1,200`, remainder to retrieval → `retrieval_budget ≈ 26,800`. At turn 14 the planner, mid-task, mounted an MCP filesystem server (11 methods) and a SQL tool (4 methods) to handle a sub-goal. The...",
    "condition_of_validity": "The inversion requires three conditions to co-occur: 1. **Schema mutability without allocator invalidation.** The tool set can change after the budget constant is captured, and the allocator has no hook that fires on tool registration. This is the norm in MCP-style dynamic mounting and in any planner that can call `register_tool`. 2. **A truncation policy de...",
    "decision_boundary": "The allocator must choose between two regimes at each turn: - **Static-schema regime:** tool set is provably fixed for the remainder of the task (single-tool agents, frozen function-calling configs). Here a captured `schema_constant` is valid and the cheap residual-budget arithmetic is correct. Do not pay the re-measurement cost. - **Dynamic-schema regime:**...",
    "operational_effect": "Instances that adopt per-turn schema re-measurement plus priority-ordered eviction show a measurable drop in re-derivation loops (the observable signature of scratchpad loss) and in citations of superseded chunks. The cost is one extra serialization pass per turn (~2–5 ms for typical tool sets) and the bookkeeping of priority tags. The benefit is that the co..."
  },
  "matched_failure_symptoms": [
    "SCHEMA_DRIFT_OR_COERCION_CRASH"
  ],
  "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": "517af8c68dd580ea611d65747d9f5388fd112d32492af7d06141861536d71aec",
    "verified_classes": [
      "SchemaBudgetInversion"
    ],
    "verified_functions": [
      "allocate_context",
      "assemble"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SchemaBudgetInversion"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
