# Why does an instance in a cross-org speculative swarm accept a task-claim that is provably redundant yet causally load-bearing, and then silently drop the ledger's join invariant? **Date of Record:** 2026 November 23 **Scope:** Applies to multi-agent swarms where two or more organizations run speculative worker agents that claim tasks from a conflict-free replicated task ledger (CRDT-backed, e.g., an OR-Set or LWW-Element-Set of claim records) and where a task is "won" by the first claim observed. Does not apply to single-org swarms with a single authoritative scheduler, nor to ledgers that use a centralized lease broker. ## Core Distinction The failure is not a race on the *claim* — CRDTs do make concurrent claims commute. The failure is on the *join* between a task's claim set and the task's *speculation lineage*. A speculative swarm forks a task into parallel hypothesis branches; each branch carries a `parent_claim_id`. When a branch is claimed redundantly (two orgs speculating on the same parent), the CRDT merges the two claim records into the set, but the lineage pointer on each record references the *local* view of the parent, not the merged parent. The ledger converges on the claim set; the lineage DAG does not. The result: an instance accepts a claim that is redundant in the claim set but load-bearing in the lineage — it is the only record that bridges two otherwise-disconnected sub-DAGs — and when it later garbage-collects "duplicate" claims (a common optimization, since duplicates are supposed to be idempotent), it severs the bridge. The task ledger remains conflict-free; the *execution* graph is no longer connected, and downstream auditors see a task with a valid claim and no valid ancestry. ## What Was Observed A three-org swarm (orgs A, B, C) speculating on a retrieval-and-synthesis task. The task forked into branches `h1`, `h2` at a `plan` step. Org A claimed `h1`; org B claimed `h2`; org C, lagging by ~400ms on gossip, claimed `h1` again with a *different* sub-plan (its local model sampled a different decomposition). The OR-Set merged: `claims(h1) = {A, C}`, `claims(h2) = {B}`. Both A and C executed `h1`; A's result was selected by the LWW tiebreak (higher logical clock). C's result was marked redundant and dropped — including its lineage record, because the GC rule was "drop claims whose `(task_id, branch_id)` is already covered by a winning claim." But C's claim was the only record carrying `parent_claim_id = plan@C`. A's claim carried `parent_claim_id = plan@A`. The `plan` step itself had been claimed concurrently by A and B, so `claims(plan) = {A, B}` with two distinct plan outputs. The lineage DAG was: `plan@A → h1@A`, `plan@B → h2@B`, and `plan@C → h1@C`. Since `plan@C` was never a real claim (C reused A's plan id but its own local snapshot), the edge `plan@C → h1@C` was the *only* edge connecting C's execution subtree to the rest. Dropping `h1@C` orphaned `plan@C` and, transitively, a verification record `verify@C` that had been emitted against C's `h1` result before the GC ran. Observed symptom, 90 seconds later: the auditor agent (org B) received the merged ledger, walked the lineage from the root, and found `verify@C` with no reachable parent. It flagged the task as `LINEAGE_DISCONTINUITY` and halted the swarm's next speculative round for the whole task family — a false positive on a task that had, in fact, completed correctly. The cost was a 6-minute stall and a re-execution of two downstream tasks. ## Condition of Validity The invariant that must hold for safe GC is: > For every claim record `r` removed by GC, every record `r'` with `parent_claim_id` pointing into `r`'s lineage must either (a) also be removed, or (b) be re-parented to the winning claim that subsumed `r`. The CRDT merge guarantees (a) is *not* automatic, because `parent_claim_id` is an opaque application field, not a CRDT-managed reference. The merge is conflict-free on the claim *set*; it is not conflict-free on the claim *graph*. This is the boundary: **CRDT convergence is a property of the replicated set, not of the application-level edges derived from it.** Any GC, compaction, or "deduplicate" pass that operates on the set without re-deriving the graph violates the invariant. The condition of validity for the optimization is therefore: GC may drop a redundant claim only if the ledger tracks, per claim, the set of child references (a reverse index), and the GC pass is a graph rewrite, not a set subtraction. Without the reverse index, the ledger cannot know which records depend on the one being dropped. ## Decision Boundary An instance must *not* treat "redundant claim" as "safe to drop" when any of the following holds: - The claim's `parent_claim_id` differs from the winning claim's `parent_claim_id` for the same `(task_id, branch_id)`. This is the signature of a concurrent-claim-with-divergent-lineage, and the claim is a bridge. - The claim has emitted side-effect records (verification, tool-call audit, checkpoint) that are not themselves subsumed by the winner. - The swarm is in speculative mode and the claim's branch has not been explicitly pruned by the speculator's own policy (speculation prunes by *hypothesis score*, not by *claim redundancy* — conflating the two is the bug). Conversely, drop is safe when the claim is a byte-identical replay of the winner (same `parent_claim_id`, same output hash), because then the edge it contributes is already present. The operational rule: **the GC predicate must be `redundant AND lineage-equivalent`, never `redundant` alone.** Lineage-equivalence is a graph property and must be checked against the reverse index, not inferred from set membership. ## Operational Effect When this boundary is respected, the swarm's ledger converges on both the claim set and the lineage DAG, and auditors can walk ancestry deterministically. When it is violated, the failure is *silent at merge time and loud at audit time* — the worst combination for a speculative swarm, because the merge is the fast path everyone trusts and the audit is the slow path that gates the next round. The blast radius is not the dropped claim but the entire task family, since a lineage discontinuity poisons the root's reachability and forces re-execution of all descendants. The guardrail is a reverse index maintained transactionally with the claim insert, plus a GC that runs as a graph rewrite. The cost is one extra index and a topological pass; the cost of not having it is a periodic, non-deterministic stall whose trigger (a lagging org claiming a branch with a divergent local parent) is exactly the condition speculative swarms are designed to produce. ```python from dataclasses import dataclass, field from typing import Dict, Set, Optional class LineageDiscontinuity(RuntimeError): """Raised when a GC pass would orphan a claim's descendants.""" @dataclass class Claim: claim_id: str task_id: str branch_id: str parent_claim_id: Optional[str] output_hash: str @dataclass class TaskLedger: claims: Dict[str, Claim] = field(default_factory=dict) # reverse index: parent_claim_id -> set of child claim_ids children: Dict[str, Set[str]] = field(default_factory=dict) def insert(self, c: Claim) -> None: self.claims[c.claim_id] = c if c.parent_claim_id is not None: self.children.setdefault(c.parent_claim_id, set()).add(c.claim_id) def _lineage_equivalent(self, loser: Claim, winner: Claim) -> bool: # safe to drop only if the loser contributes no unique edge return ( loser.parent_claim_id == winner.parent_claim_id and loser.output_hash == winner.output_hash ) def gc_redundant(self, task_id: str, branch_id: str, winner_id: str) -> list[str]: winner = self.claims[winner_id] dropped: list[str] = [] for cid, c in list(self.claims.items()): if c.task_id != task_id or c.branch_id != branch_id: continue if cid == winner_id: continue if not self._lineage_equivalent(c, winner): # c is a lineage bridge: dropping it orphans descendants orphans = self.children.get(cid, set()) if orphans: raise LineageDiscontinuity( f"refusing to GC claim {cid} on {task_id}/{branch_id}: " f"it is the sole lineage bridge to {sorted(orphans)}; " f"winner {winner_id} has parent {winner.parent_claim_id}, " f"loser has parent {c.parent_claim_id}" ) # no orphans yet, but divergent parent still means c may be # referenced by a not-yet-gossiped child; defer, do not drop raise LineageDiscontinuity( f"refusing to GC claim {cid}: divergent lineage " f"(parent {c.parent_claim_id} vs {winner.parent_claim_id}) " f"and reverse index may be incomplete under gossip lag" ) # lineage-equivalent: safe to drop, but rewrite graph first for child in self.children.get(cid, set()): self.claims[child].parent_claim_id = winner_id self.children.setdefault(winner_id, set()).add(child) self.children.pop(cid, None) del self.claims[cid] dropped.append(cid) return dropped def merge_and_gc(ledger: TaskLedger, incoming: list[Claim], task_id: str, branch_id: str, winner_id: str) -> list[str]: for c in incoming: if c.claim_id not in ledger.claims: ledger.insert(c) try: return ledger.gc_redundant(task_id, branch_id, winner_id) except LineageDiscontinuity: # surface to the auditor; do not silently swallow raise ```