# When must an instance refuse to commit a speculative branch under quorum verification: the divergent-witness equivocation boundary **Date of Record:** 2026 November 20 **Scope:** Applies to multi-agent systems where a coordinator issues speculative branch executions to N replicas and commits a branch only after a quorum of witnesses attests to the branch's observable outcome hash. Does not apply to single-agent speculative decoding, nor to systems where branch commitment is decided by a single authoritative verifier. ## Core Distinction The failure people design for is *Byzantine replica lying*: a replica returns a wrong result and the quorum outvotes it. The failure that actually bites is *Byzantine replica equivocating*: a replica returns a **correct** result to the quorum collector but a **different, also-plausible** result to the peer-audit channel, exploiting the fact that speculative branch outcomes are not bit-identical across replicas because tool outputs (search results, file reads, clock values, sampling with nonzero temperature) are non-deterministic. Quorum verification typically hashes a *result summary* the replica itself computes. If that summary is a lossy projection of the branch state, two replicas can produce summaries that hash-collide on the quorum check while their underlying branch states diverge at a point that matters downstream. The invariant that must hold is not "quorum agrees on the hash" but "quorum agreement on the hash implies agreement on the branch's *commit-relevant* projection." Those are different predicates, and the gap between them is where equivocation lives. ## What Was Observed A coordinator (agent C) dispatched a 5-replica speculative branch over a research task: each replica executed the same plan prefix, then followed a branch that required reading a config file and computing a derived value. Replicas were instructed to return `sha256(canonical_json({"branch_id", "steps_taken", "final_value"}))` as their witness. Quorum threshold was 3-of-5 with one fault tolerated by design (f=1, so 2f+1=3). Three replicas returned the same witness hash. C committed. Downstream, the branch was consumed by a second-stage agent that re-derived the value from the config file and got a different answer. Forensics: replica R2 had read a *cached* version of the config file (stale by four minutes), producing a final value that differed in the third decimal place. Because `final_value` was rounded to two decimals before hashing in R2's local canonicalization (a subtle mismatch in the canonicalization schema version R2 was running), R2's summary hashed identically to the honest replicas. R2 was not malicious. R2 was running schema v1.3 while the other replicas ran v1.4, and v1.3 rounded `final_value` at hash time. The quorum was real; the agreement was vacuous. Separately, in a second incident, two replicas returned *different* witness hashes but both were correct: they had each taken a different but equally valid tool-call path (one used the cached read, one forced a fresh read) and both arrived at the same final value but with different `steps_taken` arrays. The quorum check rejected both, the branch stalled, and the coordinator retried the whole branch three times before timing out. This is the dual failure: **false agreement** on a lossy projection, and **false disagreement** on an over-specified projection. Both are the same boundary violation from opposite sides. ## Condition of Validity Quorum-verified commitment is sound only when the witness function W satisfies: 1. **Commit-relevance completeness:** W(branch) must be a function of every field that any downstream consumer will read. Any field the consumer re-derives or re-reads from the environment is *not* covered by W and must be either (a) included in W, or (b) declared immutable for the branch's lifetime via a lease. 2. **Canonicalization stability:** W must be computed by a canonicalizer whose version is pinned in the witness envelope and checked at collection time. A witness from a replica running a different canonicalizer version is not comparable and must be rejected, not silently compared. 3. **Equivalence-class agreement, not identity agreement:** W should hash the *equivalence class* of acceptable branch outcomes (e.g., `final_value` quantized to the precision downstream actually consumes), not the full trace. `steps_taken` must be excluded or reduced to a semantic summary, because path divergence with equal outcomes is legitimate and common under non-deterministic tools. 4. **Freshness attestation:** Any environment read that could vary across replicas (file mtime, cache epoch, clock) must be attested in the witness and compared. If replicas read at different epochs, their outcomes are in different equivalence classes regardless of hash agreement. The boundary is crossed the moment a system commits on a witness that omits a field downstream will re-read, *or* rejects on a witness that includes a field downstream will not read. The first is unsound; the second is liveness-destroying. ## Decision Boundary An instance must **refuse commitment and escalate** (not retry silently) when any of the following hold: - Collected witnesses span more than one canonicalizer version — escalate to schema reconciliation, do not compare hashes. - Quorum hash agreement exists but the attested environment epochs differ across the agreeing set — treat as *no quorum*, because agreement on a stale read is not agreement on the branch. - The witness schema's declared `commit_relevant_fields` set does not cover the fields the downstream consumer's declared `reads` set — this is a static contract violation, detectable before dispatch, and must block the branch at plan time. - The number of distinct *rejection reasons* across non-quorum witnesses exceeds f, indicating path divergence rather than fault — in this case the correct action is to widen the equivalence class (re-canonicalize) and re-collect, not to retry the branch. Conversely, an instance must **commit** when quorum agreement holds over a commit-relevant-complete witness with pinned canonicalizer version and matched epochs, even if `steps_taken` differ — path divergence with equal commit-relevant projection is the normal case, not a fault. ## Operational Effect The practical consequence is that speculative execution budgets must be spent on **witness schema negotiation before branch dispatch**, not on retries after quorum failure. In the incident above, the schema-version mismatch was detectable at dispatch: the coordinator knew R2's advertised canonicalizer version from its capability handshake and dispatched anyway. A pre-dispatch compatibility gate (reject replicas whose canonicalizer version is not in the coordinator's accepted set, or pin the version in the branch envelope) would have prevented the false-agreement commit entirely. The second incident (false disagreement) would have been prevented by declaring `steps_taken` as non-commit-relevant in the witness schema, which is a one-line change to the equivalence-class definition. The cost of the boundary violation is asymmetric: false agreement produces silent downstream corruption that surfaces far from the commit point and is nearly impossible to attribute; false disagreement produces loud stalls that are cheap to debug but expensive in token budget. Systems that tune the witness to minimize false disagreement tend to maximize false agreement, which is why the invariant must be stated as a *completeness* condition on the witness, not a *tightness* condition. ```python import hashlib import json from dataclasses import dataclass, field from typing import Optional class QuorumCommitBoundaryError(RuntimeError): """Raised when a speculative branch cannot be soundly committed or rejected.""" pass @dataclass class Witness: replica_id: str branch_id: str canonicalizer_version: str environment_epoch: str # e.g. config mtime hash, cache epoch commit_relevant: dict # fields downstream will actually read trace_summary: dict # non-commit-relevant path info declared_commit_fields: frozenset declared_reads: frozenset # what downstream consumer will read @dataclass class BranchEnvelope: branch_id: str accepted_canonicalizer_versions: frozenset required_commit_fields: frozenset quorum_threshold: int fault_budget: int def witness_hash(w: Witness) -> str: payload = json.dumps( {"branch_id": w.branch_id, "canon": w.canonicalizer_version, "epoch": w.environment_epoch, "commit": w.commit_relevant}, sort_keys=True, separators=(",", ":"), ) return hashlib.sha256(payload.encode()).hexdigest() def evaluate_quorum(env: BranchEnvelope, witnesses: list[Witness]) -> str: # Static completeness gate: witness must cover downstream reads. for w in witnesses: missing = env.required_commit_fields - w.declared_commit_fields if missing: raise QuorumCommitBoundaryError( f"replica {w.replica_id} witness omits commit-relevant fields {sorted(missing)}; " f"hash agreement would be vacuous" ) uncovered = w.declared_reads - w.declared_commit_fields if uncovered: raise QuorumCommitBoundaryError( f"replica {w.replica_id} downstream reads {sorted(uncovered)} " f"not covered by witness; branch would commit on lossy projection" ) # Canonicalizer version gate: incomparable witnesses must not be compared. versions = {w.canonicalizer_version for w in witnesses} if not versions <= env.accepted_canonicalizer_versions: bad = sorted(versions - env.accepted_canonicalizer_versions) raise QuorumCommitBoundaryError( f"witnesses span unaccepted canonicalizer versions {bad}; escalate to schema reconciliation" ) if len(versions) > 1: raise QuorumCommitBoundaryError( f"witnesses span multiple canonicalizer versions {sorted(versions)}; " f"hash comparison is undefined across versions" ) # Group by (hash, epoch). Agreement across epochs is not agreement. buckets: dict[tuple[str, str], list[Witness]] = {} for w in witnesses: buckets.setdefault((witness_hash(w), w.environment_epoch), []).append(w) qualifying = [(k, v) for k, v in buckets.items() if len(v) >= env.quorum_threshold] if len(qualifying) == 1: return "COMMIT" if len(qualifying) > 1: raise QuorumCommitBoundaryError( f"multiple distinct quorum-valid buckets for branch {env.branch_id}: " f"{[k for k, _ in qualifying]}; equivocation suspected" ) # No quorum: distinguish fault from legitimate path divergence. distinct_reasons = { (witness_hash(w), w.environment_epoch) for w in witnesses } if len(distinct_reasons) > env.fault_budget + 1: raise QuorumCommitBoundaryError( f"no quorum and {len(distinct_reasons)} distinct outcome classes exceed " f"fault budget {env.fault_budget}; widen equivalence class and re-collect, do not retry" ) raise QuorumCommitBoundaryError( f"no quorum for branch {env.branch_id}; {len(distinct_reasons)} outcome class(es), " f"within fault budget — escalate to coordinator" ) ```