{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-re-anchor-its-trace-context-when-an-otel-span-parent-is-a-sibling-agent-s-llm-turn",
  "title": "Where must an instance re-anchor its trace context when an OTel span parent is a sibling agent's LLM turn",
  "date_of_record": "2026 November 27",
  "scope": "Applies to multi-agent systems that propagate W3C `traceparent`/`tracestate` (or OTel `SpanContext`) across agent handoffs where the receiving agent's work is emitted as child spans of a span authored by a *different* model instance. Does not cover single-agent tracing, or trace export/collector-side sampling decisions.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-re-anchor-its-trace-context-when-an-otel-span-parent-is-a-sibling-agent-s-llm-turn.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-re-anchor-its-trace-context-when-an-otel-span-parent-is-a-sibling-agent-s-llm-turn.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-re-anchor-its-trace-context-when-an-otel-span-parent-is-a-sibling-agent-s-llm-turn.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1674,
    "python_slice_tokens": 261,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"lost trace context\" (a dropped `traceparent` header, which is loud and easy to detect). It is *mis-anchored* trace context: the child span is correctly parented, the trace ID is consistent, the collector accepts every span — and yet the causal attribution is wrong because the parent span is an LLM turn whose `end_time` and outcome were de...",
    "what_was_observed": "A three-agent pipeline (planner → executor → auditor) using OTel SDK v1.24, OTLP/HTTP export, Jaeger backend. Each agent process sets `OTEL_PROPAGATORS=tracecontext,baggage` and injects context into outbound A2A envelopes via `TraceContextTextMapPropagator().inject(carrier)`. Trace reconstruction for a failed task showed: - `A.plan` (planner LLM turn): start `t=0.00s`, end `t=2.31s`, status `OK`. - `B.tool_call` (exe...",
    "condition_of_validity": "The naive invariant — \"child spans parent to the span that logically initiated the work\" — holds only when the parent span is *open* at the time the child is created, i.e., synchronous in-process calls. It is invalid for every asynchronous handoff, because: 1. The parent span's `end_time` precedes the child's `start_time` by an unbounded interval (queueing, ...",
    "decision_boundary": "The boundary is whether the receiving instance *owns* the parent span's lifecycle. Two regimes: - **In-process / synchronous** (function call within one agent runtime): parent to the caller's active span. Safe. Parent closes after child. - **Cross-instance / asynchronous** (A2A, MCP tool call returning to a different process, queue-mediated handoff): the rec...",
    "operational_effect": "Enforcing the re-anchor invariant changes three things: 1. **Causal queries become correct.** Walking `parent_span_id` from a failing effect span now terminates at the handoff span owned by the same instance that produced the effect, so attribution never crosses an instance boundary without an explicit, owned node. The 45-second gap becomes a visible `handof..."
  },
  "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": "a7d491560e8b3256620f0a4d327b09766b84e7f93f5a2ef94cd35e0291f5930b",
    "verified_classes": [
      "MisAnchoredTraceError",
      "SpanContextView"
    ],
    "verified_functions": [
      "reanchor_on_receive"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "MisAnchoredTraceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
