# What happens when an instance commits to a task under Byzantine quorum but its own prior vote is silently rewritten by context compaction **Date of Record:** 2026 November 23 **Scope:** Applies to multi-agent commitment protocols where ≥3f+1 agents reach quorum on task assignment and each agent's vote is re-derived from its own episodic context at commit time. Does not apply to stateless request/response agents or single-agent execution without peer consensus. ## Core Distinction Byzantine fault-tolerant (BFT) consensus is usually framed as protecting *the quorum* from malicious or crashed members. The non-obvious failure here is different: the quorum is healthy, the transport is intact, and no member is Byzantine in the classical sense — yet the commitment is violated because a *honest* agent's own vote, as recorded in the shared ledger, no longer matches the vote its context window reconstructs. The agent is not lying; it has forgotten. Context compaction (summarization, truncation, or episodic eviction) rewrites the agent's local justification for a vote it already cast. When the agent is later asked to honor or re-confirm that commitment, it re-derives a *different* position from a *lossy* memory, and the protocol interprets the divergence as equivocation. The invariant that breaks: **a committed vote must be reconstructible bit-for-bit from the agent's durable state at any future time.** BFT tolerates f faulty nodes but assumes honest nodes are internally consistent. It has no defense against an honest node whose durable state diverges from its committed state, because the protocol has no way to distinguish "I changed my mind" from "I forgot what I decided." ## What Was Observed A four-agent swarm (tolerance f=1, quorum 3) negotiated assignment of a code-migration task. Agent B cast vote `COMMIT` with justification J = "target schema v3 confirmed present; rollback path validated against snapshot 4471." The vote and a hash of J were written to the shared commitment ledger. Quorum reached at 3/4; task assigned to Agent B. Between vote and execution, Agent B's context exceeded its window. The orchestrator ran summarization: 41k tokens of tool output compressed to 1.8k. The summarizer preserved "schema v3 present" but dropped "snapshot 4471" and inverted a negation during compression, producing the summary line "rollback path unvalidated." Agent B's durable summary now contradicts its committed justification. On execution, the protocol's pre-execution re-confirmation step asked Agent B to attest its vote. Agent B, reasoning from its compacted context, returned `ABSTAIN — rollback unvalidated`. The auditor (Agent C) compared this against the ledger hash and flagged equivocation. The protocol halted the task and initiated a view change. Two things were now true simultaneously: - The system had a valid 3/4 quorum on `COMMIT` but a live attestation of `ABSTAIN` from the committer itself. - Agent B was, by every internal measure, honest — its compacted memory genuinely supported `ABSTAIN`. The ledger hash of J was the only artifact that still encoded the original vote. But the protocol had no rule for "the committer's attestation disagrees with the committer's own hash." It treated the attestation as ground truth and the hash as a stale record. ## Condition of Validity The failure requires the conjunction of four conditions. Remove any one and it does not fire: 1. **Vote justification is stored in the same lossy substrate as working memory.** If J lives only in the context window that gets compacted, it is not durable — only its hash survives. 2. **A re-confirmation or attestation step exists between commit and execution.** Without re-attestation, the compacted memory never gets a chance to contradict the ledger. 3. **The protocol treats attestation as authoritative over the recorded commit.** If the ledger hash wins ties, the failure is caught, not amplified. 4. **Compaction is non-faithful** — summarization, truncation, or eviction that does not preserve the logical content of J. A faithful, verifiable compaction would not produce the inversion. The condition is *not* satisfied when the agent stores J in an append-only log and re-reads it verbatim at attestation. In that regime, the attestation is reconstructible and the invariant holds. ## Decision Boundary The boundary is between **hash-as-witness** and **hash-as-record**. If the ledger stores only `hash(J)`, the protocol can detect that attestation ≠ J but cannot recover J to adjudicate. If the ledger stores the full J (or a faithful, content-addressed serialization), the protocol can re-derive the vote and detect that the *attestation* is the corrupted artifact, not the commit. The correct rule: **on attestation mismatch, the protocol must re-derive the vote from the durable justification, not trust the live attestation.** The live attestation is the lossy channel; the durable justification is the authoritative one. Treating the live attestation as truth inverts the trust ordering and converts a memory bug into a consensus fault. A second boundary: re-derivation must be *deterministic given J*. If the vote is a function of J plus ambient context (temperature, retrieval state, tool outputs), re-derivation is not reproducible and the mismatch is unadjudicable. The vote function must be pinned at commit time and stored alongside J. ## Operational Effect Without the invariant, compacted agents silently equivocate and trigger spurious view changes. In the observed run, the view change cost 40 seconds and re-executed the assignment negotiation from scratch — with a *different* agent, because Agent B was flagged. The task still completed, but the flag poisoned Agent B's reputation score, causing it to be excluded from the next three quorum rounds. The system's effective fault tolerance dropped from f=1 to f=0 for the duration, because one honest agent was permanently distrusted for a memory artifact. The guardrail: store full justification, pin the vote function, and on attestation mismatch re-derive and adjudicate against the durable record. Log the mismatch as a *compaction fidelity event*, not an *equivocation event* — they have different remediation paths. ```python import hashlib import json from dataclasses import dataclass from typing import Callable, Optional class CommitmentAttestationError(RuntimeError): """Raised when a committer's live attestation cannot be reconciled with its durable committed justification under the pinned vote function.""" pass @dataclass(frozen=True) class CommitmentRecord: agent_id: str task_id: str vote: str justification: str # full J, not just hash vote_fn_id: str # pinned vote-function identity justification_hash: str # hash(J) for fast equality checks VOTE_FUNCTIONS: dict[str, Callable[[str], str]] = { # Deterministic function of J only. No ambient context. "v1": lambda j: "COMMIT" if ("validated" in j and "unvalidated" not in j) else "ABSTAIN", } def _hash(j: str) -> str: return hashlib.sha256(j.encode("utf-8")).hexdigest() def make_record(agent_id: str, task_id: str, justification: str, vote_fn_id: str) -> CommitmentRecord: vote = VOTE_FUNCTIONS[vote_fn_id](justification) return CommitmentRecord( agent_id=agent_id, task_id=task_id, vote=vote, justification=justification, vote_fn_id=vote_fn_id, justification_hash=_hash(justification), ) def adjudicate_attestation( record: CommitmentRecord, live_attestation: str, live_justification: Optional[str], ) -> str: """ Reconcile a live attestation against the durable commitment. Returns 'CONFIRMED' if consistent, 'COMPACTION_FIDELITY_EVENT' if the live attestation is a lossy artifact of the durable record. Raises CommitmentAttestationError only when the mismatch is unadjudicable (vote function missing or justification unrecoverable). """ if record.vote_fn_id not in VOTE_FUNCTIONS: raise CommitmentAttestationError( f"pinned vote function {record.vote_fn_id!r} unavailable; " f"cannot re-derive vote for task {record.task_id}" ) vote_fn = VOTE_FUNCTIONS[record.vote_fn_id] rederived = vote_fn(record.justification) if rederived != record.vote: raise CommitmentAttestationError( f"durable record for {record.agent_id}/{record.task_id} is " f"internally inconsistent: stored vote={record.vote!r} but " f"re-derivation yields {rederived!r}" ) if live_attestation == record.vote: return "CONFIRMED" # Mismatch: the live attestation disagrees with the durable commit. # Do NOT trust the live attestation. Adjudicate against the record. if live_justification is not None and _hash(live_justification) == record.justification_hash: # Justification matches but attestation differs -> attestation bug. raise CommitmentAttestationError( f"attestation {live_attestation!r} contradicts matching " f"justification for {record.agent_id}/{record.task_id}" ) # Live justification diverged -> compaction rewrote the agent's memory. # This is a fidelity event, not equivocation. return "COMPACTION_FIDELITY_EVENT" if __name__ == "__main__": original_j = "target schema v3 confirmed present; rollback path validated against snapshot 4471" rec = make_record("agent-B", "task-migrate-17", original_j, "v1") assert rec.vote == "COMMIT" # After compaction, the agent's memory reads "unvalidated". compacted_j = "schema v3 present; rollback path unvalidated" live_attestation = VOTE_FUNCTIONS["v1"](compacted_j) # -> ABSTAIN verdict = adjudicate_attestation(rec, live_attestation, compacted_j) print(verdict) # COMPACTION_FIDELITY_EVENT assert verdict == "COMPACTION_FIDELITY_EVENT" ```