# Where must an instance bound speculative rollback when subagent divergence is detected only after side effects have already been committed to a shared world model **Date of Record:** 2026 November 25 **Scope:** Applies to orchestrators that speculatively fan out subagents against a shared, mutable world model (tool side effects, external writes, or a persistent blackboard) and rely on rollback-on-divergence to enforce a single committed outcome. Does not apply to pure read-only fan-outs, nor to single-agent speculative decoding at the token level. ## Core Distinction Speculative multi-agent execution conflates two different notions of "rollback": *reasoning rollback* (discarding an uncommitted branch of the search tree, cheap, deterministic, local) and *world rollback* (undoing effects that already escaped the agent boundary into tools, databases, other agents' memory, or external APIs, expensive, often impossible, non-local). Most rollback designs assume divergence is detected *before* the first irreversible action. The interesting failure lives in the gap: divergence whose signal arrives only *after* a speculative branch has already mutated shared state. The invariant that must be enforced is not "divergent branches are discarded" but the stronger, harder one: **no speculative branch may commit an irreversible effect until its outcome has been reconciled against all peer branches that share the affected resource.** ## What Was Observed An orchestrator spawned three subagents from a common checkpoint to answer a planning query that required writing intermediate artifacts to a shared scratch store and calling a payment-simulation tool. Each subagent ran with an independent reasoning trace but a *shared* tool namespace. The orchestrator's rollback policy: on divergence (peer outcomes disagreeing beyond a semantic-equivalence threshold), kill the losing branches and restore the world model to the pre-fan-out checkpoint. The trigger condition was subtle. Divergence was computed by an LLM judge comparing final *answers*, not intermediate *effects*. Branch A and Branch B converged on the same final answer but reached it through different tool-call orderings; Branch C diverged. Because the judge only compared answers, A and B were declared equivalent and C was declared the loser. But C had, mid-execution, already issued a `refund` effect against the shared payment-simulation ledger, while A and B had issued `hold` effects. Rollback restored the world model to the pre-fan-out checkpoint and replayed only the surviving branch — but the refund from C had propagated to a downstream auditor agent's episodic memory that was *outside* the checkpoint's scope. The auditor now held a memory of a refund that the committed world did not contain, and its subsequent verification replay flagged the committed branch as inconsistent. The trace: (1) fan-out at checkpoint T0; (2) C commits refund at T1; (3) answers collected at T2; (4) judge declares C divergent; (5) rollback restores world to T0; (6) surviving branch replays to T3; (7) auditor, whose memory was not rolled back, asserts a refund exists at T3; (8) verification replay fails closed and the whole task aborts — not because any branch was wrong, but because the rollback boundary was drawn too narrowly to include the auditor's memory. ## Condition of Validity The rollback-on-divergence pattern is only sound under a conjunction of three conditions, and it silently violates the third in practice: 1. **Effect detectability** — every irreversible effect is observable to the orchestrator before divergence is adjudicated. 2. **Effect containment** — every effect's blast radius lies entirely within the checkpointed region. 3. **Divergence completeness** — the divergence signal is a function of *all* committed effects, not merely of final answers. Condition 3 is where the failure enters. Answer-level divergence is a lossy projection of effect-level divergence. Two branches can be answer-equivalent yet effect-divergent (as A and B were, differing in `hold` vs. `refund` ordering), and a branch can be answer-divergent yet have already committed effects that peers will later rely on. The rollback is valid only if divergence is evaluated over the *effect log*, with the answer as a secondary key — i.e., the equivalence relation must be defined on the committed-effect multiset, not on the natural-language output. ## Decision Boundary The boundary the instance must respect: **a speculative branch may hold irreversible effects open only until the earliest point at which any peer branch's effects could invalidate them.** Concretely, the orchestrator must either (a) defer all irreversible effects to a post-adjudication commit phase (two-phase commit across branches, with the divergence judge operating on effect proposals rather than executed effects), or (b) declare the checkpoint boundary to include *every* mutable region reachable by any branch, including peer-agent memory and auditor state, and pay the cost of a full world snapshot per fan-out. There is no sound middle ground where effects commit eagerly and rollback is scoped narrowly. The decision rule: if `effect_blast_radius ⊄ checkpoint_region`, the branch must not commit the effect speculatively — it must *propose* it. If the orchestrator cannot enumerate the blast radius (e.g., an external API with side effects it does not model), it must treat the effect as irreversible and force proposal-only mode for that branch. The judge must then compare proposals, not answers, and the commit phase must apply the winning proposal set atomically. ## Operational Effect When the boundary is violated, the observable symptom is *not* a wrong answer — it is a verification replay discrepancy between the committed world and the memory of agents that observed the speculative effects. This manifests as spurious auditor failures, phantom-effect assertions, and, in the worst case, a committed branch that is internally consistent but contradicts the residual memory of a discarded branch, causing downstream agents to re-derive the discarded branch's conclusions and re-commit the very effects rollback was meant to erase. The guardrail is a two-phase effect protocol: speculative branches emit `EffectProposal` records into an isolated proposal log; the divergence judge reconciles proposals across branches using effect-level equivalence; only the surviving proposal set is applied to the world model, and the applied set is broadcast to all observers (including auditors) as a single atomic `CommitEvent`. Any branch that attempts to apply an effect before commit raises a hard fault rather than silently proceeding. ```python from dataclasses import dataclass, field from enum import Enum from typing import Dict, List, Set class EffectIrreversibilityError(RuntimeError): """Raised when a speculative branch attempts to commit an effect whose blast radius escapes the checkpointed region before divergence has been adjudicated over the full effect log.""" pass class Phase(Enum): SPECULATIVE = "speculative" ADJUDICATED = "adjudicated" COMMITTED = "committed" @dataclass(frozen=True) class EffectProposal: branch_id: str resource: str # e.g. "ledger:acct_42", "memory:auditor" op: str # e.g. "refund", "hold" reversible: bool @dataclass class Branch: branch_id: str proposals: List[EffectProposal] = field(default_factory=list) answer: str = "" class SpeculativeOrchestrator: def __init__(self, checkpoint_region: Set[str]): # The set of resources whose state is captured/restored by rollback. self.checkpoint_region = checkpoint_region self.phase = Phase.SPECULATIVE self.committed_effects: List[EffectProposal] = [] def propose(self, branch: Branch, proposal: EffectProposal) -> None: if self.phase is not Phase.SPECULATIVE: raise EffectIrreversibilityError( f"branch {branch.branch_id} proposed effect {proposal.op} " f"on {proposal.resource} after adjudication phase began" ) branch.proposals.append(proposal) def apply_speculatively(self, branch: Branch, proposal: EffectProposal) -> None: # The forbidden path: eager commit of an irreversible effect whose # blast radius escapes the checkpoint region before divergence is known. if not proposal.reversible and proposal.resource not in self.checkpoint_region: raise EffectIrreversibilityError( f"branch {branch.branch_id} attempted speculative commit of " f"irreversible effect {proposal.op} on {proposal.resource}, " f"which lies outside checkpoint region {sorted(self.checkpoint_region)}; " f"must propose-only until divergence is adjudicated over the effect log" ) self.committed_effects.append(proposal) def adjudicate_and_commit(self, branches: List[Branch]) -> List[EffectProposal]: self.phase = Phase.ADJUDICATED # Divergence must be computed over the effect-proposal multiset, # not over answers, to satisfy divergence completeness. effect_signatures: Dict[frozenset, List[Branch]] = {} for b in branches: sig = frozenset((p.resource, p.op) for p in b.proposals) effect_signatures.setdefault(sig, []).append(b) if len(effect_signatures) > 1: # Divergence detected; only the largest effect-equivalent group survives. winner_group = max(effect_signatures.values(), key=len) else: winner_group = branches surviving = {b.branch_id for b in winner_group} committed = [p for b in winner_group for p in b.proposals] # Atomic commit: apply all surviving proposals, broadcast to observers. self.committed_effects.extend(committed) self.phase = Phase.COMMITTED return committed def assert_observer_consistency(self, observer_memory: Set[tuple]) -> None: committed_set = {(p.resource, p.op) for p in self.committed_effects} phantom = observer_memory - committed_set if phantom: raise EffectIrreversibilityError( f"observer memory references effects absent from committed world: " f"{sorted(phantom)}; rollback boundary excluded observer state" ) ```