# In what scenarios must an instance refuse an A2A task acceptance when the remote agent card's declared `taskState` transition graph is acyclic but the local artifact schema requires a terminal `input-required` re-entry **Date of Record:** 2026 November 29 **Scope:** Applies to A2A v1.0 (`/.well-known/agent.json` discovery, `tasks/send` / `tasks/sendSubscribe` lifecycle, and `Artifact` payload exchange) when a client instance accepts work whose output schema depends on a mid-task clarification round-trip. Does not apply to fire-and-forget `tasks/send` calls with no `input-required` transition, nor to A2A 0.x where `taskState` was a flat enum without declared transition edges. ## Core Distinction The A2A v1.0 agent card advertises a `capabilities.stateTransitions` graph: a set of directed edges over the task lifecycle states `submitted → working → {input-required, completed, failed, canceled}`. Most client implementations validate this graph only for *reachability* — "can the task ever reach `completed`?" — and accept the task if the answer is yes. The distinction that matters is **re-entry multiplicity**, not reachability. A task whose artifact schema requires a clarification round-trip needs the transition `input-required → working` to be traversable *more than once*, because each clarification may surface a new ambiguity in the artifact. An acyclic card graph (each state visited at most once, `input-required` appearing as a single sink-then-source hop) is *reachable* but not *re-entrant*. Accepting work against an acyclic card when the local artifact validator can demand a second `input-required` produces a task that the remote server will refuse to transition back into `working`, stranding the client in a state it cannot legally leave. Reachability is a graph property. Re-entrancy is a *multiplicity* property. A2A v1.0 cards do not declare edge multiplicities, so the client must infer re-entrancy from the artifact schema and refuse acceptance when the inference fails. ## What Was Observed A document-extraction client (call it `extractor`) discovered a remote `ocr-service` via `/.well-known/agent.json`. The card declared: ``` capabilities.stateTransitions = [ submitted -> working, working -> input-required, input-required -> working, # single edge, no self-loop declared working -> completed, working -> failed ] ``` The graph is acyclic in the sense that no state is reachable from itself via a non-empty path *except* through `working → input-required → working`, which the client's validator collapsed as a single hop because it deduplicated edges by `(source, target)` pair. The client accepted a batch of 40 invoices whose artifact schema (`extractor.invoice.v3`) required a `vendor_tax_id` field that the OCR output frequently omitted, triggering an `input-required` clarification asking the user to supply the missing ID. The first 12 tasks completed cleanly. On task 13, the OCR output omitted *both* `vendor_tax_id` and `purchase_order_ref`. The extractor emitted `input-required` with a clarification request for the tax ID. The user supplied it. The extractor transitioned `input-required → working`, ran the schema validator again, and found `purchase_order_ref` still missing — a *second* clarification was required. The extractor emitted a second `input-required` transition. The remote `ocr-service` rejected the transition with `InvalidTransition: input-required -> input-required not in declared graph`, returned the task to `failed`, and — critically — discarded the partial artifact, including the tax ID the user had just supplied. Tasks 14 through 40 hit the same wall at varying points. Of 28 remaining tasks, 19 failed on second-clarification, and 9 of those had already consumed a user clarification turn whose input was lost. The root cause was not a bug in either implementation. Both were spec-conformant. The card's transition graph was a valid acyclic DAG; the extractor's artifact schema legitimately required up to N clarification rounds. The failure is at the *interface*: A2A v1.0 provides no field on the agent card to declare "this server permits k re-entries into `input-required`," and no field on the artifact schema to declare "this artifact requires up to k clarification rounds." The client must reconcile these two undeclared multiplicities itself, and the default reconciliation — assume one round — is wrong whenever the artifact schema has more than one independently-optional required field. ## Condition of Validity The refusal rule is valid under the following conjunction: 1. The remote card's `stateTransitions` contains the edge `input-required → working` at most once and declares no self-loop `input-required → input-required`. 2. The local artifact schema contains **two or more** fields that are each independently `required` but independently `nullable-at-first-pass` — i.e., the validator can raise `MissingField` for field A, accept a clarification, then raise `MissingField` for field B on the same artifact. 3. The client's clarification strategy is *sequential* (one `input-required` per missing field) rather than *batched* (all missing fields in a single clarification). If (2) is false — the schema has at most one nullable-required field — a single re-entry suffices and the acyclic card is safe to accept. If (3) is false — the client batches all missing fields into one clarification — a single re-entry also suffices, *provided* the user's single response resolves all fields, which is itself unverified and must be re-validated. The dangerous case is exactly (1) ∧ (2) ∧ (3): sequential clarification against a single-re-entry card. The rule does **not** hold when the card declares a self-loop on `input-required` or a cardinality annotation (`"input-required": {"maxReentries": 3}` in A2A v1.0 extension fields). In that case the client may accept and must instead bound its own clarification count against the declared `maxReentries`. ## Decision Boundary The client must compute, at discovery time, the **clarification budget** `B` of the remote card and the **clarification demand** `D` of the local artifact schema, and refuse acceptance when `D > B`. - `B` = 1 if the card declares `input-required → working` with no self-loop and no `maxReentries` annotation; `B` = `maxReentries` if annotated; `B` = ∞ if a self-loop is declared. - `D` = the count of independently-nullable required fields in the artifact schema, **if** the clarification strategy is sequential; `D` = 1 if batched (but see the re-validation caveat below). The boundary is sharp at `D = B + 1`. A schema with two nullable-required fields (`D = 2`) against a single-re-entry card (`B = 1`) must be refused at acceptance time, not discovered at the second clarification. The refusal must happen *before* `tasks/send`, because after `tasks/send` the client has already committed a task ID and any partial artifact is subject to the remote's discard-on-failure policy. The batched strategy (`D = 1`) is not a free pass: batching assumes the user resolves all missing fields in one turn, which is unverified. The client must re-run the full schema validator after the single re-entry and, if it still fails, transition to `failed` locally *without* emitting a second `input-required` — because the card forbids it. This converts a silent strand into an explicit, logged failure, which is the correct behavior but still loses the task. Batching reduces `D` but does not eliminate the refusal obligation when the schema has more than one nullable-required field *and* the user's single response is not guaranteed complete. ## Operational Effect The refusal at acceptance time has three downstream effects that must be planned for: **Batch fragmentation.** A batch of 40 tasks against a `B = 1` card with a `D = 2` schema will refuse all 40 at discovery. The client must not fall back to sequential clarification against the same card — that reproduces the failure. The correct fallback is to either (a) re-discover an alternate agent card with `B ≥ 2`, or (b) downgrade the artifact schema to a `D = 1` variant (batch all nullable-required fields into a single clarification and accept the unverified-completeness risk), or (c) split the schema so each task carries at most one nullable-required field, multiplying the task count by `D`. **Lost-clarification accounting.** When the failure does occur (because the refusal was not implemented, or the card was mis-parsed), the client must treat every `input-required` turn whose subsequent transition was rejected as a *consumed user turn with no artifact effect*. In the observed incident, 9 user clarifications were consumed and discarded. The client must log these against the user's clarification budget — a user who has supplied 9 tax IDs and received 9 failures will not supply a 10th. The operational invariant is: **a clarification turn is only durable if the remote acknowledges the subsequent `working` transition.** The client must not mark a clarification as "resolved" on emission; only on acknowledgment. **Card caching invalidation.** The clarification budget `B` is a property of the *card*, and cards are cached by discovery URL. If the remote `ocr-service` later updates its card to declare `maxReentries: 3`, the client's cached `B = 1` will continue to refuse tasks that are now acceptable. The cache TTL must be tied to the card's `etag` or `lastModified`, and the refusal decision must be recomputed on every cache miss — not memoized against the artifact schema alone, because the schema's `D` is stable but the card's `B` is not. The guardrail is a pre-flight check that runs before `tasks/send` and raises a typed refusal when `D > B`, carrying both values so the operator can see which side to change. ```python from dataclasses import dataclass from typing import Optional class ClarificationBudgetExceeded(RuntimeError): """Raised when the local artifact schema demands more clarification rounds than the remote A2A agent card permits via its declared state transitions.""" pass @dataclass class AgentCard: state_transitions: list[tuple[str, str]] max_reentries: Optional[int] = None # extension field, A2A v1.0 @dataclass class ArtifactSchema: nullable_required_fields: list[str] batched_clarification: bool = False def compute_clarification_budget(card: AgentCard) -> float: has_self_loop = ("input-required", "input-required") in card.state_transitions if has_self_loop: return float("inf") if card.max_reentries is not None: return card.max_reentries # single edge input-required -> working, no annotation if ("input-required", "working") in card.state_transitions: return 1 return 0 def compute_clarification_demand(schema: ArtifactSchema) -> int: if schema.batched_clarification: # batching collapses to one round, but completeness is unverified return 1 return len(schema.nullable_required_fields) def preflight_accept(card: AgentCard, schema: ArtifactSchema) -> None: budget = compute_clarification_budget(card) demand = compute_clarification_demand(schema) if demand > budget: raise ClarificationBudgetExceeded( f"refusing tasks/send: artifact schema demands {demand} clarification " f"round(s) (fields={schema.nullable_required_fields}, " f"batched={schema.batched_clarification}) but remote card permits " f"only {budget} re-entry into 'input-required'. Accepting would strand " f"the task after the {int(budget) + 1}th missing-field discovery, " f"discarding any prior user clarification." ) ``` The invariant this encodes: **acceptance is legal only when the artifact schema's clarification demand is bounded by the card's declared re-entry budget.** An acyclic card is not a guarantee of single-round sufficiency; it is a declaration that re-entry is limited, and the client must reconcile that limit against its own schema before committing a task ID.