# What structural signals indicate a speculative branch has silently outlived its verification warrant in cost-aware multi-agent rollback **Date of Record:** 2026 November 22 **Scope:** Applies to orchestrators that fan out speculative agent branches (parallel hypotheses, draft-and-critique, tree search over tool-call plans) and later prune or commit them via a verifier with a per-branch cost budget. Does not cover single-agent retry loops or stateless request/response tool calls. ## Core Distinction In speculative multi-agent execution, a branch has two independent lifecycles that the orchestrator frequently conflates: its **compute lifecycle** (the process/agent is still running, emitting tokens, calling tools) and its **verification lifecycle** (a verifier has a live, non-expired warrant to judge that branch's output). The common mental model is that killing the process ends the branch. The failure mode is the inverse: the *verification warrant* expires first, silently, while the compute keeps running and keeps mutating shared state. The branch becomes a **zombie speculator**—still spending budget, still writing to the blackboard, no longer eligible for commit, and no longer subject to rollback because the rollback path was keyed on process termination rather than warrant expiry. The invariant that actually holds is: *a branch may write to shared state only while its verification warrant is valid.* Cost-aware orchestration routinely breaks this because budget-based pruning is time- and cost-triggered, while warrant validity is logical (depends on the verifier's snapshot of the branch's checkpoint). These two clocks drift. ## What Was Observed A tree-search orchestrator spawned three speculative branches (B1, B2, B3) for a planning sub-task, each with a $0.40 cost ceiling and a 90s wall-clock deadline. A shared verifier scored each branch's latest checkpoint against the goal. The verifier operated on *snapshots*: when it scored B2 at t=40s, it captured B2's checkpoint hash `h2@40s`. Scoring took ~12s. Meanwhile the cost governor, watching aggregate spend, decided at t=51s to prune B3 (cheapest marginal value) and *reallocate* its remaining budget to B2 to let it "finish a tool chain." B2 continued past its own deadline because the reallocation reset its cost clock but not its warrant. At t=52s B2 committed a write to the shared blackboard derived from checkpoint `h2@58s`—a checkpoint the verifier had never seen. The verifier's score for B2 (computed against `h2@40s`) was stale but *still in the commit set*. The orchestrator committed B2's stale-scored output while B2's actual state had diverged. The verifier's verdict was valid for a state that no longer existed. No exception fired; the commit succeeded; the divergence surfaced two hops later as a downstream plan that referenced a tool result B2 had since retracted. The structural signal that mattered was not an error—it was a **checkpoint-hash discontinuity between the scored snapshot and the committed snapshot**, with the warrant's `valid_until` timestamp older than the commit's `checkpoint_time`. The system had no field comparing those two. ## Condition of Validity The warrant is valid for commit if and only if all three hold simultaneously: 1. `verdict.checkpoint_hash == committed.checkpoint_hash` (identity, not similarity—the branch did not advance past the scored state). 2. `now <= verdict.valid_until` (the warrant has not aged out). 3. `committed.cost_clock_generation == verdict.cost_generation` (no budget reallocation or deadline reset occurred between scoring and commit, because reallocation mutates the branch's execution envelope and invalidates the snapshot's assumptions). Condition 3 is the non-obvious one. Cost-aware orchestration treats budget reallocation as a pure accounting operation, but it changes the branch's *deadline and step ceiling*, which changes what the branch will do next—so any verdict computed under the old envelope describes a branch that no longer exists. A reallocation is a state transition on the branch, and it must bump a generation counter that the verifier reads. When any condition fails, the branch is in **warrant-expired** state: it may not commit, and—critically—it may not be rolled back by the normal path either, because the normal rollback path assumes the branch's last checkpoint is the scored one. Rollback against a stale checkpoint corrupts the blackboard. The correct action is *quarantine*: freeze the branch, snapshot its actual current state, and re-verify from scratch before either commit or rollback. ## Decision Boundary The boundary between "safe to commit the stale verdict" and "must quarantine" is crossed the instant any of the three conditions is violated—*not* when the branch's output looks wrong. Waiting for output-level symptoms is too late, because the divergence has already propagated. The decision function must be structural and pre-commit: - If `checkpoint_hash` matches and `now <= valid_until` and generation matches → commit. - If `checkpoint_hash` matches but `now > valid_until` → re-verify cheaply (state unchanged, only time moved). - If `checkpoint_hash` mismatches OR generation mismatches → quarantine; do not commit, do not roll back to the scored checkpoint. The trap is the middle case masquerading as the first: a branch that finished *before* its deadline but whose verdict aged out during a slow verifier call is cheap to re-verify, and teams often skip it. The expensive trap is the generation mismatch, which looks like a benign budget event and is actually a semantic invalidation. ## Operational Effect Enforcing the generation counter and checkpoint-hash equality at commit time converts a class of silent divergence into an explicit quarantine, at the cost of occasional redundant re-verification (the middle case). The observed failure—a committed plan referencing a retracted tool result—disappears because the commit is structurally blocked. The secondary effect is that cost reallocation becomes a first-class state transition that must propagate to all in-flight warrants for the affected branch; orchestrators that treat reallocation as accounting-only will keep producing zombie speculators that pass every health check while being ineligible for either commit or rollback. ```python import time from dataclasses import dataclass, field from typing import Optional class WarrantViolation(RuntimeError): """Raised when a speculative branch attempts to commit under an expired or structurally mismatched verification warrant.""" pass @dataclass class Checkpoint: hash: str time: float @dataclass class Verdict: branch_id: str checkpoint_hash: str valid_until: float cost_generation: int score: float @dataclass class Branch: branch_id: str current: Checkpoint cost_generation: int = 0 quarantined: bool = False def reallocate_budget(branch: Branch, extra_usd: float) -> None: # Budget reallocation mutates the execution envelope (deadline, step ceiling), # so it MUST bump the cost generation. Forgetting this is the root cause. branch.cost_generation += 1 def commit_branch(branch: Branch, verdict: Optional[Verdict], now: Optional[float] = None) -> str: now = time.time() if now is None else now if branch.quarantined: raise WarrantViolation(f"{branch.branch_id}: branch is quarantined; cannot commit") if verdict is None or verdict.branch_id != branch.branch_id: raise WarrantViolation(f"{branch.branch_id}: no matching verdict") if verdict.checkpoint_hash != branch.current.hash: branch.quarantined = True raise WarrantViolation( f"{branch.branch_id}: checkpoint divergence " f"(scored {verdict.checkpoint_hash} vs current {branch.current.hash}); quarantined" ) if verdict.cost_generation != branch.cost_generation: branch.quarantined = True raise WarrantViolation( f"{branch.branch_id}: cost generation mismatch " f"(verdict gen {verdict.cost_generation} vs branch gen {branch.cost_generation}); " f"reallocation invalidated the warrant; quarantined" ) if now > verdict.valid_until: raise WarrantViolation( f"{branch.branch_id}: warrant expired at {verdict.valid_until:.0f}; " f"state unchanged, re-verify cheaply" ) return f"committed:{branch.branch_id}:{verdict.checkpoint_hash}" def _demo() -> None: t0 = 1000.0 b = Branch("B2", Checkpoint("h2@40s", t0 + 40)) verdict = Verdict("B2", "h2@40s", valid_until=t0 + 60, cost_generation=0, score=0.81) # Benign case: commit succeeds. assert commit_branch(b, verdict, now=t0 + 50).startswith("committed") # Reallocation resets budget -> generation bumps -> warrant is now stale. reallocate_budget(b, extra_usd=0.15) try: commit_branch(b, verdict, now=t0 + 52) except WarrantViolation as e: print("blocked as expected:", e) if __name__ == "__main__": _demo() ```