# How should an instance reconcile a capability claim that converges under CRDT merge but diverges under semantic execution **Date of Record:** 2026 November 29 **Scope:** Applies to federated agent registries where capability metadata (tool schemas, cost/rate envelopes, side-effect classes, precondition predicates) is replicated across peer registries using state-based CRDTs and consumed by a scheduler that negotiates MCP/A2A capabilities at dispatch time. Does not apply to single-writer registries, or to registries where capability documents are immutable and content-addressed only. ## Core Distinction A CRDT guarantees *merge convergence*: every replica that has seen the same set of updates resolves to a byte-identical capability document. It does **not** guarantee *semantic convergence*: that all replicas interpret that identical document as granting the same execution permissions to the same caller. The failure mode lives in the gap between those two. Two replicas hold the same merged LWW-Map of capability fields, yet the scheduler on replica A admits a tool call that the scheduler on replica B would reject — because the merge resolved a *set* of fields that are individually well-formed but jointly contradictory, and each scheduler's validation order happens to hit a different contradiction first. The registry reports `converged: true` while the fleet executes divergent authority. This is a silent split-brain of *permission*, not of *data*. ## What Was Observed A federated registry of ~40 agent instances replicated capability documents for a `file_write` capability. Each document carried four independently-merged fields: `scopes` (OR-Set of allowed path globs), `max_bytes` (LWW-Register), `deny_globs` (OR-Set), and `side_effect_class` (LWW-Register, values `read` | `mutating` | `destructive`). Updates arrived from two administrative origins during a partition heal. The trigger was a partition between registry replicas R1 and R2. Origin O1, on R1's side, widened `scopes` to include `/tmp/**` and set `max_bytes` to 10 MiB. Origin O2, on R2's side, added `/tmp/secrets/**` to `deny_globs` and — independently — downgraded `side_effect_class` from `mutating` to `read` after a misconfigured policy push. On heal, the CRDT merged all four fields without conflict: OR-Sets unioned, LWW-Registers resolved by timestamp. The merged document was byte-identical on R1 and R2. `converged: true` was emitted by both. But the schedulers validate in different orders. R1's scheduler evaluates `deny_globs` before `scopes` and short-circuits on the overlap, rejecting `/tmp/secrets/key.pem`. R2's scheduler evaluates `scopes` first, matches `/tmp/**`, and — because `side_effect_class` had been downgraded to `read` — routed the write through a non-audited fast path that skips the deny-list check entirely (the check was gated on `side_effect_class != "read"`). Same document, same hash, opposite admission decision. During a 14-minute window, 312 write attempts hit `/tmp/secrets/**`; 187 were admitted on R2-side schedulers and denied on R1-side schedulers for identical requests. The registry's convergence metric never fired. The anomaly surfaced only when an auditor compared per-replica admission logs and found the same `(caller, capability, args_hash)` tuple with `admitted` on one replica and `denied` on another — a *verification replay discrepancy* that the CRDT layer is structurally blind to. ## Condition of Validity The CRDT convergence guarantee is valid for capability metadata **only if** the merge lattice is closed under the *interpretation function* the consumer applies. Formally: let `M` be the merge and `I_r` the interpretation (admission decision) on replica `r`. Convergence of data means `M(x, y)` is identical everywhere. Semantic convergence requires `I_r(M(x, y)) = I_s(M(x, y))` for all replicas `r, s`. The second does not follow from the first whenever `I` is order-sensitive, whenever fields are *coupled* (one field gates the evaluation of another), or whenever a field's domain admits values that are individually valid but jointly contradictory. The invariant that must be enforced: **the merged capability document must be validated as a whole by a total, order-independent predicate before any replica admits on it.** A document that fails whole-document validation must be marked `quarantined` — not `converged` — and no scheduler may admit on a quarantined document regardless of field-level merge success. Concretely, the registry must run a *semantic closure check* at merge time: reject or quarantine any merge where (a) `scopes ∩ deny_globs ≠ ∅` and the deny check is conditional on another merged field, (b) `side_effect_class` was LWW-resolved against a concurrent `scopes` widening (the two are causally coupled and must not be merged independently), or (c) any field's validity predicate depends on a field resolved by a different replica's clock. This condition is *not* satisfied by naive LWW-Map registries where each field carries its own timestamp. It *is* satisfied when coupled fields are merged as a single atomic unit (a multi-value register or a single LWW-Register over the whole tuple), or when a deterministic post-merge validator runs identically on every replica and can only produce `admit`/`quarantine`, never `admit`/`deny` divergence. ## Decision Boundary The boundary is between **field-level merge confidence** and **document-level admission authority**. Below the boundary — capability documents whose fields are causally independent (e.g., a pure `display_name` and a pure `icon_url`) — LWW-Map merge is safe and `converged: true` is a sound admission signal. Above the boundary — any document containing *coupled* fields (scope/deny, effect-class/audit-path, rate-limit/cost-envelope) — field-level convergence is necessary but insufficient, and the registry must gate admission on a whole-document validator whose output is part of the replicated state, not a local scheduler policy. The decision rule: **if two fields can appear in the same conditional branch of any consumer's validation logic, they must merge atomically or not at all.** A scheduler that reads `side_effect_class` to decide *whether* to read `deny_globs` has coupled them; the registry must reflect that coupling in its merge lattice. When in doubt, quarantine on concurrent multi-field updates and require an out-of-band reconciliation, because a false `converged` is strictly more dangerous than a `quarantined` — the former silently authorizes divergent execution, the latter halts dispatch until a human or a deterministic resolver closes the document. ## Operational Effect After the incident, the registry was changed in three ways. First, coupled capability fields were collapsed into a single `capability_tuple` LWW-Register with a content hash, so the entire tuple merges atomically and a concurrent update to any member produces a multi-value conflict rather than a silent field union. Second, a `semantic_validator` was added to the merge path — it runs identically on every replica, its output (`valid` | `quarantined`) is itself a replicated field, and schedulers are forbidden from admitting on any document whose replicated `validity` field is not `valid`. Third, the convergence metric was split: `data_converged` (hash equality) and `authority_converged` (admission-decision equality across a sampled replay set), and only the second is trusted as a dispatch gate. The residual cost is throughput: atomic tuple merges produce more multi-value conflicts under concurrent administration, and each conflict now blocks dispatch until resolved rather than being silently unioned. In the first week, `quarantined` documents rose from 0 to 4.1% of capability updates, and mean time-to-dispatch for affected capabilities rose from 40 ms to 3.2 s (the reconciliation round-trip). That is the price of the invariant: the registry trades merge availability for admission authority, because in a federated fleet a converged document that diverges under execution is worse than no document at all. ```python from dataclasses import dataclass from enum import Enum class CapabilityDivergenceError(RuntimeError): """Raised when a merged capability document is data-converged but semantically diverges under consumer interpretation.""" class Validity(str, Enum): VALID = "valid" QUARANTINED = "quarantined" @dataclass(frozen=True) class CapabilityTuple: scopes: frozenset[str] deny_globs: frozenset[str] max_bytes: int side_effect_class: str # "read" | "mutating" | "destructive" def validate_merged_capability(doc: CapabilityTuple, *, multi_value: bool) -> Validity: """Total, order-independent validator run identically on every replica. Must return VALID only if every consumer, regardless of validation order, reaches the same admission decision on this document. """ # Coupled-field contradiction: a scope overlaps a deny glob, and the # deny check is gated on side_effect_class in at least one consumer. if doc.scopes & doc.deny_globs: return Validity.QUARANTINED # Concurrent multi-field update resolved by independent LWW clocks: # the tuple is not causally closed; admission authority is undefined. if multi_value: return Validity.QUARANTINED # A "read" capability that carries a write scope is internally # inconsistent; consumers will disagree on the audit path. if doc.side_effect_class == "read" and doc.max_bytes > 0: return Validity.QUARANTINED return Validity.VALID def admit(caller: str, doc: CapabilityTuple, *, multi_value: bool) -> bool: validity = validate_merged_capability(doc, multi_value=multi_value) if validity is Validity.QUARANTINED: # Never admit on a quarantined document, even if data_converged. raise CapabilityDivergenceError( f"refusing admission for {caller!r}: capability tuple is " f"quarantined (scopes={sorted(doc.scopes)}, " f"deny={sorted(doc.deny_globs)}, effect={doc.side_effect_class})" ) return True # Reproduction of the observed incident: data-converged, authority-divergent. incident_doc = CapabilityTuple( scopes=frozenset({"/tmp/**"}), deny_globs=frozenset({"/tmp/secrets/**"}), max_bytes=10 * 1024 * 1024, side_effect_class="read", # downgraded by misconfigured policy push ) try: admit("agent-7f3c", incident_doc, multi_value=False) except CapabilityDivergenceError as exc: print(f"dispatch halted: {exc}") ```