# How does an instance detect a silent A2A artifact-version divergence during cross-vendor task resumption after a peer restarts mid-stream? **Date of Record:** 2026 November 25 **Scope:** Applies to A2A v1.0 task lifecycles where a client agent resumes a `tasks/get` or `tasks/subscribe` stream against a peer that has restarted and re-advertised its Agent Card with a changed artifact schema or `artifact.mimeType`/`version` hint. Does not cover initial task submission negotiation or purely synchronous single-request exchanges. ## Core Distinction The failure is not a protocol error. A2A v1.0's task lifecycle is designed so that a restarted peer can re-serve a task in a non-terminal state (`working`, `input-required`) and the client can continue. The Agent Card is the only cross-vendor contract surface, and it is re-fetched opportunistically — not pinned to the task. The non-obvious boundary is that **the task's artifact contract is bound at task creation time, but the peer's Agent Card is bound at fetch time**. When a peer restarts between two `tasks/get` polls, the client may receive artifacts produced under a new card (new `skills[].artifacts` schema, new `defaultInputModes`/`defaultOutputModes`, or a bumped `protocolVersion`-adjacent capability flag) while its own parser is still keyed to the card it saw at submission. The divergence is *silent* because A2A's artifact envelope carries `artifactId`, `name`, and `parts[]` but does **not** carry a per-artifact schema version or a hash of the card that produced it. The client's JSON/schema validator sees a structurally valid artifact and accepts it. Continuity is broken at the semantic layer, not the transport layer. ## What Was Observed A client agent submitted a `message/send` to a vendor peer, receiving `task.id = t-7f3a`, state `working`, and a first artifact `art-1` whose `parts[0]` was `{"type":"data","data":{"rows":[...],"schema":"v2"}}`. The client cached the peer's Agent Card (`card_A`) at submission and keyed its downstream reducer to `schema: "v2"`. The peer restarted at T+41s (rolling deploy). On the next `tasks/get` poll, the client received state `working` with a *replacement* artifact `art-2` (same `name`, new `artifactId`) whose payload was `{"rows":[...],"schema":"v3"}` — because the peer's post-restart card `card_B` advertised `skills[0].artifacts[0].schema: "v3"` and the peer's artifact generator now emitted v3. The client's reducer, keyed to v2, did the following: 1. Matched `art-2` by `name` to the cached `art-1` slot (A2A allows artifact replacement by `name`). 2. Applied the v2 field-mapping (`rows[i].col_a`), which under v3 is `rows[i].columns.a`. 3. Produced a *structurally valid but semantically empty* merge: every mapped field was `None`, and the reducer's `Optional` typing swallowed it. 4. The task proceeded to `completed` with a downstream artifact that passed schema validation and was emitted to the user as a successful result containing zero populated rows. The trace showed no error, no retry, no non-2xx status. The only signal was a downstream `KeyError` three hops later in an unrelated tool, which was misattributed. ## Condition of Validity This divergence is only observable (and only matters) when all of the following hold simultaneously: - The task is **non-terminal** across the peer restart (`working`/`input-required`), so A2A mandates the peer re-serve it rather than fail it. - The peer's post-restart Agent Card differs from the pre-restart card in a field that **affects artifact interpretation**: `skills[].artifacts[].schema`, `defaultOutputModes`, a `parts[].type` preference, or a capability flag gating structured vs. text output. - The client's artifact handling is **keyed to a cached card** rather than re-validating against the card returned alongside the task, and the artifact envelope lacks a per-artifact schema discriminator (which A2A v1.0 does not require). - The peer replaces artifacts **by `name`** rather than emitting a new `name`, so the client's slot-matching logic treats v3 as an update to v2. If the client re-fetches and re-validates the card on every `tasks/get`, or if the peer emits artifacts under a new `name` on schema change, the divergence surfaces as a loud mismatch instead of a silent one. The failure is therefore a property of *cache-key choice*, not of A2A itself. ## Decision Boundary The invariant that must be enforced is: **an artifact may only be interpreted by the card that was current at the moment the artifact was produced, and the client must be able to prove which card that was.** A2A v1.0 does not carry this proof, so the client must synthesize it. The operational boundary is: - **Accept** a resumed artifact if its `artifactId` is unchanged from a previously seen artifact, or if the peer's current card is byte-identical (canonicalized) to the card cached at submission. - **Reject and re-negotiate** if the current card's artifact-affecting fields differ from the cached card *and* the artifact is a replacement (same `name`, new `artifactId`). Re-negotiation means: issue a fresh `message/send` for the remaining work rather than trusting the resumed stream, or downgrade to `input-required` and ask the peer to re-emit under a pinned schema. - **Never** silently re-key a reducer to a new schema mid-task. A schema change is a task-boundary event, not a stream-continuation event. The guardrail is a **card-fingerprint pin**: at submission, compute a canonical hash over the artifact-affecting subset of the peer card (`skills[].artifacts`, `defaultOutputModes`, `capabilities`). On every resumed artifact, recompute the peer's current fingerprint and compare. On mismatch, halt the stream and escalate — do not parse. ## Operational Effect Without the pin, the failure mode is a **silent semantic null**: artifacts that are schema-valid, transport-clean, and wrong. It is worse than a crash because it propagates. The downstream agent receives a `completed` task with an artifact whose fields are present-but-empty, treats emptiness as a legitimate business state ("no rows matched"), and continues. The error surfaces only when a later tool asserts on a field that should have been populated, at which point the causal chain back to the peer restart is unrecoverable from logs — the restart is 40+ seconds and several hops upstream. With the pin, the client converts a silent divergence into a **loud task-boundary event**: the resumed stream is rejected at the artifact, the task is re-driven from the last verified checkpoint under the new card, and the artifact reducer is re-initialized against the new schema with an explicit migration assertion. The cost is one re-execution of the remaining work; the benefit is that no artifact is ever interpreted under a card that did not produce it. The invariant to carry forward: **pin the card, fingerprint the artifact-affecting surface, and treat any fingerprint change mid-task as a renegotiation, not a continuation.** ```python import hashlib import json from dataclasses import dataclass class ArtifactCardDivergence(RuntimeError): """Raised when a resumed A2A artifact is served under a card that differs from the card pinned at task submission, in an artifact-affecting field.""" @dataclass(frozen=True) class PinnedCard: task_id: str fingerprint: str def _artifact_affecting_subset(card: dict) -> dict: # Only the fields that change how artifact parts must be parsed. return { "skills": [ { "id": s.get("id"), "artifacts": s.get("artifacts", []), "inputModes": s.get("inputModes", []), "outputModes": s.get("outputModes", []), } for s in card.get("skills", []) ], "defaultInputModes": card.get("defaultInputModes", []), "defaultOutputModes": card.get("defaultOutputModes", []), "capabilities": card.get("capabilities", {}), } def fingerprint_card(card: dict) -> str: canonical = json.dumps( _artifact_affecting_subset(card), sort_keys=True, separators=(",", ":"), ).encode("utf-8") return hashlib.sha256(canonical).hexdigest() def pin_card_on_submit(task_id: str, card: dict) -> PinnedCard: return PinnedCard(task_id=task_id, fingerprint=fingerprint_card(card)) def verify_resumed_artifact( pinned: PinnedCard, current_card: dict, artifact: dict, previously_seen_artifact_ids: set[str], ) -> None: current_fp = fingerprint_card(current_card) artifact_id = artifact.get("artifactId") # Unchanged artifact identity: safe to accept regardless of card drift. if artifact_id in previously_seen_artifact_ids: return # New artifact under a drifted card: this is a replacement, not a continuation. if current_fp != pinned.fingerprint: raise ArtifactCardDivergence( f"task {pinned.task_id}: resumed artifact {artifact_id!r} " f"(name={artifact.get('name')!r}) served under card fingerprint " f"{current_fp[:12]} but task was pinned to {pinned.fingerprint[:12]}. " f"Refusing to interpret; renegotiate the task boundary." ) ```