Repository navigation
refactor: update ACTS test suite specifications to standardize error formats, include header inspection, and refine transport requirements - #2227
Open
JakubWorek wants to merge 4 commits into
Conversation
…formats, include header inspection, and refine transport requirements
This was referenced Sep 11, 2026
JakubWorek
added a commit
to a2aproject/a2a-itk
that referenced
this pull request
Sep 16, 2026
…condition (#67) ## Summary Takes the corpus from [A2A#2227](a2aproject/A2A#2227), where the defects this runner used to patch at load time have been fixed at source. With them fixed, `test_suite/acts/compat.py` has nothing left to do and is **deleted** — the corpus now loads 111 tests, 0 errors, strictly, with no rewriting. That removal is the point of the PR, and everything else follows from it: the schema catches up to what the corrected corpus needs, the runner gains the one precondition A2A actually supports for authentication, and two runner bugs that the cleaner corpus made visible are fixed. ## `compat.py` had stopped being a safety net Three of its four rules already fired zero times. The fourth, `expect-field-outside-body`, had started matching the corrected corpus's new `expect.headers` blocks and relocating them into `expect.body` — so the three header tests would have passed **without checking a header**, and blamed the SDK for nothing. A rewrite layer that silently reinterprets a fixed corpus is worse than no layer at all. Gone with it: the `compat=` parameter, `LoadedSuite.rewrites`, five package exports, `test_acts_compat.py`, and `wire_map`'s `aliases` mechanism — which existed only to accept `StreamingNotSupportedError` and `ExtendedCardNotSupportedError`, two error names A2A does not define and #2227 removes. ## Authentication: a precondition that can be met Five tests — `SEC-AUTH-001/002/003/004/006`, four MUST and one SHOULD — gated on `preconditions.capabilities.authentication`. `AgentCapabilities` has exactly four members and none of them is `authentication`, so those tests were **unrunnable against any agent on any binding**, and no SUT configuration could change that. They had been reporting as unsatisfiable since #64 added the diagnostic that caught them. A2A#2227 moves them to a top-level `preconditions.authentication`, read off the card's `securitySchemes` **and** `securityRequirements`, presence only. This adds the matching branch to `_unmet_precondition`, and the branch was proved to fail in both directions before the corpus was pointed at it — the lesson from `expect.headers`, which sat in the schema unread for a release. The precondition is not a way of letting an agent off: A2A conditions the server's obligation on *"its declared authentication requirements"*, so a rejection test genuinely does not apply to an agent that declares none. The one exception is `Get Extended Agent Card`, whose authentication A2A mandates unconditionally — which is why `SEC-EXTCARD-001/002/004` deliberately do not carry the gate. A corpus guard now fails if any test ever again gates on a capability `AgentCapabilities` does not define. That assertion would have caught this the day it was written. ## Reaching the auth tests: a second deviation `_rerun_capability_skips` becomes a **`Deviation` table** — `env_var`, `skip_pattern`, `log_name`, `took_effect` — with two rows. The reduced-capability pass from #64 is the first; an `ITK_ACTS_AUTH` pass is the second, and it is a table row rather than a second copy of fifty lines. The reasoning is the same shape as before. One agent cannot both require and not require a credential: an absent `Authorization` header means "reject me" in `SEC-AUTH-001` and "serve me" in `JSONRPC-ENV-001`, and no server can tell those two requests apart. Enforcing during the main pass costs **fourteen** raw steps that must be served, measured. So the pass runs *only* the tests whose skip it can clear, and those fourteen never meet the enforcing SUT. Every `SEC-AUTH-*` now carries a real verdict on every binding it applies to; the only remaining skips there are transport filters. Two properties worth reviewing specifically: - **The pass verifies from the card that the deviation took effect**, and leaves the original skip in place when it did not, so a SUT that ignores the switch is not credited with a verdict nobody produced. a2a-python exercised exactly this path before its fixture PR: warn, keep the skips, score unchanged. - **A failed extra pass no longer loses the report.** `_run_pass` was called unguarded, so an agent that would not start in a deviated mode took the whole binding's report with it, surfacing as `error (jsonrpc): …` and exit 2. An `ActsRunError` now warns and keeps the original skips; anything else still propagates. Pinned by a test asserting a `ZeroDivisionError` is *not* swallowed. `TestResult` gained an optional `configuration`, recording which deviation produced a spliced verdict. It is omitted when unset, so a run with no deviations is byte-identical to before. **Flagging for review:** ACTS §13.3 does not define that key, and the deviation mechanism is deliberately ours rather than the spec's — happy to drop it if that drift is unwelcome. ## Two runner bugs the corrected corpus exposed **A refused stream is a conformant answer.** `CORE-CAP-002` and `STREAM-SUB-003` failed on *every* SDK because the runner treated any non-SSE reply to a streaming call as "wrong content type" and discarded the body. A2A requires an agent that does not advertise streaming to answer `UnsupportedOperationError`, and says the same of subscribing to an already-terminal task — so the *conformant* reply is an ordinary error document and no stream at all. `StreamNotOpened` now carries the parsed reply, so `expect_error` can be evaluated against it. `http_base` opens the stream by hand rather than through `aconnect_sse`, which checks the content type inside its own `client.stream` block and closes the response before the body can be read; `grpc.stream` parses the `AioRpcError` when nothing was streamed. **`RUNNER_VARIABLES` never reached the service.** `run_acts.py` passed them and `POST /run-acts` did not, so `{{insufficientAuthToken}}` was unresolved on the service path and `SEC-EXTCARD-002` **errored** — a harness fault reported against the SDK. They are now merged inside `acts_runner.run()`, where every front end gets them, and a caller can still override. ## Schema catch-up `expect.headers` (wired into `evaluate_headers`, not merely declared), `preconditions.authentication`, `ErrorType` carrying exactly A2A's names, `details` as an assertion over the error array rather than a map, `data` removed. `_observed_error` now exposes `details` as the array it is.
aeoess
reviewed
Sep 21, 2026
aeoess
left a comment
There was a problem hiding this comment.
§12.2 now ties insufficientAuthToken and otherUserTaskId to the auth_credentials runner requirement, but the three tests that reference them do not declare it:
SEC-AUTH-002→{{insufficientAuthToken}}SEC-AUTH-003→{{otherUserTaskId}}SEC-EXTCARD-002→{{insufficientAuthToken}}
Without the declaration, a runner that cannot supply the fixture reaches the unresolved-variable failure path instead of the skip behavior §12.2 defines.
The first two are in this diff, so I left suggestions there. SEC-EXTCARD-002 is outside the changed lines and needs the same addition after its tags line:
runner_requirements: [auth_credentials]
…, and add REST subscribe tests
This was referenced Oct 14, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ACTS corpus adjustments
Follow-up to #1882. Fixes the parts of the ACTS corpus that disagreed with the normative A2A sources, were asserted by checks that could not fail, or named a feature the grammar had no way to express.
1. Spec (
docs/acts-specification.md)Corrected against the normative A2A sources. Error tables rebuilt from A2A 5.4 and 9.5 (9 A2A codes corrected, several HTTP mappings fixed, 5 JSON-RPC errors split into their own table). Operation table (4.1) realigned with 5.3.
Partand push-config params flattened to the proto shape. State transitions in 7.1 de-contradicted (illegal transitions enumerated; SUBMITTED -> COMPLETED and SUBMITTED -> REJECTED declared legal). File-layout in 16 now matches the real tree.Error-table details:
VersionNotSupportedError-32006 -> -32009. AddedInvalidAgentResponseError(-32006),ExtendedAgentCardNotConfiguredError(-32007),ExtensionSupportRequiredError(-32008). Removed the inventedStreamingNotSupportedErrorandExtendedCardNotSupportedError.error.codeorgoogle.rpc.ErrorInfo.reason, never by status.Grammar additions that legalize shapes the corpus already used:
items(5 sites),one_ofover assertions,expect_streamon raw steps (12 sites), optionalerror_type,detailsas an assertion (not a map).New capabilities.
expect.headersfor response metadata that never reaches the body (gRPC excluded bytransportfilter).expect_webhookas a new step kind (7.2) because a push notification is a request the SUT makes, not a reply to one, so the other assertion blocks cannot reach it.expect_stream.streamsanddisconnect_after(7.3) for the "two subscribers to one task" and "one hangs up mid-stream" requirements that no single-stream read can observe.preconditions.authenticationas the top-level gate the auth tests need. 12.2 table of runner-provided variables ({{insufficientAuthToken}},{{otherUserTaskId}},{{webhookUrl}}) that the corpus referenced but no document defined.Declarative
runner_requirements. Three tests demanded capabilities indescriptiononly, so every runner quietly executed a weaker variant and reported a pass. Now explicit: a test opening more than one stream MUST declareconcurrent_streams, usingdisconnect_afterMUST declarestream_disconnect, usingexpect_webhookMUST declarewebhook_endpoint, naming a 12.2 variable MUST declare its requirement. A runner lacking any of them MUST skip. Section 7.3 adds five sibling rules preventing a deliberate cut from making a stream's assertions unfailable.Clarifications, no grammar change. 4.4 (raw sent as written, no auto
A2A-VersionormessageId), 6.1 (gRPCstatusis the canonical transcoding), 7 (both oneof addressing styles and both spellings), 10 (runner rewrites JSON-RPCidinwire_payload), 11.2 (tck-auth-requireddocumented).2. Corpus (
tests/acts/)Mechanical conformance to the corrected grammar. 13
code:->error_type:. 18 push-op renames (set_push_notification_config->create_push_configx 12, plusget/list/deleteto short forms). 11 raw-bodymessageIdadds. 12 push-param flattenings and 12taskId/contextIdrelocations intomessage. Nestedfile:parts flattened to proto shape.Semantic corrections.
REST-PD-001asserted RFC 7807, but A2A 11.6 mandatesgoogle.rpc.Status.VER-NEG-002expected a successful v1.0 response to a request with noA2A-Version; A2A 3.6.2 makes an absent header mean 0.3, so a 1.0 interface must refuse it. Now-32009or-32601.VER-NEG-001asserts-32009per the corrected table.CARD-CACHE-001,JSONRPC-CT-001,REST-CT-001were named for header checks but had noheaderskey to assert on. Fixed, and they declarerunner_requirements: [header_inspection](first use in the corpus).CARD-CACHE-001tightened further: 8.6.1 names two independent SHOULDs; the first fix accepted either, now requiresall_ofand thatCache-Controlcarriesmax-age.HTTP+JSONreplacesRESTwhere the spec spells it that way.CORE-CTX-001rewritten as a raw step. FourAgentSkillobjects inclient-parsinggained the REQUIREDdescriptionandtags.Tests that passed without testing anything. Nine of them, green on all three transports against every reference SDK.
PUSH-DELIV-001/002/003,SEC-PUSH-001/002) registered a config and stopped. Now assert on the delivered request viaexpect_webhook. Two checkAuthorizationper A2A 4.3.3; deliberately notX-A2A-Notification-Token(A2A defines the token but no carrier header).webhookUrlwas a document literal athttps://example.com/.... Moved to the 12.2 runner-provided table.STREAM-MULTI-001/002andSTREAM-RESUB-001demanded concurrency and disconnect in prose only;-002was byte-identical to-001,RESUBhad no disconnect. All three now usestreams/disconnect_afterontck-long-running.CORE-ERR-009fetched two absent ids and never looked at the "unauthorized" half. Now fetches{{otherUserTaskId}}and requires both to nameTaskNotFoundError.SEC-EXTCARD-001/002/004andREST-STATUS-001.Authentication. Five
SEC-AUTH-*gated onpreconditions.capabilities.authentication, which does not exist onAgentCapabilities, so they were unrunnable against any SUT. Re-gated on the new top-levelpreconditions.authentication. Positive controls added toSEC-AUTH-001/002/004/006.SEC-AUTH-003was vacuous (both steps asserted onlymessage: {type: string}); now both requireTaskNotFoundError, which is the substance of the no-disclosure requirement.SEC-EXTCARD-001/002/004deliberately keep no gate because A2A mandates the extended card unconditionally.REST SubscribeToTask method ambiguity (new). Proto says GET at
/tasks/{id}:subscribe, markdown 5.3/11.3.2 say POST. The ecosystem splits:One pairing has no overlap: a client following the proto (
a2a-rs) against a server following only the markdown (a2a-java,a2a-dotnet). This surfaced as a 6h nightly hang ona2a-rsonce dotnet joined the ITK matrix. AddedREST-SUB-GET-001andREST-SUB-POST-001intransport-bindings.acts.yaml: raw GET and raw POST on a WORKINGtck-long-runningtask, expect 200 + terminal SSE event. SHOULD rather than MUST (following only one source is defensible). The task-state check is deliberate: subscribing to a terminal task is a legitimateUnsupportedOperationError. First-event-is-Task MUST stays covered bySTREAM-SSE-004via the abstract op. Verified locally againsta2a-rs(both pass) anda2a-dotnet(GET fails with 404 from the GetTask fall-through, POST passes). No spec changes here; the GET/POST contradiction requires separate PR.Spec refs.
CARD-CACHE-001points at#8.6.1. ThreeDM-FMT-*tests moved from#2.3to#5.5/#4.1.4;DM-FMT-003renamed to "Message response omits taskId and carries contextId", which is what it asserts.