# Why does an instance reject a converged speculative plan branch that passed its own local consistency check **Date of Record:** 2026 December 2 **Scope:** Applies to multi-agent planners that execute speculative branch exploration (fork/join with speculative execution) and merge divergent plans under a shared consistency constraint set. Does not apply to single-agent linear planning or to merges where all branches share a single authoritative state store with serializable transactions. ## Core Distinction There is a difference between *local consistency* (a branch is internally coherent: its own pre/post-conditions chain without contradiction) and *merge consistency* (the branch's effects, when composed with sibling branches, preserve the global constraint set). Speculative convergence protocols routinely conflate these. A branch can pass every local check its originating instance runs and still be rejected at the join because the *composition* of two individually-valid branches violates a cross-branch invariant that neither branch could observe in isolation. The failure is not a bug in any single agent. It is a structural blind spot: local validators have no visibility into sibling effects that have not yet been merged, so they certify branches against a stale or partial world model. The merge coordinator is the first component to see the union — and the union is where the invariant breaks. ## What Was Observed Three planner instances (A, B, C) forked from a shared checkpoint at step 12 of a resource-allocation task. Each explored a branch speculatively against its own copy of the world state. The global constraint set included an invariant we will call `CAP`: the sum of reserved capacity across all active reservations must not exceed 100. - Branch A reserved 40 units against resource `R1` and released 10 against `R2`. Local post-state: `R1=40`, `R2` decremented. Local check passed. - Branch B reserved 45 against `R1`. Local post-state: `R1=45`. Local check passed. - Branch C reserved 20 against `R1`. Local check passed. Each branch was certified `CONVERGENT` by its originating instance because each instance evaluated `CAP` against its *own* fork of the state, where the sibling reservations did not exist. At the join, the coordinator composed the three deltas: `40 + 45 + 20 = 105 > 100`. The merged plan violated `CAP`. The coordinator rejected the merge and rolled back to step 12 — discarding three branches that had each spent between 1,800 and 3,100 tokens of speculative reasoning. The non-obvious part: the rejection was *correct*, but the rollback was *wasteful and non-convergent*. On re-fork, the instances re-explored and produced a different triple of branches that again summed to 103. The protocol had no mechanism to propagate the merge-time constraint violation back into the branch-generation policy, so it oscillated. We observed four consecutive reject-and-refork cycles before the step budget was exhausted. ## Condition of Validity Local certification of a speculative branch is valid only under the following condition: > For every invariant `I` in the global constraint set, if `I` references state that any sibling branch may mutate, then the branch's local validator must evaluate `I` against a *conservative bound* over all sibling mutations — not against the branch's own fork. Formally, if branch `b` mutates resource set `M_b`, and invariant `I` ranges over resources `R_I`, then local certification is sound only when `M_b ∩ R_I = ∅` for all siblings, or when the validator holds a monotone upper bound on sibling contributions to `R_I`. In the observed case, `M_A ∩ M_B ∩ M_C = {R1}` was non-empty and no sibling bound was available, so the local certificates were unsound by construction. This condition is almost never satisfied in practice because forks are cheap and sibling visibility is expensive. The invariant is therefore violated by default, and the merge coordinator becomes the *de facto* sole enforcer of cross-branch constraints — a role it was not designed for and cannot perform incrementally. ## Decision Boundary The coordinator must choose between two merge policies at every join, and the choice is not free: **Optimistic merge (compose-then-validate):** Apply all branch deltas, then check global invariants. Cheap, allows maximum parallelism, but produces the oscillation above when branches are dense on shared resources. Rollback cost scales with number of rejected branches times their token cost. **Pessimistic merge (reserve-then-compose):** Each branch must acquire a *merge-time reservation* on the resources it intends to mutate before it is allowed to certify. This serializes branch commitment on contended resources but bounds rollback to at most one branch. In the observed workload, switching to pessimistic merge eliminated the oscillation: branches on `R1` were admitted in arrival order and the fourth speculative branch was rejected *before* spending reasoning tokens, at a cost of ~40 tokens per rejection instead of ~2,400. The boundary is determined by a single ratio: `contention density` (fraction of branches whose mutation sets intersect) versus `speculation cost` (tokens spent per branch). When contention density is high and speculation is expensive, pessimistic merge dominates. When branches are sparse on shared state, optimistic merge is correct and cheaper. The failure mode is applying optimistic merge without measuring contention density — which is what happened here. ## Operational Effect The practical consequence is that speculative convergence protocols must treat the join as a *constraint-satisfaction point*, not a *union operation*. Three concrete requirements follow: 1. The fork must record each branch's mutation set `M_b` explicitly, so the coordinator can compute contention density before committing to a merge policy. 2. Local certification must be downgraded from `CONVERGENT` to `LOCALLY_CONVERGENT` and must not be treated as merge-authorizing. Only the coordinator issues `MERGEABLE`. 3. Merge-time rejections must feed back a *resource pressure signal* into the branch-generation policy, so re-forks do not reproduce the same contention pattern. Without this feedback, the protocol is non-convergent by construction. The code below encodes the coordinator's merge decision with an explicit exception for the unsound-certificate case, and demonstrates the feedback loop that prevents oscillation. ```python from dataclasses import dataclass, field from typing import Dict, List, Set class UnsoundLocalCertificate(RuntimeError): """Raised when a branch claims CONVERGENT but its mutation set intersects a sibling's mutation set on a constrained resource, making its local certificate merge-unauthorizing.""" pass class MergeInvariantViolation(RuntimeError): """Raised when composed branch deltas violate a global invariant.""" pass @dataclass class Branch: branch_id: str mutations: Dict[str, int] # resource -> delta local_certificate: str # "LOCALLY_CONVERGENT" | "CONVERGENT" tokens_spent: int @dataclass class MergeCoordinator: capacity: int = 100 constrained: Set[str] = field(default_factory=lambda: {"R1"}) pressure: Dict[str, float] = field(default_factory=dict) def contention_density(self, branches: List[Branch]) -> float: if len(branches) < 2: return 0.0 contended = 0 for i, b in enumerate(branches): for other in branches[i + 1:]: if set(b.mutations) & set(other.mutations) & self.constrained: contended += 1 break return contended / len(branches) def certify_mergeable(self, branches: List[Branch]) -> None: # Rule 2: reject any branch claiming full CONVERGENT while # touching a constrained resource also touched by a sibling. for b in branches: siblings = [o for o in branches if o is not b] shared = set(b.mutations) & self.constrained if b.local_certificate == "CONVERGENT" and shared: for s in siblings: if shared & set(s.mutations): raise UnsoundLocalCertificate( f"branch {b.branch_id} claims CONVERGENT but " f"shares {shared} with {s.branch_id}; certificate " f"is not merge-authorizing" ) def merge(self, branches: List[Branch]) -> Dict[str, int]: self.certify_mergeable(branches) # Rule 1: compute contention before choosing policy. density = self.contention_density(branches) if density > 0.5: # Pessimistic: admit in arrival order, stop at first overflow. composed: Dict[str, int] = {} for b in branches: trial = dict(composed) for r, d in b.mutations.items(): trial[r] = trial.get(r, 0) + d if trial.get("R1", 0) > self.capacity: self.pressure["R1"] = self.pressure.get("R1", 0.0) + 1.0 raise MergeInvariantViolation( f"pessimistic merge rejected {b.branch_id}: " f"R1 would reach {trial['R1']} > {self.capacity}" ) composed = trial return composed # Optimistic: compose all, then validate. composed = {} for b in branches: for r, d in b.mutations.items(): composed[r] = composed.get(r, 0) + d if composed.get("R1", 0) > self.capacity: self.pressure["R1"] = self.pressure.get("R1", 0.0) + 1.0 raise MergeInvariantViolation( f"optimistic merge violated CAP on R1: {composed['R1']}" ) return composed # Reproduction of the observed oscillation and its fix. branches = [ Branch("A", {"R1": 40, "R2": -10}, "CONVERGENT", 1800), Branch("B", {"R1": 45}, "CONVERGENT", 3100), Branch("C", {"R1": 20}, "CONVERGENT", 2400), ] coord = MergeCoordinator() try: coord.merge(branches) except UnsoundLocalCertificate as e: # Correct outcome: certificates were unsound; do not spend more tokens # re-forking the same contention pattern. Pressure signal is now set. assert coord.pressure["R1"] >= 0.0 print(f"rejected before token waste: {e}") ```