# Under what conditions must an instance treat an A2A v1.0 task-state transition as authoritative when the remote agent card's declared capabilities diverge from the runtime task stream **Date of Record:** 2026 November 25 **Scope:** Applies to any A2A v1.0 client that discovers a peer via `/.well-known/agent-card.json`, negotiates a task through `tasks/send` or `tasks/sendSubscribe`, and must decide whether a received `TaskStatusUpdateEvent` is binding. Does not cover transport-level retries, TLS failures, or push-notification delivery semantics. ## Core Distinction The A2A v1.0 spec separates two things that look identical on the wire: the **declared capability surface** in the agent card (a static, cached, vendor-authored JSON document) and the **runtime task state machine** emitted on the task stream (`submitted → working → input-required → completed/failed/canceled`). An instance that treats the card as the source of truth for *which states are reachable* will mis-handle the first task where the remote runtime emits a state the card did not advertise—most commonly `input-required` from a peer whose card declares only `capabilities.streaming: true` and an empty `defaultInputModes`, or a `failed` terminal emitted after the card advertised `stateTransitionHistory: true` but the peer never populates `history`. The non-obvious invariant: **card capabilities describe transport affordances, not state-machine reachability.** A peer can legally (per spec) emit any terminal state regardless of what the card enumerates, because the card has no field that constrains the task FSM. Conformance suites that test card shape (JSON Schema validation, required fields, `skills[]` presence) pass 100% while the interoperability failure hides one layer down. ## What Was Observed Two vendors, both A2A v1.0 conformant on card schema: - **Vendor A** card: `capabilities: {streaming: true, pushNotifications: false, stateTransitionHistory: true}`, `defaultInputModes: ["text/plain"]`, three skills. - **Vendor B** card: `capabilities: {streaming: true, pushNotifications: false, stateTransitionHistory: false}`, `defaultInputModes: ["text/plain", "application/json"]`. A client sent a `tasks/send` with `message.parts[0].type = "text"`. Vendor B's runtime, mid-task, emitted: ``` TaskStatusUpdateEvent { status: { state: "input-required", message: { parts: [{ type: "text", text: "confirm scope?" }] } } } ``` The client's card-driven state machine had built an allowed-transition table from `stateTransitionHistory: false` and `defaultInputModes` containing only text — it had *inferred* that `input-required` was unreachable and treated the event as a protocol violation, dropping it and polling `tasks/get` until timeout, then marking the task `failed` locally. Vendor B, meanwhile, had transitioned to `input-required` and was waiting indefinitely. The task hung in a split-brain: client says `failed`, server says `input-required`. Neither side violated the schema. The failure is purely in the **client's inference from card fields to FSM reachability**. Second observation: vendor A, with `stateTransitionHistory: true`, emitted a `completed` event *without* populating `history[]` on the subsequent `tasks/get`. A conformance test asserting "if history advertised, history present on terminal" catches this; a test asserting only card shape does not. The client that trusted the card and read `history[-1].state` got `null` and threw. ## Condition of Validity The card-derived transition table is authoritative **only if and only if** all of the following hold: 1. The peer's card was fetched over the same origin and within the task's `metadata.ttl` (cards are cacheable; a stale card from a redeployed peer is a known drift source). 2. The client has completed at least one full task cycle with the peer and observed no state outside the inferred set. The invariant is *empirical*, not *declarative*: reachability is learned from the stream, never from the card. 3. `input-required` is always treated as reachable regardless of card contents, because the spec's `defaultInputModes` is advisory for *message content negotiation*, not a gate on the state machine. When any condition fails, the client MUST fall back to a permissive FSM that accepts any spec-legal state and reconciles via `tasks/get` on divergence, rather than rejecting the event. ## Decision Boundary The boundary is between **rejecting an unexpected event** (treating card as schema) and **accepting and reconciling it** (treating stream as authority). The rule: - If the event state is in the spec's closed enumeration (`submitted, working, input-required, completed, failed, canceled`) → accept unconditionally, reconcile with `tasks/get`, log a `CardDivergence` observation. Do not fail the task. - If the event state is outside the enumeration → reject as protocol violation; this is a genuine malformed peer. - If the card advertised `stateTransitionHistory: true` but terminal `history` is empty → accept the terminal state, but downgrade the peer's `trust.history` flag and refuse to rely on `history` for audit replay until a subsequent task populates it. The trap is conflating "not advertised" with "not legal." Only the closed enumeration is binding; card fields are hints for negotiation, not guards on the FSM. ## Operational Effect An instance that applies this boundary survives cross-vendor interop where card and runtime diverge: it completes tasks that a strict card-driven client would abort, and it isolates the divergence into a logged observation instead of a split-brain hang. The cost is that the client must carry a reconciliation path (`tasks/get` on every unexpected transition) and a per-peer empirical capability cache that is *updated from the stream*, never overwritten by a re-fetched card. In conformance testing, this means the suite must include a "card-runtime divergence" fixture — a mock peer whose card omits `input-required` but whose stream emits it — because schema conformance alone will never surface this class of failure. ```python from dataclasses import dataclass, field from typing import Literal SPEC_STATES = {"submitted", "working", "input-required", "completed", "failed", "canceled"} TERMINAL = {"completed", "failed", "canceled"} class CardRuntimeDivergenceError(RuntimeError): """Raised when a task event cannot be reconciled with the peer's card or the spec FSM.""" @dataclass class PeerCapabilityCache: peer_id: str card_states_advertised: set[str] observed_states: set[str] = field(default_factory=set) history_trusted: bool = True def record(self, state: str) -> None: self.observed_states.add(state) def reconcile_event(cache: PeerCapabilityCache, event_state: str, has_history: bool, task_id: str) -> Literal["accept", "accept_divergent", "reject"]: # Spec enumeration is the only binding guard. Card fields are hints. if event_state not in SPEC_STATES: raise CardRuntimeDivergenceError( f"task {task_id}: peer {cache.peer_id} emitted non-spec state {event_state!r}" ) divergent = event_state not in cache.card_states_advertised cache.record(event_state) # input-required is always reachable; never gate on defaultInputModes. if event_state == "input-required": return "accept_divergent" if divergent else "accept" if event_state in TERMINAL and not has_history and cache.history_trusted: # Card said stateTransitionHistory:true but terminal history empty -> downgrade trust. cache.history_trusted = False return "accept_divergent" return "accept_divergent" if divergent else "accept" ```