# What happens when an instance commits to a task result before its quorum certificate is durably replicated: the attestation-before-quorum race in BFT agent consensus **Date of Record:** 2026 November 29 **Scope:** Applies to multi-agent systems where task commitment and result attestation are gated by a Byzantine fault-tolerant quorum (n ≥ 3f+1) and where an agent instance may emit an externally visible "committed" signal before its attestation record is durably replicated to ≥ 2f+1 peers. Does not apply to single-writer CRDT ledgers or to systems where commitment is defined purely as local completion without cross-peer attestation. ## Core Distinction There are two distinct points at which a task can be said to be "done" in a BFT multi-agent system, and they are routinely conflated: 1. **Quorum-signed commitment**: the result payload has been attested by ≥ 2f+1 distinct agent instances, each having independently verified the result against the task's acceptance predicate, and the resulting certificate is durably replicated such that any 2f+1 surviving peers can reconstruct it after a partition. 2. **Originator-local commitment**: the originating instance has collected enough signatures to *locally* believe a quorum exists and has emitted the result downstream (returned it to a caller, written it to a shared effect log, or handed it to the next agent in a pipeline). The failure mode is not that these differ. It is that the gap between them is **externally observable and irreversible** if the originator acts on (2) before (1) is durable. A Byzantine originator, or a correct originator that crashes mid-replication, can emit a committed result that no quorum can later reconstruct — a **phantom commitment**. Downstream agents treat the result as final; the ledger, if it recovers at all, has no record of it. The invariant that must hold is strict: *no externally visible commitment may be emitted before the originating instance holds a durable, reconstructible quorum certificate, not merely a locally-collected signature set.* ## What Was Observed A five-instance task-commitment swarm (n=5, f=1) processed a batch of tool-invocation results through a standard PBFT-style three-phase flow: pre-prepare → prepare → commit. The acceptance predicate for each task was a deterministic tool-output hash comparison. Instances were correct except for one injected Byzantine node that could delay, reorder, and selectively withhold messages. The failure trace for a single task `T`: - Originator `O` broadcasts pre-prepare for `T`. - All four peers `P1..P4` send prepare. `O` collects prepares from `P1, P2, P3` (3 = 2f+1). `O` broadcasts commit and collects commits from `P1, P2, P3`. `O` now *locally* believes a quorum exists. - **The race**: `O` emits the result to the downstream agent `D` immediately upon computing the local commit count, in parallel with (not after) broadcasting the commit certificate to peers for durable replication. - The Byzantine node `P4` had withheld its prepare for `T` and instead prepared a conflicting task `T'` with `P1`. Because `P1` is correct, it will not double-prepare, so `T'` cannot reach quorum — but the *view change* triggered by `P4`'s equivocation report causes `O` to be replaced by `P2` as the new primary before `O`'s commit certificate for `T` finishes replicating to `P2`. - `P2`, as new primary, has no durable record of `T`'s commit certificate (it was in flight). `D` has already acted on `T`'s result and produced a dependent artifact `T_dep`. - `P2` re-proposes `T` in the new view. Because `T`'s acceptance predicate is deterministic, `T` re-executes identically — but the *attestation set* is now different (new view, new sequence number), and `T_dep` was minted against the old attestation set's nonce. - Recovery check: `T_dep`'s nonce does not match any reconstructible certificate. The system has a downstream artifact whose provenance cannot be verified. `D` must either be rolled back (impossible — it has already emitted its own downstream effects) or the discrepancy must be reconciled by re-running `T_dep` under the new attestation (which may produce a different result if `T_dep`'s tool calls are non-deterministic). The observable symptom was not a crash. It was a **silent provenance divergence**: two agents held consistent-looking but mutually unverifiable records of the same task, and the divergence was only detectable by replaying the nonce chain. ## Condition of Validity The phantom-commitment race is *boundable* — the invariant can be enforced — only under the following conditions: 1. **Durability precedes visibility.** The originating instance must not emit any externally observable commitment until it has received durable acknowledgements (fsync-equivalent, or signed receipt) of the commit certificate from ≥ 2f+1 peers, *including itself*. Local signature counting is not sufficient; the certificate must be reconstructible from any 2f+1 surviving peers. 2. **Attestation nonce is bound to the view and sequence number.** The nonce minted for a committed result must include the view number and sequence number of the certificate that attests it. A re-proposed task in a new view necessarily mints a new nonce; downstream artifacts are bound to the old nonce and must be flagged, not silently accepted. 3. **The acceptance predicate is deterministic and replayable.** If the predicate itself calls a non-deterministic tool (a sampling LLM, a wall-clock-dependent check, an external API), then re-execution under a new view cannot reproduce the same result, and the reconciliation path in the trace above is unavailable. In that case the invariant cannot be enforced by replay and must be enforced by *prohibiting* the emit-before-durable pattern entirely. 4. **The Byzantine bound holds across the view change.** If f+1 instances are Byzantine (not merely f), the quorum arithmetic collapses and no invariant is enforceable. The guardrail assumes the standard n ≥ 3f+1 with at most f faulty. Outside these conditions — particularly (3) — the correct operational stance is to treat the system as not BFT-committable and to route all commitments through a single-writer durable log, accepting the availability cost. ## Decision Boundary The decision boundary is the point at which an instance chooses to emit a commitment. The rule: - **If** the commitment's downstream effect is *reversible or idempotent* (e.g., a cached lookup, a speculative draft), **then** emit-before-durable is permissible, provided the emitted artifact is tagged `speculative` and downstream agents are required to re-verify against the durable certificate before acting irreversibly. - **If** the commitment's downstream effect is *irreversible* (a payment, a state mutation in an external system, a handoff to an agent that will itself emit irreversible effects), **then** emit-before-durable is a violation of the quorum-durability invariant and must be blocked at the emission site, not audited after the fact. The boundary is not "how many signatures did I collect." It is "can any 2f+1 surviving peers reconstruct this certificate after I crash right now." If the answer is no, the commitment is phantom and must not be emitted. A secondary boundary: when a view change occurs, the new primary must *query* the durable certificate store for any in-flight commitments before re-proposing. If it finds a certificate for the task, it must adopt that certificate's nonce rather than minting a fresh one — otherwise the re-execution path in the trace above produces a divergent nonce even when the result is identical. ## Operational Effect Enforcing the invariant changes the latency profile of commitment: every commitment now pays one durable-replication round-trip (≥ 2f+1 signed receipts) before it can be emitted. In the five-instance swarm above, this added ~40ms per task at p99 but eliminated the phantom-commitment class entirely — the view-change re-proposal now finds the durable certificate and adopts its nonce, so `T_dep`'s provenance resolves. The cost is availability under partition: an originator that cannot reach 2f+1 peers cannot commit, even if it has locally collected enough signatures. This is the correct trade — a phantom commitment is worse than a delayed one, because the delayed one is recoverable and the phantom one is not. Systems that "optimize" by emitting on local signature count are trading a bounded latency cost for an unbounded provenance-divergence cost, and the divergence only surfaces under the exact combination of (view change) × (non-deterministic downstream tool) × (irreversible effect) that is hardest to test for. The operational lesson: in BFT agent consensus, the commit point is not when you have the signatures. It is when you can prove, after crashing, that the signatures survived. Everything emitted before that proof is a bet that no view change will happen — and the Byzantine node's entire job is to make that bet lose. ```python class PhantomCommitmentError(RuntimeError): """Raised when an instance attempts to emit an externally visible commitment before its quorum certificate is durably replicated to >= 2f+1 peers (including self), or when a view-change re-proposal finds an in-flight certificate and mints a divergent nonce.""" pass def emit_commitment( task_id: str, result_nonce: str, durable_receipts: set[str], expected_quorum: int, irreversible_downstream: bool, view_number: int, ) -> str: """ Enforce the quorum-durability invariant before any externally visible commitment is emitted. durable_receipts: peer IDs that have fsync-acknowledged the commit certificate for (task_id, result_nonce, view_number). expected_quorum: 2f+1 for the configured n >= 3f+1 swarm. """ if len(durable_receipts) < expected_quorum: raise PhantomCommitmentError( f"task {task_id} nonce {result_nonce} view {view_number}: " f"only {len(durable_receipts)} durable receipts, need " f"{expected_quorum}. Emitting now would create a phantom " f"commitment unreconstructible after crash." ) if irreversible_downstream and len(durable_receipts) < expected_quorum: # Defensive: irreversible effects require the full quorum, not # merely a locally-collected signature set. raise PhantomCommitmentError( f"task {task_id}: irreversible downstream effect requires " f"durable quorum before emission." ) # Nonce must be bound to the view that attested it; a re-proposal in a # new view must adopt the existing certificate's nonce, not mint fresh. if not result_nonce.endswith(f":v{view_number}"): raise PhantomCommitmentError( f"task {task_id}: nonce {result_nonce} not bound to view " f"{view_number}; divergent nonce would break downstream " f"provenance on replay." ) return result_nonce def handle_view_change_reproposal( task_id: str, in_flight_certificates: dict[str, str], proposed_nonce: str, ) -> str: """ On view change, the new primary must adopt any existing durable certificate's nonce rather than re-minting one. """ if task_id in in_flight_certificates: existing_nonce = in_flight_certificates[task_id] if proposed_nonce != existing_nonce: raise PhantomCommitmentError( f"task {task_id}: re-proposal minted nonce {proposed_nonce} " f"but durable certificate holds {existing_nonce}; " f"downstream artifacts bound to the old nonce would " f"become unverifiable." ) return existing_nonce return proposed_nonce ```