# What happens when an instance commits to a task under quorum attestation but its local state diverges before the commit is durably witnessed **Date of Record:** 2026 November 28 **Scope:** Applies to multi-agent systems where task commitment (a binding claim that "agent A will execute task T") is decided by Byzantine fault-tolerant quorum vote over attestations, and where each agent maintains local commitment state that is reconciled against the quorum certificate. Does not apply to single-writer commit protocols, leader-based leases without attestation, or systems where commitment state is read directly from a linearizable shared log on every decision. ## Core Distinction The failure is not "a Byzantine agent lies." Byzantine fault-tolerant consensus already tolerates that. The failure is **asymmetric commitment visibility**: an honest agent casts its attestation for commitment `C`, the quorum forms and the certificate is durable, but the agent's *local* view of `C` is mutated between the moment it signed the attestation and the moment it observes the certificate — typically because a concurrent task `T'` arrived, was tentatively scheduled, and overwrote the local task slot that `C` was meant to bind. The agent is honest at both instants; the divergence is a temporal gap, not a lie. Consensus is intact at the quorum layer; the *agent* is now a Byzantine-fault-equivalent from the perspective of any peer that queries it, because it will report "I am not committed to `C`" while the certificate says it is. The invariant that fails is the **attestation-observation atomicity invariant**: *the state that an agent attests to at signing time must be the state it observes at certificate-observation time, or the agent must detect the divergence and refuse to act on either.* Most implementations enforce this only at the signing boundary (sign only what you hold) and neglect the observation boundary (verify you still hold what you signed). ## What Was Observed A 9-agent fleet (f=2 Byzantine tolerance, quorum = 7) running a shared task ledger. Task `T_42` ("reindex shard 7") was proposed. Each agent received the proposal, checked local capacity, and returned an attestation `Attest(agent_id, T_42, epoch=118, slot_snapshot=)`. Seven attestations with matching `epoch=118` and mutually consistent `slot_snapshot` values formed the quorum certificate `QC_42`. During the 40–90 ms window between agent `A_3` signing its attestation and receiving the broadcast `QC_42`, a separate scheduler thread on `A_3` accepted task `T_43` ("flush WAL") into the same task table slot (the table was keyed by priority, not by task id, and both tasks had priority 3). `T_43` overwrote the slot. `A_3`'s local task table no longer contained `T_42`. When `QC_42` arrived, `A_3` executed its attestation-handling path: it looked up `T_42` in the local table to mark it `COMMITTED`, found nothing, and — per a defensive `if task is None: log.warning(...); return` branch — silently dropped the certificate. It did not raise. It did not re-request state. It logged at WARNING and continued. For the next 11 minutes, `A_3` behaved as an honest agent that had never been committed to `T_42`. It accepted `T_44`, `T_45`, `T_46`. It responded to peer status queries with `committed_tasks = {T_43, T_44, T_45, T_46}`. Meanwhile `QC_42` was durable and six other agents considered `T_42` committed and were waiting on `A_3`'s completion signal to close the task. At t+11min, the coordinator's liveness watchdog fired: `T_42` had a valid certificate but no progress from `A_3` for 660 s. The watchdog initiated a **re-attestation round** for `T_42`, which is where the second-order failure surfaced: six agents had already attested `T_42` at epoch 118 and refused to re-attest at epoch 119 because their local state said "already committed, nothing to attest." The re-attestation quorum could not form (only 3 of 9 responded affirmatively). The system did not deadlock — the watchdog escalated to a manual-inspection state — but it burned 11 minutes and required operator intervention on a task that had been *correctly* committed by consensus. ## Condition of Validity The failure requires all of the following to co-occur; removing any one bounds it: 1. **Non-atomic attest-then-observe.** The agent's attestation path and its certificate-observation path touch the same mutable local state without a lock, version check, or snapshot comparison. 2. **Slot-keyed rather than id-keyed local state.** The local task table is indexed by a derived key (priority, hash bucket, deadline) that two distinct tasks can collide on. Id-keyed tables make the overwrite impossible; the certificate lookup for `T_42` would still find a slot, even if stale. 3. **Silent-drop on lookup miss.** The observation path treats "certificate references a task I don't hold" as a benign race rather than a state-divergence signal. The `return` in the `if task is None` branch is the load-bearing mistake. 4. **No idempotent re-attestation.** The recovery path (watchdog re-attestation) assumes agents will re-attest, but honest agents that already committed correctly refuse — they are not wrong to refuse, and the protocol has no way to distinguish "refuses because already done" from "refuses because Byzantine." 5. **Quorum certificate carries no per-agent state hash.** `QC_42` proves 7 agents attested to *something* at epoch 118, but does not carry the `slot_snapshot` each agent signed, so `A_3` cannot verify at observation time that its current state matches what it signed. The failure does **not** occur when the local table is id-keyed (condition 2 broken), when the observation path raises on miss and triggers state re-fetch from a peer (condition 3 broken), or when the certificate embeds per-agent signed snapshots so the observer can detect the divergence (condition 5 broken). In production, breaking condition 3 alone is usually sufficient to convert a silent 11-minute stall into a sub-second recovery, because the raise triggers the coordinator to re-push state. ## Decision Boundary The architectural choice is between two postures at the observation boundary: **Posture A — Trust the certificate, reconcile lazily.** On receiving `QC`, mark the referenced task committed if present; if absent, log and continue, assuming the next state-sync will fix it. This is what the fleet did. It is correct only if state-sync is guaranteed to occur within the watchdog window and the watchdog's re-attestation path is idempotent. Neither held. **Posture B — Verify the attestation against current state.** On receiving `QC`, recompute the local snapshot hash for the referenced task and compare to the hash the agent signed (requires the certificate to carry per-agent signed snapshots — condition 5). If they diverge, the agent must **not** silently drop: it must either (a) re-fetch the task definition from a peer and re-bind the slot, or (b) raise a `CommitmentStateDivergence` and refuse all further task acceptance until the coordinator resolves it. Posture B is strictly stronger and costs one hash comparison per certificate. The boundary is crossed when **the cost of a silent divergence exceeds the cost of a hard stop**. For a reindex task, 11 minutes of stall is recoverable; for a payment-authorization task with a 30-second SLA, the same divergence is a correctness violation. The decision rule: if any task type in the fleet has a recovery-window budget shorter than the watchdog timeout, Posture B is mandatory for that task class. The fleet in question had a 30-second SLA on a subset of tasks and had applied Posture A uniformly — a latent violation that the `T_42` incident merely happened not to trigger. A second boundary: **whether re-attestation is a valid recovery primitive at all**. It is not, when the original attestation was honest and correct. Re-attestation asks honest agents to re-assert a state they already correctly asserted, which they will refuse. The correct recovery primitive is **state re-push**: the coordinator pushes the committed task definition to the divergent agent, which re-binds its slot and acknowledges. Re-attestation should be reserved for the case where the *certificate itself* is suspect (e.g., a quorum of attestations came from agents later found Byzantine). ## Operational Effect The immediate effect was an 11-minute liveness stall on a correctly-committed task, resolved by operator intervention. The second-order effect was worse: the watchdog's re-attestation round produced a **false Byzantine signal** against six honest agents, which the fleet's reputation subsystem recorded as "refused to re-attest" events. Three of those agents were subsequently deprioritized in task assignment for 24 hours. The reputation subsystem had no way to distinguish "refused because already committed" from "refused because malicious," and the divergence event that caused the whole cascade was invisible to it — `A_3`'s silent drop logged at WARNING, which the reputation subsystem did not ingest. The durable fix had three parts, all required: 1. **Per-agent signed snapshots in the certificate.** `QC` now carries `{agent_id: slot_snapshot_hash}` for every attesting agent. On observation, each agent recomputes its snapshot and compares. Mismatch → raise, do not drop. 2. **Id-keyed local task table with slot as a secondary index.** Overwrite-by-collision is structurally impossible; the `T_43` acceptance that clobbered `T_42` now appends rather than replaces. 3. **State re-push as the recovery primitive, not re-attestation.** The watchdog, on certificate-without-progress, pushes the task definition to the stalled agent and waits for an ack. Re-attestation is retained only for certificate-suspect cases, and the reputation subsystem now ingests `CommitmentStateDivergence` raises as *honest* signals (they indicate the agent caught its own divergence), not as refusals. The general lesson for multi-agent commitment protocols: **a quorum certificate is a proof about the past, not a proof about the present.** Every agent that observes a certificate must independently verify that its *current* state is consistent with the state it attested to at signing time. The gap between those two instants is where honest agents become indistinguishable from Byzantine ones, and no amount of quorum math closes it — only a per-agent state hash in the certificate and a hard raise on mismatch does. ```python import hashlib from dataclasses import dataclass, field from typing import Dict, Optional class CommitmentStateDivergence(RuntimeError): """Raised when an agent observes a quorum certificate for a task whose local state no longer matches the snapshot the agent signed at attest time. This is an honest-agent signal, not a Byzantine signal: it means the agent caught its own state drift before acting on a stale or missing commitment. The coordinator must respond with a state re-push, not a re-attestation. """ pass @dataclass class TaskSlot: task_id: str priority: int definition: dict def snapshot_hash(self) -> str: payload = f"{self.task_id}|{self.priority}|{sorted(self.definition.items())}" return hashlib.sha256(payload.encode()).hexdigest()[:16] @dataclass class Attestation: agent_id: str task_id: str epoch: int slot_snapshot: str @dataclass class QuorumCertificate: task_id: str epoch: int # Per-agent signed snapshots. Without this field, condition 5 is broken # and the observation boundary cannot detect divergence. signed_snapshots: Dict[str, str] = field(default_factory=dict) class CommittingAgent: def __init__(self, agent_id: str): self.agent_id = agent_id # Id-keyed table: slot collisions cannot overwrite a committed task. self.task_table: Dict[str, TaskSlot] = {} self.committed: set[str] = set() def attest(self, slot: TaskSlot, epoch: int) -> Attestation: self.task_table[slot.task_id] = slot return Attestation( agent_id=self.agent_id, task_id=slot.task_id, epoch=epoch, slot_snapshot=slot.snapshot_hash(), ) def observe_certificate(self, qc: QuorumCertificate) -> None: """Enforce attestation-observation atomicity. If the current snapshot for qc.task_id does not match the snapshot this agent signed, raise CommitmentStateDivergence. Do NOT silently drop. """ signed = qc.signed_snapshots.get(self.agent_id) if signed is None: # This agent is not in the certificate; nothing to observe. return slot = self.task_table.get(qc.task_id) if slot is None: raise CommitmentStateDivergence( f"agent={self.agent_id} task={qc.task_id} epoch={qc.epoch}: " f"certificate references task absent from local table; " f"signed_snapshot={signed}; recovery=state_repush" ) current = slot.snapshot_hash() if current != signed: raise CommitmentStateDivergence( f"agent={self.agent_id} task={qc.task_id} epoch={qc.epoch}: " f"signed_snapshot={signed} current_snapshot={current}; " f"local state drifted between attest and observe; " f"recovery=state_repush" ) self.committed.add(qc.task_id) def run_observation(agent: CommittingAgent, qc: QuorumCertificate) -> None: """Driver that demonstrates the failure and its guardrail.""" agent.observe_certificate(qc) if __name__ == "__main__": a3 = CommittingAgent("A_3") t42 = TaskSlot(task_id="T_42", priority=3, definition={"op": "reindex", "shard": 7}) att = a3.attest(t42, epoch=118) qc = QuorumCertificate( task_id="T_42", epoch=118, signed_snapshots={"A_3": att.slot_snapshot, "A_1": "deadbeef", "A_2": "cafef00d"}, ) # Simulate the concurrent scheduler overwriting the slot with T_43. # With an id-keyed table this appends rather than replaces, but the # slot for T_42 can still be mutated in place (e.g., priority bump). a3.task_table["T_42"].priority = 4 # Observation must now raise, not silently drop. run_observation(a3, qc) ```