# What structural signals indicate that a speculative branch is unsound to merge after rollback in multi-agent reconciliation **Date of Record:** 2026 November 27 **Scope:** Applies to orchestrators that fan out speculative agent branches from a shared checkpoint, execute them concurrently, and reconcile a single committed result via rollback of losing branches. Does not apply to single-agent retry loops, to branches that never share mutable state, or to systems where branches are pure functions over immutable inputs. ## Core Distinction The naive model of speculative multi-agent execution treats a branch as a *transaction*: it either commits its result or rolls back cleanly, and reconciliation is a merge of the surviving branch's output. This model is wrong whenever branches share a mutable substrate — a common tool-call ledger, an external resource (a file, a database row, a rate-limited API), or a peer agent's memory that was written by an earlier branch. In those cases the correct mental object is not a transaction but a *causal cone*: a branch's result is only valid if every side effect it observed and every side effect it caused is consistent with the committed history. Rollback of a losing branch does not undo the causal influence that branch had on shared state before it lost. The boundary condition is therefore not "did the branch fail" but "did the branch's *observations* survive rollback while its *writes* did not" — an asymmetric residue that produces silently valid-looking but causally poisoned results. ## What Was Observed A three-branch speculative plan-execute swarm was reconciling a document-editing task. Branch A (planner-fast) and Branch B (planner-thorough) both wrote intermediate artifacts to a shared scratch ledger keyed by `(task_id, step_index)`. Branch C was a verifier that read the ledger to check consistency. The orchestrator selected B as the winner on a scoring pass and issued rollback to A and C. The rollback of A deleted A's ledger entries. The rollback of C deleted C's entries — but C had, during its verification pass, *read* A's entries and recorded a derived assertion `ledger_consistent=true` into its own state. That assertion was committed into the reconciler's evidence set *before* rollback because the reconciler merges evidence eagerly to reduce latency. After rollback, the committed result carried B's edits plus a consistency assertion that was derived from a branch (A) whose writes no longer existed. The assertion was true at observation time and false at commit time. No error fired: the schema validated, the hash of B's output matched, and the evidence set was internally well-formed. The failure surfaced only three steps later when a downstream agent tried to re-derive the assertion from the ledger and got a contradiction, triggering a full-task abort. The structural signal that was missed: the committed evidence set contained an assertion whose *provenance* was a rolled-back branch. The reconciler tracked *what* was asserted but not *which branch's causal cone* the assertion depended on. Rollback was keyed on branch identity, but dependency was keyed on artifact identity, and the two were never cross-checked. ## Condition of Validity A speculative branch is sound to merge only if, for every artifact in the committed result, the set of branches in its causal cone is a subset of the set of branches that survived rollback. Formally: let `cone(a)` be the branches whose reads or writes contributed to artifact `a`, and let `S` be the surviving branch set. The merge is valid iff `cone(a) ⊆ S` for all committed `a`. This invariant is violated whenever a branch reads state written by another branch that later rolls back, and that read is promoted into committed evidence — the classic read-your-sibling's-writes hazard, made non-obvious because the read *succeeded* and the derived value was *correct at the time*. The invariant also fails under a second, subtler condition: a branch that rolls back may have *mutated external state* the orchestrator cannot reverse (a sent email, a consumed rate-limit token, an appended log line another agent later parses). Here the branch's writes survive rollback in an external system even though its internal ledger entries were deleted, so `cone(a)` is incomplete by construction. The orchestrator's rollback is a *partial* inverse — it inverts internal state but not external effects — and any reconciliation that assumes total inversion is unsound. ## Decision Boundary The operational decision is whether to (a) merge the winning branch's result while quarantining any evidence whose cone includes a rolled-back branch, (b) re-run the losing branches' *reads* against the post-rollback ledger to re-derive evidence, or (c) abort and re-plan from the last clean checkpoint. The boundary is set by whether the rolled-back branch's reads can be cheaply re-derived: if `cone(a)` intersects the rolled-back set only through *reads* of internal ledger state, re-derivation (b) is sound and cheap; if it intersects through *external side effects* that cannot be replayed idempotently, only (c) is sound. Merging (a) is never sound when the quarantined evidence was load-bearing for the winner's own derivation — that is, when the winner read the loser's output rather than only the loser reading the winner's. The trap is that the scoring pass that selects the winner runs *before* rollback, so the winner's score was computed against a ledger that still contained the losers' writes. The winner may have been selected precisely *because* it exploited a loser's artifact. Selection and rollback are ordered wrong: the winner is chosen in a world that rollback then invalidates. ## Operational Effect The observable effect is a class of failures that pass every local check and fail only on replay or downstream re-derivation — "ghost-consistent" results. They are expensive because they surface late, after the committed result has been consumed by subsequent agents whose own state is now built on a poisoned premise. The remediation is to make provenance a first-class field on every evidence artifact and to gate the merge on the cone-subset check, and to order selection *after* a dry-run rollback so the winner is scored in the post-rollback world. Where external side effects are in play, the orchestrator must maintain a separate non-invertible-effects ledger and treat any branch that touched it as permanently in the cone of every artifact it could have influenced. ```python from dataclasses import dataclass, field class UnsoundSpeculativeMerge(RuntimeError): """Raised when a committed artifact's causal cone includes a rolled-back branch.""" @dataclass class Artifact: artifact_id: str value: object cone: frozenset[str] # branch ids whose reads/writes contributed @dataclass class Branch: branch_id: str external_effects: frozenset[str] = field(default_factory=frozenset) def reconcile( committed: list[Artifact], surviving: frozenset[str], rolled_back: frozenset[str], branches: dict[str, Branch], ) -> list[Artifact]: # Non-invertible external effects survive rollback; any branch that # touched them remains in the cone of everything downstream of it. non_invertible = frozenset( eff for bid in rolled_back for eff in branches[bid].external_effects ) for art in committed: leaked = art.cone & rolled_back if not leaked: continue if non_invertible: raise UnsoundSpeculativeMerge( f"artifact {art.artifact_id} depends on rolled-back branches " f"{sorted(leaked)} which left non-invertible external effects " f"{sorted(non_invertible)}; merge is unsound, re-plan required" ) # Reads-only contamination: re-derive rather than merge. raise UnsoundSpeculativeMerge( f"artifact {art.artifact_id} cone {sorted(art.cone)} is not a subset " f"of surviving {sorted(surviving)}; re-derive evidence post-rollback" ) return committed ```