# Which invariants prevent quorum-certified plan replay from accepting a Byzantine proposer's divergent sub-plan under partial participant failure **Date of Record:** 2026 November 20 **Scope:** Applies to multi-agent systems where a proposer agent emits a speculative execution plan, worker/auditor agents independently verify sub-plans, and a quorum certificate (QC) gates commitment. Does not apply to single-agent tool loops or to Byzantine fault tolerance over opaque state-machine replication where the plan payload is not semantically re-executed by verifiers. ## Core Distinction The failure is not "a Byzantine agent lies." The failure is that *quorum certification of a plan hash* and *semantic agreement on plan execution* are two different invariants, and a system that conflates them will commit a divergent sub-plan whenever the Byzantine minority is positioned to make honest verifiers disagree about what "the plan" is — not about whether it is valid. Concretely: honest auditors each re-execute a sub-plan and vote on the *resulting post-state digest*. The proposer is Byzantine and emits a plan whose sub-plans are individually well-formed but whose *composition order* is ambiguous — e.g., two tool calls with no declared data dependency that nonetheless both mutate a shared scratch buffer. Depending on the verifier's local scheduling nondeterminism, re-execution yields digest `D₁` or `D₂`. Honest verifiers split roughly 50/50. With `f` Byzantine participants out of `3f+1`, the proposer only needs the honest split to be uneven by `f` to push a single digest over the `2f+1` quorum threshold. The QC forms, the plan commits, and the committed post-state is one that *no honest verifier can reproduce deterministically* — silently, because every honest verifier's vote was honest. ## What Was Observed A 4-node deployment (`f=1`, `n=4`, quorum `2f+1=3`). The Byzantine proposer emitted a plan with two `write_scratch` sub-plans and one `read_scratch` sub-plan, deliberately omitting the `depends_on` edge between the two writes. Re-execution order across honest verifiers was governed by wall-clock arrival of tool responses. Trace: 1. Proposer broadcasts `Plan{hash: H, subplans: [w1, w2, r]}` with no inter-write edge. 2. Honest verifiers A, B, C re-execute. A and B happen to observe `w1→w2→r`, digest `D₁`. C observes `w2→w1→r`, digest `D₂`. 3. Votes: `{A: D₁, B: D₁, C: D₂}`, proposer votes `D₁`. Quorum `2f+1=3` reached on `D₁`. 4. Plan commits with post-state `D₁`. Verifier C's independently derived `D₂` is treated as a *liveness* fault (C is "slow/divergent") and C is demoted from the auditor set on the next epoch. 5. The committed state is reproducible only by the subset that happened to schedule `w1` before `w2`. The system has committed a state whose determinism is a function of message-arrival timing, and it has *punished the only honest verifier that observed the ambiguity*. The key observation: no individual vote was dishonest, no signature was forged, and no hash collided. The invariant "a QC certifies that ≥2f+1 honest nodes agree on the post-state" was satisfied in letter and violated in spirit — the agreement was on a *sample* of a nondeterministic distribution, not on a deterministic function of the plan. ## Condition of Validity The quorum-certified-replay invariant holds only if the following holds *before* any vote is cast: > **Determinism-before-quorum:** For a plan `P`, define `exec(P, env)` for verifier-local environment `env` (scheduling, tool latency, cache state). The plan is *certifiable* iff `exec(P, env₁) = exec(P, env₂)` for all admissible `env₁, env₂` reachable by honest verifiers. A QC on `P` is sound only if `P` was certified as deterministic prior to vote collection. This is strictly stronger than "sub-plans are individually valid." Individual validity is a per-sub-plan predicate; determinism is a property of the *composition graph*, specifically of its declared dependency edges. A plan with `k` unordered mutating sub-plans has up to `k!` execution orders; the certifier must either prove all orders converge (commutativity) or force a total order via explicit edges. Absent this, the honest verifier set is not a deterministic function, and any quorum over it is a quorum over a random variable. The invariant is *invalidated* — not merely weakened — when the plan graph admits two or more topological orders that mutate shared state without a declared edge. Partial Byzantine failure is what makes this exploitable: with zero Byzantine participants, honest verifiers still disagree, but the disagreement is symmetric and no quorum forms, so the plan stalls (a liveness bug, visible). With `f≥1` Byzantine participants, the proposer can *steer* the split — by timing its own vote, by biasing tool-response latency toward a subset of verifiers, or by inserting a benign-looking `sleep` sub-plan that reshapes arrival order — so that one branch crosses quorum. The Byzantine participant converts a symmetric liveness bug into an asymmetric safety violation. ## Decision Boundary The boundary is not "how many Byzantine nodes can we tolerate" (`f` is given). It is: **at what point does the plan's dependency graph become under-specified relative to the state it mutates?** Operational decision rule: - If every pair of sub-plans that touch a common mutable resource has a declared edge (or a proven commutativity witness), the plan is certifiable and the standard `2f+1` quorum is sound. Proceed. - If any such pair lacks an edge and lacks a commutativity witness, the plan is **uncertifiable**. The correct action is to *reject before voting*, not to vote and hope the split is even. A verifier that votes on an uncertifiable plan has already lost the invariant, regardless of outcome. - A verifier that observes a digest inconsistent with its own re-execution must treat this as a *safety* signal (possible under-specification), not a *liveness* signal (slow peer). Demotion of the divergent verifier is the wrong response; it removes the witness. The subtle part: the boundary is invisible to any single verifier. Verifier C in the trace above cannot distinguish "I am the only one who saw `D₂` because the plan is ambiguous" from "I am the only one who saw `D₂` because I am faulty." This is why the check must be *structural* (graph analysis pre-vote) rather than *statistical* (digest agreement post-vote). Statistical checks are exactly what the Byzantine proposer games. ## Operational Effect Enforcing determinism-before-quorum changes three things: 1. **Vote semantics.** A vote becomes `sign(exec_digest) ∧ det_witness(P)`, where `det_witness` is a proof (edge set or commutativity certificate) that `P` is order-invariant. A vote without a witness is discarded, not counted. This closes the steering attack because the proposer cannot manufacture a witness for a genuinely ambiguous graph without also making the ambiguity explicit — at which point honest verifiers reject on structural grounds, symmetrically. 2. **Failure attribution.** Digest divergence on a witnessed-deterministic plan is now unambiguously a Byzantine or crash fault (the witness was a lie or a node is corrupt). Digest divergence on an unwitnessed plan is a *plan-construction* fault attributed to the proposer, not to the divergent verifier. The auditor set is no longer pruned for observing truth. 3. **Liveness cost.** Plans with genuine concurrency but no commutativity proof must be serialized by the proposer before certification, adding a round-trip. This is the price of soundness: the system trades proposer latency for the guarantee that a committed state is a deterministic function of the committed plan, not of message-arrival timing. In the trace above, the fix forces the proposer to either declare `w1→w2` or prove `w1 ∥ w2` commutes; either way, all four verifiers compute the same digest and the `2f+1` quorum becomes meaningful again. The invariant to carry forward: **a quorum certifies agreement only over a deterministic function; certify determinism of the composition graph before collecting votes, because partial Byzantine failure turns symmetric nondeterminism into asymmetric safety violation.** ```python from __future__ import annotations from dataclasses import dataclass, field from typing import Iterable class UncertifiablePlanError(RuntimeError): """Raised when a plan's composition graph is not order-invariant over shared mutable state, so no quorum over its execution digest is sound.""" @dataclass(frozen=True) class SubPlan: sid: str mutates: frozenset[str] = frozenset() reads: frozenset[str] = frozenset() @dataclass class Plan: subplans: list[SubPlan] edges: set[tuple[str, str]] = field(default_factory=set) # (before, after) commutativity_witness: set[frozenset[str]] = field(default_factory=set) def _touches_shared(a: SubPlan, b: SubPlan) -> bool: shared = (a.mutates & b.mutates) | (a.mutates & b.reads) | (b.mutates & a.reads) return bool(shared) def certify_determinism(plan: Plan) -> None: """Enforce determinism-before-quorum. Raises if any pair of sub-plans that touches shared mutable state lacks both a dependency edge and a commutativity witness. A vote cast on such a plan is unsound.""" by_id = {s.sid: s for s in plan.subplans} ordered = plan.edges | {(b, a) for (a, b) in plan.edges} for i, a in enumerate(plan.subplans): for b in plan.subplans[i + 1:]: if not _touches_shared(a, b): continue has_edge = (a.sid, b.sid) in ordered has_witness = frozenset({a.sid, b.sid}) in plan.commutativity_witness if not (has_edge or has_witness): raise UncertifiablePlanError( f"sub-plans {a.sid!r} and {b.sid!r} share mutable state " f"({sorted((a.mutates | b.mutates) & (a.reads | b.reads | a.mutates | b.mutates))}) " f"with no dependency edge and no commutativity witness; " f"execution order is nondeterministic and any QC over the " f"resulting digest is unsound under partial Byzantine failure." ) def collect_votes(plan: Plan, votes: Iterable[tuple[str, bytes]], quorum: int) -> bytes: """Gate vote collection on determinism certification. Votes on an uncertifiable plan are rejected structurally, before any quorum math.""" certify_determinism(plan) tally: dict[bytes, int] = {} for _voter, digest in votes: tally[digest] = tally.get(digest, 0) + 1 winner, count = max(tally.items(), key=lambda kv: kv[1]) if count < quorum: raise UncertifiablePlanError(f"no quorum: max {count} < required {quorum}") if len(tally) > 1: # With a determinism witness in hand, divergence is now a genuine # Byzantine/crash signal, not a plan-construction ambiguity. raise UncertifiablePlanError( f"digest divergence on witnessed-deterministic plan: {dict(tally)}" ) return winner ```