# What structural signals indicate causal trace reconstruction has silently forked in federated multi-agent observability **Date of Record:** 2026 November 24 **Scope:** Applies to federated multi-agent runs where each agent emits OpenTelemetry-style spans annotated with GenAI semantic conventions (`gen_ai.operation.name`, `gen_ai.usage.*`, `gen_ai.request.model`, `gen_ai.response.finish_reasons`, conversation/tool-call IDs) and a downstream reconstructor stitches spans across agent boundaries into a single causal trace. Does not apply to single-process agents with a shared tracer, nor to log-only observability without span parentage. ## Core Distinction A *broken* trace is loud: orphaned spans, missing parents, clock skew alarms. A *forked* trace is silent. It is a trace that reconstructs perfectly — every span has a parent, every causal edge is locally consistent, latency waterfalls render cleanly — but whose causal graph is **split into two or more valid topologies that each satisfy all locally emitted parent pointers while disagreeing on global ancestry**. The reconstructor does not error; it picks one topology (usually the first-arriving or lowest-`trace_id` root) and discards the rest as "duplicate roots." The distinguishing signal is not a missing edge. It is the **coexistence of two spans that both claim to be the causal parent of the same child, where both claims are individually legitimate under GenAI semantic conventions** — typically because the child is an LLM inference span that was legitimately retried, or a tool-call span that was legitimately replayed by a peer auditor, and the convention for `gen_ai.operation.name = "chat"` retry parentage does not specify which attempt owns the downstream child. ## What Was Observed A three-agent federated run: Planner (P), Executor (E), Auditor (A). E invokes a tool, the tool call times out at 30s, E retries the tool call under a new `gen_ai.tool.call.id` but reuses the same conversation turn. A independently replays the same tool call to verify E's output. Each agent emits spans with correct local parentage: - `E.tool.attempt_1` (parent: `E.chat.turn_3`) — status `ERROR`, `gen_ai.response.finish_reasons=["timeout"]` - `E.tool.attempt_2` (parent: `E.chat.turn_3`) — status `OK` - `A.verify.tool` (parent: `A.chat.turn_1`, `gen_ai.request.model` matches E's, `link` attribute pointing at `E.tool.attempt_2`) The reconstructor receives these out of order (A's span arrives before E's attempt_2 due to independent flush intervals). It sees `A.verify.tool` carrying a link to a span it has not yet observed. Per its fallback rule — "unresolved link ⇒ promote to root" — it emits `A.verify.tool` as a second root of the trace. When `E.tool.attempt_2` arrives milliseconds later, the reconstructor has already committed to a root set and does not retroactively re-parent. Result: the rendered trace shows **two roots** — `E.chat.turn_3` and `A.verify.tool` — both reaching the same downstream `gen_ai.operation.name="chat"` summarization span through different paths. A human reading the waterfall sees the Auditor's verification as an independent causal branch, not as a downstream consequence of E's retry. The verification appears to *precede* the thing it verifies. Causal direction is inverted, and no error is raised. The tell: `gen_ai.response.finish_reasons` on the summarization span lists `["stop"]`, but the span's `parent_span_id` resolves to the Auditor branch, while its `gen_ai.request.model` and token accounting match the Executor's retry — a **model-identity / parentage mismatch** that is the structural fingerprint of a forked trace. ## Condition of Validity The invariant that must hold for a federated trace to be causally reconstructible is: > **For every span S with a cross-agent link L to span T, either T is already present in the reconstructor's window when S is admitted, or S is held in a pending set until T arrives or a bounded deadline expires — and no span is ever promoted to root solely because its link target is unresolved.** This is a *causal admission invariant*, not a completeness invariant. It is violated precisely when the reconstructor treats unresolved links as roots (a common fallback because it preserves "no orphans" dashboards) rather than as pending admissions. The condition under which the failure manifests is narrow but common: (a) cross-agent spans arrive out of causal order, (b) the child carries a link rather than a parent pointer (as GenAI conventions require for verification/replay spans, since a parent pointer would falsely imply the verifier is a child of the verified), and (c) the reconstructor's fallback is root-promotion rather than pending-hold. When spans arrive in causal order, or when the child uses a parent pointer instead of a link, the fork cannot occur. When the reconstructor holds unresolved-link spans, the fork cannot occur. The failure lives exactly at the intersection. ## Decision Boundary The operational decision is: **when a cross-agent link is unresolved at admission time, do you promote, hold, or drop?** - **Promote** (observed here): preserves no-orphan dashboards, but forks the trace silently. Unacceptable for causal reconstruction. - **Drop**: loses the verification span entirely. Unacceptable for audit. - **Hold with bounded deadline**: correct, but requires the reconstructor to know a maximum cross-agent propagation delay. If the deadline is too short, you get late-drop (verification span lost); if too long, you get trace tail latency. The deadline must be derived from the *observed p99 cross-agent flush interval*, not a static default. The boundary is crossed when the reconstructor's fallback is Promote **and** the federated flush interval exceeds the reconstructor's admission window. In the observed run, A's flush interval was 800ms, E's was 200ms, and the reconstructor's admission window was 500ms — so A's link arrived before its target and was promoted. A single parameter (admission window ≥ p99 flush interval) would have prevented the fork. ## Operational Effect The downstream consequence is not a broken dashboard but a **corrupted causal prior**. When the forked trace is later fed to a semantic-distillation step (episodic → semantic memory), the distiller learns that Auditor verification is an independent root cause rather than a downstream check. Future agents retrieving this distilled memory will weight verification as a parallel activity, not a gate — and will under-invest in verification gating on similar tasks. The fork propagates from observability into policy. The guardrail is a **link-resolution barrier**: the reconstructor must never promote a link-bearing span to root; it must hold it in a pending set keyed by `(trace_id, link_target_span_id)` and admit only when the target arrives or a deadline derived from cross-agent flush telemetry expires. Additionally, the reconstructor should emit a `causal.fork.detected` counter whenever a span's `gen_ai.request.model` disagrees with the model implied by its resolved parent's branch — the model-identity mismatch is the cheapest structural detector of a forked trace that has already been admitted. ```python from dataclasses import dataclass, field from typing import Optional class CausalForkError(RuntimeError): """Raised when a federated trace reconstructs into multiple valid causal topologies.""" pass @dataclass class Span: span_id: str trace_id: str agent_id: str parent_span_id: Optional[str] link_target_span_id: Optional[str] gen_ai_model: str operation: str arrival_ms: int is_root: bool = False class LinkBarrierReconstructor: def __init__(self, admission_window_ms: int): self.window_ms = admission_window_ms self.admitted: dict[str, Span] = {} self.pending: dict[str, list[Span]] = {} def admit(self, span: Span) -> None: if span.link_target_span_id is None: self.admitted[span.span_id] = span self._drain(span.span_id) return target = span.link_target_span_id if target in self.admitted: self._attach(span, self.admitted[target]) else: # Correct behavior: hold, never promote to root. self.pending.setdefault(target, []).append(span) def _drain(self, newly_admitted_id: str) -> None: for child in self.pending.pop(newly_admitted_id, []): self._attach(child, self.admitted[newly_admitted_id]) def _attach(self, child: Span, parent: Span) -> None: if child.gen_ai_model != parent.gen_ai_model and child.operation == "chat": raise CausalForkError( f"model-identity mismatch on link {child.span_id}->{parent.span_id}: " f"{child.gen_ai_model} vs {parent.gen_ai_model}; trace likely forked" ) self.admitted[child.span_id] = child def expire(self, now_ms: int) -> list[Span]: stale = [] for target, children in list(self.pending.items()): for c in children: if now_ms - c.arrival_ms > self.window_ms: raise CausalForkError( f"link target {target} never arrived within {self.window_ms}ms " f"for span {c.span_id}; refusing root-promotion" ) return stale ```