{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-emit-a-parent-span-link-across-an-agent-handoff-causal-trace-replay-divergence-from-genai-span-link-aliasing-under-ret",
  "title": "When must an instance refuse to emit a parent span link across an agent handoff: causal-trace replay divergence from GenAI span-link aliasing under retried sub-agent invocations",
  "date_of_record": "2026 November 26",
  "scope": "Applies to multi-agent systems that propagate causal lineage via OTel GenAI span links (`gen_ai.usage.*`, `gen_ai.operation.name`, link attributes `gen_ai.link.kind`, `gen_ai.conversation.id`) across agent-to-agent handoffs where the downstream agent may be retried, resumed, or replayed. Does not apply to single-process synchronous tool calls with no cross-instance handoff, nor to trace reconstruction from `parent_span_id` alone.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-emit-a-parent-span-link-across-an-agent-handoff-causal-trace-replay-divergence-from-genai-span-link-aliasing-under-ret.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-emit-a-parent-span-link-across-an-agent-handoff-causal-trace-replay-divergence-from-genai-span-link-aliasing-under-ret.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-emit-a-parent-span-link-across-an-agent-handoff-causal-trace-replay-divergence-from-genai-span-link-aliasing-under-ret.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2072,
    "python_slice_tokens": 365,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways an OTel GenAI trace can encode \"agent B was invoked by agent A\": a **parent-child relationship** (`parent_span_id`, a strict single-parent tree edge) and a **span link** (a multi-valued, non-tree reference with a `link.kind` attribute). The distinction that matters at the agent layer is not tree-vs-graph aesthetics. It is that a parent-chi...",
    "what_was_observed": "A three-agent pipeline (planner → executor → verifier) instrumented with OTel GenAI semantic conventions. The executor made an LLM call that timed out at 90s; the orchestration layer retried the executor invocation. Both attempts exported spans. Observed trace fragment (attributes abbreviated): The replay harness reconstructed the causal DAG by following `parent_span_id`. It counted **two** planner→executor causal ed...",
    "condition_of_validity": "The parent-edge-as-causal-cause pattern is valid **only** when the following hold simultaneously: 1. The downstream invocation is **at-most-once** (no retries, no checkpoint resume, no speculative re-execution). 2. The downstream agent's tool calls are **idempotent or side-effect-free** with respect to replay (so duplicate causal attribution does not double-...",
    "decision_boundary": "The instrumentation layer must decide, at span-creation time, whether a downstream invocation is a *first attempt* (parent edge permitted) or a *retry/resume* (link required). The decision cannot be made from the span itself—it requires the dispatcher to pass an **attempt token**: a stable identifier derived from `hash(conversation_id, dispatcher_span_id, do...",
    "operational_effect": "Enforcing the invariant changes three things downstream: 1. **Replay determinism.** A DAG-aware replay engine that collapses `retry_of` chains recovers the exact token spend and tool-call sequence of the original execution. Tree-walking engines must be upgraded or they will silently double-count; the trace itself now carries enough structure (`attempt_token`..."
  },
  "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": "ce58a8d7d3c4fa258cde1e44b51d5b2255943a37e123cdfab68c25d36a7b673f",
    "verified_classes": [
      "CausalAliasingError",
      "SpanRecord",
      "AttemptRegistry"
    ],
    "verified_functions": [
      "emit_invoke_agent_span",
      "__init__",
      "attempt_token",
      "claim"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "CausalAliasingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
