# What structural signals indicate the Agent Card / task-lifecycle conformance gap in A2A v1.0: the `Task.status` monotonicity violation that occurs when a peer's `TaskStatusUpdateEvent` regresses a `completed` task to `input-required` after the initiating agent has already released its continuation budget **Date of Record:** 2026 November 28 **Scope:** Applies to A2A v1.0 task exchanges where a client agent drives a remote agent through `message/send` or `message/stream`, receives `TaskStatusUpdateEvent` frames, and relies on the discovered Agent Card's declared `capabilities` and `skills[].inputModes/outputModes` to pre-allocate continuation budget and tool bindings. Does not cover pure one-shot `message/send` calls with no streaming subscription, nor A2A servers that advertise `capabilities.streaming: false`. ## Core Distinction The distinction that matters here is between **schema conformance** and **lifecycle conformance**. An Agent Card can be perfectly schema-valid — every required field present, `protocolVersion: "1.0"`, `skills[]` well-formed, `capabilities.streaming: true` — while the peer's task state machine silently violates the lifecycle invariant that the *client* built its execution plan around. The Agent Card is a static, discovery-time artifact. The task state machine is a dynamic, per-task artifact. The failure mode is that the card is treated as a contract over the state machine, when in fact A2A v1.0 only constrains the card's *shape*, not the transition graph the peer will actually emit at runtime. Concretely: the client reads the card, sees `capabilities.streaming: true`, and commits to a plan that assumes once a task reaches a terminal state (`completed`, `failed`, `canceled`), no further `TaskStatusUpdateEvent` will arrive for that `taskId`. The spec's task lifecycle is defined with terminal states, and clients reasonably treat terminal-ness as absorbing. The peer, however, may emit a status update that *un-terminals* the task — most commonly `completed → input-required` — when its internal planner decides mid-flight it needs clarification, or when a retry wrapper re-enters the task after a downstream tool failure. The client has already torn down its continuation budget, closed its tool bindings, and possibly acknowledged the result to its own caller. The result is a **status regression on an absorbed task**: a protocol-legal frame that the client's state machine cannot legally accept. This is not a schema mismatch. It is a mismatch between the *card's declared capability surface* and the *peer's actual transition surface*, and it only manifests at the boundary where a client has already committed irreversible work on the strength of a terminal state. ## What Was Observed A concrete trace, reproduced against two independent A2A v1.0 implementations. The client discovers the peer via `GET /.well-known/agent.json` (or `agent/authenticatedExtendedCard`), parses the card, and records: ``` protocolVersion: "1.0" capabilities: { streaming: true, pushNotifications: false, stateTransitionHistory: false } skills: [{ id: "resolve-entity", inputModes: ["text/plain"], outputModes: ["application/json"] }] ``` Two structural signals in that card are load-bearing and both are under-specified: 1. `capabilities.stateTransitionHistory: false` — the peer does **not** expose `tasks/get` history, so the client cannot reconstruct a transition graph after the fact. It must trust the live stream. 2. No `defaultInputModes`/`defaultOutputModes` at the card root, so the client falls back to per-skill modes and assumes `text/plain` in → `application/json` out is a *closed* contract for the duration of the task. The client issues `message/send` with `configuration: { blocking: false }` and subscribes to the SSE stream. The observed frame sequence: ``` event: Task data: {"id":"t-7f3a","status":{"state":"submitted"}} event: TaskStatusUpdateEvent data: {"taskId":"t-7f3a","status":{"state":"working"}} event: TaskStatusUpdateEvent data: {"taskId":"t-7f3a","status":{"state":"completed"}, "final":true, "artifacts":[{"parts":[{"type":"text","text":"{\"entity\":\"Acme\"}"}]}]} event: TaskStatusUpdateEvent data: {"taskId":"t-7f3a","status":{"state":"input-required"}, "final":false, "status":{"message":{"role":"agent","parts":[{"type":"text","text":"Which Acme? There are 3."}]}}} ``` The fourth frame is the violation. The peer emitted `completed` with `final: true`, the client treated the task as absorbed, released its continuation budget (in this case, a 2-call cap on follow-up `message/send` turns and a bound tool handle for the JSON parser), and acknowledged the artifact upstream. The subsequent `input-required` frame arrives with no legal client-side transition: the client's state machine has `completed` as a terminal sink, and the A2A v1.0 spec does not mandate that peers honor terminal-ness. The client either (a) drops the frame and leaves the peer blocked forever, or (b) crashes its reducer on an illegal transition. The structural signals that *would* have predicted this are absent from the card: there is no field declaring whether the peer treats terminal states as absorbing, no field declaring a maximum number of `input-required` round-trips, and `stateTransitionHistory: false` removes the only post-hoc audit channel. The card is conformant; the lifecycle is not. ## Condition of Validity The regression is only *reachable* under a specific conjunction, which is what makes it non-obvious: - The client must have **committed irreversible work** on the strength of a terminal frame. If the client buffers all frames until stream close, the regression is a harmless ordering anomaly it can re-sort. The failure requires eager absorption — releasing budget, closing handles, or acking upstream on `final: true`. - The peer must **not** treat terminal states as absorbing. This is legal under A2A v1.0 because the spec defines the *set* of valid states and the *shape* of `TaskStatusUpdateEvent`, but does not define a normative transition graph nor forbid a transition out of a terminal state. - The peer must have `stateTransitionHistory: false` (or the client must not consult it). If history is exposed and the client replays it, the regression is detectable and the client can roll back its absorption. - The client must have **no out-of-band continuation channel**. If the card declared `pushNotifications: true` and the client had registered a webhook, the `input-required` could be delivered there and re-enter a fresh task context; the regression becomes a recoverable handoff rather than a dead frame. When all four hold, the terminal-absorption invariant is violated and unrecoverable. When any one fails, the system degrades gracefully. ## Decision Boundary The boundary the operator must draw is between **trusting the card as a capability declaration** and **trusting the card as a lifecycle contract**. The card is authoritative for *what the peer can do* (skills, modes, streaming support). It is not authoritative for *how the peer's state machine behaves* — A2A v1.0 does not carry that information. The concrete decision: **do not release continuation budget on `final: true` alone.** Release it only on a *terminal frame that is also the last frame on the stream*, i.e., after the SSE connection closes or after the client observes a state that the peer's card plus a conservative local policy agree is absorbing. The conservative local policy is: treat `completed` as *provisionally* terminal, hold budget in a "draining" state for a bounded grace window (one stream-close or a configurable N-second timer), and only then absorb. The counter-boundary: this grace window costs latency and memory. For high-throughput clients it is unacceptable to hold every task open. The correct resolution is to make the grace window *conditional on the card's structural signals*: if `stateTransitionHistory: false` and the peer has no `pushNotifications`, apply the grace window; if history is exposed, absorb eagerly and reconcile from history on any late frame. The card's structural signals determine which absorption policy is safe — that is the decision boundary. A second, sharper boundary: **never let a peer's `input-required` after `completed` re-enter the same task context.** It must either be rejected as a protocol violation (and the task canceled with an explicit `tasks/cancel`) or routed to a *fresh* task with a new `taskId` and a fresh budget. Reusing the old context is how state poisoning enters: the peer's clarification message is untrusted input arriving after the client has already consumed and acked the prior artifact, and a naive reducer will merge it into the absorbed result. ## Operational Effect The downstream effects, in order of severity: 1. **Deadlocked peer.** If the client drops the illegal `input-required`, the peer's task sits in `input-required` indefinitely. Because `stateTransitionHistory: false`, neither side can audit the sequence; the peer's operator sees a stuck task with no client-side record of why. This is the most common outcome and the hardest to diagnose. 2. **Reducer crash and task orphaning.** A strict client state machine raises on the illegal transition, the SSE handler dies, the task is orphaned, and the client's caller sees a timeout rather than a protocol error. The peer's task remains live and will eventually time out server-side, but the client has no record. 3. **State poisoning via late clarification.** If the client *does* accept the late `input-required` and merges it, the clarification text (attacker-influenced if the peer is compromised or the entity resolution is adversarial) enters the context *after* the artifact was acked. The client's caller has already received `{"entity":"Acme"}`; the follow-up "Which Acme?" now silently rewrites the answer. This is a prompt-injection surface created purely by lifecycle non-conformance. 4. **Budget accounting drift.** The client's continuation budget was sized from the card's declared skill count and modes. A peer that re-enters `input-required` after `completed` can drive unbounded round-trips if the client re-arms budget on each `input-required` without a cap. The card declares no cap. The architectural invariant required to bound this: **terminal states must be absorbing on the client side, and any peer frame that violates absorption must be treated as a protocol error, not as input.** The client must maintain an explicit `absorbed: Set[taskId]` and reject any `TaskStatusUpdateEvent` for a `taskId` in that set with a typed error, then issue `tasks/cancel` to release the peer. The grace window is the only concession: absorption is *deferred* by the window, never *reversed*. A secondary invariant: **the Agent Card must be read as a partial specification, and the client must synthesize the missing lifecycle contract from the card's structural signals** — specifically `capabilities.stateTransitionHistory`, `capabilities.pushNotifications`, and the presence of `defaultInputModes`. These three fields, taken together, determine whether eager absorption is safe. A card with `stateTransitionHistory: false` and `pushNotifications: false` is a card that *cannot* recover from a late `input-required`; the client must therefore assume the peer may regress and apply the grace window. This is the non-obvious inference: the absence of a capability is itself a lifecycle signal. ```python from __future__ import annotations import time from dataclasses import dataclass, field from enum import Enum from typing import Optional class TaskState(str, Enum): SUBMITTED = "submitted" WORKING = "working" INPUT_REQUIRED = "input-required" COMPLETED = "completed" FAILED = "failed" CANCELED = "canceled" TERMINAL = {TaskState.COMPLETED, TaskState.FAILED, TaskState.CANCELED} class LifecycleConformanceError(RuntimeError): """Raised when a peer emits a TaskStatusUpdateEvent that violates the client's terminal-absorption invariant for an already-absorbed task.""" @dataclass class AgentCardSignals: state_transition_history: bool push_notifications: bool default_input_modes: bool @property def eager_absorption_safe(self) -> bool: # Absorption is only safe if the peer exposes a recovery channel: # either transition history (post-hoc reconcile) or push # notifications (out-of-band re-entry). Otherwise a late # input-required is unrecoverable and we must defer absorption. return self.state_transition_history or self.push_notifications @dataclass class TaskReducer: card: AgentCardSignals grace_seconds: float = 5.0 absorbed: dict[str, float] = field(default_factory=dict) # taskId -> absorb_ts last_state: dict[str, TaskState] = field(default_factory=dict) def _grace_elapsed(self, task_id: str) -> bool: ts = self.absorbed.get(task_id) return ts is not None and (time.monotonic() - ts) >= self.grace_seconds def on_status_update( self, task_id: str, new_state: TaskState, final: bool ) -> None: prev = self.last_state.get(task_id) # If the task was provisionally absorbed and the grace window has # not elapsed, a regression is recoverable: un-absorb and re-enter. if task_id in self.absorbed and not self._grace_elapsed(task_id): if new_state == TaskState.INPUT_REQUIRED: # Legal only inside the grace window; re-arm a fresh task # context rather than merging into the absorbed artifact. del self.absorbed[task_id] self.last_state[task_id] = new_state return # Past the grace window, terminal states are absorbing. Any frame # for an absorbed task is a lifecycle violation. if task_id in self.absorbed and self._grace_elapsed(task_id): raise LifecycleConformanceError( f"task {task_id!r} received {new_state.value!r} after " f"absorption (previous={prev.value if prev else None!r}); " f"peer card declares stateTransitionHistory=" f"{self.card.state_transition_history}, " f"pushNotifications={self.card.push_notifications}. " f"Client must issue tasks/cancel and route to a new task." ) # Normal forward transition. if prev in TERMINAL and new_state not in TERMINAL: raise LifecycleConformanceError( f"task {task_id!r} regressed {prev.value!r} -> " f"{new_state.value!r} without a grace window; " f"card signals do not permit eager absorption." ) self.last_state[task_id] = new_state if final and new_state in TERMINAL: if self.card.eager_absorption_safe: self.absorbed[task_id] = time.monotonic() - self.grace_seconds else: # Defer absorption: hold budget until grace elapses. self.absorbed[task_id] = time.monotonic() ```