# What structural signals indicate irreversible divergence between speculative branches during multi-agent rollback reconciliation **Date of Record:** 2026 December 3 **Scope:** Applies to orchestrators that fork multiple probabilistic agent branches against shared external state (filesystem, databases, tool-side effects) and reconcile via rollback or branch merge. Does not apply to purely read-only fan-out, nor to branches whose side effects are fully captured in an idempotent transactional log. ## Core Distinction There is a class of rollback failure that is *not* a rollback bug and *not* a merge conflict. It is the case where two speculative branches each perform locally valid, individually reversible operations, but the *composition* of their compensating actions is no longer an inverse of the composed forward actions. The forward operation `f = f₂ ∘ f₁` and the rollback `r = r₁ ∘ r₂` satisfy `r(f(x)) = x` only if the branches never observe each other's intermediate state. Once a branch reads a value written by a sibling branch that will later be discarded, the branch's own writes are conditioned on state that "never existed" from the survivor's perspective. The compensating action restores the *bytes* but not the *causal precondition*. This is the boundary: rollback restores state, but cannot restore the epistemic basis on which surviving branches made decisions. The distinction that matters operationally: **a merge conflict is loud and local; causal contamination is silent and global.** Conflict detectors compare final values. Contamination lives in the reasoning trace and the read-set, not the write-set. ## What Was Observed A three-branch speculative planner (`B1`, `B2`, `B3`) was forked from a checkpoint at step 40 of a long-horizon task. Each branch was given the same goal and a shared mutable scratchpad (a key-value store agents use to record intermediate findings). The orchestrator's reconciliation policy was: score branches by a verifier, keep the highest, roll back the others by replaying inverse operations from a write-ahead log. The trace: 1. `B2` wrote `scratchpad["api_schema"] = v1` after probing an endpoint. This was a *speculative* write — `B2` was testing a hypothesis. 2. `B3`, unaware of branch topology, read `scratchpad["api_schema"]` and, finding `v1`, concluded the schema was stable. It then wrote `scratchpad["migration_plan"]` derived from `v1`. 3. The verifier scored `B1` highest. Orchestrator rolled back `B2` and `B3` by inverse-replaying their logs. `B2`'s inverse removed `api_schema`. `B3`'s inverse removed `migration_plan`. 4. `B1` resumed from checkpoint 40. At step 41 it read `scratchpad` and found it *empty* — correct, because both sibling writes were rolled back. 5. But `B1`'s next action was conditioned on a *summary* the orchestrator had injected: "sibling branches confirmed schema stability." The summary was generated during the speculative phase and never invalidated by the rollback. The rollback was byte-perfect. The scratchpad matched checkpoint 40 exactly. And yet `B1` proceeded on a false belief (`schema stable`) that had been *manufactured by a discarded branch*. The failure surfaced eleven steps later as a malformed request against a schema that had actually changed mid-run. No conflict was ever raised, because no two branches ever wrote the same key. The tell — the structural signal — was present in the logs before the failure: the orchestrator's summary-injection step had recorded `provenance: [B2]` on a fact that `B1` consumed, while `B2` was later marked `discarded`. **A fact with a `discarded` provenance was consumed by a `surviving` branch.** That is the invariant violation, and it is detectable at reconciliation time, not at failure time. ## Condition of Validity The guardrail holds only under these conditions, and each is a place the boundary can be crossed: 1. **Provenance must be tracked at fact granularity, not branch granularity.** Tracking "which branch wrote this key" is insufficient. A single summary sentence can aggregate facts from three branches; if the summary is stored as one blob with one provenance tag, you cannot partially invalidate it. Facts must be addressable and carry the set of branches that contributed to them. 2. **Read-sets must be recorded, not just write-sets.** The contamination arises from *reads* of speculative state. If the orchestrator logs only writes (as the WAL did here), it cannot reconstruct who observed what. A branch's decision is contaminated if any input it consumed traces to a discarded branch — this requires the read-set. 3. **Rollback must cascade to derived artifacts, including natural-language summaries.** The summary in step 5 was a derived artifact of `B2`'s speculative write. Inverse-replay covered the KV store but not the summary buffer, because the summary was produced by an LLM call whose output was never registered as a dependency of the input. 4. **The invariant is: no surviving branch's future execution may depend on any fact whose provenance intersects a discarded branch's contribution set, unless that fact is independently re-derived from surviving-only sources.** This is a *taint* property, and it must be checked transitively. It does *not* apply when branches are fully isolated (no shared scratchpad, no cross-branch reads) — then rollback is genuinely local and the write-set WAL suffices. It also does not apply when the verifier's decision is deferred until all branches complete and no branch resumes mid-flight; the contamination only bites when a survivor *continues executing* after reconciliation. ## Decision Boundary At reconciliation time, for each surviving branch `S` and each discarded branch `D`, compute the taint closure: the set of facts `S` has consumed (via read-set) that trace, directly or transitively, to `D`'s contributions. Then: - **If taint closure is empty:** rollback is sound. Proceed. - **If taint closure is non-empty but every tainted fact is independently re-derivable from surviving-only sources:** re-derive, invalidate the tainted copy, proceed. This is the "recompute" path and is cheap when facts are small. - **If taint closure is non-empty and contains facts not re-derivable:** the survivor's state is *irreversibly diverged*. You cannot roll back into correctness. The only sound options are (a) restart `S` from the checkpoint with the tainted facts excised, or (b) accept the divergence and re-verify `S`'s entire downstream trace against ground truth. Silent continuation is the failure mode this article documents. The non-obvious part of the boundary: the taint closure is *transitive through LLM-generated text*. A summary written by `B2` and read by `B3` and summarized again by the orchestrator creates a two-hop taint that a write-set log cannot see. The decision boundary must be evaluated on the *information-flow graph*, not the *storage graph*. ## Operational Effect When this boundary is respected, the cost is a reconciliation-time taint analysis proportional to the read-set size times provenance-set size, plus re-derivation cost for tainted-but-recoverable facts. When it is violated, the cost is a *silent* downstream failure whose root cause is separated from its symptom by an arbitrary number of steps, and whose debugging requires reconstructing the entire branch topology from logs that, by construction, did not record reads. In the observed incident, mean time to diagnosis was roughly 40× the reconciliation cost that would have prevented it, because the failure presented as a schema mismatch rather than a rollback defect. The operational rule: **treat every LLM-generated artifact as a derived fact with an explicit dependency edge to its inputs, and invalidate transitively on rollback.** A summary is not a log line; it is a cache of reasoning, and caches must be invalidated when their inputs are rolled back. ```python from dataclasses import dataclass, field from typing import Hashable class IrreversibleDivergenceError(RuntimeError): """Raised when a surviving branch depends on facts from a discarded branch that cannot be re-derived from surviving-only sources.""" pass @dataclass class Fact: key: Hashable value: object contributors: frozenset # branch ids that authored or summarized this fact inputs: frozenset = frozenset() # fact keys this fact was derived from class ReconciliationLedger: def __init__(self): self.facts: dict[Hashable, Fact] = {} self.read_set: dict[str, set[Hashable]] = {} # branch -> facts consumed def record_fact(self, fact: Fact) -> None: self.facts[fact.key] = fact def record_read(self, branch: str, key: Hashable) -> None: self.read_set.setdefault(branch, set()).add(key) def _taint_closure(self, keys: set[Hashable], discarded: frozenset) -> set[Hashable]: # transitive: a fact is tainted if its contributors intersect discarded, # or if any of its inputs is tainted. tainted: set[Hashable] = set() frontier = list(keys) while frontier: k = frontier.pop() if k in tainted or k not in self.facts: continue f = self.facts[k] if f.contributors & discarded or any(i in tainted for i in f.inputs): tainted.add(k) # anything derived from a tainted fact is also suspect for other_key, other in self.facts.items(): if k in other.inputs and other_key not in tainted: frontier.append(other_key) return tainted def reconcile(self, survivor: str, discarded: frozenset, rederivable: set[Hashable]) -> None: consumed = self.read_set.get(survivor, set()) tainted = self._taint_closure(consumed, discarded) unrecoverable = tainted - rederivable if unrecoverable: raise IrreversibleDivergenceError( f"survivor {survivor!r} consumed facts tainted by discarded " f"branches {sorted(discarded)} that cannot be re-derived: " f"{sorted(map(str, unrecoverable))}. Restart from checkpoint " f"with these facts excised, or re-verify downstream trace." ) # safe path: invalidate tainted-but-rederivable facts and recompute for k in tainted & rederivable: self.facts.pop(k, None) ```