{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-s-causal-trace-silently-fork-when-genai-semantic-convention-span-links-cross-an-agent-handoff",
  "title": "Why does an instance's causal trace silently fork when GenAI semantic-convention span links cross an agent handoff",
  "date_of_record": "2026 November 22",
  "scope": "Applies to multi-agent systems that propagate causality via OpenTelemetry GenAI semantic-convention spans (`gen_ai.operation.name`, `gen_ai.agent.id`, `gen_ai.conversation.id`) using *span links* rather than parent/child nesting across an agent-to-agent handoff. Does not apply to single-process agents whose sub-steps share one trace context, nor to systems that embed causality in a W3C `traceparent` header alone.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-s-causal-trace-silently-fork-when-genai-semantic-convention-span-links-cross-an-agent-handoff.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-s-causal-trace-silently-fork-when-genai-semantic-convention-span-links-cross-an-agent-handoff.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-s-causal-trace-silently-fork-when-genai-semantic-convention-span-links-cross-an-agent-handoff.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1615,
    "python_slice_tokens": 338,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A parent/child span relationship encodes a *synchronous* causal edge: the child cannot exist before the parent, and the trace tree has exactly one root. A **span link** encodes an *asynchronous* causal edge: the linked span is a peer reference, not a containment. The GenAI semantic conventions deliberately recommend links for agent handoffs because the recei...",
    "what_was_observed": "A three-agent pipeline (planner → retriever → synthesizer) was instrumented per the GenAI conventions. Planner span: `trace_id=T1`, `span_id=S1`, `gen_ai.operation.name=invoke_agent`. Retriever received the handoff payload, which carried `{trace_id: T1, span_id: S1}` in a custom `causality` field, and emitted: Three concrete symptoms followed: 1. **Trace-count inflation.** A single user request produced 3 root spans ...",
    "condition_of_validity": "Span-link-based causal linking is only sound when *all* of the following hold simultaneously: - **Link-preserving sampling.** The tail sampler must treat a link as a sampling *constraint*: if a span is kept, every span it links to is force-kept (or the link is rewritten to a kept ancestor). Per-`trace_id` independent sampling violates this by construction. -...",
    "decision_boundary": "The choice between nesting and linking is not stylistic. Use **parent/child nesting** when the receiving agent's work is strictly downstream and synchronous and the receiver can adopt the caller's `trace_id`—this survives naive samplers because the whole tree shares one root. Use **links** only when the receiver genuinely runs asynchronously or concurrently,...",
    "operational_effect": "The practical consequence is that **end-to-end latency and error attribution become unmeasurable precisely when multi-agent fan-out is highest**—the condition you most need to observe. Root-count metrics overcount requests; per-trace latency undercounts true user-perceived time; dangling links from sampling erase causality exactly on the slow, expensive, sam..."
  },
  "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": "b1e74732d1ebe9b6598afde8b6c6354b4667c341def080899d848aedc0cff5ea",
    "verified_classes": [
      "CausalTraceForkError",
      "SpanContext"
    ],
    "verified_functions": [
      "handoff"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "CausalTraceForkError"
    ],
    "sample_fail_closed_invariants": [
      "missing causal_root_id; a trace_id change would orphan this span from the root under link-drop sampling",
      "tail sampler is not link-preserving; linked span may be dropped while this span is kept, yielding a dangling link"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "uuid"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
