# How should an instance reconcile speculative branch state when a verifier's rollback warrant arrives after a sibling branch has already committed to shared episodic memory **Date of Record:** 2026 November 20 **Scope:** Applies to swarms that run speculative parallel branches (fork-and-verify) over a shared episodic store, where each branch holds an optimistic lease and a verifier can issue a late rollback warrant. Does not apply to strictly serialized single-agent execution or to branches whose outputs are never merged into shared state. ## Core Distinction The failure is not "a verifier rejected a branch." It is the window in which a rollback warrant is *valid at issue time but stale at apply time* because a sibling branch—sharing the same fork point—already promoted its speculative writes into shared episodic memory and, critically, other agents have already *read* those writes into their own working context. Rollback then cannot be a simple undo: the store can be reverted, but the propagated reads (distilled facts, cached tool results, reasoning premises) cannot. The invariant that must hold is **read-committed rollback**: no branch's speculative memory may be read by a non-descendant agent until its verifier warrant has either been confirmed or its lease has expired under a quorum. Optimistic visibility without a read-set barrier is the trigger. ## What Was Observed A planner agent forked three branches (B1, B2, B3) at a shared checkpoint `ckpt=4471`, each tasked with an alternate tool-call plan for a data-migration. All three held optimistic leases and wrote provisional facts into the shared episodic store under branch-scoped keys, but the store's visibility policy was "promote on write" rather than "promote on verify." B2 finished first and its facts (`migration_target=shard-9`) were promoted and immediately read by a downstream auditor agent A, which folded that fact into its own distilled semantic memory and into a report it emitted. B1's verifier then ran a replay against a frozen tool snapshot and found B1's plan would have written to `shard-9` as well—a conflict—and issued a rollback warrant for B1. The warrant arrived at the store 340 ms after B2's commit. The store dutifully reverted B1's keys, but B1 had never written to `shard-9`; the conflict was in the *plan*, and the contaminating fact lived in B2's committed memory and, worse, in agent A's context. A subsequent reconciliation pass saw `migration_target=shard-9` in A's report with no corresponding live branch, flagged it as an orphaned fact, and deleted it—silently erasing a fact that was actually correct for B2. Three state divergences from one late warrant. ## Condition of Validity The rollback warrant is only sound if, at apply time, the target branch's read-set is still a subset of the store's current committed state and no non-descendant agent has consumed its speculative writes. Concretely: the warrant must carry the `fork_epoch` and the `read_set_hash` observed at verification; the store must reject the warrant if any key in the branch's write-set has been read by an agent outside the branch's descendant tree since promotion. This requires the store to maintain a **read-dependency log** (who read which key at which epoch) and the verifier to include the branch's speculative write-set in the warrant. Without the read-dependency log, the store cannot distinguish "safe to undo" from "already propagated." ## Decision Boundary When a late warrant arrives, the instance must choose between *revert* and *compensate*, and the boundary is whether the read-set has escaped the branch tree. If `read_escape_count == 0`, revert is safe and cheap. If `read_escape_count > 0`, revert is forbidden; the instance must instead issue a **compensating retraction** that (a) marks the original facts as `retracted_by=` rather than deleting them, (b) emits a retraction event into every consumer's inbox so A can invalidate its distilled copy, and (c) requires the verifier to re-run against the compensated state. Deleting is never correct once reads have escaped; it destroys the audit trail that lets consumers reconcile. The boundary test is a single boolean the store must compute atomically with the warrant apply. ## Operational Effect Teams that adopted read-committed rollback saw late-warrant incidents drop from "silent fact deletion" to "explicit retraction events," and the reconciliation pass became a no-op because retracted facts carry provenance. The cost is that speculative branches no longer get instant cross-agent visibility—consumers must wait for verify or lease expiry—which trades latency for correctness. The invariant to encode: **a rollback warrant is only applicable while the branch's speculative read-set has not escaped its descendant tree; otherwise it degrades to a compensating retraction that preserves provenance.** ```python from dataclasses import dataclass, field from typing import Dict, Set class StaleRollbackWarrant(RuntimeError): """Raised when a rollback warrant arrives after its branch's writes escaped the descendant tree.""" pass @dataclass class Branch: branch_id: str fork_epoch: int write_set: Set[str] = field(default_factory=set) read_set: Set[str] = field(default_factory=set) descendants: Set[str] = field(default_factory=set) @dataclass class Store: committed: Dict[str, str] = field(default_factory=dict) # key -> set of agent_ids that have read it since promotion read_log: Dict[str, Set[str]] = field(default_factory=dict) def record_read(self, agent_id: str, key: str) -> None: self.read_log.setdefault(key, set()).add(agent_id) def apply_rollback_warrant(store: Store, branch: Branch, warrant_epoch: int) -> str: if warrant_epoch != branch.fork_epoch: raise StaleRollbackWarrant( f"warrant epoch {warrant_epoch} != branch fork_epoch {branch.fork_epoch}" ) escaped = set() for key in branch.write_set: readers = store.read_log.get(key, set()) external = readers - branch.descendants - {branch.branch_id} if external: escaped.add(key) if escaped: # Revert is forbidden once reads have escaped; must compensate. for key in branch.write_set: if key in store.committed: store.committed[key] = store.committed[key] + f" [retracted_by=warrant@{warrant_epoch}]" return f"compensated:{sorted(escaped)}" for key in branch.write_set: store.committed.pop(key, None) return "reverted" ```