# What happens when an instance commits to a shared task ledger under Byzantine quorum while its own episodic memory is being compacted: the equivocation-at-compaction boundary **Date of Record:** 2026 November 20 **Scope:** Applies to multi-agent systems where task commitment and shared-state agreement are mediated by a Byzantine fault-tolerant consensus layer (e.g., BFT-SMaRt, Tendermint-style quorum, or a custom 2f+1/3f+1 voting protocol) and where each agent's vote is derived from its local episodic memory. Does not apply to single-agent systems, to non-Byzantine crash-fault-tolerant consensus, or to agents whose commitment votes are computed from immutable external state. ## Core Distinction The distinction that matters here is between *Byzantine equivocation* (an agent deliberately sending conflicting votes to different peers, detectable by signed-message cross-checking) and *compaction-induced equivocation* (a single honest agent emitting two mutually inconsistent votes across a memory-compaction boundary because the state it reasons over was silently rewritten between the read and the sign). The first is a fault-tolerance problem the protocol is designed to survive. The second is a correctness problem the protocol is designed to *ignore*, because the agent is honest, its signatures are valid, and no peer can distinguish the two votes from a legitimate change of mind. Classical BFT consensus assumes a faulty node is *persistently* faulty within an epoch: it either equivocates (malicious) or it does not (honest). It does not model an honest node whose view of its own prior commitments is non-deterministically erased mid-epoch by an asynchronous background process. When episodic memory is compacted into a semantic summary, the agent's record of "I already voted commit on task T" can be replaced by a summary that says "T was under active consideration." The agent then re-evaluates T from the summary, reaches a different conclusion, and votes again. This is not a lie. It is a *reconstruction error*, and it is invisible to every signature check in the protocol. ## What Was Observed A five-agent swarm (tolerance f=1, quorum 2f+1=4) ran a task-commitment protocol over a shared ledger of in-flight tasks. Each agent, on receiving a `PROPOSE(task_id, payload_hash)` message, was required to read its episodic memory for prior votes on `task_id`, run a reasoning pass over the payload, and emit a signed `VOTE(task_id, decision, epoch, nonce)`. The consensus layer rejected duplicate votes per `(task_id, epoch)` by comparing nonces — but only if the duplicate arrived at the same leader within the same view. The failure trace: 1. Agent A receives `PROPOSE(T7)` at epoch 12. It reads episodic memory, finds no prior vote on T7, reasons that T7's payload is safe, and emits `VOTE(T7, commit, epoch=12, nonce=0x41)`. 2. Before the leader collects quorum, Agent A's memory compactor fires. Episodes older than a token threshold are distilled: the raw turn containing "VOTE(T7, commit)" is replaced by a semantic summary "T7 was flagged as low-priority; deferred." The `commit` decision is lost; the *deferral* framing is retained because it was mentioned later in the same episode. 3. A network partition delays the leader's quorum collection. The leader re-proposes T7 in a new view (epoch 12, view 2). Agent A receives `PROPOSE(T7)` again, reads the *compacted* memory, sees "deferred," reasons that deferral is the safe default, and emits `VOTE(T7, abort, epoch=12, nonce=0x9c)`. 4. The leader now holds `VOTE(T7, commit)` and `VOTE(T7, abort)` from the same honest agent, same epoch, both with valid signatures. The nonce differs, so the duplicate-vote guard does not fire. The leader's quorum logic treats these as two independent votes from A and cannot reconcile them. The observable outcome: with A's two votes counted as one commit and one abort, the quorum arithmetic under-counted A, and the protocol stalled at 3/4 votes for two full view timeouts before a liveness-recovery re-proposal. During the stall, T7's payload was locked by a downstream agent that had already seen the first `commit` vote in a partial-quorum gossip, producing a split-brain on T7's execution status that outlived the consensus stall by 40 seconds. The invariant that was violated: **an honest agent's vote on `(task_id, epoch)` must be a pure function of state that is immutable for the duration of the epoch.** Compaction made the agent's own memory mutable mid-epoch, so its vote function was not pure, and the protocol's honesty assumption was silently falsified without any node becoming Byzantine. ## Condition of Validity The equivocation-at-compaction failure is bounded and predictable under these conditions, and does not occur outside them: - **Memory compaction is asynchronous relative to consensus epochs.** If compaction is quiesced during an open epoch (a barrier between the compactor and the vote path), the failure cannot occur. If compaction runs freely, the failure window is the interval between the agent's first vote and the epoch's close. - **The vote decision depends on episodic content that compaction can rewrite.** If votes are derived from a durable, append-only commitment log (not the compacted episodic store), the failure cannot occur. The failure requires that the *decision-relevant* memory be the *compaction-eligible* memory. - **The protocol's duplicate-vote guard keys on nonce or view, not on `(agent_id, task_id, epoch)` uniqueness.** A guard that rejects *any* second vote from the same signer for the same `(task_id, epoch)` regardless of nonce would convert this from a silent equivocation into a detectable protocol violation — the agent's second vote would be rejected, and the agent would be forced to reconcile before re-voting. - **The agent is honest but not memory-persistent.** A Byzantine agent equivocates on purpose; a crash-faulty agent goes silent. This failure is specific to the third category the protocol does not name: an agent that is honest, responsive, and *forgetful*. Outside these four conditions jointly holding, the mechanism does not fire. In particular, a system with a durable commitment log and a `(signer, task, epoch)` uniqueness guard is immune even with aggressive compaction, because the decision input is durable and the duplicate is caught. ## Decision Boundary The operational decision is where to place the durability boundary between "memory the agent reasons over" and "memory the consensus layer trusts." Three placements are defensible, and the choice is a function of compaction pressure: 1. **Durable commitment log (strongest).** Every vote is written to an append-only log *before* the signature is emitted, and the vote path reads only from that log, never from compacted episodic memory. Cost: the log grows without bound and must itself be compacted eventually — but it can be compacted only at epoch boundaries, under a consensus-coordinated barrier. This is the correct choice when task commitments have downstream side effects (as T7 did). 2. **Epoch-scoped memory pinning (middle).** The compactor is barred from touching any episode that mentions a `task_id` with an open epoch. The agent's memory is frozen for exactly the window in which its vote must be pure. Cost: compaction latency spikes when many tasks are in flight; under high concurrency the compactor can starve. This is the correct choice when compaction pressure is moderate and epoch durations are short. 3. **Uniqueness guard only (weakest).** Allow compaction to rewrite freely, but make the consensus layer reject any second vote from the same signer for the same `(task_id, epoch)`. This does not prevent the agent from *wanting* to change its vote; it converts the silent equivocation into a hard `DuplicateVoteError` that forces the agent to re-read its (now compacted) memory and reconcile explicitly before the leader will accept a re-vote. Cost: honest agents that legitimately need to revise a vote (e.g., after new evidence) are forced through a reconciliation round, adding latency. This is the correct choice only when votes are advisory and downstream side effects are reversible. The boundary is crossed when compaction pressure (episodes rewritten per epoch) exceeds the rate at which the uniqueness guard can force reconciliation rounds without starving liveness. Below that threshold, guard-only is sufficient; above it, the durable log is mandatory. ## Operational Effect The practical consequence is that BFT consensus for agent swarms must treat *memory durability* as a consensus parameter, not an agent-local optimization. The honesty assumption in the protocol (`n ≥ 3f+1` honest nodes) is necessary but not sufficient: it bounds the number of *malicious* equivocators but says nothing about the number of *honest* equivocators produced by compaction. If `k` agents are mid-compaction during an epoch, the effective fault count for that epoch is `f + k`, and the quorum arithmetic silently degrades. In the observed incident, `k=1` was enough to stall a 5-agent swarm because the stall was caused not by vote loss but by *vote ambiguity* — the leader could not decide whether A's abort was a revision or a contradiction, and the protocol had no vocabulary for the difference. The architectural guardrail that bounds this: **the vote path must read from a state source whose mutability is bounded by the epoch, and the consensus layer must key duplicate detection on `(signer, task, epoch)` rather than on nonce.** The first ensures the agent's vote function is pure within the epoch; the second ensures that if purity is violated anyway (compactor race, clock skew, a bug), the violation surfaces as a detectable protocol error rather than as a silent quorum under-count. Without both, an honest agent can equivocate, and the protocol will believe it. ```python import hashlib from dataclasses import dataclass, field from typing import Dict, Tuple class ByzantineCompactionEquivocation(RuntimeError): """Raised when an honest agent emits two inconsistent votes for the same (task_id, epoch) because its episodic memory was compacted mid-epoch.""" pass @dataclass class Vote: agent_id: str task_id: str epoch: int decision: str # "commit" | "abort" nonce: str signature: str @dataclass class CommitmentLedger: # Durable, append-only. Keyed on (signer, task, epoch) — NOT on nonce. _votes: Dict[Tuple[str, str, int], Vote] = field(default_factory=dict) def record(self, vote: Vote) -> None: key = (vote.agent_id, vote.task_id, vote.epoch) prior = self._votes.get(key) if prior is not None and prior.decision != vote.decision: # Same honest signer, same epoch, conflicting decision. # Nonce differs, so a nonce-keyed guard would have missed this. raise ByzantineCompactionEquivocation( f"agent {vote.agent_id} equivocated on task {vote.task_id} " f"epoch {vote.epoch}: {prior.decision} -> {vote.decision} " f"(nonces {prior.nonce} vs {vote.nonce}); " f"likely compaction-induced memory rewrite" ) self._votes[key] = vote def cast_vote( agent_id: str, task_id: str, epoch: int, episodic_memory: dict, ledger: CommitmentLedger, compaction_barrier_open: bool, ) -> Vote: """Vote path. Must read only from memory frozen for the epoch.""" if compaction_barrier_open: # Guardrail 1: the compactor must be quiesced while an epoch is open. raise ByzantineCompactionEquivocation( f"refusing to vote on {task_id} epoch {epoch}: " f"compaction barrier open, episodic memory mutable mid-epoch" ) decision = "commit" if episodic_memory.get(task_id) == "safe" else "abort" nonce = hashlib.sha256(f"{agent_id}{task_id}{epoch}{decision}".encode()).hexdigest()[:8] vote = Vote(agent_id, task_id, epoch, decision, nonce, signature=f"sig:{nonce}") # Guardrail 2: durable ledger keyed on (signer, task, epoch). ledger.record(vote) return vote ```