You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 82c277f
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/acts-specification.md
+152-4Lines changed: 152 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -234,7 +234,7 @@ Steps are the building blocks of a test. They execute sequentially within a test
234
234
**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.
expect_webhook: expect-webhook ; Assertions on what the SUT pushed to the runner
265
+
}
266
+
261
267
assertion-step = {
262
268
id: text,
263
269
? description: text,
@@ -762,9 +768,15 @@ Streaming operations (`send_streaming_message`, `subscribe_to_task`) return an o
762
768
763
769
```cddl
764
770
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 = (
765
778
? min_count: int, ; Minimum number of events
766
779
? max_count: int, ; Maximum number of events
767
-
? timeout_ms: int, ; Maximum time to wait for stream completion
768
780
? ordering: ordering-rule, ; Ordering constraint on task states
769
781
770
782
; Event-level assertions
@@ -775,6 +787,12 @@ expect-stream = {
775
787
776
788
; All-events assertion (applied to every event)
777
789
? 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)
778
796
}
779
797
780
798
ordering-rule = "monotonic_state" ; Task states never regress
@@ -877,6 +895,124 @@ is likewise legal: the interrupting condition was resolved.
877
895
878
896
---
879
897
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
+
880
1016
## 8. Variables and Capture
881
1017
882
1018
### 8.1. Variables
@@ -1165,6 +1301,7 @@ test rather than failing it — the gap is in the runner, not the SUT:
1165
1301
| --- | --- | --- |
1166
1302
| `insufficientAuthToken` | `auth_credentials` | A credential that authenticates but does not authorize, so a test can tell a 403 apart from a 401. |
1167
1303
| `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. |
1168
1305
1169
1306
`baseUrl`is also runner-provided; it is defined in §12.4 alongside the other protocol-level
0 commit comments