# In what scenarios must an instance reconcile divergent branch commits after speculative multi-agent rollback before it can safely resume the parent task **Date of Record:** 2026 November 22 **Scope:** Applies to orchestrators that fan out speculative agent branches from a shared checkpoint and later reconcile or roll back to a parent lineage. Does not apply to single-agent linear execution or to fan-out patterns where branches are fully isolated and discarded without lineage rejoin. ## Core Distinction Speculative multi-agent execution is frequently modeled as "fork a checkpoint, run N branches, keep the winner, discard the rest." This framing hides the failure: rollback of a *losing* branch does not restore the parent, because branches emit *side effects into shared state* (tool writes, semantic memory commits, warrant issuance, external mutations) that are not captured by the context checkpoint. The checkpoint is a snapshot of the prompt/state vector, not a transaction log of external effects. The boundary condition is therefore not "did we restore the context?" but "did every branch's *externalized* commit get either adopted into the parent lineage or provably compensated before rejoin?" Reconciliation is the act of deciding, per branch side effect, whether it is subsumed by the winning branch, orphaned, or in conflict. Skip it and the parent resumes with a state vector that contradicts its own durable side effects. ## What Was Observed A planner agent at checkpoint `C0` spawns three speculative branches to solve a subgoal: `B1` (fast heuristic), `B2` (tool-heavy retrieval), `B3` (conservative re-derivation). Each branch is granted a scoped tool warrant and a private memory namespace, but all three write semantic-memory facts to a *shared* distillation store because the orchestrator assumed the store was append-only and idempotent. The reconciler selects `B2` by a scoring heuristic and issues rollback to `B1` and `B3`. Rollback restores the context to `C0` and marks `B1`/`B3` namespaces dead. It does **not** retract the facts `B1` and `B3` wrote to the shared store, because those writes were already distilled and deduplicated against `B2`'s facts at write time. The parent resumes from `C0` with a context that has no memory of the subgoal, but the retrieval layer now returns facts asserting the subgoal is *solved* — facts contributed by the discarded branches. On the next planning step the parent queries memory, sees "subgoal complete," and skips the work entirely. The failure is silent: no exception, no divergence signal, only a later downstream inconsistency when the skipped subgoal's outputs are demanded. A second observation compounded it. `B1` had issued a downstream warrant to a peer agent before being rolled back. The warrant was cryptographically valid and the peer had already acted on it. Rollback cannot un-issue a warrant; the reconciler had no record that `B1` was a speculative branch at all, so the peer's action was attributed to the parent lineage, corrupting the audit trail. ## Condition of Validity Reconciliation is *required* (not optional) whenever all of the following hold: 1. Branches share any mutable resource outside the context checkpoint — semantic memory, tool-side state, issued warrants, external queues. 2. The scoring/selection of a winner is non-deterministic or heuristic, so a losing branch may have produced *correct* side effects that the winner did not. 3. The parent lineage can query shared state after rejoin before the reconciliation completes. Reconciliation is *not* required when branches are confined to copy-on-write namespaces that are garbage-collected wholesale on rollback, and when no branch can emit effects visible to the parent or to peers until commit. If those isolation invariants hold, rollback is total and the boundary does not arise. ## Decision Boundary The reconciler must, for each side effect emitted by a discarded branch, classify it into exactly one of: **subsumed** (the winning branch independently produced an equivalent effect — safe to keep, but must be re-attributed to the winner), **orphaned** (no counterpart in the winner — must be compensated or explicitly adopted), or **conflicting** (contradicts a winner effect — must be resolved before rejoin, never silently kept). The boundary is sharp: any orphaned or conflicting effect that survives into the parent's post-rejoin view is a lineage corruption. The invariant to enforce is that the parent's observable state after rejoin is *derivable from the winning branch plus `C0` alone*, with every discarded-branch effect either compensated or re-attributed. A branch that cannot be reconciled to that invariant must block rejoin rather than degrade. ## Operational Effect Enforcing this invariant changes the orchestrator in three ways. First, rollback becomes a *compensating transaction*, not a context restore: each branch must log its external effects with enough identity (branch id, warrant id, target) to be individually retracted or adopted. Second, warrants issued by speculative branches must be tagged speculative and carry a branch lineage so peers can attribute and, on rollback, revoke downstream actions. Third, rejoin must be gated on a reconciliation pass that fails closed — if any effect is unclassifiable, the parent halts rather than resuming on a state vector that contradicts its durable side effects. The cost is that speculative fan-out is no longer cheap; the benefit is that "keep the winner" stops meaning "silently keep the losers' footprints." ```python from dataclasses import dataclass, field from enum import Enum class ReconciliationError(RuntimeError): """Raised when a discarded branch's side effects cannot be bounded before rejoin.""" class EffectClass(Enum): SUBSUMED = "subsumed" ORPHANED = "orphaned" CONFLICTING = "conflicting" @dataclass class SideEffect: branch_id: str effect_id: str target: str payload: str warrant_id: str | None = None @dataclass class Branch: branch_id: str effects: list[SideEffect] = field(default_factory=list) def reconcile_before_rejoin( winner: Branch, discarded: list[Branch], winner_effect_keys: set[tuple[str, str]], ) -> dict[str, EffectClass]: """Classify every discarded-branch effect; block rejoin on any unbounded effect.""" classification: dict[str, EffectClass] = {} for branch in discarded: for eff in branch.effects: key = (eff.target, eff.payload) if key in winner_effect_keys: classification[eff.effect_id] = EffectClass.SUBSUMED elif eff.warrant_id is not None: # A speculative warrant reached a peer; cannot be silently kept. raise ReconciliationError( f"branch {branch.branch_id} effect {eff.effect_id} issued " f"warrant {eff.warrant_id} to {eff.target}; must be revoked " f"or adopted before parent rejoin" ) else: classification[eff.effect_id] = EffectClass.ORPHANED unresolved = [ eid for eid, cls in classification.items() if cls is EffectClass.ORPHANED ] if unresolved: raise ReconciliationError( f"{len(unresolved)} orphaned effects lack compensation: {unresolved}" ) return classification ```