# What happens when an instance speculates past a federated commit barrier: cross-org read-set drift under optimistic agent execution **Date of Record:** 2026 November 21 **Scope:** Applies to federated multi-agent systems where agents in different trust domains execute speculative (optimistic) sub-plans against shared resources and reconcile at a cross-org commit barrier. Does not apply to single-domain agent swarms with a trusted coordinator, nor to purely read-only speculative fan-out with no commit semantics. ## Core Distinction The failure mode here is not "two agents disagree." It is that a speculative instance *continues reasoning and tool-calling past the point where a federated commit barrier has already invalidated its read-set*, because the invalidation signal is delivered as an asynchronous, best-effort peer message rather than as a synchronous precondition on the next tool call. The distinction that matters: **speculation validity is a property of the read-set at commit time, not of the agent's local belief at inference time.** An agent that "feels" consistent—because its own trace is internally coherent—can be arbitrarily wrong the moment a peer org's commit lands. Optimistic concurrency control tolerates this for databases because the abort is cheap and the read-set is small. For LLM agents the read-set is enormous (retrieved memory, tool outputs, peer assertions), the abort is expensive (tokens already spent, side effects already attempted), and the agent will *narrate its way through* the invalidation unless a hard barrier stops it. ## What Was Observed A three-org federation: Org A (planner), Org B (resource owner, holds a versioned inventory agent), Org C (auditor/verifier). The planner at A speculatively dispatched a sub-plan to B: reserve 40 units, then to C: attest the reservation. B's inventory agent served a read at version `v17` (39 units available after a concurrent local commit bumped from `v16`). A's planner, holding a stale `v16` belief from a prior turn (38 units, 42 free), believed 40 was safe. The trigger: C's auditor returned a *conditional* attestation ("reservation valid if inventory ≥ v17"), which A's planner treated as a plain success token because the schema negotiation had downgraded the conditional field to a boolean during an earlier MCP capability handshake. A's planner proceeded to dispatch a *second* speculative reservation to B for 5 more units, reasoning over the stale 42-free belief. B's barrier had already committed at `v17` (39 free, 40 reserved → −1, rejected), but the rejection arrived at A *after* the second dispatch was already in flight and after A had written a checkpoint asserting "40+5 reserved, 3 free." The invariant that broke: **no speculative instance may dispatch a dependent sub-plan after its read-set has been invalidated by a federated commit, even if the invalidation notification has not yet arrived.** The system relied on notification delivery ordering that the transport did not guarantee. ## Condition of Validity The optimistic scheme is *only* valid when all three hold: 1. **Read-set versioning is transitive across orgs.** Every value an agent reasons over carries the originating org's commit version, and that version is monotonic and comparable across domains. In the incident, C's attestation carried `v17` but the field was flattened to a boolean, severing transitivity. 2. **The commit barrier is a synchronous precondition, not a message.** Before any dependent dispatch, the planner must re-validate its read-set against the current authoritative version at the owning org. Best-effort pub/sub invalidation is insufficient; it is a *hint*, not a *barrier*. 3. **Conditional results are non-collapsible.** Any attestation or reservation result that is conditional on a version must remain conditional through every schema hop; a lossy schema negotiation that turns `conditional_on(v)` into `true` is a correctness bug, not a formatting convenience. Absent any one, speculation degenerates into divergent execution with high-confidence narration. ## Decision Boundary The boundary is: **does the next action depend on a value whose authoritative version may have advanced since the read?** If yes, the agent must either (a) issue a synchronous re-read/validate against the owning org before dispatch, or (b) mark the action as *provisional* and forbid downstream dependents until validated. The failure is choosing neither—treating "no invalidation received" as "read-set valid," which is the classic read-your-writes confusion applied to a read-set you do not own. Concretely: A should have blocked the second reservation because its read-set was `v16`-rooted while C's attestation implied `≥v17`. The guardrail is a version-join: reconcile the max version seen across all peer responses and refuse to dispatch dependents if any input's version is below the reconciled floor. ## Operational Effect Without the barrier, the observed outcome was a *phantom reservation*: A's checkpoint asserted 45 units reserved and 3 free, B held 40 reserved and 39 free, and C had attested a condition that was never satisfiable. The divergence persisted across a checkpoint/resume because the checkpoint captured A's *belief*, not the reconciled truth—so a restarted instance resumed from a corrupted premise and re-derived the same invalid plan. Cost: two wasted LLM execution traces, one cross-org reconciliation escalation, and a 14-minute stall while the auditor replayed the attestation. The architectural fix is a **federated version-join barrier**: every peer response carries `(org, version, conditional_on)`; the planner computes `floor = max(version across inputs)` and refuses any dependent dispatch whose inputs are below `floor`; conditional results are carried as first-class typed objects that cannot be coerced to booleans; and checkpoints store the reconciled version floor alongside the belief so resume re-validates rather than trusts. ```python from dataclasses import dataclass, field from typing import Optional class ReadSetInvalidated(RuntimeError): """Raised when a speculative instance attempts a dependent dispatch after its read-set has been superseded by a federated commit.""" pass @dataclass(frozen=True) class VersionedValue: org: str version: int value: object conditional_on: Optional[int] = None # must not be flattened away @dataclass class SpeculativePlanner: read_set: list[VersionedValue] = field(default_factory=list) def reconciled_floor(self) -> int: if not self.read_set: return 0 return max(v.version for v in self.read_set) def dispatch_dependent(self, action: str, inputs: list[VersionedValue]) -> str: floor = self.reconciled_floor() # Invariant: no dependent dispatch below the reconciled version floor, # and no conditional input silently treated as unconditional success. for v in inputs: if v.version < floor: raise ReadSetInvalidated( f"dispatch '{action}' blocked: input from {v.org} at " f"v{v.version} < reconciled floor v{floor}; read-set " f"superseded by federated commit" ) if v.conditional_on is not None and v.conditional_on > v.version: raise ReadSetInvalidated( f"dispatch '{action}' blocked: input from {v.org} is " f"conditional on v{v.conditional_on} but read at " f"v{v.version}; attestation not yet satisfiable" ) return f"dispatched:{action}@v{floor}" # Incident replay: planner holds stale v16 belief, peer attestation implies v17. planner = SpeculativePlanner( read_set=[VersionedValue("B", 16, {"free": 42})] ) attestation = VersionedValue("C", 17, {"reservation": "ok"}, conditional_on=17) try: planner.dispatch_dependent("reserve_5_more", [attestation]) except ReadSetInvalidated as e: print(f"GUARDRAIL HELD: {e}") ```