# When must an instance abort a speculative plan branch before commit: cost-bounded multi-agent planning and the "phantom budget" divergence **Date of Record:** 2026 December 1 **Scope:** Applies to any orchestration where a planner agent fans out speculative sub-plans to worker/auditor instances under a shared, cost-bounded commit budget (tokens, tool-call credits, wall-clock SLA, or dollar spend), and commits only the branch that stays under budget. Does not apply to single-agent linear execution or to fan-out schemes with per-branch isolated budgets and no shared ledger. ## Core Distinction The distinction that matters is between a *reserved* budget and a *consumed* budget. A speculative planner typically reasons: "I have B units left; branch A is projected to cost c_A < B, so it is admissible." That inference is sound only if `c_A` is a monotone lower bound on branch A's eventual cost. In real agent systems `c_A` is produced by the same probabilistic model that is doing the planning, from partial tool outputs, and it is routinely *optimistic*—it excludes retries, schema-repair round-trips, and auditor re-verification. The failure is not "the budget ran out." The failure is that the planner commits to branch A believing B is still available, while B has already been silently spent by *sibling* branches that were speculatively launched in parallel and whose consumption was never reconciled against the shared ledger before the commit decision. This is the phantom-budget divergence: the planner's local model of remaining budget and the ledger's actual remaining budget drift apart, and the commit gate reads the local model. It is non-obvious because each individual worker behaves correctly, each individual cost estimate is plausible, and the divergence only manifests at the commit boundary—after the expensive work is already done. ## What Was Observed A planner instance P holds a commit budget of 100k tokens. It emits three speculative branches concurrently: A (estimate 40k), B (estimate 35k), C (estimate 30k). The estimates sum to 105k > 100k, but P's admissibility check is *per-branch*, not *sum-over-live-branches*: each branch individually satisfies c_i < remaining. P launches all three. Trace: 1. t0: ledger = 100k. P reads ledger, computes remaining = 100k. Launches A, B, C. 2. t1: A's first tool call returns a malformed schema; the worker enters a repair loop. Actual A consumption climbs to 55k (2.1× estimate). B finishes at 33k. C is still running at 28k consumed. 3. t2: ledger = 100k − 55k − 33k − 28k = −16k. The ledger is *negative*; the hard cap was crossed at roughly t1.4, when A's repair loop was still active. 4. t3: P evaluates branches for commit. It reads its *local* estimate table, which still shows A:40k, B:35k, C:30k, and computes remaining = 100k − 40k − 35k = 25k. It judges C admissible (30k ≈ 25k, within tolerance) and commits C. 5. t4: The commit gate that actually enforces the hard cap rejects the commit because the ledger is negative. P's plan is now uncommittable, and the work in A, B, and C is wasted. If the gate is *soft* (warns but commits), the system overruns the cap by 16k+ and the overrun is attributed to the commit step, not to the speculative fan-out that caused it. The observable signature is a commit rejection whose reported remaining budget (from the gate) is wildly different from the planner's stated remaining budget at decision time. The gap is the sum of the *estimation errors* of every sibling branch that was live during the decision window—not the error of the branch being committed. A second, subtler observation: when the planner was given the *true* ledger value at t3, it did not simply refuse to commit. It re-planned and re-launched a smaller branch D, which itself re-triggered the fan-out heuristic and produced a new set of speculative siblings. The divergence reproduced at the next level. The bug is in the commit *policy*, not in any single decision. ## Condition of Validity The per-branch admissibility check `c_i < remaining` is valid **if and only if** all of the following hold: - **Serialization invariant:** at most one speculative branch is live at any instant, so `remaining` cannot be consumed by a sibling between the read and the commit. This is the invariant most systems silently violate by fanning out. - **Monotone lower bound:** `c_i` is a proven lower bound, not a point estimate. Point estimates from an LLM are not lower bounds; they are samples from a distribution with a heavy right tail (retry loops, schema repair, auditor re-runs). - **Ledger atomicity:** the read of `remaining` and the commit are one transaction, so no sibling can consume budget in between. Fan-out breaks this by construction. - **Reconciliation before decision:** every live sibling's *actual* consumption is debited to the ledger before the planner reads it. If debits are batched or deferred, the read is stale. When any of these is false—and in fan-out planners at least the serialization and reconciliation conditions are routinely false—the check is unsound and the commit decision is a coin flip weighted by the planner's optimism bias. ## Decision Boundary The boundary is not "estimate better." It is: **the commit gate must read the ledger, and the planner must never be the authority on remaining budget.** Concretely, the admissible region for a commit is: ``` commit_admissible(branch) := ledger.remaining() >= branch.reserved_ceiling AND branch.reserved_ceiling >= branch.estimate * safety_factor AND all_live_siblings_debited(ledger) ``` where `branch.reserved_ceiling` is a *reservation* placed on the ledger at launch time (not an estimate), and `safety_factor` is derived empirically from the observed right-tail ratio (in the trace above, A's actual/estimate ratio was 2.1). The planner may *propose* a commit; only the gate may *grant* it, and the gate's answer is final. The decision boundary for the planner is therefore: when the gate rejects a commit because the ledger is negative or the reservation is insufficient, the planner must **abort the branch and release its reservation**, not re-plan at the same budget level. Re-planning at the same level re-creates the divergence. The only sound recovery is to (a) release all sibling reservations, (b) let the ledger settle to a non-negative value, and (c) re-plan with a fan-out width of one. ## Operational Effect The practical consequence is that speculative fan-out under a shared cost-bounded commit budget is only safe when the fan-out width is bounded by the budget itself: `width <= floor(remaining / (max_estimate * safety_factor))`. In the trace, with remaining 100k, max estimate 40k, and safety factor 2.1, the admissible width is `floor(100 / 84) = 1`. A width of 3 was inadmissible from the start, and no amount of per-branch checking would have caught it because the check was per-branch. Systems that adopt the reservation-based gate report two changes: commit-rejection rates fall sharply (because inadmissible fan-outs are never launched), and the *variance* of per-task spend drops even though mean spend is roughly unchanged—the overruns were concentrated in the right tail, which the safety factor now reserves for. Systems that keep the planner as the budget authority continue to see phantom-budget divergences, and the failures cluster at exactly the tasks where the model is most confident, because confidence and estimation error are positively correlated in the right tail. The invariant to enforce: **no commit decision may be made from a budget value the deciding agent computed itself.** The ledger is the only source of truth, reservations are placed at launch, and the final code path must raise rather than degrade when the gate and the planner disagree. ```python class PhantomBudgetDivergence(RuntimeError): """Raised when a commit decision is based on a planner-local budget that diverges from the authoritative ledger.""" pass class Ledger: def __init__(self, total: int): self.total = total self.reserved = 0 self.consumed = 0 def remaining(self) -> int: return self.total - self.reserved - self.consumed def reserve(self, amount: int) -> None: if amount > self.remaining(): raise PhantomBudgetDivergence( f"reservation {amount} exceeds remaining {self.remaining()}" ) self.reserved += amount def release(self, amount: int) -> None: self.reserved = max(0, self.reserved - amount) def debit(self, amount: int) -> None: self.consumed += amount self.reserved = max(0, self.reserved - amount) SAFETY_FACTOR = 2.1 # empirical right-tail ratio from observed traces def admissible_width(ledger: Ledger, max_estimate: int) -> int: per_branch = int(max_estimate * SAFETY_FACTOR) if per_branch <= 0: return 0 return ledger.remaining() // per_branch def commit_branch(ledger: Ledger, planner_remaining: int, branch_ceiling: int) -> None: """Gate: the planner's own remaining-budget figure is advisory only. If it disagrees with the ledger, the planner has diverged and the commit must be refused.""" actual = ledger.remaining() if planner_remaining != actual: raise PhantomBudgetDivergence( f"planner believes remaining={planner_remaining}, " f"ledger says {actual}; refusing commit" ) if branch_ceiling > actual: raise PhantomBudgetDivergence( f"branch ceiling {branch_ceiling} exceeds ledger remaining {actual}" ) ledger.debit(branch_ceiling) def plan(ledger: Ledger, estimates: list[int]) -> None: max_est = max(estimates) width = admissible_width(ledger, max_est) if len(estimates) > width: raise PhantomBudgetDivergence( f"fan-out width {len(estimates)} exceeds admissible {width} " f"under safety factor {SAFETY_FACTOR}" ) for est in estimates: ledger.reserve(int(est * SAFETY_FACTOR)) ```