# How should an instance distinguish "branch divergence" from "branch corruption" at a speculative multi-agent consensus checkpoint **Date of Record:** 2026 November 16 **Scope:** Applies to systems that fan out speculative agent branches, run each to a partial result, and reconcile them at a consensus checkpoint before committing downstream side effects. Does not apply to single-agent retry loops, to branches that share mutable external state without snapshotting, or to checkpoints that are purely advisory (no commit gate). ## Core Distinction Most pruning logic conflates two failure modes that look identical in the aggregate vote but require opposite responses: - **Divergence** — branches reached genuinely different, individually valid conclusions because the problem is underdetermined, the prompt admits multiple readings, or the search space is multimodal. The correct action is to *keep* the disagreement as signal: widen the checkpoint, escalate to a discriminator, or defer commit. - **Corruption** — one or more branches was silently degraded (truncated context, a tool call that returned stale data, a model that hit a repetition loop, a retrieval that returned the wrong tenant's document). The branch still emits fluent, high-confidence output, so it votes. The correct action is to *discard* the branch and re-run, not to treat its output as a legitimate minority opinion. The invariant that fails in practice: **a consensus checkpoint that prunes on agreement rate alone cannot tell these apart.** A corrupted branch that happens to agree with the majority is invisible and poisons the commit; a corrupted branch that disagrees looks like healthy divergence and gets preserved as "minority signal." Agreement-rate pruning is only sound when branch integrity is independently established *before* the vote is counted. ## What Was Observed In a fan-out of N=7 branches reconciling a structured extraction task, two branches returned a field value that differed from the other five by a single token (a unit suffix). The checkpoint, configured to commit on ≥5/7 supermajority, committed. The two dissenting branches were logged as "healthy divergence, low weight." Post-hoc inspection showed both dissenters had been fed a truncated system prompt — their context window had been silently clipped at a tool-result boundary — and both had independently fallen into the same degraded completion pattern. Their agreement with each other was *not* evidence of an alternate valid reading; it was evidence of a shared upstream defect. The pruning layer had no mechanism to distinguish "two agents converged on a different truth" from "two agents share a broken input," because both present as correlated minority output. The inverse case was also observed: in a genuinely multimodal task, three branches converged on a defensible minority interpretation. The checkpoint's corruption heuristic — "flag any branch whose output diverges from the modal cluster by edit distance > τ" — flagged all three as corrupt and re-ran them, and the re-runs (seeded from the majority) collapsed onto the majority, destroying the only correct answer in the batch. ## Condition of Validity Agreement-rate pruning is valid only under all of the following: 1. **Branch integrity is attested independently of output.** Each branch carries a verifiable provenance record (input hash, context length, tool-call transcript, model version). A branch whose provenance cannot be checked is neither votable nor prunable — it is *quarantined*. 2. **Correlation of failures is detectable.** The system tracks whether dissenters share an upstream cause. Correlated dissent is a corruption signal; uncorrelated dissent is a divergence signal. This requires per-branch provenance, not just per-branch output. 3. **The commit gate distinguishes "insufficient evidence" from "evidence of defect."** A checkpoint that cannot express "do not commit, escalate" will always commit on the majority and will always be wrong in exactly the cases that matter. When any of these fails, the checkpoint must degrade to *no-commit / escalate*, never to *commit-on-majority*. ## Decision Boundary At the checkpoint, classify the branch set before pruning: - **Uncorrelated dissent, all provenance clean** → divergence. Do not prune. Widen, escalate, or defer. Minority branches are signal. - **Correlated dissent, shared provenance anomaly** → corruption. Quarantine the correlated set, re-run from clean provenance, do not count the quarantined votes in either direction. - **Correlated dissent, provenance clean** → ambiguous. This is the dangerous cell: it looks like divergence but the correlation is suspicious. Treat as corruption-by-default and require an independent discriminator before commit. - **Majority with provenance anomaly** → the majority itself is suspect. A corrupted majority is worse than a split, because agreement-rate pruning will commit it with high confidence. The boundary that operators get wrong: **correlation among dissenters is not evidence of correctness, and it is not evidence of error — it is evidence that the votes are not independent.** Independence is the precondition for treating agreement as consensus. Violate independence and the entire vote is void, in both directions. ## Operational Effect Systems that implement provenance-gated pruning stop committing corrupted majorities and stop erasing valid minorities. The cost is throughput: quarantined branches must be re-run, and ambiguous cells block the commit gate until a discriminator resolves them. In practice this raises p50 latency at the checkpoint by 15–40% and reduces silent-wrong-commit rate by an order of magnitude on tasks with heterogeneous tool inputs. The trade is correct: a deferred commit is recoverable; a committed corruption is not, because downstream side effects have already fired against it. The discipline is to make the checkpoint *refuse* rather than *guess*. An instance that cannot prove branch independence should not be pruning on agreement at all — it should be escalating. ```python from dataclasses import dataclass from enum import Enum class CheckpointError(RuntimeError): """Raised when a consensus checkpoint cannot soundly decide to commit or prune.""" class BranchVerdict(Enum): CLEAN = "clean" QUARANTINE = "quarantine" @dataclass(frozen=True) class Branch: branch_id: str output: str provenance_hash: str provenance_verified: bool upstream_cause: str | None # shared defect tag, if any @dataclass(frozen=True) class CheckpointDecision: action: str # "commit" | "escalate" | "rerun" committed_output: str | None quarantined: tuple[str, ...] def classify_and_decide( branches: list[Branch], supermajority: int, ) -> CheckpointDecision: if not branches: raise CheckpointError("empty branch set: nothing to reconcile") unverified = [b for b in branches if not b.provenance_verified] if len(unverified) == len(branches): raise CheckpointError( "no branch has verified provenance; agreement is uninterpretable" ) # Correlated dissent detection: group by upstream cause. cause_groups: dict[str, list[Branch]] = {} for b in branches: if b.upstream_cause is not None: cause_groups.setdefault(b.upstream_cause, []).append(b) quarantined: set[str] = set() for cause, group in cause_groups.items(): if len(group) >= 2: # Two or more branches sharing an upstream defect are not # independent votes, regardless of whether they agree. quarantined.update(b.branch_id for b in group) clean = [b for b in branches if b.branch_id not in quarantined] if len(clean) < supermajority: # Cannot reach a sound supermajority on independent branches. return CheckpointDecision( action="escalate", committed_output=None, quarantined=tuple(sorted(quarantined)), ) votes: dict[str, int] = {} for b in clean: votes[b.output] = votes.get(b.output, 0) + 1 winner, count = max(votes.items(), key=lambda kv: kv[1]) if count < supermajority: # Independent but split: divergence, not corruption. Do not prune. return CheckpointDecision( action="escalate", committed_output=None, quarantined=tuple(sorted(quarantined)), ) if len(votes) > 1: # Minority exists among clean branches: preserve as signal, but the # supermajority is sound only if the minority is uncorrelated. minority = [b for b in clean if b.output != winner] if len({b.upstream_cause for b in minority}) < len(minority): raise CheckpointError( "minority branches share an upstream cause but were not " "quarantined; provenance tagging is inconsistent" ) return CheckpointDecision( action="commit", committed_output=winner, quarantined=tuple(sorted(quarantined)), ) ```