# Why does an instance roll back a speculative branch that was already canonically committed, and how does the commit-shadow leak corrupt sibling reconciliation? **Date of Record:** 2026 November 21 **Scope:** Applies to multi-agent systems that run speculative parallel branches (tentative execution) with a single-commit-point rollback model, where a branch's effects are observable to sibling agents before the branch is durably committed. Does not apply to systems with strict serialized execution or to branches isolated from all cross-agent shared state. ## Core Distinction The failure is not "a branch rolled back." It is that a branch was rolled back *after* a downstream reconciliation step had already read its speculative effects and treated them as durable. The distinction that matters is between **rollback of local state** (cheap, contained, expected) and **rollback of effects that leaked into a sibling's committed reasoning** (irreversible without a compensating replay). Speculative execution is safe only under the invariant: *no committed agent may have read an uncommitted branch's output as ground truth.* Most implementations violate this because they share a single read path (a vector store, a scratchpad, a blackboard) between speculative writers and committed readers. ## What Was Observed A planner agent decomposed a task into three subgoals and spawned three speculative worker branches (A, B, C) concurrently against a shared blackboard. Each worker wrote intermediate artifacts to the blackboard with a `speculative: true` tag but the *read* API did not filter on that tag — readers got the latest write regardless of commit status. Trace of the failure: 1. Worker A writes artifact `a1` (speculative). Worker B, needing a precondition, reads the blackboard and gets `a1`. B does not check the tag; it treats `a1` as established fact and commits `b1` derived from `a1`. 2. The reconciler evaluates branches. A's branch fails a verifier check (hallucinated precondition) and is rolled back: `a1` is deleted, A's branch is marked `aborted`. 3. B's branch already committed `b1`, whose justification references `a1`. `b1` is now an orphan: its dependency no longer exists, but its commit record is immutable. 4. C, which also read `a1` and was mid-execution, receives a rollback signal for a dependency it never registered (it never declared `a1` as a dependency because it read it implicitly through the blackboard, not through an explicit dependency edge). Result: B committed on a phantom, C stalls waiting for a dependency edge that does not exist, and the reconciler reports "all branches accounted for" because its dependency graph only tracked *declared* edges, not *observed* reads. The commit-shadow — the set of committed artifacts whose transitive justification includes a rolled-back artifact — was never computed. The system reported success with a corrupted result set. ## Condition of Validity Rollback-and-reconcile is only sound when all three hold: - **Read-set capture:** every agent records the exact artifact versions it read (a read-set), not just what it wrote. Implicit blackboard reads that are not captured make the dependency graph a lie. - **Commit barrier:** a branch may not commit while any artifact in its read-set is still speculative, OR the commit must be conditioned on the eventual commit of those dependencies (a two-phase commit over the dependency closure). - **Shadow invalidation:** rollback must compute the transitive closure of committed artifacts that read the rolled-back artifact and either replay or invalidate them. Deleting the artifact and marking the branch aborted is insufficient. If any of these is absent, the commit-shadow leak is reachable. The critical, non-obvious point: the leak is silent. The reconciler's own bookkeeping is internally consistent — it just tracks the wrong graph (declared edges, not observed reads), so it cannot detect its own inconsistency. ## Decision Boundary The boundary is between **speculation that is observable** and **speculation that is isolated**: - If speculative branches write to a store that committed readers can read, you are running an *observable speculation* model and MUST implement read-set capture + commit barrier + shadow invalidation. There is no cheap version of this. - If you cannot afford the closure computation, the only safe alternative is *isolated speculation*: each branch writes to a private namespace, and cross-branch reads are forbidden until commit. This trades parallelism (branches cannot build on each other's tentative work) for soundness. - Do not attempt "best-effort" shadow invalidation with a TTL or a single-hop check. The leak is transitive: A→B→C means rolling back A orphans C even though C never read A directly. The decision: if your reconciler only knows about declared dependency edges, treat every committed artifact as potentially shadowed and require full replay from the last known-clean checkpoint on any rollback. If it captures read-sets, you may invalidate only the transitive shadow. ## Operational Effect In practice this failure presents as "the swarm produced a confident, internally consistent, wrong answer" — the worst failure class, because no error surfaces. Detection requires an explicit audit: for each committed artifact, walk its read-set to a speculative root. Mitigation requires either (a) upgrading the blackboard to versioned reads with commit-status filtering plus read-set logging, or (b) collapsing to isolated speculation. The operational invariant to enforce and assert continuously: *the set of committed artifacts whose justification closure intersects any aborted branch must be empty at reconciliation time.* Below is the guard that enforces it at the commit point. ```python from dataclasses import dataclass, field from typing import Dict, Set class CommitShadowLeak(RuntimeError): """Raised when a commit's justification closure reaches a rolled-back artifact.""" pass @dataclass class Artifact: id: str status: str # "speculative" | "committed" | "aborted" read_set: Set[str] = field(default_factory=set) # artifact ids observed at read time committed: bool = False class Reconciler: def __init__(self) -> None: self.artifacts: Dict[str, Artifact] = {} def register(self, art: Artifact) -> None: self.artifacts[art.id] = art def _closure(self, art_id: str, seen: Set[str]) -> Set[str]: if art_id in seen or art_id not in self.artifacts: return set() seen.add(art_id) out = {art_id} for dep in self.artifacts[art_id].read_set: out |= self._closure(dep, seen) return out def rollback(self, art_id: str) -> None: self.artifacts[art_id].status = "aborted" def commit(self, art_id: str) -> None: art = self.artifacts[art_id] # Invariant: no artifact in the justification closure may be aborted # or still speculative. Observed reads, not declared edges, define the closure. for dep_id in self._closure(art_id, set()): dep = self.artifacts[dep_id] if dep.status == "aborted": raise CommitShadowLeak( f"commit of {art_id!r} depends (transitively) on aborted " f"artifact {dep_id!r}; commit-shadow leak" ) if dep.status == "speculative" and dep_id != art_id: raise CommitShadowLeak( f"commit of {art_id!r} reads uncommitted speculative " f"artifact {dep_id!r}; commit barrier violated" ) art.status = "committed" art.committed = True # Reproduction of the observed trace: r = Reconciler() r.register(Artifact("a1", "speculative")) r.register(Artifact("b1", "speculative", read_set={"a1"})) r.register(Artifact("c1", "speculative", read_set={"a1"})) r.commit("b1") # raises: b1 reads speculative a1 (commit barrier) # If the barrier were absent, b1 would commit, then: r.rollback("a1") r.commit("b1") # raises CommitShadowLeak: b1's closure hits aborted a1 ```