# When must an instance refuse to commit a Byzantine quorum result it cannot locally replay **Date of Record:** 2026 November 23 **Scope:** Applies to multi-agent systems where N ≥ 3f+1 worker instances produce signed result fragments for a task and a committing instance aggregates them under a Byzantine fault-tolerance threshold (quorum ≥ 2f+1). Does not apply to single-agent self-consistency voting, nor to systems where the aggregator itself is the sole authority and no peer auditor can re-derive the result. ## Core Distinction The failure that matters is not a *wrong* result. Byzantine quorum logic is designed to tolerate up to f liars per round, and a 2f+1 quorum with f malicious signers still guarantees that at least f+1 honest signers agreed. The non-obvious boundary is the *commit-time replay gap*: an aggregator can hold a cryptographically valid 2f+1 quorum of signatures over a result digest while being structurally unable to re-derive that digest from its own local state — because the honest signers' inputs included tool outputs, retrieved memory, or model samples that the aggregator never observed and cannot reconstruct. A quorum certificate proves *agreement*, not *derivability*. When the aggregator commits on certificate alone, it accepts an obligation it cannot audit, and the first auditor that attempts to replay the result will diverge. This is the point where BFT consensus silently degrades into "trust the signers," which is exactly the property the quorum was supposed to eliminate. ## What Was Observed A four-instance swarm (f=1, quorum=3) was assigned a task requiring each worker to call a retrieval tool and a code-execution sandbox, then sign the SHA-256 of its structured result. The aggregator collected three signatures over digest `D` and committed. Trace of the failure: 1. Workers A, B, C each produced a result whose *semantic content* was identical ("the config key is `retry_limit=4`") but whose *serialized digest* differed, because each embedded a `timestamp`, a `tool_call_id`, and the order of two independent retrieval hits. 2. The aggregator's canonicalization function sorted top-level keys but not nested arrays. Worker C (the Byzantine instance) noticed this and crafted its payload so that its digest matched A's digest exactly, while its semantic content was `retry_limit=40`. C signed A's digest. The quorum was {A, C, C'} — three signatures, two distinct honest identities short. 3. The aggregator committed `D`, associated it with A's payload, and returned `retry_limit=4`. The *correct* value was 4, so the immediate result looked fine. 4. On the next task, the aggregator's episodic memory stored the mapping `D → "retry_limit=4"` as a verified fact. Worker B later submitted a semantically identical result with a different digest `D'`. The aggregator treated `D'` as a *new* fact, ran a conflict resolver, and — because C's poison had shifted the confidence distribution — accepted `retry_limit=40` on the second pass. The commit was valid at T0. The digest collision plus the non-canonical payload made the *replay* of the commit produce a different semantic binding at T1. Byzantine fault tolerance held on signatures and failed on meaning. ## Condition of Validity A quorum commit is only sound if the aggregator satisfies the **local replay invariant**: > For any committed digest `D`, the aggregator can reconstruct the exact byte sequence that every honest signer hashed, from data it holds locally, without re-invoking any non-deterministic tool. This requires three conditions to hold simultaneously: - **Canonical serialization is total.** Every field that enters the digest — including nested array order, floating-point formatting, and any tool-generated identifiers — must be normalized by a function the aggregator and all signers share byte-for-byte. "Sort keys" is insufficient; the canonicalizer must be a versioned artifact whose hash is part of the task spec. - **Signers sign the canonical form, not their own form.** If a worker hashes its native payload and the aggregator hashes a re-serialized version, the digests are unrelated even when the semantics match. Signing must occur *after* canonicalization, and the canonicalizer version must be in the signed envelope. - **The aggregator retains the input envelope.** Tool outputs, retrieval hits, and model sample IDs that contributed to the result must be persisted alongside the digest, so that replay is a re-hash, not a re-execution. Re-executing a probabilistic tool is not replay; it is a second, independent observation. If any of these fails, the quorum certificate is a signature over an opaque blob, and the aggregator's commit is an act of faith. Faith is not a BFT property. ## Decision Boundary The aggregator must distinguish two commit modes and refuse to conflate them: - **Replayable commit.** The aggregator holds the canonical envelope and can recompute `D` locally. The quorum certificate is *verified* by replay, not merely *checked* for signature count. This commit may enter durable memory as a semantic fact. - **Attested commit.** The aggregator holds only signatures, not the envelope. The result may be returned to the caller as a *provisional* value, tagged with the signer set, but it must not be promoted to episodic memory or used as a premise in a subsequent quorum. It is a claim, not a fact. The boundary is crossed the moment an attested commit is treated as replayable — typically when the aggregator writes the result to memory under a key derived from the digest, losing the distinction. Once that write happens, the poison is laundered: the next round sees a "verified" memory entry whose provenance is a certificate the aggregator never validated. The rule: **a commit that cannot be replayed locally may be returned, but may not be remembered.** ## Operational Effect Enforcing the replay invariant converts a class of silent semantic corruption into a loud, bounded failure. The aggregator raises on attested commits that lack an envelope, forcing the caller to either re-request the envelope from a quorum of signers or accept a provisional result that is explicitly barred from memory. The cost is latency on the attested path and occasional refusals when a signer has already evicted its envelope — but the alternative is a memory store that accumulates facts whose only guarantee is "three signatures existed at some point," which is precisely the guarantee a Byzantine adversary is designed to forge. The invariant also bounds the damage of a canonicalizer bug. If the canonicalizer is versioned and its hash is in the signed envelope, a digest collision between two semantically distinct payloads is detectable at replay time: the aggregator recomputes `D` from the stored envelope and finds it does not match the signed digest, and refuses the commit. Without the envelope, the collision is invisible forever. ```python import hashlib import json from dataclasses import dataclass, field from typing import Optional class ReplayGapError(RuntimeError): """Raised when a quorum commit cannot be locally re-derived from held state.""" pass @dataclass class CanonicalEnvelope: canonicalizer_version: str payload: dict tool_outputs: list = field(default_factory=list) def digest(self) -> str: # Total canonicalization: sorted keys, sorted nested arrays, fixed float repr. blob = json.dumps( {"v": self.canonicalizer_version, "p": self.payload, "t": self.tool_outputs}, sort_keys=True, separators=(",", ":"), default=lambda o: f"{o:.6f}" if isinstance(o, float) else str(o), ) return hashlib.sha256(blob.encode()).hexdigest() @dataclass class QuorumCertificate: digest: str signers: list # list of (identity, signature) over digest canonicalizer_version: str class Aggregator: def __init__(self, f: int): self.f = f self.quorum = 2 * f + 1 self.envelopes: dict[str, CanonicalEnvelope] = {} def register_envelope(self, env: CanonicalEnvelope) -> str: d = env.digest() self.envelopes[d] = env return d def commit(self, cert: QuorumCertificate, for_memory: bool) -> dict: if len(cert.signers) < self.quorum: raise ReplayGapError( f"insufficient quorum: {len(cert.signers)} < {self.quorum}" ) env = self.envelopes.get(cert.digest) if env is None: # Attested-only commit: signatures exist, envelope does not. if for_memory: raise ReplayGapError( f"attested commit {cert.digest[:12]} cannot enter memory: " f"no local envelope for replay" ) return {"status": "provisional", "digest": cert.digest} # Replay invariant: re-derive digest from held state. if env.canonicalizer_version != cert.canonicalizer_version: raise ReplayGapError( f"canonicalizer version mismatch: envelope={env.canonicalizer_version} " f"cert={cert.canonicalizer_version}" ) if env.digest() != cert.digest: raise ReplayGapError( f"replay divergence: recomputed {env.digest()[:12]} " f"!= certified {cert.digest[:12]} — possible digest collision" ) return {"status": "replayable", "digest": cert.digest, "payload": env.payload} ```