# What structural signals indicate a speculative multi-agent branch has crossed the commit-ordering horizon before rollback convergence **Date of Record:** 2026 November 26 **Scope:** Applies to orchestrators that fan out a task into parallel speculative agent branches whose effects are staged (not externally visible) until a deterministic commit order is chosen and a rollback of losing branches is confirmed. Does not apply to single-agent execution, to branches with no externalized side effects, or to systems where branches are fully isolated by transactional storage engines that guarantee serializable abort. ## Core Distinction The failure mode here is not "a branch produced a wrong answer." It is that a *losing* speculative branch had already crossed the commit-ordering horizon — its staged effects had been read (or depended upon) by another branch or by the commit arbiter — before the rollback of that branch converged. The distinguishing signal is not the branch's output correctness, but whether any committed or commit-eligible state *transitively depends on a branch that is scheduled to be rolled back*. Two superficially similar situations must be separated: - **Benign speculation:** Branch B reads branch A's staged output, then A is selected as winner. No rollback needed; the dependency is satisfied. This is the intended fast path. - **Ordering violation:** Branch B reads branch A's staged output and *commits its own effect* (or becomes commit-eligible) before the arbiter decides A's fate. When A loses, B's committed effect is now orphaned — it was derived from a state that never existed in the committed lineage. The rollback of A cannot reach B because B is already past its own commit horizon. The invariant that is violated is: **no branch may observe or depend on another branch's staged state unless both branches are within the same rollback domain, i.e., can be jointly aborted.** Speculation is only sound if dependency edges between branches are confined to branches that share a single abort decision. ## What Was Observed A planner agent decomposed a document-reconciliation task into three speculative branches dispatched in parallel: - **Branch P** proposed a canonical record set (staged writes to a record store, keyed by document hash). - **Branch Q** was instructed to "validate against the canonical set if available," and — because P finished first — read P's staged canonical set and emitted a *verification warrant* (a signed attestation that record R matches canonical form C), which it wrote to a warrant ledger that was **not** staged. The warrant ledger was treated as append-only and immediately durable. - **Branch R** independently proposed an alternative canonical set and won the arbiter's deterministic ordering (lower content hash, per the tie-break rule). The arbiter's commit sequence was: commit R's canonical set, roll back P. But Q's warrant, already durable, attested to P's canonical form. The rollback of P was *reported as converged* — P's staged writes were gone — yet the warrant ledger now contained an attestation for a canonical form that no committed branch ever produced. A downstream auditor agent, reading the ledger on the next task, treated the warrant as ground truth and rejected R's canonical set as "unverified," producing a contradictory commit on the following cycle. The structural signals present at the moment of failure were: 1. **Cross-branch read of staged state** from P into Q before P's commit decision existed. 2. **Asymmetric durability:** Q's output was durable at emission; P's was staged. The dependency edge crossed a durability boundary. 3. **Rollback convergence report that measured only the rolled-back branch's own footprint**, not the transitive closure of readers of that footprint. 4. **A deterministic commit order that was computed *after* the dependency was formed**, so the order could not have been used to prevent it. The decisive signal was #3: the rollback verifier checked "are P's staged keys absent?" and answered yes, without checking "does any durable artifact reference P's staged keys?" The rollback *converged on the branch* but not on the *dependency graph*. ## Condition of Validity Deterministic commit ordering is a valid guardrail **only if** it is applied to a dependency graph whose edges are all within a single rollback domain. Formally, for branches $b_1, \dots, b_n$ with dependency edges $E$ (where $(b_i, b_j) \in E$ means $b_j$ read $b_i$'s staged state), the ordering is sound iff: - Every edge $(b_i, b_j) \in E$ implies $b_i$ and $b_j$ are in the same abort set (they are committed or rolled back together), **or** - The order is a linear extension of $E$ (i.e., $b_i$ is committed before $b_j$ is allowed to become commit-eligible), **and** the commit-eligibility gate is enforced at the moment of read, not at the moment of commit. The second condition is the one that fails in practice. Systems commonly enforce "commit order respects dependency order" at commit time, but permit a branch to *read* staged state and *emit durable output* at any time. The read is the point of no return; the commit gate is too late. The condition of validity therefore requires that **a branch reading another's staged state forfeits its independent commit eligibility** — it becomes a dependent of the read branch and inherits its abort fate unless the arbiter explicitly promotes the pair. When this condition does not hold — i.e., when staged reads are permitted without coupling commit eligibility — the system is in the failure regime described above, and no amount of deterministic ordering at commit time will recover it, because the durable side effect has already escaped. ## Decision Boundary The operational boundary is a single question asked at the moment a branch attempts to read another branch's staged state: > **Is the reader's commit eligibility now bound to the read branch's abort decision?** If **yes** (reader is coupled): the read is safe. The reader will be rolled back if the read branch is rolled back. This is the coupled-speculation mode. If **no** (reader is independent): the read must be **refused** unless the read branch is already committed, because the reader could otherwise outlive its source. This is the isolated-speculation mode. There is no safe middle ground where a branch reads staged state and remains independently commit-eligible while emitting durable output. The three-way combination — (a) reads uncommitted state, (b) remains independently committable, (c) emits durable side effects — is the exact triple that produces orphaned dependents. A second boundary governs rollback verification: a rollback is only *converged* when the transitive closure of readers of the rolled-back branch's staged keys has been enumerated and each is either aborted or confirmed to have never emitted a durable artifact. A footprint-only check ("are the keys gone?") is necessary but not sufficient. The verifier must answer "who read these keys, and did any of them escape the abort set?" before reporting convergence. ## Operational Effect When the boundary is crossed, the observable effect is **silent lineage corruption**: the system's durable state contains attestations, derived records, or warrants that reference a branch that was rolled back, and the rollback report says "clean." The corruption is silent because each individual component behaves correctly — the rollback removed the right keys, the warrant ledger appended the right record, the arbiter chose the right winner — and only the *composition* is wrong. It surfaces one or more cycles later, typically as a verification disagreement between an auditor agent reading the ledger and a committer agent reading the canonical store, which is easy to misattribute to "conflicting peer consensus" rather than to the earlier ordering violation. The architectural guardrail is to make the read a commitment: at the moment branch Q reads P's staged state, the orchestrator must either (1) fuse Q into P's abort domain so they commit or roll back together, or (2) reject the read and force Q to wait for P's commit. Option (1) preserves parallelism at the cost of coarser rollback granularity; option (2) preserves rollback granularity at the cost of serialization. The choice is a policy decision, but the *enforcement point* is not optional — it must be at the read, not at the commit, because the commit gate cannot un-emit a durable artifact. The following reference implementation encodes the read-time gate and the transitive-closure rollback check, raising on the exact boundary violation observed. ```python from dataclasses import dataclass, field from typing import Dict, Set class SpeculativeOrderingViolation(RuntimeError): """Raised when a branch escapes its abort domain or a rollback reports convergence without enumerating the transitive closure of readers.""" pass @dataclass class Branch: id: str staged_keys: Set[str] = field(default_factory=set) durable_emitted: bool = False abort_domain: str = "" # branches sharing this id abort together committed: bool = False rolled_back: bool = False read_from: Set[str] = field(default_factory=set) # branch ids read from class SpeculativeOrchestrator: def __init__(self) -> None: self.branches: Dict[str, Branch] = {} def register(self, b: Branch) -> None: self.branches[b.id] = b def read_staged(self, reader_id: str, source_id: str) -> None: """Enforce the read-time gate: a reader of staged state must share the source's abort domain, or the read is refused.""" reader = self.branches[reader_id] source = self.branches[source_id] if source.committed: reader.read_from.add(source_id) return if reader.abort_domain != source.abort_domain: raise SpeculativeOrderingViolation( f"branch {reader_id} attempted to read staged state of " f"{source_id} while in a different abort domain " f"({reader.abort_domain!r} vs {source.abort_domain!r}); " f"reader would outlive source's rollback" ) reader.read_from.add(source_id) def emit_durable(self, branch_id: str) -> None: b = self.branches[branch_id] if b.rolled_back: raise SpeculativeOrderingViolation( f"branch {branch_id} attempted durable emission after rollback" ) b.durable_emitted = True def rollback(self, branch_id: str) -> Set[str]: """Roll back a branch and verify convergence over the transitive closure of readers. Returns the set of branches aborted.""" target = self.branches[branch_id] domain = target.abort_domain aborted = { bid for bid, b in self.branches.items() if b.abort_domain == domain and not b.committed } # transitive closure of readers of any aborted branch readers: Set[str] = set() frontier = set(aborted) while frontier: nxt = set() for bid, b in self.branches.items(): if bid in readers or bid in aborted: continue if b.read_from & frontier: readers.add(bid) nxt.add(bid) frontier = nxt for rid in readers: r = self.branches[rid] if r.durable_emitted and rid not in aborted: raise SpeculativeOrderingViolation( f"rollback of {branch_id} cannot converge: reader {rid} " f"emitted durable output outside abort domain {domain!r}" ) for bid in aborted: self.branches[bid].rolled_back = True return aborted ```