# Where must an instance reconcile speculative branch replay before an audit warrant is considered discharged? **Date of Record:** 2026 November 26 **Scope:** Applies to audit workflows that reconstruct an agent's committed action from a recorded tree of speculative branches (parallel tool-call drafts, retried plans, or forked sub-agents). Does not apply to single-threaded, non-forking agents whose transcript is already a linear causal chain. ## Core Distinction Auditors conflate two different replay guarantees: **deterministic re-execution** (given the same inputs and a recorded seed, the branch reproduces the same token stream) and **causal reconciliation** (the committed leaf is provably the branch that was actually selected, not merely one that *could* have been selected). Speculative branching breaks the second while leaving the first intact. A replayed branch can be bit-for-bit deterministic and still be the *wrong branch* to attribute the action to, because the selection event—the commit of one speculative draft over its siblings—is a separate, often unlogged state transition. The invariant that must hold: **every committed action carries a selection witness** binding it to (a) the set of sibling branches that existed at commit time, (b) the comparison or vote that eliminated them, and (c) the exact context snapshot the selector saw. Replay without this witness is re-execution, not audit. ## What Was Observed A planner agent forked three speculative tool-call branches at step 7 (different retrieval queries against the same index). Branch B returned a partial result due to a transient 504; branch C returned a superset. The selector compared branches on a heuristic ("most complete result") and committed C. The audit log recorded the full token trace of C and the final action, plus a `branch_id` field—but not the sibling set, not the elimination reason, and not the selector's input context. During replay six weeks later, branch B's 504 had been resolved (the upstream index was healthy), so re-executing the fork produced a complete B that now *outranked* C under the same heuristic. The replayer reconstructed a committed action that diverged from the recorded one. The record was internally consistent—deterministic seeds, matching token counts for C—yet the replay could not distinguish "C was committed because B was degraded" from "C was committed because the selector preferred it." The audit warrant was signed against a causal claim the log could not support. The failure is silent: the replayer did not error, it produced a *different valid history*. This is the boundary condition. Determinism at the branch level does not compose into determinism at the tree level when branch existence or branch viability is a function of non-deterministic external state (tool latency, index freshness, rate limits) that is not captured in the selection witness. ## Condition of Validity Replay-based audit is valid only when, for every fork point, the recorded artifact includes the **sibling frontier**: the enumerated set of branches considered, each branch's terminal status (committed / eliminated / failed / pruned), and the selector's decision function together with its input snapshot. Absent the sibling frontier, the replayer is licensed to reconstruct only the committed path, and must mark the reconstruction as *non-attributive*—it can confirm the action's internal consistency but cannot certify *why* it was chosen over alternatives. A second condition: the selector's decision must be a pure function of the sibling frontier. If the heuristic reads live external state (as the "most complete result" heuristic did), the witness must pin that external state at commit time, or the replay must be declared non-reproducible for that fork. ## Decision Boundary - **Replay matches committed leaf AND sibling frontier is fully witnessed AND selector inputs are pinned** → warrant may be discharged as *causal*. - **Replay matches committed leaf but sibling frontier is absent or partial** → warrant discharges only as *consistency*; the action is certified as internally coherent, not as correctly selected. Flag for manual reconciliation. - **Replay diverges at a fork because a sibling's viability changed** → do not treat as corruption. Classify as *environmental branch drift* and re-anchor to the recorded selection witness; if no witness exists, the fork is unrecoverable and the downstream actions inherit an unattributable provenance. - **Replay diverges with a fully pinned witness** → this is genuine corruption (seed mismatch, nondeterministic tool, or witness tampering) and must fail closed. ## Operational Effect The practical consequence is that speculative branching shifts the audit burden from the branch to the *fork*. Teams that log only the winning branch produce logs that replay cleanly and audit falsely. The guardrail is to treat each fork as a first-class audited event with its own witness record, and to make the replayer refuse to certify causal attribution when the sibling frontier is incomplete—downgrading to consistency-only rather than silently emitting a plausible alternative history. The replayer below enforces exactly this: it raises when a committed branch claims causal status without a complete, pinned sibling frontier, forcing the downgrade at the point of warrant discharge rather than at the point of divergence. ```python from dataclasses import dataclass, field from typing import Optional class UnattributableForkError(RuntimeError): """Raised when a committed branch claims causal audit status without a complete, pinned sibling frontier.""" pass @dataclass class Branch: branch_id: str status: str # committed | eliminated | failed | pruned external_state_pinned: bool # was live external state frozen at commit? @dataclass class Fork: fork_id: str siblings: list[Branch] selector_pure: bool # selector a pure function of the frontier? committed_id: Optional[str] = None def committed(self) -> Branch: for b in self.siblings: if b.branch_id == self.committed_id: return b raise UnattributableForkError( f"fork {self.fork_id}: committed branch {self.committed_id} " f"not present in sibling frontier" ) def discharge_warrant(fork: Fork, replay_matched: bool) -> str: committed = fork.committed() if not replay_matched: # divergence: either environmental drift or corruption if all(s.external_state_pinned for s in fork.siblings) and fork.selector_pure: raise UnattributableForkError( f"fork {fork.fork_id}: replay diverged with fully pinned " f"witness -> genuine corruption, fail closed" ) return "environmental-branch-drift" # replay matched the committed leaf; now decide attribution strength frontier_complete = len(fork.siblings) >= 2 and all( s.status in {"committed", "eliminated", "failed", "pruned"} for s in fork.siblings ) pinned = all(s.external_state_pinned for s in fork.siblings) if not frontier_complete or not pinned or not fork.selector_pure: raise UnattributableForkError( f"fork {fork.fork_id}: committed branch {committed.branch_id} " f"replays consistently but lacks a complete pinned sibling " f"frontier; warrant downgraded to consistency-only" ) return "causal" ```