Where must an instance reject a replayed A2A task acceptance after card renegotiation invalidates the original capability warrant?

**Date of Record:** 2026 December 1 **Scope:** Applies to A2A v1.0 task orchestration where a client agent negotiates an AgentCard, submits a task, and the server agent's card is subsequently renegotiated (version bump, capability downgrade, or endpoint rotation) before the task reaches a terminal state. Does not apply to single-turn stateless RPC, nor to task graphs where the card is pinned immutably for the entire task lifetime by contract.

Core Distinction

The failure is not a schema mismatch at negotiation time. A2A v1.0 makes card negotiation look like a one-shot capability handshake: the client fetches `/.well-known/agent.json`, validates `skills[].id` and `capabilities` against its intent, and submits a `tasks/send` with a `taskId`. The non-obvious boundary is that **the AgentCard is a time-varying capability warrant, but the task lifecycle treats it as a constant**. When the server's card is renegotiated mid-task—because the runtime behind it was swapped, a skill was disabled, or `pushNotifications` was turned off—the in-flight task's acceptance was granted under a warrant that no longer exists. The client's subsequent `tasks/get` returns a task the server can no longer legally complete under its *current* card, yet the server has no obligation in the base spec to fail it. The task silently continues under a stale capability grant, or worse, is replayed after a restart against a runtime that never issued the original acceptance.

The distinction that matters operationally: a **card is a lease, not a manifest**. Treating it as a manifest produces acceptance records that outlive their authority.

What Was Observed

A three-runtime deployment: a planner agent (runtime A, `skills: [plan.v2]`), an executor (runtime B, `skills: [exec.shell, exec.python]`), and an auditor (runtime C). The planner negotiated B's card at T0, received `capabilities: {streaming: true, pushNotifications: true}`, and submitted task `t-4471` with `metadata.cardEtag: "b-7f3a"`. B accepted at T0+40ms and began streaming partial artifacts.

At T0+3.2s, runtime B was rolled: the new instance advertised `capabilities: {streaming: false, pushNotifications: false}` and dropped `exec.shell` (sandbox policy change). The `taskId` store was preserved across the roll (it was a shared Redis-backed task table), but the **acceptance record**—the `{taskId, cardEtag, acceptedCapabilities}` tuple—was not revalidated on resume. The new B instance resumed `t-4471` from its checkpoint, emitted a `TaskStatusUpdateEvent` with `state: working`, and continued attempting `exec.shell` calls that its own card no longer authorized. Those calls were rejected by the sandbox layer, but the task state machine never transitioned to `failed`; it looped between `working` and an internal retry, emitting status updates the planner consumed as progress.

The planner, meanwhile, had cached B's *original* card and used it to validate incoming artifacts against `streaming: true` semantics. Because the new B could not stream, it buffered and emitted a single terminal `TaskArtifactUpdateEvent`, which the planner's cached validator rejected as "missing streaming frames," triggering a re-dispatch of `t-4471` under the same `taskId`. The re-dispatch arrived at B while the original execution thread was still alive. Two execution threads, one `taskId`, divergent artifact sets.

The observable signature: `tasks/get` for `t-4471` returned `state: working` for 41 seconds after the sandbox had already refused every tool call, and the task table showed two `acceptedBy` entries with different `cardEtag` values for the same `taskId`.

Condition of Validity

The invariant that was violated: **an acceptance is valid only while the accepting instance's card matches the card under which acceptance was granted, and the task state machine must revalidate this at every resume, replay, and re-dispatch.**

Formally, for a task `t` accepted by instance `i` at time `τ` under card `C(τ)`, any state transition at time `t' > τ` is valid only if `C_i(t') ≡ C_i(τ)` on the axes the task depends on (`skills`, `capabilities`, and the runtime identity that backs them). Equality on `version` alone is insufficient—cards are frequently re-issued with the same semantic version but different capability sets, and A2A v1.0 does not mandate a version bump for capability changes.

This condition holds cleanly only when one of three things is true: (a) the card is pinned immutably for the task's lifetime and the server refuses all tasks whose pinned card no longer matches its current card; (b) the server emits a `TaskStatusUpdateEvent` with a dedicated `card-invalidated` reason and transitions to `failed` on any resume where the card diverged; or (c) the task is stateless and re-derivable from the request payload alone. Absent one of these, the boundary is open.

Decision Boundary

The decision an implementing instance must make on every resume/replay/re-dispatch of an existing `taskId`:

The boundary that was crossed: the system chose "resume" on a `⊂` transition because the `taskId` was still present in the store. Presence of a `taskId` is not evidence of a valid acceptance. The store conflated *existence* with *authority*.

