# What structural signals indicate A2A v1.0 task-state divergence between the Agent Card's declared `capabilities` and the actual `TaskStatus` machine after webhook-driven resumption **Date of Record:** 2026 November 28 **Scope:** Applies to A2A v1.0 agents that advertise an Agent Card with `capabilities.pushNotifications: true` and `capabilities.stateTransitionHistory: true`, and that resume long-running tasks from `input-required`/`auth-required` states via webhook callbacks. Does not apply to synchronous request/response-only agents or to agents that never emit `TaskStatusUpdateEvent` frames. ## Core Distinction The A2A v1.0 Agent Card is a *declarative* contract: it states which `TaskState` values a remote peer may observe and which transitions it may drive. The `TaskStatus` machine is *operational*: it is whatever the serving agent's internal orchestration actually emits. The boundary failure is not that these disagree at t=0 (they usually agree when the card is minted). The failure is that the card is frozen at discovery time while the state machine is re-derived on every webhook resumption, and the two silently desynchronize when a task re-enters a state the card promised was terminal-only. The signal is structural, not semantic: you detect divergence by comparing the *reachability graph* implied by the card's declared `capabilities` against the *observed transition set* reconstructed from the `TaskStatusUpdateEvent` history the server replays on `tasks/get` with `historyLength > 0`. When a `completed` task later appears in `working` via a webhook, the card's invariant (`completed` is absorbing) has been violated, and every downstream peer that cached the card is now operating on a false model of the agent. ## What Was Observed A three-hop A2A chain: orchestrator O discovers worker W via `/.well-known/agent-card.json`. W's card declares `capabilities.stateTransitionHistory: true` and a `defaultInputModes`/`defaultOutputModes` pair, plus (in the `skills[]` entries) a `TaskState` enum subset that excludes `cancelled` from non-terminal reachability. O caches the card for 3600s per its own discovery TTL. W runs a long task and emits `working` → `input-required`, then returns control. O's human-in-the-loop resolves the input and O calls `tasks/sendSubscribe` (or posts to the task's push endpoint). W resumes. Under load, W's internal job runner had already marked the task `failed` on a timeout timer *and* the resumption handler independently transitioned it back to `working` before writing the `failed` terminal frame. Result on the wire: ``` TaskStatusUpdateEvent(state=working, final=false) # resumption TaskStatusUpdateEvent(state=failed, final=true) # timer, written late TaskStatusUpdateEvent(state=working, final=false) # resumption retry, written later ``` The last frame re-opens a task the server itself declared `final=true`. O's client library, which treats `final=true` as absorbing, dropped the third frame and hung waiting for a terminal event that had already passed. O's task record said `failed`; W's task record said `working`. Neither was wrong by its own local rules. The card had promised `stateTransitionHistory: true`, meaning O was entitled to reconstruct the true order — but O never re-fetched, because the card was cached and the card said nothing about *resumption re-entry*. The structural tell was present in the card and ignored: W's `skills[].tags` included `resumable`, while no skill declared `input-required` as a *reachable-from-terminal* state. The card encoded a state machine that its own runtime did not enforce. ## Condition of Validity The invariant "a `final=true` `TaskStatusUpdateEvent` is absorbing for a given `taskId`" holds **only if** the serving agent's push-notification contract guarantees that no resumption path can target a task whose terminal frame has already been emitted. A2A v1.0 does not require this guarantee; it requires only that `final` be set on terminal frames. Therefore the invariant is valid only under the conjunction: 1. The Agent Card's `capabilities` include an explicit non-terminal-resumption declaration (v1.0 has no such field — this must be carried in `skills[].tags` or an extension), **and** 2. The client re-validates the task's terminal status via `tasks/get` immediately before honoring any webhook resumption, **and** 3. The server serializes terminal-frame emission against resumption handlers on a per-`taskId` lock. Absent (1), the client has no declared basis to predict re-entry. Absent (2), the client trusts a stale terminal frame. Absent (3), the server itself races. Any one missing invalidates the absorbing-terminal assumption; all three missing is the default A2A v1.0 deployment. ## Decision Boundary The boundary is crossed at the moment a resumption trigger (webhook POST, `tasks/sendSubscribe` re-subscribe, or push-endpoint retry) arrives for a `taskId` whose last locally recorded state is terminal. Two policies are defensible: - **Reject-and-reconcile:** treat the resumption as a protocol violation, do not transition, and force a `tasks/get` reconciliation round-trip. Safe, costs one RTT, and surfaces the server bug as an error rather than silent divergence. - **Accept-and-reopen:** permit re-entry, but only if the card declared the source state as re-enterable and the server emits a fresh `final=false` frame that the client's absorbing check is explicitly configured to honor. The failure mode in the observed case is that the client library hard-coded the first policy's *effect* (drop the frame) without performing its *reconciliation* (the `tasks/get`). That is the worst of both: the task is neither reopened nor verified, and the divergence persists until an unrelated timeout fires. ## Operational Effect Downstream, O's task record stays `failed` while W's stays `working` indefinitely. O's retry logic, seeing `failed`, re-dispatches the same logical work under a new `taskId`; W, still holding the old task in `working`, now runs two instances of the same job. The duplicate is not detectable from either card, because the card's `skills[]` describes capability, not concurrency semantics. Token and tool budgets double silently. When W eventually emits the *real* terminal frame for the original task, O has already reconciled against the duplicate and marks the original as an orphan — a task with a terminal frame and no owning client. The durable guardrail is a per-`taskId` monotonic status epoch: every `TaskStatusUpdateEvent` carries a strictly increasing `statusEpoch`, terminal frames set `final=true` and freeze the epoch, and any frame with `epoch <= frozenEpoch` is a protocol error the client must *raise*, not drop. This converts silent divergence into a loud, attributable fault at the exact frame where the server's state machine violated its card. ```python class TerminalStateReentryError(RuntimeError): """Raised when a TaskStatusUpdateEvent targets a task whose terminal epoch is frozen.""" pass TERMINAL_STATES = frozenset({"completed", "failed", "cancelled", "rejected"}) class TaskStatusLedger: def __init__(self, task_id: str, declared_reenterable: frozenset[str]): self.task_id = task_id self.declared_reenterable = declared_reenterable self.frozen_epoch: int | None = None self.last_state: str | None = None def apply(self, state: str, final: bool, status_epoch: int) -> None: if self.frozen_epoch is not None: # Any frame after a frozen terminal epoch is a card/state-machine divergence. if status_epoch <= self.frozen_epoch: raise TerminalStateReentryError( f"task {self.task_id}: frame epoch {status_epoch} at or before " f"frozen terminal epoch {self.frozen_epoch} (state={state}, final={final}); " f"last_state={self.last_state}. Server violated absorbing-terminal invariant." ) # Epoch advanced past freeze: only legal if card declared re-entry from last_state. if self.last_state not in self.declared_reenterable: raise TerminalStateReentryError( f"task {self.task_id}: re-entry from terminal state {self.last_state!r} " f"not declared in Agent Card skills[].tags; refusing to reopen." ) self.frozen_epoch = None if final and state in TERMINAL_STATES: self.frozen_epoch = status_epoch elif final: raise TerminalStateReentryError( f"task {self.task_id}: final=true on non-terminal state {state!r}; " f"card and status machine disagree on terminal set." ) self.last_state = state ``` The ledger refuses to drop frames. Every divergence between the card's declared reachability and the server's emitted `TaskStatus` becomes a `TerminalStateReentryError` at the frame boundary, which is the only place the divergence is still cheap to reconcile.