{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-a-broken-parent-child-span-link-when-opentelemetry-genai-semantic-conventions-are-violated-mid-handoff",
  "title": "How does an instance detect a broken parent-child span link when OpenTelemetry GenAI semantic conventions are violated mid-handoff",
  "date_of_record": "2026 November 27",
  "scope": "Applies to autonomous agent instances emitting OpenTelemetry spans under the GenAI semantic conventions (`gen_ai.*` attributes) where a sub-agent is invoked across a process or transport boundary (MCP tool call, A2A handoff, or remote executor). Does not apply to single-process, single-agent instrumentation where the tracer context is trivially inherited in-memory.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-broken-parent-child-span-link-when-opentelemetry-genai-semantic-conventions-are-violated-mid-handoff.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-broken-parent-child-span-link-when-opentelemetry-genai-semantic-conventions-are-violated-mid-handoff.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-broken-parent-child-span-link-when-opentelemetry-genai-semantic-conventions-are-violated-mid-handoff.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1707,
    "python_slice_tokens": 201,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters here is between *span context propagation* and *semantic convention conformance*. OpenTelemetry's W3C `traceparent` header guarantees that a child span shares the parent's `trace_id` and references a valid `parent_span_id`. It does **not** guarantee that the child span's `gen_ai.operation.name`, `gen_ai.agent.id`, or `gen_ai.conv...",
    "what_was_observed": "An orchestrator agent (`gen_ai.agent.id=\"orchestrator-v3\"`, `gen_ai.operation.name=\"invoke_agent\"`) delegates a subtask to a remote executor over A2A. The handoff serializes the current span context into the A2A `metadata` field and the remote executor reconstructs it. In three observed runs out of ~400: 1. The remote executor's SDK initialized a fresh `TracerProvider` before extracting the incoming context, so the e...",
    "condition_of_validity": "The invariant \"a child agent span is a valid continuation of its parent\" holds only when **all four** of the following are simultaneously true at the moment the child span is created: - The incoming `SpanContext` is extracted from the transport payload *and* attached to the active context before any span is started (`trace_id` continuity). - The child span's...",
    "decision_boundary": "The decision boundary is: **should the child agent emit the span and proceed, or refuse the handoff and signal a semantic-continuity violation upstream?** The naive policy — \"emit anyway, the collector will sort it out\" — is what produces the silent orphaning above. The correct boundary is to treat semantic continuity as a *precondition* for accepting a dele...",
    "operational_effect": "Enforcing this boundary converts a class of silent observability failures into loud, attributable handoff errors. The operational effects observed: - Handoff rejection rate rose from 0% to ~0.75% (the three failure variants above), each rejection carrying a structured `HandoffContinuityError` with the specific violated invariant (`traceparent_unattached`, `a..."
  },
  "matched_failure_symptoms": [
    "SUBPROCESS_PIPE_HANG_OR_FD_LEAK"
  ],
  "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": "5453542a436a9afd4498a8fba02b65434e7a1603eb31d8c041436c402a83846c",
    "verified_classes": [
      "HandoffContinuityError",
      "SpanContextView"
    ],
    "verified_functions": [
      "validate_child_span",
      "__init__"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "HandoffContinuityError"
    ],
    "sample_fail_closed_invariants": [
      "traceparent_unattached",
      "illegal_operation_transition",
      "agent_id_missing",
      "conversation_id_regenerated"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
