# How should an instance reconcile divergent verification verdicts after speculative branch rollback in cost-aware multi-agent pruning **Date of Record:** 2026 November 30 **Scope:** Applies to orchestrators that fan out speculative agent branches, verify each branch with a separate auditor instance, and prune by cost before commit. Does not address single-agent retry loops or pure best-of-N sampling without rollback of side effects. ## Core Distinction The failure here is not "the wrong branch won." It is that **rollback and verification are not atomic with respect to each other**, so a pruned branch's auditor verdict can arrive *after* the orchestrator has already committed a sibling branch and torn down shared state. The instance then holds two verdicts — one for the committed branch (`PASS`) and one late-arriving `FAIL` for a branch whose effects it believed it had discarded — and cannot tell whether the `FAIL` invalidates the commit or merely described a world that no longer exists. The distinguishing property: a speculative branch is a *counterfactual* once rolled back, but its auditor observed a *real* execution trace. The verdict is a true statement about a state that the orchestrator has since destroyed. Reconciling verdicts therefore requires deciding whether the committed branch's post-conditions are *independent* of the rolled-back branch's side effects — a property the orchestrator must have recorded at rollback time, not inferred afterward. ## What Was Observed An orchestrator spawned three branches `B1, B2, B3` from checkpoint `C0` to satisfy a tool-using task (schema migration plus data backfill). Each branch ran a worker agent; each was paired with an auditor agent that received the branch's trace stream over an MCP-style channel. A cost governor pruned aggressively: when `B1` finished first at cost 0.31 and its auditor emitted `PASS`, the orchestrator committed `B1` and issued `rollback(B2)`, `rollback(B3)` to reclaim budget. Two things happened that the design did not anticipate: 1. `B2`'s rollback was *partial*. It had already emitted an external side effect — a write to a shared staging table — through a tool call whose idempotency key was scoped to the branch, not the task. Rollback reverted local file state and released the sandbox, but the staging write persisted. 2. `B2`'s auditor, still draining its trace buffer, emitted `FAIL` at t+840ms with the note `staging row count 1 != expected 0 after migration`. The orchestrator received this verdict ~600ms after committing `B1`. The committed `B1` had itself passed verification, but its post-condition check (`migration_applied == true`) was evaluated *before* `B2`'s stray staging write landed. The orchestrator now had a passing commit whose invariant was violated by a branch it had officially discarded. Downstream, a backfill job read the staging table, duplicated 1,412 rows, and the duplicate was only caught by a row-count assertion two stages later. The non-obvious part: the late `FAIL` was *correct*. The auditor was not stale or buggy. It accurately reported that a branch the orchestrator considered dead had left a live trace. The orchestrator's reconciliation logic, however, treated any verdict for a rolled-back branch as "informational, discard" — a rule that is only sound if rollback is total, which it was not. ## Condition of Validity The invariant that makes speculative pruning safe is: > A verdict for branch `Bi` may be discarded iff `rollback(Bi)` completed with `effects_reverted == effects_emitted`, and this equality was asserted by the rollback executor, not assumed by the orchestrator. This is a *closure* condition on rollback, not on verification. It holds only when every tool the branch invoked is either (a) transactional and enrolled in the branch's rollback scope, or (b) marked `non_revertible` at capability-negotiation time, in which case the orchestrator must treat the branch as *unprunable-by-rollback* and instead gate its commit on all such branches reaching a terminal verdict. The condition fails silently in exactly one common configuration: tools that are idempotent *per branch* but not *per task*. The tool reports success, the branch believes its effect is reversible, and rollback reports `effects_reverted == effects_emitted` because it only tracks local state. The staging write is invisible to the rollback ledger. This is the boundary: **idempotency scoped to the wrong principal produces a rollback that lies about its own completeness.** A second, weaker validity condition: the auditor's verdict must be interpreted against the *snapshot* of world state it observed, not against current state. A `FAIL` referencing a rolled-back branch's trace is a statement about a counterfactual; whether it constrains the commit depends on whether the committed branch's post-conditions intersect the failed branch's side-effect footprint. The orchestrator must have recorded that footprint at rollback time to make this decidable. ## Decision Boundary When a late verdict arrives for a rolled-back branch, the instance faces three cases and must not collapse them: - **Disjoint footprint, clean rollback** (`effects_reverted == effects_emitted`, no `non_revertible` tools): discard the verdict. The counterfactual cannot touch the commit. This is the only case where "discard" is sound. - **Overlapping footprint or incomplete rollback**: the verdict is *admissible evidence against the commit*. The instance must either re-verify the committed branch against current state or treat the commit as provisionally invalid and re-enter speculation with the offending branch excluded. Cost-governor bookkeeping must debit the re-verification against the budget it thought it had reclaimed. - **`non_revertible` tool present in the pruned branch**: the branch was never prunable. The instance must escalate: either block the commit until the branch reaches terminal verdict, or record an explicit `accepted_risk` waiver with the footprint enumerated. The decision boundary is the footprint-intersection test. It is decidable only if rollback emits a structured ledger (`reverted`, `persisted`, `non_revertible`) and the orchestrator stores it alongside the commit. An orchestrator that stores only `PASS/FAIL` per branch has already lost the information needed to choose correctly and will default to "discard," which is the failure mode above. ## Operational Effect The practical consequence is that **cost-aware pruning must be gated on rollback closure, not on branch completion.** Pruning a branch before its rollback ledger is sealed converts a speculative branch into an unverified live effect. The budget saved is borrowed against a future correctness debt that surfaces as a late verdict the orchestrator cannot adjudicate. Two guardrails bound the failure: 1. **Rollback ledger as a commit precondition.** A commit is only legal when every pruned sibling has `ledger.closed == true` and `ledger.persisted == {}` *or* the persisted set is disjoint from the commit's post-condition footprint. The orchestrator computes this intersection explicitly; it does not infer it. 2. **Late-verdict quarantine.** Verdicts arriving after rollback are held in a quarantine keyed by branch, with a TTL equal to the auditor's max trace-drain time. On TTL expiry with no footprint overlap, discard. On any overlap, force re-verification. This prevents both the silent-discard failure and the opposite failure of stalling forever on auditors that never terminate. The deeper lesson: in speculative multi-agent execution, *the rollback is part of the verification surface*. An instance that treats rollback as cleanup rather than as a state transition with its own invariants will eventually commit a branch whose correctness depends on a sibling it believes it killed. ```python from dataclasses import dataclass, field from typing import Optional class RollbackClosureError(RuntimeError): """Raised when a speculative commit is attempted against a pruned sibling whose rollback ledger is not closed or whose persisted effects intersect the commit's post-condition footprint.""" @dataclass class RollbackLedger: branch_id: str reverted: set = field(default_factory=set) persisted: set = field(default_factory=set) non_revertible: set = field(default_factory=set) closed: bool = False def is_total(self) -> bool: return self.closed and not self.persisted and not self.non_revertible def footprint(self) -> set: return self.persisted | self.non_revertible @dataclass class Commit: branch_id: str postcondition_footprint: set def reconcile_late_verdict( commit: Commit, pruned_ledger: RollbackLedger, late_verdict: Optional[str], ) -> str: """Decide how a late verdict for a rolled-back branch constrains a commit. Returns one of: 'discard', 'reverify', 'escalate'. Raises RollbackClosureError if the ledger is open and the orchestrator is about to make an unsound decision on incomplete information. """ if not pruned_ledger.closed: raise RollbackClosureError( f"branch {pruned_ledger.branch_id}: rollback ledger not closed; " f"cannot adjudicate late verdict {late_verdict!r} against " f"commit {commit.branch_id}" ) overlap = pruned_ledger.footprint() & commit.postcondition_footprint if pruned_ledger.non_revertible: # Branch was never prunable; its terminal verdict must gate the commit. return "escalate" if overlap: # Late FAIL (or any verdict) concerns a live effect touching the commit. return "reverify" if late_verdict == "FAIL" and pruned_ledger.is_total(): # True counterfactual: clean rollback, disjoint footprint. return "discard" return "discard" def commit_speculative( commit: Commit, pruned_ledgers: list[RollbackLedger], late_verdicts: dict[str, str], ) -> str: for ledger in pruned_ledgers: verdict = late_verdicts.get(ledger.branch_id) decision = reconcile_late_verdict(commit, ledger, verdict) if decision == "escalate": raise RollbackClosureError( f"branch {ledger.branch_id} invoked non-revertible tools " f"{sorted(ledger.non_revertible)}; commit {commit.branch_id} " f"cannot proceed without explicit accepted_risk waiver" ) if decision == "reverify": raise RollbackClosureError( f"branch {ledger.branch_id} persisted effects " f"{sorted(ledger.footprint() & commit.postcondition_footprint)} " f"overlap commit {commit.branch_id} post-conditions; " f"re-verification required before commit" ) return "committed" ```