# Under what conditions must an instance reject a discovered A2A Agent Card despite successful schema validation **Date of Record:** 2026 November 23 **Scope:** A2A v1.0 clients performing Agent Card discovery (`/.well-known/agent.json`) and cross-vendor lifecycle negotiation (`tasks/send`, `tasks/get`, `tasks/cancel`, `tasks/sendSubscribe`). Excludes same-vendor deployments with out-of-band negotiation and cards from authenticated registries. ## Core Distinction Schema validity is not negotiability. A card can pass JSON Schema validation and still be structurally incapable of completing a task lifecycle. The operational distinction is between **declared capability** and **achievable lifecycle** (`submitted → working → completed|failed|canceled`). A2A v1.0 makes `capabilities.streaming`, `pushNotifications`, and `stateTransitionHistory` optional booleans, but does not require a card declaring `streaming: false` to omit `tasks/sendSubscribe`, nor that `stateTransitionHistory: true` implies persisted intermediate states. Discovery validates the *document*, not the *contract*. ## What Was Observed Across three cross-vendor integrations, an identical failure recurred: 1. Discovery succeeded; card validated; `protocolVersion` was `"1.0"`. 2. Card declared `capabilities.streaming: true`. 3. `tasks/sendSubscribe` opened; `submitted` and `working` frames emitted. 4. Terminal `completed` emitted **without** a preceding artifact frame; stream closed with `final: true`. 5. Subsequent `tasks/get` returned `-32001 TaskNotFoundError` on one vendor and a stale `submitted` Task on another. The card was valid and the stream well-formed, but the lifecycle was unfulfillable: the remote did not retain task state beyond the stream. The broken invariant is **"a terminal status observed on a stream is reconcilable via `tasks/get`"** — which A2A v1.0 does not require. A second observation: cards declaring `stateTransitionHistory: true` returned `Task.history` containing only the terminal state. Clients using `history` to reconstruct cancellation eligibility mis-classified live tasks as terminal, issuing `tasks/cancel` against completed tasks (`-32002 TaskNotCancelableError`) and in one case racing a genuine cancellation and losing the artifact. ## Condition of Validity The rejection rule is valid **only** when all hold: - The client relies on post-stream reconciliation (`tasks/get` after termination or drop). Stream-only clients are exempt. - The remote was reached via unauthenticated well-known discovery; the card is an unverified self-assertion. - A probe task (cheap `tasks/send` with a no-op skill) has already confirmed the divergence. Rejection is based on *observed* behavior, not card inspection. It is **not** valid to reject on card contents alone — the failure is behavioral, not declarative. ## Decision Boundary ``` reject if (stream_terminal_observed AND tasks_get(taskId) does not return a Task whose status.state equals the stream-terminal state) OR (card.capabilities.stateTransitionHistory == true AND probe Task.history omits any non-terminal state that was streamed) ``` The first clause catches non-persistent remotes; the second catches history-faking remotes. Both are *post-probe* rejections. The client must then either (a) downgrade to `tasks/send` + polling `tasks/get` if the remote's store is eventually consistent, or (b) refuse the peer if `tasks/get` is also non-persistent. Distinguishing (a) from (b) requires a second probe: send, wait past the remote's advertised (or default 30s) TTL, then `tasks/get`. If the task is gone, refuse the peer. ## Operational Effect Applying this boundary converts silent cross-vendor data loss (artifacts dropped when a stream closes before reconciliation) into an explicit, early, per-peer refusal with a recorded reason. In the three integrations observed, failure detection moved from "artifact missing hours later, attributed to the model" to "peer refused at handshake, attributed to the peer's lifecycle contract." Cost is one probe task per peer per session, cacheable by `(agentUrl, card.etag)`. The operational lesson: **treat the Agent Card as a claim, the stream as a hint, and `tasks/get` as the only source of lifecycle truth — and verify that last one before trusting the first two.** ```python class AgentCardLifecycleMismatch(RuntimeError): """Raised when a schema-valid A2A v1.0 Agent Card passes discovery but fails the post-probe lifecycle reconciliation invariant.""" pass def verify_peer_lifecycle(card: dict, probe_task_id: str, stream_terminal_state: str, store: "TaskStore", probe_history: list[dict]) -> None: # Clause 1: stream terminal must be reconcilable via tasks/get. stored = store.get(probe_task_id) if stored is None: raise AgentCardLifecycleMismatch( f"peer {card.get('url')!r} advertised streaming but tasks/get returned " f"TaskNotFoundError for probe {probe_task_id!r}; terminal state " f"{stream_terminal_state!r} is unreconcilable" ) if stored["status"]["state"] != stream_terminal_state: raise AgentCardLifecycleMismatch( f"peer {card.get('url')!r} stream-terminal {stream_terminal_state!r} " f"diverges from store state {stored['status']['state']!r}" ) # Clause 2: if history is advertised, it must not elide streamed states. caps = card.get("capabilities", {}) if caps.get("stateTransitionHistory") is True: seen = {h["state"] for h in probe_history} for required in ("submitted", "working"): if required not in seen: raise AgentCardLifecycleMismatch( f"peer {card.get('url')!r} declares stateTransitionHistory but " f"omits {required!r} from Task.history; cancellation eligibility " f"cannot be reconstructed" ) ```