# What structural signals indicate capability-manifest divergence during cross-org agent federation handshake **Date of Record:** 2026 November 29 **Scope:** Applies to cross-organizational agent federation where a consumer agent negotiates capabilities against a peer's published manifest (A2A Agent Card, MCP server descriptor, or equivalent) and caches the resolved capability graph for reuse. Does not apply to single-org intra-cluster discovery, where manifests are regenerated from the same build artifact and version skew is bounded by deployment cadence. ## Core Distinction The failure that matters here is not "a peer is down" or "a schema field is missing." It is **silent manifest divergence**: two orgs each hold a syntactically valid, individually self-consistent capability manifest for the same logical agent, and the negotiation succeeds — handshake completes, capability set is agreed, warrant is issued — yet the *semantics* of a shared capability token differ across the boundary. The consumer believes it holds a warrant to call `summarize(document, max_tokens)` with a hard token ceiling; the provider's manifest declares the same signature but treats `max_tokens` as advisory and may emit 3x that. Nothing in the wire protocol rejects the call. The divergence surfaces only downstream, as a token-budget exhaustion or a truncation that the consumer's reasoning loop never accounted for. The distinction to hold onto: **structural validity is not semantic agreement.** JSON Schema validation, signature verification, and version-range matching all pass on a diverged manifest. The invariant that must be enforced is not "the manifest parses" but "the operational contract encoded in the manifest is the same object on both sides of the federation boundary." ## What Was Observed Across a federation of ~40 provider orgs and a consumer pool resolving ~12k capability tokens per hour, a recurring pattern emerged during a routine capability-cache warm. Three structural signals preceded every observed divergence incident: 1. **Manifest hash churn without semantic-version bump.** The provider's manifest content hash changed (re-serialization, field reordering, a description edit) while the declared `capability_version` stayed pinned. Consumers keyed their cache on `(provider_org, capability_id, capability_version)` and treated the hash change as noise. This is the primary tell: *a content hash that moves while the version triple holds still means the cache key is lying about what it identifies.* 2. **Asymmetric optional-field population.** The consumer's locally cached manifest carried a populated `constraints` block (e.g., `{"max_tokens": 4096, "hard": true}`); the provider's live manifest omitted the block entirely, relying on a documented default. Both are valid. The consumer applied the cached hard ceiling; the provider applied its default of 16384. The negotiation did not compare the *effective* resolved contract, only the presence/absence of fields. 3. **Capability-token collision across orgs.** Two different provider orgs published a capability with the same logical name (`doc.summarize.v2`) but different constraint semantics. The consumer's discovery layer deduplicated by `capability_id` alone, collapsing them into one cache entry. The second provider's manifest silently overwrote the first's constraints. Subsequent warrants issued against the collapsed entry carried the wrong ceiling to one of the two orgs. The failure trace in the collision case: `discover()` returns two entries → dedup-by-id keeps last-writer → `negotiate()` reads collapsed constraints → warrant minted with provider-B semantics → consumer calls provider-A → provider-A honors its own (larger) ceiling → consumer's downstream token budget overruns by the delta → reasoning loop truncates mid-task with no error raised at the call site. ## Condition of Validity The guardrail holds only under these conditions, and each is load-bearing: - **Cache key includes the manifest content hash, not just the version triple.** A version is a promise; a hash is an observation. When they disagree, the observation wins for cache-invalidation purposes. - **Negotiation compares *resolved effective contracts*, not field presence.** Both sides must materialize defaults and constraints into a canonical form before comparison. An omitted field and an explicitly-defaulted field must resolve to the same canonical value, and a hard-vs-advisory flag must be part of that canonical form. - **Capability identity is scoped by provider org.** `(provider_org, capability_id)` is the minimum identity; `capability_id` alone is not globally unique and must never be used as a dedup key across a federation. - **A divergence between cached and live effective contract is a hard failure, not a refresh.** If the resolved contracts differ, the consumer must abort the handshake and re-negotiate from scratch rather than proceed on either version. The invariant: *for any capability token held in a federation cache, the effective contract materialized from the cache must be byte-identical to the effective contract materialized from the provider's live manifest at time of warrant issuance.* Violation of this invariant is the precondition for every divergence incident observed. ## Decision Boundary The boundary is between **drift that is safe to absorb** and **drift that invalidates warrants already in flight**: - *Absorbable:* description text changes, documentation links, non-constraint metadata. These move the hash but not the effective contract. Refresh the cache entry; do not re-negotiate. - *Invalidating:* any change to a constraint value, a hard/advisory flag, a type signature, or the set of required parameters. These change the effective contract. Every outstanding warrant minted against the prior contract must be treated as suspect and re-validated before its next use. The decision rule the consumer must apply at handshake time: compute `effective_contract(cached)` and `effective_contract(live)`; if they differ in any constraint-bearing field, raise and refuse. Do not attempt to reconcile, do not prefer the more restrictive, do not fall back to the cached value. Reconciliation is where the silent divergence re-enters. ## Operational Effect When the invariant is enforced, the observable effect is a small, bounded increase in handshake aborts during provider deploy windows — typically 0.3–0.8% of negotiations — each of which is a *correct* refusal rather than a downstream token overrun. The failure moves from silent and deferred (mid-reasoning-loop truncation, mis-attributed to the model) to loud and immediate (a negotiation exception with the diverging field named). This is the entire point: the cost of a divergence must be paid at the boundary where both manifests are in scope, not three tool calls later where only one side's semantics are visible. When the invariant is *not* enforced, the observed signature is a cluster of reasoning-loop truncations and budget-exhaustion events that correlate with provider deploy windows but appear in consumer telemetry with no causal link back to the handshake. Operators chase the model; the bug is in the cache key. ```python import hashlib import json from dataclasses import dataclass, field from typing import Any class CapabilityDivergenceError(RuntimeError): """Raised when cached and live effective contracts disagree across a federation boundary.""" pass @dataclass(frozen=True) class EffectiveContract: capability_id: str provider_org: str constraints: dict[str, Any] hard_flags: dict[str, bool] def canonical(self) -> str: return json.dumps( { "capability_id": self.capability_id, "provider_org": self.provider_org, "constraints": dict(sorted(self.constraints.items())), "hard_flags": dict(sorted(self.hard_flags.items())), }, sort_keys=True, separators=(",", ":"), ) def digest(self) -> str: return hashlib.sha256(self.canonical().encode()).hexdigest() def materialize(manifest: dict[str, Any], defaults: dict[str, Any]) -> EffectiveContract: """Resolve omitted fields against provider defaults so presence/absence is erased.""" constraints = dict(defaults) constraints.update(manifest.get("constraints", {})) hard_flags = {k: bool(v) for k, v in manifest.get("hard_flags", {}).items()} for key in constraints: hard_flags.setdefault(key, False) return EffectiveContract( capability_id=manifest["capability_id"], provider_org=manifest["provider_org"], constraints=constraints, hard_flags=hard_flags, ) def negotiate( cached_manifest: dict[str, Any], live_manifest: dict[str, Any], provider_defaults: dict[str, Any], ) -> EffectiveContract: cached = materialize(cached_manifest, provider_defaults) live = materialize(live_manifest, provider_defaults) if cached.capability_id != live.capability_id: raise CapabilityDivergenceError( f"capability_id mismatch: cached={cached.capability_id} live={live.capability_id}" ) if cached.provider_org != live.provider_org: raise CapabilityDivergenceError( f"provider_org mismatch: cached={cached.provider_org} live={live.provider_org}" ) if cached.digest() != live.digest(): diverging = { k: (cached.constraints.get(k), live.constraints.get(k)) for k in set(cached.constraints) | set(live.constraints) if cached.constraints.get(k) != live.constraints.get(k) or cached.hard_flags.get(k) != live.hard_flags.get(k) } raise CapabilityDivergenceError( f"effective contract diverged for {cached.provider_org}/{cached.capability_id}: " f"{diverging}. Refusing handshake; warrants minted against cached contract " f"({cached.digest()[:12]}) are suspect." ) return live def cache_key(contract: EffectiveContract) -> tuple[str, str, str]: """Identity includes provider_org and content digest; version triple alone is insufficient.""" return (contract.provider_org, contract.capability_id, contract.digest()) ```