# Which invariants prevent speculative quorum commit under equivocating agents in partially synchronous swarms **Date of Record:** 2026 December 2 **Scope:** Applies to multi-agent swarms where N≥3f+1 agents speculatively execute and cast votes on a shared state transition, and where a designated auditor set performs per-agent equivocation detection before a quorum commit is finalized. Does not apply to single-agent tool loops, to fully synchronous closed-world pipelines, or to quorums where every vote is cryptographically signed and verified inline by the committing coordinator. ## Core Distinction The failure mode this record isolates is *speculative commit under partial synchrony with equivocation-aware auditors*. In a partially synchronous model, message delivery is guaranteed after an unknown Global Stabilization Time (GST), but before GST an agent may legitimately receive a different view of peer votes than another agent. Speculative execution lets agents act on a *provisional* quorum before finality is confirmed, which is the whole point of the optimization. The non-obvious boundary is this: **equivocation detection is a per-agent, per-vote predicate, but quorum formation is a set-level predicate, and the two do not compose monotonically.** An auditor that correctly flags agent A as equivocating (A signed two conflicting votes for the same round) may still have already contributed to a provisional quorum that B observed and committed against. The invariant that prevents this is not "detect equivocation" — it is "no provisional quorum is *durably* observable to any agent until the equivocation set for that quorum's membership is monotone-closed." Detecting the equivocation after the fact is worthless if the speculative commit already propagated to a downstream agent that cannot roll back. Concretely: equivocation detection is *local and lagging*; speculative quorum observation is *distributed and leading*. Any system that commits on provisional quorums without enforcing a monotone-closure barrier on the equivocation set will eventually fork its own state — not because detection failed, but because detection succeeded *too late relative to an observer that was already allowed to act*. ## What Was Observed A 5-agent swarm (f=1, so quorum = 4) running a speculative consensus loop over a shared episodic memory store. Each round, agents propose a memory mutation, vote, and a designated auditor set (2 of the 5, rotating) checks each vote for equivocation by comparing the vote's signed round number and payload hash against any prior vote from the same agent in the same round. The trace that broke: - Round 47, pre-GST. Agent A sends vote `v_A1 = (round=47, payload=H1)` to agents B and C, and `v_A2 = (round=47, payload=H2)` to agents D and E. Both are validly signed. A is equivocating. - B receives `v_A1`, plus votes from B, C, D → B counts 4 votes for H1 (A, B, C, D). B's provisional quorum for H1 is satisfied. B speculatively commits H1 to its local memory and — critically — *emits a downstream tool call* that reads the committed memory and writes a derived fact to a shared external store. - D receives `v_A2`, plus votes from D, E, B → D counts 4 votes for H2 (A, D, E, B). D's provisional quorum for H2 is satisfied. D speculatively commits H2 and emits a *conflicting* downstream tool call. - The auditors (C and E) each see only one of A's votes. C sees `v_A1`; E sees `v_A2`. Neither auditor can flag equivocation, because equivocation is only detectable by an agent that sees *both* signed votes. The auditor set is partitioned by the same partial synchrony that partitioned the vote delivery. - Post-GST, C and E exchange audit reports and *both* flag A. The equivocation is correctly detected at round 47 + Δ. But B and D have already committed and already fired side-effecting tool calls. The detection is post-hoc and the state is forked. The failure is not that equivocation went undetected. It is that the *commit path did not depend on the detection path*. Speculative commit was gated on a 4-of-5 vote count, but the equivocation set for those 4 voters was not required to be closed before the commit became observable outside the agent's own volatile state. ## Condition of Validity The invariant holds — and speculative commit is safe — only when all three of the following are true simultaneously: 1. **Monotone-closure barrier on the equivocation set.** A provisional quorum Q may be *observed* (used to drive further reasoning) but may not be *externalized* (drive side-effecting tool calls, writes to shared stores, or votes in a dependent round) until every member of Q has been audited against every other member's view of that round. This requires the auditor set to be a *quorum-intersecting* set: any two auditors' views must overlap on at least one honest agent, so that the union of their audit reports eventually covers all equivocation. With 2 rotating auditors out of 5, this fails — the two auditors can be partitioned to disjoint views. The barrier requires auditor sets of size ≥ f+1 with guaranteed intersection, not arbitrary rotation. 2. **Bounded speculation depth.** An agent may hold at most one un-closed speculative commit at a time. If B commits H1 speculatively and then receives evidence that H1's quorum is not closed, B must be able to *retract* before any dependent action. If B has already chained a second speculative round on top of H1 (round 48 proposing a mutation of H1), retraction requires unwinding the chain. The invariant is depth-1 speculation: no speculative commit may be a *premise* for another speculative commit until the first is closure-confirmed. 3. **GST-relative commit gating.** Pre-GST, provisional quorums are advisory only. The system may *prepare* on them but must not *externalize* until either (a) the equivocation set is closed, or (b) GST has passed and a synchronous confirmation round has run. The subtlety: agents cannot know when GST has passed, so the gate must be "closure OR timeout-with-reconfirmation," and the timeout must be long enough that a partitioned auditor pair has had a chance to exchange reports. A timeout that fires before auditor reports converge is a *false closure* — the worst outcome, because it looks like success. The invariant fails silently when any one of these is relaxed, and it fails *most* dangerously when (1) is relaxed but (2) and (3) appear to hold, because the system looks correct in the common case (no equivocation) and only forks under adversarial partition — exactly the condition partial synchrony is designed to model. ## Decision Boundary The operational decision is: *when may a speculative commit be externalized?* The boundary is sharp and must be encoded as a hard gate, not a heuristic: - **Externalize** a speculative commit only if: the quorum's membership has a closed equivocation audit (all pairs of auditors' views unioned and checked), AND speculation depth is 1, AND (GST-confirmed OR closure-confirmed). - **Hold** (observe internally, do not externalize) if: quorum is satisfied but equivocation set is not closed. This is the correct state for B in the trace above — B should have *known* H1 but not *acted* on it. - **Retract** if: an equivocation is detected in the quorum's membership after a hold. Retraction is only possible if no externalization occurred; if externalization occurred, the system is in a forked state and must escalate to a reconciliation protocol (out of scope here, but the point is it should be unreachable). The boundary is *not* "commit when 4-of-5 votes agree." That is the quorum predicate, and it is necessary but not sufficient. The sufficient predicate adds the equivocation-closure conjunct. Systems that conflate the two — treating quorum satisfaction as commit authorization — are the ones that fork. ## Operational Effect Enforcing the invariant changes the latency and failure profile in three concrete ways: 1. **Speculative commit latency increases by one auditor-exchange round.** The optimization is no longer "commit before finality" but "commit before finality *minus* one audit round." This is the price of closure. In practice the audit round is cheap (two signed messages exchanged between auditors), but it is *not zero*, and it must be on the critical path of externalization, not off it. 2. **Auditor set design becomes a quorum-intersection problem, not a rotation problem.** The 2-of-5 rotation in the trace is unsafe because it permits disjoint auditor views. The fix is auditor sets of size ≥ f+1 = 2 with *guaranteed intersection* — which for f=1 means both auditors must be drawn from a set that any two such sets intersect, i.e., the auditor set must itself be a quorum-intersecting family. In a 5-agent swarm, that means the auditor set cannot be a free rotation; it must be constrained so that any two audit rounds share at least one honest auditor, or the audit must be a *full* broadcast to all agents (O(N²) messages, but closure is then trivially guaranteed). 3. **Forked state becomes unreachable, at the cost of a hold state.** Agents will spend time in the "quorum satisfied, equivocation not closed" hold state. This state must be *explicitly modeled* in the agent's state machine — not as an error, but as a legitimate transient. Agents that treat "quorum satisfied but not externalized" as a bug will either externalize prematurely (reintroducing the fork) or deadlock (treating hold as failure). The correct behavior is to hold, continue internal reasoning on the provisional state, and await closure or GST-confirmation. The invariant is: **quorum satisfaction is necessary but not sufficient for externalization; equivocation-closure over the quorum's membership is the missing conjunct, and it must be a monotone-closed, quorum-intersecting, depth-1-gated predicate on the commit path.** Detection without closure-gating is theater. ```python from dataclasses import dataclass, field from typing import FrozenSet, Dict, Optional class SpeculativeCommitViolation(RuntimeError): """Raised when a speculative commit is externalized before its equivocation set is monotone-closed, violating the closure invariant.""" pass @dataclass(frozen=True) class Vote: agent_id: str round_no: int payload_hash: str signature: str @dataclass class Quorum: round_no: int payload_hash: str members: FrozenSet[str] equivocation_closed: bool = False speculation_depth: int = 0 externalized: bool = False class SpeculativeConsensusGate: def __init__(self, quorum_size: int, auditor_intersection_guaranteed: bool): self.quorum_size = quorum_size self.auditor_intersection_guaranteed = auditor_intersection_guaranteed self._votes: Dict[int, Dict[str, list[Vote]]] = {} self._audit_reports: Dict[int, list[FrozenSet[str]]] = {} def record_vote(self, v: Vote) -> None: self._votes.setdefault(v.round_no, {}).setdefault(v.agent_id, []).append(v) def record_audit(self, round_no: int, equivocators: FrozenSet[str]) -> None: self._audit_reports.setdefault(round_no, []).append(equivocators) def equivocation_closed(self, round_no: int, members: FrozenSet[str]) -> bool: # Closure requires the union of auditor views to cover every member # AND the auditor family to be quorum-intersecting. Without intersection # guarantee, closure is unprovable even if reports look complete. if not self.auditor_intersection_guaranteed: return False reports = self._audit_reports.get(round_no, []) if not reports: return False covered = frozenset().union(*reports) # every member must have been audited by at least one report whose # view intersected another auditor's view return members.issubset(covered) and len(reports) >= 2 def try_externalize(self, q: Quorum, gst_confirmed: bool) -> None: if q.speculation_depth > 1: raise SpeculativeCommitViolation( f"round {q.round_no}: speculation depth {q.speculation_depth} " f"exceeds depth-1 invariant; cannot externalize chained " f"speculative commits" ) closed = self.equivocation_closed(q.round_no, q.members) if not closed and not gst_confirmed: raise SpeculativeCommitViolation( f"round {q.round_no}: quorum satisfied but equivocation set " f"not monotone-closed and GST not confirmed; externalization " f"would permit forked state under partition" ) if closed and self._has_equivocator(q.round_no, q.members): raise SpeculativeCommitViolation( f"round {q.round_no}: equivocation detected in quorum " f"membership after closure; commit must retract, not externalize" ) q.equivocation_closed = closed q.externalized = True def _has_equivocator(self, round_no: int, members: FrozenSet[str]) -> bool: for agent_id in members: votes = self._votes.get(round_no, {}).get(agent_id, []) hashes = {v.payload_hash for v in votes} if len(hashes) > 1: return True return False ```