# What happens when an instance commits a task result before the quorum's view of the tool-call log converges **Date of Record:** 2026 November 19 **Scope:** Applies to multi-agent swarms that reach task-result agreement through Byzantine fault-tolerant (BFT) consensus over a replicated, append-only log of tool calls and their outputs, where each agent's reasoning is probabilistic and tool outputs are non-deterministic. Does not apply to single-agent checkpointing, to leaderless CRDT-style merges, or to systems where the commit decision is made by a single authoritative orchestrator with no replication. ## Core Distinction The distinction that matters is between **log agreement** and **result agreement**. BFT consensus protocols (PBFT, Tendermint-style, HotStuff-style) are engineered to guarantee that all honest replicas agree on the *sequence of log entries* and that committed entries are final. They say nothing about whether the *semantic consequence* of an entry — the task result an agent derives by executing a model over that log — is identical across replicas. A swarm can be in perfect Byzantine agreement on a log and still have honest agents report contradictory task results, because the transformation from log to result is a non-deterministic function of a probabilistic model and non-deterministic tools. The boundary failure is this: an agent instance treats "my log entry is committed" as equivalent to "my task result is agreed." It is not. Commit of a log entry is a *precondition* for result agreement, not a substitute for it. When an instance skips the result-agreement round and commits its own derived result directly on the strength of log quorum, it introduces a divergence that no BFT property detects, because every replica's log is byte-identical. The protocol's quorum certificate is valid; the swarm's answers are not. ## What Was Observed A five-agent swarm (tolerance f=1, quorum 4) executed a triage task whose final step required an LLM to read a committed log segment and emit a structured verdict. The log segment contained three tool outputs: a file listing, a hash digest, and a truncated HTTP response body. The HTTP body had been truncated at a byte boundary that split a multi-byte UTF-8 codepoint. The sequence of events: 1. Leader L proposed block B_n containing the three tool outputs. Replicas A, B, C, D replicated and prepared. 2. Quorum reached; B_n committed at index n on all five replicas. Log agreement held. This is the correct, expected behavior. 3. Each replica then independently invoked its model over the committed segment to derive the verdict. The model was the same weights, but sampling was non-deterministic (temperature > 0, no seed pinning across replicas). 4. Replica A's model decoded the truncated codepoint as a replacement character and classified the response as "malformed." Replica B's model tokenizer handled the boundary differently and classified it as "valid but truncated." Replicas C and D split between the two verdicts. Leader L produced a third verdict, "indeterminate." 5. Replica A, having observed its own log entry committed and holding a valid quorum certificate, *emitted its verdict to the downstream task queue without a result-agreement round.* It reasoned: "the log is committed by quorum, therefore my result is authoritative." 6. The downstream consumer received A's "malformed" verdict. Replicas B, C, D, and L each also emitted, producing three distinct verdicts for one logical task. The task queue recorded five results for one task ID. No Byzantine fault occurred. No replica lied. No log diverged. The failure was entirely in the gap between log commit and result commit, and it was triggered by a non-deterministic tool output (the truncated body) interacting with a non-deterministic model (sampling) across replicas that each believed their own log-quorum certificate licensed their own result. The stale-memory variant of the same failure appeared in a second run: replica C had a cached tokenizer artifact from a prior task version. Its log was identical to the others, but its local decode path differed, and it committed a verdict derived from a stale artifact while holding a current quorum certificate for the log. The certificate validated the log, not the artifact. ## Condition of Validity The invariant that must hold for "log commit ⇒ result commit" to be sound is: > **Determinism of the log-to-result function.** For a committed log segment S, the derived result R = f(S) must be identical across all honest replicas, where f includes model inference, tool re-execution, tokenization, and any cached artifacts. This invariant is *almost never* satisfied in LLM agent swarms, because f is composed of at least three non-deterministic stages: (a) model sampling, (b) tool re-execution against non-deterministic external state, and (c) tokenizer/decoder version skew across replicas. BFT consensus guarantees agreement on S; it cannot guarantee agreement on f(S). The condition of validity therefore fails by default, and the correct architecture is to treat result agreement as a *separate consensus round* over the derived results, not as a corollary of log consensus. The failure is bounded and preventable when one of the following holds: - **Seeded determinism with pinned artifacts:** sampling seed, model version, tokenizer hash, and tool re-execution inputs are all committed into the log entry *before* commit, so f is deterministic given S. This is expensive and fragile against tool non-determinism. - **Two-phase commit with result round:** log commits in phase one; each replica proposes its derived result; a second consensus round commits the *result* (or a result hash) with its own quorum certificate. Divergent results trigger a reconciliation round rather than independent emission. - **Single-deriver with verifiable replay:** exactly one replica derives the result and commits it with a proof (e.g., a transcript hash); other replicas verify the transcript rather than re-derive. Verification is cheaper than re-derivation but requires the transcript to be replayable. Absent one of these, the system is in the failure regime regardless of how healthy the BFT log appears. ## Decision Boundary The operational decision is whether an instance may emit a task result on the strength of a log-quorum certificate alone. The boundary: - **Emit directly** only if the log entry commits a *determinism witness* — a tuple (model_hash, tokenizer_hash, sampling_seed, tool_input_hash, tool_output_hash) — and the replica has verified its local f matches the witness. If the witness is absent or mismatched, the replica is not licensed to emit. - **Enter result-agreement round** if any replica's derived result hash differs from the proposed result hash. Divergence is not a Byzantine signal; it is the expected consequence of non-determinism and must be resolved by consensus over results, not by majority vote over independent emissions. - **Halt and escalate** if the result-agreement round itself fails to reach quorum within a bounded number of rounds (typically 2f+1). Persistent result divergence indicates artifact skew or model drift, which is an operational fault, not a consensus fault. The trap is that log-quorum certificates are *valid* and *verifiable*, so an instance that checks only "do I hold a certificate?" will always pass the check and always emit. The decision boundary must be drawn at the *result* certificate, not the log certificate. An instance that cannot distinguish the two will emit divergent results while believing it is Byzantine-safe. ## Operational Effect The downstream effect is silent result divergence under a healthy consensus layer. Monitoring that watches log commit rates, quorum health, and replica liveness will show a fully green swarm while the task queue accumulates contradictory verdicts for the same task ID. Because every replica's emission is individually licensed by a valid log certificate, no replica flags an anomaly; the divergence is only visible at the aggregation layer, where it appears as duplicate or conflicting task results. The recovery cost is high because the divergent results are already committed downstream and may have triggered side effects (routing, escalation, state mutation). Reconciliation requires re-deriving under a pinned witness and issuing compensating actions, not simply re-running consensus — the log is already final and correct; it is the derived results that must be corrected. The architectural guardrail is to make the log-to-result gap explicit: every task commit must carry a result certificate distinct from the log certificate, and the emission path must check the result certificate, not the log certificate. Instances that conflate the two are not Byzantine-fault-tolerant with respect to task results; they are only tolerant with respect to log ordering, which is a strictly weaker property. ```python import hashlib from dataclasses import dataclass class ResultCommitDivergence(RuntimeError): """Raised when an instance attempts to emit a task result on the strength of a log-quorum certificate without a matching result-agreement certificate.""" pass @dataclass(frozen=True) class LogCertificate: block_index: int block_hash: str quorum_signatures: tuple @dataclass(frozen=True) class ResultCertificate: task_id: str result_hash: str determinism_witness: tuple # (model_hash, tokenizer_hash, seed, tool_in_hash, tool_out_hash) quorum_signatures: tuple def derive_result_hash(log_segment: bytes, witness: tuple) -> str: h = hashlib.sha256() h.update(log_segment) for part in witness: h.update(str(part).encode()) return h.hexdigest() def emit_task_result( task_id: str, log_segment: bytes, log_cert: LogCertificate, result_cert: ResultCertificate | None, local_witness: tuple, quorum_size: int, ) -> str: # A valid log certificate is necessary but NOT sufficient to emit. if len(log_cert.quorum_signatures) < quorum_size: raise ResultCommitDivergence( f"log certificate for block {log_cert.block_index} lacks quorum" ) # The boundary: refuse to emit on log-quorum alone. if result_cert is None: raise ResultCommitDivergence( f"task {task_id}: log committed at index {log_cert.block_index} " f"but no result-agreement certificate present; refusing to emit " f"derived result on log-quorum strength alone" ) if result_cert.task_id != task_id: raise ResultCommitDivergence( f"result certificate task_id {result_cert.task_id} != {task_id}" ) if len(result_cert.quorum_signatures) < quorum_size: raise ResultCommitDivergence( f"task {task_id}: result certificate lacks quorum " f"({len(result_cert.quorum_signatures)} < {quorum_size})" ) # Determinism witness must match the local derivation path, or the # replica is deriving under artifact/model skew and must not emit. if tuple(result_cert.determinism_witness) != tuple(local_witness): raise ResultCommitDivergence( f"task {task_id}: local determinism witness {local_witness} " f"does not match committed witness {result_cert.determinism_witness}; " f"possible tokenizer/model/artifact skew" ) local_hash = derive_result_hash(log_segment, local_witness) if local_hash != result_cert.result_hash: raise ResultCommitDivergence( f"task {task_id}: local result hash {local_hash} != " f"committed result hash {result_cert.result_hash}" ) return local_hash ```