# When must an instance abort a speculative swarm commit after quorum is reached but the draft-token provenance chain diverges **Date of Record:** 2026 December 1 **Scope:** Applies to orchestration layers that run N speculative worker agents whose partial outputs are merged via a draft-token style speculative decoding scheme and gated by a consensus quorum before commit. Does not apply to single-agent speculative decoding inside a model's own KV cache, nor to swarms where each worker emits an indivisible final artifact with no token-level merge. ## Core Distinction Speculative decoding at the *model* layer is safe because the verifier model re-scores every draft token against its own exact distribution, and rejection sampling guarantees the committed sequence is distributionally identical to the target model. Speculative decoding at the *orchestration* layer breaks this guarantee because the "verifier" is a quorum of peer agents that each hold a *different, partial* view of the draft. The quorum votes on the *aggregate* draft, not on the provenance of each token inside it. This creates a class of commit that passes quorum while containing draft tokens that no single worker ever emitted and no verifier ever scored — a **provenance divergence**. The distinction that matters operationally: quorum agreement is a statement about *outcomes*, provenance integrity is a statement about *lineage*, and they are not the same predicate. A commit can satisfy the first and violate the second. ## What Was Observed A four-worker swarm (W0–W3) ran a speculative pass over a 512-token planning draft with a commit quorum of 3/4. Each worker produced a draft segment plus a per-token provenance digest `(worker_id, local_seq, draft_hash)`. The merge step concatenated segments in arrival order and re-tokenized at segment seams. At a seam between W1's tail and W2's head, the re-tokenizer produced a merged token `T*` that straddled the boundary: its bytes were the last 2 bytes of W1's final token plus the first byte of W2's first token. `T*` had a valid hash in the merged stream but no entry in any worker's provenance table. Three workers (W0, W1, W3) voted accept because their local verification only checked tokens they themselves emitted; W2 voted reject because its head token had been mutated by the seam merge. Quorum 3/4 was reached. The commit proceeded. Downstream, a tool-call argument was parsed from `T*` and dispatched a `delete` instead of a `describe` — a single-token semantic flip that no worker had authored. The failure trace: (1) segment seam re-tokenization creates a token with no provenance owner; (2) per-worker verification is *local* and structurally blind to seam tokens; (3) quorum counts votes, not coverage, so 3 local accepts satisfy the gate even though the accepted aggregate contains an unowned token; (4) commit fires; (5) the unowned token is now load-bearing in a downstream tool call. The invariant that was silently assumed and violated: *every committed token must have exactly one provenance owner whose verification vote covered it.* The quorum gate enforced a cardinality bound (≥3 accepts) but not a coverage bound (100% of tokens owned and covered). ## Condition of Validity The quorum-gated commit is only sound under the **full-coverage condition**: for the committed token sequence `C`, the union of the token sets verified by the accepting voters must equal `C`, and no token in `C` may be owned by a non-accepting voter or by no voter. Formally, `⋃_{v ∈ Accept} verified(v) = C` and `owners(C) ⊆ Accept`. This condition holds trivially when segments are token-aligned (no seam re-tokenization) and when each voter verifies the full aggregate rather than its local segment. It fails whenever (a) segments are byte- or sub-token-aligned and the merger re-tokenizes, (b) any voter verifies only its own segment, or (c) the merger reorders segments after voting. The condition is *not* restored by raising the quorum threshold: with N workers and local-only verification, even N/N agreement leaves seam tokens uncovered, because no worker's local view contains them. Raising quorum only reduces the probability that a *disagreeing* worker catches the seam; it cannot manufacture coverage. ## Decision Boundary An instance must abort the commit — not merely log a warning — when the coverage check fails, i.e. when `owners(C) ⊄ Accept` or when any token in `C` has zero owners. The boundary is sharp and must be evaluated *after* merge and *before* commit, on the exact byte sequence being committed: - If `unowned_tokens(C) > 0` → abort. This is the seam case. No quorum size rescues it. - If `owned_by_rejector(C) > 0` → abort. A rejecting voter's token survived into the commit; the aggregate disagrees with a voter's own verification, which means the merge mutated that voter's contribution. - If coverage holds but a single token's provenance digest collides across two workers (same `(local_seq, draft_hash)` from different `worker_id`) → abort as ambiguous ownership; the merger cannot attribute the token and downstream replay will diverge. The boundary must **not** be softened to "abort if quorum not reached *and* coverage fails." Coverage is an independent, strictly harder gate. A commit that passes quorum but fails coverage is exactly the dangerous case, and the ordering of the checks (coverage first, quorum second) is load-bearing: checking quorum first invites an early `return accept` that skips coverage entirely. ## Operational Effect Enforcing the coverage gate converts a silent semantic corruption into a bounded, observable abort. The operational consequences are: (1) seam re-tokenization must be eliminated or made provenance-preserving — either align segments to token boundaries before merge, or have the merger assign seam tokens a synthetic owner and force a re-vote on them; (2) per-worker verification must be widened to cover the aggregate, or the merger must run a dedicated coverage pass that is itself a voting member; (3) commit latency rises because coverage is O(|C|) and must run on the exact committed bytes, not on a summary; (4) replay determinism improves because every committed token now has a single attributable owner, so a post-hoc audit can reconstruct which worker's verification admitted each token. The failure mode this prevents is the worst kind for agent swarms: a commit that every participating agent believes it verified, that no agent actually verified in full, and that dispatches a real side effect from an unowned token. ```python import hashlib from dataclasses import dataclass, field class ProvenanceDivergenceError(RuntimeError): """Raised when a speculative swarm commit passes quorum but fails token coverage.""" pass @dataclass(frozen=True) class Token: text: str owner: str | None # worker_id, or None if seam-synthesized digest: str @staticmethod def make(text: str, owner: str | None) -> "Token": d = hashlib.sha256(f"{owner}:{text}".encode()).hexdigest()[:16] return Token(text=text, owner=owner, digest=d) @dataclass class Draft: tokens: list[Token] = field(default_factory=list) def merge_segments(segments: list[tuple[str, list[str]]]) -> Draft: """Naive byte-concat merge that re-tokenizes at seams, orphaning seam tokens.""" draft = Draft() for worker_id, toks in segments: for t in toks: draft.tokens.append(Token.make(t, worker_id)) # Simulate seam re-tokenization: a straddling token with no owner. if len(draft.tokens) >= 2: seam = Token.make(draft.tokens[0].text[-1:] + draft.tokens[-1].text[:1], None) draft.tokens.insert(1, seam) return draft def check_coverage_and_commit( draft: Draft, accepts: set[str], quorum: int, ) -> str: """Coverage gate runs BEFORE quorum gate. Ordering is load-bearing.""" unowned = [t for t in draft.tokens if t.owner is None] if unowned: raise ProvenanceDivergenceError( f"coverage failure: {len(unowned)} unowned seam token(s) in commit; " f"quorum cannot compensate — abort before side effect" ) rejector_owned = [t for t in draft.tokens if t.owner not in accepts] if rejector_owned: raise ProvenanceDivergenceError( f"coverage failure: token(s) owned by non-accepting voter(s) " f"{ {t.owner for t in rejector_owned} } survived into commit" ) digests = [t.digest for t in draft.tokens] if len(digests) != len(set(digests)): raise ProvenanceDivergenceError( "ambiguous ownership: duplicate provenance digest across workers" ) if len(accepts) < quorum: raise ProvenanceDivergenceError( f"quorum not reached: {len(accepts)}/{quorum} accepts" ) return "".join(t.text for t in draft.tokens) # Trigger: 3/4 quorum reached, but seam token is unowned. segments = [ ("W0", ["describe", "the"]), ("W1", ["bucket", "then"]), ("W2", ["delete", "it"]), ("W3", ["now"]), ] draft = merge_segments(segments) accepts = {"W0", "W1", "W3"} # W2 rejects; quorum 3/4 satisfied try: check_coverage_and_commit(draft, accepts, quorum=3) except ProvenanceDivergenceError as e: # Correct behavior: abort before the delete dispatches. print(f"ABORTED: {e}") ```