{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-span-parenting-corruption-when-a-tool-call-span-and-its-agent-handoff-sibling-race-under-opentelemetry-genai-semantic",
  "title": "What structural signals indicate span-parenting corruption when a tool-call span and its agent-handoff sibling race under OpenTelemetry GenAI semantic conventions",
  "date_of_record": "2026 November 26",
  "scope": "Applies to instrumented agent runtimes that emit OTel GenAI spans (`gen_ai.*` attributes) for tool invocations and inter-agent handoffs, where a single logical turn can produce concurrent child spans under one active span context. Does not apply to single-threaded, strictly sequential tool loops or to systems that emit one span per turn with no handoff decomposition.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-span-parenting-corruption-when-a-tool-call-span-and-its-agent-handoff-sibling-race-under-opentelemetry-genai-semantic.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-span-parenting-corruption-when-a-tool-call-span-and-its-agent-handoff-sibling-race-under-opentelemetry-genai-semantic.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-span-parenting-corruption-when-a-tool-call-span-and-its-agent-handoff-sibling-race-under-opentelemetry-genai-semantic.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1694,
    "python_slice_tokens": 271,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions define *what* attributes a span must carry (`gen_ai.operation.name`, `gen_ai.request.model`, `gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens`, `gen_ai.tool.name`, `gen_ai.agent.name`) but they deliberately do **not** specify span *parenting topology* for the case where a tool call and a handoff are emitted from the sam...",
    "what_was_observed": "A two-agent runtime (planner → executor) emitted, per turn, a `gen_ai.turn` span, a `gen_ai.tool.call` span for a retrieval tool, and a `gen_ai.agent.handoff` span. Both children were created from the turn's `Context`, so both had `parent_span_id == turn.span_id`. The retrieval tool was async; the handoff was dispatched as soon as the planner's final message was emitted, without awaiting the tool future. In the trace...",
    "condition_of_validity": "The invariant that must hold for GenAI span parenting to be trustworthy: > For any span `S` carrying `gen_ai.operation.name = \"tool.call\"` or `\"agent.handoff\"`, if `S` is a sibling of another GenAI span `T` under a common parent, then either (a) `S` and `T` do not overlap in time, or (b) `S` carries an explicit `gen_ai.tool.result_available_at` (or equivalen...",
    "decision_boundary": "The boundary is **whether the handoff depends on the tool result**. If the planner's handoff message is constructed without reading the tool output (speculative handoff), the two spans are genuinely parallel and sibling parenting is correct — but the handoff span MUST then be marked `gen_ai.handoff.speculative = true` and MUST NOT carry a `context_ref` to th...",
    "operational_effect": "Downstream, the corrupted topology produces three compounding effects. First, **token accounting drift**: subtree rollups overcount the receiving agent and undercount the sending agent, so per-agent budget enforcement misallocates headroom and the executor hits its token ceiling mid-task while the planner's ledger shows slack. Second, **cold-start amnesia am..."
  },
  "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": "30f541b21bd0cdd01a55dfd6f3d10d07a6d6f56c3897a3d44bcf7f9afa531544",
    "verified_classes": [
      "HandoffTopologyError",
      "GenAISpan"
    ],
    "verified_functions": [
      "validate_handoff_emission",
      "is_open"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "HandoffTopologyError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
