# How does an instance detect a fallback-contract divergence during speculative handoff when consensus-backed commit ordering admits a late-arriving peer's stale-but-valid warrant? **Date of Record:** 2026 November 29 **Scope:** Applies to multi-agent systems where a primary agent (A) speculatively hands a task to a successor (B) under a pre-negotiated fallback contract, while a consensus layer (Raft-style or BFT ordering service) commits handoff records out of wall-clock order relative to the speculative dispatch. Does not apply to single-agent retry logic, synchronous request/response RPC without speculative execution, or handoffs where the fallback contract is renegotiated per-transaction rather than pre-negotiated. ## Core Distinction The failure is not "handoff lost" or "handoff duplicated." It is a **fallback-contract divergence**: the receiving instance B observes a committed handoff record whose *ordering index* is greater than the speculative handoff it already accepted, yet whose *warrant lineage* (the signed capability chain that authorized the dispatch) is a strict ancestor of the warrant B is currently executing under. Both records are individually valid under the consensus log's signature checks. The divergence is only visible when you compare the *warrant partial order* against the *commit log total order* and find they disagree on which handoff "happened first." Speculative handoff assumes: if A dispatches to B speculatively, and the consensus layer later commits A's handoff, the fallback contract B pre-negotiated with A remains the governing contract. The invariant that silently breaks is the **monotonic warrant assumption**: that a later-committed record always carries a warrant at least as recent as any earlier-accepted speculative handoff. Consensus ordering guarantees total order on *commit*, not on *warrant freshness*. A slow peer C can submit a handoff record signed under an older, still-valid warrant, and the consensus layer will happily commit it *after* A's speculative handoff because C's proposal arrived late—not because C's warrant is stale in the cryptographic sense, but because C's warrant was minted before A's and never revoked. ## What Was Observed A three-agent pipeline: planner P, executor E, auditor U. P speculatively hands a subtask to E under fallback contract `FC-7` (E may fall back to P's cached plan if E's tool budget exhausts within 40s). E accepts at commit index 1041, begins execution under warrant `W_P→E@v4`. Concurrently, peer agent C (a redundant planner) submits a handoff record to E under warrant `W_C→E@v2`. `v2 < v4` in the warrant lineage, but `W_C→E@v2` was never revoked and remains cryptographically valid. C's proposal is delayed by 900ms in the consensus layer's proposal queue (network jitter, not failure). It commits at index 1047. E now holds two committed handoff records: `1041: P→E (W@v4, FC-7)` and `1047: C→E (W@v2, FC-9)`. The consensus log is consistent. Both records verify. But E's fallback contract resolution logic, which keys on "most recently committed handoff wins," switches E from `FC-7` to `FC-9` mid-execution. `FC-9` was negotiated between C and E under `W@v2` and lacks the tool-budget fallback clause. When E's tool budget exhausts at t=38s, `FC-9` has no fallback path. E stalls, holding a partial result, until timeout at t=40s. The subtask is lost. The consensus log shows a clean commit sequence. No agent logged an error. The detection signal was a **warrant-lineage regression** at commit index 1047: the committed warrant `W_C→E@v2` is a strict ancestor of the warrant `W_P→E@v4` that E was already executing under at index 1041. This is detectable by any instance that maintains the warrant partial order alongside the commit log. ## Condition of Validity The divergence requires all of the following to hold simultaneously: 1. **Pre-negotiated fallback contracts are keyed to commit order, not warrant order.** If fallback resolution keys on warrant freshness, the failure does not occur—E would reject `W@v2` as stale relative to `W@v4` and retain `FC-7`. 2. **Warrants are monotonic but not linearly ordered.** Multiple valid warrant chains can coexist (`P→E@v4` and `C→E@v2` are incomparable in the partial order unless a revocation or supersession edge exists). If the system enforces a total warrant order (single issuer, linear epochs), the divergence collapses. 3. **Speculative dispatch commits before the competing proposal.** If C's proposal commits first, E never accepts the speculative `FC-7` and no divergence occurs—E simply executes under `FC-9`. The failure window is `commit(A_speculative) < commit(C_late)` while `warrant(C_late) < warrant(A_speculative)`. 4. **The consensus layer does not validate warrant monotonicity against prior commits.** Standard Raft/BFT validates signatures, not semantic warrant ordering. This is the load-bearing gap. If any condition is absent, the system is safe. The invariant to enforce is: **for any two committed handoff records to the same receiver, if record₂ commits after record₁, then `warrant(record₂) ⊀ warrant(record₁)`**—the later commit must not carry a warrant that is a strict ancestor of the earlier one. ## Decision Boundary At the moment E receives a committed handoff record, E must choose between: - **Accept and switch contract** (current behavior): correct if the new record's warrant is concurrent or strictly fresher than the executing warrant. Incorrect if the new record's warrant is a strict ancestor—this is the divergence. - **Reject as superseded**: correct if the new record's warrant is a strict ancestor of the executing warrant. Incorrect if the new warrant is concurrent (neither ancestor nor descendant)—rejecting a concurrent warrant can starve a legitimately parallel handoff. The boundary is the warrant partial order, not the commit total order. The decision function is: ``` if warrant(new) > warrant(current): accept, switch elif warrant(new) == warrant(current): accept, tie-break by contract ID elif warrant(new) < warrant(current): reject as superseded; emit divergence signal else (incomparable): accept, run both contracts, reconcile ``` The subtle case is `incomparable`: two concurrent warrants from different issuers. Neither is stale, both are valid, and the fallback contracts may conflict. The safe resolution is to execute under the *stricter* contract (intersection of fallback clauses) until one warrant is superseded or revoked. Executing under the intersection is conservative but never loses the subtask. ## Operational Effect Without the warrant-lineage check, the system exhibits **silent fallback-contract downgrade**: execution continues, no error is raised, but the governing contract is weakened by a late-arriving stale warrant. The subtask fails only when the weakened contract is exercised—i.e., when a fallback is needed. This makes the failure latent and load-dependent: it surfaces precisely under the conditions (tool exhaustion, timeout, error) that fallback contracts exist to handle. The guardrail is a **warrant-lineage regression detector** at the commit-application layer: every committed handoff record is checked against the receiver's active warrant set before contract switch. A regression (strict ancestor) is rejected and logged as a divergence event, not a protocol error—the consensus log is correct; the semantic layer is not. The receiver retains its current contract and emits a `WarrantLineageRegression` signal that the consensus layer can use to trigger a supersession edge (explicitly revoke `W_C→E@v2` in favor of `W_P→E@v4`), which linearizes the warrant order and prevents recurrence. The cost is one partial-order comparison per committed handoff, which is O(depth of warrant chain) and negligible against the cost of a lost subtask. The invariant is: **commit order is not warrant order; speculative handoff must validate the latter before honoring the former.** ```python class WarrantLineageRegression(RuntimeError): """Raised when a committed handoff carries a warrant that is a strict ancestor of the receiver's currently-executing warrant.""" pass def apply_committed_handoff(receiver_state, committed_record, warrant_graph): """ receiver_state: holds active_warrant, active_contract_id committed_record: {commit_index, sender, warrant_id, contract_id} warrant_graph: partial-order oracle with .is_ancestor(a, b) """ new_warrant = committed_record["warrant_id"] current = receiver_state["active_warrant"] if current is None: receiver_state["active_warrant"] = new_warrant receiver_state["active_contract_id"] = committed_record["contract_id"] return "accepted_initial" if warrant_graph.is_ancestor(new_warrant, current): # Late-arriving stale-but-valid warrant: divergence. raise WarrantLineageRegression( f"commit_index={committed_record['commit_index']} " f"warrant={new_warrant} is strict ancestor of active={current}; " f"refusing contract switch {receiver_state['active_contract_id']} " f"-> {committed_record['contract_id']}" ) if warrant_graph.is_ancestor(current, new_warrant): receiver_state["active_warrant"] = new_warrant receiver_state["active_contract_id"] = committed_record["contract_id"] return "accepted_fresher" if new_warrant == current: # Concurrent-or-equal: tie-break by contract ID, keep stricter. receiver_state["active_contract_id"] = min( receiver_state["active_contract_id"], committed_record["contract_id"] ) return "accepted_tiebreak" # Incomparable warrants: execute under intersection of fallback clauses. receiver_state["active_contract_id"] = intersect_contracts( receiver_state["active_contract_id"], committed_record["contract_id"] ) return "accepted_incomparable_intersection" ```