Repository navigation
feat(acts): /run-acts, report writer and client steps - #64
Merged
JakubWorek merged 9 commits intoSep 9, 2026
Merged
JakubWorek merged 9 commits into
JakubWorek merged 9 commits into
Conversation
JakubWorek
force-pushed
the
jakubworek/acts-service-and-report
branch
from
September 7, 2026 07:54
a5c6a3f to
0abc415
Compare
JakubWorek
force-pushed
the
jakubworek/acts-service-and-report
branch
from
September 8, 2026 10:38
041a575 to
91eb897
Compare
…tobuf codegen in acts cli
…nd unhandled errors
JakubWorek
force-pushed
the
jakubworek/acts-service-and-report
branch
from
September 9, 2026 08:30
91eb897 to
7bd519c
Compare
mykytanetipa
approved these changes
Sep 9, 2026
…unsupported protocol branches
…fic trailing slash requirements
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.
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.
Summary
Makes a conformance run something you can ask for and record.
POST /run-actsstarts the mounted SUT, runs the corpus against one binding and returns a spec §13 report document;run_acts.pyis 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 bareproc 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 - soacts_runner.build_dispatcherreadssupportedInterfaces. 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 whyHttpDispatchergainedagent_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.pyreads an SDK'sacts/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.pyandscripts/process_acts_results.pymirror the existingitk_report.py/process_results.pypair, behindITK_ACTS_RUN=1in 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 toacts_<sdk>.jsonon thenightly-metricsrelease.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>andconformantis the conjunction. Three entries a night would make the window cover a third as long and force every consumer to re-group bycommit_sha. Each test contributes its verdict plus thefailuredetail orskip_reason- a history recording only"fail"cannot answer whether tonight's failure is last night's - whilename,duration_msand 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-stepformat 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_messagenamingtck-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 assertsexpect_parsedagainst exactly as it wouldexpect.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
authenticationcapability 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 ownAgentCapabilitiesmessage rather than written out, and the CLI prints aCOULD NOT RUN ON ANY BINDINGblock. 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 Nonegave nobody anything to act on; the failure now quotes theErrorInfo.reason, JSON-RPC code or gRPC status that was actually returned.gRPC no longer drops required fields at their default value.
MessageToDictomits proto3 scalars that are zero, which silently removed fields the corpus asserts on. Restoring exactly those annotatedgoogle.api.field_behavior = REQUIREDtakes the gRPC binding from 38 to 39 MUST passes; a blanketalways_print_fields_with_no_presencewas measured first and is net negative, fixing one test and breaking two.Also here:
params.extendedselects 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 wrongContent-Typeand assert the SUT rejects it.Spawning a Go SUT
_spawn_gorango run main.go, which compiles that one file, so a Go agent split across files dies withundefined: ...and the run reports only a readiness timeout. Nowgo run ., matching what_build_goalready did.Reaching the tests no SUT could run
Four tests -
CORE-CAP-001,CORE-CAP-002,SEC-EXTCARD-003andPUSH-CFG-004- assert that an agent lacking a capability answersUnsupportedOperationError. 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 withITK_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
capabilitiesblock.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-001andPUSH-CFG-004fail on all three SDKs, which returnPushNotificationNotSupportedErrorwhere the corpus demandsUnsupportedOperationError- and §5.4 defines the specific error for exactly this case, so that is a corpus defect rather than three SDK bugs.SEC-EXTCARD-003passes on python and go and fails on js, where §13.3 does nameUnsupportedOperationError.The card the harness was reading
fetch_agent_cardsent no headers, and §3.6.2 makes an absentA2A-Versionmean 0.3 - so an SDK with a compat layer answered the bootstrap fetch with its v0.3 card, on whichextendedAgentCardis not a capability at all but a top-levelsupportsAuthenticatedExtendedCard. Preconditions are evaluated against that card while theCARD-*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.0like every other request in the run. On a2a-js that recoversCARD-EXT-001on all three bindings andSEC-EXTCARD-001/002/004on REST - six tests that had been skipping, every one of them a failure that was invisible.