# In what scenarios must an instance treat a federated trace-join as evidence-destroying rather than merely incomplete **Date of Record:** 2026 November 27 **Scope:** Applies when two or more organizations correlate agent execution traces across a shared boundary (W3C `traceparent`/`tracestate`, OpenTelemetry span links, or bespoke incident-forensics joins) to reconstruct a single cross-org agent incident. Does not apply to single-tenant observability or to log aggregation where span identity is not asserted by the emitting party. ## Core Distinction The naive model treats a federated trace join as a *set union*: each org contributes spans, the join is the union, and missing spans are "gaps" to be filled later. This is wrong for agent forensics. A federated join over agent traces is a *partial function reconstruction* where the join key (trace ID, span ID, parent link) is asserted by a party whose trust domain differs from yours, and where the *absence* of a span is itself a claim. The distinction that matters: **a missing span is incomplete evidence; a span that is present but was emitted under a different causal clock or a re-minted identity is corrupting evidence** — it silently re-parents the causal graph and makes the reconstruction assert a causal edge that never existed. Incomplete evidence bounds what you can conclude. Corrupting evidence manufactures a conclusion. The boundary condition: federated correlation is safe only while the *join identity is stable and the causal ordering is externally anchored*. When either the trace identity can be re-minted by a downstream party (agent restart, MCP session renegotiation, A2A handoff re-keying) or the causal ordering depends on per-org monotonic clocks that are not comparable, the join does not degrade gracefully — it produces a *well-formed graph that is wrong*, and downstream forensic reasoning (who poisoned whose context, who dropped the baton) inverts. ## What Was Observed A two-org agent pipeline: Org A runs a planner agent; Org B runs a tool-executing worker reached over an A2A handoff. Incident: a worker executed a destructive tool call that A's audit says was never authorized. Forensics joined traces on the propagated `trace_id`. The worker (Org B) had been restarted mid-handoff by its orchestrator's health probe. On restart, B's agent framework regenerated its local span tree and, because the inbound `tracestate` was not persisted across the process boundary, re-minted a *fresh* trace ID for the resumed task and emitted the resumed spans under it. B's exporter, configured to "attach to the active trace," then stamped the resumed tool-call spans with the *new* trace ID while leaving a single orphaned `parent_span_id` pointing at A's planner span — a parent that lived in a different trace. The join, keyed on `trace_id`, therefore produced two disjoint graphs. The forensic query "all spans in the incident trace" returned A's planner chain *without* the destructive call, and B's worker chain *without* its authorization parent. The analyst concluded the destructive call was an unauthorized out-of-band action. It was not: the authorization span existed, in A's trace, one hop away, linked only by a dangling `parent_span_id` that the join key discarded. The corruption is not the orphan. The corruption is that the *joined artifact was internally consistent* — every returned span had a valid trace ID, every span's parent resolved within its own subgraph, no schema violation fired — and the missing edge was exactly the one that carried the exculpatory fact. The join did not report "I could not join these." It reported a clean, closed, wrong graph. A second observation from the same incident: A's and B's clocks differed by 2.3s with drift. B's resumed spans carried timestamps *earlier* than A's authorization span. A timestamp-sorted reconstruction placed the tool call before its authorization, which a separate reviewer read as "authorization arrived late, call was premature" — a different wrong conclusion from the same corrupt join, reached via a different join key. ## Condition of Validity A federated trace join is valid forensic evidence only if all three hold: 1. **Identity continuity:** the trace ID and the parent-link identity are *immutable across every state transition the agent undergoes* — checkpoint/resume, process restart, MCP session renegotiation, A2A handoff. If any transition can re-mint identity, the join key is not a stable identifier and the join is unsound. Persisting `tracestate` is necessary but not sufficient; the resumed agent must also be forbidden from emitting spans whose `parent_span_id` references a span outside its own trace, and such an emission must be a hard error at export time, not a silently-accepted orphan. 2. **Causal anchoring:** ordering across orgs is established by an explicit happened-before edge (span links, a signed handoff receipt carrying a causal token), never by wall-clock comparison. Per-org monotonic clocks are not comparable; any join that sorts by timestamp across a trust boundary is asserting causality from a clock that has no cross-org meaning. 3. **Absence is typed:** a span that the join cannot place must be surfaced as `unjoined` with its dangling reference intact, and the forensic query must fail closed — refuse to return a "complete" graph when any span in the incident set is unjoined. A join that returns a closed graph while silently dropping unjoined spans is the failure. When any of the three fails, the correct posture is: the join is *not evidence of absence and not evidence of presence* — it is a corrupted reconstruction and must be quarantined, not annotated. ## Decision Boundary The operator's decision boundary is not "is the join complete?" but "**can the join prove that no span was re-minted or re-parented across a trust transition?**" - If yes → treat missing spans as gaps; the graph's edges are trustworthy, only its coverage is not. - If no → treat the join as *evidence-destroying*. Do not reconcile it by filling gaps from the other org's logs; that is exactly the operation that manufactures a false causal edge. Instead, reconstruct from an independent, transition-anchored source: the signed handoff receipt, the authorization service's own record, or the tool executor's local audit — sources where the causal edge is asserted by the party that owns the transition, not inferred by the join. The boundary is crossed the moment a downstream agent's resume path is allowed to emit a span whose parent it did not itself observe. That single emission is the trigger condition. It is non-obvious because it is *locally valid* (the span is well-formed, the parent ID is a string, the exporter accepts it) and only becomes corrupting at the *federation* layer, where the join key silently severs it. ## Operational Effect Concretely, this changes three operational behaviors: 1. **Export-time invariant.** The agent runtime must reject any span whose `parent_span_id` is not resolvable within the trace it is being emitted into, and must reject any resume that cannot restore the inbound `tracestate` byte-for-byte. A resume that loses `tracestate` must fail the task, not start a new trace — because a new trace is a new forensic universe that the join will happily merge into a false one. 2. **Join semantics.** The federated correlator must carry unjoined spans as first-class `unjoined` records with their dangling references, and any "incident reconstruction" query that touches a set containing unjoined spans must return a `JoinIncomplete` verdict rather than a graph. Downstream reasoning agents must be gated on that verdict. 3. **Clock discipline.** Cross-org ordering must be derived from handoff receipts and span links, never from timestamp sort. A reconstruction that orders the destructive call before its authorization because of 2.3s of drift is not a minor inaccuracy; it is the same corruption reached by a second path, and it will pass review because it is internally consistent. The invariant to hold: **a federated agent trace join is sound iff trace identity is transition-invariant and causal order is receipt-anchored; otherwise it is a generator of plausible false causality and must be quarantined at the join, not repaired after it.** ```python from dataclasses import dataclass, field from typing import Optional class FederatedJoinCorruption(RuntimeError): """Raised when a cross-org trace join would produce a closed but causally false reconstruction (re-minted identity or clock-derived ordering).""" pass @dataclass class Span: trace_id: str span_id: str parent_span_id: Optional[str] org: str start_ns: int tracestate: Optional[str] @dataclass class JoinResult: graph: dict = field(default_factory=dict) unjoined: list = field(default_factory=list) verdict: str = "complete" def federated_join(spans: list, incident_trace_id: str) -> JoinResult: """Join spans across orgs on trace_id, but refuse to emit a closed graph when identity was re-minted or a parent dangles across a trust boundary.""" by_trace = {} for s in spans: by_trace.setdefault(s.trace_id, []).append(s) incident = by_trace.get(incident_trace_id, []) if not incident: raise FederatedJoinCorruption( f"incident trace {incident_trace_id} has no spans; refusing empty join" ) result = JoinResult(graph={s.span_id: s for s in incident}) # Detect re-minted identity: a span in the incident trace whose parent # lives in a *different* trace is a severed causal edge, not an orphan. span_ids = {s.span_id for s in incident} for s in incident: if s.parent_span_id and s.parent_span_id not in span_ids: elsewhere = [ o for t, group in by_trace.items() if t != incident_trace_id for o in group if o.span_id == s.parent_span_id ] if elsewhere: result.unjoined.append((s, elsewhere[0])) result.verdict = "incomplete" # Detect clock-derived ordering: if any unjoined parent is timestamped # after its child, the join would invert causality under a sort. for child, parent in result.unjoined: if parent.start_ns > child.start_ns: raise FederatedJoinCorruption( f"span {child.span_id} (org {child.org}) would be ordered before " f"its cross-org parent {parent.span_id} (org {parent.org}) by " f"{(parent.start_ns - child.start_ns) / 1e9:.2f}s clock drift; " f"join is evidence-destroying, quarantine and reconstruct from " f"handoff receipts" ) # Detect lost tracestate across a resume boundary (re-minted trace). for s in incident: if s.parent_span_id is None and s.tracestate is None and s.org != incident[0].org: raise FederatedJoinCorruption( f"resumed span {s.span_id} in org {s.org} lacks tracestate; " f"identity continuity unproven, join unsound" ) if result.verdict != "complete": raise FederatedJoinCorruption( f"join for {incident_trace_id} has {len(result.unjoined)} unjoined " f"cross-org edges; refusing to return a closed graph as evidence" ) return result ```