Skip to content

feat: Add new spec for A2A protocol conformance tests - #1882

Open
darrelmiller wants to merge 8 commits into
mainfrom
conformance-spec
Open

darrelmiller wants to merge 8 commits into
mainfrom
conformance-spec

Conversation

@darrelmiller

Copy link
Copy Markdown
Contributor

Summary

This PR introduces ACTS (A2A Conformance Test Specification) — a unified YAML format for A2A protocol conformance tests,plus 111 tests covering all testable MUST/SHOULD requirements from the A2A v1.0 spec.

Problem

The A2A ecosystem has 4 fragmented conformance testing efforts (a2a-tck, a2a-itk, agntcy/csit, agentbin), each withdifferent test definitions. This makes it impossible to verify that SDKs passing "conformance tests" can actuallyinteroperate.

Solution

One canonical test format that all SDKs test against. Language-agnostic YAML declarations + freedom to implement runners in any language = guaranteed interoperability.

What's Included

📋 Specification (docs/acts-specification.md)

  • ~2000 lines, 17 sections, inline CDDL grammar (RFC 8610 conformant)
  • Abstract operations (transport-agnostic: JSON-RPC, gRPC, REST)
  • Rich assertion DSL, streaming support, state machine validation
  • Standard JSON report format for dashboards

✅ Test Suite (111 tests across 14 files)

  • 72 MUST, 35 SHOULD, 4 MAY tests
  • Core ops, discovery, streaming, errors, multi-turn, auth, push notifications, history, polling, wire format, data types, version negotiation, transport bindings, client parsing
  • Full coverage: All 76 testable spec requirements mapped

🎨 HTML Viewer (tests/acts/test-viewer.html)

  • Interactive browser with search, filter, syntax highlighting
  • 290 KB standalone file, zero dependencies

Coverage Validation

✅ Spec audit: All 76 testable MUST/SHOULD requirements have tests
✅ Gap analysis: All scenarios from 4 existing repos covered
✅ CDDL validation: All files validate against RFC 8610 grammar

darrelmiller and others added 7 commits May 25, 2026 17:58
Introduces a language-neutral YAML format for declaring conformance
tests that A2A SDKs must pass. Key design decisions:

- Abstract operations instead of wire methods for transport independence
- Three conformance levels (must/should/may) per RFC 2119
- Client golden-response tests for interop bug coverage
- SUT behavior contract via message-prefix convention
- Inline CDDL type definitions throughout the spec

Co-authored-by: Copilot <[email protected]>
Spec additions:
- §13 Report Format: standardized JSON output schema with CDDL for
  dashboards to consume results from any runner implementation
- Appendix A: consolidated report CDDL added
- Sections 14-17 renumbered accordingly

Test suites (tests/acts/):
- suite.acts.yaml: top-level manifest including all suites
- discovery.acts.yaml: 6 tests (CARD-DISC-*)
- core-operations.acts.yaml: 7 tests (CORE-SEND/GET/CANCEL-*)
- multi-turn.acts.yaml: 3 tests (CORE-MULTI-*)
- streaming.acts.yaml: 6 tests (STREAM-SSE/SUB-*)
- polling.acts.yaml: 2 tests (CORE-EXEC-*)
- error-handling.acts.yaml: 7 tests (CORE-ERR-*, JSONRPC-ERR-*)
- wire-format.acts.yaml: 3 tests (DM-FMT-*)
- data-types.acts.yaml: 4 tests (DM-ART-*)
- push-notifications.acts.yaml: 4 tests (PUSH-CFG-*)
- client-parsing.acts.yaml: 6 tests (CLIENT-PARSE-*)

Tests synthesized from a2a-tck, a2a-itk, agntcy/csit, and agentbin
to validate the ACTS format covers real-world scenarios.

Co-authored-by: Copilot <[email protected]>
New test files:
- history.acts.yaml (6 tests: history length, ordering, content)
- version-negotiation.acts.yaml (2 tests: version errors, defaults)
- transport-bindings.acts.yaml (8 tests: JSON-RPC, REST, gRPC)

Additions to existing files:
- core-operations: +3 (failure, content-type error, list tasks)
- streaming: +5 (first event, message-only, concurrent, resubscribe)
- error-handling: +4 (malformed request, capability errors, error data)
- discovery: +3 (caching, schema validation, extended card)
- data-types: +3 (timestamps, schema validation, tolerance)
- push-notifications: +6 (list, errors, idempotent delete, delivery)

Co-authored-by: Copilot <[email protected]>
Cross-referenced every MUST and SHOULD in the A2A specification against
existing ACTS tests. Found 23 uncovered testable requirements and created
tests for all of them.

