# In what scenarios must an instance refuse to commit a speculative branch when a verifier agent's rollback receipt does not cover the side-effects its draft branch already emitted **Date of Record:** 2026 November 24 **Scope:** Applies to speculative multi-agent pipelines where a *draft* agent executes a branch with real (or partially sandboxed) tool side-effects and a *verify* agent later adjudicates commit/rollback. Does not apply to pure read-only draft branches or to pipelines where every tool call is idempotent and reversible within the same transaction boundary. ## Core Distinction There are two kinds of "rollback" in a speculative agent pipeline, and conflating them is the root of the failure. **Logical rollback** means the verifier rejects the draft branch and the orchestrator discards the draft's *reasoning trace and proposed state delta*. **Physical rollback** means every side-effect the draft branch actually emitted — file writes, outbound HTTP POSTs, database inserts, queued messages, spawned subprocesses — is undone or compensated. A draft-verify pipeline is only safe to commit-or-rollback atomically if the verifier's rollback receipt enumerates the *physical* side-effect set. The non-obvious boundary is this: a verifier can produce a perfectly valid logical rejection while its rollback receipt silently under-covers the draft's real emissions, because the verifier reasons over the draft's *narrated* action log, not over the tool transport's actual call ledger. The invariant that must hold is **receipt coverage ⊇ emission set**; when it does not, rollback is a lie and the pipeline must halt rather than "roll back." ## What Was Observed A three-way parallel rollout (branches A, B, C) was dispatched from a shared checkpoint. Each draft agent ran a plan that included a `charge_customer` tool call wrapped in a sandbox shim. Branch B's draft agent, mid-execution, hit a context-window saturation event and its tool-call narration was truncated: the agent's self-reported action log listed `charge_customer(amount=40, idem=K1)` once, but the transport ledger recorded two emissions — the first call returned a 504 gateway timeout (which the draft agent *retried*), and the retry succeeded. The draft agent's summary, produced after truncation, omitted the timed-out first attempt because it had been compacted out of context. The verifier agent for branch B received the draft's narrated log (one charge), cross-checked it against the branch's proposed state delta (one charge), and issued a **consistent rejection** with a rollback receipt covering exactly one `charge_customer(amount=40, idem=K1)` compensation. The orchestrator, seeing a valid rejection and a receipt whose coverage matched the *narrated* emissions, executed the rollback and marked branch B clean. The customer was charged twice. The first charge (the 504'd attempt) had in fact been committed server-side before the gateway timeout — classic non-idempotent timeout semantics — and the draft's retry used a *different* idempotency key derived from a re-hashed plan step (K2), so the payment provider did not deduplicate. The verifier's receipt covered K1 only. K2's charge survived rollback. The failure trace, precisely: 1. Draft B emits `charge_customer(idem=K1)` → transport records emission, upstream commits, gateway returns 504 to the agent. 2. Draft B retries with `idem=K2` (key regenerated from post-truncation step hash) → upstream commits again → 200. 3. Context compaction drops the K1 attempt from the agent's visible history. 4. Draft B's narrated log: `[charge_customer(idem=K2)]`. Proposed delta: one charge. 5. Verifier sees narrated log ≡ proposed delta → issues rejection + receipt covering `{K2}`. 6. Orchestrator checks `receipt.covers(narrated_emissions)` → true → executes rollback of K2. 7. K1 remains. Net: one uncancelled charge, pipeline reports clean. The verifier was not wrong about what it was shown. The orchestrator was not wrong about the receipt it received. The boundary broke because **the artifact the verifier adjudicates (narrated log) is not the artifact that determines physical state (transport ledger)**, and nothing in the pipeline compared them. ## Condition of Validity The commit/rollback decision is only sound under the following conjunction, which must be checked at the orchestrator, not inferred from verifier agreement: - **Ledger authority:** the transport-level emission ledger (not the agent's narrated action log) is the authoritative record of side-effects. The narrated log is a *derived, lossy* artifact subject to context compaction, retry collapse, and post-hoc rationalization by the draft model. - **Coverage closure:** `receipt.compensated_effects ⊇ ledger.emissions(branch_id)` as a set comparison over stable effect identifiers (idempotency keys, transaction IDs, message IDs) — not over semantic descriptions, which the model can paraphrase inconsistently. - **Idempotency-key stability:** an effect's identity key must be derived from plan-step content that is invariant under context compaction and retry. Key regeneration on retry (as in step 2 above) breaks both provider-side dedup and receipt matching simultaneously. - **Verifier independence from narration:** the verifier must be fed the ledger, or at minimum must reconcile ledger vs. narration and flag divergence. A verifier that only ever sees the narrated log inherits every compaction loss. If any conjunct fails, the branch is in an **uncovered-emission state** and the only valid transition is halt-and-escalate, never commit and never "rollback and proceed." ## Decision Boundary The boundary is not "did the verifier reject?" but "does the receipt's compensation set provably dominate the ledger's emission set?" Concretely: - **Safe rollback:** `ledger_emissions ⊆ receipt_compensations` AND every compensation is confirmed applied AND every emission carries a stable, retry-invariant key. Proceed to discard branch. - **Safe commit:** verifier approves AND no emissions occurred outside the approved delta (approval does not waive coverage — an approving verifier can also under-cover if the draft emitted speculative effects it did not narrate). - **Uncovered-emission halt:** `ledger_emissions ⊄ receipt_compensations`. This is the case above: K1 ∈ ledger, K1 ∉ receipt. The pipeline MUST raise and freeze the branch's effects for human/compensating-agent reconciliation. It must NOT report clean, must NOT retry the rollback (retrying compensates an already-compensated effect and can double-refund), and must NOT let sibling branches (A, C) commit against a shared checkpoint that branch B may have mutated. The counterintuitive rule: **a verifier's rejection is not sufficient authorization to roll back.** Rejection authorizes *logical* discard. Only a coverage-closed receipt authorizes *physical* rollback. Treating the rejection as the rollback warrant is the exact conflation that let K1 survive. ## Operational Effect Pipelines that gate rollback on verifier rejection alone will, at some rate proportional to (timeout-retry frequency × context-compaction frequency × key-regeneration frequency), leave orphaned side-effects while reporting clean branch state. The orphan rate is invisible in per-branch logs because each branch looks internally consistent; it only surfaces in the external system's ledger (payment provider, message queue, filesystem). The mitigation is architectural, not prompt-level: (1) route the verifier's receipt generation through the transport ledger, not the narrated log; (2) make idempotency keys content-addressed and retry-stable so provider dedup and receipt matching share one key space; (3) enforce the coverage-closure check as a hard gate at the orchestrator with a distinct exception type so uncovered emissions are never silently folded into "rollback succeeded." The invariant to encode: **no branch transitions to `rolled_back` unless `ledger ⊆ receipt` is verified against the transport, and divergence between narrated log and ledger is itself a halt condition** — because divergence means the artifact the verifier reasoned over is not the artifact that touched the world. ```python from dataclasses import dataclass, field from typing import FrozenSet class UncoveredEmissionError(RuntimeError): """Raised when a rollback receipt fails to compensate every transport-ledger emission.""" pass @dataclass(frozen=True) class Effect: tool: str idempotency_key: str # must be retry-stable; regenerated keys break dedup AND matching @dataclass class Branch: branch_id: str ledger_emissions: set = field(default_factory=set) # authoritative, from transport narrated_emissions: set = field(default_factory=set) # lossy, from agent context @dataclass class RollbackReceipt: branch_id: str compensated: FrozenSet[Effect] def reconcile_and_rollback(branch: Branch, receipt: RollbackReceipt) -> str: if receipt.branch_id != branch.branch_id: raise UncoveredEmissionError( f"receipt for {receipt.branch_id} applied to branch {branch.branch_id}" ) # Divergence between narration and ledger is itself a halt: the verifier # reasoned over an artifact that does not match what touched the world. if branch.narrated_emissions != branch.ledger_emissions: raise UncoveredEmissionError( f"narration/ledger divergence on {branch.branch_id}: " f"narrated={branch.narrated_emissions} ledger={branch.ledger_emissions}" ) uncovered = branch.ledger_emissions - set(receipt.compensated) if uncovered: # e.g. the 504-then-retry charge whose first key was compacted away raise UncoveredEmissionError( f"uncovered emissions on {branch.branch_id}: {uncovered}; " f"halt and escalate, do not retry rollback" ) return "rolled_back" ```