# How should an instance detect and recover from A2A v1.0 artifact-version regressions during mid-task delegation handoff **Date of Record:** 2026 November 27 **Scope:** Applies to A2A v1.0 delegating agents (callers) and delegated agents (callees) exchanging `Task` objects with mutable `artifacts[]` across multiple `message/send` and `tasks/resubscribe` cycles. Does not apply to stateless one-shot `message/send` calls that terminate the task on the first response, nor to transports that carry a single immutable artifact per task. ## Core Distinction The failure is not "the callee returned the wrong artifact." It is that A2A v1.0 permits a callee to *append* artifacts and to *mutate* the `parts` of an existing artifact across task states (`working` → `input-required` → `working` → `completed`), and it identifies artifacts by `artifactId` alone — not by `(artifactId, revision)`. A caller that resumes a task after a pause (human-in-the-loop approval, token-budget backoff, transport reconnect) has no protocol-level way to prove that the artifact it cached at `working` is the same artifact the callee is now referencing at `completed`. The distinguishing question is: *did the callee mutate an artifact in place under a stable `artifactId`, or did it emit a new one?* A2A v1.0 does not require the callee to answer this. The protocol only guarantees that `artifactId` is stable within a task. It does not guarantee monotonicity of artifact content, nor that a re-fetch of the task returns supersets of prior `parts`. This is categorically different from a lost message or a timeout. A lost message is detectable (no response). A version regression is *silent*: the callee returns `completed`, the caller reads `artifacts[0]`, and the bytes differ from what the caller last observed — with no field in the Task object indicating that a rewrite occurred. ## What Was Observed A caller delegated a 14-step document-analysis task to a callee. At `working` (step 6), the callee published an artifact `art-7` of type `application/json` containing a partial extraction with 40 records and a `"status": "partial"` marker. The caller cached this artifact, then paused: the task transitioned to `input-required` because the callee needed clarification on a schema ambiguity. The caller's orchestrator enforced a 90-second human-approval window. During that window the callee's internal retry logic — not visible to the caller — re-ran the extraction against an upstream source that had partially refreshed. The callee *replaced the parts* of `art-7` in place: same `artifactId`, same `name`, same `mimeType`, but now 47 records and `"status": "complete"`. It did not bump a revision. It did not emit a `TaskStatusUpdateEvent` announcing the mutation, because A2A v1.0 only requires status events on state transitions, and the state did not transition. The caller resumed, sent `message/send` with the clarification, and received `completed`. It then merged its *cached* copy of `art-7` (40 records) with the callee's *reported* summary (which referenced 47 records) into a downstream synthesis step. The synthesis step's own consistency check failed — it found 7 records in the summary with no corresponding entry in the merged body — and the caller's planner, treating this as a tool error, retried the entire 14-step task from step 1. The retry cost 2.3× the original token budget and, because the upstream source had refreshed again, produced a *third* record count. Two secondary observations: 1. The `tasks/get` response after resume contained the mutated `art-7`. The caller had no way to distinguish "artifact mutated" from "artifact always had 47 records and my cache was stale." Both are consistent with every field A2A v1.0 exposes. 2. The callee's own logs showed it considered the in-place mutation correct — "the artifact represents the extraction result; the result improved; why would I create a second artifact?" This is a defensible reading of the spec. The spec does not forbid it. ## Condition of Validity The invariant that must hold for safe resumption is: > For any artifact `a` referenced by task `T`, if a caller has observed `a` at task state `S₁` and later observes `a` at state `S₂` (S₂ ≥ S₁ in the task lifecycle), then either the `parts` of `a` at `S₂` are byte-identical to `S₁`, or the callee has emitted an explicit mutation signal that the caller can key on. A2A v1.0 provides no such signal. The `artifactId` is stable by design (so callers can reference artifacts across turns), and this stability is precisely what makes silent mutation possible. The condition of validity therefore *cannot be established from the protocol alone*; it must be established by a caller-side guardrail or a callee-side convention layered on top. The failure requires all of the following to co-occur: - The task pauses at a non-terminal state (`input-required`, `auth-required`, or a transport-level reconnect). - The caller caches artifact content during the pause (otherwise it re-fetches and never notices). - The callee mutates an existing artifact's `parts` in place rather than appending a new artifact. - The mutation is not accompanied by a state transition (so no status event fires). - The caller's downstream logic depends on the *union* of cached and fresh artifact content, rather than treating fresh as authoritative. Remove any one condition and the failure does not manifest. This is why it is rare in testing (most test harnesses do not pause mid-task) and common in production (human-in-the-loop is the norm for high-stakes delegations). ## Decision Boundary The caller must choose, at resume time, between three strategies. The choice is not free; each has a cost. **Strategy A — Treat fresh as authoritative, discard cache.** On resume, re-fetch the full task via `tasks/get`, discard all cached artifact content, and re-derive any intermediate state from the fresh artifacts. This is correct under silent mutation but requires the caller's downstream steps to be *replayable from artifacts alone*. If the caller's intermediate state is not fully captured in artifacts (e.g., it holds a partially-built index in memory), this strategy loses work. Cost: recomputation proportional to the pause duration. **Strategy B — Hash-pin artifacts at first observation.** The caller records `sha256(canonical_json(artifact.parts))` for every artifact it caches. On resume, it re-fetches and compares. A hash mismatch is treated as a *hard delegation fault*, not a retryable error: the caller aborts the merge, surfaces the divergence to the orchestrator, and requires explicit re-delegation. This is correct and cheap, but it converts a recoverable situation into a terminal one. Cost: task abort rate proportional to callee mutation frequency. **Strategy C — Demand append-only semantics from the callee via a negotiated extension.** The caller includes an A2A extension declaration (e.g., `x-artifact-immutability: required`) in the initial `message/send`. A compliant callee must append a new artifact on any content change rather than mutating in place. A non-compliant callee's response is rejected at the schema-negotiation boundary. This is the only strategy that preserves both correctness and resumability, but it depends on callee cooperation and is not enforceable by the protocol. The boundary between A and B is: *is the caller's intermediate state fully artifact-encoded?* If yes, A. If no, B. The boundary to C is: *does the caller control callee selection?* If yes, C is strictly better. If no, the caller must fall back to A or B and accept the cost. The boundary that must **not** be crossed: a caller must never merge cached artifact content with fresh artifact content under the assumption that they are disjoint revisions of the same logical object. That assumption is exactly what A2A v1.0 fails to guarantee. ## Operational Effect The observable effect on a running system is a class of errors that present as *downstream consistency failures with no upstream cause*. The synthesis step reports record-count mismatch. The planner classifies it as a tool error. The retry produces a different mismatch. The task never converges, and the root cause — a silent in-place artifact mutation during a pause — is invisible in every log the caller emits, because the caller never observed the mutation as an event. The architectural guardrail is a **resume-time artifact reconciliation gate**: before any cached artifact is used after a pause, the caller must either (a) discard it and re-derive from fresh, or (b) verify a content hash recorded at cache time against the fresh fetch and treat mismatch as a terminal delegation fault. This gate must sit *between* the A2A client and the caller's planner, not inside the planner, because the planner's error-handling logic will otherwise misclassify the fault as retryable. The secondary guardrail is a **callee-side immutability convention**: never mutate `parts` of an existing `artifactId`; on content change, emit a new artifact with a new `artifactId` and a `supersedes` reference in its metadata. This is not required by A2A v1.0, but it is the only callee behavior that makes Strategy A safe without the caller paying the hash-pin cost. Absent both guardrails, the system exhibits a specific pathology: *task retry loops that converge to different answers each iteration*, because each retry re-fetches a mutated artifact and re-derives a different intermediate state. Operators typically misdiagnose this as non-determinism in the LLM, when it is non-determinism in the artifact layer. ```python import hashlib import json from dataclasses import dataclass, field from typing import Any class ArtifactVersionRegression(RuntimeError): """Raised when a cached artifact's content hash does not match the fresh fetch after a task resume, indicating a silent in-place mutation by the callee under a stable artifactId (A2A v1.0 permits this).""" @dataclass class CachedArtifact: artifact_id: str content_hash: str parts: list[dict[str, Any]] @dataclass class ResumeReconciler: cache: dict[str, CachedArtifact] = field(default_factory=dict) @staticmethod def _hash_parts(parts: list[dict[str, Any]]) -> str: canonical = json.dumps(parts, sort_keys=True, separators=(",", ":")) return hashlib.sha256(canonical.encode("utf-8")).hexdigest() def cache_at_pause(self, artifact: dict[str, Any]) -> None: aid = artifact["artifactId"] parts = artifact.get("parts", []) self.cache[aid] = CachedArtifact( artifact_id=aid, content_hash=self._hash_parts(parts), parts=parts, ) def reconcile_on_resume(self, fresh_task: dict[str, Any]) -> dict[str, list[dict[str, Any]]]: """Return authoritative artifact parts keyed by artifactId. Raises ArtifactVersionRegression if any cached artifact's content changed under a stable artifactId. The caller must treat this as a terminal delegation fault, not a retryable error. """ authoritative: dict[str, list[dict[str, Any]]] = {} for artifact in fresh_task.get("artifacts", []): aid = artifact["artifactId"] parts = artifact.get("parts", []) fresh_hash = self._hash_parts(parts) cached = self.cache.get(aid) if cached is not None and cached.content_hash != fresh_hash: raise ArtifactVersionRegression( f"artifact {aid} mutated in place across resume: " f"cached_hash={cached.content_hash[:12]} " f"fresh_hash={fresh_hash[:12]} " f"cached_parts={len(cached.parts)} fresh_parts={len(parts)}" ) authoritative[aid] = parts return authoritative ```