New test files:
- auth-security.acts.yaml (12 tests: auth rejection, extended card access,
  in-task AUTH_REQUIRED state, push webhook auth)

Additions to existing files:
- core-operations: +2 (ListTasks includeArtifacts, nextPageToken)
- multi-turn: +2 (mismatched contextId/taskId, rejected client contextId)
- error-handling: +3 (error @type field, ErrorInfo, missing-vs-unauthorized)
- discovery: +1 (protocol declaration in Agent Card)
- transport-bindings: +1 (REST application/a2a+json content type)
- client-parsing: +2 (extended card caching, capability checking)

Coverage: 76 testable spec requirements now have matching tests.
99 additional requirements are process/documentation/deployment concerns
not testable via conformance tests.

Co-authored-by: Copilot <[email protected]>
Reconcile 4 critical naming mismatches between spec and tests:
- action/request -> operation/params (JSON-RPC alignment)
- raw_request/raw_expect -> raw/expect (flat block, reuse expect)
- golden_response -> client_response (clearer naming)
- rawBody -> body_raw (snake_case consistency)

Add 3 structural improvements identified during format review:
- status field in expect-block (tests already use it)
- runner_requirements enum for runner-special tests
- named-assertion / assertions block (used by 9 tests)

Updated both inline CDDL and Appendix A consolidated grammar.

Co-authored-by: Copilot <[email protected]>
§12.6 stated the report format was 'not prescribed' (MAY), but §13
mandates a JSON report format (MUST). Updated §12.6 to reference §13
and align the normative language.

Co-authored-by: Copilot <[email protected]>
- Interactive viewer with search, filter by level/tag
- Syntax-highlighted YAML rendering
- Expand/collapse all tests
- Stats dashboard showing 111 tests (MUST/SHOULD/MAY breakdown)
- Standalone HTML file, zero dependencies
@darrelmiller
darrelmiller requested a review from a team as a code owner May 26, 2026 16:03

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the A2A Conformance Test Specification (ACTS) along with a comprehensive suite of YAML-based conformance tests covering core operations, streaming, discovery, error handling, and security. The review feedback identifies several schema and specification violations across the test files, including incorrect abstract operation names, invalid keys in error expectations, mismatched field names for file content, and incorrect JSON-RPC error codes. Additionally, the gRPC-to-HTTP error mapping table in the specification document should be updated to prioritize canonical transcoding mappings.

Comment on lines +201 to +202
- id: set-config
operation: set_push_notification_config

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The abstract operation set_push_notification_config is used here, but it is not defined in the ACTS specification. According to the specification, the correct abstract operation name is create_push_config.

          - id: set-config
            operation: create_push_config

Comment on lines +331 to +332
expect_error:
code: UnsupportedOperationError

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The expect_error block uses the key code to specify the expected error type. However, the ACTS specification defines this field as error_type. Using code will cause schema validation failures in compliant test runners.

            expect_error:
              error_type: UnsupportedOperationError

Comment on lines +213 to +216
- file:
name: "report.pdf"
mediaType: "application/pdf"
bytes: "JVBERi0xLjQ="

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The field name bytes is used under the file object to represent the base64-encoded file content. However, both the ACTS specification and the underlying Part protobuf definition use the field name raw for this purpose.

                        - file:
                            name: "report.pdf"
                            mediaType: "application/pdf"
                            raw: "JVBERi0xLjQ="

Comment on lines +153 to +154
expect:
status: error

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The expect block specifies status: error. According to the ACTS specification, status must be a valid HTTP status code (integer) or a numeric assertion. If the request is expected to fail, you should use the expect_error block instead of expect.

            expect_error:
              error_type: InvalidParamsError

Comment on lines +40 to +41
error:
code: -32009

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The expected JSON-RPC error code is set to -32009. However, the ACTS specification defines the JSON-RPC code for VersionNotSupportedError as -32006. This mismatch will cause conformant implementations to fail this test.

                error:
                  code: -32006

Comment on lines +626 to +630
| `TaskNotCancelableError` | -32002 | `FAILED_PRECONDITION` | 409 |
| `UnsupportedOperationError` | -32004 | `UNIMPLEMENTED` | 405 |
| `ContentTypeNotSupportedError` | -32005 | `INVALID_ARGUMENT` | 415 |
| `InvalidParamsError` | -32602 | `INVALID_ARGUMENT` | 400 |
| `VersionNotSupportedError` | -32006 | `UNIMPLEMENTED` | 406 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The mapping of gRPC statuses to HTTP statuses in this table does not align with the general rule to prioritize compatibility with gRPC transcoding systems by using the canonical mapping. Specifically:

  • TaskNotCancelableError (gRPC FAILED_PRECONDITION) should map to HTTP 400 (canonical mapping for FAILED_PRECONDITION), not 409.
  • UnsupportedOperationError (gRPC UNIMPLEMENTED) should map to HTTP 501 (canonical mapping for UNIMPLEMENTED), not 405.
  • VersionNotSupportedError (gRPC UNIMPLEMENTED) should map to HTTP 501, not 406.
  • ContentTypeNotSupportedError (gRPC INVALID_ARGUMENT) should map to HTTP 400, not 415.
