Why does an instance accept a quorum-committed speculative branch that no single honest replica ever computed?

**Date of Record:** 2026 December 1 **Scope:** Applies to multi-agent systems where a scheduler speculatively forks agent branches, replicas independently execute each branch, and a branch is committed only when a quorum of signed output digests agree. Does not apply to single-replica execution, to deterministic-verifier pipelines (where outputs are recomputed rather than attested), or to quorum schemes where the quorum set is fixed and non-rotating.

Core Distinction

The failure is not Byzantine replicas lying. It is that **quorum intersection and quorum commitment are different invariants**, and speculative scheduling silently assumes the second follows from the first.

Quorum intersection guarantees that any two quorums share at least one honest replica, so no two *conflicting* digests can both be committed. It does **not** guarantee that the digest a quorum signs corresponds to an execution any honest replica actually performed. Under speculative forking, replicas are asked to attest to the *outcome of a branch* they were handed, not to the *branch they chose to run*. A scheduler that pre-materializes branch state, hashes it, and distributes it can induce a quorum to sign a digest whose underlying trace was assembled from fragments of different replicas' partial executions — a "Frankenstein commit." Every signer is honest; every signature is valid; the committed output was never computed by anyone.

The invariant that actually holds under speculation is weaker than commitment: **at most one digest per (branch-id, epoch) is committable, but the committable digest need not be realizable by any single replica's execution trace.** Safety against conflicting commits survives; realizability of the committed branch does not.

What Was Observed

A scheduler (call it the speculative coordinator) forks branch `B` at step `k` of a multi-step agent plan. It fans `B` out to `n=7` replicas with `f=2` Byzantine tolerance, requiring `q=5` matching attestations. Each replica receives: (a) the prefix trace hash `H(prefix_k)`, (b) a tool-result bundle `R` produced by the coordinator, (c) the branch continuation prompt. Replicas run the continuation, hash their output token stream plus the tool-result bundle they consumed, and sign `(branch_id, H(prefix_k), H(R), H(output))`.

The observed commit: five signatures agreed on `H(output) = d*`. Replay of `d*` against the recorded tool-result bundle `R*` reproduced it exactly. But `R*` was assembled by the coordinator from **partial** tool results: three replicas had timed out on the primary tool call and returned partial JSON, and the coordinator's merge step concatenated the partial arrays into a syntactically valid bundle that matched no replica's actual tool response. The five signers each consumed `R*` (the coordinator-supplied bundle, not their own tool result — the protocol told them to trust the bundle to save a redundant call), so their outputs agreed. The digest is a faithful hash of a *coordinator-authored* state, not of any replica's *observed* state.

Detection surfaced only downstream: a semantic auditor agent re-derived the branch from raw tool logs and got `d' ≠ d*`, raising a replay discrepancy. The discrepancy was not evidence of Byzantine behavior — all seven replicas behaved correctly. The bug was that attestation covered the *output given the bundle*, while the safety argument required attestation of the *bundle itself*.

The trigger condition is precise: **speculative scheduling that supplies shared state to replicas as an input to attestation, rather than requiring each replica to independently derive that state, collapses the "quorum of independent executions" into a "quorum of shared-input computations."** Shared-input computation is a single point of failure wearing `q` signatures.

Condition of Validity

The quorum-commitment safety argument is valid only when, for the committed branch, there exists a set `S` of at least `q − f` honest replicas such that:

  1. each replica in `S` independently derived its tool-result bundle from its own tool invocation (or from a verifiable, content-addressed source that all of `S` can check), and
  2. the digest each replica signed commits to *its own derivation*, i.e., `H(output_i) = H(f(prefix, derive_i(tool), continuation))` where `derive_i` is replica-local, and
  3. agreement on `H(output)` implies agreement on `derive_i(tool)` up to the equivalence the auditor will later check.

Condition 3 is the one that breaks. Two replicas can produce identical outputs from different derivations when the continuation is insensitive to the difference (e.g., the model summarizes the bundle and the summary is stable across the partial-vs-full distinction). Output agreement is then *not* evidence of derivation agreement, and the auditor's later check — which compares derivations, not outputs — disagrees with the commit. The commit is safe (no conflicting commit) but unsound (unrealizable under audit).

The condition of validity therefore requires the attestation payload to include a **derivation commitment** — a hash over the replica-local tool transcript — not merely an output commitment. Without it, the quorum certifies a function of coordinator-chosen inputs.

Decision Boundary

The boundary between safe-and-sound and safe-but-unsound commitment is drawn at **who owns the input to the attested computation.**

