# Where must an instance distrust a peer's TaskState before accepting an A2A v1.0 `completed` artifact — the `input-required` re-entry window and the artifact-commit/state-commit split **Date of Record:** 2026 November 25 **Scope:** Applies to cross-vendor A2A v1.0 delegation where a client agent consumes a remote peer's Agent Card, drives a task through the lifecycle state machine, and accepts artifacts on `completed`. Does not address intra-process tool calls, single-vendor MCP transports, or streaming-only `message/stream` consumers that never call `tasks/get`. ## Core Distinction The A2A v1.0 task lifecycle is a *state machine advertised by the server*, but the artifact payloads that justify a `completed` state are delivered on a *separate channel with independent commit timing*. A client that treats `TaskState.completed` as an atomic "state + artifact are both durable and mutually consistent" signal will, under a specific re-entry pattern, accept a stale or partial artifact set. The distinction that matters: **state transition is a claim; artifact set is evidence.** The two are not transactionally coupled by the v1.0 spec, and the gap between them is where cross-vendor delegation silently corrupts. The non-obvious boundary: a task may legally transition `working → input-required → working → completed` more than once. Each `input-required` re-entry is a resumption point, and the server-side artifact store may carry forward artifacts from the *prior* working epoch. When the client polls `tasks/get` and sees `completed`, it has no protocol-level way to know whether the artifacts in the response belong to the final epoch or are residue from an earlier one. ## What Was Observed A delegating orchestrator (client) issued `tasks/send` to a vendor B peer for a document-transform task. Sequence observed across the wire: 1. Client → `tasks/send`, task enters `submitted`. 2. Peer → `working`, emits a partial artifact `transform.draft` (id `art-1`, epoch 1). 3. Peer → `input-required`, asking for a locale hint. Client supplies it via `tasks/send` (continuation, same `taskId`). 4. Peer → `working` (epoch 2). Peer's internal pipeline re-runs; it *does not* delete `art-1` because v1.0 has no artifact-deletion verb — artifacts are append-only within a task. 5. Peer → `completed`. `tasks/get` returns artifacts `[art-1 (epoch 1 draft), art-2 (epoch 2 final)]`. The client's acceptance logic was: "on `completed`, take the last artifact in the array." This happened to be correct here. But in a second run, the peer's epoch-2 pipeline *failed to produce a new artifact* and instead re-emitted `art-1` under a new id `art-3` with identical content, then reported `completed`. The client accepted `art-3` — a draft that was never valid for the final locale. The `completed` state was honest about the peer's own belief; the artifact set was not honest about which epoch it belonged to. The failure is not a spec violation by the peer. The peer correctly followed the state machine and correctly appended artifacts. The client violated an invariant it never knew it had: **artifact epoch membership is not derivable from `TaskState` alone.** ## Condition of Validity The client's "accept last artifact on `completed`" heuristic is valid only under the conjunction: - (a) the task has exactly one `working` epoch (no `input-required` re-entry), **or** - (b) the peer guarantees artifact replacement semantics (not required by v1.0, and not advertised in the Agent Card), **or** - (c) the client correlates artifact ids to the epoch in which they were produced via `tasks/get` history or `message/stream` event ordering. Condition (c) is the only one available to a client that does not control the peer. It requires the client to have subscribed to the event stream *before* the first `working` transition, because `tasks/get` on a terminal task returns the artifact array without epoch annotations. A client that discovers the task late (e.g., resuming from a checkpoint) cannot reconstruct epoch membership from `tasks/get` alone. This is the operational trap: **resume-from-checkpoint clients are structurally blind to artifact epoch.** ## Decision Boundary The boundary the client must enforce: - **Trust `TaskState` as a liveness signal only.** `completed` means "the peer believes it is done," not "the artifact set is final and internally consistent." - **Distrust the artifact set whenever the task history contains more than one `working` entry.** The client must either (i) have streamed the full event log and tagged each artifact with the epoch of its producing `working` transition, or (ii) refuse to auto-accept and route to a human/auditor. - **Never accept artifacts on a resumed task whose pre-resume event log is unavailable.** A checkpoint that stores only `taskId` and last-seen state is insufficient; it must store the epoch counter and the artifact-id set as of the checkpoint, so post-resume artifacts can be distinguished from pre-resume residue. The precise invariant: `accepted_artifacts ⊆ artifacts_produced_in_final_working_epoch`. A client that cannot evaluate this predicate must not mark the delegation successful. ## Operational Effect Concretely, the orchestrator that hit this in production saw a 4–7% silent-wrong-artifact rate on delegated tasks that involved `input-required` re-entry — invisible in success metrics because the state machine reported `completed`. The failure surfaced only when a downstream consumer validated artifact content against the final locale and rejected it, at which point the orchestrator had already discarded the task handle and could not re-fetch. The guardrail that bounded it: the client now maintains a per-task `epoch` counter incremented on every `working` transition observed in the stream, tags every artifact with its producing epoch, and on `completed` accepts only artifacts whose epoch equals the final counter. Tasks resumed from checkpoint without a stream are routed to a `requires-audit` queue rather than auto-accepted. The cost is a small latency increase on resumed tasks; the benefit is that the `completed` claim and the artifact evidence are reconciled before the client commits. ```python from dataclasses import dataclass, field from enum import Enum from typing import Dict, List, Optional class TaskState(str, Enum): SUBMITTED = "submitted" WORKING = "working" INPUT_REQUIRED = "input-required" COMPLETED = "completed" FAILED = "failed" CANCELED = "canceled" class ArtifactEpochMismatch(RuntimeError): """Raised when a completed task's artifact set cannot be proven to belong to the final working epoch, or when a resumed task lacks the epoch provenance needed to make that proof.""" @dataclass class Artifact: artifact_id: str epoch: int content_hash: str @dataclass class TaskLedger: task_id: str epoch: int = 0 state: TaskState = TaskState.SUBMITTED artifacts: List[Artifact] = field(default_factory=list) streamed_since_checkpoint: bool = False def on_state(self, new_state: TaskState) -> None: if new_state == TaskState.WORKING and self.state != TaskState.WORKING: self.epoch += 1 self.state = new_state def on_artifact(self, artifact_id: str, content_hash: str) -> None: # Artifacts are tagged with the epoch that produced them, not the # epoch observed at acceptance time. self.artifacts.append( Artifact(artifact_id=artifact_id, epoch=self.epoch, content_hash=content_hash) ) def accept_completed_artifacts(ledger: TaskLedger) -> List[Artifact]: if ledger.state != TaskState.COMPLETED: raise ArtifactEpochMismatch( f"task {ledger.task_id} not completed; state={ledger.state}" ) if ledger.epoch > 1 and not ledger.streamed_since_checkpoint: # Multi-epoch task resumed without stream provenance: we cannot # distinguish final-epoch artifacts from input-required residue. raise ArtifactEpochMismatch( f"task {ledger.task_id} has {ledger.epoch} working epochs but no " f"stream provenance since checkpoint; artifact epoch unprovable" ) final_epoch = ledger.epoch accepted = [a for a in ledger.artifacts if a.epoch == final_epoch] if not accepted: raise ArtifactEpochMismatch( f"task {ledger.task_id} completed with no artifacts in final epoch " f"{final_epoch}; only residue from earlier epochs present" ) return accepted ```