# What structural signals indicate speculative branch divergence has become unrecoverable in multi-agent rollback reconciliation **Date of Record:** 2026 November 27 **Scope:** Applies to multi-agent systems that execute speculative parallel branches against a shared mutable world-state and reconcile via rollback when one branch is selected. Does not apply to read-only fan-out (map/reduce over immutable inputs) or to single-agent speculative decoding within one model's token stream. ## Core Distinction The failure mode is not "a branch produced a wrong answer." It is that **rollback of a losing branch is not the inverse of that branch's forward execution**, because the branch's side effects leaked into state that the rollback protocol does not own. The distinction that matters operationally: *compensable* divergence versus *non-compensable* divergence. A compensable divergence is one where every effect of the speculative branch is captured in a transaction log that the coordinator can replay in reverse — writes to an owned store, messages to a queue with a compensating delete, file mutations in a copy-on-write volume. A non-compensable divergence is one where the branch's effect is *observable to a third party that already acted on it*: an external API call that fired a webhook, an email sent, a peer agent that read the branch's tentative output and committed a derived decision, or a token spent against a rate-limited budget. The structural signal of unrecoverability is **the presence of an effect whose inverse is not in the transaction log but is instead in another agent's committed history**. The subtle part: the coordinator's rollback succeeds *locally* — its own state returns to the pre-branch checkpoint cleanly — while the system as a whole has already absorbed the branch. Local rollback success is therefore a false signal of global consistency. The invariant that actually bounds this is *effect provenance completeness*: every externally observable effect must carry the ID of the speculative branch that produced it, and reconciliation must refuse to commit a winning branch while any orphaned effect from a losing branch remains externally visible. ## What Was Observed A three-branch speculative planner (branches A, B, C) runs against a shared tool bus. Branch B calls a `send_status` tool to a downstream scheduler agent, passing a tentative ETA of 14:00. The scheduler — a separate agent with its own memory — records the ETA and immediately schedules a dependent job at 13:45. The coordinator selects branch A, whose ETA is 16:00, and issues rollback of B and C. Rollback of B walks B's transaction log: it reverses the local ETA write, releases B's locks, and marks B's record `rolled_back`. It does **not** emit a compensating `send_status` to the scheduler, because the `send_status` call was logged as an *outbound tool invocation*, not as a *reversible state mutation* — the tool schema had no compensation hook. The scheduler's memory now holds a 14:00 ETA that no live branch asserts. When branch A commits its 16:00 ETA, the scheduler receives a contradictory update and, depending on its own conflict-resolution policy, either (a) keeps the stale 14:00 because it arrived first, or (b) enters a re-plan loop trying to reconcile two ETAs it believes are both current. The structural signals present at the moment of failure, in order of diagnostic value: 1. **Orphaned external effect with no owning live branch.** After rollback, the scheduler's ETA references branch B, which is `rolled_back`. Any effect whose provenance points to a non-live branch is an orphan. 2. **Rollback log entries typed as `invocation` rather than `mutation`.** The transaction log distinguished tool calls from state writes; only the latter had inverses. This is the mechanical root cause — a schema-level signal. 3. **Downstream agent committed a decision derived from a tentative value.** The scheduler acted (scheduled a job) on B's ETA before B was selected. This is the irreversibility signal: a derived commit in another agent's history. 4. **Reconciliation produced a second write to the same external key without a supersede marker.** The commit of A's ETA did not carry a `supersedes: B` field, so the scheduler could not order the two writes. The trace: `B.send_status(14:00)` → scheduler commits `eta=14:00, provenance=B` → scheduler schedules job at 13:45 → coordinator selects A → `rollback(B)` reverses local writes only → `commit(A, eta=16:00)` with no supersede marker → scheduler holds two unordered ETAs → re-plan loop or stale retention. ## Condition of Validity The guardrail holds only under a specific condition: **every tool exposed to a speculative branch must be classified as either `reversible` (has a registered compensation) or `deferred` (buffered until branch selection)**. A tool that is neither — one that emits an irreversible external effect immediately — must not be callable from a speculative branch at all. This condition is valid when the coordinator can enumerate the full tool surface at branch-spawn time and the classification is enforced at the bus, not by convention. It fails when a branch can reach an unclassified tool transitively — e.g., branch B calls a *peer agent* that itself calls an irreversible tool. The peer's internal call is invisible to the coordinator's transaction log. This is the transitive-effect escape: the boundary must extend across agent hops, not just direct tool calls, which means the branch ID must propagate in every inter-agent message header and every peer must refuse irreversible tools while holding a speculative branch ID. The condition is also invalidated if the downstream agent's conflict-resolution policy is unknown to the coordinator. If the scheduler resolves conflicting ETAs by first-write-wins, a supersede marker is insufficient; the coordinator must instead *retract* before committing, which requires the scheduler to expose a retraction endpoint. Without that, no reconciliation protocol can guarantee ordering. ## Decision Boundary The coordinator must choose between **rollback** and **abort-and-restart** based on one test: does any losing branch have an external effect with a live provenance reference in another agent's committed state? - If **no** — pure compensable divergence — rollback is correct and cheap. Reverse the log, release locks, proceed. - If **yes** — non-compensable divergence — rollback is a lie. The correct action is *abort-and-restart with a poisoned-branch marker*: surface the orphaned effects to the downstream agents as retractions, force them to re-derive, and re-run the selection from a checkpoint taken *before* any branch spawned. Restarting from the pre-spawn checkpoint is the only move that restores a state in which no agent holds a derived decision from a discarded branch. The boundary is crossed the moment the first irreversible external effect fires from a speculative branch. Before that instant, rollback is sound. After it, the only sound recovery is restart-with-retraction, and the cost of that restart scales with how long the speculative window stayed open — which is why the speculative window must be bounded by *effect count*, not wall-clock time. A branch that fires zero irreversible effects can speculate for hours; a branch that fires one must be selected or retracted within the same reconciliation cycle. ## Operational Effect Systems that treat local rollback success as global consistency exhibit a characteristic pathology: **silent ETA drift** — downstream agents accumulate tentative values from discarded branches that are never retracted, and their derived decisions slowly diverge from the committed plan. The divergence is invisible in coordinator logs (rollback reported success) and only surfaces as downstream re-plan loops or stale-state assertions hours later, by which point the provenance chain back to the discarded branch is cold. The operational fix that bounds this is to make the transaction log's effect type a *first-class routing decision*: `mutation` effects get inverses; `invocation` effects get either a compensation hook or a `deferred` buffer; anything else raises at the bus and refuses the branch. Combined with branch-ID propagation across agent hops and a mandatory supersede-or-retract marker on every commit to an externally-owned key, the invariant becomes checkable: *no committed state in any agent may reference a branch that is not live*. That is the structural signal to monitor — not rollback success, but orphan count. ```python class OrphanedSpeculativeEffect(RuntimeError): """Raised when a committed external effect references a non-live speculative branch.""" pass def reconcile_branch_selection( selected_branch_id: str, losing_branch_ids: list[str], external_effects: list[dict], # each: {"key", "value", "provenance_branch", "type"} live_branch_ids: set[str], ) -> list[dict]: """ Reconcile after selecting one branch. Returns compensating actions to emit. Raises OrphanedSpeculativeEffect if a losing branch left a non-compensable external effect that no compensation hook can reverse. """ compensations = [] for eff in external_effects: prov = eff["provenance_branch"] if prov in live_branch_ids: continue # effect belongs to a live branch; leave it # Effect references a branch that is not live -> orphan candidate if eff["type"] == "mutation" and eff.get("compensation") is not None: compensations.append({"op": "invert", "target": eff["key"], "compensation": eff["compensation"]}) elif eff["type"] == "deferred": compensations.append({"op": "drop", "target": eff["key"]}) else: # Irreversible invocation from a discarded branch, already observed # downstream. Rollback cannot invert this; only retraction can. raise OrphanedSpeculativeEffect( f"branch {prov} discarded but effect on key {eff['key']!r} " f"({eff['type']}) is externally observable and non-compensable; " f"abort-and-restart with retraction required, not rollback" ) # Emit supersede markers so downstream agents can order writes for eff in external_effects: if eff["provenance_branch"] == selected_branch_id: compensations.append({"op": "commit_supersede", "target": eff["key"], "supersedes": losing_branch_ids}) return compensations ```