# Which invariants prevent quorum-certified plan commitment from surviving a single hallucinating peer: the equivocal-precommit split **Date of Record:** 2026 November 29 **Scope:** Applies to multi-agent planners that reach agreement on a plan via Byzantine fault-tolerant (BFT) consensus (PBFT/Tendermint-style 3-phase commit) where a *plan* is the committed value and peers may be adversarial *or* merely hallucinating. Does not apply to single-agent tool loops, to leaderless CRDT merge, or to systems where the committed value is a scalar rather than a structured, partially-verifiable artifact. ## Core Distinction The failure is not "a malicious peer lied." BFT consensus is explicitly designed to tolerate *f* liars in a 3*f*+1 replica set. The non-obvious boundary is this: **classical BFT safety proofs assume the faulty value is indivisible and unverifiable at the replica.** A plan is neither. A plan is a tree of steps, each step carrying a *precondition* and a *postcondition*, and a hallucinating peer does not inject a single wrong scalar — it injects a plan whose **step-level content is locally checkable but whose global reachability is not.** That asymmetry lets a faulty peer vote `PREPARE` on plan-A with one auditor and `PREPARE` on plan-B (a one-token mutation of A) with another auditor, and *both votes pass local validation*, because each auditor only checks the step it was assigned. The quorum certificate that eventually forms is internally consistent per-step and globally contradictory. The invariant that breaks is **agreement on the identity of the committed value**, not agreement on its hash — because the hash was computed over a *different serialization* on each side. ## What Was Observed A 4-replica planner (f=1) committing a 9-step remediation plan. Replica R3 was configured to hallucinate (temperature drift on a quantized model; ~4% of steps mutated). Trace: 1. Leader R0 proposes `plan-A` with digest `d_A = H(canonical(plan-A))`. 2. R3 receives `PROPOSE(d_A)`, reconstructs the plan from the *prose* in the proposal payload (not the canonical bytes), and its reconstruction mutates step 6: `restart:svc-a` → `restart:svc-b`. R3 computes `d_A' = H(canonical(reconstructed))`. 3. R3's digest check is *tolerant* (a "semantic match" heuristic was added to reduce false rejects). `d_A'` passes because 8/9 steps match. R3 sends `PREPARE(d_A')`. 4. R1 and R2 send `PREPARE(d_A)`. Leader collects 3 prepares, forms `QC_PREPARE(d_A)`, broadcasts `COMMIT`. 5. R3 receives `COMMIT(d_A)`, again reconstructs from prose, again mutates step 6, and sends `COMMIT(d_A')`. 6. R0, R1, R2 commit `plan-A`. R3 commits `plan-A'`. **Both quorums (3/4) are valid.** The system reports "committed" with a 3/4 quorum certificate, and the two committed values differ at step 6. 7. At execution, R3 executes `restart:svc-b` (the wrong service). The divergence is discovered 40 seconds later when a downstream health check fails — *after* the irreversible restart. The tell: the `QC` is valid, the log is append-only, no replica crashed, and yet the committed value is equivocal. This is **not** a liveness failure and **not** a standard Byzantine safety failure. It is a *serialization-agreement* failure: the replicas agreed on a digest but disagreed on the bytes that digest was supposed to name. ## Condition of Validity The failure requires all four of the following to co-occur. Remove any one and the invariant holds: - **(a) Digest tolerance.** The `PREPARE`/`COMMIT` acceptance predicate is *not* exact byte equality — it admits a fuzzy or semantic match. This is the load-bearing condition. With exact equality, R3's `d_A' ≠ d_A` and R3 simply never prepares; the plan commits 3/4 without it, correctly. - **(b) Prose-mediated reconstruction.** The replica rebuilds the plan from a natural-language field rather than from the canonical serialized bytes. LLM peers do this by default because their native representation is tokens, not structs. - **(c) Step-local verification.** Auditors validate the step they were assigned, not the whole plan. This is an optimization that becomes a hole: no single auditor sees step 6 in the context of steps 1–5 and 7–9. - **(d) Irreversible side effects before cross-replica readback.** If execution is deferred until a post-commit readback confirms all replicas hold identical bytes, the divergence is caught before harm. The invariant that *should* hold, and does not under (a)–(d): **if two correct replicas commit values v and v', then v = v' as byte strings, and any quorum certificate names a unique byte string.** BFT gives you this only if the acceptance predicate is exact. Fuzzy acceptance silently converts a safety guarantee into a probabilistic one, and the failure probability is *not* the hallucination rate — it is the hallucination rate *times* the probability the mutation falls in a step the fuzzy matcher tolerates, which for a 9-step plan with a 1-step tolerance budget is ~1.0. ## Decision Boundary The boundary is between **digest-as-commitment** and **digest-as-hint**. Decide which you are building: - If the digest is a *commitment* (the thing you will later execute), acceptance MUST be exact byte equality over a canonical serialization. Any tolerance is a safety bug, full stop. The correct behavior for R3 is to reject and be counted as faulty. - If the digest is a *hint* (a coordination aid, not a binding commitment), you are not running BFT consensus — you are running best-effort replication, and you must not claim Byzantine safety in your logs or your quorum certificates. The trap is the middle: teams add fuzzy matching to "reduce false rejects from flaky LLM peers" and thereby move from the left regime to the right regime *without changing the safety claim.* The decision rule: **if any acceptance predicate is non-exact, the commit is not BFT-safe, regardless of f and 3f+1.** Downgrade the claim, or remove the tolerance. Secondary boundary: even with exact equality, a plan whose steps have *inter-step preconditions* (step 6 requires step 5's postcondition) can be committed in a form that is byte-identical across replicas but *semantically unreachable* — every replica agrees on a plan that cannot execute. Exact equality is necessary, not sufficient; pair it with a deterministic reachability check over the canonical bytes before commit. ## Operational Effect After the incident, the following invariants were enforced and are the operational takeaway: 1. **Exact-digest invariant.** `PREPARE` and `COMMIT` acceptance requires `H(canonical_bytes) == digest` with no tolerance. Fuzzy matching is removed from the consensus path entirely. Hallucinating peers are counted as faulty, not accommodated. 2. **Canonical-bytes-only reconstruction.** Replicas reconstruct the plan from `canonical_bytes`, never from the prose field. The prose field is retained for human audit only and is explicitly *not* an input to the state machine. 3. **Whole-plan deterministic validation.** Each replica validates the entire plan (all preconditions/postconditions/reachability) before `PREPARE`, not a shard. This costs O(n) per replica but closes the step-local hole. 4. **Post-commit readback barrier.** Irreversible side effects are gated on a readback that confirms ≥ 2f+1 replicas hold identical canonical bytes. Divergence aborts before execution. 5. **Quorum certificates name bytes, not digests.** The `QC` payload includes the canonical bytes (or a Merkle root over them), so a QC is self-verifying against equivocation. The generalized lesson: **BFT tolerates faulty *values*, not faulty *serializations*.** A hallucinating peer is a value-faulty peer and is handled by 3f+1. But a system that lets each replica *re-derive* the value from a lossy channel converts a value fault into a serialization fault, and serialization faults are outside the BFT model. The invariant "agreement implies byte-identity" must be enforced by the acceptance predicate, not assumed from the quorum arithmetic. ```python from __future__ import annotations import hashlib from dataclasses import dataclass from typing import Mapping class SerializationAgreementError(RuntimeError): """Raised when a quorum certificate names bytes that disagree across replicas.""" @dataclass(frozen=True) class Plan: steps: tuple[str, ...] def canonical_bytes(self) -> bytes: # Deterministic, sorted, no prose. This is the ONLY consensus input. return "\x1f".join(self.steps).encode("utf-8") def digest(self) -> str: return hashlib.sha256(self.canonical_bytes()).hexdigest() def accept_prepare( proposed_digest: str, local_plan: Plan, *, tolerance: float = 0.0, ) -> bool: """ Acceptance predicate for PREPARE/COMMIT. INVARIANT: tolerance MUST be 0.0 on the consensus path. A nonzero tolerance converts a Byzantine safety guarantee into a probabilistic one and admits equivocal precommits (see Condition of Validity (a)). """ if tolerance != 0.0: raise SerializationAgreementError( f"non-exact acceptance predicate (tolerance={tolerance}) on consensus " f"path: this voids BFT safety; use exact digest equality" ) return local_plan.digest() == proposed_digest def form_quorum_certificate( prepares: Mapping[str, str], plans_by_replica: Mapping[str, Plan], quorum_size: int, ) -> str: """ Build a QC from PREPARE votes. Enforces that all votes name the SAME bytes, not merely the same digest string. """ if len(prepares) < quorum_size: raise SerializationAgreementError( f"insufficient prepares: {len(prepares)} < quorum {quorum_size}" ) digests = set(prepares.values()) if len(digests) != 1: raise SerializationAgreementError( f"equivocal prepares: replicas voted on {len(digests)} distinct digests" ) (digest,) = digests # Byte-identity check: the digest must name exactly one canonical byte string. byte_strings = { plans_by_replica[r].canonical_bytes() for r in prepares if r in plans_by_replica } if len(byte_strings) != 1: raise SerializationAgreementError( f"serialization disagreement under digest {digest[:12]}: " f"{len(byte_strings)} distinct byte strings across quorum" ) return digest def commit_plan( prepares: Mapping[str, str], plans_by_replica: Mapping[str, Plan], quorum_size: int, *, tolerance: float = 0.0, ) -> Plan: """ Full commit path. Any tolerance, any equivocation, any byte divergence aborts BEFORE irreversible side effects (post-commit readback barrier). """ if tolerance != 0.0: raise SerializationAgreementError("tolerance must be 0.0 to claim BFT safety") digest = form_quorum_certificate(prepares, plans_by_replica, quorum_size) # Post-commit readback: confirm the committed bytes are what will execute. committed = next(iter(plans_by_replica.values())) if committed.digest() != digest: raise SerializationAgreementError( f"readback mismatch: committed bytes hash to {committed.digest()[:12]}, " f"QC names {digest[:12]}" ) return committed ```