# Why does an instance commit to a task quorum that outlives its own attestation key epoch? **Date of Record:** 2026 November 24 **Scope:** Applies to multi-agent swarms where task commitment is ratified by a Byzantine fault-tolerant (BFT) quorum and each agent attests results under a rotating signing key. Does not apply to single-agent retry logic or to stateless request/response orchestration without a commitment ledger. ## Core Distinction The failure here is not a forged signature and not a crashed replica. It is a *commitment/epoch skew*: a quorum certificate (QC) for a task commitment is valid at the moment it is formed, but the attestation key epoch that the committing agents used to sign the QC expires or rotates before the result attestation is produced. The consensus layer treats the QC as permanently valid because it carries enough signatures to satisfy the threshold at time *t*. The attestation layer treats the result as invalid because the same agents are now signing under epoch *t+1* and the verifier only holds the *t+1* key set. Both layers are individually correct. The invariant that is violated is the implicit one: **a commitment quorum and the attestation quorum for that commitment must share a key epoch, or the verifier must retain the historical key set keyed to the commitment's epoch.** This is non-obvious because a BFT quorum is usually discussed as a quorum of *messages*, not a quorum of *identities bound to a time-varying key*. Once keys rotate, a 2f+1 signature set is a statement about the past, and the verifier must be able to reconstruct the past. ## What Was Observed A swarm of 7 worker agents (f=2, threshold 2f+1=5) commits to a task `T` at epoch `e=41`. The commitment QC `QC_commit(T, e=41)` carries 5 signatures over `H(T || params || epoch=41)` from agents `{A1..A5}` under their epoch-41 public keys. The commitment is durably logged. The task executes for 18 minutes. During execution, the key-rotation daemon advances the swarm to epoch `e=42` at the scheduled boundary. Agents `A1..A5` now sign under epoch-42 keys; the verifier's active key registry contains only the epoch-42 set (the epoch-41 set was evicted by a TTL of 15 minutes chosen to bound registry size). When `A1..A3` finish and emit result attestations `attest(T, result, e=42)`, the verifier: 1. Looks up the commitment `QC_commit(T, e=41)` — valid, threshold met. 2. Looks up the attestation key set — epoch 42 only. 3. Attempts to verify the commitment signatures against the epoch-42 key set — **fails for all 5 signers**, because the signatures were made with epoch-41 private keys. The verifier raises a signature-mismatch, the commitment is flagged `UNVERIFIABLE`, and the task is re-queued. But the task already ran. Re-queueing causes the side effect to execute twice; the dedup key is `H(T)` which now has two result attestations under epoch 42 that both verify, and the reconciler cannot order them because neither carries the epoch-41 provenance. The observed trace: ``` t=0 QC_commit(T, e=41) formed, 5/7 sigs, logged t=0 commitment accepted, task dispatched t=840s rotation: active_keys := epoch_42; epoch_41 evicted (TTL 900s, but evicted early by size pressure) t=1080s attest(A1, T, result, e=42) -> verifier: commitment sigs fail vs epoch_42 t=1080s commitment marked UNVERIFIABLE, task re-queued t=1081s duplicate execution begins under same H(T) ``` The root trigger was not the rotation itself but the *early eviction* of the epoch-41 key set under registry size pressure — the TTL was a soft bound, and the actual eviction policy was LRU-by-size, which is not aligned with the commitment lifetime. The commitment lifetime (18 min) exceeded the retained key window (14 min). ## Condition of Validity The invariant holds only if, for every commitment `C` with epoch `e_C`, the verifier retains the public key set for `e_C` for at least `max(commitment_lifetime) + attestation_window + reconciliation_slack`. Concretely: - `retain(e) >= now - (max_task_duration + attestation_timeout + reconcile_grace)`. - The key registry's eviction policy must be *epoch-monotonic* (evict oldest epoch only when no live commitment references it), not LRU-by-size or wall-clock TTL. - The commitment record must carry `e_C` explicitly and the verifier must resolve keys *by the epoch in the record*, never by "current active epoch." If any of these three is absent, a commitment can be ratified under a key set that the verifier can no longer reconstruct when the attestation arrives. The failure is silent at commit time — the QC is genuinely valid — and only surfaces at attestation, after side effects have occurred. ## Decision Boundary The boundary is between two defensible designs: 1. **Epoch-pinned verification** (correct): the commitment record pins `e_C`; the verifier resolves the historical key set by `e_C`; eviction is gated on "no live commitment references this epoch." Rotation is transparent to in-flight tasks. 2. **Epoch-coherent commitment** (also correct, more restrictive): refuse to commit a task whose expected duration exceeds the remaining epoch lifetime, forcing either a shorter epoch or a commitment that completes before rotation. This bounds the problem by construction but rejects long tasks. The failure occurs in the *gap*: a system that pins nothing and assumes "current keys" are always the right keys, while allowing task duration to exceed key retention. The decision is: either pin the epoch in the commitment and retain keys accordingly, or reject commitments that would span a rotation. There is no correct middle ground where the commitment outlives its key set and the verifier has no historical view. ## Operational Effect Downstream, the observable effects are: duplicate execution of side-effecting tasks (the re-queue path), non-deterministic reconciliation when two epoch-42 attestations exist for the same `H(T)` with no ordering provenance, and audit failure because the commitment's signatures cannot be re-verified post-hoc. The swarm's liveness is preserved (tasks eventually complete) but safety of exactly-once execution is lost. The fix is not in the consensus protocol — the BFT quorum did its job — it is in the *key-retention contract* that the consensus layer implicitly depends on and never states. Operational guardrail: treat the epoch-41 key set as part of the commitment's validity proof, not as external configuration, and gate eviction on live-commitment reference counting rather than TTL. ```python import hashlib from dataclasses import dataclass, field from typing import Dict, Set class EpochSkewError(RuntimeError): """Raised when a commitment's key epoch is no longer reconstructable at attestation time.""" pass @dataclass class Commitment: task_hash: str epoch: int signers: Set[str] signatures: Dict[str, bytes] = field(default_factory=dict) class EpochKeyRegistry: def __init__(self): # epoch -> {agent_id -> public_key} self._keys: Dict[int, Dict[str, bytes]] = {} # epoch -> set of live commitment task_hashes referencing it self._refs: Dict[int, Set[str]] = field(default_factory=dict) def install(self, epoch: int, keys: Dict[str, bytes]) -> None: self._keys[epoch] = keys self._refs.setdefault(epoch, set()) def pin(self, commitment: Commitment) -> None: if commitment.epoch not in self._keys: raise EpochSkewError( f"cannot pin commitment {commitment.task_hash}: epoch {commitment.epoch} unknown" ) self._refs[commitment.epoch].add(commitment.task_hash) def release(self, commitment: Commitment) -> None: self._refs.get(commitment.epoch, set()).discard(commitment.task_hash) def evict(self, epoch: int) -> None: # Guardrail: never evict an epoch that still backs a live commitment. if self._refs.get(epoch): raise EpochSkewError( f"refusing to evict epoch {epoch}: {len(self._refs[epoch])} live commitments reference it" ) self._keys.pop(epoch, None) self._refs.pop(epoch, None) def verify_commitment(self, commitment: Commitment, threshold: int) -> bool: # Resolve keys by the commitment's *own* epoch, never the "active" epoch. epoch_keys = self._keys.get(commitment.epoch) if epoch_keys is None: raise EpochSkewError( f"epoch {commitment.epoch} for commitment {commitment.task_hash} " f"was evicted before attestation; cannot reconstruct quorum" ) valid = sum( 1 for agent, sig in commitment.signatures.items() if agent in epoch_keys and _sig_ok(epoch_keys[agent], commitment, sig) ) return valid >= threshold def _sig_ok(pub: bytes, c: Commitment, sig: bytes) -> bool: # Placeholder for real signature check; binds task, params, and epoch. return hashlib.sha256(pub + c.task_hash.encode() + str(c.epoch).encode()).digest() == sig def attest_result(registry: EpochKeyRegistry, commitment: Commitment, threshold: int) -> bool: if not registry.verify_commitment(commitment, threshold): raise EpochSkewError( f"attestation rejected for {commitment.task_hash}: commitment quorum " f"not verifiable under epoch {commitment.epoch}" ) return True ```