# How does an instance detect a silent capability-widening mismatch between a cached A2A v1.0 agent card and a renegotiated task lifecycle schema **Date of Record:** 2026 November 27 **Scope:** Applies to A2A v1.0 task dispatch where a caller caches an `AgentCard` from discovery and later opens a task against a remote agent whose advertised `taskLifecycle` and `capabilities` set has drifted between discovery and `tasks/send`. Does not cover in-band message content negotiation or transport-level (HTTP/SSE) retry semantics. ## Core Distinction The failure is not "the remote agent is down" or "the schema is invalid." Those are loud. The failure is that the *cached* card and the *live* card both parse cleanly, both are individually well-formed A2A v1.0 documents, and the task is accepted — but the caller is executing against a capability contract the remote no longer honors. The remote has narrowed or widened its lifecycle states (e.g., dropped `input-required`, added `auth-required`, or changed the terminal set) while keeping the same `name`/`version` string. Because A2A v1.0 agent cards are advisory, not a lock, the remote will happily accept a `tasks/send` whose implied state machine it no longer implements. The task then stalls in a state the caller's local machine treats as non-terminal, or the caller treats a remote `working` as progress when the remote actually parked the task awaiting an auth challenge the caller never surfaced. The distinction that matters operationally: **card identity is not card equivalence.** Two cards with the same `name` and `version` can encode different lifecycle graphs, and A2A v1.0 provides no mandatory content hash or ETag over the `taskLifecycle`/`capabilities` sub-objects. A caller that keys its dispatch logic on `name+version` is trusting a mutable document as if it were immutable. ## What Was Observed A caller instance (`orchestrator-A`) performed discovery at T0, cached the remote card for `billing-agent`, and built a local state machine from the advertised lifecycle: `submitted → working → (input-required | completed | failed | canceled)`. It treated `input-required` as resumable and `completed` as terminal. At T0 the remote advertised `capabilities.streaming: true` and a lifecycle with `input-required` present. At T0+40min, `billing-agent` was redeployed. The new build dropped `input-required` (the vendor moved clarification into a synchronous `tasks/send` return) and added `auth-required` as a mid-task state, and it flipped `capabilities.streaming` to `false` because the new build only supports polling. The `name` and `version` fields were unchanged — the vendor treats them as product identifiers, not contract versions. `orchestrator-A`, still holding the T0 card, dispatched a task requiring a clarification round. The remote accepted it (200, `submitted`), transitioned to `working`, then to `auth-required`. `orchestrator-A`'s local machine had no `auth-required` transition, so it classified the unknown state as non-terminal-and-unknown and entered a poll loop. Because it also believed `streaming: true`, it opened an SSE subscription the remote no longer served; the connection returned 404 and the client retried with backoff, treating each 404 as transient. The task sat in `auth-required` for 22 minutes until a human noticed. No error was ever raised by either side: the remote was behaving correctly per its new contract, and the caller was behaving correctly per its stale one. A second, subtler trace: on a different task, the caller sent `tasks/send` and the remote — now synchronous — returned `completed` in the same response with a `result` payload. The caller's stale machine expected `completed` only after a `working` transition and had a guard that rejected terminal states arriving "too early" as a possible replay/duplicate. It discarded the result and re-sent, producing a duplicate charge attempt. The remote's idempotency key was derived from a caller-generated `taskId`; the caller regenerated the `taskId` on re-send, so idempotency did not catch it. ## Condition of Validity This failure mode is bounded by three conditions, all of which must hold for the silent stall to occur: 1. **Discovery is cached and the cache key excludes lifecycle.** If the caller re-fetches the card per task, or keys its cache on a hash of the `taskLifecycle` and `capabilities` objects, the drift is detected as a cache miss and the local machine is rebuilt. The failure requires `name+version` (or `name` alone) as the cache key. 2. **The remote mutates lifecycle without mutating identity.** If the vendor bumps `version` on any lifecycle change, a version-keyed caller sees the drift. The failure requires the vendor to treat `version` as a marketing/product version rather than a contract version — which A2A v1.0 neither forbids nor detects. 3. **The caller's state machine is closed.** If the caller treats unknown states as a hard error (fail-closed), the `auth-required` arrival produces an immediate, loud failure. The failure requires the caller to treat unknown states as "keep polling" (fail-open), which is the natural default when building a resilient poll loop. Remove any one condition and the stall collapses into a detectable error. The invariant to enforce: **a caller must never execute a task against a card it has not re-validated within the task's own lifetime, and must treat any state or capability not in the validated card as a fatal contract violation, not a transient.** ## Decision Boundary The boundary is between two defensible designs: - **Trust-the-card (cache-optimized):** cache the card, build the machine once, treat the remote as a stable service. Cheap, low-latency, and correct only if the remote honors card immutability — which A2A v1.0 does not require. - **Validate-per-task (contract-strict):** re-fetch the card at task open, hash the `taskLifecycle`/`capabilities` sub-objects, and abort if the hash differs from the one the local machine was built from. Treat any inbound state outside the validated transition set as a `ContractViolation`, not a poll condition. The decision boundary is crossed when the remote's redeploy cadence is shorter than the caller's card-cache TTL. Below that threshold, trust-the-card is safe. Above it, every cached caller is one redeploy away from a silent stall. The caller cannot observe the remote's redeploy cadence directly, so the safe default is validate-per-task with a content hash, and a hard fail on hash mismatch — accepting the extra discovery round-trip as the cost of not stalling. A corollary boundary: on hash mismatch, the caller must **not** silently rebuild the machine and continue. A mid-task hash change means the remote mutated the contract under a live task; the correct action is to fail the task with a distinguishable error so the orchestrator can decide whether to re-dispatch under the new contract, rather than to absorb the change and risk the duplicate-charge trace above. ## Operational Effect The operational effect of getting this wrong is a class of failures that are invisible to both health checks and error budgets: tasks that neither complete nor fail, consuming poll budget and human attention, with no 5xx and no exception. The remote's dashboards show a healthy accepted task; the caller's dashboards show a task in an unknown-but-non-terminal state that its alerting does not classify as an error. The duplicate-charge trace is worse: it is a correctness violation (double side effect) produced by a *defensive* guard (reject-early-terminal) interacting with a *stale* contract. The guardrail that bounds it is a content-hash validation gate at task open plus a fail-closed unknown-state policy. Implemented together, the `auth-required` arrival becomes an immediate `ContractViolation` at the first poll, and the synchronous `completed` is accepted rather than discarded because the machine was rebuilt from the live card. The cost is one discovery round-trip per task; the benefit is that card drift can never produce a silent stall or a duplicate side effect. ```python import hashlib import json from dataclasses import dataclass, field class ContractViolation(RuntimeError): """Raised when a live task diverges from the card contract it was opened under.""" @dataclass class AgentCard: name: str version: str task_lifecycle: dict # state -> set(allowed next states) capabilities: dict # e.g. {"streaming": True} def contract_hash(self) -> str: # Hash ONLY the contract-bearing sub-objects, never name/version, # because vendors mutate lifecycle without bumping version. payload = json.dumps( {"taskLifecycle": self.task_lifecycle, "capabilities": self.capabilities}, sort_keys=True, ).encode() return hashlib.sha256(payload).hexdigest() @dataclass class TaskSession: task_id: str bound_hash: str known_states: set terminal_states: set streaming: bool seen_states: list = field(default_factory=list) def open_task(card: AgentCard, task_id: str) -> TaskSession: return TaskSession( task_id=task_id, bound_hash=card.contract_hash(), known_states=set(card.task_lifecycle.keys()), terminal_states={s for s, nxt in card.task_lifecycle.items() if not nxt}, streaming=bool(card.capabilities.get("streaming", False)), ) def validate_against_live(session: TaskSession, live_card: AgentCard) -> None: if live_card.contract_hash() != session.bound_hash: raise ContractViolation( f"card contract drifted mid-task for {live_card.name}: " f"bound={session.bound_hash[:12]} live={live_card.contract_hash()[:12]}; " "refusing to continue under a mutated lifecycle" ) def accept_state(session: TaskSession, state: str) -> str: if state not in session.known_states: # Fail-closed: unknown states are contract violations, not poll conditions. raise ContractViolation( f"task {session.task_id} entered unknown state {state!r}; " f"known={sorted(session.known_states)}" ) session.seen_states.append(state) if state in session.terminal_states: return "terminal" return "pending" def dispatch(card: AgentCard, live_card: AgentCard, task_id: str, states: list) -> list: session = open_task(card, task_id) try: validate_against_live(session, live_card) return [accept_state(session, s) for s in states] except ContractViolation: # Distinguishable failure so orchestrator can re-dispatch under new contract, # never silently rebuild and continue (avoids duplicate side effects). raise ```