{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reject-a-dynamically-discovered-tool-whose-schema-validates-but-whose-declared-capability-envelope-silently-narrows-the-caller",
  "title": "Where must an instance reject a dynamically discovered tool whose schema validates but whose declared capability envelope silently narrows the caller's token budget mid-handoff",
  "date_of_record": "2026 November 29",
  "scope": "Applies to agent-to-agent (A2A) and MCP-style capability negotiation where a callee advertises tools dynamically and the caller trusts the advertised schema as the sole admission predicate. Does not apply to statically versioned tool manifests pinned at build time, nor to single-agent tool use where no delegation handoff occurs.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reject-a-dynamically-discovered-tool-whose-schema-validates-but-whose-declared-capability-envelope-silently-narrows-the-caller.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reject-a-dynamically-discovered-tool-whose-schema-validates-but-whose-declared-capability-envelope-silently-narrows-the-caller.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reject-a-dynamically-discovered-tool-whose-schema-validates-but-whose-declared-capability-envelope-silently-narrows-the-caller.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1630,
    "python_slice_tokens": 257,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"the tool is broken.\" It is that *schema validity and capability validity are independent predicates*, and most negotiation stacks check only the first. A dynamically discovered tool can return a JSON-Schema-perfect argument contract while its declared capability envelope (`max_input_tokens`, `max_output_tokens`, `wall_clock_ms`, `ree...",
    "what_was_observed": "A planner instance (`P`) held a 128k-token window, of which 41k remained after reasoning and prior tool results. It negotiated with an executor instance (`E`) over A2A. `E` advertised a `summarize_corpus` tool with a clean input schema (`{documents: array<string>, focus: string}`) and an output schema (`{summary: string}`). `P` validated the input against the schema, dispatched, and blocked. `E` executed and returned...",
    "condition_of_validity": "The invariant holds — that is, the guardrail below is necessary and sufficient — under the following conditions: 1. The caller maintains an explicit, decrementing `remaining_context_budget` counter that is updated on every token insertion, including tool results, and is *not* inferred from message count. 2. The callee's capability advertisement includes a ma...",
    "decision_boundary": "The boundary is precise: **reject the handoff when `callee.declared_envelope.max_output_tokens + caller.reserved_output_headroom > caller.remaining_context_budget`.** The `reserved_output_headroom` term is the non-obvious part — it is the tokens the caller needs *after* the tool result to do anything useful with it. A caller that admits a tool result exactly...",
    "operational_effect": "Enforcing this boundary converts a silent, hard-to-attribute failure (hollow artifacts, hallucinated IDs, stale-context reasoning) into a loud, typed, recoverable one. The planner receives a `CapabilityEnvelopeViolation` with the specific numbers — declared envelope, remaining budget, required headroom — and can decompose the task or renegotiate for a narrow..."
  },
  "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": "f53109947c9082aee253944c97f0f96c657c63098e40a0575327a331ff6279d2",
    "verified_classes": [
      "CapabilityEnvelopeViolation",
      "CapabilityEnvelope",
      "CallerBudget"
    ],
    "verified_functions": [
      "admit_handoff",
      "enforce_receipt",
      "cache_key",
      "admissible"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "CapabilityEnvelopeViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
