Skip to content

Commit 82c277f

Browse files
committed
test: stop ACTS tests passing without exercising what they name
1 parent 7b8acfd commit 82c277f

7 files changed

Lines changed: 395 additions & 21 deletions

‎docs/acts-specification.md‎

Lines changed: 152 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ Steps are the building blocks of a test. They execute sequentially within a test
234234
**Test isolation:** Tests within a suite (or across suites) MUST NOT share state. Each test starts with a clean context — no tasks, captures, or side effects carry over from previous tests. Runners MAY execute tests in any order or in parallel.
235235
236236
```cddl
237-
step = server-step / client-step / assertion-step / raw-step
237+
step = server-step / client-step / webhook-step / assertion-step / raw-step
238238

239239
server-step = {
240240
id: text, ; Unique within the test
@@ -258,6 +258,12 @@ client-step = {
258258
? assertions: [+ named-assertion]
259259
}
260260

261+
webhook-step = {
262+
id: text,
263+
? description: text,
264+
expect_webhook: expect-webhook ; Assertions on what the SUT pushed to the runner
265+
}
266+
261267
assertion-step = {
262268
id: text,
263269
? description: text,
@@ -762,9 +768,15 @@ Streaming operations (`send_streaming_message`, `subscribe_to_task`) return an o
762768

763769
```cddl
764770
expect-stream = {
771+
stream-assertions, ; Applied to every stream the step opens
772+
773+
? timeout_ms: int, ; Maximum time to wait for stream completion
774+
? streams: [+ stream-plan] ; Open one stream per entry, concurrently (§7.3)
775+
}
776+
777+
stream-assertions = (
765778
? min_count: int, ; Minimum number of events
766779
? max_count: int, ; Maximum number of events
767-
? timeout_ms: int, ; Maximum time to wait for stream completion
768780
? ordering: ordering-rule, ; Ordering constraint on task states
769781
770782
; Event-level assertions
@@ -775,6 +787,12 @@ expect-stream = {
775787
776788
; All-events assertion (applied to every event)
777789
? each_event: { * text => assertion }
790+
)
791+
792+
stream-plan = {
793+
stream-assertions, ; Applied to this stream alone
794+
? description: text, ; Names the stream in a failure report
795+
? disconnect_after: int ; Read this many events, then hang up (§7.3)
778796
}
779797
780798
ordering-rule = "monotonic_state" ; Task states never regress
@@ -877,6 +895,124 @@ is likewise legal: the interrupting condition was resolved.
877895

878896
---
879897

898+
## 7.2. Push Delivery Assertions
899+
900+
A push notification is a request the **SUT** makes, to a URL the runner supplied. It appears in
901+
no response, so none of the assertion blocks above can reach it: a test that registers a push
902+
configuration and stops has shown that the configuration API works and nothing about delivery.
903+
`expect_webhook` is the only construct whose subject is an inbound request.
904+
905+
```cddl
906+
expect-webhook = {
907+
task_id: text, ; Whose notifications to read; usually a captured id
908+
? min_count: int, ; Deliveries required before the step passes. Default 1
909+
? timeout_ms: int, ; How long to wait for them. Default 10000
910+
? each_event: { * text => assertion }, ; Applied to every delivered payload
911+
? final_event: { * text => assertion }, ; Applied to the most recent delivery
912+
? token: assertion ; The notification token the SUT must echo back
913+
}
914+
```
915+
916+
A webhook step carries no `expect`, `expect_error`, `expect_stream`, `capture` or `repeat`: those
917+
address a reply to a request the runner made, and this step makes none.
918+
919+
A runner MUST poll until `min_count` deliveries have arrived or `timeout_ms` elapses, and MUST
920+
fail the step when too few arrived, reporting how many did. Delivery is asynchronous, so a fixed
921+
wait would make a slow SUT indistinguishable from a silent one.
922+
923+
A test using `expect_webhook` MUST declare `runner_requirements: [webhook_endpoint]`. A runner
924+
with no receiver of its own cannot host the URL the SUT calls back on, and MUST skip rather than
925+
report a failure it caused itself.
926+
927+
`token` addresses the `X-A2A-Notification-Token` header carried on the delivery, which is how a
928+
receiver tells an authentic push from a forged one. It is the only part of push authentication a
929+
conformance runner can observe: whether a client *rejects* a forged call is a property of the
930+
client, not of the agent under test.
931+
932+
```yaml
933+
- id: set-config
934+
operation: create_push_config
935+
params:
936+
taskId: "{{create.taskId}}"
937+
url: "{{webhookUrl}}"
938+
token: "acts-push-token"
939+
940+
- id: delivered
941+
expect_webhook:
942+
task_id: "{{create.taskId}}"
943+
min_count: 1
944+
token: "acts-push-token"
945+
each_event:
946+
any_of:
947+
- task:
948+
id: "{{create.taskId}}"
949+
- statusUpdate:
950+
taskId: "{{create.taskId}}"
951+
```
952+
953+
---
954+
955+
## 7.3. Concurrent Streams and Disconnection
956+
957+
Some requirements are about the connections rather than the events on them: that an agent serves
958+
two subscribers to one task at once, and that it keeps serving one when the other goes away.
959+
Neither is observable from a single stream read to its end, however many assertions are made
960+
about the events it delivered.
961+
962+
`streams` opens one stream per entry, **concurrently**, all from the step's single request. The
963+
assertions in the enclosing `expect_stream` apply to every stream; those in a `stream-plan` apply
964+
to that stream alone. A step that omits `streams` opens one stream, as before.
965+
966+
A runner MUST issue the same request for every stream in a set. Concurrent streams are
967+
subscribers to one thing, so a runner that rebuilt the request per stream — generating a fresh
968+
`messageId` for each, as §12.4 requires it to do once — would be observing several different
969+
tasks and could conclude nothing about any of them.
970+
971+
`disconnect_after` reads that many events and then **closes the connection**. A runner MUST
972+
actually close it, not merely stop reading: an abandoned response is closed eventually by
973+
whatever reclaims it, by which time the stream has ended and the SUT has observed no mid-stream
974+
disconnect at all.
975+
976+
The two controls are independent. `disconnect_after` on the only stream of a step is the
977+
disconnect half of a resubscribe test; combined with `streams` it is what makes the members of a
978+
set differ.
979+
980+
Restrictions, all of which exist to stop a test passing without exercising what it names:
981+
982+
- A test whose step opens more than one stream MUST declare
983+
`runner_requirements: [concurrent_streams]`, and one using `disconnect_after` MUST declare
984+
`stream_disconnect`. A runner lacking either MUST skip the test. Prose in `description` is not
985+
a declaration: `STREAM-MULTI-001`, `STREAM-MULTI-002` and `STREAM-RESUB-001` each described a
986+
capability no runner had, executed a single undisturbed stream instead, and passed.
987+
- `max_count` MUST NOT appear on a plan with `disconnect_after`: the runner stops first, so the
988+
limit cannot be exceeded.
989+
- `min_count` on such a plan MUST NOT exceed `disconnect_after`, which no stream could satisfy.
990+
- `timeout_ms` bounds the step, not one stream of it, and MUST NOT appear on a plan.
991+
- `capture` MUST NOT appear on a step opening more than one stream; which stream a value came
992+
from would be decided by arrival order.
993+
994+
A runner MUST report which stream a failure came from, naming it by its `description` where one
995+
is given.
996+
997+
```yaml
998+
- id: subscribe
999+
operation: subscribe_to_task
1000+
params:
1001+
id: "{{start.taskId}}"
1002+
expect_stream:
1003+
min_count: 1
1004+
streams:
1005+
- description: "hangs up after one event"
1006+
disconnect_after: 1
1007+
- description: "stays subscribed"
1008+
ordering: monotonic_state
1009+
final_event:
1010+
status:
1011+
state: TASK_STATE_COMPLETED
1012+
```
1013+
1014+
---
1015+
8801016
## 8. Variables and Capture
8811017

8821018
### 8.1. Variables
@@ -1165,6 +1301,7 @@ test rather than failing it — the gap is in the runner, not the SUT:
11651301
| --- | --- | --- |
11661302
| `insufficientAuthToken` | `auth_credentials` | A credential that authenticates but does not authorize, so a test can tell a 403 apart from a 401. |
11671303
| `otherUserTaskId` | `auth_credentials` | The id of a task belonging to a different principal, so a test can check that an inaccessible resource is not distinguishable from an absent one. |
1304+
| `webhookUrl` | `webhook_endpoint` | A URL the runner is listening on, so the SUT's push notifications arrive somewhere a test can assert against with `expect_webhook` (§7.2). A literal cannot serve: an address nobody answers makes every delivery test vacuous. |
11681305

11691306
`baseUrl` is also runner-provided; it is defined in §12.4 alongside the other protocol-level
11701307
inputs.
@@ -1863,7 +2000,7 @@ preconditions = {
18632000
}
18642001
18652002
; ── Steps ─────────────────────────────────────────────────────────
1866-
step = server-step / client-step / assertion-step / raw-step
2003+
step = server-step / client-step / webhook-step / assertion-step / raw-step
18672004
18682005
server-step = {
18692006
id: text,
@@ -2003,13 +2140,24 @@ jsonrpc-standard-error =
20032140
20042141
; ── Streaming ─────────────────────────────────────────────────────
20052142
expect-stream = {
2143+
stream-assertions,
2144+
? timeout_ms: int,
2145+
? streams: [+ stream-plan]
2146+
}
2147+
2148+
stream-assertions = (
20062149
? min_count: int,
20072150
? max_count: int,
2008-
? timeout_ms: int,
20092151
? ordering: ordering-rule,
20102152
? events: [+ event-assertion],
20112153
? final_event: { * text => assertion },
20122154
? each_event: { * text => assertion }
2155+
)
2156+
2157+
stream-plan = {
2158+
stream-assertions,
2159+
? description: text,
2160+
? disconnect_after: int
20132161
}
20142162
20152163
ordering-rule = "monotonic_state"

‎tests/acts/auth-security.acts.yaml‎

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ suites:
223223
capabilities:
224224
pushNotifications: true
225225
tags: [auth, push, runner-special]
226+
runner_requirements: [webhook_endpoint]
226227
requires_behaviors: ["tck-long-running"]
227228
steps:
228229
- id: create-task
@@ -248,6 +249,7 @@ suites:
248249
params:
249250
taskId: "{{create-task.taskId}}"
250251
url: "{{webhookUrl}}"
252+
token: "acts-push-token"
251253
authentication:
252254
scheme: "Bearer"
253255
credentials: "test-token"
@@ -259,6 +261,25 @@ suites:
259261
id:
260262
type: string
261263

264+
- id: delivery-carries-the-credential
265+
description: >
266+
REQ-SEC-018 is about the headers on the request the *SUT*
267+
makes, which no response can show. Accepting the config proves
268+
nothing: a server that stores it and pushes anonymously — or
269+
never pushes — satisfies every other step here.
270+
271+
The assertion is on `Authorization`, because that is what A2A
272+
§4.3.3 makes a MUST: "the agent MUST include authentication
273+
credentials in the request headers as specified in the
274+
PushNotificationConfig.authentication field". The `token` field
275+
has no header defined for it anywhere in A2A, so requiring one
276+
would fail a conformant agent over a convention.
277+
expect_webhook:
278+
task_id: "{{create-task.taskId}}"
279+
min_count: 1
280+
headers:
281+
Authorization: "Bearer test-token"
282+
262283
- id: SEC-PUSH-002
263284
name: "Client validates push notification webhook authenticity"
264285
description: "Runner MUST verify that webhook requests with invalid auth are rejected by the client."
@@ -268,6 +289,7 @@ suites:
268289
capabilities:
269290
pushNotifications: true
270291
tags: [auth, push, client, runner-special]
292+
runner_requirements: [webhook_endpoint]
271293
requires_behaviors: ["tck-long-running"]
272294
steps:
273295
- id: create-task
@@ -293,6 +315,7 @@ suites:
293315
params:
294316
taskId: "{{create-task.taskId}}"
295317
url: "{{webhookUrl}}"
318+
token: "acts-expected-token"
296319
authentication:
297320
scheme: "Bearer"
298321
credentials: "expected-token"
@@ -304,6 +327,21 @@ suites:
304327
id:
305328
type: string
306329

330+
- id: delivery-carries-the-configured-credential
331+
description: >
332+
The client-side half of REQ-SEC-019 — rejecting a forged
333+
webhook call — is not something a conformance runner can drive
334+
against the SUT. What it can check is the precondition that
335+
makes rejection possible at all: the agent must present the
336+
credential it was configured with, and present *that* one
337+
rather than something of its own, so a receiver has a value to
338+
compare against.
339+
expect_webhook:
340+
task_id: "{{create-task.taskId}}"
341+
min_count: 1
342+
headers:
343+
Authorization: "Bearer expected-token"
344+
307345
- id: SEC-EXTCARD-001
308346
name: "Extended Agent Card requires authentication"
309347
description: "Verifies that fetching the extended Agent Card without authentication is rejected."
@@ -315,6 +353,17 @@ suites:
315353
tags: [auth, discovery, runner-special]
316354
transport: [rest]
317355
steps:
356+
- id: get-extended-card-with-auth
357+
description: >
358+
Positive control. The runner presents its credential on an
359+
abstract operation (§12.4), so the same endpoint must answer
360+
this one — otherwise the rejection below is attributable to a
361+
server that refuses everything here, or to no such route at
362+
all, rather than to the absent credential.
363+
operation: get_extended_agent_card
364+
expect:
365+
status: 200
366+
318367
- id: get-extended-card-without-auth
319368
raw:
320369
method: GET
@@ -341,6 +390,15 @@ suites:
341390
runner_requirements: [auth_credentials]
342391
transport: [rest]
343392
steps:
393+
- id: get-extended-card-with-auth
394+
description: >
395+
Positive control, as in SEC-EXTCARD-001: a server refusing this
396+
endpoint outright would otherwise satisfy the rejection below
397+
without ever having looked at the credential's scope.
398+
operation: get_extended_agent_card
399+
expect:
400+
status: 200
401+
344402
- id: get-extended-card-insufficient-auth
345403
raw:
346404
method: GET
@@ -383,6 +441,13 @@ suites:
383441
tags: [auth, discovery, runner-special]
384442
transport: [rest]
385443
steps:
444+
- id: get-extended-card-with-auth
445+
description: >
446+
Positive control, as in SEC-EXTCARD-001.
447+
operation: get_extended_agent_card
448+
expect:
449+
status: 200
450+
386451
- id: get-extended-card-without-auth
387452
raw:
388453
method: GET

‎tests/acts/client-parsing.acts.yaml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ suites:
251251
skills:
252252
- id: "public-skill"
253253
name: "Public Skill"
254+
description: "A skill listed on the public card."
255+
tags: ["public"]
254256
supportedInterfaces:
255257
- url: "https://example.com/a2a/v1"
256258
protocolBinding: HTTP+JSON
@@ -274,8 +276,12 @@ suites:
274276
skills:
275277
- id: "public-skill"
276278
name: "Public Skill"
279+
description: "A skill listed on the public card."
280+
tags: ["public"]
277281
- id: "extended-skill"
278282
name: "Extended Skill"
283+
description: "A skill revealed only to an authenticated client."
284+
tags: ["extended"]
279285
supportedInterfaces:
280286
- url: "https://example.com/a2a/v1"
281287
protocolBinding: HTTP+JSON
@@ -309,6 +315,8 @@ suites:
309315
skills:
310316
- id: "basic-skill"
311317
name: "Basic Skill"
318+
description: "The agent's only skill."
319+
tags: ["basic"]
312320
supportedInterfaces:
313321
- url: "https://example.com/a2a/v1"
314322
protocolBinding: HTTP+JSON

0 commit comments

Comments
 (0)