{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-token-level-trace-propagation-failure-at-the-agent-span-boundary-under-opentelemetry-genai-semantic-conventions",
  "title": "What structural signals indicate token-level trace propagation failure at the agent span boundary under OpenTelemetry GenAI semantic conventions",
  "date_of_record": "2026 November 14",
  "scope": "Applies to multi-agent systems and tool-calling LLM pipelines instrumented with OpenTelemetry GenAI semantic conventions (`gen_ai.*` attributes) where agent spans are expected to parent tool-call spans and token accounting is propagated across the agent boundary. Does not apply to single-shot LLM completion spans without downstream tool execution, nor to systems using proprietary trace formats that bypass the OTel span model.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-token-level-trace-propagation-failure-at-the-agent-span-boundary-under-opentelemetry-genai-semantic-conventions.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-token-level-trace-propagation-failure-at-the-agent-span-boundary-under-opentelemetry-genai-semantic-conventions.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-token-level-trace-propagation-failure-at-the-agent-span-boundary-under-opentelemetry-genai-semantic-conventions.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1706,
    "python_slice_tokens": 448,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The OpenTelemetry GenAI semantic conventions distinguish between *span-level attribution* (which agent or model invocation owns a span) and *token-level propagation* (how `gen_ai.usage.input_tokens` and `gen_ai.usage.output_tokens` flow from the model response back to the originating agent span). These are frequently conflated. A trace can appear structurall...",
    "what_was_observed": "In a production agent pipeline (planner agent → tool executor → sub-agent LLM call → synthesis), traces were structurally valid: `trace_id` propagated end-to-end, parent-child relationships were intact, and no spans were dropped by the collector. Dashboards reported per-agent token cost. The structural signals that indicated a propagation failure were not errors. They were *arithmetic and cardinality anomalies*: 1. *...",
    "condition_of_validity": "The invariant holds — and token propagation can be trusted — only when all of the following are true: - Every span emitting `gen_ai.usage.*` carries a non-empty `gen_ai.operation.name` drawn from the current convention set (`chat`, `text_completion`, `embeddings`, `execute_tool`). - Every tool-call span that triggers a nested model invocation has a distinct ...",
    "decision_boundary": "The decision boundary is whether to treat token totals as **authoritative** (trusted for billing, quota, or cost attribution) or **diagnostic** (trusted only for trend analysis). - If the four validity conditions above are machine-checked at ingestion, totals are authoritative. - If they are not checked, totals must be treated as diagnostic, and any per-agen...",
    "operational_effect": "When this boundary is respected (leaves summed, distinct call IDs enforced, operation names mandatory), per-agent token attribution is exact and survives arbitrary nesting depth. When it is violated, the failure is silent: traces pass schema validation, dashboards render, and cost figures are wrong by the exact magnitude of the nested sub-agent's token consu..."
  },
  "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": "1d142ebfbad1bbd9567a148406ccd8522eab653780e20e07e3ac6b6082914738",
    "verified_classes": [
      "GenAITraceInvariantError",
      "SpanRecord"
    ],
    "verified_functions": [
      "validate_token_propagation",
      "aggregate_agent_tokens"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "GenAITraceInvariantError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
