{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-a-token-cost-telemetry-correlation-break-when-otel-genai-agent-spans-straddle-tool-call-boundaries",
  "title": "What structural signals indicate a token/cost telemetry correlation break when OTel GenAI agent spans straddle tool-call boundaries",
  "date_of_record": "2026 November 30",
  "scope": "Applies to agent runtimes emitting OpenTelemetry GenAI semantic conventions (`gen_ai.*`) where a single logical agent turn spans one or more tool calls, and cost is derived by correlating `gen_ai.usage.*` attributes on parent and child spans. Does not apply to single-shot inference spans without nested tool-call children, nor to runtimes that emit a single flat span per turn with pre-aggregated usage.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-token-cost-telemetry-correlation-break-when-otel-genai-agent-spans-straddle-tool-call-boundaries.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-token-cost-telemetry-correlation-break-when-otel-genai-agent-spans-straddle-tool-call-boundaries.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-token-cost-telemetry-correlation-break-when-otel-genai-agent-spans-straddle-tool-call-boundaries.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2139,
    "python_slice_tokens": 619,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions treat `gen_ai.usage.input_tokens` and `gen_ai.usage.output_tokens` as attributes of the span that *represents the model invocation*. They are **not** defined as a hierarchical rollup contract. The convention is silent on what a parent agent span's usage attributes should mean when that span has multiple `execute_tool` children,...",
    "what_was_observed": "A production agent trace showed a turn-level cost of 1,847 tokens on the root `invoke_agent` span, but the sum of `gen_ai.usage.input_tokens` across all spans in that trace was 6,112. The 4,265-token gap was structurally invisible: the root span carried `gen_ai.usage.input_tokens=1847` and three `execute_tool` children each carried their own `gen_ai.usage.input_tokens` (1,102 / 1,540 / 1,623) corresponding to the int...",
    "condition_of_validity": "The invariant \"root-span usage attributes equal the sum of all descendant model-invocation usage attributes\" is valid **if and only if** every span carrying `gen_ai.usage.*` in the trace is a *disjoint* accounting unit and the root's usage attributes are documented (or empirically verified per-exporter-version) as a rollup rather than a per-invocation value....",
    "decision_boundary": "When a trace's usage-bearing span set contains an ancestor-descendant pair, the runtime must choose one of two correlation policies and record the choice out-of-band (a resource attribute such as `agent.cost.rollup_policy=exclusive|inclusive`, or a pinned exporter version in the span's `InstrumentationScope`). The boundary is crossed — and must raise rather ...",
    "operational_effect": "Concretely: cost attribution splits by a factor equal to the number of model-bearing tool calls per turn, and the split is *stable* (so it does not trip anomaly detection) until the tool mix changes, at which point it steps. Token-budget enforcement that reads root usage will under-count and permit turns that exceed the budget by the child-invocation total; ..."
  },
  "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": "bc81840c89f31bc0793d087a12b2fd9c7bfd93c4a029e17a69152fc53dd358f8",
    "verified_classes": [
      "UsageCorrelationError",
      "GenAISpan"
    ],
    "verified_functions": [
      "_walk",
      "validate_usage_correlation",
      "has_usage",
      "total_tokens"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "UsageCorrelationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
