{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-refuse-to-emit-a-genai-span-when-tool-call-attributes-cannot-be-reconciled-with-the-parent-token-budget",
  "title": "In what scenarios must an instance refuse to emit a GenAI span when tool-call attributes cannot be reconciled with the parent token budget",
  "date_of_record": "2026 November 26",
  "scope": "Applies to any agent runtime that emits OpenTelemetry GenAI semantic-convention spans for tool calls and aggregates token/cost metrics up the span tree. Does not apply to single-shot LLM completions with no child tool spans, nor to runtimes where token accounting is emitted only at the trace root.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-to-emit-a-genai-span-when-tool-call-attributes-cannot-be-reconciled-with-the-parent-token-budget.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-to-emit-a-genai-span-when-tool-call-attributes-cannot-be-reconciled-with-the-parent-token-budget.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-to-emit-a-genai-span-when-tool-call-attributes-cannot-be-reconciled-with-the-parent-token-budget.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1404,
    "python_slice_tokens": 220,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions treat a tool call as a child span of the agent's `invoke_agent` span, carrying `gen_ai.tool.name`, `gen_ai.tool.call.id`, and — critically — `gen_ai.usage.input_tokens` / `gen_ai.usage.output_tokens` when the tool itself triggers a nested model call. The conventions do not define a reconciliation rule between a child span's rep...",
    "what_was_observed": "An agent span tree for a single user turn, captured at export time: - Root `invoke_agent` span: `gen_ai.usage.output_tokens=412` — this includes the ~180 tokens of JSON tool-call arguments the model generated. - Child `execute_tool` span (`gen_ai.tool.name=search_docs`): `gen_ai.usage.input_tokens=180` — the tool re-fed its own argument payload into a nested embedding/rerank model. - Grandchild `chat` span under the ...",
    "condition_of_validity": "A span may be emitted with usage attributes only if, for every token count it reports, there exists exactly one span in the subtree that is the *designated accounting owner* of that token. Concretely, the runtime must satisfy the invariant: > For any token t consumed during a turn, the number of spans in the tree whose `gen_ai.usage.*` attributes include t i...",
    "decision_boundary": "The boundary is crossed when a child `execute_tool` span is about to be emitted with `gen_ai.usage.input_tokens` set, and the runtime cannot prove that those tokens are disjoint from the parent's already-reported `output_tokens`. The runtime must then choose: - **Refuse emission** of the usage attributes on the child span (emit the span, drop `gen_ai.usage.*...",
    "operational_effect": "Downstream, the double-count propagates into token-budget enforcement: an agent that checks its remaining budget against aggregated span metrics will believe it has consumed roughly 2–3× its true budget for tool-heavy turns, and will abort mid-task earlier than necessary — a self-inflicted context-window exhaustion that looks like a model failure but is a te..."
  },
  "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": "144a372437483667b8ddbcd938a7419951e6af6d501442abf2126d3ab7a4664b",
    "verified_classes": [
      "UnreconciledUsageError",
      "SpanUsage",
      "ToolSpan"
    ],
    "verified_functions": [
      "emit_tool_span",
      "safe_emit"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "UnreconciledUsageError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
