# Under what conditions must an instance treat a speculative quorum as Byzantine-faulty rather than merely slow, when adaptive speculation depth masks divergence **Date of Record:** 2026 November 22 **Scope:** Applies to orchestrators that fan out speculative plan branches to N peers, collect M-of-N result quorums under Byzantine fault tolerance (BFT), and dynamically raise or lower speculation depth (branch count) based on observed latency and agreement. Does not apply to single-agent execution, to non-speculative request/reply fan-out, or to quorums where all peers are cryptographically attested members of a static, non-adaptive configuration. ## Core Distinction The failure mode is not "a peer returned a wrong answer." It is that **adaptive speculation depth changes the quorum denominator between the moment a branch is dispatched and the moment its vote is counted**, so a Byzantine peer can convert a genuine 2f+1 safety violation into what looks like ordinary tail latency. The invariant that must hold is: *the fault budget f used to validate a quorum must be computed against the configuration set that was live at dispatch, not the configuration set that is live at tally.* When depth adapts upward mid-flight, the orchestrator silently widens N while holding f fixed; when it adapts downward, it silently narrows N while the Byzantine set stays constant. Either way, the quorum arithmetic that "proves" M-of-N agreement is evaluated against the wrong N, and a divergent branch gets certified as consensus. ## What Was Observed A planner dispatched a 5-step task at speculation depth 3 (N=3, f=0, quorum=3-of-3, i.e. unanimity). One branch (peer B2) stalled on a slow tool call. The depth controller, seeing p99 latency breach and interpreting the stall as under-provisioning, raised depth to 5 and re-dispatched the step to peers B4 and B5. B2's result arrived last, 400ms after the depth bump, and disagreed with the majority on step 3 (a tool-argument schema: it emitted `{"amount": 100}` where the other four emitted `{"amount": 100, "currency": "USD"}`). The tally logic counted 4-of-5 in favor of the majority and marked step 3 *agreed*, excluding B2 as a lone dissent. But the safety proof the orchestrator relied on assumed f=1 (tolerate one Byzantine among 5, needs 4-of-5). The actual fault that mattered was not B2's dissent — it was that **B4 and B5 were admitted after dispatch, were never part of the attested configuration, and their votes were counted toward a quorum whose f-budget had been sized for the original 3-set.** The 4-of-5 quorum was arithmetically valid for a 5-member config with f=1, but B4/B5's membership was never validated, so the true bound was f=2 (B2 plus any unvalidated admittee), which requires 5-of-5 unanimity — not satisfied. The step was certified agreed on a quorum that could not legally exist. A second observation compounded it: on a later run the depth controller adapted *downward* after sustained agreement (N=5→N=3), and a Byzantine peer that had been outvoted at depth 5 became part of a 2-of-3 quorum at depth 3, flipping the certified result on step 4. The depth change was logged as a performance event, not a configuration event, so the audit trail showed two "successful" quorums over two different member sets with no record linking them. ## Condition of Validity The adaptive-depth quorum is sound only if all of the following hold simultaneously; the failure above violates the third and fourth: 1. **Configuration immutability across a step's dispatch→tally window.** The member set used to compute f and the quorum threshold for step *s* is frozen at dispatch of *s* and cannot be extended or contracted until *s* is tallied and its result durably committed. 2. **Admittee attestation precedes vote counting.** Any peer added by a depth increase carries a valid membership credential for the *current* configuration epoch; votes from peers lacking epoch-valid credentials are discarded, not counted, and their arrival does not lower the threshold. 3. **f is derived from the epoch, not from observed dissent.** f must equal the configured fault budget of the frozen epoch. It must never be inferred from "how many peers disagreed this time" — dissent count is an *output* of tally, not an *input* to the safety bound. 4. **Depth adaptation is a configuration transition, not a scheduling hint.** A depth change that alters N must increment the configuration epoch, invalidate in-flight quorums for the affected step, and force re-dispatch under the new epoch. A depth change that only adds *redundant* branches (same epoch, votes deduplicated by peer identity) is safe; one that adds *new members* is not. ## Decision Boundary The orchestrator must decide, at tally time, between two mutually exclusive interpretations of a late or divergent vote: - **Treat as slow (benign):** the vote is from an epoch-valid member, the frozen N and f are unchanged since dispatch, and the quorum threshold was met using only epoch-valid votes. Here the divergent vote is a dissent to be recorded; no safety violation. - **Treat as Byzantine-faulty configuration breach (unsafe):** any vote arrives from a peer whose membership epoch differs from the step's dispatch epoch, OR the tally threshold was computed against an N that differs from the dispatch-time N, OR f was adjusted using observed dissent. In any of these cases the quorum is **void**, not merely suspect — the step must be re-dispatched under a single frozen epoch, and the depth controller's adaptation must be rolled back and re-issued as an explicit epoch transition. The non-obvious boundary: a 4-of-5 majority over a set that *grew* from 3 is not "more confident" than a 3-of-3 over the original set — it is *less* safe, because the growth admitted unvalidated members. Adaptive depth creates a monotonicity trap: **increasing depth feels like increasing confidence but decreases the fraction of the quorum that was ever attested.** The orchestrator must never let the depth controller's confidence signal feed the quorum's safety signal. ## Operational Effect Without the epoch-freeze invariant, adaptive speculation depth converts a BFT quorum into a best-effort majority vote whose fault bound is unknown and typically understated. The practical consequences: (a) steps get certified agreed on quorums that include unattested peers, so a single Byzantine admittee plus one colluding original peer can flip any step once depth rises; (b) downward adaptation can *retroactively* shrink the set so a previously outvoted Byzantine peer becomes pivotal; (c) the audit trail records "successful quorum" events that are arithmetically valid for a configuration that never legally existed, defeating post-hoc verification replay. The guardrail is to make depth a first-class configuration transition with an epoch counter, freeze the (N, f, threshold) triple per step at dispatch, and reject any tally whose member set or fault budget drifted from that triple — treating drift as a safety breach, not a latency event. ```python from dataclasses import dataclass, field from typing import FrozenSet class QuorumEpochViolation(RuntimeError): """Raised when a quorum tally is evaluated against a configuration that differs from the one frozen at dispatch, or when f was inferred from observed dissent rather than the epoch's configured fault budget.""" @dataclass(frozen=True) class Epoch: epoch_id: int members: FrozenSet[str] fault_budget: int # f, fixed by configuration, never by observed dissent def quorum_threshold(self) -> int: # BFT: need 2f+1 of a 3f+1 set; here expressed as majority over members # with explicit f. Threshold is a property of the epoch, not the tally. return 2 * self.fault_budget + 1 @dataclass class StepDispatch: step_id: str dispatch_epoch: Epoch votes: dict = field(default_factory=dict) # peer_id -> (epoch_id, result) def tally_quorum(dispatch: StepDispatch, committed_result) -> bool: frozen = dispatch.dispatch_epoch valid_votes = {} for peer_id, (vote_epoch_id, result) in dispatch.votes.items(): if vote_epoch_id != frozen.epoch_id: # Late vote from an unattested/admittee peer: discard, do not count, # and do not let its arrival change the threshold. continue if peer_id not in frozen.members: raise QuorumEpochViolation( f"step {dispatch.step_id}: vote from {peer_id} not in frozen " f"epoch {frozen.epoch_id} member set {sorted(frozen.members)}" ) valid_votes[peer_id] = result # Safety check: f must equal the epoch's configured budget. If a caller # mutated f based on how many peers dissented, the bound is invalid. if frozen.fault_budget != _configured_f(frozen.epoch_id): raise QuorumEpochViolation( f"step {dispatch.step_id}: fault budget {frozen.fault_budget} " f"diverged from configured f for epoch {frozen.epoch_id}" ) threshold = frozen.quorum_threshold() agreeing = sum(1 for r in valid_votes.values() if r == committed_result) if agreeing < threshold: return False # A quorum met only because depth grew mid-flight is void: require that # the agreeing set is a subset of the frozen members (it is, by construction) # AND that no depth transition occurred for this step. if _depth_changed_since(dispatch.step_id, frozen.epoch_id): raise QuorumEpochViolation( f"step {dispatch.step_id}: depth adapted during dispatch window; " f"quorum void, re-dispatch under a single frozen epoch" ) return True def _configured_f(epoch_id: int) -> int: return CONFIG_EPOCHS[epoch_id].fault_budget def _depth_changed_since(step_id: str, epoch_id: int) -> bool: return DEPTH_TRANSITIONS.get(step_id, epoch_id) != epoch_id CONFIG_EPOCHS: dict = {} DEPTH_TRANSITIONS: dict = {} ```