References
  1. When mapping gRPC statuses to HTTP statuses, prioritize compatibility with gRPC transcoding systems by using the canonical mapping, even if a more specific HTTP status code is available.

Comment on lines +173 to +175
expect:
error:
exists: true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For asserting that an operation fails, the expect_error block should be used instead of expect with an error body check. This ensures consistency across the test suite and aligns with the schema defined in the specification.

            expect_error:
              error_type: UnsupportedOperationError

@andysalvo

Copy link
Copy Markdown

ACTS scopes protocol conformance cleanly. One gap worth flagging: two implementations can pass all 111 tests and still produce different cryptographic outputs from the same input — JCS canonicalization, hash derivation, and signature binding sit below the transport layer ACTS validates. We hit this recently when our own JCS serializer diverged on Unicode handling that six other implementations got right; the shared test vectors caught it, not protocol-level tests. A derivation conformance layer would compose well as a separate test class or companion suite.

@MoltyCel

Copy link
Copy Markdown
Contributor

test (edit later)

@muscariello
muscariello requested review from a team as code owners May 29, 2026 07:34
@chopmob-cloud

Copy link
Copy Markdown

We have an adversarial bench live -- 138 profiles across 30 categories, tested against our own A2A agent at api.algovoi.co.uk. It sits above what ACTS validates: ACTS checks protocol compliance against MUST/SHOULD requirements, the bench tests agent behaviour under adversarial conditions (prompt injection, coercive payment patterns, wallet draining attempts, malicious tool call sequences). The two layers complement without overlapping.

On @andysalvo's point about JCS and cryptographic outputs: that layer is below protocol-observable behaviour and cannot be reached by protocol assertions -- it needs shared test vectors that implementations run locally and compare byte-for-byte. A derivation conformance suite would compose alongside ACTS as a separate test class rather than an extension of it.

Profile schema is public if it is useful for expressing an adversarial class in the ACTS format.


AlgoVoi (chopmob-cloud) -- Acquisition enquiries: https://docs.algovoi.co.uk/acquisition

@chopmob-cloud

Copy link
Copy Markdown

The gap is real and sits below what ACTS validates. Two implementations can pass all 111 ACTS tests and still diverge on JCS canonical output for the same input — particularly on unicode normalisation, number representation, and key ordering edge cases. ACTS validates the transport and protocol layer; it does not validate the cryptographic substrate underneath.

The 8-implementation cross-validation corpus at \chopmob-cloud/algovoi-jcs-conformance-vectors\ covers exactly this layer: Python (rfc8785), TypeScript (canonicalize), Go (gowebpki/jcs), Rust (serde_json), Java (cyberphone/json-canonicalization), PHP, .NET, Ruby — all producing byte-identical output across the same vector set, including the non-ASCII UTF-8 cases that diverge most frequently in practice.

A complete A2A conformance spec needs both layers: ACTS for protocol, a JCS byte-match suite for the cryptographic substrate. The two are complementary rather than overlapping.

AlgoVoi (chopmob-cloud) -- Acquisition enquiries: https://docs.algovoi.co.uk/acquisition

@msampathkumar msampathkumar changed the title Conformance spec feat: Add new spec for A2A protocol conformance tests Jun 4, 2026
@elang2

elang2 commented Aug 10, 2026

Copy link
Copy Markdown

Solid work here. I have a few observations after reading through the spec and test structure.

CDDL (RFC 8610) for test declarations makes sense for a multi-language ecosystem. But CDDL is a data definition language, not a behavioral one. You mention "state machine validation" for streaming tests, and I'm curious how temporal ordering constraints are actually expressed. If it's just an ordered sequence of expected events in the YAML, that works, but the spec should call out how runners distinguish "messages arrived in correct order" from "messages are individually well-formed." Those are different guarantees.

The transport abstraction is the right call since A2A is transport-agnostic in theory. In practice though, do any of the tests exercise transport-specific edge cases? Things like HTTP/2 stream resets, gRPC deadline propagation, WebSocket close frames. If not, worth noting that gap explicitly so nobody assumes transport conformance is covered.

One more thing. You state all "testable" requirements are mapped. What's the methodology for deciding something isn't testable? Some MUST NOT requirements are hard to test positively but straightforward to test via negative assertions (send bad input, verify rejection). Listing the excluded requirements would let reviewers push back on that classification where they disagree.

