Skip to content

feat(acts): ACTS corpus, schema and loader - #59

Merged
JakubWorek merged 3 commits into
mainfrom
jakubworek/acts-scenarios-and-schema
Sep 2, 2026
Merged

JakubWorek merged 3 commits into
mainfrom
jakubworek/acts-scenarios-and-schema

Conversation

@JakubWorek

@JakubWorek JakubWorek commented Sep 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds the ACTS conformance corpus and the code to load it: a schema derived from the spec's CDDL grammar, a compat layer, and a loader that flattens a manifest into an ordered run plan. Nothing executes tests yet - this is the input side.

The corpus is a verbatim mirror. scenarios/acts/*.acts.yaml is byte-identical to tests/acts/ at a2aproject/A2A@dbcabfba (head of a2aproject/A2A#1882), and MUST NOT be edited by hand. Refreshing is then a copy rather than a three-waymerge, and defects stay visible to the people who can fix them upstream.

That creates a problem: 26 of the 111 tests violate the ACTS CDDL and cannot be validated as written. Losing them is expensive - it takes out all push-notification coverage, all capability-error coverage, and the only gRPC error-status test. So test_suite/acts/compat.py rewrites them at load time instead, under four rules:

Rule Defect Sites
expect-error-code-key expect_error keys the error name as code; the CDDL says error_type 13
push-config-operation-name operation: uses push-config names absent from the spec's abstract-operation enum 18
expect-field-outside-body a response field placed directly under expect, which admits only status and body 2
expect-error-as-expect-field expect: {error: …} used to assert a failure, which belongs in expect_error 2

Every rule is a rename or a move the document already determines; none invents a value. A defect needing a judgement call is left broken and belongs upstream - a runner that guesses what a malformed conformance test meant is worse than one that reports it. Site counts are pinned, so when upstream fixes a defect the count drops, a test fails, and the rule gets deleted. compat=False on any loader entry point shows the corpus exactly as shipped.

Keeping the rules out of schema.py is the point of the split: the schema stays a statement of what the CDDL permits, so it can still tell a valid ACTS document from an invalid one.

Notes

  • Assertion trees are deliberately untyped. Spec §5.2 makes {status: {state: FOO}} (nested paths, exact match) syntactically identical to {type: array, count_gte: 1} (two operators). Only an evaluator holding a real response can tell them apart, so expect.body, params, wire_payload, expect_parsed and friends stay as plain data.
  • TransportBinding is separate from test_suite.transports.Transport on purpose - ACTS says rest where the traversal engine says http_json, and sharing one enum would silently mistranslate whichever suite lost.
  • Some corpus defects parse fine and are left wrong, pinned by tests that fail when upstream fixes them: REST-PD-001 asserts an RFC 7807 body where A2A §11.6 mandates google.rpc.Status; CLIENT-PARSE-006 uses file.bytes for file.raw; a gRPC-only test asserts an HTTP status; and 23 tests tagged runner-special describe their real check only in prose, because expect-block has no headers key. scenarios/acts/PROVENANCE.md has the register.

…pus to enable strict schema validation without modifying upstream snapshots
Comment thread tests/test_acts_corpus.py Resolved
@JakubWorek
JakubWorek merged commit bd4e926 into main Sep 2, 2026
2 checks passed
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