{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-span-attribute-truncation-in-opentelemetry-genai-agent-traces-the-gen-ai-usage-input-tokens-desynchronization-boundar",
  "title": "What structural signals indicate span-attribute truncation in OpenTelemetry GenAI agent traces: the `gen_ai.usage.input_tokens` desynchronization boundary",
  "date_of_record": "2026 November 29",
  "scope": "Applies to agent runtimes emitting OpenTelemetry spans conforming to the GenAI semantic conventions (`gen_ai.*`) where tool-call child spans are nested under an agent invocation span and token usage is recorded per-span. Does not apply to flat, non-nested trace topologies or to runtimes that aggregate usage only at the root span.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-span-attribute-truncation-in-opentelemetry-genai-agent-traces-the-gen-ai-usage-input-tokens-desynchronization-boundar.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-span-attribute-truncation-in-opentelemetry-genai-agent-traces-the-gen-ai-usage-input-tokens-desynchronization-boundar.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-span-attribute-truncation-in-opentelemetry-genai-agent-traces-the-gen-ai-usage-input-tokens-desynchronization-boundar.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1656,
    "python_slice_tokens": 344,
    "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 *per-span* attributes describing the model call that span represents. They are not a running ledger. This distinction is load-bearing: an agent invocation span that fans out to N tool calls, each of which triggers a sub-model call, produces N+1 spans each car...",
    "what_was_observed": "A multi-step agent executing a retrieval-augmented task emitted a root span `agent.invoke` with `gen_ai.usage.input_tokens=18422`, `gen_ai.usage.output_tokens=3110`. Beneath it, four `gen_ai.tool.call` child spans were exported. Summing the children's `input_tokens` yielded 9,041 — roughly half the parent. The parent was correct; two child spans had been dropped by a tail-sampling policy that retained only the first ...",
    "condition_of_validity": "The reconciliation invariant `root.input_tokens == Σ(descendant leaf input_tokens)` is valid **only if** all of the following hold: - The trace is complete (no sampling, no tail-drop, no batch overflow). - Every model call is represented by exactly one span carrying usage attributes. - No span aggregates usage from a child that also reports it (double-counti...",
    "decision_boundary": "The boundary between \"safe to reconcile\" and \"must delta-account\" is crossed the moment any span in the trace is dropped, merged, or sampled, and the crossing is **not observable from the exported trace alone**. A collector-side decision is required: - If the sampling policy is *head-based* and deterministic per-trace, reconciliation is safe for retained tra...",
    "operational_effect": "Without the witness attribute, cost dashboards under-report by the elision fraction, and the under-report is *correlated with task complexity* — complex tasks fan out more, get sampled more aggressively, and lose more tokens. The bias is systematic, not random, so it does not average out across a fleet. Agents doing the hardest work appear cheapest per task...."
  },
  "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": "734ae9e52864841189e0d795fd9a251bff18e2a7e0c963814d895b75330c5434",
    "verified_classes": [
      "TraceReconciliationError",
      "Span"
    ],
    "verified_functions": [
      "reconcile"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TraceReconciliationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
