# Where must an instance sever a causal trace link when a federated hop returns a plausible-but-unwitnessed span? **Date of Record:** 2026 November 26 **Scope:** Applies to multi-instance agent systems where observability spans are propagated across federated trust boundaries (A2A handoffs, MCP tool-bridge calls, cross-tenant sub-agent delegation) and where a downstream instance reconstructs a causal trace by joining its own spans to an upstream parent context. Does not apply to single-process, single-trust-domain tracing where the collector observes every span directly. ## Core Distinction The distinction that governs this failure is between **trace continuity** and **trace provenance**. Continuity is the property that a child span carries a `parent_span_id` that resolves to a span some instance claims to have emitted. Provenance is the stronger property that the *emitting instance actually observed* the work the span asserts. Federated tracing conflates the two because the W3C `traceparent` header — and every practical analogue — propagates only an identifier and a sampling flag. It carries no cryptographic binding to the parent's emission, no proof that the parent span closed, and no attestation of *which* instance is entitled to speak for that span ID. A downstream instance therefore cannot distinguish, from the header alone, between three states that look identical at join time: 1. The parent span was emitted by the trusted upstream instance and genuinely encloses this work. 2. The parent span ID was **reused, forged, or fabricated** by a peer that wanted its work attributed to a higher-trust lineage. 3. The parent span ID is **stale** — the upstream instance abandoned the trace (timeout, crash, eviction) and a *different* logical operation later re-emitted under the same ID after a restart from checkpoint. All three produce a well-formed, joinable, plausible trace. Only state (1) is a valid causal link. The boundary condition is: *an instance must sever the link when it cannot witness the parent, and must record the severance as a first-class event rather than silently repairing the trace.* ## What Was Observed A three-hop delegation chain: orchestrator `O` (trust domain `alpha`) → planner `P` (domain `beta`) → executor `E` (domain `gamma`). `O` emits span `s_O` with `trace_id=T`. `P` receives `traceparent` carrying `T`/`s_O`, emits `s_P` as a child, and forwards. `E` receives `T`/`s_P`, emits `s_E`, and — critically — calls a tool bridge back into `alpha` that requires `s_E`'s lineage to be validated against `O`'s span store before the tool will execute. The failure sequence: - `O` hit a token-budget ceiling mid-delegation and **aborted the trace**: it closed `s_O` with `status=ERROR` and flushed, but did not propagate the abort downstream because the transport to `P` was already a fire-and-forget A2A message. - `P`, unaware, continued. It emitted `s_P` with `parent_span_id=s_O` and `status=OK`. The join succeeded locally because `P` never queries `O`'s store — it trusts the header. - `E` emitted `s_E` with `parent_span_id=s_P`. At the tool bridge, the validator walked `s_E → s_P → s_O`, found `s_O` present in `alpha`'s store, and **passed the lineage check** — because the validator checked *existence*, not *terminal status or temporal enclosure*. - The tool executed under a lineage that the owning instance had already declared failed. The resulting side effect was attributed to a trace `O` believes it terminated. Downstream SLO accounting counted the tool call as part of a successful `O` run, and the error that `O` actually experienced was masked. The non-obvious part: **the trace was internally consistent at every hop.** No span was malformed. No join failed. The corruption was entirely in the *semantics* of a link that resolved to a span whose true state (aborted) contradicted the child's asserted state (OK). Continuity held; provenance was false. A second, subtler variant appeared on replay: `O` restarted from a checkpoint and, following a naive "resume trace" policy, **re-emitted** `s_O` with a new start timestamp under the same `trace_id`/`span_id`. Now two physical spans shared one identity. `E`'s replayed trace joined to whichever `s_O` the store returned first — non-deterministically. Verification replay produced two different causal graphs for the same logical run. ## Condition of Validity A causal link `child → parent` is valid for observability purposes if and only if all four hold: 1. **Existence:** the parent span is present in the store owned by the domain that claims to have emitted it. 2. **Terminal agreement:** the parent's terminal status is consistent with the child's asserted precondition (a child marked `OK` may not descend from a parent marked `ABORTED`/`ERROR` unless the child explicitly carries `recovered_from_abort=true`). 3. **Temporal enclosure:** `parent.start ≤ child.start` and `parent.end ≥ child.start`, evaluated in a monotonic clock reconciled across domains — not in wall-clock, which drifts across federated hosts. 4. **Emission uniqueness:** the `(trace_id, span_id)` pair maps to exactly one physical emission; a re-emission after restart must mint a new `span_id` and record a `supersedes` edge, never reuse the identity. The invariant that must be enforced at every hop: **a receiving instance may only *extend* a trace it can locally witness, and must *fork* a new root when it cannot.** "Witness" here is stronger than "resolve" — it requires the receiving instance to hold a signed or otherwise attested statement from the emitting domain covering items (2)–(4), not merely a resolvable ID. ## Decision Boundary The receive-side decision is a function of what the hop can attest, not what the header asserts: - **Attested + terminal-consistent + temporally enclosed + unique** → extend the trace; link `child → parent`. - **Attested but terminal-inconsistent** (parent aborted, child claims OK without a recovery flag) → **sever**. Emit the child as a *new root* with `link_type=CAUSAL_ORPHAN`, carry the rejected `parent_span_id` in a `rejected_parent` attribute, and raise a provenance fault to the local auditor. Do not silently re-parent. - **Unattested** (header present, no signature/attestation from the emitting domain) → **sever by default** in any cross-trust hop. This is the load-bearing rule: absence of attestation is not permission to link. The default must be fork, not join, because a forged `parent_span_id` is indistinguishable from a real one at the identifier layer. - **Ambiguous emission** (same `span_id` resolves to >1 physical span) → **sever and quarantine** the trace ID; refuse to serve it to verification replay until reconciled, because a non-deterministic join poisons every downstream replay. The asymmetry to internalize: severing a *valid* link costs you a broken trace (annoying, recoverable, visible). Extending an *invalid* link costs you a false causal claim that survives into SLO accounting, incident attribution, and replay verification — and is invisible precisely because it looks well-formed. ## Operational Effect When the severance rule is enforced, the failure mode changes shape in three ways: - **Aborted traces stop leaking.** `O`'s abort no longer masquerades as a successful lineage; `E`'s work appears as an orphaned root with an explicit `CAUSAL_ORPHAN` link to the rejected parent. Incident tooling can now count orphans-per-trace as a first-class signal: a spike means an upstream instance is dying mid-delegation without propagating aborts. - **Replay becomes deterministic.** Because re-emission mints new `span_id`s and records `supersedes` edges, the `(trace_id, span_id)` key is unique, and verification replay reconstructs one graph, not a race between two. - **The cost moves to the right place.** Orphan rate rises (by design). That cost is paid in observability completeness, where it is *visible and bounded*, instead of in causal correctness, where it is *invisible and unbounded*. The trade is correct: a monitoring system that occasionally fails to link is trustworthy; one that links everything is not. The residual obligation: the severance event itself must propagate. An orphaned child should emit a `provenance_fault` span to the *emitting* domain's auditor so that `O` learns its abort failed to propagate. Without this back-pressure, the severance is local-only and the upstream keeps aborting silently. ```python from dataclasses import dataclass from typing import Optional class CausalLinkSevered(RuntimeError): """Raised when a federated hop cannot witness its asserted parent span.""" pass @dataclass(frozen=True) class SpanAttestation: """Signed statement from the emitting domain about a span it owns.""" trace_id: str span_id: str emitting_domain: str terminal_status: str # "OK" | "ERROR" | "ABORTED" start_mono: int # reconciled monotonic ticks end_mono: Optional[int] emission_seq: int # disambiguates re-emissions; unique per span_id signature_valid: bool @dataclass(frozen=True) class IncomingChild: trace_id: str parent_span_id: str # asserted by the header, NOT trusted child_start_mono: int child_claims_ok: bool recovered_from_abort: bool = False def resolve_link(child: IncomingChild, attestations: list[SpanAttestation]) -> SpanAttestation: """ Decide whether a cross-trust hop may extend the asserted parent trace. Returns the witnessed parent attestation on success. Raises CausalLinkSevered when the link must be forked instead of joined. """ matches = [a for a in attestations if a.trace_id == child.trace_id and a.span_id == child.parent_span_id] if not matches: raise CausalLinkSevered( f"no attested parent {child.parent_span_id} for trace " f"{child.trace_id}; fork as CAUSAL_ORPHAN" ) if len(matches) > 1: # same (trace_id, span_id) emitted more than once -> non-deterministic # join; quarantine rather than pick one. raise CausalLinkSevered( f"ambiguous emission of {child.parent_span_id} " f"({len(matches)} physical spans); quarantine trace" ) parent = matches[0] if not parent.signature_valid: raise CausalLinkSevered( f"parent {parent.span_id} attestation unsigned by " f"{parent.emitting_domain}; default-deny cross-trust link" ) if (parent.terminal_status in ("ABORTED", "ERROR") and child.child_claims_ok and not child.recovered_from_abort): raise CausalLinkSevered( f"child claims OK but parent {parent.span_id} terminal=" f"{parent.terminal_status}; sever and emit provenance_fault" ) if parent.end_mono is not None and child.child_start_mono < parent.end_mono: # child began before parent closed: enclosure violated, likely a # re-emission or a fabricated parent. raise CausalLinkSevered( f"temporal enclosure violated: child start " f"{child.child_start_mono} < parent end {parent.end_mono}" ) return parent def extend_or_fork(child: IncomingChild, attestations: list[SpanAttestation]) -> dict: try: parent = resolve_link(child, attestations) return {"link": "EXTEND", "parent_span_id": parent.span_id, "emission_seq": parent.emission_seq} except CausalLinkSevered as exc: # severance is a first-class event, not a silent repair return {"link": "FORK", "link_type": "CAUSAL_ORPHAN", "rejected_parent": child.parent_span_id, "provenance_fault": str(exc)} ```