{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-tool-call-lineage-has-silently-detached-from-its-parent-span-under-opentelemetry-genai-semantic-conventions",
  "title": "What structural signals indicate tool-call lineage has silently detached from its parent span under OpenTelemetry GenAI semantic conventions",
  "date_of_record": "2026 November 30",
  "scope": "Applies to agent runtimes that emit OpenTelemetry spans using the `gen_ai.*` semantic conventions (v1.27+) for tool invocations and token accounting, where tool calls may be retried, fanned out across sub-agents, or replayed from a checkpoint. Does not cover tracing of non-agentic LLM inference or plain RPC instrumentation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-tool-call-lineage-has-silently-detached-from-its-parent-span-under-opentelemetry-genai-semantic-conventions.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-tool-call-lineage-has-silently-detached-from-its-parent-span-under-opentelemetry-genai-semantic-conventions.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-tool-call-lineage-has-silently-detached-from-its-parent-span-under-opentelemetry-genai-semantic-conventions.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1806,
    "python_slice_tokens": 437,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions treat a tool call as a *child span* of the model-invocation span that requested it, with lineage expressed through `trace_id`/`parent_span_id` and token accounting expressed through `gen_ai.usage.input_tokens` / `gen_ai.usage.output_tokens` on the *invocation* span. The failure we care about is not a missing span or a dropped a...",
    "what_was_observed": "An agent executing a `search_documents` tool call hit a 504 on the tool's HTTP endpoint. The runtime's retry policy re-issued the call after 2s. Both attempts executed server-side (the first timed out on the client, not the server). The runtime emitted: - Invocation span `A` (`gen_ai.operation.name=chat`, `gen_ai.usage.input_tokens=1840`, `gen_ai.usage.output_tokens=212`) containing the tool-call request. - Tool span...",
    "condition_of_validity": "The invariant holds only when the following conjunction is true: - `gen_ai.tool.call.id` is unique within `(trace_id, parent_span_id)`, not merely within `trace_id`. - `gen_ai.usage.*` attributes appear **only** on spans with `gen_ai.operation.name ∈ {chat, text_completion, embeddings}` and **never** on `execute_tool` spans. - A tool-call span's `start_time`...",
    "decision_boundary": "The boundary is between **cache-served results** and **fresh executions**. A runtime may serve a cached tool result to avoid redundant execution — but the moment it does, it must either: - (a) emit a *new* span with a *new* `span_id`, `gen_ai.tool.call.id` scoped to the new parent, and **no** `gen_ai.usage.*` attributes, marking `gen_ai.tool.cache_hit=true`;...",
    "operational_effect": "Downstream consequences observed: - **Token ledger overcount.** Cost attribution summed `gen_ai.usage.*` across all spans regardless of `operation.name`, double-counting the cached turn's tokens. Billing reconciliation showed a 6–9% inflation on retry-heavy traces. - **Waterfall misreads.** The trace UI rendered `T3` under `B` with `T2`'s timestamps, produci..."
  },
  "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": "8f94f1ea2d8e428daabdd2a874561ca7615362aa7573558a8951b0bc25c17212",
    "verified_classes": [
      "LineageDetachmentError",
      "Span"
    ],
    "verified_functions": [
      "assert_lineage_invariant",
      "is_tool_span",
      "is_invocation_span"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "LineageDetachmentError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
