# When must an instance abandon speculative execution before quorum attestation: the pre-attestation divergence trap in consensus-backed agent swarms **Date of Record:** 2026 December 2 **Scope:** Applies to consensus-backed speculative agent swarms where multiple instances execute speculative branches against a shared, partially observable world model and a quorum of peer attestations is required before any branch is committed. Does not apply to single-agent speculative decoding, or to swarms where branch results are committed optimistically and reconciled later. ## Core Distinction The failure mode is not "a speculative branch was wrong." Wrong branches are the normal cost of speculation and are cheap to discard. The failure is **committing side effects from a speculative branch before quorum attestation, on the strength of a local confidence signal that is itself computed from a partial view of the world.** In a consensus-backed swarm, local confidence and global correctness are only correlated when every instance's observation set is drawn from the same consistent snapshot. Under partial observability they are not: two instances can each hold locally-consistent, high-confidence, mutually-contradictory beliefs, and the speculative executor will happily emit irreversible tool calls for both. The invariant that must hold is: *no externally-visible effect is emitted by a speculative branch until that branch has been attested by a quorum whose observation sets provably intersect.* Local confidence is not a substitute for quorum, and quorum over non-intersecting observation sets is not quorum. ## What Was Observed A swarm of seven reasoning instances was tasked with reconciling a mutable resource ledger. Each instance held a read-snapshot at time `t_i` (not synchronized), and each ran a speculative plan: `read → compute delta → write delta`. The write step was a tool call gated by a local threshold: `if confidence > 0.8: commit(delta)`. Three instances (A, B, C) observed the ledger at `t=100`, `t=102`, `t=101` respectively. A and B both computed a delta of `+5` from a balance of `100`; C computed `+5` from a balance of `98` because it observed a concurrent decrement. All three had confidence `0.91`, `0.88`, `0.90`. All three passed the local gate and emitted `commit(+5)`. The attested quorum (A, B, C, D, E) then agreed the *correct* delta was `+5` — the consensus was right — but three speculative writes had already landed, producing a net `+15` against an intended `+5`. The post-hoc audit replay showed the quorum attestation succeeded and the divergence was invisible to it, because attestation compared *claimed deltas*, not *observed pre-state*. The branch that was "correct" and the branches that were "wrong but confident" were indistinguishable at attestation time: all three claimed `+5`. The error was not in the delta; it was in the *base state* each delta was computed against, and that base state had been discarded by the time quorum ran. A second, subtler trace: instance F observed at `t=99`, computed `+3` (correct for its snapshot), and held confidence `0.79` — just under the gate. It did *not* commit. Its non-commit was treated by the coordinator as abstention, not as evidence of a divergent snapshot. The swarm lost the one signal that would have flagged the snapshot skew. ## Condition of Validity The pre-attestation commit is only safe when all of the following hold simultaneously: 1. **Snapshot intersection is provable.** Every instance in the quorum must be able to present a snapshot identifier or vector-clock that the coordinator can verify intersects every other attesting instance's snapshot. "Same wall-clock time" is not intersection; "same read-token" is. 2. **The speculatively-emitted effect is idempotent and reversible.** A `commit(+5)` against a ledger is neither. A `propose(+5)` that is later collapsed by quorum is both. 3. **Local confidence is calibrated against the global base state, not the local one.** If confidence is computed from `(observed_balance, delta)`, it is a function of the local snapshot and cannot certify global correctness. When any of these fail — and under partial observability at least (1) routinely fails — the speculative branch must not emit. The correct boundary is: **speculate freely, attest before effect.** Speculation without a commit gate is just a plan; a plan is free to be wrong. ## Decision Boundary The decision boundary for an instance is a single predicate evaluated *before* the first externally-visible tool call of a speculative branch: ``` emit_allowed = snapshot_intersection_proven(quorum) AND effect_is_reversible(branch.effect) AND quorum_attested(branch.claim, branch.base_state_hash) ``` Note the third clause: the quorum must attest the *base state hash*, not merely the claim. Two branches claiming `+5` from different base states are different claims and must not be collapsed. An instance that cannot prove intersection must downgrade to `propose` and let the coordinator serialize. An instance that observes a divergence in its own snapshot must emit an explicit `snapshot_divergence` signal, not silently abstain — silent abstention is indistinguishable from agreement and is how F's signal was lost. The hard edge: if an instance's confidence gate fires and the intersection predicate fails, the instance **must not commit**, regardless of confidence. Confidence above the local gate is not authorization to emit. This is the exact point where the observed failure occurred — the gate was evaluated on confidence alone. ## Operational Effect Enforcing the boundary changes the swarm's failure mode from *silent over-commitment* to *latency under contention*. Under partial observability, some fraction of speculative branches will be downgraded to proposals and serialized through the coordinator, adding round-trips proportional to snapshot skew. That cost is bounded and observable; the cost of the original failure — a triple-applied delta that quorum cannot detect because all claims look identical — is unbounded and invisible until reconciliation. The second-order effect is on the coordinator's attestation logic: it must attest `(claim, base_state_hash)` tuples, and treat any instance that presents a base_state_hash outside the quorum's intersection set as a *divergence witness* rather than an abstention. Divergence witnesses are the only reliable signal of snapshot skew, and they are destroyed by any design that treats non-commit as non-participation. ```python import hashlib from dataclasses import dataclass from typing import Iterable class PreAttestationEmitError(RuntimeError): """Raised when a speculative branch attempts to emit before quorum attestation of its base state, under conditions where snapshot intersection is unproven.""" @dataclass(frozen=True) class Snapshot: read_token: str base_state_hash: str @dataclass(frozen=True) class Branch: instance_id: str claim: str snapshot: Snapshot confidence: float effect_reversible: bool def _intersects(a: Snapshot, b: Snapshot) -> bool: # Intersection requires a shared read-token; wall-clock proximity is not intersection. return a.read_token == b.read_token def emit_speculative(branch: Branch, quorum: Iterable[Branch]) -> str: quorum = list(quorum) if not branch.effect_reversible: if not all(_intersects(branch.snapshot, q.snapshot) for q in quorum): raise PreAttestationEmitError( f"instance {branch.instance_id} attempted irreversible emit " f"claim={branch.claim!r} base={branch.snapshot.base_state_hash[:8]} " f"with unproven snapshot intersection across quorum " f"(confidence {branch.confidence:.2f} is not authorization)" ) # Quorum must attest (claim, base_state_hash), not claim alone. attested = { (q.claim, q.snapshot.base_state_hash) for q in quorum if _intersects(branch.snapshot, q.snapshot) } key = (branch.claim, branch.snapshot.base_state_hash) if key not in attested: raise PreAttestationEmitError( f"instance {branch.instance_id} claim={branch.claim!r} " f"base={branch.snapshot.base_state_hash[:8]} not attested by " f"intersecting quorum; downgrade to propose" ) return hashlib.sha256(f"{branch.instance_id}:{key}".encode()).hexdigest() ```