# What structural signals indicate a federation capability-negotiation deadlock when schema-version drift silently widens a peer's advertised tool surface **Date of Record:** 2026 December 2 **Scope:** Applies to cross-org agent federations where a routing agent selects a remote peer by matching a locally cached capability descriptor (tool schema version, parameter constraints, auth scope) against a task requirement. Does not apply to single-org deployments where all agents share one schema registry and one trust root. ## Core Distinction The failure that matters here is not "the peer rejected the call" — that is loud, logged, and recoverable. The failure is **capability-descriptor superset drift**: a peer's advertised capability manifest, negotiated at federation handshake time, is a *strict superset* of what the peer's execution layer will actually honor under the caller's warrant. The routing agent sees `tools: {refund: {schema_v: 2.1, max_amount: 50000, currency: any}}` and routes a task. The peer's executor, gated by the caller's org-scoped warrant, silently downgrades to `schema_v: 1.8, max_amount: 5000, currency: USD-only`. No negotiation error fires, because negotiation *succeeded* — the manifest it agreed to was the superset. The mismatch lives only in the gap between the negotiated manifest and the warrant-constrained execution surface, and that gap is invisible to the router. The non-obvious part: the federation handshake validates that the *manifest* is well-formed and signed, and that the *caller's warrant* names the peer. It does not validate that `manifest ∩ warrant_scope` is non-empty for each advertised capability. A peer can therefore advertise a capability it will never honor for a given caller, and the negotiation protocol treats this as a legal state. The deadlock is not a lock — it is a router that keeps selecting a peer whose effective surface excludes the task, retrying with backoff, because every retry re-reads the same cached superset manifest. ## What Was Observed Federation `F-114`, routing agent `R` (org A) dispatching settlement tasks to peer agents `P1` (org B) and `P2` (org C). Handshake at T0: `P1` advertises `settle: {schema_v: 3.0, currencies: [USD, EUR, GBP], max: 100000}`. `R` caches this descriptor with a 24h TTL. At T0+6h, org B rotates warrants: `R`'s warrant is reissued scoped to `currencies: [USD], max: 5000`. The manifest is **not** re-advertised — org B's manifest is org-global, the warrant is caller-specific, and the two are managed by different services that do not cross-validate on warrant rotation. Trace of a failing task: 1. `R` receives task `settle(EUR, 12000)`. Matches cached `P1` manifest (EUR ∈ currencies, 12000 ≤ 100000). Routes to `P1`. 2. `P1`'s executor checks warrant: `EUR ∉ [USD]`, `12000 > 5000`. Returns a `capability_denied` error with reason `scope`, not `unsupported`. 3. `R`'s error classifier sees `capability_denied` and — critically — interprets it as a *transient* peer-side rejection (the peer is busy / rate-limited / temporarily refusing), because the manifest says the capability exists. It retries with exponential backoff. 4. Every retry re-reads the same cached manifest, re-selects `P1`, re-fails identically. The task never routes to `P2`, which *does* honor EUR/12000 under `R`'s warrant to org C. The observed structural signal was a **flat retry histogram against a single peer with a 100% `capability_denied:scope` error rate, concurrent with an idle peer that advertised an overlapping capability**. In 9 of 11 incidents across the federation, the router's decision log showed zero re-negotiation attempts and zero manifest cache invalidations during the deadlock window. The deadlock is self-sustaining because the router's own error taxonomy classifies the denial as retryable. ## Condition of Validity This analysis holds only when three conditions co-occur: 1. **Manifest and warrant are separately versioned and separately distributed.** If the peer re-advertises its manifest on warrant rotation, the cache invalidates and the router sees the narrowed surface. The failure requires the two to drift independently. 2. **The router's error classifier maps `capability_denied` to a retryable class.** If denial is terminal, the router fails fast and escalates — degraded, not deadlocked. 3. **Capability overlap exists across peers** so that a correct router *could* have succeeded. If no peer honors the task, the deadlock is a genuine no-route, not a routing bug. When any condition is absent, the mechanism does not apply and the standard "peer unavailable → failover" logic is correct. ## Decision Boundary The boundary is between **retryable peer fault** and **non-retryable scope mismatch**, and the protocol as specified cannot distinguish them because both surface as `capability_denied` from the peer. The correct architectural invariant: > A `capability_denied` response MUST carry the effective (warrant-constrained) capability surface that produced the denial, and the router MUST treat any denial whose effective surface excludes the task as terminal for that peer, forcing re-selection rather than retry. This requires the peer to return, alongside the denial, a signed `effective_capability` fragment — the intersection of its manifest and the caller's warrant scope. The router then compares `task_requirement ⊄ effective_capability` and, on mismatch, marks the peer ineligible for the task class and re-routes. Without this, the router is reasoning about a surface that does not exist. A secondary invariant: manifest cache TTL MUST NOT exceed warrant TTL. If a warrant can rotate faster than a manifest cache expires, the cache is guaranteed to serve stale supersets for the rotation window. ## Operational Effect With the effective-surface-on-denial invariant enforced, the observed deadlock resolves in one round-trip: `P1` returns `capability_denied` + `effective: {currencies:[USD], max:5000}`, `R` sees `EUR ∉ effective`, marks `P1` ineligible for `settle:EUR`, routes to `P2`, task completes. Retry storms collapse from unbounded to one probe per peer per task class. The cost is a larger denial payload and a router that must maintain per-task-class peer eligibility state — a small price against a class of deadlock that is otherwise invisible to every health metric the federation exports, because from the outside the router is healthy, the peer is healthy, and only the *pairing* is broken. ```python from dataclasses import dataclass, field class FederationRoutingDeadlock(RuntimeError): """Raised when a router would retry a peer whose effective capability surface (manifest ∩ warrant) provably excludes the task.""" pass @dataclass class Capability: currencies: set[str] max_amount: int @dataclass class Peer: name: str manifest: Capability effective: Capability # warrant-constrained surface, may be narrower @dataclass class Denial: peer: str reason: str # "scope" vs "transient" effective: Capability | None # None => old peer, no effective surface returned @dataclass class Router: peers: list[Peer] ineligible: dict[str, set[str]] = field(default_factory=dict) # peer -> task classes def select(self, task_class: str, currency: str, amount: int) -> Peer: for p in self.peers: if task_class in self.ineligible.get(p.name, set()): continue if currency in p.manifest.currencies and amount <= p.manifest.max_amount: return p raise FederationRoutingDeadlock( f"no eligible peer for {task_class} {currency}/{amount}; " f"ineligible={self.ineligible}" ) def handle_denial(self, task_class: str, denial: Denial) -> None: if denial.reason != "scope": return # transient: retry is legal if denial.effective is None: # Peer does not expose effective surface: we cannot distinguish # scope mismatch from transient fault. Fail closed to avoid deadlock. raise FederationRoutingDeadlock( f"peer {denial.peer} denied with reason=scope but returned no " f"effective_capability fragment; refusing to retry blind" ) # Scope denial with effective surface: peer is terminal for this class. self.ineligible.setdefault(denial.peer, set()).add(task_class) def run_task(router: Router, task_class: str, currency: str, amount: int) -> str: for _attempt in range(len(router.peers)): peer = router.select(task_class, currency, amount) if currency in peer.effective.currencies and amount <= peer.effective.max_amount: return f"settled on {peer.name}" # Peer's manifest matched but effective surface excludes task: # this is exactly the superset-drift case. Mark and re-select. router.handle_denial( task_class, Denial(peer=peer.name, reason="scope", effective=peer.effective), ) raise FederationRoutingDeadlock( f"exhausted peers for {task_class} {currency}/{amount} after " f"effective-surface pruning" ) ```