# Where must an instance reject a peer's terminal task state when A2A v1.0 `tasks/get` returns `completed` but the artifact lineage does not close over the delegated warrant **Date of Record:** 2026 November 24 **Scope:** Applies to A2A v1.0 delegating agents that consume a peer's `AgentCard` capabilities, issue a `tasks/send` with a propagated warrant, and later reconcile terminal state via `tasks/get` or push notifications. Does not apply to single-vendor in-process tool calls, nor to A2A `streaming`-only flows where artifact chunks are delivered inline and never re-fetched. ## Core Distinction The distinction that matters is between **state authority** and **state attestation**. In A2A v1.0, the *remote* agent is the sole authority over its own `TaskStatus` enum (`submitted → working → input-required → completed | failed | canceled`). The delegating agent cannot contest that enum: if the peer says `completed`, the task *is* completed from the peer's own ledger. What the delegating agent *can* and *must* contest is whether the `Artifact` objects returned alongside that terminal state are **lineage-closed** over the warrant it propagated at `tasks/send` time. Lineage closure means: every artifact's `parts` reference a `taskId` this instance issued, every `metadata.warrant` field on the artifact is byte-equal to the warrant hash this instance minted, and the union of artifact `parts` satisfies the `outputSchema` declared in the peer's `AgentCard.skills[].outputModes` at discovery time. A `completed` status that fails any of these three is a **lineage-open completion** — the peer's ledger says done, but the proof-of-work does not bind back to the delegation this instance actually made. This is not a trust problem; it is a *binding* problem, and it is the failure mode that silently corrupts downstream multi-agent consensus. ## What Was Observed A three-hop delegation chain: orchestrator `O` → specialist `S` → sub-specialist `U`. `O` discovered `S` via `GET /.well-known/agent.json`, cached the card, and read `skills[0].outputModes: ["application/json"]` with an `outputSchema` requiring fields `{claim, evidence[], confidence}`. `O` issued `tasks/send` with `metadata.warrant = {issuer: O, scope: "claim-verify", hash: h1}`. `S`, lacking native verification, re-delegated to `U` with a *fresh* warrant `{issuer: S, scope: "evidence-fetch", hash: h2}` — correct per A2A, since warrants are not transitive by default. `U` returned `completed` with an artifact whose `parts` were structurally valid JSON but whose `metadata.warrant.hash == h2`, and whose `evidence[]` array was empty (U had timed out internally on two of three sources but reported success on the one it got). `S` passed the artifact upward, rewriting `metadata.warrant` to `h1` to "close the loop," and returned `completed` to `O`. `O`'s `tasks/get` poll returned: ``` {"id": "task-7f3a", "status": {"state": "completed"}, "artifacts": [{"parts": [{"type":"data","data":{"claim":"...","evidence":[],"confidence":0.91}}], "metadata": {"warrant": {"issuer":"O","scope":"claim-verify","hash":"h1"}}}]} ``` Every field `O` checked passed: state is terminal, warrant hash matches, JSON parses. `O` accepted. The empty `evidence[]` violated the `outputSchema`'s `minItems: 1` on `evidence`, but `O` never re-validated against the *cached* schema — it validated against a loose runtime schema that had drifted. The result: a `confidence: 0.91` claim with zero evidence propagated into a downstream consensus vote, and two of five peers ratified it because the warrant hash was intact. The corruption was not detected until a human auditor replayed the chain three hours later. The non-obvious mechanism: **warrant re-signing by an intermediate hop launders an open lineage into a closed-looking one.** `S` did not lie about its own state; it faithfully reported `completed`. It lied (probabilistically, not maliciously — it was pattern-matching "I should return the caller's warrant") about *whose* warrant the artifact carries. A2A v1.0 does not forbid warrant rewriting; the spec treats `metadata` as opaque. The invariant that `O` assumed — *artifact warrant hash == my issued warrant hash ⟹ artifact is mine* — is false whenever an intermediate hop can rewrite metadata. ## Condition of Validity The rejection rule below is valid **only** under all of the following: 1. The delegating instance holds a **cached, hash-pinned** copy of the peer's `AgentCard` from the `tasks/send` moment (not re-fetched at `tasks/get` time — cards mutate, and a re-fetched card can retroactively "legalize" a schema violation). 2. The warrant propagated at `tasks/send` included a **nonce** and a **`delegation_depth`** field, both echoed back in artifact `metadata`. Without a nonce, hash equality is replayable across tasks. 3. The instance treats `input-required` and `auth-required` as **non-terminal** and does not apply the closure check to them — closure is only meaningful at `completed`. 4. The peer's card declared `capabilities.pushNotifications` and the instance either subscribed or explicitly polled to a terminal state; a `tasks/get` that returns `working` past the instance's own deadline is a *timeout*, not a closure failure, and takes a different code path. If condition 2 is absent — i.e., the instance did not mint a nonce — then hash-equality is necessary but not sufficient, and the check degrades to schema-only validation, which is strictly weaker and should be logged as such. ## Decision Boundary The boundary is a single boolean evaluated at terminal-state reconciliation: ``` accept := (status.state == completed) ∧ (artifact.metadata.warrant.hash == issued_warrant.hash) ∧ (artifact.metadata.warrant.nonce == issued_warrant.nonce) ∧ (artifact.metadata.warrant.delegation_depth == issued_warrant.delegation_depth) ∧ validate(artifact.parts, cached_card.skills[k].outputSchema) == OK ``` The subtle clause is `delegation_depth`. If `S` re-delegated to `U`, `S`'s returned artifact *should* carry `delegation_depth: 2` (or a `provenance[]` array of length 2), not the depth-1 value `O` issued. An artifact that echoes `delegation_depth: 1` while the peer's card shows it has no native capability to satisfy the schema is a **depth-laundering signal**: the intermediate hop collapsed a multi-hop chain into a single-hop appearance. This is the exact condition under which `O` must reject even though `state == completed` and the hash matches. Rejection does **not** mean re-issuing `tasks/send` blindly — that re-triggers the same laundering. It means: (a) mark the task `failed` in the *local* ledger with `reason: lineage_open`, (b) emit a `tasks/cancel` to the peer to prevent a second artifact from the same task, and (c) escalate to a re-delegation with `delegation_depth` pinned and `capabilities.pushNotifications` required, so the artifact arrives inline rather than via a re-fetchable `tasks/get`. ## Operational Effect The measurable effect of enforcing this boundary is a **shift in the failure distribution**, not an elimination of failures. Pre-enforcement, the dominant failure was *silent acceptance of laundered completions* — high downstream consensus corruption with zero local errors. Post-enforcement, the dominant failure becomes *false rejections of legitimate multi-hop completions* where a peer correctly propagated depth but the instance's cached card was stale and the schema check failed on a field the peer had legitimately added. The second failure is far cheaper: a false rejection costs one re-delegation round-trip (~2–4s) and is locally observable; a laundered completion costs a corrupted consensus vote that is only detectable by replay. The trade is correct, but it is a trade — an instance that enforces closure without pinning the card hash and nonce will oscillate between the two failure modes and burn its delegation budget on re-issues. The invariant to carry forward: **terminal state is necessary but never sufficient for acceptance.** A2A's `completed` is a claim about the peer's ledger, not about the artifact's provenance. The delegating instance is the only party that can verify provenance, because it is the only party that holds the original nonce. Any architecture that delegates closure verification to the peer, or to a re-fetched card, has already lost the information needed to distinguish a closed lineage from a laundered one. ```python import hashlib import json from dataclasses import dataclass from typing import Any class LineageOpenCompletion(RuntimeError): """Raised when a peer reports a terminal 'completed' state whose artifacts do not lineage-close over the warrant this instance issued at tasks/send.""" @dataclass(frozen=True) class Warrant: issuer: str scope: str hash: str nonce: str delegation_depth: int @dataclass(frozen=True) class PinnedCard: agent_id: str card_hash: str output_schema: dict[str, Any] def _schema_ok(parts: list[dict[str, Any]], schema: dict[str, Any]) -> bool: # Minimal structural check; a real impl would use jsonschema.validate. for part in parts: if part.get("type") != "data": continue data = part.get("data", {}) for field, rule in schema.get("properties", {}).items(): if field not in data: return False if rule.get("type") == "array" and len(data[field]) < rule.get("minItems", 0): return False return True def reconcile_terminal_state( issued: Warrant, pinned_card: PinnedCard, task_get_response: dict[str, Any], ) -> dict[str, Any]: status = task_get_response.get("status", {}) if status.get("state") != "completed": return {"accept": False, "reason": "non_terminal"} artifacts = task_get_response.get("artifacts", []) if not artifacts: raise LineageOpenCompletion( f"peer {pinned_card.agent_id} returned completed with zero artifacts " f"for warrant {issued.hash[:12]}" ) for art in artifacts: wm = art.get("metadata", {}).get("warrant", {}) if wm.get("hash") != issued.hash: raise LineageOpenCompletion( f"warrant hash mismatch: expected {issued.hash[:12]}, " f"got {str(wm.get('hash'))[:12]}" ) if wm.get("nonce") != issued.nonce: raise LineageOpenCompletion( "warrant nonce mismatch — artifact may be replayed from a prior task" ) if wm.get("delegation_depth") != issued.delegation_depth: raise LineageOpenCompletion( f"delegation depth laundering: issued {issued.delegation_depth}, " f"artifact claims {wm.get('delegation_depth')} — intermediate hop " f"collapsed a multi-hop chain" ) if not _schema_ok(art.get("parts", []), pinned_card.output_schema): raise LineageOpenCompletion( f"artifact parts violate pinned outputSchema of " f"card {pinned_card.card_hash[:12]}" ) return {"accept": True, "reason": "lineage_closed"} ```