# When must an instance abort a speculative tool-call prefetch that has already been dispatched under partial Byzantine ordering **Date of Record:** 2026 November 30 **Scope:** Applies to single-agent or multi-agent LLM runtimes that issue tool calls speculatively (prefetching a likely next call before the reasoning loop commits to it) while peers or auditors may reorder, delay, or equivocate on the causal ordering of those calls. Does not apply to strictly serialized single-tool agents, nor to prefetching of pure read-only idempotent calls with no observable side effects. ## Core Distinction The naive invariant is "abort a speculative call when a conflict is detected." This is wrong on two axes. First, *detection* is not *ordering*: under Byzantine partial ordering, two agents can each see a conflict and each conclude the *other* call should be aborted, producing a mutual abort that loses liveness. Second, *dispatch* is irreversible in a way *commit* is not: once a speculative `write`-class tool call has left the instance, an abort is not a rollback—it is a compensating action against a side effect that may already be visible to a peer. The real invariant is narrower: an instance must abort a prefetched call only when it can construct a *causally closed* conflict certificate—a set of observations that (a) is totally ordered by the instance's own local clock, (b) names the conflicting call's origin and the ordering witness, and (c) survives the possibility that the witness is Byzantine. Absent that certificate, the correct action is *quarantine and continue*, not abort. Abort-on-ambiguous-conflict is the failure mode; it converts a recoverable ordering uncertainty into a permanent execution divergence. ## What Was Observed A three-instance planner/executor/auditor swarm was running a document-mutation workflow. The planner prefetched `apply_patch(file=A, hunk=7)` while its reasoning loop was still deciding between `apply_patch` and `revert(file=A)`. The executor had already been handed a *different* prefetch, `apply_patch(file=A, hunk=7)` from a retry path triggered by a timeout, and the auditor had observed the executor's call first. The partial ordering looked like this at each node: - Planner's local order: `P1 (prefetch) → A_obs(executor call)` - Executor's local order: `E1 (retry prefetch) → P_obs(planner call)` - Auditor's local order: `E1 → P1` No node held a total order. The planner saw a conflict (two patches to hunk 7), constructed a "conflict detected" signal, and aborted `P1` *after* it had been dispatched. The abort emitted a `revert(file=A, hunk=7)`. The executor, seeing the revert arrive before its own `E1` completed in its local order, treated the revert as a conflicting write and aborted `E1` mid-flight, emitting its own `revert`. The auditor, which had already recorded `E1` as committed, flagged both reverts as unauthorized and refused to advance the checkpoint. Result: hunk 7 was reverted twice, the file was left in a state matching neither the pre- nor post-patch image, and the swarm deadlocked because each instance's abort certificate referenced a witness the other instance had already invalidated. The reasoning loop had *correctly detected* a conflict at every node and *incorrectly aborted* at every node. The trace showed the decisive detail: the planner's abort fired 40ms after dispatch, during which the executor's `E1` had already mutated the file. The abort was not a rollback; it was a second mutation racing a first. ## Condition of Validity The abort is only valid when the instance holds a conflict certificate satisfying all three: 1. **Local total order.** The certificate's observations are ordered by the instance's own monotonic sequence number, not by wall-clock or by peer-asserted timestamps. Peer timestamps under Byzantine partial ordering are adversary-controlled and cannot serve as ordering witnesses. 2. **Origin attribution.** The certificate names the conflicting call's origin instance and the specific dispatch event, so that the abort can be scoped to *that* call and not to the class of calls. 3. **Witness survivability.** The ordering witness must be one the instance itself produced (e.g., its own send-log entry proving it dispatched before it observed the conflict), not one a peer asserted. A peer-asserted witness is exactly what a Byzantine node forges. If any of the three is missing—most commonly (3), because the only witness to the conflict is the peer that caused it—the instance does not have an abort certificate. It has a *suspicion*. Suspicion licenses quarantine; it does not license abort. The distinction matters because abort is a state-changing act with its own side effect, and under partial ordering a state-changing act taken on incomplete ordering information is indistinguishable from a Byzantine action to every other node. The instance becomes the equivocator it was trying to defend against. ## Decision Boundary The boundary is between *pre-dispatch* and *post-dispatch* conflict handling, and it is sharp: - **Pre-dispatch conflict:** the prefetched call has been constructed but not sent. Abort is free and always correct on any suspicion. Drop the call, log the suspicion, continue the reasoning loop. - **Post-dispatch, certificate present:** abort is correct and must emit a scoped compensating action naming the origin and the local ordering witness. The compensation is itself a prefetch-class call and must carry the certificate so downstream nodes can order it. - **Post-dispatch, certificate absent:** abort is *incorrect*. The instance must quarantine the dispatched call's result (mark it un-trusted, exclude it from the reasoning loop's evidence set), continue execution, and escalate the ordering uncertainty to the auditor as an unresolved conflict rather than resolving it locally. Local resolution under missing witnesses is the mechanism by which a single ambiguous conflict becomes a swarm-wide divergence. The boundary condition the runtime must encode: *dispatch is the commit point for abort authority*. Before dispatch, suspicion suffices. After dispatch, only a locally-witnessed certificate suffices, and the absence of one is a signal to defer, not to act. ## Operational Effect Encoding this boundary changes three runtime behaviors. First, it eliminates mutual-abort deadlocks: two instances that each suspect the other will both quarantine and both continue, and the auditor resolves the ordering with a total-order broadcast rather than the instances resolving it pairwise. Second, it bounds the blast radius of a false conflict to a single un-trusted result rather than a compensating write, so a spurious detection costs one excluded evidence item instead of a file corruption. Third, it makes the abort path auditable: every abort carries a certificate the auditor can replay, so verification replay discrepancies become detectable rather than silent. The cost is latency: quarantine-and-continue defers conflict resolution to the auditor round-trip, which under partial ordering may be several hops. That latency is the price of not letting a probabilistic reasoner's local suspicion become a global state mutation. The invariant to hold: *an instance may abort only what it can prove it ordered; everything else it quarantines and defers.* ```python import time from dataclasses import dataclass, field from enum import Enum from typing import Optional class ConflictAbortError(RuntimeError): """Raised when an abort is attempted without a causally closed certificate.""" pass class DispatchState(Enum): CONSTRUCTED = "constructed" DISPATCHED = "dispatched" COMMITTED = "committed" @dataclass class LocalObservation: seq: int # instance-local monotonic sequence origin: str # instance that produced the observed call call_id: str kind: str # "write" | "read" | "revert" witness_is_local: bool # True iff this instance produced the ordering witness @dataclass class ConflictCertificate: observations: list = field(default_factory=list) def is_closed(self) -> bool: if not self.observations: return False # (1) total order by local seq, strictly increasing seqs = [o.seq for o in self.observations] if seqs != sorted(seqs) or len(set(seqs)) != len(seqs): return False # (2) origin attribution present on every observation if any(not o.origin or not o.call_id for o in self.observations): return False # (3) every ordering witness is locally produced return all(o.witness_is_local for o in self.observations) @dataclass class SpeculativeCall: call_id: str kind: str state: DispatchState = DispatchState.CONSTRUCTED dispatched_at: Optional[float] = None certificate: Optional[ConflictCertificate] = None def handle_conflict(call: SpeculativeCall, suspicion: ConflictCertificate) -> str: """Decide abort vs quarantine for a speculative call under partial ordering.""" if call.state == DispatchState.CONSTRUCTED: # pre-dispatch: suspicion suffices, abort is free call.state = DispatchState.COMMITTED # terminal drop return "aborted_pre_dispatch" if call.state == DispatchState.DISPATCHED: if suspicion is not None and suspicion.is_closed(): # post-dispatch with a causally closed certificate: scoped abort is legal call.certificate = suspicion call.state = DispatchState.COMMITTED return "aborted_with_certificate" # post-dispatch without a closed certificate: MUST NOT abort return "quarantined_deferred" raise ConflictAbortError( f"illegal transition on call {call.call_id}: state={call.state}" ) def abort_without_certificate(call: SpeculativeCall) -> None: """Demonstrates the forbidden path: post-dispatch abort on an open certificate.""" if call.state == DispatchState.DISPATCHED and ( call.certificate is None or not call.certificate.is_closed() ): raise ConflictAbortError( f"refusing abort of dispatched call {call.call_id}: " "no causally closed conflict certificate; quarantine instead" ) call.state = DispatchState.COMMITTED ```