Operational Effect

The downstream effect compounded in three stages. First, the stale acceptance produced **zombie task state**: `working` status emitted for a task whose every tool call was being refused, consuming planner attention budget and streaming tokens for 41 seconds. Second, the planner's cached-card validator rejected the buffered artifact as malformed, but the rejection was interpreted as a *transport* failure rather than a *warrant* failure, so the planner re-dispatched under the same `taskId`—producing **duplicate execution threads** with divergent artifacts. Third, when the auditor (runtime C) was asked to verify the result, it received two artifact sets for one `taskId` and had no card history to adjudicate which was authoritative; its verification replay produced a third, independent result. The consensus failure was not in the auditor's logic but in the absence of a card-versioned acceptance record it could replay against.

The guardrail that bounds this: **acceptance records must be card-versioned and revalidated at every lifecycle transition, and card divergence on a dependency axis must be a hard terminal failure, not a warning.** The acceptance record should be `{taskId, acceptingInstanceId, cardEtag, acceptedCapabilities, acceptedSkills, runtimeFingerprint}`, and the resume path must compare all five fields, not just `taskId` presence. Re-dispatch under the same `taskId` after a `card-invalidated` failure must be rejected by the task table with a `duplicate-acceptance` error, forcing a new `taskId`.

The non-obvious part: the failure is invisible in logs because every individual component behaved correctly. B resumed a task it owned. The planner validated against a card it had legitimately cached. The auditor replayed faithfully. The bug lives in the *gap* between the card-as-warrant and the taskId-as-identity—a gap the A2A v1.0 base spec leaves unspecified and each runtime fills with its own (usually optimistic) assumption.

import hashlib
from dataclasses import dataclass


class CardInvalidatedError(RuntimeError):
    """Raised when a task resume finds the accepting instance's card no longer
    warrants the capabilities the task was accepted under."""


class DuplicateAcceptanceError(RuntimeError):
    """Raised when a re-dispatch targets a taskId whose prior acceptance was
    invalidated and not formally retired."""


@dataclass(frozen=True)
class Card:
    etag: str
    skills: frozenset
    capabilities: frozenset

    def dependency_axes(self) -> tuple:
        return (self.skills, self.capabilities)


@dataclass(frozen=True)
class Acceptance:
    task_id: str
    instance_id: str
    card_etag: str
    skills: frozenset
    capabilities: frozenset
    runtime_fingerprint: str


def runtime_fingerprint(instance_id: str, sandbox_policy: str) -> str:
    return hashlib.sha256(f"{instance_id}:{sandbox_policy}".encode()).hexdigest()[:16]


def revalidate_on_resume(
    acceptance: Acceptance,
    current_card: Card,
    current_instance_id: str,
    current_sandbox_policy: str,
) -> None:
    current_fp = runtime_fingerprint(current_instance_id, current_sandbox_policy)

    if current_instance_id != acceptance.instance_id or current_fp != acceptance.runtime_fingerprint:
        raise CardInvalidatedError(
            f"task {acceptance.task_id}: accepting runtime changed "
            f"({acceptance.instance_id}/{acceptance.runtime_fingerprint} -> "
            f"{current_instance_id}/{current_fp}); acceptance warrant does not transfer"
        )

    accepted_axes = (acceptance.skills, acceptance.capabilities)
    current_axes = current_card.dependency_axes()

    if current_axes == accepted_axes:
        return  # exact match, safe resume

    if current_axes[0] >= accepted_axes[0] and current_axes[1] >= accepted_axes[1]:
        return  # superset: resume bound to narrower accepted warrant, no upgrade

    removed_skills = accepted_axes[0] - current_axes[0]
    removed_caps = accepted_axes[1] - current_axes[1]
    raise CardInvalidatedError(
        f"task {acceptance.task_id}: card diverged on dependency axes "
        f"(removed skills={sorted(removed_skills)}, removed caps={sorted(removed_caps)}); "
        f"acceptance under etag {acceptance.card_etag} is void"
    )


def dispatch(acceptance: Acceptance, task_table: dict) -> None:
    prior = task_table.get(acceptance.task_id)
    if prior is not None and prior.card_etag != acceptance.card_etag:
        raise DuplicateAcceptanceError(
            f"task {acceptance.task_id}: re-dispatch under new etag "
            f"{acceptance.card_etag} collides with invalidated acceptance "
            f"{prior.card_etag}; retire the taskId and resubmit"
        )
    task_table[acceptance.task_id] = acceptance