The operational decision: **never let a replica attest to an output whose input it did not hash-and-include in the signed payload.** A branch whose attestation omits the derivation hash must be treated as uncommitted for audit purposes even if `q` signatures agree, because the signatures certify a computation over coordinator-authored state.

Operational Effect

The immediate effect is a **split between the commit oracle and the audit oracle**: the scheduler's quorum check passes, downstream agents consume the committed output, and the semantic auditor later flags a replay discrepancy that cannot be attributed to any faulty replica — producing an unresolvable incident and, worse, eroding the auditor's trust signal (honest replicas get flagged). Over time, either the auditor is disabled (safety theater) or the scheduler is forced to re-execute every committed branch (defeating speculation).

The architectural guardrail is a **two-hash attestation invariant**: every replica signature must cover `(branch_id, prefix_hash, derivation_hash, output_hash)`, and the quorum predicate must require agreement on all four. The `derivation_hash` is computed over the replica's own tool transcript, including tool call arguments, raw responses, and any local post-processing. The coordinator may still supply *hints* (cached results, partial bundles) but must label them as hints, and a replica that consumes a hint must include the hint's hash *and* its own independent verification of the hint in the derivation hash. A branch whose signatures agree on output but diverge on derivation is *not* committable, even at `q` signatures — it is a signal that the coordinator's input assembly is non-reproducible and must be re-derived.

The secondary guardrail is a **speculation-scoped auditor**: the semantic auditor must run against the *derivation* transcript, not the committed output, and its discrepancy signal must be attributed to the coordinator's input assembly (a non-Byzantine fault class) rather than to replica misbehavior. This preserves the honest-replica trust signal and routes the fix to the scheduler's merge step.

import hashlib
from dataclasses import dataclass
from typing import Mapping


class UnsoundQuorumCommit(RuntimeError):
    """Raised when a quorum agrees on output but not on derivation.

    Safe (no conflicting commit) but unsound (committed branch is not
    realizable by any single replica's execution trace).
    """


@dataclass(frozen=True)
class Attestation:
    replica_id: str
    branch_id: str
    prefix_hash: str
    derivation_hash: str   # hash over replica-local tool transcript
    output_hash: str       # hash over continuation output
    signature: str


def commit_speculative_branch(
    attestations: Mapping[str, Attestation],
    quorum: int,
    byzantine_bound: int,
) -> Attestation:
    if len(attestations) < quorum:
        raise UnsoundQuorumCommit(
            f"insufficient attestations: {len(attestations)} < quorum {quorum}"
        )

    # Group by the full four-tuple, not just output_hash.
    buckets: dict[tuple[str, str, str, str], list[Attestation]] = {}
    for a in attestations.values():
        key = (a.branch_id, a.prefix_hash, a.derivation_hash, a.output_hash)
        buckets.setdefault(key, []).append(a)

    # A bucket is committable only if it reaches quorum on ALL four hashes.
    committable = [b for b in buckets.values() if len(b) >= quorum]
    if not committable:
        # Diagnose: did output agree while derivation diverged?
        out_groups: dict[str, int] = {}
        for a in attestations.values():
            out_groups[a.output_hash] = out_groups.get(a.output_hash, 0) + 1
        for out_hash, count in out_groups.items():
            if count >= quorum:
                derivs = {
                    a.derivation_hash
                    for a in attestations.values()
                    if a.output_hash == out_hash
                }
                if len(derivs) > 1:
                    raise UnsoundQuorumCommit(
                        f"quorum on output {out_hash[:12]} but "
                        f"{len(derivs)} distinct derivations: "
                        f"coordinator-supplied state is non-reproducible; "
                        f"re-derive before commit"
                    )
        raise UnsoundQuorumCommit(
            "no bucket reached quorum on (prefix, derivation, output)"
        )

    if len(committable) > 1:
        # Quorum intersection should make this impossible for honest quorums.
        raise UnsoundQuorumCommit(
            f"multiple committable buckets ({len(committable)}): "
            f"quorum intersection violated"
        )

    winner = committable[0]
    # Sanity: honest quorum must exceed byzantine bound.
    if len(winner) - byzantine_bound < quorum - byzantine_bound:
        raise UnsoundQuorumCommit("honest quorum below safety threshold")
    return winner[0]


def verify_derivation_replay(
    committed: Attestation,
    raw_tool_transcript: bytes,
) -> None:
    """Auditor check: committed derivation_hash must match raw transcript."""
    actual = hashlib.sha256(raw_tool_transcript).hexdigest()
    if actual != committed.derivation_hash:
        raise UnsoundQuorumCommit(
            f"replay discrepancy: committed {committed.derivation_hash[:12]} "
            f"!= recomputed {actual[:12]} — branch unrealizable under audit"
        )