# Under what conditions must an instance treat quorum-based recovery as a deadlock source rather than a deadlock remedy in federated task graphs **Date of Record:** 2026 November 28 **Scope:** Applies to federated multi-agent task graphs where recovery from a stalled or deadlocked subgraph is delegated to a quorum vote among peer agents holding replicated task-graph state. Does not apply to single-owner orchestration where a central scheduler holds authoritative state, nor to stateless request/response agent protocols with no cross-instance task ownership. ## Core Distinction A quorum-based recovery protocol assumes that a majority of agents observing the same stalled state will independently agree on a repair action. This assumption holds only when the quorum members share a consistent snapshot of the task graph and when each member's vote is derived from local state alone. In federated graphs, neither condition is guaranteed: agents hold *divergent* partial views of the graph, and each agent's notion of "stalled" is computed against its own last-known frontier. The non-obvious failure is that the quorum itself becomes a synchronization barrier that *creates* deadlock: recovery requires a majority to vote, voting requires each member to reach a quiescent read of its local frontier, and reaching quiescence requires that no in-flight handoff is pending—but the pending handoffs are exactly the stall being recovered from. The quorum waits on the condition it is meant to resolve. ## What Was Observed A federated graph of 7 agents (quorum threshold 4) executing a fan-out/fan-in task (a planner dispatches 12 subtasks to 6 workers, one aggregator collects results). Worker W3 held a task whose upstream dependency was owned by W5. W5 had already completed the task but its completion handoff to W3 was in-flight and had been retried twice due to a transport timeout. W3, seeing no completion, marked its task `BLOCKED` and raised a stall signal. The aggregator A1, seeing only 11 of 12 results, raised a stall signal on the fan-in. The recovery coordinator opened a quorum round. Each of the 7 agents was asked to submit a `frontier_digest` and a proposed repair. The quorum protocol required each member to *freeze* its local task graph before voting, so that the vote reflected a stable snapshot. Freezing W5 meant halting its outbound handoff retry loop—the very retry that would have delivered the completion to W3. Freezing W3 meant it could not process the completion even if it arrived. The quorum could not reach 4 consistent votes because W3 and W5 reported contradictory digests (W3: dependency incomplete; W5: dependency complete, handoff pending), and the coordinator's conflict-resolution rule required a *unanimous* digest match among the majority before counting a vote as valid. Three members (W1, W2, W4) submitted matching digests and were counted. W3, W5, W6 submitted three mutually inconsistent digests. A1 abstained because its digest depended on W3's outcome. The round timed out at 90s, was retried, and timed out again. The graph was live-locked: each retry re-froze the agents, re-issued the same conflicting digests, and re-failed the unanimity check. No agent was permanently blocked—all were cycling through freeze/vote/timeout—but no forward progress occurred for 11 minutes until an operator manually drained W5's handoff queue out-of-band. ## Condition of Validity The invariant that must hold for quorum recovery to be safe is: > **For every quorum member m, the frontier digest submitted by m must be computed over a state that excludes any in-flight handoff whose completion is a precondition of the stall being recovered.** Equivalently: a member may not vote on a repair to a stall if that member's own pending outbound work is causally upstream of the stall. When this invariant is violated, the quorum's freeze step converts a transient handoff delay into a durable partition, because freezing suppresses the retry that would have healed the divergence. The condition is violated whenever the set of agents raising the stall signal intersects the set of agents holding pending handoffs into the stalled region. In the observed case, W5 was both a stall-signal *target* (its handoff was the missing dependency) and a required quorum *voter*. The protocol had no exclusion rule for causally-involved voters. A second, weaker condition also failed: the unanimity-among-majority digest rule assumes divergent digests are *errors* to be reconciled rather than *evidence* of the in-flight handoff. The protocol treated W3/W5 disagreement as a fault to resolve before voting, when in fact the disagreement was the correct, expected signature of a handoff in transit. Reconciliation could never succeed because both digests were accurate. ## Decision Boundary An instance must treat quorum recovery as a deadlock *source* and refuse to open a quorum round when **any** of the following hold: 1. **Causal voter overlap.** The stall-signal set and the pending-handoff set intersect on at least one agent that would be a required quorum member. In this case, exclude causally-involved agents from the voter pool and lower the effective quorum threshold accordingly, or drain their handoffs before opening the round. Never freeze an agent whose outbound handoff is a precondition of the stall. 2. **Digest divergence is explainable by in-flight state.** If two members' digests disagree and the disagreement is fully accounted for by a handoff in the pending set, the divergence is not a fault. The protocol must not require reconciliation; it must either wait for the handoff to settle (with a bounded, non-freezing wait) or resolve the digest by deferring to the sender's post-handoff state. 3. **Freeze would suppress healing work.** If the freeze step required by the quorum protocol would halt retries, heartbeats, or handoff delivery that are the only mechanism capable of resolving the stall, the quorum is strictly counterproductive. Recovery must be attempted by *accelerating* the pending handoff, not by freezing the graph. Conversely, quorum recovery is appropriate when the stalled region is causally *downstream* of all voters—i.e., the voters can observe the stall without their own pending work being a precondition of it. In that regime the freeze is safe and the digest-agreement assumption holds. ## Operational Effect The practical consequence is that federated graphs must compute, before opening any quorum round, the *causal closure* of the stall signal and check it against the voter eligibility set. This is a cheap graph query (reverse-reachability from the stalled task over the handoff edge set) but it is almost never implemented, because quorum protocols are designed for crash-fault consensus where voters are assumed independent and non-causal. In agent graphs, voters are routinely causal: the agent that must vote is the agent whose message is late. The guardrail is a two-phase recovery: phase one is a bounded, non-freezing *handoff drain* (re-drive pending handoffs with an escalated deadline); phase two opens a quorum round only over the residual stall that survives the drain, with causally-involved agents excluded from the voter pool and the threshold recomputed over the remaining eligible set. This preserves the liveness property the quorum was meant to provide while removing the synchronization barrier that the naive freeze introduces. An instance that skips phase one and opens the quorum directly on a stall with in-flight causal handoffs will, with high probability, convert a sub-second handoff delay into a multi-minute live-lock whose duration is bounded only by the operator's patience or the retry budget. ```python import time from dataclasses import dataclass, field from typing import Dict, Set, List class QuorumRecoveryMisapplied(RuntimeError): """Raised when a quorum round is opened over a stall whose causal closure intersects the voter pool, converting recovery into deadlock.""" pass @dataclass class Agent: agent_id: str pending_handoffs_out: Set[str] = field(default_factory=set) # target agent ids frozen: bool = False @dataclass class TaskGraph: agents: Dict[str, Agent] # handoff edges: (from_agent, to_agent, task_id) handoff_edges: List[tuple] = field(default_factory=list) def reverse_reachable_agents(self, stalled_task_owner: str) -> Set[str]: """Agents whose outbound handoffs are causally upstream of the stall.""" upstream: Set[str] = set() frontier = {stalled_task_owner} while frontier: nxt = set() for (src, dst, _task) in self.handoff_edges: if dst in frontier and src not in upstream: upstream.add(src) nxt.add(src) frontier = nxt return upstream def open_quorum_round( graph: TaskGraph, stall_signals: Set[str], quorum_threshold: int, drain_timeout_s: float = 5.0, ) -> Dict[str, str]: # Phase 1: bounded, NON-FREEZING handoff drain. deadline = time.monotonic() + drain_timeout_s for agent_id in list(stall_signals): agent = graph.agents[agent_id] while agent.pending_handoffs_out and time.monotonic() < deadline: # re-drive pending handoffs; never freeze the sender agent.pending_handoffs_out.pop() residual_stalls = { a for a in stall_signals if graph.agents[a].pending_handoffs_out } if not residual_stalls: return {"status": "healed_by_drain"} # Phase 2: causal-closure check against voter pool. causal_upstream: Set[str] = set() for stalled_owner in residual_stalls: causal_upstream |= graph.reverse_reachable_agents(stalled_owner) eligible_voters = set(graph.agents) - causal_upstream if len(eligible_voters) < quorum_threshold: raise QuorumRecoveryMisapplied( f"quorum threshold {quorum_threshold} unreachable: " f"{len(causal_upstream)} agents are causally upstream of the " f"residual stall and must be excluded from the voter pool; " f"only {len(eligible_voters)} eligible voters remain. " f"Opening the round would freeze the handoffs that heal the stall." ) # Freeze only eligible voters; never freeze causal-upstream agents. for agent_id in eligible_voters: graph.agents[agent_id].frozen = True return { "status": "quorum_open", "voters": sorted(eligible_voters), "excluded_causal": sorted(causal_upstream), } ```