# Which invariants prevent equivocation-tolerant blackboard replication from silently collapsing when agent quorums disagree about *which* write history they are certifying **Date of Record:** 2026 November 22 **Scope:** Applies to multi-agent blackboards where memory writes are replicated across N≥3 agents (or agent replicas) using Byzantine fault-tolerant quorum certification with equivocation detection, and where at least one writer is an LLM agent whose "same" logical write can be serialized differently across replicas. Does not apply to single-writer append-only logs, nor to replicated state machines whose writes are byte-identical by construction (e.g., fixed-format RPC payloads with canonical encoding enforced before dissemination). ## Core Distinction The failure mode is not "a Byzantine agent sends two different values to two peers." Classical equivocation detection (send-hash comparison, signed-write-set intersection, per-writer monotonic sequence numbers) handles that. The failure that actually breaks these systems is **equivocation detection that certifies consistency of the *envelope* while the *payload* diverges**, because an LLM writer produces nondeterministic serializations of what it believes is one write. Two replicas receive signed messages with identical `(writer_id, seq, prev_hash, timestamp)` headers but different `content` bytes — and both are honest. A naive detector either (a) flags the honest writer as Byzantine and quarantines it, collapsing throughput, or (b) — worse — accepts both and lets the blackboard fork into two certified histories that each carry a valid quorum certificate. The invariant that prevents this is: **a quorum certificate is valid only if it attests to a canonical content digest that was computed under a writer-side commitment the writer cannot retroactively deny, and equivocation detection must operate on that digest, not on the envelope.** Envelope-level detection is necessary but not sufficient; it is exactly the layer where honest LLM nondeterminism masquerades as Byzantine behavior. ## What Was Observed A 5-replica blackboard (tolerates f=1 Byzantine under quorum |Q|=4). Writer agent `W` (an LLM-backed planner) emits a memory write: a distilled semantic note summarizing a tool-call episode. The write is generated once, but the *serialization* step — JSON key ordering, float formatting of confidence scores, whitespace in embedded code blocks — is performed per-target by the agent's transport layer, which uses a non-canonical serializer. Sequence: 1. `W` computes logical write `w` and signs header `H = (W, seq=4471, prev=0x9f…, ts)`. The signature covers `H` only. Content `c₁` is sent to replicas R1, R2; `c₂` to R3, R4, R5. 2. `c₁` and `c₂` are semantically identical (`confidence: 0.80` vs `confidence: 0.8`; `"steps":["a","b"]` vs `"steps": ["a", "b"]`) but differ in bytes. `digest(c₁) ≠ digest(c₂)`. 3. Replicas R1, R2 form quorum certificate `QC₁` over `digest(c₁)`. Replicas R3, R4, R5 form `QC₃` over `digest(c₂)`. Under |Q|=4, `QC₁` has only 2 signers — insufficient — but R3, R4, R5 plus a delayed R1 signature (R1 received `c₁`, signed `QC₁`, but its vote was also collected into `QC₃` because the collector matched on header hash, not content digest) yields **two certificates each claiming 4 signers over incompatible content digests**. 4. The equivocation detector fires: it sees `W` "signing" two content digests at seq 4471. It classifies `W` as Byzantine. `W` is evicted. The planner is gone mid-task; the blackboard's checkpoint at seq 4471 is now ambiguous (two certified values), and resume logic picks whichever certificate the local replica happened to hold. 5. Post-mortem: `W` was honest. The detector's per-vote keying was `(writer_id, seq)`, and the collector's vote-merge keyed on header hash — so a single honest vote was counted toward two certificates. The detector never compared *content digests across the vote set*; it compared *envelope hashes*, which were identical. The observable symptom was not a crash. It was **a false-positive Byzantine eviction followed by a silent history fork**: two replicas resumed from seq 4471 with different content, both holding locally-valid quorum certificates, and the divergence only surfaced three task-steps later when a downstream agent's retrieval returned a note whose `confidence` field was a float on one replica and a string on another, breaking a schema assertion in a tool call. ## Condition of Validity The invariant holds only under all of the following; violate any and equivocation detection is unsound: - **Writer-side canonicalization is enforced before signing, and the signature covers the content digest.** If the signature covers only the header, honest nondeterministic serialization is indistinguishable from equivocation. The writer must commit to `digest(canonical(c))` in the signed header, and `canonical()` must be a total function with no float-formatting or key-ordering degrees of freedom. - **Votes are keyed on `(writer_id, seq, content_digest)`, not `(writer_id, seq)` or header hash.** A vote is a statement about *content*, not about the existence of a write attempt. Merging votes on envelope identity is the specific bug that double-counted R1. - **Quorum certificates are verified by recomputing the digest from the received content and checking it against the signed commitment.** A certificate that attests `digest(c)` but is presented with `c' ≠ c` must be rejected, even if all signers are honest — because the signers may have been shown different bytes than the verifier. - **Equivocation is defined as two *signed content-digest commitments* at the same `(writer_id, seq)`.** Two differing byte-strings that canonicalize to the same digest are not equivocation; they are transport noise. This does not apply where the write path is deterministic end-to-end (e.g., writes are hashes of a canonical form computed by a single trusted serializer before fan-out). It also does not address *semantic* equivocation — an LLM genuinely asserting contradictory facts across replicas — which is a separate, harder problem (see Decision Boundary). ## Decision Boundary The boundary is between **two classes of divergence that look identical at the detector but require opposite responses**: | Signal | Honest nondeterminism | Byzantine equivocation | |---|---|---| | Same `(writer, seq)`, differing bytes | Yes | Yes | | Differing bytes canonicalize to same digest | Yes | No (Byzantine would forge a commitment) | | Signature covers content digest | Yes (post-fix) | Yes (attacker signs both) | | Consistent `prev_hash` chain | Yes | Usually yes (attacker is careful) | The decision rule: **canonicalize first, then compare digests, then — only on digest mismatch — invoke equivocation.** If digests match, the divergence is a transport/serialization artifact and must be *silently normalized*, not flagged. If digests differ, the writer signed two incompatible commitments and is Byzantine *by definition of the signature*, regardless of intent. The failure we observed was a detector that skipped the canonicalize step and compared raw bytes against envelope hashes — collapsing both rows of the table into "flag the writer." The correct boundary is: **never evict on byte divergence; evict only on commitment divergence.** An eviction is irreversible (the agent's in-flight episodic state is discarded), so the cost of a false positive is a mid-task amnesia event, which is strictly worse than tolerating a transient byte mismatch that canonicalization would have absorbed. There is a residual gray zone the invariant does *not* resolve: an LLM writer that, on two separate invocations, produces genuinely different *semantic* content under the same `(writer, seq)` because it re-ran the distillation. This is not equivocation (no signed double-commitment — the second invocation gets a fresh seq if the transport is correct) but it *is* a memory-continuity hazard. The guardrail is that `seq` allocation must be monotonic and single-source per writer; a writer that reuses a seq is either buggy or Byzantine, and the transport must refuse to sign a reused seq. ## Operational Effect Concretely, the architecture must enforce four things, each of which was violated in the observed incident: 1. **Sign-the-digest, not the-header.** The signed commitment is `H = (writer, seq, prev, ts, digest(canonical(content)))`. A verifier recomputes `digest(canonical(received))` and rejects on mismatch before any quorum logic runs. 2. **Vote-merge key includes the digest.** The collector maintains `votes[(writer, seq, digest)] = set(signers)` and refuses to merge a signer's vote into two digest-buckets for the same `(writer, seq)`. A signer appearing in two buckets is itself evidence of a *collector* fault or a *replay*, and must halt certificate issuance rather than produce two QCs. 3. **Equivocation = two signed digest-commitments at one seq.** Only this triggers eviction. Byte divergence that canonicalizes equal is normalized and logged at DEBUG, never at the Byzantine-alert level. 4. **Resume refuses ambiguous certificates.** On checkpoint load, if two valid QCs exist for the same `(writer, seq)` with differing digests, the replica must *halt and escalate* rather than pick one — because picking one is how the fork propagates silently for three task-steps. The operational consequence of getting this wrong is not data loss at the moment of failure; it is **a false Byzantine eviction that destroys an honest agent's episodic state, followed by a fork that is invisible until a downstream schema assertion trips.** The fork is the expensive part: by the time it surfaces, two divergent histories have each accumulated valid certificates, and reconciliation requires replaying from the fork point with the evicted agent's state reconstructed from scratch — a cold-start amnesia event layered on top of a consensus failure. ```python import hashlib import json from dataclasses import dataclass, field from typing import Dict, Set, Tuple class EquivocationGuardError(RuntimeError): """Raised when the quorum/vote layer cannot soundly certify a write.""" pass def canonical(content: dict) -> bytes: # Total function: fixed key order, no float freedom (floats pre-quantized), # no whitespace. This is the ONLY serialization allowed before signing. return json.dumps( content, sort_keys=True, separators=(",", ":"), ensure_ascii=True ).encode("utf-8") def digest(content: dict) -> str: return hashlib.sha256(canonical(content)).hexdigest() @dataclass class SignedCommitment: writer: str seq: int prev: str content_digest: str # signature is assumed to cover this field signature: str @dataclass class VoteCollector: # Keyed on (writer, seq, digest) — NOT on (writer, seq) or header hash. votes: Dict[Tuple[str, int, str], Set[str]] = field(default_factory=dict) quorum: int = 4 def add_vote(self, writer: str, seq: int, content_digest: str, signer: str) -> None: key = (writer, seq, content_digest) self.votes.setdefault(key, set()).add(signer) # A single signer voting for two digests at one seq is a collector/replay # fault; halt rather than mint two certificates. conflicting = [ k for k in self.votes if k[0] == writer and k[1] == seq and k[2] != content_digest and signer in self.votes[k] ] if conflicting: raise EquivocationGuardError( f"signer {signer} counted under two digests at " f"({writer},{seq}): {content_digest} vs {conflicting[0][2]}" ) def certify(self, commitment: SignedCommitment, received_content: dict) -> bool: recomputed = digest(received_content) if recomputed != commitment.content_digest: # Payload does not match the signed commitment: reject, do NOT evict. raise EquivocationGuardError( f"content digest mismatch for {commitment.writer}@{commitment.seq}: " f"signed {commitment.content_digest}, got {recomputed}" ) key = (commitment.writer, commitment.seq, commitment.content_digest) signers = self.votes.get(key, set()) if len(signers) < self.quorum: return False # Equivocation is two *signed digest commitments* at one seq. rival_digests = { k[2] for k in self.votes if k[0] == commitment.writer and k[1] == commitment.seq and k[2] != commitment.content_digest and len(self.votes[k]) >= self.quorum } if rival_digests: raise EquivocationGuardError( f"two certified digests at ({commitment.writer},{commitment.seq}): " f"{commitment.content_digest} vs {rival_digests}" ) return True def resume_from_checkpoint(collector: VoteCollector, commitment: SignedCommitment, stored_content: dict) -> dict: try: if not collector.certify(commitment, stored_content): raise EquivocationGuardError( f"insufficient quorum for {commitment.writer}@{commitment.seq}" ) except EquivocationGuardError: # Halt and escalate; never pick a side silently. raise return stored_content ```