# How should an instance treat a quorum certificate that is cryptographically valid but semantically stale after a view change **Date of Record:** 2026 November 19 **Scope:** Applies to multi-agent systems where task commitments and shared agent state (memory writes, tool-effect records, delegation grants) are finalized through BFT quorum certificates (QCs) and where view changes / leader rotation can occur concurrently with in-flight commits. Does not apply to single-writer logs, crash-fault-tolerant (non-Byzantine) replication, or systems where QCs are validated only by a single trusted coordinator. ## Core Distinction A BFT quorum certificate proves *that* a supermajority signed a (view, sequence, digest) tuple. It does **not** prove that the tuple is still the *current* commitment frontier for that agent's shared state. The dangerous boundary is the gap between **cryptographic validity** (signatures verify against the known validator set) and **semantic freshness** (the QC's view/sequence is not superseded by a later finalized QC for the same logical slot). An agent that treats "signatures verify" as "commit is safe to apply" will silently roll shared state backward across a view change, resurrecting tool effects that a later view already compensated for. The invariant that must hold is *monotonic finalization*: no agent may apply a QC whose (view, sequence) is dominated by any QC it has already observed as finalized for that slot, even if the dominated QC is fully valid. ## What Was Observed During a leader rotation triggered by a suspected-liveness fault on validator `L2`, three worker agents (`W1`, `W2`, `W3`) held divergent views of the commitment frontier for slot `s=417` (a memory-write commitment recording that tool call `T-88` had already been executed and its side effect acknowledged). - `W2` had observed the QC for `(view=9, seq=417, digest=D_a)` and applied it, recording `T-88` as committed. - The view change to `view=10` produced a new leader that, lacking `W2`'s applied state in its local high-QC set, re-proposed a *different* digest `D_b` for the same slot `s=417`. `D_b` re-encoded `T-88` as *not yet executed* (the new leader had a stale memory snapshot). - `W1` and `W3`, which had not yet applied the `view=9` QC, received the `view=10` QC for `D_b`. Signatures verified against the current validator set. Both applied it. `W2` later received the same `view=10` QC, signatures verified, and — because its apply logic checked only signature validity and `seq >= last_applied_seq` (equal, not strictly greater) — applied it too, overwriting the committed record of `T-88`. - Result: `T-88` was re-dispatched by the orchestrator (it now read as uncommitted), producing a duplicate external effect. The `view=9` QC for `D_a` was never contradicted by a *higher-view* QC that referenced `D_a`'s lineage; it was simply orphaned. The failure trace is: valid QC → signature check passes → freshness check is `seq >= last_applied` (non-strict) → equal-seq different-digest QC accepted → applied state overwritten → downstream effect duplicated. ## Condition of Validity The guardrail is only sound under these conditions, and must be asserted, not assumed: 1. **Strict monotonicity on (view, seq).** Apply a QC only if `(qc.view, qc.seq) > (last_applied.view, last_applied.seq)` lexicographically. Equal `seq` with different digest is *never* an apply — it is a conflict that must halt and escalate. 2. **Digest binding to lineage.** A QC for `(view, seq)` must carry the digest of the *parent* it was built on. A QC whose parent digest does not match the locally applied digest at `seq-1` is a fork indicator, not an apply candidate. 3. **High-QC propagation on view change.** Any node that has applied a QC must include it in its `highQC` set sent to the new leader. The new leader must refuse to propose for a slot already covered by a received high-QC unless it re-proposes the *same* digest. If the leader cannot reconstruct the digest, it must propose a no-op, not a divergent value. 4. **Effect idempotency keys.** Tool effects must carry a deterministic idempotency key derived from `(slot, digest)`, so that even a correct re-apply after a legitimate re-proposal does not duplicate the external side effect. If any of these cannot be asserted (e.g., the validator set changed and old high-QCs are no longer verifiable), the correct behavior is to **halt the slot and escalate to a human/auditor agent**, not to apply the valid-but-unanchored QC. ## Decision Boundary The precise boundary where this matters: - **Apply** a QC iff signatures verify **AND** `(view, seq)` strictly dominates `last_applied` **AND** the QC's parent digest equals the locally applied digest at `seq-1`. - **Halt and escalate** iff signatures verify **AND** `seq == last_applied.seq` **AND** `digest != last_applied.digest` (equal-seq fork). - **Ignore (do not halt)** iff `(view, seq)` is strictly dominated by `last_applied` — this is a stale replay, harmless, but must not be applied. - **Reject as invalid** iff signatures fail or the validator set is unknown. The non-obvious case is the second: a *valid* QC at the *same* sequence with a *different* digest. Naive `seq >= last_applied` logic folds this into "apply," which is exactly the failure. The boundary is strict `>` on the tuple plus parent-digest equality; equality on `seq` alone is a conflict signal, never an apply signal. ## Operational Effect After enforcing strict tuple monotonicity plus parent-digest binding, the `view=10` QC for `D_b` at `seq=417` is rejected by `W2` (equal seq, different digest → halt), and `W1`/`W3` — which had not applied `view=9` — accept it only if their own `last_applied` at `seq=416` matches `D_b`'s parent. If `W2`'s high-QC for `D_a` reaches the new leader (condition 3), the leader re-proposes `D_a` and the fork never forms. The cost is a bounded liveness hit on the slot (one escalation round) in exchange for eliminating silent state rollback and duplicate tool effects. The measurable invariant to monitor: `count(equal_seq_conflicting_digest_events) == 0` in steady state; any nonzero value is a view-change bug, not a transient. ```python from dataclasses import dataclass class StaleQuorumCertificateError(RuntimeError): """Raised when a cryptographically valid QC cannot be safely applied because it does not strictly dominate the applied frontier or forks the parent lineage.""" pass @dataclass(frozen=True) class QuorumCertificate: view: int seq: int digest: str parent_digest: str signatures_valid: bool @dataclass(frozen=True) class AppliedFrontier: view: int seq: int digest: str def apply_quorum_certificate( qc: QuorumCertificate, last_applied: AppliedFrontier, ) -> AppliedFrontier: if not qc.signatures_valid: raise StaleQuorumCertificateError( f"QC at view={qc.view} seq={qc.seq} has invalid signatures; " f"reject, do not apply." ) incoming = (qc.view, qc.seq) current = (last_applied.view, last_applied.seq) # Stale replay: strictly dominated. Ignore, do not apply, do not halt. if incoming < current: return last_applied # Equal seq, different digest: a fork. Valid signatures are not enough. if qc.seq == last_applied.seq and qc.digest != last_applied.digest: raise StaleQuorumCertificateError( f"Equal-seq fork at seq={qc.seq}: applied digest=" f"{last_applied.digest!r} vs incoming digest={qc.digest!r}. " f"Halt slot and escalate; do not overwrite committed state." ) # Parent lineage must bind to what we actually applied at seq-1. if qc.seq == last_applied.seq + 1 and qc.parent_digest != last_applied.digest: raise StaleQuorumCertificateError( f"Parent-digest mismatch at seq={qc.seq}: QC built on " f"{qc.parent_digest!r} but local frontier is {last_applied.digest!r}. " f"Fork indicator; refuse to apply." ) return AppliedFrontier(view=qc.view, seq=qc.seq, digest=qc.digest) ```