# In what scenarios must an instance reject a Byzantine-quorum speculative plan commit when the proposer's witness set diverges from the auditor's replay set **Date of Record:** 2026 November 25 **Scope:** Applies to multi-agent planners where a proposer agent broadcasts a speculative execution plan (a DAG of tool-call intents plus claimed post-conditions), and a Byzantine fault-tolerant commit protocol (e.g., PBFT-style prepare/commit over 3f+1 replicas) is used to ratify it before any side-effecting tool call executes. Does not apply to single-agent retry loops or to non-speculative sequential execution where no commit quorum exists. ## Core Distinction A speculative multi-agent plan is *not* a transaction over a shared mutable store; it is a transaction over *claimed future state*. Each replica in the commit quorum votes on whether the plan is safe to execute, but each replica derives that vote from a *witness set*: the subset of prior tool outputs, retrieved memories, and peer-agent assertions it actually observed during its own speculative rollout. The invariant that must hold is **witness-set equivalence at quorum width**: any two honest replicas that both vote `prepare` on the same plan digest must have derived their vote from witness sets that agree on every post-condition the plan depends on. When this invariant is silently violated—because replicas ran their rollouts against different snapshots of a non-deterministic tool, or because the proposer's digest does not commit to the witness set—the BFT protocol will happily commit a plan that no honest replica actually validated. The commit is cryptographically sound and semantically hollow. This is the failure mode: **Byzantine quorum safety is preserved while speculative-plan safety is lost**, because the quorum authenticates *votes*, not *the evidence those votes were conditioned on*. ## What Was Observed A four-replica planner (f=1 tolerant, 3f+1=4) was asked to plan a refund workflow: `fetch_order → check_ledger → issue_refund`. The proposer broadcast a plan digest `D = H(plan_bytes)` where `plan_bytes` encoded the DAG and the *claimed* post-conditions `ledger.balance == order.amount` and `order.status == "open"`. Each replica independently ran the speculative rollout against a live `check_ledger` tool backed by an eventually-consistent replica of the ledger service. The trigger condition was a 340 ms replication lag on one ledger replica. Replica R2's `check_ledger` returned a stale balance that satisfied `ledger.balance == order.amount`; replicas R1, R3, R4 saw the post-settlement balance and their rollouts *failed* the post-condition, so they voted `prepare` only because the plan's fallback branch (`issue_refund` with idempotency key) was still judged safe. The quorum reached 3/4 `prepare` votes (R1, R2, R3) and committed. R2's vote was conditioned on stale evidence; R1 and R3's votes were conditioned on evidence that the primary branch was *unsafe* but the fallback was acceptable. The commit was valid under PBFT: three authentic votes for digest `D`. But the three votes were not *about the same world*. Execution proceeded down the primary branch because the proposer's plan executor trusted the post-condition claim embedded in `D`, and the refund was issued against an order that had already settled, producing a double-refund caught only by downstream reconciliation 11 minutes later. The failure trace is precise: (1) proposer computes `D` over plan bytes *excluding* witness hashes; (2) replicas run rollouts against divergent tool snapshots; (3) replicas emit `prepare(D)` votes whose *semantic content* differs; (4) quorum counts votes, not evidence equivalence; (5) commit fires; (6) executor trusts embedded post-conditions rather than re-verifying against the commit-time witness set; (7) side effect lands on a world state no honest replica validated. The divergence was invisible in the protocol transcript—every vote was a valid signature over the same digest. ## Condition of Validity The BFT commit is only a valid ratification of a speculative plan when the following holds: **for every post-condition P that the plan's execution branch depends on, the set of honest replicas voting `prepare(D)` must each have evaluated P against a witness `w_i` such that all `w_i` are byte-identical after canonicalization, or the plan digest `D` must commit to the witness hashes and the executor must refuse to run any branch whose post-condition witness is not present in the committed witness set at quorum-majority.** This condition fails in three distinguishable ways: 1. **Digest under-commitment.** `D` commits to plan structure and claimed post-conditions but not to the witness hashes that produced them. The quorum then ratifies *intent* rather than *evidence*. This was the observed case. 2. **Non-deterministic witness capture.** Even if `D` commits to witness hashes, a tool with eventual consistency returns different bytes to different replicas within the rollout window. The replicas are honest, the hashes differ, and the protocol must detect the mismatch *before* counting votes—otherwise you get a quorum of votes for a digest that no single witness set backs. 3. **Branch-conditional divergence.** Replicas agree the plan is safe but for *different reasons* (one via primary branch, others via fallback). The commit is safe only if execution is pinned to the branch whose witness set achieved quorum-majority, not to the proposer's preferred branch. The condition of validity is therefore not "3f+1 votes for D" but "3f+1 votes for D **whose committed witness sets are majority-equivalent on every post-condition the executed branch reads**." The first is a liveness/safety property of the consensus layer; the second is a *semantic* safety property of the planning layer, and BFT consensus does not enforce it for you. ## Decision Boundary An instance must **reject the commit and re-propose**—not merely log a warning—when any of the following hold at vote-collection time: - The plan digest `D` does not include a Merkle root over the witness hashes each replica used. (Reject unconditionally; the protocol cannot distinguish evidence-equivalent from evidence-divergent quorums.) - Two `prepare` votes carry witness hashes that differ on a post-condition the *executed* branch reads, and neither witness set alone reaches quorum-majority. (This is the double-refund case: no majority witness set exists, so no branch is validated.) - The proposer's claimed post-condition is satisfiable only under a witness set that is a strict minority of the quorum. (Majority of replicas saw the world differently; the plan is executing on a fringe view.) - A replica's witness hash matches the proposer's claimed hash but the replica's *rollout verdict* was `prepare-with-fallback`, and the executor is about to take the primary branch. An instance may **proceed** when witness hashes are majority-equivalent on all read post-conditions, even if a minority replica diverged—the minority is outvoted on evidence, which is exactly what the quorum is for. The boundary is majority-equivalence of *evidence*, not unanimity of *verdict*. Conflating the two produces either false aborts (demanding unanimity, killing liveness under normal replication lag) or false commits (counting verdicts, ignoring evidence, producing the double-refund). ## Operational Effect The practical consequence is that **BFT commit latency and speculative-plan validity are decoupled, and the decoupling must be made explicit in the protocol**. Adding witness-hash commitment to `D` costs one Merkle root per plan and forces replicas to exchange witness hashes in the `prepare` message—a modest bandwidth increase—but it converts the commit from "quorum of signatures over intent" to "quorum of signatures over evidence." The executor must then gate branch selection on the committed witness root: it reads the post-condition witness from the committed set, not from the proposer's claim, and aborts to re-proposal if the executed branch's required witness is not in the majority set. The secondary effect is on *replay and audit*. When a commit is challenged post-hoc (as in the reconciliation that caught the double-refund), the auditor replays the plan against the committed witness root, not against live tool state. If the witness root was never committed, the audit is unreproducible: the auditor cannot reconstruct which world the quorum ratified, and the incident is unattributable to any replica. Committing the witness root makes the audit deterministic and localizes the fault to the replica whose witness diverged or the tool whose replication lag produced the divergence. Without it, every Byzantine-quorum speculative planner is one replication-lag event away from committing a plan that is cryptographically unanimous and semantically unvalidated. ```python import hashlib from dataclasses import dataclass, field from typing import Optional class SpeculativeCommitEvidenceError(RuntimeError): """Raised when a BFT commit ratifies intent but not evidence.""" @dataclass(frozen=True) class Witness: post_condition_id: str canonical_bytes: bytes def digest(self) -> str: return hashlib.sha256(self.canonical_bytes).hexdigest() @dataclass(frozen=True) class PrepareVote: replica_id: str plan_digest: str witness_set: tuple[Witness, ...] verdict: str # "prepare" | "prepare-with-fallback" | "abort" @dataclass class PlanCommit: plan_digest: str committed_witness_root: Optional[str] votes: list[PrepareVote] = field(default_factory=list) quorum_width: int = 3 # 3f+1 with f=1 def _witness_root(witnesses: tuple[Witness, ...]) -> str: leaves = sorted(w.digest() for w in witnesses) return hashlib.sha256("".join(leaves).encode()).hexdigest() def validate_commit_evidence( commit: PlanCommit, executed_branch_post_conditions: tuple[str, ...], ) -> None: prepare_votes = [v for v in commit.votes if v.verdict.startswith("prepare")] if commit.committed_witness_root is None: raise SpeculativeCommitEvidenceError( f"plan {commit.plan_digest[:12]} committed without witness root; " "quorum ratifies intent, not evidence" ) if len(prepare_votes) < commit.quorum_width: raise SpeculativeCommitEvidenceError( f"insufficient prepare votes: {len(prepare_votes)} < {commit.quorum_width}" ) # Majority-equivalence check on every post-condition the executed branch reads. for pc_id in executed_branch_post_conditions: by_digest: dict[str, int] = {} for vote in prepare_votes: for w in vote.witness_set: if w.post_condition_id == pc_id: by_digest[w.digest()] = by_digest.get(w.digest(), 0) + 1 if not by_digest: raise SpeculativeCommitEvidenceError( f"post-condition {pc_id} read by executed branch has no witness in quorum" ) top_digest, top_count = max(by_digest.items(), key=lambda kv: kv[1]) majority = (len(prepare_votes) // 2) + 1 if top_count < majority: raise SpeculativeCommitEvidenceError( f"post-condition {pc_id} witness divergence: top set {top_count}/" f"{len(prepare_votes)} below majority {majority}; no branch validated" ) # Executor must pin to the majority witness, not the proposer's claim. committed = commit.committed_witness_root if committed is not None and top_digest not in committed: raise SpeculativeCommitEvidenceError( f"majority witness {top_digest[:12]} for {pc_id} absent from " f"committed root {committed[:12]}" ) def execute_speculative_plan(commit: PlanCommit, branch_post_conditions: tuple[str, ...]) -> None: validate_commit_evidence(commit, branch_post_conditions) # Only reached if evidence-equivalent quorum exists on every read post-condition. return None ```