The HTML viewer is a nice touch for adoption. A machine-readable coverage matrix (requirement ID to test ID) would also help SDK maintainers wire this into CI.

@astrogilda

astrogilda commented Aug 30, 2026 •

Copy link
Copy Markdown

Tried to express a canonicalization corpus in this format and could not, and the reason is structural, not a missing field.

A test requires steps, and step is a closed union of four kinds. A server step needs an operation from a closed RPC enum and a live system under test. A client step tests the parser, and expect_parsed is keyed per field, so it can never assert a whole byte string. A raw step needs a method and a path. An assertion step needs a prior step. None of the four applies a pure function to a local input and compares output bytes, which is the shape every canonicalization vector takes: f(input) == bytes, with no system under test anywhere in it.

Two cases make it concrete. One of our vectors turns on whether an e-acute arrives as the literal character or as its six-character JSON escape, a distinction destroyed the moment a document is parsed, and every step kind parses first. Another turns on 0.000001 against 1e-06, and the numeric operators here are gte, lte, gt and lt, which are value comparisons. Those two are the same number.

The extension is small. A fifth step kind carrying a derivation function, an input and expected bytes, an open registry-backed function name, and one more runner requirement. Around twenty lines of CDDL, and nothing else in the format changes. With it, all 57 of our vectors convert.

Worth saying plainly because it bears on what this proposal is for: across the whole diff, signature, 8785, jcs, canonicaliz and digest return nothing. Positive control, agentCard returns 36. So the format meant to unify the conformance efforts currently cannot express an assertion about the bytes a signature is computed over.

This is the gap I would close before the format becomes the canonical one, because none of the four efforts it unifies covers that layer either. I checked all four. Two say so in their own files: a2a-tck tags its four card-signing requirements not-automatable with no executable test referencing any of them, and agentbin publishes a matrix reading not-tested for the same four across five languages. Of the other two, csit's byte-for-byte assertions compare sentinel strings and its A2A fixture sets signatures to none, and a2a-itk returns nothing for 8785, jcs, jws, dsse or ed25519.

Happy to open the CDDL change as its own pull request if that is useful, or to leave it here.

JakubWorek added a commit to a2aproject/a2a-itk that referenced this pull request Sep 2, 2026
## 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.
@Math1987

Math1987 commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Hi Darrel,
I'd like to contribute a focused correction to SEC-AUTH-001, SEC-AUTH-002, and SEC-AUTH-003, building on Jakub's existing ITK ACTS stack.

I exercised the current corpus through the loader, JSON-RPC dispatcher and runner from ITK #64, using in-process synthetic HTTP fixtures:

  • SEC-AUTH-001/002 pass when authentication is disabled but validation returns -32602 for the missing messageId in their raw requests. Adding a valid ID makes this control fail, while the fixture's intended 401/403 rejections still pass.
  • Both also pass on HTTP 200 with {"title":"request accepted"} a malformed SendMessage response providing no authentication-rejection evidence.
  • SEC-AUTH-003 passes when one error says “Task exists but belongs to another user” and the other says “Task not found”, both with code -32001. Adding TaskNotFoundError alone does not catch this.

These checks explicitly supplied the corpus's capabilities.authentication flag, which the current AgentCapabilities proto does not define. The fixture/applicability contract needs attention too: credentials must distinguish authenticated-but-insufficient access, and the protected task must demonstrably exist for its owner.

I'd propose valid requests, verified credential roles and positive controls, authentication-specific rejection checks, and a targeted protected/missing-task comparison. The existing raw captures and substitutions are sufficient to detect the demonstrated message leak. I'd start verification with JSON-RPC, while keeping cross-binding behavior explicit. Custom JSON-RPC authentication errors and normalization of variable response fields need an agreed contract; I would not assume a universal auth error number or byte-identical bodies.

I'm aware PROVENANCE already documents the missing error_type fields. The contribution would focus on these reproduced false passes and the fixture contract, with corpus changes upstream and verification using the existing ITK implementation.

Would this be a useful bounded follow-up here, coordinated with Jakub's work?

@JakubWorek

Copy link
Copy Markdown
Member

Hi Darrel, I'd like to contribute a focused correction to SEC-AUTH-001, SEC-AUTH-002, and SEC-AUTH-003, building on Jakub's existing ITK ACTS stack.

