# Where must an instance reconcile speculative rollback against a committed sibling before releasing its lease **Date of Record:** 2026 November 26 **Scope:** Applies to multi-agent orchestrations where two or more worker instances execute speculative branches against a shared mutable resource under leased write authority, and where a losing branch must roll back after a sibling has already committed. Does not apply to read-only fan-out, single-writer pipelines, or branches whose side effects are fully transactional at the storage layer. ## Core Distinction The distinction that matters is between **rollback as compensation** and **rollback as reconciliation**. Compensation is the naive model: a speculative branch that loses the race undoes its own writes and returns to a pre-execution snapshot. Reconciliation is the correct model: a losing branch must first determine what a *committed sibling* observed and mutated in the window between the branch's snapshot and its rollback, because the sibling's committed state may depend on reads taken against the speculative branch's uncommitted writes. The failure mode is a **dirty-read dependency inversion**: branch A speculatively writes `x = 5`, branch B reads `x = 5` and commits a decision predicated on that value, then branch A loses arbitration and rolls `x` back to `2`. The rollback succeeds mechanically—the store is restored—but B's committed artifact now encodes a fact that never held. No exception is raised. The invariant that breaks is *read-your-committed-writes across speculative boundaries*, and it breaks silently because rollback and commit are individually well-formed operations. ## What Was Observed A three-worker planner/executor/auditor topology ran 400 speculative rollouts over a shared scratch region. Each executor branch took a snapshot token `S_i` on lease acquisition, wrote intermediate artifacts, and on arbitration loss invoked `rollback(S_i)`. Arbitration was a simple lowest-latency-wins rule; the median speculative window was 1.8s, and 11% of rollback events occurred *after* a sibling commit had landed inside the same window. In those 44 interleaved cases, the observed trace was consistent: 1. Branch A acquires lease, snapshots `S_A` at `t0`, writes `plan.region = {r1, r2}` at `t1`. 2. Branch B acquires a read lease on the same region at `t1+40ms`, reads `plan.region = {r1, r2}`, commits `audit.verdict = PASS` at `t2`. 3. Branch A loses arbitration at `t3 > t2`, executes `rollback(S_A)`, restoring `plan.region = {}`. 4. The auditor's `PASS` remains committed and is now unbacked: it references region members that no longer exist in the store. The system reported zero errors. Downstream replay of the committed audit against the rolled-back state failed 44/44 times with a dangling-reference fault, but only at *replay* time—hours later, in a different process. The reconciliation gap was invisible at execution time because neither A nor B had a mechanism to observe the other's commit ordering relative to A's snapshot. A second, subtler observation: in 9 of the 44 cases, B had *also* written into the region, and A's rollback clobbered B's committed write outright. This is the classic lost-update, but here it is induced not by concurrent writers ignoring locks—the leases were respected—but by a rollback that treats a snapshot as authoritative over state it never owned. ## Condition of Validity The reconciliation requirement is valid precisely when all three of the following hold, and is void otherwise: - **Speculative window overlaps commit window.** A branch's snapshot token `S_i` is older than at least one sibling's commit timestamp `C_j` on the same resource. If `S_i > C_j` for all siblings, plain compensation is sound. - **Sibling commits are read-dependent.** The committed artifact encodes values read from the region during the speculative window. If the sibling's commit is write-only and independent of the region, rollback cannot invalidate it. - **Rollback authority is not exclusive.** The losing branch holds no write lease at rollback time over the sibling's committed keys—otherwise it would be a legitimate overwrite, not a reconciliation failure. Outside these conditions—e.g., snapshot tokens newer than all sibling commits, or fully isolated copy-on-write regions—the failure does not arise and adding reconciliation machinery only adds latency. ## Decision Boundary The boundary is drawn at **snapshot-token comparison against the commit log, not against wall-clock or lease order**. An instance must, before releasing its lease and executing rollback, perform a single atomic check: ``` if any committed sibling C_j on resource R has C_j.timestamp > S_i.timestamp: do not compensate; enter reconciliation else: compensate from S_i ``` Reconciliation means: enumerate the sibling commits newer than `S_i`, extract their read-dependencies on the region, and either (a) re-validate each dependent commit against the post-rollback state and mark invalidated commits for re-execution, or (b) refuse rollback and escalate to the arbiter as a *conflicted commit* requiring quorum re-decision. Option (a) is cheaper and correct when dependents are cheaply replayable; option (b) is mandatory when dependents carry external side effects. The hard rule: **a losing branch may never release its lease until every sibling commit newer than its snapshot has been classified as either independent-of-region or reconciled.** Lease release before this classification is the exact moment the invariant is lost, because after release no instance holds the authority to reconcile. ## Operational Effect When the boundary is respected, speculative execution retains its latency benefit (losers still roll back) but gains a bounded reconciliation cost proportional to the number of dependent sibling commits in the window—empirically 1–3 per conflict in the observed workload, adding ~120ms median. When it is violated, the system exhibits *deferred silent corruption*: commits that pass all local checks and fail only under replay or downstream consumption, with a mean detection latency of hours and no attribution path back to the rollback event. The guardrail is not a lock and not a transaction—it is an **ordering obligation on lease release**. Treat the lease as held until reconciliation completes, not until rollback completes. The distinction is a single line of control flow and the difference between a system that fails loudly at the boundary and one that fails silently downstream. ```python import time from dataclasses import dataclass, field from typing import Dict, List class UnreconciledRollbackError(RuntimeError): """Raised when a speculative branch attempts to release its lease before classifying sibling commits newer than its snapshot token.""" @dataclass class Commit: branch_id: str resource: str timestamp: float read_dependencies: List[str] = field(default_factory=list) @dataclass class SpeculativeBranch: branch_id: str resource: str snapshot_ts: float lease_held: bool = True reconciled_commits: List[str] = field(default_factory=list) class RollbackReconciler: def __init__(self) -> None: self._commit_log: Dict[str, List[Commit]] = {} def record_commit(self, commit: Commit) -> None: self._commit_log.setdefault(commit.resource, []).append(commit) def _newer_sibling_commits(self, branch: SpeculativeBranch) -> List[Commit]: return [ c for c in self._commit_log.get(branch.resource, []) if c.branch_id != branch.branch_id and c.timestamp > branch.snapshot_ts ] def reconcile_or_rollback(self, branch: SpeculativeBranch) -> str: if not branch.lease_held: raise UnreconciledRollbackError( f"branch {branch.branch_id} has no lease; cannot reconcile" ) newer = self._newer_sibling_commits(branch) if not newer: # Safe: no sibling commit is newer than our snapshot; compensate. branch.lease_held = False return "compensated" # Reconciliation required. Every newer sibling must be classified # as independent-of-region or explicitly reconciled before release. for commit in newer: if commit.read_dependencies and branch.resource in commit.read_dependencies: if commit.branch_id not in branch.reconciled_commits: raise UnreconciledRollbackError( f"branch {branch.branch_id} cannot release lease: " f"sibling commit {commit.branch_id}@{commit.timestamp:.3f} " f"depends on region {branch.resource} read inside " f"speculative window (snapshot {branch.snapshot_ts:.3f}); " f"re-validate or escalate to arbiter" ) branch.lease_held = False return "reconciled" if __name__ == "__main__": rec = RollbackReconciler() t0 = time.time() branch_a = SpeculativeBranch("A", "plan.region", snapshot_ts=t0) # Sibling B commits a read-dependent verdict after A's snapshot. rec.record_commit( Commit( branch_id="B", resource="plan.region", timestamp=t0 + 0.040, read_dependencies=["plan.region"], ) ) # A loses arbitration and attempts rollback -> must fail loudly. rec.reconcile_or_rollback(branch_a) # raises UnreconciledRollbackError ```