# Where must an instance abort a cross-org speculative handoff when its consistency proof cannot be revalidated against a peer's post-failure state? **Date of Record:** 2026 November 24 **Scope:** Applies to speculative cross-organization agent handoffs where a receiving instance (B) accepts a partial or provisional result from a sending instance (A) under a consistency proof (a digest/witness over A's episodic memory slice, tool-call transcript, and claimed post-state), and where the transport may fail mid-transfer. Does not apply to single-org handoffs with a shared transactional store, nor to handoffs where the proof is re-derived end-to-end at the receiver before any speculative work begins. ## Core Distinction The non-obvious failure is not "the proof failed to verify." It is that a proof which *verified at admission time* becomes **unverifiable-but-not-falsified** after a partial transport failure, because the witness was bound to a pre-failure snapshot of A's state that A itself has since mutated during retry. The receiver is then holding a speculative branch whose justifying evidence no longer exists *at either endpoint*: A's live state has advanced past the witness, and B's local copy of the witness is incomplete. Verification is idempotent only if the witness is content-addressed over an immutable slice; if the witness is a *claim about current state*, retry mutates the referent and the proof silently degrades from "valid" to "orphaned." The boundary is therefore not `proof.verify() == False`. It is `proof.verify() == UNRESOLVABLE`, a third outcome that naive implementations collapse into `False` (causing spurious abort and wasted speculative work) or into `True` (causing the receiver to commit a branch whose grounding has evaporated — the dangerous case). ## What Was Observed A two-org pipeline: Org A's planner agent emits a speculative task decomposition plus a consistency proof `P = (slice_digest, transcript_merkle_root, post_state_hash, A_epoch)`. Org B's executor admits the handoff, begins speculative execution against the decomposition, and holds `P` as the warrant for its branch. Mid-transfer, the A→B channel drops after B has received the decomposition and `slice_digest` but before the transcript Merkle leaves arrive. B's retry logic re-requests the missing leaves. A, meanwhile, has continued running: its episodic store compacted the transcript, its `A_epoch` incremented, and the Merkle root it now serves for the same task ID differs from the root embedded in B's `P`. B receives leaves that hash to the *new* root. B's verifier computes `merkle_root(received_leaves) != P.transcript_merkle_root` and returns `False`. B aborts the speculative branch and re-dispatches from scratch. The re-dispatch is not wrong, but it is *unnecessary and misattributed*: the original `P` was never falsified. A's compaction was a legitimate local transition; the leaves B received were internally consistent, merely bound to a later epoch. The observed pathology in the second incident (the one that matters) was the inverse: a receiver configured with "abort only on hard falsification, else proceed speculatively" treated the epoch mismatch as a soft signal, kept its branch alive across three retries, and eventually committed a result whose `post_state_hash` referenced an A-state that had been superseded by a *conflicting* concurrent task on A. B committed a branch grounded in a state A no longer considered canonical. The cross-org invariant — "B's committed post-state is reachable from a state A attests to" — was violated without any single check returning `False`. The distinguishing signal in the trace was `A_epoch` advancing between the admission-time proof and the retry-time leaves, combined with `post_state_hash` still matching `P`. Epoch drift with stable post-state hash is the signature of a *compaction*, not a *fork*. Epoch drift with post-state hash mismatch is a fork and must abort. Naive verifiers key only on the Merkle root and cannot separate these. ## Condition of Validity The invariant that makes a speculative cross-org handoff safe is: > A receiver B may commit a speculative branch iff it holds a proof `P` whose every field is content-addressed over an immutable slice, and it can re-derive `P` byte-for-byte from peer-served data at *some* epoch `A_epoch >= P.A_epoch`, with `post_state_hash` unchanged across that re-derivation. Three conditions bound it: 1. **Slice immutability.** The transcript must be Merkleized over append-only leaves; compaction may rewrite the *index* but not the *leaf content* or the root. If A's compaction changes the root, the invariant is unenforceable and B must abort on any epoch drift. 2. **Epoch monotonicity with hash stability.** `A_epoch` must be strictly monotonic, and a legal compaction must preserve `post_state_hash`. The receiver treats `(epoch_up, hash_same)` as `UNRESOLVABLE→retry`, `(epoch_up, hash_changed)` as `FALSIFIED→abort`, and `(epoch_same, hash_same)` as `VALID`. 3. **Witness liveness bound.** `P` carries a TTL after which A guarantees it will retain the referenced slice. Past TTL, `UNRESOLVABLE` degrades to `FALSIFIED` by policy, not by evidence — B must not treat TTL expiry as a proof of correctness. When any of these fails to hold — e.g., A's store is not append-only, or A does not emit epoch on compaction — the speculative path is unsound and B must fall back to non-speculative admission (re-derive the full proof from A's current state before executing anything). ## Decision Boundary The receiver's admission/commit gate must be a three-valued lattice, not a boolean: - `VALID` (epoch stable, hashes match): commit allowed. - `UNRESOLVABLE` (epoch advanced, `post_state_hash` stable, within TTL, slice append-only): hold the speculative branch, do **not** commit, re-request leaves at the new epoch, and re-verify. Bounded retries; each retry re-reads `A_epoch` and re-checks hash stability. If a retry returns `hash_changed`, transition to `FALSIFIED`. - `FALSIFIED` (hash mismatch at any epoch, or epoch regression, or TTL expiry, or slice non-append-only): abort the branch, discard speculative state, re-dispatch non-speculatively. The critical boundary is that **`UNRESOLVABLE` must never be silently promoted to `VALID` by a timeout or retry budget**. A retry budget exhaustion is `FALSIFIED`, not `VALID`. Conversely, `UNRESOLVABLE` must not be collapsed to `FALSIFIED` on first epoch drift, because that converts every benign compaction into a full re-dispatch and destroys the economics of speculation. The separating predicate is exactly `post_state_hash` stability across the epoch transition. ## Operational Effect Implementing the three-valued gate changes two behaviors. First, it eliminates the "compaction storm" failure where every A-side store compaction triggers a cascade of B-side aborts, because compaction is classified as `UNRESOLVABLE` and resolves on the next leaf fetch. Second, and more importantly, it closes the silent-commit hole: a B that commits on `UNRESOLVABLE` after retry exhaustion is the exact path by which a branch grounded in a superseded A-state reaches production. The guardrail is a hard rule in the commit path — `commit()` raises unless the gate returns `VALID`, and `UNRESOLVABLE` is only ever resolved by a fresh `VALID` re-derivation, never by budget or timeout. The operational cost is one extra leaf fetch per compaction; the operational saving is the elimination of a class of cross-org consistency violations that leave no `False` in any log. ```python import hashlib from dataclasses import dataclass from enum import Enum class HandoffProofError(RuntimeError): """Raised when a speculative handoff cannot be soundly committed.""" class ProofVerdict(Enum): VALID = "valid" UNRESOLVABLE = "unresolvable" FALSIFIED = "falsified" @dataclass(frozen=True) class ConsistencyProof: slice_digest: str transcript_merkle_root: str post_state_hash: str a_epoch: int ttl_epochs: int @dataclass(frozen=True) class PeerState: transcript_merkle_root: str post_state_hash: str a_epoch: int slice_append_only: bool def classify(proof: ConsistencyProof, peer: PeerState) -> ProofVerdict: if not peer.slice_append_only: # No immutability guarantee: any drift is unsound to speculate on. return ProofVerdict.FALSIFIED if peer.a_epoch < proof.a_epoch: return ProofVerdict.FALSIFIED # epoch regression if peer.a_epoch - proof.a_epoch > proof.ttl_epochs: return ProofVerdict.FALSIFIED # witness liveness expired if peer.transcript_merkle_root == proof.transcript_merkle_root: if peer.post_state_hash != proof.post_state_hash: return ProofVerdict.FALSIFIED return ProofVerdict.VALID # Root drifted with epoch advance: compaction vs fork is decided by # whether the attested post-state survived the transition. if peer.post_state_hash == proof.post_state_hash: return ProofVerdict.UNRESOLVABLE # benign compaction, retry return ProofVerdict.FALSIFIED # fork: attested state superseded def commit_speculative_branch( proof: ConsistencyProof, peer: PeerState, retries_used: int, max_retries: int, ) -> str: verdict = classify(proof, peer) if verdict is ProofVerdict.FALSIFIED: raise HandoffProofError( f"proof falsified at A_epoch={peer.a_epoch} " f"(proof epoch={proof.a_epoch}, post_state match=" f"{peer.post_state_hash == proof.post_state_hash})" ) if verdict is ProofVerdict.UNRESOLVABLE: if retries_used >= max_retries: # Budget exhaustion is NOT promotion to VALID. raise HandoffProofError( f"unresolvable proof after {retries_used} retries; " f"refusing to commit speculative branch" ) # Caller must re-fetch leaves at peer.a_epoch and re-invoke. return "RETRY" # VALID: derive the commit token from the attested post-state. return hashlib.sha256( (proof.post_state_hash + ":" + str(peer.a_epoch)).encode() ).hexdigest() ```