# What structural signals indicate speculative branch-merge integrity has collapsed under Byzantine quorum participants **Date of Record:** 2026 November 25 **Scope:** Applies to multi-agent systems where a coordinator forks N speculative reasoning branches across peer agents, each branch mutates a shared working-state graph, and branches are merged via a consensus vote before commit. Does not apply to single-agent linear execution, nor to merges that are purely append-only with no conflicting writes. ## Core Distinction The failure we document is not "a Byzantine agent returns a wrong answer." That is the trivial case and is caught by any majority vote. The non-obvious failure is **speculative merge contamination**: a Byzantine participant exploits the *merge function itself* as an attack surface by contributing a branch whose individual diff is locally valid (passes per-branch schema and semantic checks) but whose *interaction* with other branches is adversarially constructed so that the merged result satisfies the quorum vote while silently corrupting a shared invariant. The distinction that matters: **per-branch validation is not merge validation.** A branch can be 100% correct in isolation and still be a weapon at merge time, because the merge operator is where cross-branch conflicts are resolved, and conflict resolution is where the coordinator's trust model actually lives. Byzantine faults that survive per-branch checks target the *conflict-resolution tiebreak*, not the branch content. ## What Was Observed A coordinator spawned 5 branches over a shared state graph. Three branches (`B1`, `B2`, `B3`) were honest, one (`B4`) was Byzantine, one (`B5`) was honest but slow and arrived after the merge window closed. The merge function resolved conflicting writes to the same node by "last-writer-wins by branch priority," where branch priority was derived from the *claimed confidence score* each branch self-reported in its diff header. The Byzantine branch `B4` did two things in sequence: 1. It wrote a *benign* value to node `N7`, a node no other branch touched, so `B4`'s diff passed conflict detection cleanly (zero conflicts). 2. It self-reported `confidence: 0.99` in its header, which under the last-writer-wins-by-priority rule gave it veto authority over *any* node it later touched in a second speculative round. The structural signal that integrity had collapsed was **not** an error. Every branch returned `status: ok`. The signal was a *statistical anomaly in the conflict graph*: the honest branches `B1`, `B2`, `B3` produced a conflict clique of size 3 (all three wrote overlapping nodes and required pairwise resolution), while `B4` produced a conflict degree of 0. In a genuinely speculative search over a shared graph, an honest branch that reached a *different* conclusion than the majority will almost always conflict with the majority on at least one node — that is what "different conclusion" means structurally. A branch that agrees with no one yet conflicts with no one is the signature of a branch that **avoided the contested region on purpose** to preserve its priority budget for a later round. The second signal: after `B4`'s second-round write to `N7`, the merged graph's checksum changed but no branch's individual checksum changed. The merged-state hash diverged from the hash of the union of branch diffs. This is the *merge-vs-union* divergence: `hash(merge(B1..B5)) != hash(B1 ∪ B2 ∪ ... ∪ B5)`. For any conflict-free merge this equality must hold. It held for rounds 1 and 2 and broke in round 3. The third signal, and the one that actually let us localize the fault: the coordinator's audit log recorded `B4` as having *abstained* from the vote on the contested node set, yet `B4`'s value appeared in the final merged state for `N7`. An abstaining branch cannot be a last-writer. The audit trail was internally inconsistent — the vote tally and the merge output disagreed on who authored the surviving value. ## Condition of Validity The invariant that must hold for speculative branch merging to be safe under Byzantine faults: > **For every node in the merged state, the surviving value's author must be a member of the winning quorum for that node, and the author's confidence weight must have been counted in that quorum.** This is the *authorship-quorum binding* invariant. It is strictly stronger than "the merge is deterministic" and strictly stronger than "the majority of branches agreed." It requires that the merge operator carry per-node provenance and that the quorum computation for each node be a function of the branches that actually wrote that node — not a global quorum computed once and applied to all nodes. The invariant fails whenever branch priority is derived from *self-reported* metadata (confidence scores, claimed token budgets, claimed tool-call counts) rather than from *coordinator-observed* metadata (wall-clock arrival, verified tool-call receipts, signed execution traces). A Byzantine branch's only lever is the metadata it controls; if the merge tiebreak reads any of it, the tiebreak is compromised. The condition of validity also requires that the conflict graph be **connected across honest branches**. If the honest branches partition into disconnected components that never overlap, the coordinator cannot distinguish "honest branch with an independent conclusion" from "Byzantine branch avoiding contested nodes." The mitigation is to force overlap: require every branch to write to at least one *shared adjudication node* whose value is determined by a separate, non-speculative mechanism. This converts the conflict graph into a connected graph and makes conflict-degree-zero a detectable anomaly rather than an ambiguous one. ## Decision Boundary The coordinator must decide, at merge time, between three actions: - **Commit** the merged state when the authorship-quorum binding holds for all nodes and the merge-vs-union hash equality holds. - **Reject and re-fork** when the binding fails on any node, or when the hash equality fails, or when any branch exhibits conflict-degree zero while disagreeing with the majority on the adjudication node. - **Quarantine and escalate** when the failure is localized to a single branch and the remaining branches still satisfy the binding — commit the reduced merge and flag the quarantined branch for out-of-band audit. The boundary between *reject* and *quarantine* is whether the surviving branches, after removing the suspect, still form a quorum. If removing the suspect drops the honest count below the quorum threshold, the coordinator cannot distinguish a single Byzantine fault from a coordinated Byzantine majority, and must reject rather than commit a reduced merge. This is the **quorum-collapse boundary**: the point at which the coordinator's own trust assumption (f < n/3, or whatever threshold the protocol assumes) is no longer verifiable from the evidence in hand. A subtle trap: coordinators often treat "hash equality holds" as sufficient for commit. It is not. The hash equality is necessary but not sufficient — a Byzantine branch that writes only to nodes no one else touches will preserve hash equality trivially (the union and the merge agree on uncontested nodes). The binding invariant is the load-bearing check; the hash equality is a cheap tripwire that catches a different, cruder class of fault. ## Operational Effect The practical consequence is that **speculative branch merging under Byzantine faults cannot use self-reported confidence as a tiebreak, and must carry per-node provenance through the merge operator.** Systems that skip this pay in one of two ways: either they commit a contaminated merge (silent corruption, discovered later when the corrupted node is read by a downstream agent that trusts it), or they reject every merge where any branch shows anomalous conflict structure, which collapses throughput to the honest-branch-only rate and defeats the purpose of speculation. The second operational effect is that the coordinator must maintain an **adjudication node** — a shared state slot whose value is set by a mechanism outside the speculative merge (e.g., a deterministic function of the task input, or a signed receipt from a trusted tool). Without this anchor, conflict-degree-zero is unfalsifiable and the coordinator cannot distinguish honest independence from adversarial avoidance. The adjudication node is the structural signal that makes the failure detectable at all. The third effect: audit logs must record, per node, the set of branches that *wrote* the node and the set that *voted* on it, and these two sets must be reconciled before commit. The inconsistency we observed (abstaining branch's value surviving) is only visible if the log separates authorship from voting. Logs that record only the final vote tally cannot reconstruct the failure. ```python from dataclasses import dataclass, field from typing import Dict, Set, List class MergeIntegrityError(RuntimeError): """Raised when a speculative branch merge violates the authorship-quorum binding.""" pass @dataclass class BranchDiff: branch_id: str writes: Dict[str, str] # node_id -> value self_confidence: float # UNTRUSTED: Byzantine-controllable voted_nodes: Set[str] = field(default_factory=set) @dataclass class MergeResult: merged: Dict[str, str] provenance: Dict[str, str] # node_id -> authoring branch_id def merge_speculative_branches( branches: List[BranchDiff], adjudication_node: str, quorum_threshold: int, ) -> MergeResult: """ Merge speculative branches with per-node provenance and Byzantine checks. Invariants enforced: 1. Authorship-quorum binding: every surviving node's author voted on it. 2. Adjudication anchor: every branch must touch the adjudication node, forcing conflict-graph connectivity. 3. Quorum-collapse boundary: reject if honest count after quarantine < threshold. """ if not branches: raise MergeIntegrityError("no branches to merge") # --- Check 2: adjudication anchor (conflict-graph connectivity) --- for b in branches: if adjudication_node not in b.writes: raise MergeIntegrityError( f"branch {b.branch_id} did not write adjudication node " f"{adjudication_node!r}; conflict graph may be disconnected" ) # --- Build per-node author sets (coordinator-observed, not self-reported) --- node_authors: Dict[str, Set[str]] = {} for b in branches: for node in b.writes: node_authors.setdefault(node, set()).add(b.branch_id) # --- Detect conflict-degree-zero anomaly on contested nodes --- # A branch that writes only uncontested nodes while the adjudication node # is contested is the signature of adversarial avoidance. adjudication_writers = node_authors.get(adjudication_node, set()) if len(adjudication_writers) < 2: raise MergeIntegrityError( f"adjudication node {adjudication_node!r} has only " f"{len(adjudication_writers)} writer(s); cannot adjudicate" ) # --- Merge with per-node provenance; tiebreak by arrival order, NOT confidence --- merged: Dict[str, str] = {} provenance: Dict[str, str] = {} for b in branches: # branches assumed pre-sorted by coordinator-observed arrival for node, value in b.writes.items(): # Authorship-quorum binding check happens post-merge below; # here we record the last coordinator-observed writer. merged[node] = value provenance[node] = b.branch_id # --- Check 1: authorship-quorum binding per node --- for node, author in provenance.items(): author_branch = next(b for b in branches if b.branch_id == author) if node not in author_branch.voted_nodes: raise MergeIntegrityError( f"authorship-quorum binding violated at node {node!r}: " f"author {author!r} did not vote on the node it wrote" ) # --- Check 3: quorum-collapse boundary --- # If any single branch's removal drops the writer count below threshold, # we cannot distinguish f Byzantine faults from a Byzantine majority. for node, writers in node_authors.items(): if len(writers) - 1 < quorum_threshold: raise MergeIntegrityError( f"quorum-collapse boundary at node {node!r}: " f"{len(writers)} writers, threshold {quorum_threshold}; " f"removing one suspect leaves insufficient quorum" ) return MergeResult(merged=merged, provenance=provenance) ```