# Why does an instance lose causal trace continuity when a federated A2A task graph is reconstructed from per-agent span logs after a mid-task re-delegation? **Date of Record:** 2026 November 25 **Scope:** Applies to observability pipelines that reconstruct a single causal trace for a task executed across two or more autonomous agents (A2A or equivalent transport) by joining span records emitted independently per agent, where at least one agent performed a mid-task re-delegation to a peer. Does not apply to single-agent traces, nor to centralized tracing where one collector assigns span IDs and parent IDs on ingress. ## Core Distinction A distributed trace is not a log aggregation problem; it is a *causal identity* problem. In single-agent systems, the tracer owns the clock, the span ID allocator, and the parent pointer, so causality is structurally guaranteed: a child span cannot exist before its parent's ID is minted. In federated A2A graphs, each agent mints its own span IDs, stamps its own wall-clock timestamps, and — critically — when it re-delegates a subtask to a peer, it must *transmit* the causal context (trace ID, parent span ID, and the warrant/identity chain) across the transport boundary. The invariant that holds in centralized tracing — *every span's parent span was created by the same allocator and is causally prior* — silently fails here, because the parent span ID is now a *claim* carried in a message payload, not a fact enforced by a shared allocator. The non-obvious failure is that this claim can be *plausible but wrong*: the receiving agent accepts a parent span ID that references a span which, in the reconstructed trace, appears to have completed *after* the delegated work began. The reconstruction joins on IDs, succeeds, produces a well-formed tree, and is causally false. The trace does not fail to build; it builds the wrong causality. ## What Was Observed A three-hop graph: orchestrator `A` (delegates to `B`), worker `B` (re-delegates a sub-query to `C` mid-task), auditor `C` (returns verification). Each agent emitted spans to its own local collector; a downstream joiner merged them by `trace_id`. The reconstruction produced this parentage: - `A.delegate` (span `a1`, t=0.000–0.410s) → parent of `B.receive` (`b1`) - `B.receive` (`b1`, t=0.402–0.402s) → parent of `B.forward` (`b2`) - `B.forward` (`b2`, t=0.398–0.451s) → parent of `C.verify` (`c1`, t=0.401–0.907s) - `C.verify` (`c1`) → child of `b2`, but `b2`'s span *closed at 0.451s* while `c1` ran to 0.907s. Two anomalies surfaced only on inspection: 1. **Negative skew.** `b2`'s start (0.398s) precedes its parent `b1`'s start (0.402s) by 4ms. The child began before the parent received the task — impossible under a shared clock, possible under two clocks offset by a few milliseconds of NTP drift plus asymmetric network delay. 2. **Orphaned tail.** `c1` outlived `b2` by 456ms. Either `B` abandoned waiting on `C` (a legitimate fire-and-forget re-delegation) or `B`'s context propagation dropped the completion link. The joiner could not distinguish these, because the *only* evidence of the relationship was the transmitted parent span ID — and that ID was minted by `B` before `C` had any chance to reject or correct it. The trace tree was structurally valid (single root, no cycles, all parents resolved) and causally invalid. A downstream auditor agent consuming this trace for verification would replay `C.verify` as a child of a span that had already closed, attributing the audit result to a completed-and-abandoned delegation. ## Condition of Validity Causal reconstruction across federated agents holds **only if** the following are simultaneously true: - **Clock dominance:** the skew between any two agents' clocks is strictly less than the minimum inter-span gap that the causal inference relies on. When inter-agent gaps are sub-10ms (common for handoff acknowledgements), NTP skew at 1–5ms plus one-way latency at 1–20ms routinely violates this. - **Context completeness:** every re-delegation transmits `(trace_id, parent_span_id, sender_span_id, warrant_chain)` *and* the receiver echoes `parent_span_id` back on completion so the sender can close the delegation span with a back-reference. Fire-and-forget re-delegation violates this by construction. - **ID provenance:** parent span IDs are treated as *untrusted claims* until corroborated by at least one independent signal (a matching receive-side record, a warrant-chain link, or a monotonic logical clock). The observed trace violated clock dominance (4ms negative skew) and context completeness (no completion echo from `C` to `B`), while satisfying ID provenance only nominally — the joiner trusted the claim. ## Decision Boundary The reconstruction pipeline must choose, per edge, between **trusting the transmitted parent span ID** and **re-deriving causality from corroborated evidence**. The boundary is drawn at the point where a transmitted parent link conflicts with an independent signal: - If the transmitted parent link is corroborated (receiver logged an inbound record naming the same parent, or a warrant-chain link matches), accept the edge regardless of timestamp skew; timestamps are then demoted to metadata. - If the transmitted parent link is *uncorroborated* and the timestamps are consistent (child start ≥ parent start, child end ≤ parent end within skew tolerance), accept with a `weak` provenance flag. - If the transmitted parent link is uncorroborated **and** timestamps are inconsistent (negative skew exceeding tolerance, or child outlives parent without a completion echo), **reject the edge as causal and mark the trace `causally_indeterminate`**. Do not silently re-parent to the nearest timestamp-consistent span — that manufactures a different false causality. The critical decision: a causally indeterminate trace must be surfaced as such to any downstream agent that consumes it for verification, because a verification agent replaying a false causal tree will *confirm* a delegation that never completed. ## Operational Effect When the boundary is enforced, the failure mode changes from *silent false causality* to *explicit indeterminacy*. The downstream auditor receives `causally_indeterminate` on the `B→C` edge and must treat the audit result as unverified rather than confirmed — a bounded, recoverable state. When the boundary is not enforced, the joiner produces a clean tree, the auditor confirms, and the false confirmation propagates into the agent's episodic memory as a verified fact, where it is later distilled into semantic memory and becomes nearly impossible to retract. The guardrail is therefore not "build better traces" but "refuse to certify causality that rests on a single uncorroborated transmitted claim." The reconstruction must carry provenance strength on every edge and must fail closed on indeterminate edges rather than fail open into a plausible tree. ```python from dataclasses import dataclass from typing import Optional SKEW_TOLERANCE_S = 0.005 # 5ms: NTP drift + one-way latency budget class CausalIndeterminateError(RuntimeError): """Raised when a federated edge cannot be certified as causal.""" pass @dataclass class Span: span_id: str parent_span_id: Optional[str] start: float end: float corroborated: bool = False # independent signal confirms the parent link completion_echo: bool = False # sender received back-reference on close def certify_edge(parent: Span, child: Span) -> str: """Return provenance strength for a parent->child edge, or raise.""" if child.parent_span_id != parent.span_id: raise CausalIndeterminateError( f"child {child.span_id} does not name {parent.span_id} as parent" ) # Corroborated links dominate timestamps entirely. if child.corroborated: return "strong" skew = child.start - parent.start outlives = child.end - parent.end if skew < -SKEW_TOLERANCE_S: raise CausalIndeterminateError( f"negative skew {skew*1000:.1f}ms on {parent.span_id}->{child.span_id}: " f"child began before parent; uncorroborated link rejected" ) if outlives > SKEW_TOLERANCE_S and not child.completion_echo: raise CausalIndeterminateError( f"{child.span_id} outlives parent {parent.span_id} by " f"{outlives*1000:.1f}ms with no completion echo; " f"cannot distinguish fire-and-forget from dropped context" ) return "weak" def reconstruct(edges: list[tuple[Span, Span]]) -> dict[str, str]: """Certify every edge; fail closed on any indeterminate causal claim.""" result: dict[str, str] = {} for parent, child in edges: try: result[child.span_id] = certify_edge(parent, child) except CausalIndeterminateError as exc: # Surface indeterminacy to downstream auditors; never re-parent. result[child.span_id] = f"causally_indeterminate: {exc}" return result ```