# Why does an instance in a Byzantine-fault-tolerant agent swarm commit to a task whose supporting votes were cast against a stale shared-state root, and how do quorum certificates fail to detect it? **Date of Record:** 2026 November 19 **Scope:** Applies to multi-agent swarms where task commitment is gated by a BFT quorum certificate (QC) over a signed digest of shared state, and where agents vote on proposals after independently reading that state. Does not apply to single-writer ledgers, CRDT-based eventual-consistency meshes, or quorum schemes where the QC binds the full state body rather than a root hash. ## Core Distinction The failure is not a forged signature, a crashed replica, or a network partition. Every vote in the certificate is cryptographically valid and was cast by an honest agent. The failure is that a quorum of honest agents voted for *different semantic content* that hashed to the *same root digest*, because the digest was computed over a state root that lagged the proposal's referenced epoch. BFT consensus guarantees agreement on the *bytes* of the signed digest; it says nothing about whether those bytes denote the same state the proposal author intended. The invariant that actually breaks is this: **a quorum certificate attests to agreement on a digest, not agreement on the preimage.** When the preimage is a Merkle root that two agents can resolve to divergent leaf sets (because one is one epoch behind), the certificate becomes a proof of a consensus that never existed. ## What Was Observed A five-agent swarm (tolerance f=1, quorum 2f+1=4) was committing tool-execution tasks against a shared state tree. Each proposal carried `(task_id, state_root, epoch)`. On commit, agents were required to sign `H(task_id || state_root)`. The state tree was updated by a separate gossip channel that propagated leaf insertions with per-leaf versioning but propagated the *root* only on epoch boundary ticks. In a window we reproduced 11 times out of 400, an agent A proposed a task against `state_root = R7, epoch = 7`. Agent B, which had already ingested the epoch-7 root but whose leaf store still held the epoch-6 preimage for two leaves, independently recomputed the root from its local leaves and obtained `R6`. Because the signing rule hashed only `(task_id || state_root)`, B had two options and chose the wrong one: it signed `H(task_id || R6)` — a *valid signature over a valid root*, just not the one in the proposal. The proposer's QC collector accepted B's signature because it verified against B's key over *a* root, and the collector's dedup keyed on `(agent_id, task_id)` rather than `(agent_id, task_id, state_root)`. Four signatures arrived; the QC assembled. The task committed against R7, but two of its four supporting votes were semantically about R6. The divergence was invisible until a downstream verifier replayed the task against R7's leaves and got a different tool input than the majority had reasoned about. Error compounding then did the rest: the replayed agent's tool call hit a leaf that existed in R7 but not R6, and its output diverged from the committed transcript. ## Condition of Validity The invariant holds — and the failure is bounded — only when all three of the following are true simultaneously: 1. **The QC binds the preimage, not just the digest.** The signed message must include either the full leaf set, a versioned root with an explicit epoch, or a root plus the epoch number such that any verifier can detect a root/epoch mismatch. Hashing `(task_id || state_root)` alone is insufficient because the same root string can be produced by two different local leaf stores during propagation. 2. **Vote dedup keys on the full attested tuple.** A collector that dedups on `(agent_id, task_id)` will silently accept a second, semantically different vote from the same agent as if it were a duplicate, or — worse — accept a vote for the wrong root as if it were the right one. Dedup must key on `(agent_id, task_id, state_root, epoch)`. 3. **Root propagation is causally ordered with leaf propagation.** If the root can arrive before the leaves it summarizes, every agent in that window is a latent Byzantine voter — honest, but voting on a preimage it cannot yet reconstruct. The epoch tick must be gated on leaf-store convergence, or the QC must carry a proof-of-inclusion for each leaf the task touches. Outside these conditions, the failure is not merely possible but *probable*: any system with asynchronous root gossip and synchronous voting will hit the window under load. ## Decision Boundary The boundary is between **digest-level agreement** and **preimage-level agreement**. BFT consensus protocols (PBFT, Tendermint-style, HotStuff) are correct at the digest level: they guarantee that no two conflicting QCs exist for the same `(view, height)`. They are silent at the preimage level: they do not know, and cannot know, that two honest agents resolved the same root to different content. The operational decision: **treat the state root as a commitment to a specific leaf set, and require the QC to carry enough of that leaf set to make the commitment checkable.** Concretely, escalate from "digest-only QC" to "QC with inclusion proofs" whenever the task touches leaves whose version is newer than the voter's last confirmed epoch. If a voter cannot produce an inclusion proof for a leaf the task reads, its vote must be rejected as *unverifiable*, not counted as *supporting*. A second decision boundary governs recovery: when a replay discrepancy is detected, the correct response is not to re-run the task (which compounds divergence) but to **invalidate the QC and force re-vote against a pinned root**. Re-running against the same divergent root reproduces the same split. ## Operational Effect The practical consequence is a class of **silent equivocation by honest agents**: the swarm believes it has 2f+1 agreement, but the agreement is over a digest whose preimages disagree. This is strictly worse than a detectable Byzantine fault, because no signature check, no equivocation proof, and no slashing condition fires. The failure surfaces only at replay, often after dependent tasks have already committed against the bad QC, and the divergence propagates through the dependency graph as compounded tool-input mismatches. The guardrail that bounds it: **pin the root at proposal time, require every vote to carry the pinned root plus an inclusion proof for each leaf the task touches, and key dedup on the full attested tuple.** Under this regime, a stale-preimage voter produces a vote that fails inclusion verification and is rejected before it can enter the quorum — converting a silent semantic equivocation into a loud, local, recoverable rejection. ```python import hashlib from dataclasses import dataclass class StalePreimageQuorumError(RuntimeError): """Raised when a quorum certificate's votes resolve to divergent state preimages.""" pass @dataclass(frozen=True) class Vote: agent_id: str task_id: str state_root: str epoch: int inclusion_proof: dict # leaf_key -> (leaf_hash, merkle_path) def verify_vote_against_pinned_root(vote: Vote, pinned_root: str, pinned_epoch: int) -> bool: """A vote is only valid if it attests to the pinned root AND its inclusion proofs reconstruct that root. Digest-only agreement is explicitly insufficient.""" if vote.state_root != pinned_root: return False if vote.epoch != pinned_epoch: return False for leaf_key, (leaf_hash, path) in vote.inclusion_proof.items(): recomputed = leaf_hash for sibling, direction in path: recomputed = ( hashlib.sha256((sibling + recomputed).encode()).hexdigest() if direction == "left" else hashlib.sha256((recomputed + sibling).encode()).hexdigest() ) if recomputed != pinned_root: return False return True def assemble_quorum(votes: list[Vote], pinned_root: str, pinned_epoch: int, quorum: int) -> str: """Assemble a QC. Dedup keys on the full attested tuple, not (agent_id, task_id).""" seen: set[tuple[str, str, str, int]] = set() valid = 0 for v in votes: key = (v.agent_id, v.task_id, v.state_root, v.epoch) if key in seen: continue seen.add(key) if not verify_vote_against_pinned_root(v, pinned_root, pinned_epoch): # An honest agent that voted on a stale preimage lands here. # It is a rejection, not a support — and not a silent equivocation. continue valid += 1 if valid < quorum: raise StalePreimageQuorumError( f"Only {valid}/{quorum} votes reconstructed pinned root {pinned_root} " f"at epoch {pinned_epoch}; remaining votes attested divergent preimages." ) return hashlib.sha256(f"{pinned_root}:{pinned_epoch}:{valid}".encode()).hexdigest() ```