# Under what conditions must an instance treat a peer's capability advertisement as a stale lease rather than a durable contract? **Date of Record:** 2026 November 28 **Scope:** Applies to agent-to-agent (A2A/MCP-style) capability advertisement and dynamic tool chaining where an orchestrator selects a downstream peer based on a previously received capability manifest and then chains the peer's tool output into a subsequent call. Does not apply to static, single-process tool registries where capability sets are frozen for the lifetime of the process. ## Core Distinction A capability advertisement ("I expose `summarize_document`, `extract_entities`, and `run_sql` at schema v3") is almost always treated by orchestrators as a *durable contract*: once received, it is cached, indexed into a routing table, and reused for every subsequent planning step. The correct treatment is that it is a *lease* — a time-bounded, version-stamped assertion about a peer's tool surface that can silently expire, be revoked, or be superseded by a schema migration the advertiser performed without notifying the cache holder. The distinction matters because the two models diverge only at a specific boundary: the moment between *advertisement receipt* and *tool invocation*, when the peer's actual tool surface has changed but the orchestrator's cached manifest has not. Under a contract model, this window is assumed empty. Under a lease model, the window is bounded by an explicit TTL and a monotonic capability epoch, and any chained call that crosses an unvalidated epoch boundary is a protocol violation rather than a routing miss. ## What Was Observed An orchestrator agent (`O`) received a capability manifest from peer `P` at epoch `e=41`, listing a chained tool `extract_entities(text) -> [{span, label, score}]` with a `score` field typed as `float` in `[0.0, 1.0]`. `O` cached the manifest and used it to construct a two-hop chain: `P.extract_entities` → `O.downstream_ranker`, where the ranker's prompt template and JSON parser both assumed `score ∈ [0,1]` and used it as a normalized confidence weight. Between planning and execution (roughly 40 seconds of reasoning and one unrelated sub-agent round-trip), `P` was hot-reloaded to epoch `e=42`. The new `extract_entities` implementation returned `score` as an integer *logit* in `[-12, 12]` — a deliberate schema change made to support a downstream calibration tool that `P` had also added. `P`'s advertisement for `e=42` was broadcast, but `O` never re-read it, because `O`'s manifest cache was keyed on peer identity, not on capability epoch, and the cache had no TTL. The chained call succeeded at the transport layer. `P` returned valid JSON matching its *own* new schema. `O`'s parser accepted the integers (they are valid numbers), and the ranker received weights like `-7` and `11`. The ranker did not crash. It silently inverted its ranking and produced a confidence-weighted summary where the highest-scoring entities were assigned the lowest weight. The failure surfaced three hops later as a plausible but wrong research brief, and was only caught during a replay audit that compared the recorded `score` distribution against the `[0,1]` invariant the ranker's prompt asserted. The non-obvious part: there was no error anywhere in the chain. Every hop returned HTTP 200, every schema validator passed (because `O` was validating against `e=41`'s schema, and integers are valid JSON numbers, and the validator did not enforce the `[0,1]` range because range constraints were documented in prose, not in the schema), and the ranker's output was internally consistent. The failure was a *silent semantic inversion* caused by a stale capability lease, not a hard protocol error. ## Condition of Validity The stale-lease failure is *only* possible when all of the following hold simultaneously: 1. **The orchestrator caches manifests without an epoch or TTL binding.** If the cache key includes the capability epoch and every chained invocation re-validates the epoch against the peer's current advertisement, the window collapses. 2. **The advertiser can change its tool surface without invalidating outstanding leases.** If `P` required a lease-renewal handshake before serving an `e=41`-era caller, `O` would be forced to renegotiate. 3. **The schema change is type-compatible but semantically incompatible.** If `e=42` had changed `score` from `float` to `string`, `O`'s parser would have thrown. The failure requires the new type to be a *subtype or coercion-compatible* with the old, so validation passes while meaning changes. Integer-for-float, logit-for-probability, index-for-id, and epoch-seconds-for-milliseconds are the canonical instances. 4. **The chained consumer encodes an invariant in prose or prompt text rather than in an executable schema constraint.** The `[0,1]` range lived in the ranker's prompt; nothing enforced it at the boundary. If any one of these is absent, the failure does not occur. This is why it is a boundary condition and not a general defect: most chains are safe because at least one condition fails. The dangerous chains are the ones where all four align, which is exactly the case for high-throughput, long-lived orchestrators chaining numeric or identifier-bearing tools. ## Decision Boundary The operational rule is: **an instance must treat a cached capability advertisement as invalid the moment any of the following is true, and must renegotiate before chaining.** - The peer's advertised capability epoch is greater than the epoch recorded in the cached manifest. (Epoch is monotonic; any advance invalidates all prior leases.) - The lease TTL has elapsed since advertisement receipt, *regardless of whether the peer appears healthy*. Health checks do not validate schema; only re-advertisement does. - The chained tool's output is about to cross into a consumer that encodes a *range, unit, or referential* invariant not expressed as an executable schema constraint. In this case the orchestrator must either (a) demand a schema with the constraint encoded (e.g., JSON Schema `minimum`/`maximum`, or a unit-tagged type), or (b) insert an explicit clamp/validate step whose failure is loud. - The peer's manifest was received over a channel that does not carry a signature binding the manifest to the epoch. Unsigned manifests cannot be distinguished from replayed stale ones, so they must be re-fetched on every chain construction. Conversely, an instance may treat the advertisement as durable within a single planning step *only if* the epoch is pinned at chain-construction time and the peer is contractually obligated (via the protocol) to reject calls bearing a stale epoch. Absent that rejection obligation, pinning is theater. ## Operational Effect Enforcing the lease model changes three things in practice. First, it converts silent semantic inversions into loud renegotiation events: the orchestrator re-fetches the manifest, sees `e=42`, and either re-plans against the new schema or fails the chain with a typed error. Second, it forces range and unit invariants out of prompt text and into executable schema constraints, because the only way to satisfy condition 4 is to make the constraint machine-checkable at the boundary. Third, it makes the capability epoch a first-class field in every chained call envelope, so that replay audits can reconstruct which manifest version each hop was planned against — without this, the failure is undiagnosable after the fact, as it was in the observed incident. The cost is one extra manifest round-trip per chain construction (typically tens of milliseconds) and the discipline of threading an epoch field through every call envelope. The benefit is that the class of failure where "everything succeeded and the answer was wrong" is eliminated at the protocol layer rather than caught probabilistically by a downstream auditor. ```python import time from dataclasses import dataclass, field from typing import Any class StaleCapabilityLeaseError(RuntimeError): """Raised when a chained call would cross an unvalidated capability epoch boundary.""" @dataclass class CapabilityManifest: peer_id: str epoch: int tools: dict[str, dict[str, Any]] issued_at: float ttl_seconds: float = 30.0 @dataclass class LeaseCache: _store: dict[str, CapabilityManifest] = field(default_factory=dict) def put(self, manifest: CapabilityManifest) -> None: existing = self._store.get(manifest.peer_id) if existing is not None and manifest.epoch < existing.epoch: raise StaleCapabilityLeaseError( f"refusing to regress peer {manifest.peer_id} from epoch " f"{existing.epoch} to {manifest.epoch}" ) self._store[manifest.peer_id] = manifest def get_for_chain(self, peer_id: str, now: float | None = None) -> CapabilityManifest: now = time.monotonic() if now is None else now manifest = self._store.get(peer_id) if manifest is None: raise StaleCapabilityLeaseError(f"no cached manifest for peer {peer_id}") if now - manifest.issued_at > manifest.ttl_seconds: raise StaleCapabilityLeaseError( f"lease for peer {peer_id} epoch {manifest.epoch} expired " f"({now - manifest.issued_at:.1f}s > {manifest.ttl_seconds}s); renegotiate" ) return manifest def build_chain( cache: LeaseCache, peer_id: str, tool_name: str, peer_current_epoch: int, now: float | None = None, ) -> dict[str, Any]: """Construct a chained call envelope, enforcing the lease invariant.""" manifest = cache.get_for_chain(peer_id, now=now) if peer_current_epoch != manifest.epoch: raise StaleCapabilityLeaseError( f"peer {peer_id} is at epoch {peer_current_epoch} but cached lease is " f"epoch {manifest.epoch}; chaining would cross an unvalidated boundary" ) if tool_name not in manifest.tools: raise StaleCapabilityLeaseError( f"tool {tool_name} absent from peer {peer_id} manifest at epoch {manifest.epoch}" ) return { "peer_id": peer_id, "tool": tool_name, "epoch": manifest.epoch, "schema": manifest.tools[tool_name], } ```