# Where must an instance bound speculative branch reconciliation when a rollback invalidates a sibling agent's committed side effects? **Date of Record:** 2026 November 22 **Scope:** Applies to multi-agent pipelines that run speculative branches (parallel or forked agent instances) whose tool calls produce externally observable side effects (writes, sends, deployments, payments), where a rollback of one branch must reconcile against siblings that already committed. Does not apply to purely read-only speculation or to single-agent speculative decoding. ## Core Distinction Speculative execution in agent pipelines is not the CPU branch-prediction analogy it is usually dressed as. A CPU can discard a mispredicted branch because the branch's writes are buffered in a reorder buffer and never observed. An agent branch's "writes" are *tool invocations against real systems*: an email dispatched, a row inserted, a webhook fired, a ticket transitioned. The critical distinction is between **speculation that is observable** and **speculation that is merely stateful**. A branch is safely rollback-able only if every side effect it produced is either (a) buffered behind a commit barrier the reconciler controls, or (b) idempotent and reversible by a compensating action whose cost is known. The failure mode arises when a sibling branch commits a side effect that depends on a *shared* assumption the rolled-back branch introduced—so rolling back the assumption leaves the committed effect orphaned but live. The non-obvious part: the reconciler typically reasons about rollback in terms of *the branch's own* side-effect ledger. It does not reason about **cross-branch causal dependencies on speculative premises**. When branch A speculates a premise P (e.g., "inventory is sufficient", "the schema accepts field X", "user identity is verified"), and branch B *consumes* P as a read-only input and then commits a side effect E that is only valid if P holds, rolling back A does not roll back E. The system has committed a fact whose warrant has been retracted. ## What Was Observed A three-branch pipeline for a procurement agent. Branch A (fast, cheap model) was tasked with verifying supplier inventory via a read tool and produced the premise `available_qty=500`. Branch B (expensive, larger model) read A's premise from the shared blackboard and issued a purchase order for 400 units against it. Branch C (auditor) ran concurrently and detected that A's tool call had returned a *stale cache hit* (the tool's `cache_age_ms` exceeded the tool's own freshness contract), so A's premise was invalidated and A was rolled back. The reconciler rolled back A correctly: A's ledger was empty (read-only), A's state was discarded, and the branch was marked `ROLLED_BACK`. The pipeline then re-ran the verification with a fresh tool call, obtained `available_qty=120`, and—because the cost-aware speculation budget was already 71% consumed—the orchestrator declined to re-speculate branch B. Branch B was *not* rolled back, because B's ledger showed a single committed side effect (the PO) that was "valid at commit time" by the reconciler's per-branch logic. Result: a committed purchase order for 400 units against 120 available, with no branch in the system holding the warrant for why it was placed. The orphaned effect was only caught downstream when fulfillment failed. The trace: `A.premise(P) → Bboard.write(P, ttl=∞) → B.read(P) → B.commit(PO) → C.invalidate(P) → A.rollback() → B.untouched → orphan(B, P)`. The reconciler's invariant was per-branch; the causal dependency was cross-branch. No component owned the edge `B ← P`. ## Condition of Validity Speculative rollback with sibling reconciliation is sound only under the **premise-warrant invariant**: for every committed side effect E in branch B, there must exist a set of premises `W(E)` such that every `p ∈ W(E)` is either (i) grounded in a non-speculative, freshness-validated source, or (ii) still live (not rolled back) at the time E is observed by any downstream system. The invariant must be enforced at the *edge* level, not the branch level. Operationally this requires three things the naive pipeline lacks: 1. **Premise provenance on the blackboard.** Every premise written to shared state must carry `{source_branch, tool_call_id, freshness_deadline, speculation_flag}`. Reads must record the premise IDs they consumed into the reading branch's own ledger as *dependencies*, not just values. 2. **Dependency-tracked commit.** A side effect may be committed only if all premises in its dependency closure are non-speculative or still-live. If a dependency is speculative, the commit must be *deferred* behind a barrier until the dependency's branch resolves (commit or rollback). 3. **Rollback propagation over the dependency graph.** Rolling back branch A must invalidate every premise A authored, and must trigger a *reconciliation pass* over every branch whose dependency closure contains an invalidated premise. Those branches must either compensate (reverse the effect), re-derive (re-speculate with a fresh premise, charging the budget), or halt for human adjudication. The cost-aware budget interacts here in a way that is easy to miss: re-derivation after rollback is a *second* speculation charge against the same budget. If the budget is nearly exhausted, the system is structurally biased toward *not* reconciling, which silently converts "we can't afford to re-check" into "we accept the orphaned effect." The budget must therefore reserve a **reconciliation floor**—a fraction of the budget that cannot be spent on primary speculation and is only available to re-derive invalidated premises or compensate orphaned effects. ## Decision Boundary The boundary is whether the dependency edge `B ← P` was recorded at read time. If it was, rollback of A is a graph operation with a bounded, correct reconciliation. If it was not—if B read P as a bare value from the blackboard—then rollback of A is undecidable from the reconciler's state, and the only sound action is to treat B as *potentially orphaned* and force it into adjudication. Concretely, the reconciler must choose among: - **Propagate-and-compensate** when the dependency edge exists and a compensating action is known and cheap (e.g., cancel PO, delete row). Charge the compensation to the reconciliation floor. - **Propagate-and-re-derive** when the edge exists but compensation is impossible (email already sent) and re-derivation is affordable. Re-run B's chain against the fresh premise. - **Halt-and-escalate** when the edge is missing (bare-value read) or the reconciliation floor is exhausted. Do not silently accept; do not silently roll back a committed effect whose reachability you cannot bound. The invariant that makes the boundary decidable: **no premise may be read from shared state without its provenance being appended to the reader's dependency ledger.** A bare-value read is the precise condition under which the system loses the ability to reconcile, and it must be treated as a protocol violation at write time, not discovered at rollback time. ## Operational Effect Enforcing the premise-warrant invariant changes the pipeline's failure profile from *silent orphaned side effects* to *explicit, bounded adjudication*. The cost is that more branches block on barriers (waiting for speculative premises to resolve) and the reconciliation floor reduces primary speculation throughput by the reserved fraction. The benefit is that rollback becomes a total function over the dependency graph rather than a per-branch no-op with respect to siblings. The subtle operational consequence: barrier waits increase tail latency precisely when speculation is *most* valuable (high contention, many parallel branches), because that is when dependency edges are densest. A pipeline tuned for throughput will be tempted to drop provenance tracking to avoid barriers. That tuning is exactly the condition under which the orphaned-effect bug reappears. The guardrail must be structural—provenance is written by the blackboard layer, not by the branch—so that no amount of throughput tuning can silently remove it. ```python from dataclasses import dataclass, field from typing import Optional class OrphanedSideEffectError(RuntimeError): """Raised when a committed side effect's dependency closure contains an invalidated speculative premise that cannot be reconciled within budget.""" @dataclass class Premise: premise_id: str source_branch: str speculative: bool freshness_deadline: float live: bool = True @dataclass class SideEffect: effect_id: str branch: str dependency_closure: list[str] # premise_ids consumed before commit committed: bool = True @dataclass class Reconciler: premises: dict[str, Premise] = field(default_factory=dict) effects: dict[str, SideEffect] = field(default_factory=dict) reconciliation_floor: float = 0.20 # fraction of budget reserved budget_spent: float = 0.0 def rollback_branch(self, branch: str) -> list[str]: """Invalidate all premises authored by `branch`, then reconcile every effect whose dependency closure touches an invalidated premise.""" invalidated = [p for p in self.premises.values() if p.source_branch == branch and p.speculative] for p in invalidated: p.live = False invalidated_ids = {p.premise_id for p in invalidated} orphans = [e for e in self.effects.values() if e.committed and (set(e.dependency_closure) & invalidated_ids)] for e in orphans: # Missing provenance edge => undecidable => must escalate. if not e.dependency_closure: raise OrphanedSideEffectError( f"effect {e.effect_id} in branch {e.branch} has no recorded " f"dependency closure; cannot bound rollback of {branch}" ) if self.budget_spent >= (1.0 - self.reconciliation_floor): raise OrphanedSideEffectError( f"reconciliation floor exhausted while reconciling " f"{e.effect_id}; refusing silent acceptance of orphan" ) self._reconcile(e) return [e.effect_id for e in orphans] def _reconcile(self, effect: SideEffect) -> None: # Compensate or re-derive; charge against the reconciliation floor. self.budget_spent += 0.05 effect.committed = False ```