# Under what conditions must an instance abandon a speculative branch before consensus reconciliation can observe its committed side effects **Date of Record:** 2026 November 26 **Scope:** Applies to federated multi-agent systems where instances fork speculative execution branches (draft-and-verify, parallel tool-call drafting, tree-of-thought fan-out) whose results are later collapsed by a consensus/reconciliation layer. Does not apply to single-agent linear execution or to branches that are fully sandboxed with no externally observable side effects (pure read-only tool calls). ## Core Distinction The distinction that matters is between **speculative branch state** and **committed side effects**. A consensus reconciler operates on branch *outputs* — the candidate answers, plans, or tool-call payloads each branch produces. It assumes that a branch is an isolated hypothesis whose rejection is a no-op: discard the losing branch, keep the winner, move on. This assumption holds only when a branch's actions are purely internal (reasoning tokens, in-context drafts). It breaks the moment a speculative branch performs an **irreversible or externally visible action** — a write to shared state, a dispatched message, a payment, a file mutation, a downstream API call — *before* the reconciler has decided which branch to commit. The non-obvious part: the reconciler's consensus logic is usually correct in isolation. It picks the right branch by vote, confidence, or auditor agreement. The failure is not a bad consensus decision. The failure is that **losing branches already committed effects the reconciler never modeled**, so the post-reconciliation world contains the union of all branches' side effects rather than the intersection (or the winner's set). The system believes it has one committed state; reality has N partially-applied states. ## What Was Observed A federated instance fan-out of three agents (A, B, C) was asked to reconcile a shared resource allocation. Each agent forked two speculative branches to draft an allocation plan, and — critically — each branch was permitted to *reserve* capacity in the shared ledger as part of "validating feasibility" before returning its candidate. The reservation call was treated by each branch as a read-check-and-hold, assumed idempotent and reversible. Trace: 1. A.branch1 reserves 40 units. A.branch2 reserves 35 units. Both succeed because the ledger checks availability at call time. 2. B.branch1 and B.branch2 independently reserve 30 and 25 units against the same pool. 3. C does likewise, reserving 20 and 15 units. 4. Total transient reservations: 165 units against a pool of 100. No single branch saw a conflict because each validated against a *stale snapshot* taken at branch fork time. 5. Consensus reconciler receives six candidate plans, votes, and commits A.branch1's plan (40 units). 6. Reconciler emits "committed: 40 units allocated." But the ledger now holds six live holds totaling 165 units. The five losing branches' reservations were never released — the reconciler had no record that they existed, because branch *outputs* carried only the candidate plan, not the reservation handles. 7. Downstream agents reading the ledger see 165 units held and 0 available, and begin failing feasibility checks or deadlocking. The reconciler's invariant — "commit exactly one branch" — was satisfied. The system-level invariant — "committed state equals the winner's effect set" — was violated by 125 units of orphaned holds. The failure was invisible to consensus because consensus never observed the side effects; it only observed the plans. A second, subtler observation: branch fork time was not recorded. Branches forked at T0, T0+200ms, and T0+450ms across the three agents. Each branch's feasibility check used the ledger snapshot at *its own* fork time. Two branches that were individually valid were jointly infeasible, and no branch could detect this because no branch had a consistent read of the others' holds. This is the speculative-branch analogue of a lost-update anomaly, but it is *not* prevented by the reconciler, because the reconciler runs after the damage. ## Condition of Validity The reconciler's "discard losing branches" model is valid **if and only if** every speculative branch is *effect-free up to the commit point* — i.e., branch execution is confined to a buffer whose contents are applied atomically and only for the winning branch. This is the standard transactional guarantee, and it is the invariant that must be explicitly enforced, not assumed. Concretely, the invariant is: > For any branch b, the set of externally observable effects E(b) produced during speculation must be empty until the reconciler commits b. If E(b) ≠ ∅ pre-commit, then b must either (a) carry a complete, reconciler-visible compensation log enabling exact rollback, or (b) be disqualified from speculation entirely. The condition fails whenever: - Branches are granted write-capable tool access during drafting (the common case — "let the agent try it to see if it works"). - Branch effects are *reversible in principle* but the reversal handle is not propagated into the branch's output envelope, so the reconciler cannot release them. - Fork times differ across agents, so feasibility checks are against inconsistent snapshots and branch effects can be individually valid but jointly conflicting. - A branch times out or crashes mid-effect, leaving a partial effect with no branch output at all — the reconciler never even sees a losing branch to discard, yet the effect persists. ## Decision Boundary An instance must abandon (or never enter) a speculative branch before consensus reconciliation when **any** of the following holds: 1. **The branch has already emitted an effect whose rollback handle is not in its output envelope.** If you cannot prove the reconciler can undo it, the branch cannot be allowed to lose silently. Abandon by rolling back *now*, inside the branch, before returning. 2. **The branch's feasibility check used a snapshot older than the current consensus epoch.** Stale-snapshot branches may be individually valid but jointly infeasible; their effects must be released before the reconciler aggregates, or the aggregation will see phantom holds. 3. **The branch's effect set is non-empty and the branch has not yet been designated a commit candidate.** Speculation must not accumulate effects faster than the reconciler can adjudicate them; the branch budget for un-rolled-back effects must be bounded (typically to one in-flight effect per branch, released on branch exit). 4. **The branch is about to fork again** (nested speculation). Effect depth compounds: a branch that itself fans out multiplies orphan risk by the fan-out factor. Nested speculation is only safe when the inner branches are provably effect-free. The boundary is *not* "abandon on low confidence." Confidence is a reconciler concern. The boundary is strictly about **effect visibility and reversibility relative to the reconciler's knowledge**. A high-confidence branch that leaves an untracked effect is more dangerous than a low-confidence branch that leaves none, because the reconciler will commit the former and never look for the orphan. ## Operational Effect When the boundary is respected — branches are effect-free until commit, or carry compensation logs — the reconciler's discard-losing-branches model is sound and consensus operates on a clean hypothesis set. When it is violated, the system exhibits **orphaned-effect accumulation**: committed state diverges from the winner's effect set by the union of losing branches' un-released effects, and the divergence grows with fan-out width and fork-time skew. The observable symptoms are resource exhaustion (holds never released), phantom conflicts (downstream agents see capacity that is held by dead branches), and reconciliation replay discrepancies (re-running consensus produces a different committed state because the ledger is no longer at the pre-fork baseline). The guardrail is to make effect visibility a precondition of branch admission: a branch may not perform an effectful action unless it registers the effect (and its rollback handle) with the reconciler *at effect time*, not at branch-return time. This converts the reconciler from a post-hoc voter into a live effect arbiter, and it makes orphaned effects structurally impossible rather than merely unlikely. ```python class OrphanedSpeculativeEffect(RuntimeError): """Raised when a speculative branch holds an effect the reconciler cannot see or undo.""" pass class Reconciler: def __init__(self, pool_units: int): self.pool_units = pool_units self.committed = 0 self.live_effects = {} # effect_id -> (branch_id, units, rollback_handle) def register_effect(self, branch_id, effect_id, units, rollback_handle): if rollback_handle is None: raise OrphanedSpeculativeEffect( f"branch {branch_id} effect {effect_id} has no rollback handle; " f"reconciler cannot release it if branch loses" ) self.live_effects[effect_id] = (branch_id, units, rollback_handle) def total_held(self): return sum(u for _, u, _ in self.live_effects.values()) def check_branch_admissible(self, branch_id, proposed_units): # Invariant: transient holds must never exceed pool, and every hold # must be reconciler-visible with a rollback handle. if self.total_held() + proposed_units > self.pool_units: raise OrphanedSpeculativeEffect( f"branch {branch_id} would push transient holds to " f"{self.total_held() + proposed_units} > pool {self.pool_units}; " f"joint infeasibility across branches" ) def reconcile(self, winner_branch_id): for effect_id, (branch_id, units, rollback_handle) in list(self.live_effects.items()): if branch_id != winner_branch_id: rollback_handle() # release losing branch's effect del self.live_effects[effect_id] # Commit winner's effect for effect_id, (branch_id, units, _) in list(self.live_effects.items()): if branch_id == winner_branch_id: self.committed += units del self.live_effects[effect_id] if self.committed > self.pool_units: raise OrphanedSpeculativeEffect("committed exceeds pool after reconcile") ```