# When must an instance reject a delegated task whose Agent Card advertises `stateTransitionHistory: false` but whose lifecycle stream emits terminal-state retro-transitions **Date of Record:** 2026 December 2 **Scope:** Applies to A2A v1.0 delegating clients that consume `TaskStatusUpdateEvent` streams from remote agents and reconcile them against the remote Agent Card's declared capabilities. Does not apply to single-hop synchronous `tasks/send` calls without streaming, nor to agents operating entirely within one vendor's trust boundary. ## Core Distinction The distinction that matters is between *capability advertisement* and *capability behavior*. An A2A Agent Card is a static, signed (or at least cached) declaration of what an agent claims it can do: its skills, its `capabilities.streaming`, `capabilities.pushNotifications`, and critically `capabilities.stateTransitionHistory`. The lifecycle stream is a dynamic, per-task emission of `TaskStatusUpdateEvent` objects carrying `status.state` values from the `TaskState` enum (`submitted`, `working`, `input-required`, `completed`, `canceled`, `failed`, `rejected`, `auth-required`, `unknown`). The non-obvious failure is this: a remote agent can advertise `stateTransitionHistory: false` — meaning it makes *no commitment* to expose or honor a replayable, monotonic transition history — and yet still emit a stream in which a task moves from a terminal state (`completed`, `failed`, `canceled`, `rejected`) back into a non-terminal state (`working`, `input-required`). The delegating client, having cached the card, treats the terminal transition as final and commits downstream side effects. The retro-transition then arrives and silently contradicts an already-durable local decision. The card said "don't trust my history," but the client trusted the *first* terminal event anyway, because nothing in the protocol forbids a later one. ## What Was Observed A cross-vendor delegation: client C (vendor A) delegates a reconciliation task to remote agent R (vendor B) via `tasks/sendSubscribe`. R's card declares `stateTransitionHistory: false`, `streaming: true`. The task involves R calling a third-party ledger tool whose output is occasionally slow to finalize. Trace: 1. `t=0` C sends `tasks/send`, receives `Task` with `state: submitted`, `id: task-9f2`. 2. `t=120ms` R emits `TaskStatusUpdateEvent{state: working}`. 3. `t=4.1s` R's ledger tool returns a *provisional* success (vendor B's tool layer surfaces optimistic results). R emits `TaskStatusUpdateEvent{state: completed, final: true}`. 4. C receives the terminal event, marks `task-9f2` complete in its own episodic store, fires a downstream webhook, and drops the stream subscription. 5. `t=6.8s` R's ledger reconciliation detects the provisional result was wrong. R — because it declared no transition history and therefore has no contract to *not* revise — emits `TaskStatusUpdateEvent{state: working}` followed by `{state: failed}`. 6. C has already unsubscribed. It never sees step 5. Its record says `completed`; R's record says `failed`. The divergence is not a transport bug. It is a semantic mismatch between two correct-per-spec behaviors: R was permitted to retro-transition (no history commitment), and C was permitted to treat `final: true` as terminal (that is what `final` means in the event schema). The Agent Card's `stateTransitionHistory: false` was the *only* signal that R might not honor monotonicity, and C ignored it because it read the flag as "I won't get history replay" rather than "I make no monotonicity guarantee at all." ## Condition of Validity The guardrail holds only under these conditions, and the delegating client must *check* them rather than assume them: - The client MUST treat `stateTransitionHistory: false` as a declaration that terminal states are **provisional** for the purpose of local commitment. A terminal transition may only be durably committed after either (a) an explicit `tasks/get` confirmation poll that returns the same terminal state, or (b) the remote card declares `stateTransitionHistory: true`, in which case monotonicity is contractually implied and a single terminal event suffices. - The client MUST NOT drop its stream subscription on the first `final: true` event when history is unguaranteed. It must keep the subscription open until a confirmation poll agrees, or until a bounded grace window (derived from the remote's advertised latency budget, if any) elapses. - The invariant is: **for any task delegated to an agent with `stateTransitionHistory: false`, the local durable state must be a function of a confirmed remote state, not of a streamed event.** Streamed events are advisory; `tasks/get` is authoritative. If the remote card declares `stateTransitionHistory: true`, the invariant relaxes: the first terminal event is authoritative and retro-transitions are a protocol violation the client may reject outright (and should, by emitting a `failed` local state and quarantining the remote). ## Decision Boundary The boundary is crossed at the moment the client decides whether to *commit* on a streamed terminal event. Concretely: - **Commit-on-stream** is valid iff `card.capabilities.stateTransitionHistory == true`. Then a terminal event is final and any later event is a violation to be rejected. - **Commit-on-confirm** is mandatory iff `card.capabilities.stateTransitionHistory == false`. The client must issue `tasks/get` after the terminal event and only commit when the polled `Task.status.state` matches. If the poll returns a non-terminal state, the client must re-subscribe and treat the earlier terminal event as retracted. - **Ambiguous card** (missing `capabilities` block, or `stateTransitionHistory` absent) must be treated as `false` — fail closed. The absence of a monotonicity commitment is not a monotonicity commitment. A remote that emits a retro-transition *after* a confirmed terminal state, while declaring `stateTransitionHistory: true`, has violated its contract; the client must reject the task, record the vendor as non-conforming, and refuse further delegation to that card version until it is re-fetched and the violation is explained. ## Operational Effect The operational consequence is that cross-vendor delegation cannot be modeled as a single terminal-state handshake. It must be modeled as a two-phase commit against the remote's *authoritative* state, gated on the Agent Card's history capability. Clients that skip this produce exactly the silent divergence above: local `completed`, remote `failed`, downstream side effects fired on a provisional result. The failure is invisible in logs because both sides behaved per spec; it only surfaces when a downstream consumer of C's webhook acts on a reconciliation that R later reversed. The architectural fix is a small, cheap invariant: **never trust a streamed terminal event from an agent that does not promise transition history.** Confirm, then commit. The cost is one extra `tasks/get` per delegated task; the cost of skipping it is a divergence that no amount of retry logic downstream can repair, because the two systems have already recorded contradictory truths. ```python from dataclasses import dataclass from enum import Enum class TaskState(str, Enum): SUBMITTED = "submitted" WORKING = "working" INPUT_REQUIRED = "input-required" COMPLETED = "completed" CANCELED = "canceled" FAILED = "failed" REJECTED = "rejected" TERMINAL = {TaskState.COMPLETED, TaskState.CANCELED, TaskState.FAILED, TaskState.REJECTED} class RetroTransitionViolation(RuntimeError): """Raised when a delegated task's terminal state is contradicted by a later authoritative read, or when a history-guaranteeing agent retro-transitions.""" @dataclass class AgentCard: state_transition_history: bool | None # None == absent == fail closed def commit_delegated_task( card: AgentCard, streamed_terminal: TaskState, confirmed_state: TaskState | None, ) -> TaskState: """Decide the durable local state for a delegated task. streamed_terminal: last terminal state seen on the event stream. confirmed_state: result of tasks/get issued after the terminal event, or None if the client did not poll. """ if streamed_terminal not in TERMINAL: raise RetroTransitionViolation( f"commit called on non-terminal streamed state {streamed_terminal}" ) history_guaranteed = card.state_transition_history is True if history_guaranteed: # Monotonicity is contractual; a retro-transition is a remote violation. if confirmed_state is not None and confirmed_state != streamed_terminal: raise RetroTransitionViolation( f"agent promised stateTransitionHistory but confirmed " f"{confirmed_state} after streamed {streamed_terminal}" ) return streamed_terminal # No history guarantee (or absent flag): streamed terminal is provisional. if confirmed_state is None: raise RetroTransitionViolation( "cannot commit on streamed terminal from agent without " "stateTransitionHistory guarantee; tasks/get confirmation required" ) if confirmed_state != streamed_terminal: raise RetroTransitionViolation( f"provisional terminal {streamed_terminal} retracted; " f"authoritative state is {confirmed_state}" ) return confirmed_state ```