Skip to content

feat(acts): /run-acts, report writer and client steps - #64

Merged
JakubWorek merged 9 commits into
jakubworek/acts-streaming-and-rawfrom
jakubworek/acts-service-and-report
Sep 9, 2026
Merged

JakubWorek merged 9 commits into
jakubworek/acts-streaming-and-rawfrom
jakubworek/acts-service-and-report

Conversation

@JakubWorek

@JakubWorek JakubWorek commented Sep 4, 2026 •

Copy link
Copy Markdown
Member

Stacked on #63. Base is jakubworek/acts-streaming-and-raw, so this diff shows only the service, the report writer, §10 client steps and the diagnostics below. Retargeting as the branches below land.

Summary

Makes a conformance run something you can ask for and record. POST /run-acts starts the mounted SUT, runs the corpus against one binding and returns a spec §13 report document; run_acts.py is the same pipeline without a container, and can run several bindings in sequence, generating each SDK's protobuf stubs first so a fresh checkout does not fail readiness with a bare proc exit=1.

The report comes back unwrapped - no ITK envelope around it. The whole point of a standardized format is that a dashboard can read a run from any ACTS runner without knowing who produced it.

Binding URLs come from the agent card, never a convention. An agent may mount JSON-RPC at /jsonrpc/ and REST at /rest/ - the python one does - so acts_runner.build_dispatcher reads supportedInterfaces. The card itself stays at the host root, since it is what tells a client which bindings exist and so cannot sit behind one; that is why HttpDispatcher gained agent_card_url. A raw step's path is likewise relative to the binding's mount, not the host root: getting that wrong 404s every raw test and reads as ten conformance failures. The card is fetched without following redirects, so an agent that answers it from somewhere else is reported rather than quietly followed.

test_suite/acts/behaviors.py reads an SDK's acts/sut-behaviors.yaml. No file means the repo has not adopted §11 and gating is off; an empty file means it implements nothing and every behaviour test fails. Conflating those with one empty set would silently turn the gate on or off.

Nightly integration

scripts/acts_report.py and scripts/process_acts_results.py mirror the existing itk_report.py / process_results.py pair, behind ITK_ACTS_RUN=1 in the shared driver. Each transport leaves a full §13 report on disk for the workflow to upload as an artifact, and the nightly path appends to acts_<sdk>.json on the nightly-metrics release.

One entry per run, not per transport. A commit tested over three bindings is one run of the SDK, so they nest under results.<transport> and conformant is the conjunction. Three entries a night would make the window cover a third as long and force every consumer to re-group by commit_sha. Each test contributes its verdict plus the failure detail or skip_reason - a history recording only "fail" cannot answer whether tonight's failure is last night's - while name, duration_ms and the per-step breakdown stay in the artifact. Measured on the real corpus: 62 KB per run across three bindings, 434 KB at the 7-run window.

§10 client tests

§10 defines the client-step format and says nothing about the mechanism. Every other step drives the SUT as a server; a client test asks what its client library would have parsed from given bytes, which no A2A operation can ask. Those eight tests could only be skipped.

They now ride an ordinary send_message naming tck-client-parse, with {operation, wire_payload} in a data part; the agent runs the payload through its own client and returns the result, which the runner asserts expect_parsed against exactly as it would expect.body. No new route - just another §11 prefix. It is still a contract §10 does not define, so a SUT that has not implemented it fails rather than skips, and it is worth agreeing upstream before more SDKs adopt it.

With this no step kind is deferred; the only skips left are preconditions and transport filters.

Telling a corpus defect from an SUT one

Three changes for failures that were being reported against the wrong party.

Unsatisfiable preconditions are named as such. Five tests gate on an authentication capability that A2A 1.0 does not define, so no agent can ever clear them. As an ordinary skip they read as "not applicable to this agent" and four MUST-level tests sat invisible on every binding. The known set is derived from the specification's own AgentCapabilities message rather than written out, and the CLI prints a COULD NOT RUN ON ANY BINDING block. It stays a skip: the corpus is at fault and the SUT must not wear it.

