Skip to content

feat(acts): adopt the corrected corpus, drop compat, add the auth precondition and pass - #67

Merged
JakubWorek merged 1 commit into
mainfrom
jakubworek/acts-use-adjusted-corpus
Sep 16, 2026
Merged

JakubWorek merged 1 commit into
mainfrom
jakubworek/acts-use-adjusted-corpus

Conversation

@JakubWorek

Copy link
Copy Markdown
Member

Summary

Takes the corpus from 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.

@JakubWorek
JakubWorek merged commit 589dae8 into main Sep 16, 2026
2 checks passed
JakubWorek added a commit that referenced this pull request Sep 17, 2026
…#68)

`CARD-CACHE-001`, `JSONRPC-CT-001` and `REST-CT-001` are tagged `runner_requirements:[header_inspection]` and have skipped on every run since they were written — reported as "runner does not provide header_inspection", which reads as an honest limitation. It was not one. `expect.headers` has been wired into the runner since #67 and the dispatchers have been reporting headers all along; no front end ever passed `capabilities`, so the gate never opened.

Fixed where `RUNNER_VARIABLES` already solves the identical problem — merged inside `acts_runner.run()`, so `POST /run-acts`, `run_acts.py` and CI all get it and no caller has to remember. Patching the CI payload alone would have left local runs still skipping.

## What it finds

`JSONRPC-CT-001`, the only MUST, passes on all five SDKs, so no conformance verdict changes and `--require-conformant` stays green. Everything newly graded is SHOULD.

| | CARD-CACHE-001 | JSONRPC-CT-001 (must) | REST-CT-001 |
|---|---|---|---|
| a2a-js | pass | pass | pass |
| a2a-java | pass | pass | fail — 415, its known REST breakage |
| a2a-python | **fail** | pass | **fail** — `application/json` |
| a2a-go | **fail** | pass | **fail** — `application/json` |
| a2a-rs | **fail** | pass | **fail** — `application/json` |

Three SDKs publish no `Cache-Control` or `ETag` on the agent card, and the same three answer `application/json` where §11 wants `application/a2a+json`. Real deviations, invisible until now; a2a-js passing both shows they are satisfiable. Per run this turns 5 skips into 5 graded results.

## Also here

The first failures reported `actual` as `<test_suite.acts.assertions._FoldedHeaders object at 0x…>` — a raw repr going straight into the §13 report, swallowing the one thing a missing-header failure should say. `_FoldedHeaders` gains a `__repr__`, so it now reads `{'date': …, 'server': 'uvicorn', 'content-type': 'application/json'}`.

Two tests, both verified to fail without their fix:

- `test_the_harness_declares_every_capability_the_corpus_asks_for` — every `runner_requirement` in the corpus must be in `RUNNER_CAPABILITIES` or listed as one we genuinely cannot arrange. This is the check whose absence let the bug sit silently.
- `test_a_failure_reports_the_headers_that_were_actually_present`.
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