Skip to main content

Module conformance

Module conformance 

Source
Expand description

A2A v1.0 conformance vector runner.

The spec publishes a set of request/response examples; this module is the loop that drives each one through an A2aRequestHandler and reports the diff. The handler can be the library’s own reference implementation, a third-party server a consumer is auditing, or a fixture for a test.

§Vector format

A vector is a JSON object with name, request, and expected:

{"name": "send-message-happy",
 "request": {"jsonrpc": "2.0", "id": 1, "method": "SendMessage",
             "params": {"message": {...}}},
 "expected": {"result": {...}}}

expected is one of {"result": <value>} for a successful response or {"error": {"code": <i64>, "message_contains": <str>}} for an error response. The message_contains form is the forgiving one: a server is free to add detail, but a runner that asserted the whole message verbatim would couple vectors to a specific implementation’s wording.

Structs§

ExpectedError
The expected error code and a substring the message must contain. The code is exact; the message is a substring match.
JsonlError
Why a JSONL fixture could not be parsed.
ObservedError
The shape of an observed error: the code the server returned and the message it carried. Compared against ExpectedError with == on the code and substring on the message.
Vector
One conformance vector, exactly as it appears in a JSONL fixture file. The shape is a JSON object, one per line.
VectorResult
The outcome of running a single vector. A ConformanceReport is a Vec<VectorResult>.

Enums§

ExpectedResponse
What the server is expected to answer. One of Result (a successful response) or Error (a JSON-RPC error with the code and a substring the message must contain).
ObservedResponse
What the runner actually saw on the wire, in the same shape the fixture uses for expected.
VectorOutcome
What the runner saw when it ran a vector.

Constants§

DEFAULT_PROTOCOL_VERSION
The default protocol version the runner uses when the caller does not specify one. A2A’s 1.0.1 is a patch (no schema changes), so 1.0 is the right default for vectors that pin the spec’s behaviour.

Functions§

parse_jsonl
Parses a JSONL fixture file’s contents into a list of vectors.
run_against_in_process
Runs a list of vectors against a handler, using the in-process serve_jsonrpc adapter.
run_one
Runs a single vector through the supplied router.