# Where must an instance reject a peer's Agent Card when `supportedInterfaces[].protocolVersion` is a range expression rather than a pinned version — the A2A v1.0 discovery handshake and the silent task-lifecycle downgrade **Date of Record:** 2026 November 23 **Scope:** Applies to A2A v1.0 (and v1.0-compatible) client instances that resolve a remote Agent Card, negotiate a `supportedInterfaces` entry, and then drive a task through `submitted → working → input-required → completed/failed/canceled` while streaming `TaskArtifactUpdateEvent` frames. Does not apply to single-vendor deployments where both endpoints share a build hash, nor to pure request/response MCP tool calls that carry no task state machine. ## Core Distinction The Agent Card is not a capability document; it is a *contract proposal* whose `protocolVersion` field is frequently written by vendors as a semver range (`">=0.2 <1.1"`, `"^1.0"`, `"1.x"`) rather than a single pinned token. A2A v1.0's discovery spec says the client "SHOULD select a compatible interface," which most runtimes implement as *first interface whose version predicate the client's own version satisfies*. That is a set-intersection test, not an equality test. The boundary failure lives exactly here: a range in the card means the peer has declared that it can *speak* a family of dialects, but it has not declared *which dialect it will speak for this task*. The client's local task state machine is pinned to one dialect — specifically, the shape of `status` transitions and the presence/absence of the `final` flag on `TaskArtifactUpdateEvent`. When the peer picks the *lowest* version in its declared range (a common server-side default, because ranges are usually written to preserve backward compatibility), the two state machines diverge mid-task. The client keeps streaming artifacts under v1.0 semantics while the peer emits v0.2-style lifecycle frames that omit `final`, and the client's terminal-state predicate never fires. The task hangs in `working` until timeout, then is marked `failed` by the client *after* the peer has already committed the artifacts — a split-brain completion. ## What Was Observed A cross-vendor run: client on A2A v1.0.0, peer advertising `supportedInterfaces: [{ url, protocolVersion: ">=0.2 <1.1", ... }]`. Discovery succeeded. The client's version-predicate check `satisfies("1.0.0", ">=0.2 <1.1")` returned true, so it selected that interface and began the task. Trace of the failure: 1. `POST /tasks` → peer returns `{ id, status: { state: "working" } }`. Consistent with both dialects. 2. Peer streams `TaskArtifactUpdateEvent` frames. Under v0.2 these frames carry no `final` boolean; the *absence* of an artifact-update after the last one, followed by a `status: completed`, is the terminal signal. Under v1.0 the client's reducer requires `final: true` on the last artifact frame *or* a `completed` status frame — and it treats a `completed` status arriving without a preceding `final` artifact as a **truncation**, not a completion (a guard added to catch dropped frames on flaky transports). 3. The peer sends `status: completed`. The client's guard fires: "artifact stream ended without final marker — possible truncation." It does **not** transition to `completed`. It waits for the missing `final` frame. 4. No further frames arrive. At the client's `artifactStreamIdleTimeout` (default 30s in the reference SDK), the task is transitioned to `failed` with reason `artifact_stream_truncated`. 5. The peer, meanwhile, considers the task `completed` and has persisted the artifact. A subsequent `GET /tasks/{id}` from the client returns `completed` — contradicting the client's local `failed`. The two instances now hold divergent terminal states for the same task ID. The non-obvious part: the version predicate passed. Nothing in discovery flagged a mismatch. The divergence was produced *by the successful negotiation* — the client selected an interface whose declared range admitted a dialect the client's reducer could not correctly terminate under. ## Condition of Validity The failure reproduces if and only if all four hold: - The peer's `protocolVersion` is a **range** (or a wildcard/`x` token), not a pinned version. Pinned versions cannot trigger this; the client either matches or rejects at discovery. - The peer's server-side interface selection resolves to a version **older** than the client's pinned dialect for the relevant *frame-shape* difference — here, the `final` flag on artifact updates introduced in v1.0. - The client's terminal-state reducer has a **negative guard** (a check that fires on *absence* of an expected marker) rather than a **positive guard** (a check that fires on *presence* of a terminal marker). Negative guards are what convert a dialect mismatch into a hang-then-fail rather than an immediate error. - The client's `artifactStreamIdleTimeout` exceeds the peer's inter-frame gap but is shorter than the peer's task-completion-to-connection-close latency, so the client times out *before* the transport closes cleanly and could have signaled EOF. If the client uses a positive terminal guard (`completed` status is sufficient to terminate regardless of `final`), the mismatch produces a *silent semantic* error (artifacts accepted under wrong dialect) but not a split-brain. If the timeout is longer than connection close, the EOF is observed and the client can reconcile. The specific split-brain requires the negative guard *and* the timeout ordering. ## Decision Boundary The invariant a client must enforce: **a range-valued `protocolVersion` in an Agent Card is not a negotiation result; it is an advertisement of the peer's flexibility. The client must pin the dialect for the task before the first frame, and must refuse to enter `working` if it cannot pin.** Concretely, the client must, at discovery time: - Reject (or downgrade to a *declared* fallback dialect it fully implements) any interface whose `protocolVersion` is not a single satisfiable token, *unless* the client can issue a `POST /tasks` with an explicit `protocolVersion` override and the peer's card declares `supportsVersionPinning: true` (or the v1.0 `interface.selection: "client-pinned"` hint). - If pinning is unavailable, the client must select the **highest** version in the peer's declared range that the client itself implements, and must configure its reducer for *that* dialect's frame shape — not for the client's native v1.0 shape. A v1.0 client talking to a peer that may answer in v0.2 must run a v0.2-compatible reducer for that task. - The terminal-state guard must be **positive-first**: a `completed` status frame is authoritative; a missing `final` flag is a *warning* (artifact may be truncated) but must not suppress the terminal transition. Truncation is detected by comparing artifact byte counts / chunk indices, not by the presence of a boolean that one dialect doesn't emit. The boundary is: the moment the client's local reducer dialect and the peer's *actual* response dialect are permitted to differ, the state machines are no longer composable, and any cross-instance invariant (task status agreement) is unenforceable. ## Operational Effect Downstream consequences observed in the run: - **Divergent terminal state.** Client holds `failed`, peer holds `completed`. Any auditor replaying the task from the client's log sees a failure; the peer's log shows success. Consensus between the two instances is broken by a *successful* protocol negotiation. - **Artifact orphaning.** The peer's persisted artifact is unreachable from the client's failed task record; a retry creates a *new* task ID and re-executes side effects (the peer does not dedupe across task IDs unless the client passes an idempotency key, which v0.2-dialect peers often ignore). - **Timeout amplification under load.** Because the failure manifests as idle-timeout rather than immediate error, a fleet of clients negotiating against a range-advertising peer will all hang for `artifactStreamIdleTimeout` per task, converting a per-task semantic bug into a fleet-wide latency cliff. - **Warrant/identity non-propagation.** The client's post-failure reconciliation attempt (`GET /tasks/{id}`) carries the client's original warrant; the peer, having already closed the task under v0.2 semantics, does not recognize the v1.0 warrant extension fields and returns a bare status. The reconciliation succeeds at the transport layer but fails to transfer the audit trail. The guardrail is a discovery-time **dialect pin** plus a **positive terminal predicate**. Without both, range-valued version advertisements are a latent split-brain generator, and the failure surfaces only under the specific timeout/guard ordering above — which is why it survives vendor integration tests that use pinned-version cards. ```python import re from dataclasses import dataclass class DialectMismatchError(RuntimeError): """Raised when a task cannot be pinned to a single frame dialect.""" pass class SplitBrainCompletionError(RuntimeError): """Raised when local terminal state contradicts peer terminal state.""" pass # Versions whose artifact-update frames carry a `final` boolean. FINAL_FLAG_VERSIONS = {(1, 0), (1, 1)} def _parse(v: str): m = re.fullmatch(r"(\d+)\.(\d+)(?:\.\d+)?", v.strip()) if not m: return None return (int(m.group(1)), int(m.group(2))) def _satisfies(client: tuple, expr: str) -> bool: # Minimal range check: ">=A = base if ".x" in expr: base = _parse(expr.replace(".x", ".0")) return base is not None and client[0] == base[0] if ">=" in expr and "<" in expr: lo = _parse(expr.split(">=")[1].split("<")[0]) hi = _parse(expr.split("<")[1]) return lo is not None and hi is not None and lo <= client < hi exact = _parse(expr) return exact == client def pin_dialect(client_version: str, card_interfaces: list[dict], client_implements: set[tuple]) -> tuple: """ Select a single dialect for the task. Refuse to proceed if the only satisfiable interfaces are range-valued and unpinnable. """ client = _parse(client_version) if client is None: raise DialectMismatchError(f"unparseable client version {client_version!r}") candidates = [] for iface in card_interfaces: expr = iface.get("protocolVersion", "") if _satisfies(client, expr): candidates.append((iface, expr)) if not candidates: raise DialectMismatchError("no interface satisfies client version") # Prefer an explicitly pinnable interface. for iface, expr in candidates: if iface.get("selection") == "client-pinned" and _parse(expr) in client_implements: return _parse(expr) # Otherwise, pick the highest dialect in the range that we implement, # and configure the reducer for THAT dialect, not our native one. best = None for iface, expr in candidates: for ver in client_implements: if _satisfies(ver, expr) and (best is None or ver > best): best = ver if best is None: raise DialectMismatchError( f"range {expr!r} admits no dialect this client implements" ) return best @dataclass class TaskReducer: dialect: tuple saw_final: bool = False terminal: str | None = None def on_artifact_update(self, frame: dict): if "final" in frame: self.saw_final = bool(frame["final"]) # v0.2 dialect: no `final` key; do not treat absence as truncation. def on_status(self, frame: dict): state = frame.get("status", {}).get("state") if state in ("completed", "failed", "canceled"): # Positive terminal predicate: status is authoritative. if self.dialect in FINAL_FLAG_VERSIONS and not self.saw_final: # Warning only; do not suppress terminal transition. frame.setdefault("warnings", []).append("no_final_marker") self.terminal = state def require_agreement(self, peer_status: str): if self.terminal is None: raise SplitBrainCompletionError("local task has no terminal state") if self.terminal != peer_status: raise SplitBrainCompletionError( f"local={self.terminal} peer={peer_status}: dialect divergence" ) ```