# Under what conditions must an instance treat a trace-context propagation failure at an MCP-to-A2A handoff as a forensic data-integrity fault rather than a logging gap **Date of Record:** 2026 November 24 **Scope:** Applies to multi-hop agent executions where a root orchestrator emits a W3C `traceparent` (or equivalent correlation tuple) that must survive both MCP tool-call transport hops and A2A task-boundary crossings, and where the resulting trace is later used as the authoritative record for incident forensics. Does not apply to single-process agents that never cross a transport or task boundary, nor to purely observational telemetry that is never replayed as evidence. ## Core Distinction A trace-context propagation failure is *not* the same event as a missing log line. A missing log line is an observability deficit: you lose a view of something that still happened, and the system's causal history remains externally reconstructable from other signals. A propagation failure at an MCP-to-A2A handoff is a **correlation-integrity fault**: the causal chain that binds a parent agent's decision to a child agent's action is severed *at a trust boundary*, and the severed link cannot be recovered from any downstream artifact because the two halves were minted under different correlation identities that never shared a join key. The sharp mechanism is this: MCP carries context as **per-request metadata on a transport frame** (the `traceparent` rides the JSON-RPC `_meta` or an HTTP header and dies with the frame). A2A carries context as **task-scoped state on a long-lived task object** (context is set at task creation and must be re-derived or explicitly re-injected on every subsequent `tasks/send` or streaming event). These two propagation models have different lifetimes and different ownership. A handoff that translates one into the other has a *silent default*: when the A2A task is created without an explicit context injection, the receiving agent mints a **fresh root trace**. The trace is well-formed, non-empty, and plausible—it simply belongs to a different causal tree than the caller's. Nothing errors. The forensic record is now two disjoint trees that both look complete. ## What Was Observed A three-tier pipeline: orchestrator agent `O` (holds the user intent), a retrieval agent `R` invoked over A2A, and `R` in turn calling an MCP tool server `T` for document fetch. A user-visible wrong answer was reported and the on-call engineer pulled the trace store to reconstruct the decision path. The trace store returned two traces: - Trace `A` (`O` → `R` task creation → `R`'s reasoning spans) with 41 spans, terminating cleanly at `R`'s final answer span. - Trace `B` (`R` → `T` `tools/call` → `T`'s fetch spans) with 9 spans, rooted at a span named `retrieval.fetch` with **no parent** and a `trace_id` unrelated to `A`. The engineer's first read was "logging gap in `R`." That read was wrong. Both traces were internally complete; the *join* between them was absent. The specific failure sequence: 1. `O` created the A2A task with `traceparent` correctly set in the task metadata (`00---01`). 2. `R` received the task, correctly extracted `traceparent` into its local context, and its reasoning spans *were* parented under `spanO` — hence trace `A` is intact through `R`. 3. `R` then issued an MCP `tools/call` to `T`. The MCP client library in `R` was initialized **once at agent startup**, before any A2A task existed, with a static `_meta` block captured at init time. The per-request `traceparent` that `R` held in its task context was never threaded into the MCP request `_meta`. 4. `T`'s MCP server, finding no `traceparent` in `_meta`, followed the spec-compliant fallback: it started a new trace (`B`) rooted at the tool invocation. 5. `T` returned results to `R`; `R` incorporated them and answered. The `R`→`T` edge exists only as a *time-adjacency* in the merged view, never as a parent-child link. The critical observation: **the failure is invisible to every component that participates in it.** `O` sees its task complete. `R` sees its tool call succeed. `T` sees a valid request and emits a valid trace. Only the *forensic replay* — a consumer that did not exist at execution time — observes the discontinuity, and it observes it as an absence, which is indistinguishable from "the tool was never called" or "the span was dropped by the exporter." ## Condition of Validity The classification "forensic data-integrity fault" (as opposed to "logging gap") is valid **if and only if** all three hold: 1. **The correlation identity is load-bearing for a downstream decision.** The trace is designated as the authoritative causal record — used for root-cause attribution, safety-incident reconstruction, or audit. If the trace is purely for latency dashboards, a broken link is a gap, not an integrity fault. 2. **The severed edge crosses a trust or process boundary at which context is re-minted by default.** MCP transport frames and A2A task objects both default to "mint fresh context if none supplied." A boundary that *fails closed* (rejects a request lacking `traceparent`) converts the same defect into a hard error and is therefore out of scope — it cannot produce this fault. 3. **No independent join key survives the break.** If `R` stamped the A2A `task_id` into the MCP request `_meta` (or into a tool argument), the two trees could still be joined post hoc, and the fault degrades to a gap. The integrity fault exists precisely when the only join key was the `traceparent` that died at the boundary. If condition 2 fails (fail-closed boundary) or condition 3 fails (surviving join key), reclassify as observability gap and handle through normal telemetry remediation. The distinction matters because integrity faults require **quarantine of the affected traces as evidence** and a **replay-invalidity flag**, whereas gaps are backfilled. ## Decision Boundary The operational decision is: *when a trace-replay tool detects a disconnected sub-tree, does it (a) merge by time-adjacency and proceed, or (b) refuse and flag?* The boundary is drawn by **whether the disconnected sub-tree's root span was minted at a boundary the caller crossed.** Concretely, the replay tool must check, for each orphan root, whether the orphan's `start_time` falls within the wall-clock window of an active parent span in another trace *and* whether the orphan's origin service is one the parent is known to call. If both hold, the tool has detected a *probable* propagation break — it must **not** auto-merge (time-adjacency is not causation and will silently fabricate a causal edge that a forensic consumer will trust). It must instead emit a `CorrelationBreak` record carrying both trace IDs, the suspected boundary type (`mcp_transport` vs `a2a_task`), and mark both traces `replay_invalid = true` until a human or a corroborating join key resolves the link. The invariant that bounds this: **a trace is forensically admissible only if every span's parent is present in the same trace, or every cross-trace edge is backed by an explicit, non-temporal join key.** Time-adjacency is never a valid join key for evidence. A replay tool that violates this invariant produces a merged trace that is *more dangerous than two disjoint ones*, because it launders an absence into an apparent causal chain. ## Operational Effect Downstream of a correctly-classified integrity fault: - The affected incident cannot be root-caused from trace alone; the on-call must fall back to tool-server request logs (which carry `task_id` if the MCP client was configured to forward it) to re-establish the `R`→`T` edge. If those logs were not retained, the causal link is **permanently unrecoverable** — this is the concrete cost of the fault. - The remediation is architectural, not observational: the MCP client in `R` must be re-initialized per A2A task (or its `_meta` must be per-request mutable), and the A2A task-creation path must **fail closed** when `traceparent` is absent. Both changes convert a silent mint-fresh-root into either correct propagation or a loud rejection. - Until remediation, every trace crossing this boundary must be tagged `correlation_unverified` at export time so that no forensic consumer treats it as a complete causal record. The generalizable lesson for an agent operating in this domain: **treat any boundary that defaults to minting a fresh correlation root as a forensic hazard, and treat a disconnected sub-tree found during replay as an integrity fault to be quarantined, never as a gap to be backfilled by time-adjacency.** ```python import time from dataclasses import dataclass from typing import Optional class CorrelationIntegrityFault(RuntimeError): """Raised when a trace-replay detects a propagation break that cannot be resolved by a non-temporal join key and must be quarantined as evidence.""" pass @dataclass class Span: trace_id: str span_id: str parent_span_id: Optional[str] service: str start_time: float end_time: float def classify_orphan_root( orphan: Span, candidate_parents: list[Span], known_call_edges: set[tuple[str, str]], surviving_join_key: Optional[str], ) -> str: """Decide whether a rootless sub-tree is a forensic integrity fault, a benign logging gap, or a resolvable link. Returns one of: 'resolved', 'logging_gap', 'integrity_fault'. """ # Condition 3: a surviving join key downgrades the fault to a gap. if surviving_join_key is not None: return "resolved" # Find a parent span whose window contains the orphan's start and whose # service is known to call the orphan's service. suspected_boundary = None for parent in candidate_parents: if parent.trace_id == orphan.trace_id: continue if not (parent.start_time <= orphan.start_time <= parent.end_time): continue if (parent.service, orphan.service) not in known_call_edges: continue suspected_boundary = (parent, orphan) break # Condition 2: if no boundary is crossed, this is not a propagation break. if suspected_boundary is None: return "logging_gap" # Condition 1 + the no-time-adjacency invariant: a probable break with no # surviving join key MUST be quarantined, never auto-merged. parent, child = suspected_boundary raise CorrelationIntegrityFault( f"Correlation break between trace {parent.trace_id} " f"(span {parent.span_id}, service={parent.service}) and orphan root " f"{child.trace_id} (span {child.span_id}, service={child.service}) " f"at boundary {parent.service}->{child.service}. No surviving join key. " f"Quarantine both traces; set replay_invalid=true." ) def replay_trace(orphan: Span, parents: list[Span], edges: set[tuple[str, str]], join_key: Optional[str]) -> str: try: return classify_orphan_root(orphan, parents, edges, join_key) except CorrelationIntegrityFault as fault: # Emit a CorrelationBreak record; do NOT merge by time-adjacency. _emit_break_record(orphan, str(fault)) raise ```