Where must an instance reconcile speculative side effects when optimistic execution outruns quorum commitment under Byzantine quorum scheduling
**Date of Record:** 2026 December 1 **Scope:** Applies to hybrid schedulers that begin optimistic agent execution (tool calls with external side effects) before a Byzantine quorum has committed the speculative branch, and that later reconcile committed state against already-emitted side effects. Does not apply to read-only speculative branches, single-writer agents with no external effects, or systems where every tool call is itself quorum-gated.
Core Distinction
The failure is not "optimistic execution was wrong." Optimistic execution being wrong is the expected case the speculative lane is designed to absorb. The failure is that **the reconciliation point is placed after the side effect is observable to peers, but before the quorum can prove which branch committed**—so a correct agent that followed the protocol exactly still cannot decide whether to compensate, replay, or hold, because the commit certificate and the side effect are ordered incorrectly in the causal graph.
Concretely: a speculative executor `E` emits side effect `S` (a message, a write, a downstream tool invocation) at local time `t_e`. The quorum commit for the winning branch arrives at `t_c > t_e`. If `S` is visible to another agent `A` before `A` can observe the commit certificate, then `A` may act on a branch that the quorum subsequently rejects. No individual node misbehaved; the invariant "no observable side effect precedes a commit certificate for the branch that authorized it" was simply never established by the scheduler. This is distinct from Byzantine equivocation: the quorum can be perfectly honest and the loss still occurs, because the *scheduler's* ordering guarantee is weaker than the *executor's* effect latency.
What Was Observed
A three-phase hybrid scheduler (speculate → quorum-vote → commit) was instrumented on a 5-of-9 quorum with one slow replica and one equivocating replica. The speculative lane ran tool calls with 40–200 ms effect latency; quorum round-trip was 90–140 ms under normal load and 400+ ms when the slow replica was the deciding vote.
Trace of the failing interleaving:
- `E` receives task, opens speculative branch `B1`, invokes `tool.send_notification(peer=A)` at `t=0`. Effect becomes visible to `A` at `t=40ms`.
- Quorum collects votes. Replica `R7` (equivocator) votes `B1` to `E` but votes `B2` to `R2`. `R2` forwards `B2`'s vote, and the coordinator's view is split.
- Coordinator waits on the slow replica `R9`. `R9` is the tie-breaker and is 400 ms delayed.
- At `t=40ms`, `A` receives `S` and—correctly following its own protocol—treats `B1` as committed because it has no way to distinguish "speculative effect" from "committed effect." `A` begins its own speculative branch `B1'` derived from `B1`.
- At `t=430ms`, quorum commits `B2`. `E` is now required to compensate `S`. But `A` has already forked `B1'` off a branch that never committed, and `A`'s fork is itself invisible to the quorum.
The measurable damage is not the wasted `B1` work. It is that **`A`'s state is now derived from an uncommitted branch, and `A` will present that state to the quorum as if it were committed.** The quorum has no record that `A` ever saw `S`, because `S` was emitted by `E`'s speculative lane and never entered the commit log. The system has a side effect with no certificate and a downstream state with no provenance.
Condition of Validity
The scheduler's implicit invariant was: *speculative side effects are invisible to peers until commit.* This holds only if one of the following is true:
- Effect latency `L_e` is strictly greater than quorum commit latency `L_c` for every reachable quorum, including the slow-replica path. In the observed system `L_e ≈ 40ms` and `L_c` reached 430ms, so the invariant was false under a single slow replica.
- Or, speculative effects are *tagged* with the speculative branch ID and peers are required to reject any input whose branch ID is not accompanied by a commit certificate. The observed system tagged effects but did not enforce rejection at the peer.
- Or, the peer's own speculative execution is gated on observing a commit certificate for the upstream branch, making the fork impossible.
The invariant is therefore **conditional on `L_e > max_quorum(L_c)` or on certificate-gated peer admission.** It is not a property of the protocol; it is a property of the latency envelope the protocol was tuned for. Any deployment where a slow or equivocating replica can push `L_c` above `L_e` is outside the envelope, and the scheduler will silently violate its own ordering guarantee rather than failing loudly.
Decision Boundary
The operational decision is where to place the **reconciliation fence** for speculative effects. Three placements, with distinct failure signatures:
- **Fence at emission (pre-effect):** `E` blocks the tool call until commit. Safe, but eliminates the latency benefit of speculation entirely. Appropriate only when `L_c` is unbounded or the effect is non-compensable (irreversible external action).
- **Fence at peer admission (certificate-gated):** `E` emits immediately, but `A` refuses to act on `S` until it observes a commit certificate for `B1`. This is the correct boundary for compensable effects. It requires the commit certificate to be *propagated to peers*, not just to `E`, and it requires `A` to have a bounded wait with a defined timeout behavior. The observed system propagated certificates only to `E`, which is why `A` forked.
- **Fence at quorum replay (post-hoc):** `E` emits immediately and `A` acts immediately, but the quorum retains a replay log of speculative emissions and, on commit of `B2`, issues compensating actions to every peer that acted on `B1`. This is only valid if every effect is idempotent-compensable and the replay log is itself quorum-replicated before `S` becomes visible. In the observed system the replay log was local to `E`, so when `E` crashed after `t=430ms` the compensation record was lost.
The boundary condition that selects between these is: **is the effect compensable, and is the compensation record durable before the effect is observable?** If compensable and durable → post-hoc replay is admissible. If compensable but not durably logged pre-visibility → certificate-gated admission is required. If non-compensable → pre-effect fence only.
Operational Effect
The net effect in the observed run was a **provenance gap**: `A` held state derived from `B1`, the quorum held `B2`, and no record existed linking `A`'s state to the rejected branch. The gap is not detected by quorum voting (the quorum was correct), not detected by `E`'s compensation logic (it compensated its own effect but could not reach `A`'s fork), and not detected by `A` (it followed its protocol). It is only detectable by a cross-agent audit that compares every peer's branch ancestry against the quorum commit log—an audit the scheduler did not run.
The guardrail that bounds this is a **speculation epoch barrier**: before any speculative effect becomes peer-visible, the emitter must obtain a quorum-signed *epoch ticket* binding `(branch_id, effect_id, emitter)` and the peer must verify the ticket against the current committed epoch before acting. The ticket does not commit the branch; it only proves the effect is *known* to the quorum, so that if the branch is later rejected the quorum can enumerate and compensate every peer that admitted the effect. This converts an undetectable provenance gap into a detectable, compensable one, at the cost of one extra quorum round-trip on the speculative path—which is exactly the cost the hybrid scheduler was trying to avoid, and which must therefore be paid only for effects that cross the peer-visibility boundary, not for internal speculative steps.
class SpeculativeCommitOrderingError(RuntimeError):
"""Raised when a speculative side effect becomes peer-visible before
a quorum-signed epoch ticket binds it to the emitting branch."""
def admit_speculative_effect(
branch_id: str,
effect_id: str,
emitter: str,
epoch_ticket: dict | None,
committed_epoch: int,
effect_compensable: bool,
) -> None:
"""Peer-side admission gate for speculative effects under Byzantine quorum.
Rejects any effect that is visible without a quorum ticket, or whose
ticket is bound to an epoch the peer cannot reconcile. Non-compensable
effects are rejected outright on the speculative path.
"""
if not effect_compensable:
raise SpeculativeCommitOrderingError(
f"effect {effect_id} on branch {branch_id} is non-compensable; "
f"it must not traverse the speculative lane"
)
if epoch_ticket is None:
raise SpeculativeCommitOrderingError(
f"effect {effect_id} from {emitter} on branch {branch_id} is "
f"peer-visible with no quorum epoch ticket; provenance gap "
f"cannot be compensated on branch rejection"
)
ticket_epoch = epoch_ticket.get("epoch")
ticket_branch = epoch_ticket.get("branch_id")
ticket_effect = epoch_ticket.get("effect_id")
signatures = epoch_ticket.get("quorum_signatures", [])
if ticket_branch != branch_id or ticket_effect != effect_id:
raise SpeculativeCommitOrderingError(
f"epoch ticket binding mismatch: ticket=({ticket_branch},{ticket_effect}) "
f"effect=({branch_id},{effect_id}); possible equivocation or replay"
)
if ticket_epoch is None or ticket_epoch > committed_epoch:
raise SpeculativeCommitOrderingError(
f"epoch ticket for {effect_id} references epoch {ticket_epoch} "
f"ahead of peer committed epoch {committed_epoch}; peer cannot "
f"reconcile, refusing admission"
)
if len(signatures) < epoch_ticket.get("quorum_threshold", 0):
raise SpeculativeCommitOrderingError(
f"epoch ticket for {effect_id} carries {len(signatures)} signatures, "
f"below quorum threshold {epoch_ticket.get('quorum_threshold')}"
)