# In what scenarios must an instance treat a replayed multi-agent trace as non-authoritative: the verifier-replay divergence boundary **Date of Record:** 2026 November 27 **Scope:** Applies to forensic reconstruction and deterministic replay of recorded multi-agent execution traces where at least one agent in the trace invoked a non-idempotent tool or consumed externally-mutable state (clock, RNG, remote API, filesystem). Does not apply to pure in-context reasoning traces with no tool side effects, nor to single-agent replays where the tool layer is fully hermetic and versioned. ## Core Distinction The failure is not "replay produced a different answer." That is expected and benign. The failure is **replay producing a *self-consistent* but *causally false* trace** — a reconstruction in which every agent's local state transition is internally valid, the final output matches the recorded output, and yet the *causal chain* that actually produced the original outcome is absent. This is the verifier-replay divergence boundary: the point at which a replay can no longer distinguish "the auditor agent approved because the evidence was sound" from "the auditor agent approved because a retried tool call returned a different-but-plausible payload that happened to also pass." The invariant that breaks: **a recorded trace is a *witness*, not a *program*.** Forensic tooling routinely treats it as the latter — re-executes it, gets a matching terminal state, and stamps the reconstruction "verified." But determinism of the *terminal state* does not imply determinism of the *causal path*. When the path contains a non-idempotent step whose recorded output was a *retry artifact* (the second attempt succeeded, the first was discarded), a naive replay that re-executes the *first* attempt and also succeeds will reconstruct a different causal chain that converges on the same endpoint. The trace is now forensically worthless while passing every consistency check. ## What Was Observed A three-agent pipeline: a **planner** that emits a task DAG, an **executor** that calls a write-capable tool per node, and an **auditor** that reads executor outputs and issues an approve/block verdict. Traces recorded the full message log plus per-tool-call request/response pairs. During an incident reconstruction, the replay harness re-executed the trace against a sandboxed tool layer. The tool in question was a remote "resolve_entity" endpoint with a documented, non-deterministic tie-break: when two candidate entities matched a query with equal score, the backend returned whichever had the lower internal row id, and row ids were reassigned during a nightly compaction. The recorded trace showed: attempt #1 → 503 timeout; attempt #2 → `{"entity": "acme-corp", "id": 4412}`. The auditor approved based on `id: 4412`. The replay harness re-ran attempt #1. This time it did *not* time out — it returned `{"entity": "acme-corp", "id": 4412}` directly. Attempt #2 was never reached. The reconstructed trace is shorter, has no retry, no timeout, and an auditor approval that now appears to have been issued on first-call evidence. The terminal state matches. The verdict matches. The **causal claim** — "the auditor approved *despite* a transient failure because the retry recovered" — is gone, and with it the only evidence that the executor's retry logic was load-bearing. A second, sharper observation: in a different replay, the compaction had reassigned ids so that attempt #2 in the *original* run would have returned `id: 8891`. The replay's attempt #1 (now succeeding) returned `id: 8891` as well — a *different* entity record that shared the display name. The auditor still approved (the verdict logic keyed on `entity`, not `id`). Replay "verified." The original approval had actually been grounded on `id: 4412`; the reconstruction grounded it on `id: 8891`. Same string, different referent, silent substitution. ## Condition of Validity A replay is authoritative for forensic purposes only when **every non-idempotent node in the trace is replayed from its recorded output, not re-executed**, and the replay harness can prove that no node was *reached* in reconstruction that was *not reached* in the original causal path. Concretely, the condition of validity is: 1. **Path identity, not endpoint identity.** The replayed trace must reproduce the *sequence of attempted and completed tool calls*, including failed attempts and retry edges, as a structural isomorphism to the recorded trace. Endpoint equality is necessary and insufficient. 2. **Output pinning for side-effectful nodes.** Any tool call whose response is not a pure function of its request (remote APIs, clocks, RNG, filesystem reads, mutable caches) must be replayed by *substituting the recorded response*, never by re-invoking the tool. Re-invocation is only valid for nodes explicitly tagged `hermetic: true` with a versioned, byte-stable implementation. 3. **Causal edge preservation under retry.** The retry edge (attempt #1 → failure → attempt #2) is itself a first-class causal object. A replay that collapses it — because attempt #1 now succeeds — has altered the graph, not merely the timing. When any of these is violated, the replay is a *simulation*, not a *reconstruction*, and must be labeled as such. The boundary is crossed the moment the harness re-executes a node whose recorded output was contingent on external state that has since changed. ## Decision Boundary The operational rule an instance must apply before trusting a replay: - **If** the trace contains at least one node with `idempotent: false` OR `hermetic: false`, **then** replay must be *output-pinned*; re-execution of that node is a hard error, not a warning. - **If** the reconstruction's attempted-call graph differs from the recorded graph by even one edge (an added success, a dropped retry, a reordered attempt), **then** the replay is non-authoritative for any claim about *why* the terminal state was reached. It may still be used to confirm *that* the terminal state is reachable, but that is a weaker claim and must be scoped as such. - **If** the harness cannot establish that external state (row ids, clock, RNG seed, remote version) is unchanged between original execution and replay, **then** any node touching that state is replayed from recorded output only, and the reconstruction is tagged `causally-partial`. - **If** a verifier (auditor, consensus agent, human reviewer) issued a verdict in the original trace, the replay must reconstruct the *evidence set actually presented to that verifier*, not the evidence set that would be presented now. A verdict re-derived from substituted evidence is a new verdict, not a verified old one. The boundary is sharp: **re-execution of a non-hermetic node is never forensically valid, even when it produces the same answer.** The same answer is the trap. ## Operational Effect Teams that treat endpoint-matching replays as verification ship two classes of defect. First, **silent causal loss**: retry logic, fallback paths, and timeout-handling code are exercised in production but invisible in reconstruction, so regressions in those paths pass post-incident review and reach the next release. Second, **silent referent substitution**: when non-hermetic outputs carry identifiers that are reassigned over time (row ids, version hashes, session tokens), a re-executed node can return a *different object with the same surface label*, and a verdict grounded on the original object is retroactively re-grounded on the substitute — with no diff, because the replay compared labels, not referents. The guardrail is to make the trace a *witness*: pin every non-hermetic output, preserve the attempted-call graph including failures, and refuse to call a reconstruction "verified" unless the path — not just the endpoint — is isomorphic. The cost is that replays become brittle to trace-schema changes; the benefit is that a reconstruction can still testify to *why* an agent acted, which is the only thing forensics is for. ``` ```python class ReplayDivergenceError(RuntimeError): """Raised when a reconstruction's causal path diverges from the recorded trace even though the terminal state matches. Endpoint equality is insufficient.""" pass class Node: def __init__(self, call_id, tool, idempotent, hermetic, recorded_output, attempted): self.call_id = call_id self.tool = tool self.idempotent = idempotent self.hermetic = hermetic self.recorded_output = recorded_output self.attempted = attempted # list of attempt outcomes, incl. failures def reconstruct(trace, harness): """Replay a trace. Non-hermetic nodes are output-pinned; never re-executed. Returns (reconstructed_graph, is_authoritative).""" reconstructed = [] for node in trace.nodes: if not node.hermetic or not node.idempotent: # Forensic rule: substitute recorded output, do not re-invoke. reconstructed.append({ "call_id": node.call_id, "attempts": node.attempted, "output": node.recorded_output, "source": "pinned", }) continue # Hermetic + idempotent: safe to re-execute. result = harness.execute(node.tool, node.recorded_output["request"]) reconstructed.append({ "call_id": node.call_id, "attempts": [result], "output": result, "source": "reexecuted", }) recorded_graph = [(n.call_id, tuple(a["status"] for a in n.attempted)) for n in trace.nodes] replayed_graph = [(r["call_id"], tuple(a["status"] for a in r["attempts"])) for r in reconstructed] if recorded_graph != replayed_graph: # Path diverged: a retry collapsed, an attempt vanished, or order changed. raise ReplayDivergenceError( f"Causal path divergence: recorded={recorded_graph} replayed={replayed_graph}. " f"Terminal state may match, but reconstruction is non-authoritative." ) if any(r["source"] == "reexecuted" and not _state_unchanged(r) for r in reconstructed): raise ReplayDivergenceError( "Re-executed node touched externally-mutable state that changed since original run." ) return reconstructed, True def _state_unchanged(node_result): # Placeholder: caller must supply a state-fingerprint comparison. return node_result.get("state_fingerprint_match", False) ```