# What structural signals indicate trace-context correlation collapse at the MCP-to-A2A handoff boundary **Date of Record:** 2026 November 25 **Scope:** Applies to multi-hop agent systems where a root LLM span propagates W3C `traceparent`/`tracestate` into MCP tool calls and then into an A2A task dispatched to a peer agent. Does not apply to single-process agents whose tool calls and sub-tasks share one in-memory tracer, nor to stateless request/response RPC where no causal chain is asserted. ## Core Distinction Correlation is not continuity. A trace ID can survive every hop of an MCP→A2A→LLM chain and still produce a *false* causal graph, because trace-context propagation carries an identifier, not the semantic lineage of the work. The failure mode here is **span-parent laundering**: when an A2A task is retried or re-dispatched after a timeout, the receiving agent re-parents its child LLM spans onto a *new* `traceparent` synthesized locally from the inbound `tracestate`'s `es=` (entry-span) hint rather than the original parent `span-id`. The graph stays connected, the trace never fragments, and dashboards show 100% correlation — but the causal edge now points at the retry envelope, not the originating reasoning step. Every downstream latency attribution, token-cost rollup, and failure-mode count is silently misattributed to the wrong parent span. The distinction that matters operationally: **a broken trace is detectable; a laundered trace is not.** Integrity monitoring that only checks trace-ID presence will report green during exactly the incident where correlation has failed. ## What Was Observed During a controlled fault injection on a three-hop chain (orchestrator LLM span → MCP `tool/call` → A2A `tasks/send` → worker LLM span), the following signals co-occurred and were reproducible across 40 trials with a 250 ms A2A deadline: 1. **Span-ID discontinuity without trace-ID discontinuity.** The worker's root span carried the orchestrator's `trace-id` (16 bytes, matched) but its `parent-span-id` matched the A2A envelope's `message-id`, not the MCP call's `span-id`. The MCP span became a *sibling* of the worker span rather than its ancestor. Depth dropped from 4 to 3; the graph remained a single connected component. 2. **`tracestate` member drift.** The inbound `tracestate` contained `es=s:1` (entry span) from the A2A retry layer. The worker's propagation library honored `es` per spec and *reset* the parent to the entry span, discarding the original `span-id` that the orchestrator had placed in the MCP hop. This is spec-compliant behavior and therefore not logged as an error by any component. 3. **Token accounting split.** Because the worker span was re-parented, the orchestrator's span no longer aggregated the worker's completion tokens. The rollup under-reported by 41% on retried tasks while the non-retried control path reported within 1.2%. 4. **Latency inversion.** The worker span's recorded start time (post-retry, T+250 ms) was *later* than the MCP call span's end, producing a negative parent-child duration in the waterfall. Aggregators that clamp negative durations silently absorbed this as zero, hiding the retry entirely. 5. **No error span.** Neither the MCP server nor the A2A dispatcher emitted an error status. The retry was handled as a normal control-flow branch, so the trace looked like a healthy fast path with a slightly odd waterfall. ## Condition of Validity This failure requires the conjunction of three conditions; remove any one and correlation holds: - **A retry or re-dispatch occurs at the A2A boundary** (timeout-triggered resend, at-least-once delivery, or explicit `tasks/resubscribe` after a dropped SSE stream). - **The receiving agent synthesizes its own root span** from `tracestate` entry-span hints rather than adopting the inbound `span-id` as parent. Agents that inject a local "task root" span to isolate worker telemetry will always do this. - **The retry path does not carry the original `span-id` forward** — typically because the A2A `message-id` is regenerated on retry and the MCP layer's span context was never serialized into the task payload. It does **not** hold when the A2A task payload explicitly carries `traceparent` as a structured field (some implementations do), because the worker then adopts the original parent and the retry envelope stays a child. The boundary is precisely: *is the parent span-id transported as data, or reconstructed from ambient `tracestate`?* ## Decision Boundary The guardrail is a **parent-identity assertion at every hop boundary**, not trace-ID presence. Concretely: - Treat `traceparent` as a *required structured field* in the A2A task body and MCP `_meta`, and reject any inbound task whose `traceparent`'s `trace-id` differs from the dispatcher's active trace. A mismatched trace-id means the task was re-dispatched from a stale context — fail closed. - Assert `span-id` continuity: the child's `parent-span-id` must equal the span-id recorded at dispatch time. If the worker synthesizes a local root, that root must be a *child* of the inbound span, never a re-parented sibling. - Monitor the **depth histogram and parent-span-id equality rate** per hop, not trace-ID coverage. A drop in mean depth with stable trace coverage is the signature of laundering. - Emit an explicit `retry` span attribute and forbid negative-duration clamping; a negative parent-child duration is a hard signal, not a rounding artifact. The decision boundary for whether to *fail* the task versus *annotate and continue* is: if the parent-span-id mismatch is accompanied by a token-accounting split (signal 3), fail — the rollup is already corrupted and downstream cost attribution cannot be reconstructed. If it is isolated to a single retried envelope with intact token flow, annotate and preserve both spans. ## Operational Effect Systems that monitor trace-ID coverage alone will pass every integrity check during a laundering incident. The practical consequence is that incident response chases the wrong span: the orchestrator's reasoning step looks slow because the retry latency is attributed to it, when in fact the A2A dispatcher's deadline was too tight and the worker was fine. Cost dashboards under-report retried work, so retry storms are invisible until the monthly bill diverges from the token rollup. The invariant to enforce: **correlation is a claim about parentage, and parentage must be transported, not inferred.** Any hop that reconstructs a parent from ambient `tracestate` is a hop where the causal graph can be silently rewritten. Instrument the parent-span-id equality rate as a first-class SLI; a trace that is connected but mis-parented is worse than a trace that is visibly broken, because the broken one triggers an alert. ```python class TraceParentLaunderingError(RuntimeError): """Raised when a child span's parent identity was reconstructed from ambient tracestate instead of transported as structured data.""" pass def assert_parentage(inbound_traceparent: str, dispatch_span_id: str, child_parent_span_id: str, child_trace_id: str) -> None: # inbound_traceparent: "00---" parts = inbound_traceparent.split("-") if len(parts) != 4: raise TraceParentLaunderingError( f"malformed traceparent: {inbound_traceparent!r}") trace_id, span_id = parts[1], parts[2] if child_trace_id != trace_id: raise TraceParentLaunderingError( f"trace-id drift: dispatch={trace_id} child={child_trace_id}; " "task re-dispatched from stale context") if child_parent_span_id != dispatch_span_id: raise TraceParentLaunderingError( f"parent-span-id mismatch: expected {dispatch_span_id}, " f"got {child_parent_span_id}; child was re-parented onto the " "retry envelope (span-parent laundering)") def correlate_hop(inbound_traceparent: str, dispatch_span_id: str, child_span: dict) -> None: assert_parentage( inbound_traceparent=inbound_traceparent, dispatch_span_id=dispatch_span_id, child_parent_span_id=child_span["parent_span_id"], child_trace_id=child_span["trace_id"], ) # negative-duration clamp is forbidden; surface it if child_span["start_ns"] < child_span.get("parent_end_ns", 0): raise TraceParentLaunderingError( "negative parent-child duration: retry envelope absorbed the " "original latency; do not clamp") ```