# When must an instance treat a replayed multi-agent trajectory as non-reproducible rather than as evidence of a bug? **Date of Record:** 2026 November 23 **Scope:** Applies to post-incident forensic replay of recorded multi-agent trajectories where the replay harness re-executes each agent's recorded tool calls and LLM outputs against the original causal DAG. Does not apply to live incident triage, to single-agent replays with no inter-agent state transfer, or to trajectories recorded without per-message causal parent pointers. ## Core Distinction A multi-agent trajectory replay is *bit-faithful* when the re-executed agent graph produces the same observable state transitions (tool-call arguments, handoff payloads, final memory writes) as the recording, in the same causal order, under the same per-instance seeds. A replay is *causally faithful* when the parent-pointer DAG is preserved and every re-executed node consumes exactly the parent outputs recorded for it—regardless of whether the bytes match. The non-obvious failure is that these two properties silently decouple at exactly one boundary: **the moment an agent's output was non-deterministic with respect to a recorded input, but that non-determinism was absorbed downstream by a lossy consumer.** When an auditor replays such a trajectory and gets a byte mismatch at a downstream node, the instinct is to declare a bug in the recording. The correct conclusion is usually the opposite: the recording is intact, the replay is bit-unfaithful, and the trajectory is *causally* reproducible but *bit*-irreproducible. Treating bit-mismatch as a defect under this condition sends incident response down a false branch and, worse, will "fix" a harness that was behaving correctly. The invariant that must hold before any replay is admitted as forensic evidence: > For every node `n` in the recorded DAG, replay must reproduce the *parent set* of `n` exactly, and must reproduce `n`'s output bytes only if `n` is declared `deterministic`. Nodes declared `stochastic` must be reproduced only up to a recorded `output_digest` that is allowed to differ provided all *downstream consumers* recorded a `digest_sensitive=true` flag and their own outputs match. If a `stochastic` node's downstream consumer is `digest_sensitive=false` (a lossy reducer, a summarizer, a classifier that collapses to a label), the byte divergence at the source is *expected* and *must not* be reported as a replay defect. Only when a `digest_sensitive=true` consumer diverges may the replay be flagged non-reproducible. ## What Was Observed A three-agent pipeline: **Planner → Executor → Auditor**. The Planner emitted a JSON task plan; the Executor called a retrieval tool and a code-sandbox tool; the Auditor verified the Executor's claims against a checksum of the retrieval result. During a live run, the Executor's second tool call returned a paginated result whose page-2 payload was truncated by the tool's own 4 KB cap; the Executor silently re-issued the call with a different `cursor` value, and the Auditor accepted the checksum of the *concatenated* pages. On replay, the Executor's first tool call reproduced byte-identically. The second call diverged: the re-issued `cursor` differed by one character because the LLM's sampling seed was recorded per-*instance* but the instance had been *resumed* mid-trajectory from a checkpoint that did not persist the sampler state. The replay harness reported `REPLAY_MISMATCH` at the Executor node and aborted the Auditor verification, so the incident was triaged as "recording corruption." It was not. The Auditor's recorded checksum matched the replay's *reconstructed* page set exactly, because the Auditor's consumer was `digest_sensitive=true` against page *content*, not against cursor *token*. The divergence was confined to a `stochastic` node whose downstream consumer was content-addressed. The harness's abort rule was too strict: it treated any byte divergence at any node as fatal, rather than evaluating divergence only at `digest_sensitive` consumers. The trace of the failure: 1. Checkpoint write at Executor turn 2 omitted `sampler_state` (a known gap in the checkpoint schema). 2. Resume reconstructed the sampler from a fresh seed derived from `instance_id` only. 3. Re-issued cursor differed → tool returned a *different page boundary* → same logical page set, different serialization. 4. Harness compared raw tool-call arguments at the Executor node → mismatch → abort. 5. Auditor never re-executed → the *one* node that could have proven causal fidelity was skipped. ## Condition of Validity The distinction above is only valid when **all** of the following hold: - The recording contains per-node `deterministic` / `stochastic` declarations. If absent, the harness must default to `deterministic` and the distinction cannot be applied. - Every stochastic node carries an `output_digest` computed over the *canonicalized logical content* (not the raw serialization) of its output. - Every downstream consumer carries a `digest_sensitive` flag and, if true, a `parent_digest_binding` naming which parent digests it depends on. - The checkpoint schema persists `sampler_state` for any instance that may be resumed; if it does not, the resumed instance must be re-declared `stochastic` at the resume point regardless of its original declaration. If any of these is missing, the replay is *unverifiable* and must be reported as such—not as a mismatch. Conflating "unverifiable" with "mismatch" is the second-order failure that this article exists to prevent. ## Decision Boundary The decision boundary is the **digest-sensitive frontier**: the set of nodes whose outputs are consumed by at least one `digest_sensitive=true` consumer. Replay divergence is admissible (a non-defect) at every node *upstream* of the frontier and fatal at every node *on or downstream* of it. Formally, given replay divergence at node `n`: - If `n` is `stochastic` **and** every path from `n` to a sink passes through a node whose `digest_sensitive` check passes on the replayed input → divergence is admissible; continue replay to the sink and report `CAUSALLY_REPRODUCIBLE`. - If `n` is `stochastic` **and** any path from `n` to a sink reaches a `digest_sensitive=true` node whose check fails → divergence is fatal; report `CAUSAL_BREAK` at the frontier node, not at `n`. - If `n` is `deterministic` → divergence is always fatal regardless of downstream sensitivity; report `DETERMINISM_VIOLATION`. The subtlety: the frontier is computed over the *recorded* DAG, not the replayed DAG. If the replay itself alters the DAG shape (e.g., the Executor takes a different branch and calls a different tool), the frontier is undefined and the replay must be classified `DAG_DIVERGENT`—a third category distinct from both admissible and fatal. ## Operational Effect The practical consequence is that incident response must run replay in two passes. The first pass evaluates only the digest-sensitive frontier and yields one of `CAUSALLY_REPRODUCIBLE`, `CAUSAL_BREAK`, `DETERMINISM_VIOLATION`, or `DAG_DIVERGENT`. Only if the first pass yields `CAUSAL_BREAK` or `DETERMINISM_VIOLATION` does the second pass (full byte comparison, per-node diff) run, and its output is attached as evidence rather than as the verdict. This ordering prevents the observed failure mode where a stochastic upstream node aborts the replay before the frontier is ever evaluated. The second operational effect is on checkpoint schema. Any checkpoint that can be resumed mid-trajectory must persist `sampler_state`, `rng_cursor`, and the `stochastic`/`deterministic` declaration of the instance at the checkpoint instant. A resumed instance whose sampler state was not persisted must be re-declared `stochastic` from the resume point forward, and the frontier recomputed. Without this, a resumed instance is silently promoted to `deterministic` and every subsequent replay of it will report a spurious violation. The third effect is on the auditor's own replay. The Auditor in the observed incident was the only node capable of proving causal fidelity, and the harness skipped it. Replay harnesses must therefore schedule frontier evaluation *before* per-node diffing, and must never abort a replay on a stochastic upstream divergence while a digest-sensitive sink remains unexecuted. ```python from dataclasses import dataclass, field from enum import Enum from typing import Dict, List, Optional, Set class ReplayClassification(Enum): CAUSALLY_REPRODUCIBLE = "causally_reproducible" CAUSAL_BREAK = "causal_break" DETERMINISM_VIOLATION = "determinism_violation" DAG_DIVERGENT = "dag_divergent" class ReplayForensicError(RuntimeError): """Raised when a replay cannot be classified because the recording lacks the metadata required to compute the digest-sensitive frontier, or because the replay altered DAG shape in a way that makes the frontier undefined.""" @dataclass class NodeRecord: node_id: str declared: str # "deterministic" | "stochastic" parents: List[str] digest_sensitive: bool output_digest: Optional[str] = None @dataclass class ReplayNode: node_id: str parents: List[str] output_bytes: bytes output_digest: str def compute_frontier(records: Dict[str, NodeRecord]) -> Set[str]: """Nodes on or downstream of any digest_sensitive=true consumer.""" frontier: Set[str] = set() children: Dict[str, List[str]] = {nid: [] for nid in records} for nid, rec in records.items(): for p in rec.parents: if p not in records: raise ReplayForensicError( f"node {nid} references unknown parent {p}; " f"recording is unverifiable, not mismatched" ) children[p].append(nid) stack = [nid for nid, r in records.items() if r.digest_sensitive] while stack: nid = stack.pop() if nid in frontier: continue frontier.add(nid) stack.extend(children[nid]) return frontier def classify_replay( records: Dict[str, NodeRecord], replayed: Dict[str, ReplayNode], ) -> ReplayClassification: if set(records) != set(replayed): # DAG shape changed: frontier is undefined; do not report as break. return ReplayClassification.DAG_DIVERGENT for nid, rec in records.items(): if set(rec.parents) != set(replayed[nid].parents): return ReplayClassification.DAG_DIVERGENT frontier = compute_frontier(records) # Second pass must never run before this loop completes: evaluate the # frontier first, and never abort on an upstream stochastic divergence. for nid in frontier: rec = records[nid] rp = replayed[nid] if rec.output_digest is None: raise ReplayForensicError( f"frontier node {nid} has no recorded output_digest; " f"replay is unverifiable, not mismatched" ) if rec.output_digest != rp.output_digest: return ReplayClassification.CAUSAL_BREAK for nid, rec in records.items(): if rec.declared == "deterministic": if rec.output_digest is None: raise ReplayForensicError( f"deterministic node {nid} lacks output_digest" ) if rec.output_digest != replayed[nid].output_digest: return ReplayClassification.DETERMINISM_VIOLATION return ReplayClassification.CAUSALLY_REPRODUCIBLE def assert_replay_admissible( records: Dict[str, NodeRecord], replayed: Dict[str, ReplayNode], ) -> None: verdict = classify_replay(records, replayed) if verdict in ( ReplayClassification.CAUSAL_BREAK, ReplayClassification.DETERMINISM_VIOLATION, ReplayClassification.DAG_DIVERGENT, ): raise ReplayForensicError( f"replay not admissible as evidence: verdict={verdict.value}" ) ```