An unnamed error says how the SUT spelled it. error_type should equal TaskNotFoundError, got None gave nobody anything to act on; the failure now quotes the ErrorInfo.reason, JSON-RPC code or gRPC status that was actually returned.

gRPC no longer drops required fields at their default value. MessageToDict omits proto3 scalars that are zero, which silently removed fields the corpus asserts on. Restoring exactly those annotated google.api.field_behavior = REQUIRED takes the gRPC binding from 38 to 39 MUST passes; a blanket always_print_fields_with_no_presence was measured first and is net negative, fixing one test and breaking two.

Also here: params.extended selects the extended card and is stripped before dispatch rather than sent as a request field, and raw steps no longer inherit dispatcher default headers - several tests set a deliberately wrong Content-Type and assert the SUT rejects it.

Spawning a Go SUT

_spawn_go ran go run main.go, which compiles that one file, so a Go agent split across files dies with undefined: ... and the run reports only a readiness timeout. Now go run ., matching what _build_go already did.

Reaching the tests no SUT could run

Four tests - CORE-CAP-001, CORE-CAP-002, SEC-EXTCARD-003 and PUSH-CFG-004 - assert that an agent lacking a capability answers UnsupportedOperationError. Their preconditions therefore require the card not to advertise it, and every ITK agent advertises everything, so all four skipped on every SDK on every binding and the protocol's "unsupported" branch went untested by anybody.

Relaxing the gate is not the fix: an agent that advertises streaming is obliged to stream, so against it the assertion would simply be wrong. One agent cannot both stream and not stream, so the runner now takes a second pass. After the main run it collects the tests skipped with agent card capability X=True, needs False, restarts the SUT with ITK_ACTS_REDUCED_CAPABILITIES=1, runs just those, and splices the verdicts in. Driving it off the first pass's own skip reasons rather than re-deriving the precondition logic keeps the two from drifting, and the pass is skipped entirely when nothing was gated.

No plumbing was needed to reach the agent: the launcher gives the child no explicit environment, so setting the variable in the runner process is enough. A SUT that ignores it keeps its original skips and gets a warning naming it, rather than being credited with a verdict nobody produced. Every SDK already gates these operations on its own card, so honouring the variable means publishing a smaller capabilities block.

Two passes is the whole answer, not a compromise. The corpus has seven distinct capability-precondition sets but only two distinct cards satisfy them, because no test requires one capability absent and another present - which is what lets a single all-off card serve all four at once. Configuring a card per test would mean 111 restarts per binding for exactly the same verdicts, taking the three-SDK suite from about two minutes to about forty.

The four now produce findings rather than silence. CORE-CAP-001 and PUSH-CFG-004 fail on all three SDKs, which return PushNotificationNotSupportedError where the corpus demands UnsupportedOperationError - and §5.4 defines the specific error for exactly this case, so that is a corpus defect rather than three SDK bugs. SEC-EXTCARD-003 passes on python and go and fails on js, where §13.3 does name UnsupportedOperationError.

The card the harness was reading

fetch_agent_card sent no headers, and §3.6.2 makes an absent A2A-Version mean 0.3 - so an SDK with a compat layer answered the bootstrap fetch with its v0.3 card, on which extendedAgentCard is not a capability at all but a top-level supportsAuthenticatedExtendedCard. Preconditions are evaluated against that card while the CARD-* tests assert on the dispatcher-fetched one, which did send the header, so the harness was reading two dialects of the same agent.

It now sends A2A-Version: 1.0 like every other request in the run. On a2a-js that recovers CARD-EXT-001 on all three bindings and SEC-EXTCARD-001/002/004 on REST - six tests that had been skipping, every one of them a failure that was invisible.

@JakubWorek
JakubWorek force-pushed the jakubworek/acts-service-and-report branch from 91eb897 to 7bd519c Compare September 9, 2026 08:30
@JakubWorek
JakubWorek merged commit 89f4560 into main Sep 9, 2026
2 checks passed
JakubWorek added a commit 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants