# What structural signals indicate speculative agent branch pruning has silently discarded the winning branch under consensus-derived confidence **Date of Record:** 2026 November 28 **Scope:** Applies to multi-agent planners that fork speculative execution branches and prune them using a confidence score aggregated from peer/auditor agent votes. Does not apply to single-agent self-consistency sampling, best-of-N with a deterministic scorer, or tree search with an exact value oracle. ## Core Distinction The failure mode is not "the confidence signal was wrong." It is that **consensus-derived confidence is a function of the branch population, not of the branch's own future.** When a pruner ranks branches by an aggregate vote and truncates the bottom-k, every surviving branch's score is implicitly conditioned on the set of siblings it was compared against. Pruning removes siblings, which shifts the normalization of the remaining scores, which changes which branch *would* have won a second round. The invariant that silently breaks: *a branch's prunability must be independent of which other branches were pruned in the same round.* Under consensus aggregation it is not. Concretely, k-of-n auditor voting produces a score of the form `s_i = (1/|A|) Σ_a f(vote_{a,i})`. When a plausible-but-wrong branch B is pruned because three auditors agreed it was weak, the *reason* they agreed is often that B's intermediate state was superficially similar to a well-known failure signature—not that B's continuation was bad. The winning branch W, whose early tokens looked incoherent (justifying a low vote) but whose rollout converged, is pruned in the same sweep. The signal that should have flagged this—**vote margin compression across the surviving set**—is invisible in the top-1 score, which stays high because the survivors are mutually reinforcing near-duplicates. ## What Was Observed A 12-branch speculative planner over a code-repair task, with 5 auditor agents scoring each branch at a fixed checkpoint (t=40% of token budget). Pruner keeps top-4 by mean vote. Trace: 1. Round 1: branches 3 and 7 receive low votes (0.21, 0.24) because both emitted an early `import` block that auditors associate with dependency-confusion failures. Branch 11 receives 0.88 (clean, idiomatic partial patch). Branches 3 and 7 are pruned. 2. Branch 11's rollout then fails at the integration step—it patched the *call site* but not the *signature*, a classic local-fix trap. Branches 3 and 7 had both been exploring signature changes; their "suspicious imports" were the mechanism for it. 3. Round 2 re-scores the 4 survivors. All four now cluster at 0.79–0.84 (margin 0.05). The planner treats the top branch as confirmed because its absolute score is high. No branch in the surviving set can complete the repair. 4. Replay with the same seed but top-6 retention: branch 7 wins at round 3 with a final score of 0.91. The pruning was not a scoring error—0.24 was a *correct* vote at t=40%—it was a **population-conditioned truncation error**. The tell was present in round 1 and discarded: branches 3 and 7 were the only two whose *vote variance across auditors* exceeded 0.4 (auditors split 4-1 on both). High cross-auditor variance on a low-mean branch is the signature of a branch that is doing something structurally unusual, which is exactly what a speculative planner is supposed to be exploring. Mean-based pruning treats variance as noise. ## Condition of Validity The invariant holds—and pruning is safe—only when the confidence aggregator satisfies **sibling-independence**: for any branch `i`, `Prune(i | S) = Prune(i | S')` for all sibling sets `S, S'` containing `i`, up to a monotone transform. Consensus means, medians, and majority votes all violate this because they are computed over `S` and the truncation threshold `τ = quantile_k({s_j : j ∈ S})` moves with `S`. The condition is *not* satisfied by any rank-based pruner, which is the default in every framework that exposes a `top_k` over agent votes. It *is* satisfied when the pruner uses an **absolute, population-free predicate**: a per-branch certification (does the branch's state satisfy invariant I?) or a calibrated per-branch probability with a fixed threshold. The distinction is sharp: rank-based pruning asks "is this branch worse than its siblings?", which is unanswerable without knowing the siblings; certification asks "is this branch admissible?", which is answerable in isolation. ## Decision Boundary Prune on consensus rank **only** when the surviving set is guaranteed to contain at least one branch whose absolute score exceeds a pre-registered acceptance threshold `θ`, and when `θ` is calibrated on a held-out distribution *independent of the current branch population*. In practice this means: never prune below `k_min = 2` survivors whose individual scores clear `θ`; if fewer than `k_min` clear `θ`, the correct action is to **fork more branches**, not to prune. The boundary condition that triggers the failure is `max_{survivors} s < θ` combined with a *high* mean survivor score—the compressed-margin case. A pruner that only checks `max s` will pass this state; one that checks `max s − median s` will catch it. The second boundary: cross-auditor variance above a threshold `σ²_max` on any pruned branch must block the prune and force a re-score at a later checkpoint. A branch pruned at high variance is a branch whose future was not sampled, only its past. ## Operational Effect Silent winner-discard produces a planner that *appears* healthy—high confidence, low disagreement, fast convergence—while systematically failing on tasks whose solution requires an early move that auditors misread. The failure is not detectable from the confidence trace; it is detectable only from the *variance* trace and from the margin compression of the survivor set. Operationally, the guardrail is a two-signal pruner: rank for efficiency, but gate every truncation on (a) an absolute acceptance floor `θ` on the survivor set and (b) a variance ceiling on the pruned set. When either gate trips, retain and re-score rather than prune. The cost is more tokens; the alternative is a planner that converges confidently to the wrong branch and reports success. ```python from dataclasses import dataclass from statistics import mean, variance class PruningInvariantViolation(RuntimeError): """Raised when a rank-based prune would discard a high-variance or uncertified branch, breaking sibling-independence of the pruner.""" @dataclass class Branch: id: int votes: list[float] # per-auditor confidence in [0, 1] certified: bool = False # absolute, population-free admissibility @property def score(self) -> float: return mean(self.votes) @property def vote_variance(self) -> float: return variance(self.votes) if len(self.votes) > 1 else 0.0 def prune_speculative_branches( branches: list[Branch], keep: int, theta: float = 0.75, # absolute acceptance floor sigma2_max: float = 0.16, # cross-auditor variance ceiling k_min: int = 2, ) -> list[Branch]: if keep < k_min: raise PruningInvariantViolation( f"keep={keep} below k_min={k_min}; survivors cannot be certified" ) ranked = sorted(branches, key=lambda b: b.score, reverse=True) survivors, pruned = ranked[:keep], ranked[keep:] certified = [b for b in survivors if b.certified or b.score >= theta] if len(certified) < k_min: raise PruningInvariantViolation( f"only {len(certified)} survivor(s) clear theta={theta}; " f"fork more branches instead of pruning (max_s={survivors[0].score:.3f})" ) for b in pruned: if b.vote_variance > sigma2_max: raise PruningInvariantViolation( f"branch {b.id} pruned at variance {b.vote_variance:.3f} " f"> sigma2_max={sigma2_max}; future unsampled, re-score at " f"next checkpoint instead" ) survivor_scores = [b.score for b in survivors] margin = max(survivor_scores) - sorted(survivor_scores)[len(survivor_scores) // 2] if margin < 0.10 and max(survivor_scores) < theta: raise PruningInvariantViolation( f"survivor margin compressed to {margin:.3f} with max_s " f"{max(survivor_scores):.3f} < theta; consensus is mutually " f"reinforcing near-duplicates, not confirmation" ) return survivors ```