I exercised the current corpus through the loader, JSON-RPC dispatcher and runner from ITK #64, using in-process synthetic HTTP fixtures:

  • SEC-AUTH-001/002 pass when authentication is disabled but validation returns -32602 for the missing messageId in their raw requests. Adding a valid ID makes this control fail, while the fixture's intended 401/403 rejections still pass.
  • Both also pass on HTTP 200 with {"title":"request accepted"} a malformed SendMessage response providing no authentication-rejection evidence.
  • SEC-AUTH-003 passes when one error says “Task exists but belongs to another user” and the other says “Task not found”, both with code -32001. Adding TaskNotFoundError alone does not catch this.

These checks explicitly supplied the corpus's capabilities.authentication flag, which the current AgentCapabilities proto does not define. The fixture/applicability contract needs attention too: credentials must distinguish authenticated-but-insufficient access, and the protected task must demonstrably exist for its owner.

I'd propose valid requests, verified credential roles and positive controls, authentication-specific rejection checks, and a targeted protected/missing-task comparison. The existing raw captures and substitutions are sufficient to detect the demonstrated message leak. I'd start verification with JSON-RPC, while keeping cross-binding behavior explicit. Custom JSON-RPC authentication errors and normalization of variable response fields need an agreed contract; I would not assume a universal auth error number or byte-identical bodies.

I'm aware PROVENANCE already documents the missing error_type fields. The contribution would focus on these reproduced false passes and the fixture contract, with corpus changes upstream and verification using the existing ITK implementation.

Would this be a useful bounded follow-up here, coordinated with Jakub's work?

From what I've found out during tests with python sdk, not only this tests are not compliant with A2A spec.
CARD-DISC-002 asserts protocolBinding ∈ {JSONRPC,GRPC,REST}; spec value for that is HTTP+JSON
Part of DM-ART-* tests are using pre 1.0 shapes
Other failing tests on ITK ACTS impl and Python SDK are also mostly caused by the error in the corpus itself (ofc some failures are caused by SDK but they are in minority)

pushNotificationConfig:
url: "{{webhookUrl}}"
expect_error:
code: UnsupportedOperationError

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JakubWorek

Copy link
Copy Markdown
Member

In order to address the issues with correctness of the corpus we propose: #2227

