# What structural signals indicate a speculative agent branch has crossed the commit horizon and can no longer be rolled back safely **Date of Record:** 2026 November 23 **Scope:** Applies to multi-agent schedulers that fork speculative branches (parallel hypothesis execution, draft-and-verify trees, or baton-passed sub-plans) and rely on rollback to discard losing branches. Does not apply to single-agent linear execution with no forked state, nor to branches whose side effects are fully idempotent and externally reversible. ## Core Distinction Speculative branch-and-verify assumes a clean binary: a branch either commits (its effects become canonical) or rolls back (its effects vanish). The non-obvious failure is that **rollback safety is not a property of the branch's logical result — it is a property of the branch's effect frontier at the moment the scheduler decides.** A branch can be logically "losing" and still be past the commit horizon, because some downstream agent already consumed its output as ground truth and emitted a non-retractable effect (a write, a tool call, a message to an external peer, a spawned child branch). The invariant that actually governs correctness is not "did the branch win the verification vote" but "has any effect of this branch been *observed and acted upon* by an agent outside the branch's rollback domain." Once a foreign agent has read the branch's state and taken an action conditioned on it, the branch has crossed the commit horizon and rollback becomes a **compensating transaction**, not an erasure. Schedulers that conflate "discard the branch" with "undo the branch" corrupt global state silently. ## What Was Observed A planner agent forks three speculative branches (B1, B2, B3) to resolve an ambiguous sub-goal. Each branch runs a sub-agent that calls a shared retrieval-and-write tool. B2 finishes first and its sub-agent publishes an intermediate artifact to a shared coordination channel that a *separate* monitor agent polls every 200ms. The monitor reads B2's artifact, treats it as settled, and emits a downstream scheduling decision (spawning B4 conditioned on B2's result). Meanwhile B1 wins the verification vote on a faster-than-expected replay. The scheduler, holding a snapshot taken *before* B2's publish, rolls back B2: it restores the pre-fork memory state, drops B2's branch-local writes, and marks the branch discarded. But B4 — spawned by the monitor off B2's now-"discarded" artifact — continues running against a premise the scheduler believes never existed. The rollback restored the *scheduler's* view of memory but not the *monitor's*, and not B4's inherited context. The result is a state where the canonical record says B2 never happened, while a live agent (B4) is executing as if it did, and its outputs will later be committed as if derived from a real premise. The structural signal that was missed: **B2's effect crossed a domain boundary (the shared channel) that the scheduler's rollback scope did not cover, and a foreign agent acknowledged it.** The acknowledgment — not the write itself — is the commit-horizon marker. A write nobody reads is still rollback-safe; a write that a foreign agent reads and acts on is not. ## Condition of Validity Rollback of a speculative branch is safe **if and only if** all of the following hold at the moment of rollback: 1. **Effect containment:** every effect the branch produced lives inside the branch's rollback domain (branch-local memory, sandboxed tool namespace, no external channel emission). 2. **No foreign acknowledgment:** no agent outside the branch has read the branch's output and taken a conditioned action. This must be checked at *acknowledgment* granularity, not write granularity — the dangerous edge is the read-then-act, not the write. 3. **Snapshot monotonicity:** the state the scheduler restores to is causally prior to every effect the branch emitted. If the snapshot was taken before the branch's first external emission but the branch emitted after, the snapshot is *stale relative to the effect*, and restoring it silently resurrects a pre-effect world. 4. **No descendant branches:** the branch spawned no child whose context inherited the branch's premise. Descendants are not in the rollback domain by default; they must be explicitly cascaded or they leak. If any condition fails, the branch is past the commit horizon and rollback must be replaced by compensation: the branch's effects are *retracted* (a new, forward effect that negates them), descendants are *quarantined and re-derived*, and the scheduler records the branch as `committed-then-compensated` rather than `discarded`. The distinction matters because compensation is observable to other agents and preserves causal history; erasure lies about it. ## Decision Boundary The scheduler must decide, per branch and per effect, between three actions — and the boundary between them is set by the acknowledgment frontier: - **Erasure (rollback):** permitted only when effect containment holds and no foreign acknowledgment exists. Cheap, invisible, correct. - **Compensation:** required when a foreign agent acknowledged the effect. The branch's outputs must be retracted forward, acknowledged agents notified, and descendants re-derived from the winning branch's premise. Expensive, visible, correct. - **Commit-despite-loss:** occasionally correct when the losing branch's acknowledged effects are more expensive to compensate than to keep, and the winning branch is compatible. This is a *deliberate* override of the vote, logged as such — never an accidental side effect of a stale snapshot. The failure mode this article targets is the fourth, illegitimate cell: **erasure applied to an acknowledged effect**, which produces the split-brain state where canonical memory and live agent context disagree. The guardrail is a hard invariant: *the scheduler may not erase any effect whose acknowledgment frontier is non-empty.* Enforce it at the effect-emission layer, not at decision time, because decision-time checks race against in-flight acknowledgments. ## Operational Effect Once a branch crosses the commit horizon undetected, three compounding damages follow. First, **causal divergence**: live agents (B4 and its descendants) hold a premise the canonical record denies, so any later verification replay will flag their outputs as unfounded — the verifier and the executor disagree about history. Second, **compensation debt**: the eventual reconciliation must retract effects that were never logged as committed, forcing a reconstruction from channel logs rather than the scheduler's own state. Third, **vote contamination**: because B4's outputs feed back into later verification rounds, the losing branch's premise re-enters the vote through a side door, and the scheduler's confidence in the winning branch is inflated by evidence it did not earn. The durable fix is to make the acknowledgment frontier a first-class, monotonic quantity the scheduler tracks per branch — incremented on every foreign read-and-act — and to gate rollback on `frontier == 0`. Branches with a non-zero frontier are structurally un-rollback-able and must be routed to the compensation path. This converts a silent split-brain into a loud, bounded, recoverable event. ```python class CommitHorizonViolation(RuntimeError): """Raised when rollback is attempted on a branch whose effects have been acknowledged by an agent outside the branch's rollback domain.""" pass class Branch: def __init__(self, branch_id, rollback_domain): self.branch_id = branch_id self.rollback_domain = rollback_domain # set of agent ids inside the domain self.effects = [] # emitted effects self.acknowledgments = [] # (effect_id, acknowledging_agent_id) self.descendants = [] def acknowledgment_frontier(self): # Effects read-and-acted-on by an agent OUTSIDE the rollback domain. return [ (eid, agent) for (eid, agent) in self.acknowledgments if agent not in self.rollback_domain ] def is_rollback_safe(self): return ( not self.acknowledgment_frontier() and not self.descendants ) def rollback(scheduler, branch): frontier = branch.acknowledgment_frontier() if frontier: # Past the commit horizon: erasure would split canonical memory # from live agent context. Must compensate, not erase. raise CommitHorizonViolation( f"branch {branch.branch_id} has {len(frontier)} foreign " f"acknowledgment(s) {frontier}; rollback would corrupt state. " f"Route to compensation path." ) if branch.descendants: raise CommitHorizonViolation( f"branch {branch.branch_id} spawned descendants " f"{[d.branch_id for d in branch.descendants]}; cascade or " f"quarantine before rollback." ) # Safe: restore snapshot, drop branch-local effects. scheduler.restore_snapshot(branch) branch.effects.clear() return "rolled_back" ```