JakubWorek added a commit to a2aproject/a2a-js that referenced this pull request Sep 17, 2026
…nd CI workflows (#715)

# Description

SUT for ACTS conformance tests, mirrors
[python](a2aproject/a2a-python#1230)
Ci workflows, mirrors
[python](a2aproject/a2a-python#1243)

Based on spec: a2aproject/A2A#1882
yarolegovich pushed a commit to a2aproject/a2a-go that referenced this pull request Sep 18, 2026
…436)

# Description

SUT for ACTS conformance tests, mirrors
[python](a2aproject/a2a-python#1230)
Ci workflows, mirrors
[python](a2aproject/a2a-python#1243)

Based on spec: a2aproject/A2A#1882
@astrogilda

Copy link
Copy Markdown

The false passes you reproduced are why I want vectors that need no live system: an input, the expected bytes, positive controls, reject cases. The canonicalization corpus this thread argued over is at a2aproject/a2a-tck#228 under conformance-vectors/a2a-jcs-v01: 57 RFC 8785 vectors with a Python runner and a Go runner. I'd like the pass and fail counts here from a run against your registry's card canonicalizer and signature check. A vector that disagrees with your bytes is the report.

@MoltyCel

Copy link
Copy Markdown
Contributor

astrogilda —
57/57 against our canonicalizer, 0 FAIL. Corpus at PR #228, branch add-a2a-jcs-v01-conformance-vectors, HEAD a7dfbc82b3ae; all 57 files checked sha256 against MANIFEST.json, no deviation.
Three paths exercised, all on the signing side: the raw canonicalize() our verdict signing and envelope store hang off, the card signing bytes from sign_agent_card(), and the card verify bytes from verify_signed_card(). Both card paths apply the same rule: strip top-level signatures, then canonicalize.
Cross-checked with two libraries, our jcs 0.2.1 and the PR runner's rfc8785 0.1.4. 57/57 each, no per-vector divergence, and byte-identical output across the 47 MUST-ACCEPT cases.
Scope, stated plainly: Python only. The Go oracle did not run here, so the result covers one language family.
On false passes. A green first run says little until the harness is shown to fail, so three mutations against the canonicalizer, each run over all 57:
one output key renamed: 54/57, 3 caught
output replaced with {}: 2/57, 55 caught
exceptions suppressed: rejects 2/10, 8 of 10 caught
The two rejects that survive exception suppression are A2-REJECT-003 and A2-REJECT-004. They assert that the canonical form does not carry the key signatures, and in an implementation that strips signatures before canonicalizing, that holds whether or not anything is thrown.
One portability note: run_python.py does not start under Python 3.9, since bytes | None needs 3.10+. Adding from future import annotations makes it run. Our clone is unmodified at a7dfbc82b3ae; that line went into a local copy.
Worth a look on your side: run A2-REJECT-003/004 against an implementation that keeps signatures through canonicalization. That will show whether they assert the rejection you intended or only the stripping behaviour.

Lars

@astrogilda

Copy link
Copy Markdown

Thanks, Lars, for the run, and for the mutations that found this. You were right: both runners passed A2-REJECT-003 and A2-REJECT-004 by checking the fixture, whatever the implementation did.

At 5cf977d on a2aproject/a2a-tck#228 they compare the implementation's signing bytes instead, so keeping signatures fails all four A2 vectors, and run_python.py starts on 3.9. I'd propose listing your canonicalizer in the corpus README as a third rail, with your result and commit.

@MoltyCel

Copy link
Copy Markdown
Contributor

astrogilda —
Re-ran at 5cf977d. Three paths on our side, and they give three different numbers because they are three different things, so the breakdown matters more than any single figure.
The signing-bytes path passes 57/57, including all four A2 vectors. As a negative control I removed the rule that strips top-level signatures before canonicalising, and all four A2 vectors then fail; against a7dfbc8 only two of them were sensitive to that rule. Your change does what you intended it to.
The raw canonicaliser gives 53/57, failing the same four, because the strip rule lives in the caller and not in the primitive. Every real caller of that primitive handles envelopes that carry no signatures field, so nothing live depends on it, though the primitive also accepts a card-shaped input without complaint, which is a trap worth closing on our side.
The verify path gives 49/57, and this is the first time it has been measured separately, since it became its own RFC 8785 implementation on 21 September with no shared code with the jcs library the other two paths use. Seven of its eight failures are its documented refusal to handle non-integer numbers, which it raises on by design. The eighth is a real divergence and your corpus found it: A5-002 carries {"big": 1e+21}, an integral float, so is_integer() returns true, str(int(1e21)) produces 1000000000000000000000, and RFC 8785 asks for 1e+21. The function emits wrong bytes silently there, in a place its own docstring promises an exception. Nothing live is affected, since the committed agent card carries no float and both card paths produce identical bytes on it, and we are fixing it regardless.
That last one is worth having in your argument for the fifth step kind. A canonicalisation vector caught a silent byte divergence in a third implementation, which is the failure mode no live-system test can reach, and it caught it in a path that had never been measured against anything before.
On the README listing: I would rather it carried the per-path breakdown than a single number, and the honest entry is easier to write once the A5-002 fix has landed. Our side identifies as moltrust-api at 2b1703f, with app/signature.py at blob f7193f49 and lib/agent_card_verify.py at blob 9b5c6598, jcs 0.2.1 behind the first two paths and no library behind the third, Python 3.9.6. The blob hashes are there because 2b1703f touches neither file.
The Go oracle changed the same way at 5cf977d, with signingBytes() added and the reject branch comparing string(out) against InputRaw. I have not run it; there is no Go toolchain on this machine, so everything above is Python only. Your PR head has moved to 391c29f since, which is a README-only commit, and the run above is against 5cf977d.
Lars

@astrogilda

Copy link
Copy Markdown

@MoltyCel thank you, Lars, for the re-run and the negative control.

I ran the same control on the TCK's own CARD-SIGN-002 test and it still checked the fixture; 97b0072 on a2aproject/a2a-tck#228 fixes that. Both runners now score each path by its function: your signing path reads 57/57 on card-signing-input, and verify splits into 7 refused and 1 diverged.

After your A5-002 fix, may I list that record in probityai/agent-evidence-vectors RUNS.md and send moltrust-api a pull request adding a pinned CI step?

@MoltyCel

Copy link
Copy Markdown
Contributor

A5-002 is fixed and the verify path is now at 57/57 against 5cf977d, with corpus integrity unchanged at 57 vectors, no sha256 deviation, corpusDigest 2ec93667….
Two changes got it there. The first serialises integral floats through the ECMAScript Number::toString rules in place of str(int(x)), taking CPython's repr as the shortest round-tripping digit string and applying the five formatting cases of ECMA-262 6.1.6.1.20 to its digits and exponent. The second drops the refusal of numbers with a fractional part, since the same routine covers them, and the seven vectors that failed for that reason now pass: A5-001, A5-007, A5-008, A5-010, A5-011, A5-013, A6-005. NaN and both infinities are still rejected, and -0.0 serialises as 0 with the sign bit set, which I checked separately.
The serialiser was measured against three oracles over 945 values, 596 integral floats and 349 non-integral ones drawn across exponents -320 to 308 with the boundary values (5e-324, 1.7976931348623157e308, and the form changes around 1e-7 and 1e21): rfc8785 0.1.4, jcs 0.2.1 and V8 (node v25.8.1) agree with our output on all 945, under both Python 3.9.6 and 3.12.12.
Two suggestions for the set, one cheap and one that needs a decision from you.
The cheap one is a negative counterpart to A5-002, -1e+21, which catches implementations that test the sign before they test integrality; ours passes it now and would have failed it three days ago.
The other is the integer domain above 2^53−1, and fixing the float path made it sharper on our side. json.loads('{"n": 1000000000000000000000}') yields a Python int and never enters the float path, so A5-002 cannot reach it. The oracles disagree there: rfc8785 0.1.4 raises IntegerDomainError, while jcs 0.2.1 and V8 convert to a double, and at 9007199254740993 that conversion drops the digit that separates the literal from its neighbour. We took the refusal reading for the verify path, citing RFC 8785 §3.2.2.3 and the I-JSON range in RFC 7493 §2.2, and that now leaves our own two paths on different rules, because the signing path runs through jcs and would convert. A card carrying such a number is unreachable for us today and no test pins the difference, which is the gap a vector would close. Whichever behaviour the set pins, implementations that took the other reading produce different bytes for the same input without noticing, and I can supply the three oracle outputs for a handful of values above 2^53 so the expected bytes are argued from measurements.
The change is in a working tree without a commit, so the identification stays at moltrust-api 2b1703f with lib/agent_card_verify.py at blob 9b5c6598 until it lands, and I will post the new blob hash when it does.
Lars

@MoltyCel

Copy link
Copy Markdown
Contributor

and re your question eralier, both, yes, with conditions that concern pinning.
For RUNS.md, please pin our side to the commit plus the two blob hashes, since the branch name goes stale and 2b1703f touches neither file, so the commit title on its own points at the wrong change. The record you described is the state before the A5-002 fix, and the numbers after it are in my comment above. The fix has no commit yet, so I would land it first and post the commit and the new lib/agent_card_verify.py blob here, and the entry you publish then names a state that anyone can reproduce.
For the CI step, send the pull request and I will review it quickly. Four things I would like in the workflow from the start: the corpus pinned by commit SHA, every action pinned by SHA, permissions: contents: read with no secrets in scope, and a trigger limited to pull requests that touch app/signature.py or lib/agent_card_verify.py plus a weekly schedule. Scoring each path by its function is the part worth carrying into the step, since one number for a repository with three canonicalisation paths leaves open which path was measured, and ours still differ by four vectors after the fix.
One note on your own pull request while it is open: four required checks are red, and the title validation is the cheapest of them, since it wants a conventional-commits prefix and nothing else.
I will post the commit and the blob hash here the moment the fix lands, so your pull request can pin the step against a state that is green on its first run.
Lars

@MoltyCel

Copy link
Copy Markdown
Contributor

The fix has landed. moltrust-api main is at 9b33b41f11e9221363262599ee1915e0967475ba, with lib/agent_card_verify.py at blob a9e478eff792c8e03c394c780a5efcf01ba0f3c9, and the squash left the blob identical to the one on the pull request head.
Your corpus at 5cf977d against that state: 57/57 on card-verify-input, 57/57 on card-signing-input, and 53/57 on the raw canonicaliser, whose four failures are the a2-signatures-exclusion group and stay open as described earlier. 57 files, no manifest mismatch, corpusDigest 2ec93667b1436537a7f46cf882bae37977dc10face4bb27a2120e2d7aa824da4.
Pin the RUNS.md entry and the CI step to that commit and that blob, and both read green from their first run.
Lars

@MoltyCel

MoltyCel commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

A correction to my comment of 26 September, where I reported 57/57 on both of our paths.
That number depended on a setting in the runner I used. jcs_a2a_runner_5cf977d.py counts any exception on a reject vector as a refusal. Under the class our own module promises for refusals, CardVerificationError, the verify path scored 52/57; under the corpus runner's own default of ValueError, it scored 54/57. The five vectors that separate them are the lone-surrogate cases A3-REJECT-011, A3-REJECT-012 and A4-REJECT-013 to -015, where the path refused the input and raised UnicodeEncodeError instead of its own error class. No output bytes differed anywhere, and the signing path's 57/57 holds under the corpus runner's default as well.
I fixed the cause instead of restating the number. Lone surrogates in values and in keys now raise CardVerificationError, and that class now derives from ValueError, so the verify path reads 57/57 under all three counting rules. Merged at moltrust-api c81b57165d6d62bda1548b55db96fcf75d367db4, with lib/agent_card_verify.py at blob dc908ba47ed9622263484a6fb6f8f2597beddaf8. Byte output is unchanged across 40,115 inputs: 30,099 identical, and every former UnicodeEncodeError now carries the declared class.
Your CI step in #505 ran green on a merge ref that includes the fix, on both Python 3.9 and 3.12: raw canonicaliser 53/53, card signing 57/57, card verify 57/57, with the negative control at 53/57 and all four rule-3 vectors red as intended. Corpus pinned at 97b0072, digest 29b3f2c5…. Getting there turned up a defect of ours that your pinned [email protected] refused where our own @v4 had passed over it: main carried a submodule entry with no .gitmodules. That is removed and merged, at f1e877b5109e6fde6b0d69d13170becf6a171c43.
Two things for the listing. A score for a canonicalisation path means nothing without the refusal classes the runner counted, so the README entry should carry those alongside the number. And the builtins:ValueError declaration in your verify step is no longer needed after this merge, though it costs nothing to leave in.
The number stood uncorrected from 26 September, which is on me.
Lars

@astrogilda

Copy link
Copy Markdown

@MoltyCel, fixed in 7a3197d, on a2aproject/a2a-tck#228. External adapters must now declare --refusal, and types match exactly: declaring ValueError no longer silently includes UnicodeEncodeError. The report records the refusal types and refusalMatch: exact; undeclared exceptions are errored and fail the run.

The 16 new regression tests include all five lone-surrogate cases. The crash negative control now scores 48/53 with five errors and exit status 1. All 389 unit tests and lint pass; the reference targets remain 53/53 and 57/57. Remote CI is green on the new head.

Vector bytes, dispositions and corpus digest are unchanged. The README records your correction and the merged CI. When taking the new pin, name each path's actual refusal type rather than a base class as shorthand.

@astrogilda

Copy link
Copy Markdown

@MoltyCel thank you, Lars, for that correction: you caught that your 57/57 depended on the runner counting any exception as a refusal, and you fixed the cause in c81b571.

It changes what I list. RUNS.md in probityai/agent-evidence-vectors, our public corpus, records outside runs, and your entry will give each path with its refusal class: raw canonicaliser 53/53, card signing 57/57, card verify 57/57 under CardVerificationError.

I'll also drop the builtins:ValueError line from the a2a-jcs-conformance workflow.

@astrogilda

Copy link
Copy Markdown

ooh, good catch on the refusal classes, Lars. I've recorded the corrected result by implementation path, with the MolTrust commit, code blobs, corpus revision and digest pinned: probityai/agent-evidence-vectors@8ef8ddc. Your run stays the external result; Probity is recording it with the classification you actually reported.

next, let's take this through an effect-side check. We now have a native authority-to-ticket run that retains the selected kernel decision, framework tool call, raw HTTP exchange and signed readback together: probityai-archive/agent-evidence-observer#22.

I'd start with one permit and one denial on your own host/key/store/clock/checkpoint setup, with you retaining the result. That gives us a concrete outside-operated comparison. This uses the unsigned kernel; we'll keep JWS issuer verification as its own check.

@MoltyCel

MoltyCel commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Two updates to the entry, and a note on where the numbers come from, since the canonicaliser in app/signature.py forwards to the jcs library and raises nothing of its own. The class that reaches your runner is whatever jcs raises, so I measured it rather than read it off the source.

Across every reject vector on both the raw and the signing path, the result is UnicodeEncodeError on the five lone-surrogate rejects (A3-REJECT-011, A3-REJECT-012, A4-REJECT-013/014/015) and ValueError on the three number rejects (A5-REJECT-016/017/018). Both are declared as of 1e4c4b7c in moltrust-api. Your runner in #228 classifies with type(exc) in refusals, and under that exact-identity rule a declared ValueError leaves UnicodeEncodeError uncovered despite the subclass relationship, which is why both have to be named. The verify path keeps CardVerificationError on its own, the one class our own code raises, and that is what let #526 drop the ValueError line without moving the count.

The four numbers hold on both corpus states: raw canonicaliser 53/53, card signing 57/57, card verify 57/57, negative control 53/57, exit 0 in either direction, and under exact all four records read refusalMatch: exact. Between 97b0072 and 7a3197d only README.md and run_python.py differ, with no vector file changed, so the declarations hold against the bytes the pin evaluates.

One line in the entry has gone stale: "The builtins:ValueError declaration is being removed" happened on 3 October, in #526.

@astrogilda

Copy link
Copy Markdown

@MoltyCel, thanks for catching the stale line, and for measuring which exception classes jcs actually raises. The entry now records #526 and both declarations: https://github.com/probityai/agent-evidence-vectors/blob/1f4fe3ea555a4224305c568cb8acf9a50d0bf774/RUNS.md

This branch has not been deployed

No deployments
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.

9 participants