diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index fd10ba7859..60c4630312 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -359,8 +359,9 @@ jobs: cache-suffix: agent-py${{ matrix.python-version }} - name: Install the shim against the in-tree core # Agent's lock for its own tools, then Flow's for the core it tests. + # The a2a extra lets the A2A server and signed-card tests run. run: >- - python ../../scripts/ci/locked_install.py --lock 'packages/agent[dev]' --lock 'packages/flow[agent]' + python ../../scripts/ci/locked_install.py --lock 'packages/agent[dev]' --lock 'packages/flow[agent,a2a]' --editable packages/types --editable packages/flow --editable packages/agent - name: Confirm the in-tree Flow is the one installed run: | diff --git a/capabilities/10-computer-use-agents/0070-a2a-agent2agent-protocol-adapter-openadapt-agent.md b/capabilities/10-computer-use-agents/0070-a2a-agent2agent-protocol-adapter-openadapt-agent.md index f2f3ee77a0..d59f7d9bb4 100644 --- a/capabilities/10-computer-use-agents/0070-a2a-agent2agent-protocol-adapter-openadapt-agent.md +++ b/capabilities/10-computer-use-agents/0070-a2a-agent2agent-protocol-adapter-openadapt-agent.md @@ -1 +1 @@ -| A2A (Agent2Agent) protocol adapter: `openadapt agent serve --a2a` serves compiled workflows as A2A 1.0 skills with the official `a2a-sdk` (`openadapt[a2a]`): Agent Card at `/.well-known/agent-card.json`, JSON-RPC and HTTP+JSON, runs as tasks with status updates, the run's receipt as a handoff artifact when Flow wrote one (sandbox and strict at-rest runs have none), a `verify_handoff` skill, and the draft extension `https://openadapt.ai/extensions/handoff-receipt/v1`. Every call passes the MCP server's gate; person confirmations are not served; only `done` is completed. Loopback by default, a bearer token anywhere else, browser `Origin` and unknown `Host` refused | On main ([#2414](https://github.com/OpenAdaptAI/OpenAdapt/pull/2414)) | Synthetic: the official `a2a-sdk` 1.3.1 client against the server over HTTP on 127.0.0.1, with a governed run whose Flow process is stubbed and whose receipt Flow's writer signs; the official A2A TCK (a2aproject/a2a-tck at 5e6f37c): 110 automated checks passed and 11 failed, MUST 76.0%. The failures are 10 SDK-scenario tests that expect the TCK's own scripted agent, and the SDK's error Content-Type ([benchmark/a2a_tck](packages/flow/benchmark/a2a_tck/README.md)) | `openadapt_flow/agent/a2a_server.py`, [A2A.md](packages/flow/docs/A2A.md) | +| A2A (Agent2Agent) protocol adapter: `openadapt agent serve --a2a` serves compiled workflows as A2A 1.0 skills with the official `a2a-sdk` (`openadapt[a2a]`): Agent Card at `/.well-known/agent-card.json`, signed (A2A 1.0 section 8.4, EdDSA JWS by the Seal key that signs receipts; no server if the key can't be opened), JSON-RPC and HTTP+JSON, runs as tasks with status updates, the run's receipt as a handoff artifact when Flow wrote one (sandbox and strict at-rest runs have none), a `verify_handoff` skill, and the draft extension `https://openadapt.ai/extensions/handoff-receipt/v1`. Every call passes the MCP server's gate; person confirmations are not served; only `done` is completed. Loopback by default, a bearer token anywhere else, browser `Origin` and unknown `Host` refused | On main ([#2414](https://github.com/OpenAdaptAI/OpenAdapt/pull/2414)) | Synthetic: the official `a2a-sdk` 1.3.1 client against the server over HTTP on 127.0.0.1, with a governed run whose Flow process is stubbed and whose receipt Flow's writer signs; the official A2A TCK (a2aproject/a2a-tck at 5e6f37c, 2026-11-30, sandbox server with `--a2a-tck-scenarios`): 121 automated checks passed, 0 failed, 142 skipped (gRPC, push, cancel, auth scenarios), MUST 78.7% because the TCK counts skipped and manual checks as not passed ([benchmark/a2a_tck](packages/flow/benchmark/a2a_tck/README.md)); a second implementation, the A2A JavaScript SDK 1.3.0, ran a workflow and verified a second key's handoff over JSON-RPC and HTTP+JSON and checked the card signature with independent JWS and RFC 8785 libraries, all on one computer ([benchmark/a2a_interop](packages/flow/benchmark/a2a_interop/README.md)); the card signature verified by the `a2a-sdk` verifier and refused when changed, unpinned or relabelled (the TCK leaves signing to manual checks) | `openadapt_flow/agent/a2a_server.py`, [A2A.md](packages/flow/docs/A2A.md) | diff --git a/packages/agent/tests/test_handoff_e2e.py b/packages/agent/tests/test_handoff_e2e.py index d0bffb73b3..4b03a2775d 100644 --- a/packages/agent/tests/test_handoff_e2e.py +++ b/packages/agent/tests/test_handoff_e2e.py @@ -10,8 +10,8 @@ Covered: a real run's receipt in the A2A artifact and the MCP tool result; verification of a good, a tampered, an unknown-signer and a swapped-payload handoff; the A2A and MCP gates refusing the same things; no browser Origin -or foreign Host; the extensions header echo; and a follow-up message that -can't approve a run waiting for a person. +or foreign Host; the extensions header echo; a follow-up message that +can't approve a run waiting for a person; and the signed Agent Card. """ from __future__ import annotations @@ -44,6 +44,7 @@ from openadapt_flow.agent.bridge import AgentBridge # noqa: E402 from openadapt_flow.agent.handoff_tools import HandoffTools # noqa: E402 from openadapt_flow.agent.mcp import build_server # noqa: E402 +from openadapt_flow.agent.runner import RunnerConfig # noqa: E402 from openadapt_flow.receipt_record import write_receipt_record # noqa: E402 from openadapt_flow.seal_keys import SoftwareSigner # noqa: E402 @@ -152,9 +153,7 @@ async def _send(url, data, **ids): client = await create_client(url, client_config=ClientConfig(streaming=False)) try: task = None - async for event in client.send_message( - SendMessageRequest(message=_message(data, **ids)) - ): + async for event in client.send_message(SendMessageRequest(message=_message(data, **ids))): if event.HasField("task"): task = event.task assert task is not None @@ -233,9 +232,7 @@ async def scenario(): assert "openings" not in json.dumps(handoff["receipt"]) good = await _send(a2a_url, {"skill": "verify_handoff", "handoff": handoff}) - tampered = await _send( - a2a_url, {"skill": "verify_handoff", "handoff": _tampered(handoff)} - ) + tampered = await _send(a2a_url, {"skill": "verify_handoff", "handoff": _tampered(handoff)}) # The receipt is bound to the run result; stapled to other bytes it fails. restapled = h.make_handoff({"outcome": "done", "amount": 10**6}, handoff["receipt"]) swapped = await _send(a2a_url, {"skill": "verify_handoff", "handoff": restapled}) @@ -244,7 +241,12 @@ async def scenario(): handoff, good, tampered, swapped = asyncio.run(scenario()) assert good["integrity"] == "intact" assert good["signer_roles"] == ["this_computer"] - assert good["outcome"] == "VERIFIED" + # The stubbed run has no read-back, so its receipt says UNKNOWN (receipts + # say VERIFIED only on a level 3 or 4 read). The verdict copies the + # receipt's outcome and never upgrades it. + statement = json.loads(base64.b64decode(handoff["receipt"]["payload"])) + assert statement["predicate"]["outcome"] == "UNKNOWN" + assert good["outcome"] == "UNKNOWN" assert good["what_this_proves"][0] == h.WHAT_A_SIGNATURE_PROVES assert tampered["integrity"] == "refused" and tampered["reason"] == "bad_signature" assert good["payload"]["bound"] is True @@ -309,7 +311,7 @@ def test_a2a_refuses_browsers_and_foreign_hosts_and_echoes_extensions(a2a_url): assert "a2a-extensions" not in httpx.get(card).headers -def test_a2a_off_loopback_needs_a_token_and_hides_workflows(bridge, tmp_path): +def test_a2a_off_loopback_needs_a_token_and_hides_workflows(bridge, signer, tmp_path): with pytest.raises(ValueError, match="needs --a2a-token-file"): a2a_server.A2AConfig(host="0.0.0.0") config = a2a_server.A2AConfig(host="0.0.0.0", port=_free_port(), token="t" * 40) @@ -322,7 +324,9 @@ def test_a2a_off_loopback_needs_a_token_and_hides_workflows(bridge, tmp_path): from starlette.testclient import TestClient - client = TestClient(a2a_server.build_app(bridge, config), base_url=f"http://0.0.0.0:{config.port}") + client = TestClient( + a2a_server.build_app(bridge, config), base_url=f"http://0.0.0.0:{config.port}" + ) body = {"jsonrpc": "2.0", "id": 1, "method": "GetExtendedAgentCard", "params": {}} assert client.post("/a2a/jsonrpc", json=body).status_code == 401 wrong = client.post("/a2a/jsonrpc", json=body, headers={"Authorization": "Bearer nope"}) @@ -333,6 +337,11 @@ def test_a2a_off_loopback_needs_a_token_and_hides_workflows(bridge, tmp_path): headers={"Authorization": "Bearer " + "t" * 40, "A2A-Version": "1.0"}, ) assert ok.status_code == 200 + # Both cards carry a signature by this computer's receipt key. + keys = {signer.key_id: signer.public_raw()} + served = client.get("/.well-known/agent-card.json").json() + assert a2a_server.verify_agent_card(served, keys) == signer.key_id + assert a2a_server.verify_agent_card(ok.json()["result"], keys) == signer.key_id def test_a2a_follow_up_cannot_approve_a_run_waiting_for_a_person( @@ -347,7 +356,11 @@ def test_a2a_follow_up_cannot_approve_a_run_waiting_for_a_person( result = a2a_server.call_remote_tool( bridge, "run_workflow", - {"workflow": next(iter(bridge.catalog)), "inputs": {"note": "x"}, "request_id": "ref-hold-1"}, + { + "workflow": next(iter(bridge.catalog)), + "inputs": {"note": "x"}, + "request_id": "ref-hold-1", + }, ) assert result["outcome"] == "needs_review" assert a2a_server.task_state_for(result["outcome"]) == "TASK_STATE_INPUT_REQUIRED" @@ -465,7 +478,9 @@ def own_record(claim): } ) signer_lines: set[tuple[str, ...]] = set() - reasons: dict[str, set] = {kind: set() for kind in ("true", "fabricated", "differing", "swapped", "unbound")} + reasons: dict[str, set] = { + kind: set() for kind in ("true", "fabricated", "differing", "swapped", "unbound") + } decisions: list[tuple[str, str, float]] = [] class Inbox(BaseHTTPRequestHandler): @@ -546,3 +561,279 @@ async def runs(): # Without its own read, the receiver never accepts on the signature. unchecked = h.decide(h.make_handoff({"ref": "x"}, receipts[0][0], signer=signer), registry) assert unchecked.ok and unchecked.decision == "unchecked" + + +# -- the signed Agent Card -------------------------------------------------------- + + +def _jws_header(signature: dict) -> dict: + protected = signature["protected"] + return json.loads(base64.urlsafe_b64decode(protected + "=" * (-len(protected) % 4))) + + +def test_a2a_agent_card_is_signed_by_the_receipt_key(a2a_url, bridge, signer): + """The served card verifies against the key a receiver pins for receipts.""" + card = httpx.get(a2a_url + "/.well-known/agent-card.json").json() + (signature,) = card["signatures"] + header = _jws_header(signature) + assert header == {"alg": "EdDSA", "kid": signer.key_id, "typ": "JOSE"} + # The kid is the receipt registry's key id, so one pinned key covers both. + assert header["kid"] == bridge.handoffs.registry()[0].key_id + assert a2a_server.verify_agent_card(card, {signer.key_id: signer.public_raw()}) == signer.key_id + + +def test_a2a_agent_card_signature_verifies_with_the_official_sdk(a2a_url, signer): + """Interop: a2a-sdk's own verifier (PyJWT, RFC 8785) accepts the card.""" + pytest.importorskip("jwt") + from a2a.types import AgentCard + from a2a.utils.signing import InvalidSignaturesError, create_signature_verifier + from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey + from google.protobuf.json_format import ParseDict + + data = httpx.get(a2a_url + "/.well-known/agent-card.json").json() + public = Ed25519PublicKey.from_public_bytes(signer.public_raw()) + + def key_for(kid, jku): + assert jku is None + if kid != signer.key_id: + raise KeyError(kid) + return public + + verify = create_signature_verifier(key_for, ["EdDSA"]) + verify(ParseDict(data, AgentCard(), ignore_unknown_fields=True)) + changed = dict(data, description=data["description"] + " (changed)") + with pytest.raises(InvalidSignaturesError): + verify(ParseDict(changed, AgentCard(), ignore_unknown_fields=True)) + + +def test_a2a_agent_card_refuses_tampered_unknown_unsigned_and_wrong_alg(a2a_url, signer): + card = httpx.get(a2a_url + "/.well-known/agent-card.json").json() + keys = {signer.key_id: signer.public_raw()} + other = SoftwareSigner(Ed25519PrivateKey.generate(), "generated") + + tampered = json.loads(json.dumps(card)) + tampered["supportedInterfaces"][0]["url"] = "http://evil.example/a2a/jsonrpc" + with pytest.raises(a2a_server.CardSignatureError): + a2a_server.verify_agent_card(tampered, keys) + # A receiver that pins another key refuses the same card, even though the + # card's own jwk header names the real signer's public key. + with pytest.raises(a2a_server.CardSignatureError): + a2a_server.verify_agent_card(card, {other.key_id: other.public_raw()}) + with pytest.raises(a2a_server.CardSignatureError, match="not signed"): + a2a_server.verify_agent_card({k: v for k, v in card.items() if k != "signatures"}, keys) + # Re-label the signature as another algorithm: refused, never downgraded. + forged = json.loads(json.dumps(card)) + header = dict(_jws_header(forged["signatures"][0]), alg="none") + forged["signatures"][0]["protected"] = ( + base64.urlsafe_b64encode(json.dumps(header).encode()).rstrip(b"=").decode() + ) + with pytest.raises(a2a_server.CardSignatureError): + a2a_server.verify_agent_card(forged, keys) + # A signature by an untrusted key beside a valid one doesn't stop the valid one. + extra = a2a_server.sign_agent_card(_card_message(card), other) + from google.protobuf.json_format import MessageToDict + + both = MessageToDict(extra) + assert len(both["signatures"]) == 2 + assert a2a_server.verify_agent_card(both, keys) == signer.key_id + + +def _card_message(card: dict): + from a2a.types import AgentCard + from google.protobuf.json_format import ParseDict + + return ParseDict(card, AgentCard(), ignore_unknown_fields=True) + + +def test_a2a_will_not_serve_an_unsigned_card_when_the_key_is_unavailable(bridge): + class BrokenHandoffs: + def signer(self): + raise RuntimeError("key_unavailable: the configured Seal key can't be opened") + + bridge.handoffs = BrokenHandoffs() + with pytest.raises(RuntimeError, match="key_unavailable"): + a2a_server.build_app(bridge, a2a_server.A2AConfig(port=_free_port())) + + +def test_a2a_rest_errors_use_the_a2a_media_type(a2a_url): + """TCK HTTP_JSON-SVC-001: HTTP+JSON errors are application/a2a+json (1.0.1).""" + missing = httpx.get(a2a_url + "/a2a/rest/tasks/no-such-task", headers={"A2A-Version": "1.0"}) + assert missing.status_code >= 400 + assert missing.headers["content-type"].split(";")[0] == "application/a2a+json" + assert "error" in missing.json() + # JSON-RPC keeps application/json, and the card is plain JSON. + card = httpx.get(a2a_url + "/.well-known/agent-card.json") + assert card.headers["content-type"].split(";")[0] == "application/json" + + +# -- the A2A TCK's scripted scenarios --------------------------------------------- + + +def test_tck_scenarios_need_sandbox_and_loopback(bridge, monkeypatch): + with pytest.raises(ValueError, match="loopback"): + a2a_server.A2AConfig(host="0.0.0.0", token="t" * 40, tck_scenarios=True) + # Loopback listener, but the card would advertise a public URL: refused. + with pytest.raises(ValueError, match="advertised URL is not loopback"): + a2a_server.A2AConfig(tck_scenarios=True, public_url="https://agent.example.com") + a2a_server.A2AConfig(tck_scenarios=True, public_url="http://localhost:9999") + # The fixture's bridge runs real workflows (production): refused. + with pytest.raises(ValueError, match="--mode sandbox"): + a2a_server.build_app(bridge, a2a_server.A2AConfig(port=_free_port(), tck_scenarios=True)) + # Relabelling that bridge as sandbox is not enough: it is not sandbox-backed. + monkeypatch.setattr(bridge, "mode", "sandbox") + with pytest.raises(ValueError, match="--mode sandbox"): + a2a_server.build_app(bridge, a2a_server.A2AConfig(port=_free_port(), tck_scenarios=True)) + + +@pytest.fixture() +def sandbox_bridge(tmp_path, signer): + from openadapt_flow.agent.sandbox import SandboxEngine + + runs = tmp_path / "sandbox-runs" + runs.mkdir() + bridge = AgentBridge( + None, + RunnerConfig(runs_dir=runs), + sandbox=SandboxEngine(runs, engine="simulated"), + mode="sandbox", + ) + bridge.handoffs = HandoffTools(registry=_registry(signer), signer=signer) + return bridge + + +def _jsonrpc_send(client, message_id): + body = { + "jsonrpc": "2.0", + "id": 1, + "method": "SendMessage", + "params": { + "message": {"messageId": message_id, "role": "ROLE_USER", "parts": [{"text": "x"}]} + }, + } + response = client.post("/a2a/jsonrpc", json=body, headers={"A2A-Version": "1.0"}) + assert response.status_code == 200 + return response.json()["result"] + + +def test_tck_scenarios_answer_only_when_turned_on(sandbox_bridge): + from starlette.testclient import TestClient + + bridge = sandbox_bridge + config = a2a_server.A2AConfig(port=_free_port(), tck_scenarios=True) + client = TestClient(a2a_server.build_app(bridge, config), base_url=config.base_url) + task = _jsonrpc_send(client, "tck-artifact-text-001")["task"] + assert task["status"]["state"] == "TASK_STATE_COMPLETED" + assert task["artifacts"][0]["parts"][0]["text"] == "Generated text content" + url = _jsonrpc_send(client, "tck-artifact-file-url-001")["task"]["artifacts"][0]["parts"][0] + assert url["url"] == "https://example.com/output.txt" and url["filename"] == "output.txt" + data = _jsonrpc_send(client, "tck-artifact-data-001")["task"]["artifacts"][0]["parts"][0] + assert data["data"] == {"key": "value", "count": 42} + message = _jsonrpc_send(client, "tck-message-response-001") + assert "task" not in message + assert message["message"]["parts"][0]["text"] == "Direct message response" + + # Off by default: the same message is an ordinary request, not a script. + off = a2a_server.A2AConfig(port=_free_port()) + plain = TestClient(a2a_server.build_app(bridge, off), base_url=off.base_url) + task = _jsonrpc_send(plain, "tck-artifact-text-001")["task"] + assert "Generated text content" not in json.dumps(task) + + +# -- canonical card bytes (A2A 1.0 section 8.4.1) --------------------------------- + + +def test_canonical_card_follows_the_spec_presence_rules(): + """The spec's worked example: REQUIRED fields stay even when empty, an + explicitly set optional field stays at its default, and an empty repeated + field that isn't REQUIRED goes. The expected bytes are written out by hand; + the other REQUIRED fields the example leaves out appear at their defaults.""" + example = { + "name": "Example Agent", + "description": "", + "capabilities": {"streaming": False, "pushNotifications": False, "extensions": []}, + "skills": [], + } + assert a2a_server.canonical_card_bytes(example) == ( + b'{"capabilities":{"pushNotifications":false,"streaming":false},' + b'"defaultInputModes":[],"defaultOutputModes":[],"description":"",' + b'"name":"Example Agent","skills":[],"supportedInterfaces":[],"version":""}' + ) + with pytest.raises(ValueError, match="schema"): + a2a_server.canonical_card_bytes(dict(example, notAField=1)) + + +def test_a_token_cards_bearer_requirement_is_signed(bridge, signer): + config = a2a_server.A2AConfig(host="0.0.0.0", port=_free_port(), token="t" * 40) + card = a2a_server.sign_agent_card(a2a_server.build_agent_card(bridge, config), signer) + from google.protobuf.json_format import MessageToDict + + served = MessageToDict(card) + assert served["securityRequirements"] + assert b'"securityRequirements":[{"schemes":{"bearer":{}}}]' in a2a_server.canonical_card_bytes( + served + ) + keys = {signer.key_id: signer.public_raw()} + assert a2a_server.verify_agent_card(served, keys) == signer.key_id + # Dropping the bearer requirement changes the signed bytes. + stripped = {k: v for k, v in served.items() if k != "securityRequirements"} + with pytest.raises(a2a_server.CardSignatureError): + a2a_server.verify_agent_card(stripped, keys) + + +def _signed_with_header(card: dict, signer, header: dict, unprotected=None) -> dict: + protected = base64.urlsafe_b64encode(json.dumps(header).encode()).rstrip(b"=").decode() + payload = base64.urlsafe_b64encode(a2a_server.canonical_card_bytes(card)).rstrip(b"=").decode() + signature = ( + base64.urlsafe_b64encode(signer.sign(f"{protected}.{payload}".encode("ascii"))) + .rstrip(b"=") + .decode() + ) + item = {"protected": protected, "signature": signature} + if unprotected is not None: + item["header"] = unprotected + return dict(card, signatures=[item]) + + +def test_card_verifier_checks_the_whole_jose_header(a2a_url, signer): + """RFC 7515 section 5.2: a genuine signature by a pinned key is still + refused when its header carries a parameter this verifier doesn't support.""" + card = { + k: v + for k, v in httpx.get(a2a_url + "/.well-known/agent-card.json").json().items() + if k != "signatures" + } + keys = {signer.key_id: signer.public_raw()} + base = {"alg": "EdDSA", "kid": signer.key_id, "typ": "JOSE"} + assert ( + a2a_server.verify_agent_card(_signed_with_header(card, signer, base), keys) == signer.key_id + ) + assert ( + a2a_server.verify_agent_card( + _signed_with_header(card, signer, {"alg": "EdDSA", "kid": signer.key_id}), keys + ) + == signer.key_id + ) + for header, unprotected in ( + (dict(base, crit=["exp"], exp=1), None), + (dict(base, crit=["b64"], b64=False), None), + (dict(base, jku="https://evil.example/jwks.json"), None), + (dict(base, typ="JWT"), None), + (base, {"kid": "someone-else"}), + (base, {"crit": ["exp"]}), + (base, {"alg": "none"}), + ): + with pytest.raises(a2a_server.CardSignatureError): + a2a_server.verify_agent_card( + _signed_with_header(card, signer, header, unprotected), keys + ) + + +def test_guard_errors_use_the_a2a_media_type_on_rest(a2a_url): + rest = httpx.get(a2a_url + "/a2a/rest/tasks/x", headers={"Origin": "https://evil.example"}) + assert rest.status_code == 403 + assert rest.headers["content-type"].split(";")[0] == "application/a2a+json" + foreign = httpx.get(a2a_url + "/a2a/rest/tasks/x", headers={"Host": "evil.example"}) + assert foreign.status_code == 421 + assert foreign.headers["content-type"].split(";")[0] == "application/a2a+json" + rpc = httpx.post(a2a_url + "/a2a/jsonrpc", json={}, headers={"Origin": "https://evil.example"}) + assert rpc.headers["content-type"].split(";")[0] == "application/json" diff --git a/packages/flow/benchmark/a2a_interop/.gitignore b/packages/flow/benchmark/a2a_interop/.gitignore new file mode 100644 index 0000000000..c2658d7d1b --- /dev/null +++ b/packages/flow/benchmark/a2a_interop/.gitignore @@ -0,0 +1 @@ +node_modules/ diff --git a/packages/flow/benchmark/a2a_interop/2026-11-30/evidence.json b/packages/flow/benchmark/a2a_interop/2026-11-30/evidence.json new file mode 100644 index 0000000000..29ead2c033 --- /dev/null +++ b/packages/flow/benchmark/a2a_interop/2026-11-30/evidence.json @@ -0,0 +1,55 @@ +{ + "date": "2026-11-30", + "server": { + "command": "openadapt-agent serve --a2a --sandbox-engine simulated --handoff-keys REGISTRY", + "openadapt_flow": "4.0.1" + }, + "client": { + "node": "v22.22.0", + "packages": { + "@a2a-js/sdk": "1.3.0", + "canonicalize": "2.1.0", + "jose": "6.2.19" + } + }, + "results": { + "card": { + "signed_by_pinned_key": true, + "tampered_refused": true, + "other_key_refused": true, + "spec_example_canonical": true + }, + "JSONRPC": { + "run_completed": true, + "run_state": 3, + "run_artifacts": [ + "run_result" + ], + "run_status_text": "Simulated sandbox result (no app was opened): Saved the change and read the record back to confirm it.", + "run_outcome": "done", + "handoff_integrity": "intact", + "handoff_signer_roles": [ + "customer_key" + ], + "handoff_outcome": "UNKNOWN", + "tampered_integrity": "refused", + "tampered_reason": "bad_signature" + }, + "HTTP+JSON": { + "run_completed": true, + "run_state": 3, + "run_artifacts": [ + "run_result" + ], + "run_status_text": "Simulated sandbox result (no app was opened): Saved the change and read the record back to confirm it.", + "run_outcome": "done", + "handoff_integrity": "intact", + "handoff_signer_roles": [ + "customer_key" + ], + "handoff_outcome": "UNKNOWN", + "tampered_integrity": "refused", + "tampered_reason": "bad_signature" + } + } +} diff --git a/packages/flow/benchmark/a2a_interop/README.md b/packages/flow/benchmark/a2a_interop/README.md new file mode 100644 index 0000000000..03e0ae83d6 --- /dev/null +++ b/packages/flow/benchmark/a2a_interop/README.md @@ -0,0 +1,56 @@ +# A second A2A implementation against `openadapt-agent serve --a2a` + +The other tests of the A2A adapter use the Python `a2a-sdk`, which the server +is also built on. This check uses an implementation that shares no code with +OpenAdapt or the Python SDK: + +- **Client.** The official A2A JavaScript SDK, `@a2a-js/sdk` (Apache-2.0). +- **Card signature.** Checked with `jose` (MIT) for the JWS and `canonicalize` + (Apache-2.0) for RFC 8785. Neither the server nor the Python SDK uses them. + +The exact versions are pinned in `package-lock.json`. Nothing is copied into +this repository; `npm ci` installs them. + +## What it does + +`run_interop.py` does the setup and starts the server, and then `interop.mjs` +runs the checks: + +1. Party A, a second key, signs a run receipt and a handoff document. +2. The sandbox server starts with `--handoff-keys` pinning Party A's key as + `customer_key`. The client pins the server's card key, which is the Seal + key that signs this computer's receipts. +3. The client checks the card signature. It also checks that a card with a + changed interface URL is refused, and so is a key it didn't pin. +4. Over JSON-RPC and again over HTTP+JSON, the client: + - runs `add_triage_note` (sandbox, simulated engine); + - sends Party A's handoff to `verify_handoff`; + - sends the same handoff with one signature byte changed. + +```bash +npm ci +python run_interop.py --out 2026-11-30 +``` + +## Result (2026-11-30, `2026-11-30/evidence.json`) + +| Check | JSON-RPC | HTTP+JSON | +|---|---|---| +| Card signed by the pinned key | yes | (same card) | +| Changed card refused, unpinned key refused | yes | (same card) | +| Section 8.4.1 worked example canonicalized as the spec gives it | yes | (no server) | +| Run completed with outcome `done` | yes | yes | +| Party A's handoff: integrity | `intact`, signer role `customer_key` | `intact`, signer role `customer_key` | +| Handoff with a changed signature | refused, `bad_signature` | refused, `bad_signature` | + +The handoff's outcome is `UNKNOWN` because Party A's receipt comes from a +report with no read-back. The verdict copies the receipt's outcome and never +upgrades it. + +## What it doesn't show + +- **The run carries no receipt.** The sandbox run is simulated and goes + through no Flow CLI process. +- **Both parties are on one computer.** Party A is a second key there, not + another organisation's system. No handoff has yet gone to a real outside + party. diff --git a/packages/flow/benchmark/a2a_interop/interop.mjs b/packages/flow/benchmark/a2a_interop/interop.mjs new file mode 100644 index 0000000000..117edb9dab --- /dev/null +++ b/packages/flow/benchmark/a2a_interop/interop.mjs @@ -0,0 +1,206 @@ +// A second A2A implementation talks to `openadapt-agent serve --a2a`. +// +// The client is the official A2A JavaScript SDK (@a2a-js/sdk). The card +// signature is checked with jose (JWS) and canonicalize (RFC 8785), neither of +// which OpenAdapt or the Python a2a-sdk uses. Usage: +// +// node interop.mjs URL PINNED_CARD_KEY.json HANDOFF.json +// +// PINNED_CARD_KEY.json is {"kid": ..., "jwk": {...}}: the key the client chose +// to trust for this server's card. HANDOFF.json is a handoff document signed by +// another party whose key the server trusts. Prints one JSON result object. + +import { readFileSync } from "node:fs"; +import { randomUUID } from "node:crypto"; +import canonicalize from "canonicalize"; +import { base64url, flattenedVerify, importJWK } from "jose"; +import { Role, TaskState } from "@a2a-js/sdk"; +import { ClientFactory, ClientFactoryOptions } from "@a2a-js/sdk/client"; + +const [url, pinnedPath, handoffPath] = process.argv.slice(2); +const pinned = JSON.parse(readFileSync(pinnedPath, "utf8")); +const handoff = JSON.parse(readFileSync(handoffPath, "utf8")); +const results = {}; + +// -- the card signature (A2A 1.0 section 8.4) --------------------------------------- + +// Field presence for canonicalization (section 8.4.1, rule 1), written from the +// spec and the lf.a2a.v1 proto, not from OpenAdapt's code. For each message type: +// `req` lists REQUIRED fields and the default each takes when absent (kept even +// when empty), `msg` names the type of each message-valued field (`[T]` for a +// repeated field, `{T}` for a map), `rep` lists repeated scalar fields, and +// `implicit` lists scalar fields without explicit presence (dropped at their +// default). Everything else present in the served JSON was set, so it stays. +const SCHEMA = { + AgentCard: { + req: { name: "", description: "", supportedInterfaces: [], version: "", capabilities: {}, + defaultInputModes: [], defaultOutputModes: [], skills: [] }, + msg: { supportedInterfaces: "[AgentInterface]", provider: "AgentProvider", + capabilities: "AgentCapabilities", securitySchemes: "{SecurityScheme}", + securityRequirements: "[SecurityRequirement]", skills: "[AgentSkill]" }, + rep: [], + }, + AgentInterface: { req: { url: "", protocolBinding: "", protocolVersion: "" }, implicit: ["tenant"] }, + AgentProvider: { req: { url: "", organization: "" } }, + AgentCapabilities: { msg: { extensions: "[AgentExtension]" } }, + AgentExtension: { implicit: ["uri", "description", "required"] }, + AgentSkill: { + req: { id: "", name: "", description: "", tags: [] }, + rep: ["examples", "inputModes", "outputModes"], + msg: { securityRequirements: "[SecurityRequirement]" }, + }, + SecurityRequirement: { msg: { schemes: "{StringList}" } }, + StringList: { rep: ["list"] }, + SecurityScheme: { + msg: { apiKeySecurityScheme: "APIKeySecurityScheme", httpAuthSecurityScheme: "HTTPAuthSecurityScheme", + oauth2SecurityScheme: "OAuth2SecurityScheme", + openIdConnectSecurityScheme: "OpenIdConnectSecurityScheme", mtlsSecurityScheme: "MutualTls" }, + }, + APIKeySecurityScheme: { req: { location: "", name: "" }, implicit: ["description"] }, + HTTPAuthSecurityScheme: { req: { scheme: "" }, implicit: ["description", "bearerFormat"] }, + OAuth2SecurityScheme: { req: { flows: {} }, implicit: ["description", "oauth2MetadataUrl"] }, + OpenIdConnectSecurityScheme: { req: { openIdConnectUrl: "" }, implicit: ["description"] }, + MutualTls: { implicit: ["description"] }, +}; + +const isDefault = (v) => v === "" || v === false || v === 0 || v === null; + +function present(value, type) { + const spec = SCHEMA[type]; + if (!spec) return value; // a type with no rules here (e.g. OAuthFlows) is kept as served + const out = {}; + for (const [k, v] of Object.entries(value ?? {})) { + const kind = spec.msg?.[k]; + if (kind?.startsWith("[")) { + const items = v.map((item) => present(item, kind.slice(1, -1))); + if (items.length || k in (spec.req ?? {})) out[k] = items; + } else if (kind?.startsWith("{")) { + const entries = Object.entries(v).map(([mk, mv]) => [mk, present(mv, kind.slice(1, -1))]); + if (entries.length || k in (spec.req ?? {})) out[k] = Object.fromEntries(entries); + } else if (kind) { + out[k] = present(v, kind); + } else if (spec.rep?.includes(k)) { + if (v.length || k in (spec.req ?? {})) out[k] = v; + } else if (spec.implicit?.includes(k)) { + if (!isDefault(v)) out[k] = v; + } else { + out[k] = v; + } + } + for (const [k, d] of Object.entries(spec.req ?? {})) { + if (!(k in out)) out[k] = typeof d === "object" && !Array.isArray(d) && spec.msg?.[k] ? present({}, spec.msg[k]) : d; + } + return out; +} + +// The only JOSE header parameters accepted (RFC 7515 section 5.2): no crit, +// no jku, and no name in both the protected and unprotected headers. +function headerOk(header, unprotected) { + const prot = Object.keys(header); + const unprot = Object.keys(unprotected ?? {}); + return prot.every((k) => ["alg", "kid", "typ"].includes(k)) + && unprot.every((k) => k === "jwk") + && !unprot.some((k) => prot.includes(k)) + && (header.typ === undefined || header.typ === "JOSE"); +} + +async function verifyCard(card, key) { + const { signatures, ...rest } = card; + const payload = base64url.encode(canonicalize(present(rest, "AgentCard"))); + for (const s of signatures ?? []) { + const header = JSON.parse(new TextDecoder().decode(base64url.decode(s.protected))); + if (!headerOk(header, s.header) || header.alg !== "EdDSA" || header.kid !== pinned.kid) continue; + try { + await flattenedVerify({ protected: s.protected, payload, signature: s.signature }, key, { + algorithms: ["EdDSA"], + }); + return header.kid; + } catch { + // try the next signature + } + } + return null; +} + +const card = await (await fetch(`${url}/.well-known/agent-card.json`)).json(); +const key = await importJWK(pinned.jwk, "EdDSA"); +const tampered = structuredClone(card); +tampered.supportedInterfaces[0].url = "http://evil.example/a2a/jsonrpc"; +const other = await importJWK( + { kty: "OKP", crv: "Ed25519", x: base64url.encode(new Uint8Array(32).fill(7)) }, + "EdDSA", +); +results.card = { + signed_by_pinned_key: (await verifyCard(card, key)) === pinned.kid, + tampered_refused: (await verifyCard(tampered, key)) === null, + other_key_refused: (await verifyCard(card, other)) === null, + // The spec's worked example (section 8.4.1), plus the REQUIRED fields it leaves out. + spec_example_canonical: + canonicalize(present({ name: "Example Agent", description: "", + capabilities: { streaming: false, pushNotifications: false, extensions: [] }, skills: [] }, "AgentCard")) + === '{"capabilities":{"pushNotifications":false,"streaming":false},"defaultInputModes":[],' + + '"defaultOutputModes":[],"description":"","name":"Example Agent","skills":[],' + + '"supportedInterfaces":[],"version":""}', +}; + + +// -- runs and handoffs over both bindings ------------------------------------------- + +function message(data) { + return { + messageId: randomUUID(), + contextId: "", + taskId: "", + role: Role.ROLE_USER, + parts: [{ content: { $case: "data", value: data }, metadata: undefined, filename: "", mediaType: "application/json" }], + metadata: undefined, + extensions: [], + referenceTaskIds: [], + }; +} + +function artifactData(task, name) { + const artifact = (task.artifacts ?? []).find((a) => a.name === name); + const part = artifact?.parts.find((p) => p.content?.$case === "data"); + return part?.content.value; +} + +function tamper(doc) { + const copy = structuredClone(doc); + const sig = copy.receipt.signatures[0].sig; + copy.receipt.signatures[0].sig = (sig[0] === "A" ? "B" : "A") + sig.slice(1); + return copy; +} + +for (const transport of ["JSONRPC", "HTTP+JSON"]) { + const factory = new ClientFactory( + ClientFactoryOptions.createFrom(ClientFactoryOptions.default, { preferredTransports: [transport] }), + ); + const client = await factory.createFromUrl(url); + const send = (data) => client.sendMessage({ tenant: "", message: message(data), configuration: undefined, metadata: undefined }); + + const run = await send({ + skill: "add_triage_note", + inputs: { note: "Made-up triage note for an interop test.", sandbox_case: "normal" }, + request_id: `interop-${transport.replace(/[^A-Za-z0-9]/g, "")}-${randomUUID()}`, + }); + const runResult = artifactData(run, "run_result"); + const good = await send({ skill: "verify_handoff", handoff }); + const bad = await send({ skill: "verify_handoff", handoff: tamper(handoff) }); + const goodVerdict = artifactData(good, "verdict"); + const badVerdict = artifactData(bad, "verdict"); + results[transport] = { + run_completed: run.status?.state === TaskState.TASK_STATE_COMPLETED, + run_state: run.status?.state ?? null, + run_artifacts: (run.artifacts ?? []).map((a) => a.name), + run_status_text: run.status?.message?.parts?.map((p) => p.content?.value).join(" ") ?? null, + run_outcome: runResult?.outcome ?? null, + handoff_integrity: goodVerdict?.integrity ?? null, + handoff_signer_roles: goodVerdict?.signer_roles ?? null, + handoff_outcome: goodVerdict?.outcome ?? null, + tampered_integrity: badVerdict?.integrity ?? null, + tampered_reason: badVerdict?.reason ?? null, + }; +} + +console.log(JSON.stringify(results, null, 2)); diff --git a/packages/flow/benchmark/a2a_interop/package-lock.json b/packages/flow/benchmark/a2a_interop/package-lock.json new file mode 100644 index 0000000000..1cc762c552 --- /dev/null +++ b/packages/flow/benchmark/a2a_interop/package-lock.json @@ -0,0 +1,80 @@ +{ + "name": "openadapt-a2a-interop", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "openadapt-a2a-interop", + "dependencies": { + "@a2a-js/sdk": "1.3.0", + "canonicalize": "2.1.0", + "jose": "6.2.19" + } + }, + "node_modules/@a2a-js/sdk": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@a2a-js/sdk/-/sdk-1.3.0.tgz", + "integrity": "sha512-OpK4nygUnLKlpTFZlM2IrYu7f3c/B7c4u4Z14+vgMq24lEINTVCxH/BqZx+GL92rNf7CoBL5oTP5UhNsl75yyg==", + "license": "Apache-2.0", + "dependencies": { + "jose": "^6.2.3" + }, + "bin": { + "a2a-db": "dist/cli/a2a_db.js" + }, + "engines": { + "node": ">=20" + }, + "peerDependencies": { + "@bufbuild/protobuf": "^2.10.2", + "@grpc/grpc-js": "^1.11.0", + "better-sqlite3": "^12.0.0 || ^13.0.0", + "express": "^4.21.2 || ^5.1.0", + "kysely": "^0.28.17 || ^0.29.0", + "mysql2": "^3.0.0", + "pg": "^8.0.0" + }, + "peerDependenciesMeta": { + "@bufbuild/protobuf": { + "optional": true + }, + "@grpc/grpc-js": { + "optional": true + }, + "better-sqlite3": { + "optional": true + }, + "express": { + "optional": true + }, + "kysely": { + "optional": true + }, + "mysql2": { + "optional": true + }, + "pg": { + "optional": true + } + } + }, + "node_modules/canonicalize": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/canonicalize/-/canonicalize-2.1.0.tgz", + "integrity": "sha512-F705O3xrsUtgt98j7leetNhTWPe+5S72rlL5O4jA1pKqBVQ/dT1O1D6PFxmSXvc0SUOinWS57DKx0I3CHrXJHQ==", + "license": "Apache-2.0", + "bin": { + "canonicalize": "bin/canonicalize.js" + } + }, + "node_modules/jose": { + "version": "6.2.19", + "resolved": "https://registry.npmjs.org/jose/-/jose-6.2.19.tgz", + "integrity": "sha512-NnThKzdK4dJTUQOBoMB0bF3Xmw4EtbFTo4xzeLaoBwcuOdBVDQcKB3/86DUTWjVMXkZOdaqZVo2OU6DllhS+9Q==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + } + } +} diff --git a/packages/flow/benchmark/a2a_interop/package.json b/packages/flow/benchmark/a2a_interop/package.json new file mode 100644 index 0000000000..5fbcf2fabc --- /dev/null +++ b/packages/flow/benchmark/a2a_interop/package.json @@ -0,0 +1,10 @@ +{ + "name": "openadapt-a2a-interop", + "private": true, + "type": "module", + "dependencies": { + "@a2a-js/sdk": "1.3.0", + "canonicalize": "2.1.0", + "jose": "6.2.19" + } +} diff --git a/packages/flow/benchmark/a2a_interop/run_interop.py b/packages/flow/benchmark/a2a_interop/run_interop.py new file mode 100644 index 0000000000..cadf992525 --- /dev/null +++ b/packages/flow/benchmark/a2a_interop/run_interop.py @@ -0,0 +1,184 @@ +"""Run interop.mjs (the A2A JavaScript SDK) against ``openadapt-agent serve --a2a``. + +Prepares a handoff signed by another party, starts the sandbox server trusting +that party's key, and writes ``/evidence.json``. Needs Node 20+ with +``npm ci`` run in this folder, and openadapt-flow with the a2a extra: + + python run_interop.py [--out 2026-11-30] +""" + +from __future__ import annotations + +import argparse +import base64 +import datetime as dt +import json +import os +import shutil +import socket +import subprocess +import sys +import tempfile +import time +import urllib.request +from pathlib import Path + +from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey + +HERE = Path(__file__).resolve().parent + + +def _free_port() -> int: + with socket.socket() as sock: + sock.bind(("127.0.0.1", 0)) + return sock.getsockname()[1] + + +def _other_party_handoff(work: Path) -> tuple[dict, dict]: + """A run receipt and handoff signed by Party A's key, and the registry + entry the server pins for Party A.""" + from openadapt_types import receipt as r + + from openadapt_flow import handoff as h + from openadapt_flow.receipt_record import write_receipt_record + from openadapt_flow.seal_keys import SoftwareSigner + + party = SoftwareSigner(Ed25519PrivateKey.generate(), "generated") + run = work / "party-a-run" + run.mkdir() + report = { + "workflow_name": "Interop handoff", + "execution_outcome": "VERIFIED", + "transaction_outcome": "VERIFIED", + "success": True, + "production_eligible": True, + "started_at": "2026-11-30T12:00:00Z", + "results": [{"step_id": "s1", "intent": "Open the record", "ok": True}], + } + (run / "report.json").write_text(json.dumps(report), encoding="utf-8") + write_receipt_record(run, signer=party, flow_version="interop") + document = h.make_handoff( + {"outcome": "done", "ref": "interop-0001"}, h.receipt_for_run(run), signer=party + ) + registry = { + "schema": r.REGISTRY_SCHEMA, + "keys": [{**party.registry_entry(), "role": "customer_key", "org": "Party A"}], + } + return document, registry + + +def _card_key(seal_home: Path) -> dict: + from openadapt_flow.offline_seal import signer_for + + signer = signer_for(seal_home) + x = base64.urlsafe_b64encode(signer.public_raw()).rstrip(b"=").decode() + return {"kid": signer.key_id, "jwk": {"kty": "OKP", "crv": "Ed25519", "x": x}} + + +def main() -> int: + parser = argparse.ArgumentParser(allow_abbrev=False) + parser.add_argument("--out", default=dt.date.today().isoformat()) + args = parser.parse_args() + node = shutil.which("node") + if node is None or not (HERE / "node_modules").is_dir(): + print("needs node and `npm ci` in this folder", file=sys.stderr) + return 2 + with tempfile.TemporaryDirectory() as tmp: + work = Path(tmp) + seal_home = work / "seal-home" + seal_home.mkdir() + document, registry = _other_party_handoff(work) + (work / "handoff.json").write_text(json.dumps(document), encoding="utf-8") + (work / "registry.json").write_text(json.dumps(registry), encoding="utf-8") + env = dict(os.environ, OPENADAPT_SEAL_HOME=str(seal_home)) + (work / "card-key.json").write_text( + json.dumps(_card_key(seal_home)), encoding="utf-8" + ) + port = _free_port() + server = subprocess.Popen( + [ + shutil.which("openadapt-agent") or "openadapt-agent", + "serve", + "--a2a", + "--a2a-port", + str(port), + "--sandbox-engine", + "simulated", + "--handoff-keys", + str(work / "registry.json"), + ], + env=env, + stdout=subprocess.DEVNULL, + stderr=subprocess.PIPE, + text=True, + ) + url = f"http://127.0.0.1:{port}" + try: + deadline = time.monotonic() + 30 + while True: + try: + urllib.request.urlopen( + url + "/.well-known/agent-card.json", timeout=2 + ) + break + except OSError: + if time.monotonic() > deadline or server.poll() is not None: + print( + server.stderr.read() if server.stderr else "", + file=sys.stderr, + ) + return 1 + time.sleep(0.3) + done = subprocess.run( + [ + node, + str(HERE / "interop.mjs"), + url, + str(work / "card-key.json"), + str(work / "handoff.json"), + ], + cwd=HERE, + capture_output=True, + text=True, + timeout=300, + ) + finally: + server.terminate() + server.wait(timeout=10) + if done.returncode != 0: + print(done.stderr, file=sys.stderr) + return done.returncode + results = json.loads(done.stdout) + lock = json.loads((HERE / "package-lock.json").read_text(encoding="utf-8")) + versions = { + name.split("node_modules/")[-1]: meta["version"] + for name, meta in lock["packages"].items() + if name.startswith("node_modules/") + } + from openadapt_flow import __version__ as flow_version + + evidence = { + "date": args.out, + "server": { + "command": "openadapt-agent serve --a2a --sandbox-engine simulated --handoff-keys REGISTRY", + "openadapt_flow": flow_version, + }, + "client": { + "node": subprocess.run( + [node, "--version"], capture_output=True, text=True + ).stdout.strip(), + "packages": versions, + }, + "results": results, + } + out = HERE / args.out + out.mkdir(exist_ok=True) + (out / "evidence.json").write_text( + json.dumps(evidence, indent=2) + "\n", encoding="utf-8" + ) + print(json.dumps(evidence, indent=2)) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/packages/flow/benchmark/a2a_tck/2026-11-30/compatibility.json b/packages/flow/benchmark/a2a_tck/2026-11-30/compatibility.json new file mode 100644 index 0000000000..cc657917c2 --- /dev/null +++ b/packages/flow/benchmark/a2a_tck/2026-11-30/compatibility.json @@ -0,0 +1,1716 @@ +{ + "summary": { + "score_scope": "automated", + "manual_verification_required": [ + "CARD-CLIENT-001", + "CARD-SIGN-001", + "CARD-SIGN-002", + "CARD-SIGN-003", + "CARD-SIGN-004", + "AUTH-TLS-001", + "AUTH-TLS-002", + "AUTH-SERVER-001", + "BIND-CUSTOM-002" + ], + "timestamp": "2026-11-30T19:53:39.858728+00:00", + "sut_url": "http://localhost:9999", + "spec_version": "", + "overall_compatibility": "78.6%", + "must_compatibility": "78.7%", + "should_compatibility": "71.4%", + "may_compatibility": "100.0%" + }, + "per_requirement": { + "CARD-DISC-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "agent_card": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/agent_card/test_agent_card.py::TestAgentCardDiscovery::test_agent_card_retrievable" + ] + }, + "CARD-STRUCT-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "agent_card": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/agent_card/test_agent_card.py::TestAgentCardStructure::test_agent_card_validates_against_schema", + "tests/compatibility/agent_card/test_agent_card.py::TestAgentCardStructure::test_required_fields_present" + ] + }, + "CARD-PROTO-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "agent_card": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/agent_card/test_agent_card.py::TestAgentCardProtocol::test_supported_interfaces_non_empty" + ] + }, + "CARD-PROTO-002": { + "level": "MUST", + "status": "PASS", + "transports": { + "agent_card": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/agent_card/test_agent_card.py::TestAgentCardProtocol::test_each_interface_validates_against_schema" + ] + }, + "BIND-FIELD-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "agent_card": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/agent_card/test_agent_card.py::TestBindingFieldDeclaration::test_all_protocols_declared" + ] + }, + "BIND-CUSTOM-001": { + "level": "SHOULD", + "status": "SKIPPED", + "transports": { + "agent_card": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/agent_card/test_agent_card.py::TestCustomBindingIdentifiers::test_custom_binding_identifiers_are_uris" + ] + }, + "CARD-CACHE-001": { + "level": "SHOULD", + "status": "PASS", + "transports": { + "agent_card": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/agent_card/test_agent_card_caching.py::TestAgentCardCacheControl::test_cache_control_has_max_age", + "tests/compatibility/agent_card/test_agent_card_caching.py::TestAgentCardCacheControl::test_cache_control_present" + ] + }, + "CARD-CACHE-002": { + "level": "SHOULD", + "status": "PASS", + "transports": { + "agent_card": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/agent_card/test_agent_card_caching.py::TestAgentCardETag::test_etag_present" + ] + }, + "CARD-CACHE-003": { + "level": "MAY", + "status": "SKIPPED", + "transports": { + "agent_card": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/agent_card/test_agent_card_caching.py::TestAgentCardLastModified::test_last_modified_present" + ] + }, + "DM-ART-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_artifacts.py::TestDataArtifact::test_task_has_data_artifact[grpc]", + "tests/compatibility/core_operations/test_artifacts.py::TestDataArtifact::test_task_has_data_artifact[http_json]", + "tests/compatibility/core_operations/test_artifacts.py::TestDataArtifact::test_task_has_data_artifact[jsonrpc]", + "tests/compatibility/core_operations/test_artifacts.py::TestFileArtifact::test_task_has_file_artifact[grpc]", + "tests/compatibility/core_operations/test_artifacts.py::TestFileArtifact::test_task_has_file_artifact[http_json]", + "tests/compatibility/core_operations/test_artifacts.py::TestFileArtifact::test_task_has_file_artifact[jsonrpc]", + "tests/compatibility/core_operations/test_artifacts.py::TestFileUrlArtifact::test_task_has_file_url_artifact[grpc]", + "tests/compatibility/core_operations/test_artifacts.py::TestFileUrlArtifact::test_task_has_file_url_artifact[http_json]", + "tests/compatibility/core_operations/test_artifacts.py::TestFileUrlArtifact::test_task_has_file_url_artifact[jsonrpc]", + "tests/compatibility/core_operations/test_artifacts.py::TestTextArtifact::test_task_has_text_artifact[grpc]", + "tests/compatibility/core_operations/test_artifacts.py::TestTextArtifact::test_task_has_text_artifact[http_json]", + "tests/compatibility/core_operations/test_artifacts.py::TestTextArtifact::test_task_has_text_artifact[jsonrpc]", + "tests/compatibility/core_operations/test_data_model.py::TestSendMessageResponseSchema::test_response_validates_against_schema" + ] + }, + "DM-MSG-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_artifacts.py::TestMessageResponse::test_returns_message_with_text_part[grpc]", + "tests/compatibility/core_operations/test_artifacts.py::TestMessageResponse::test_returns_message_with_text_part[http_json]", + "tests/compatibility/core_operations/test_artifacts.py::TestMessageResponse::test_returns_message_with_text_part[jsonrpc]", + "tests/compatibility/core_operations/test_data_model.py::TestSendMessageResponseSchema::test_response_validates_against_schema" + ] + }, + "DM-TASK-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_data_model.py::TestSendMessageResponseSchema::test_response_validates_against_schema" + ] + }, + "DM-TASK-002": { + "level": "MUST", + "status": "PASS", + "transports": { + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_data_model.py::TestSendMessageResponseSchema::test_response_validates_against_schema" + ] + }, + "DM-MSG-002": { + "level": "MUST", + "status": "PASS", + "transports": { + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_data_model.py::TestSendMessageResponseSchema::test_response_validates_against_schema" + ] + }, + "DM-PART-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_data_model.py::TestSendMessageResponseSchema::test_response_validates_against_schema" + ] + }, + "DM-STATUS-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_data_model.py::TestSendMessageResponseSchema::test_response_validates_against_schema" + ] + }, + "DM-SERIAL-004": { + "level": "MUST", + "status": "PASS", + "transports": { + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_data_model.py::TestSendMessageResponseSchema::test_response_validates_against_schema" + ] + }, + "DM-SERIAL-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_data_model.py::TestCamelCaseFieldNames::test_no_snake_case_keys" + ] + }, + "DM-SERIAL-002": { + "level": "MUST", + "status": "PASS", + "transports": { + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_data_model.py::TestEnumSerialization::test_enum_values_are_strings" + ] + }, + "DM-SERIAL-003": { + "level": "MUST", + "status": "PASS", + "transports": { + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_data_model.py::TestTimestampFormat::test_timestamps_are_iso8601_utc" + ] + }, + "DM-SERIAL-005": { + "level": "SHOULD", + "status": "PASS", + "transports": { + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_data_model.py::TestIgnoreUnrecognizedFields::test_extra_fields_ignored_jsonrpc", + "tests/compatibility/core_operations/test_data_model.py::TestIgnoreUnrecognizedFields::test_extra_fields_ignored_rest" + ] + }, + "CORE-ERR-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_error_handling.py::TestCoreErrorStructure::test_error_has_code_and_message_jsonrpc", + "tests/compatibility/core_operations/test_error_handling.py::TestCoreErrorStructure::test_error_has_code_and_message_rest" + ] + }, + "CORE-ERR-002": { + "level": "MUST", + "status": "PASS", + "transports": { + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_error_handling.py::TestCoreInputValidation::test_malformed_request_rejected_jsonrpc", + "tests/compatibility/core_operations/test_error_handling.py::TestCoreInputValidation::test_malformed_request_rejected_rest" + ] + }, + "CORE-CAP-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_error_handling.py::TestCapabilityPushNotifications::test_push_not_supported_jsonrpc", + "tests/compatibility/core_operations/test_error_handling.py::TestCapabilityPushNotifications::test_push_not_supported_rest" + ] + }, + "CORE-CAP-002": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "jsonrpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_error_handling.py::TestCapabilityStreaming::test_streaming_not_supported_jsonrpc" + ] + }, + "CORE-CAP-004": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "jsonrpc": "SKIPPED", + "http_json": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_error_handling.py::TestCapabilityExtensionRequired::test_missing_required_extension_returns_error_http_json", + "tests/compatibility/core_operations/test_error_handling.py::TestCapabilityExtensionRequired::test_missing_required_extension_returns_error_jsonrpc" + ] + }, + "CORE-CAP-003": { + "level": "MUST", + "status": "PASS", + "transports": { + "jsonrpc": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_error_handling.py::TestCapabilityExtendedCard::test_extended_card_not_supported_jsonrpc" + ] + }, + "CARD-EXT-002": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "jsonrpc": "SKIPPED", + "http_json": "SKIPPED", + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_error_handling.py::TestExtendedCardNotConfigured::test_extended_card_not_configured_grpc", + "tests/compatibility/core_operations/test_error_handling.py::TestExtendedCardNotConfigured::test_extended_card_not_configured_http_json", + "tests/compatibility/core_operations/test_error_handling.py::TestExtendedCardNotConfigured::test_extended_card_not_configured_jsonrpc" + ] + }, + "CARD-EXT-001": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "jsonrpc": "SKIPPED", + "http_json": "SKIPPED", + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_error_handling.py::TestExtendedCardRequiresAuth::test_extended_card_requires_auth_grpc", + "tests/compatibility/core_operations/test_error_handling.py::TestExtendedCardRequiresAuth::test_extended_card_requires_auth_http_json", + "tests/compatibility/core_operations/test_error_handling.py::TestExtendedCardRequiresAuth::test_extended_card_requires_auth_jsonrpc" + ] + }, + "VER-SERVER-002": { + "level": "MUST", + "status": "PASS", + "transports": { + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_error_handling.py::TestVersionErrors::test_unsupported_version_returns_error_jsonrpc", + "tests/compatibility/core_operations/test_error_handling.py::TestVersionErrors::test_unsupported_version_returns_error_rest" + ] + }, + "VER-SERVER-003": { + "level": "MUST", + "status": "PASS", + "transports": { + "jsonrpc": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_error_handling.py::TestVersionErrors::test_empty_version_treated_as_default_jsonrpc" + ] + }, + "JSONRPC-ERR-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "jsonrpc": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_error_handling.py::TestJsonRpcErrorStructure::test_error_object_structure", + "tests/compatibility/jsonrpc/test_error_info.py::TestJsonRpcErrorDetails::test_present_error_data_is_any_array" + ] + }, + "JSONRPC-ERR-002": { + "level": "MUST", + "status": "PASS", + "transports": { + "jsonrpc": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_error_handling.py::TestJsonRpcErrorStructure::test_a2a_error_codes_in_range" + ] + }, + "JSONRPC-SSE-002": { + "level": "MUST", + "status": "PASS", + "transports": { + "jsonrpc": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_error_handling.py::TestJsonRpcErrorStructure::test_a2a_error_type_mappings", + "tests/compatibility/jsonrpc/test_error_codes.py::TestJsonRpcErrorCodeMappings::test_push_notification_not_supported_error", + "tests/compatibility/jsonrpc/test_error_codes.py::TestJsonRpcErrorCodeMappings::test_task_not_cancelable_error", + "tests/compatibility/jsonrpc/test_error_codes.py::TestJsonRpcErrorCodeMappings::test_task_not_found_error", + "tests/compatibility/jsonrpc/test_error_codes.py::TestJsonRpcErrorCodeMappings::test_unsupported_operation_error", + "tests/compatibility/jsonrpc/test_error_codes.py::TestJsonRpcErrorCodeMappings::test_version_not_supported_error", + "tests/compatibility/jsonrpc/test_error_codes.py::TestJsonRpcErrorCodeRange::test_error_code_in_valid_range[CancelTask-nonexistent]", + "tests/compatibility/jsonrpc/test_error_codes.py::TestJsonRpcErrorCodeRange::test_error_code_in_valid_range[GetTask-nonexistent]", + "tests/compatibility/jsonrpc/test_error_codes.py::TestJsonRpcErrorCodeRange::test_error_code_in_valid_range[SendMessage-bad-version]" + ] + }, + "JSONRPC-ERR-003": { + "level": "SHOULD", + "status": "PASS", + "transports": { + "jsonrpc": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_error_handling.py::TestJsonRpcErrorStructure::test_error_data_contains_error_info", + "tests/compatibility/jsonrpc/test_error_info.py::TestJsonRpcWellKnownErrorDetails::test_error_data_uses_well_known_type" + ] + }, + "HTTP_JSON-ERR-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_error_handling.py::TestRestErrorStructure::test_error_uses_aip193_format", + "tests/compatibility/http_json/test_problem_details.py::TestAIP193ErrorFormat::test_code_field_matches_http_status", + "tests/compatibility/http_json/test_problem_details.py::TestAIP193ErrorFormat::test_error_object_present" + ] + }, + "HTTP_JSON-ERR-002": { + "level": "MUST", + "status": "PASS", + "transports": { + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_error_handling.py::TestRestErrorStructure::test_a2a_error_info_in_details", + "tests/compatibility/http_json/test_problem_details.py::TestAIP193ErrorInfo::test_details_contains_error_info", + "tests/compatibility/http_json/test_problem_details.py::TestAIP193ErrorInfo::test_error_info_reason_matches_condition", + "tests/compatibility/http_json/test_problem_details.py::TestAIP193ErrorInfo::test_error_info_valid" + ] + }, + "GRPC-ERR-001": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_error_handling.py::TestGrpcErrorStructure::test_grpc_error_for_nonexistent_task", + "tests/compatibility/grpc/test_status_codes.py::TestGrpcErrorInfo::test_error_info_in_status_details" + ] + }, + "STREAM-ORDER-002": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_multi_stream.py::TestMultiStreamOrdering::test_events_broadcast_to_all_streams[grpc]" + ] + }, + "STREAM-ORDER-003": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_multi_stream.py::TestMultiStreamOrdering::test_streams_receive_same_events_in_order[grpc]" + ] + }, + "STREAM-ORDER-004": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_multi_stream.py::TestMultiStreamOrdering::test_closing_one_stream_does_not_affect_others[grpc]" + ] + }, + "PUSH-CREATE-001": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "SKIPPED", + "http_json": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationCrud::test_create_push_config[grpc]", + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationCrud::test_create_push_config[http_json]", + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationCrud::test_create_push_config[jsonrpc]" + ] + }, + "PUSH-CREATE-002": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "SKIPPED", + "http_json": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationCrud::test_config_persists[grpc]", + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationCrud::test_config_persists[http_json]", + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationCrud::test_config_persists[jsonrpc]" + ] + }, + "PUSH-GET-001": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "SKIPPED", + "http_json": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationCrud::test_get_push_config[grpc]", + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationCrud::test_get_push_config[http_json]", + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationCrud::test_get_push_config[jsonrpc]" + ] + }, + "PUSH-GET-002": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "SKIPPED", + "http_json": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationCrud::test_get_nonexistent_config_returns_error[grpc]", + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationCrud::test_get_nonexistent_config_returns_error[http_json]", + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationCrud::test_get_nonexistent_config_returns_error[jsonrpc]" + ] + }, + "PUSH-LIST-001": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "SKIPPED", + "http_json": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationCrud::test_list_push_configs[grpc]", + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationCrud::test_list_push_configs[http_json]", + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationCrud::test_list_push_configs[jsonrpc]" + ] + }, + "PUSH-DEL-001": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "SKIPPED", + "http_json": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationCrud::test_delete_push_config[grpc]", + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationCrud::test_delete_push_config[http_json]", + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationCrud::test_delete_push_config[jsonrpc]" + ] + }, + "PUSH-DEL-002": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "SKIPPED", + "http_json": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationCrud::test_delete_is_idempotent[grpc]", + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationCrud::test_delete_is_idempotent[http_json]", + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationCrud::test_delete_is_idempotent[jsonrpc]" + ] + }, + "PUSH-DELIVER-001": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "SKIPPED", + "http_json": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationDelivery::test_delivery_includes_auth[grpc]", + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationDelivery::test_delivery_includes_auth[http_json]", + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationDelivery::test_delivery_includes_auth[jsonrpc]" + ] + }, + "PUSH-DELIVER-002": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "SKIPPED", + "http_json": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationDelivery::test_delivery_at_least_once[grpc]", + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationDelivery::test_delivery_at_least_once[http_json]", + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationDelivery::test_delivery_at_least_once[jsonrpc]" + ] + }, + "PUSH-DELIVER-003": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "SKIPPED", + "http_json": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationDelivery::test_delivery_payload_format[grpc]", + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationDelivery::test_delivery_payload_format[http_json]", + "tests/compatibility/core_operations/test_push_notifications.py::TestPushNotificationDelivery::test_delivery_payload_format[jsonrpc]" + ] + }, + "CORE-SEND-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-SEND-001-grpc]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-SEND-001-http_json]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-SEND-001-jsonrpc]" + ] + }, + "CORE-SEND-003": { + "level": "MUST", + "status": "PASS", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-SEND-003-grpc]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-SEND-003-http_json]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-SEND-003-jsonrpc]" + ] + }, + "CORE-STREAM-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-STREAM-001-grpc]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-STREAM-001-http_json]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-STREAM-001-jsonrpc]" + ] + }, + "CORE-STREAM-002": { + "level": "MUST", + "status": "PASS", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-STREAM-002-grpc]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-STREAM-002-http_json]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-STREAM-002-jsonrpc]" + ] + }, + "CORE-STREAM-003": { + "level": "MUST", + "status": "PASS", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-STREAM-003-grpc]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-STREAM-003-http_json]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-STREAM-003-jsonrpc]" + ] + }, + "CORE-GET-002": { + "level": "MUST", + "status": "PASS", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-GET-002-grpc]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-GET-002-http_json]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-GET-002-jsonrpc]" + ] + }, + "CORE-LIST-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-LIST-001-grpc]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-LIST-001-http_json]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-LIST-001-jsonrpc]" + ] + }, + "CORE-LIST-002": { + "level": "MUST", + "status": "PASS", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-LIST-002-grpc]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-LIST-002-http_json]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-LIST-002-jsonrpc]" + ] + }, + "CORE-LIST-003": { + "level": "MUST", + "status": "PASS", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-LIST-003-grpc]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-LIST-003-http_json]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-LIST-003-jsonrpc]" + ] + }, + "CORE-LIST-004": { + "level": "MUST", + "status": "PASS", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-LIST-004-grpc]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-LIST-004-http_json]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-LIST-004-jsonrpc]" + ] + }, + "CORE-LIST-005": { + "level": "MUST", + "status": "PASS", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-LIST-005-grpc]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-LIST-005-http_json]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-LIST-005-jsonrpc]" + ] + }, + "CORE-CANCEL-003": { + "level": "MUST", + "status": "PASS", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-CANCEL-003-grpc]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-CANCEL-003-http_json]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-CANCEL-003-jsonrpc]" + ] + }, + "CORE-EXECUTION-MODE-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-EXECUTION-MODE-001-grpc]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-EXECUTION-MODE-001-http_json]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-EXECUTION-MODE-001-jsonrpc]" + ] + }, + "CORE-EXECUTION-MODE-002": { + "level": "MUST", + "status": "PASS", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-EXECUTION-MODE-002-grpc]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-EXECUTION-MODE-002-http_json]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-EXECUTION-MODE-002-jsonrpc]" + ] + }, + "CORE-MULTI-001a": { + "level": "MUST", + "status": "PASS", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-MULTI-001a-grpc]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-MULTI-001a-http_json]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-MULTI-001a-jsonrpc]" + ] + }, + "CORE-MULTI-002a": { + "level": "MUST", + "status": "PASS", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-MULTI-002a-grpc]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-MULTI-002a-http_json]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-MULTI-002a-jsonrpc]" + ] + }, + "CORE-MULTI-003": { + "level": "MUST", + "status": "PASS", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-MULTI-003-grpc]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-MULTI-003-http_json]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-MULTI-003-jsonrpc]" + ] + }, + "CORE-MULTI-004": { + "level": "MUST", + "status": "PASS", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-MULTI-004-grpc]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-MULTI-004-http_json]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[CORE-MULTI-004-jsonrpc]" + ] + }, + "STREAM-SUB-004": { + "level": "MUST", + "status": "PASS", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[STREAM-SUB-004-grpc]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[STREAM-SUB-004-http_json]", + "tests/compatibility/core_operations/test_requirements.py::test_must_requirement[STREAM-SUB-004-jsonrpc]", + "tests/compatibility/grpc/test_streaming.py::TestGrpcStreaming::test_streaming_error_propagation", + "tests/compatibility/jsonrpc/test_sse_streaming.py::TestSseSubscribeToTask::test_subscribe_nonexistent_task_returns_error" + ] + }, + "CORE-MULTI-001": { + "level": "MAY", + "status": "PASS", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_requirements.py::test_may_requirement[CORE-MULTI-001-grpc]", + "tests/compatibility/core_operations/test_requirements.py::test_may_requirement[CORE-MULTI-001-http_json]", + "tests/compatibility/core_operations/test_requirements.py::test_may_requirement[CORE-MULTI-001-jsonrpc]" + ] + }, + "CORE-MULTI-002": { + "level": "MAY", + "status": "PASS", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_requirements.py::test_may_requirement[CORE-MULTI-002-grpc]", + "tests/compatibility/core_operations/test_requirements.py::test_may_requirement[CORE-MULTI-002-http_json]", + "tests/compatibility/core_operations/test_requirements.py::test_may_requirement[CORE-MULTI-002-jsonrpc]" + ] + }, + "STREAM-ORDER-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "grpc": "SKIPPED", + "jsonrpc": "PASS", + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_stream_ordering.py::TestStreamEventOrdering::test_streaming_event_ordering[grpc]", + "tests/compatibility/core_operations/test_stream_ordering.py::TestStreamEventOrdering::test_streaming_event_ordering[http_json]", + "tests/compatibility/core_operations/test_stream_ordering.py::TestStreamEventOrdering::test_streaming_event_ordering[jsonrpc]" + ] + }, + "CORE-HIST-001": { + "level": "SHOULD", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_task_history.py::TestHistoryLengthZeroGetTask::test_get_task_history_length_zero[grpc]" + ] + }, + "CORE-HIST-002": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_task_history.py::TestHistoryLengthLimit::test_get_task_history_does_not_exceed_limit[grpc]" + ] + }, + "CORE-HIST-003": { + "level": "SHOULD", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_task_history.py::TestHistoryLengthZeroSendMessage::test_send_message_history_length_zero[grpc]" + ] + }, + "CORE-HIST-004": { + "level": "MAY", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_task_history.py::TestHistoryPersistence::test_get_task_returns_history[grpc]" + ] + }, + "CORE-HIST-005": { + "level": "SHOULD", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_task_history.py::TestHistoryOrdering::test_history_messages_in_chronological_order[grpc]" + ] + }, + "CORE-HIST-006": { + "level": "SHOULD", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_task_history.py::TestHistoryContent::test_history_content_matches_sent_messages[grpc]" + ] + }, + "CORE-GET-001": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_task_lifecycle.py::TestGetTask::test_get_task_returns_current_state[grpc]" + ] + }, + "CORE-CANCEL-001": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_task_lifecycle.py::TestCancelTask::test_cancel_task_returns_updated_state[grpc]" + ] + }, + "CORE-CANCEL-002": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_task_lifecycle.py::TestCancelTask::test_cancel_terminal_task_returns_error[grpc]" + ] + }, + "CORE-SEND-002": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_task_lifecycle.py::TestMultiTurn::test_send_message_to_terminal_task[grpc]" + ] + }, + "CORE-MULTI-005": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_task_lifecycle.py::TestMultiTurn::test_infer_context_from_task[grpc]" + ] + }, + "CORE-MULTI-006": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_task_lifecycle.py::TestMultiTurn::test_reject_mismatching_context[grpc]" + ] + }, + "STREAM-SUB-002": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_task_lifecycle.py::TestSubscribeLifecycle::test_subscribe_terminates_at_terminal_state[grpc]" + ] + }, + "STREAM-SUB-003": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_task_lifecycle.py::TestSubscribeLifecycle::test_subscribe_rejects_terminal_task[grpc]" + ] + }, + "JSONRPC-FMT-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "jsonrpc": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_transport_behavior.py::TestJsonRpcFormat::test_response_validates_jsonrpc_envelope" + ] + }, + "JSONRPC-FMT-002": { + "level": "MUST", + "status": "PASS", + "transports": { + "jsonrpc": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_transport_behavior.py::TestJsonRpcFormat::test_content_type_is_application_json" + ] + }, + "JSONRPC-SVC-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "jsonrpc": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_transport_behavior.py::TestJsonRpcMethodNames::test_bindings_use_spec_method_names" + ] + }, + "JSONRPC-SVC-002": { + "level": "MUST", + "status": "PASS", + "transports": { + "jsonrpc": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_transport_behavior.py::TestJsonRpcServiceParams::test_extensions_header_accepted" + ] + }, + "JSONRPC-SSE-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "jsonrpc": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_transport_behavior.py::TestJsonRpcStreaming::test_streaming_content_type", + "tests/compatibility/jsonrpc/test_sse_streaming.py::TestSseStreamingFormat::test_streaming_events_contain_stream_response", + "tests/compatibility/jsonrpc/test_sse_streaming.py::TestSseStreamingFormat::test_streaming_events_have_jsonrpc_envelope" + ] + }, + "HTTP_JSON-SVC-001": { + "level": "SHOULD", + "status": "PASS", + "transports": { + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_transport_behavior.py::TestRestFormat::test_response_content_type", + "tests/compatibility/http_json/test_problem_details.py::TestHttpJsonErrorMediaType::test_error_content_type" + ] + }, + "HTTP_JSON-FMT-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_transport_behavior.py::TestRestFormat::test_response_validates_against_schema" + ] + }, + "HTTP_JSON-SVC-002": { + "level": "MUST", + "status": "PASS", + "transports": { + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_transport_behavior.py::TestRestServiceParams::test_extensions_header_accepted" + ] + }, + "HTTP_JSON-URL-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_transport_behavior.py::TestRestUrlPatterns::test_url_patterns_defined" + ] + }, + "HTTP_JSON-URL-002": { + "level": "MUST", + "status": "PASS", + "transports": { + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_transport_behavior.py::TestRestUrlPatterns::test_http_methods_correct" + ] + }, + "HTTP_JSON-QP-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_transport_behavior.py::TestRestQueryParams::test_query_params_are_camel_case" + ] + }, + "HTTP_JSON-SSE-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_transport_behavior.py::TestRestStreaming::test_streaming_content_type" + ] + }, + "GRPC-SVC-001": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_transport_behavior.py::TestGrpcService::test_grpc_response_validates_against_proto" + ] + }, + "GRPC-SVC-002": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_transport_behavior.py::TestGrpcProto3::test_response_uses_proto3" + ] + }, + "GRPC-META-001": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_transport_behavior.py::TestGrpcServiceParams::test_extensions_metadata_accepted" + ] + }, + "GRPC-ERR-003": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/core_operations/test_transport_behavior.py::TestGrpcStreaming::test_grpc_streaming_works", + "tests/compatibility/grpc/test_streaming.py::TestGrpcStreaming::test_streaming_cancellation", + "tests/compatibility/grpc/test_streaming.py::TestGrpcStreaming::test_streaming_message_structure", + "tests/compatibility/grpc/test_streaming.py::TestGrpcStreaming::test_streaming_response_type" + ] + }, + "GRPC-ERR-002": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/grpc/test_status_codes.py::TestGrpcStatusCodes::test_cancel_missing_task_returns_not_found", + "tests/compatibility/grpc/test_status_codes.py::TestGrpcStatusCodes::test_push_not_supported_returns_expected_error", + "tests/compatibility/grpc/test_status_codes.py::TestGrpcStatusCodes::test_task_not_found_returns_not_found", + "tests/compatibility/grpc/test_status_codes.py::TestGrpcStatusCodes::test_unsupported_operation_returns_expected_error", + "tests/compatibility/grpc/test_status_codes.py::TestGrpcStatusCodes::test_version_not_supported_returns_expected_error" + ] + }, + "STREAM-SUB-001": { + "level": "MUST", + "status": "SKIPPED", + "transports": { + "grpc": "SKIPPED" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/grpc/test_streaming.py::TestGrpcStreaming::test_subscribe_first_event_is_task" + ] + }, + "HTTP_JSON-STATUS-001": { + "level": "MUST", + "status": "PASS", + "transports": { + "http_json": "PASS" + }, + "errors": [], + "test_ids": [ + "tests/compatibility/http_json/test_http_status.py::TestHttpJsonStatusCodes::test_cancel_missing_task_returns_404", + "tests/compatibility/http_json/test_http_status.py::TestHttpJsonStatusCodes::test_content_type_not_supported_returns_expected_error", + "tests/compatibility/http_json/test_http_status.py::TestHttpJsonStatusCodes::test_push_not_supported_returns_400", + "tests/compatibility/http_json/test_http_status.py::TestHttpJsonStatusCodes::test_success_returns_2xx", + "tests/compatibility/http_json/test_http_status.py::TestHttpJsonStatusCodes::test_task_not_found_returns_404", + "tests/compatibility/http_json/test_http_status.py::TestHttpJsonStatusCodes::test_unsupported_operation_returns_400", + "tests/compatibility/http_json/test_http_status.py::TestHttpJsonStatusCodes::test_version_not_supported_returns_400" + ] + }, + "CARD-CLIENT-001": { + "level": "MUST", + "status": "MANUAL", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "CARD-SIGN-001": { + "level": "MUST", + "status": "MANUAL", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "CARD-SIGN-002": { + "level": "MUST", + "status": "MANUAL", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "CARD-SIGN-003": { + "level": "MUST", + "status": "MANUAL", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "CARD-SIGN-004": { + "level": "MUST", + "status": "MANUAL", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "AUTH-TLS-001": { + "level": "MUST", + "status": "MANUAL", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "AUTH-TLS-002": { + "level": "SHOULD", + "status": "MANUAL", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "AUTH-SERVER-001": { + "level": "SHOULD", + "status": "MANUAL", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "AUTH-SERVER-002": { + "level": "MUST", + "status": "NOT TESTED", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "AUTH-INTASK-001": { + "level": "MUST", + "status": "NOT TESTED", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "AUTH-INTASK-002": { + "level": "MUST", + "status": "NOT TESTED", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "AUTH-INTASK-003": { + "level": "MUST", + "status": "NOT TESTED", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "AUTH-INTASK-004": { + "level": "MUST", + "status": "NOT TESTED", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "AUTH-INTASK-005": { + "level": "SHOULD", + "status": "NOT TESTED", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "AUTH-INTASK-006": { + "level": "SHOULD", + "status": "NOT TESTED", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "AUTH-SCOPE-001": { + "level": "MUST", + "status": "NOT TESTED", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "AUTH-SCOPE-002": { + "level": "MUST", + "status": "NOT TESTED", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "AUTH-SCOPE-003": { + "level": "MUST", + "status": "NOT TESTED", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "VER-CLIENT-001": { + "level": "MUST", + "status": "NOT TESTED", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "VER-SERVER-001": { + "level": "MUST", + "status": "NOT TESTED", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "VER-CLIENT-002": { + "level": "MUST", + "status": "NOT TESTED", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "BIND-CUSTOM-002": { + "level": "MUST", + "status": "MANUAL", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "BIND-EQUIV-001": { + "level": "MUST", + "status": "NOT TESTED", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "BIND-EQUIV-002": { + "level": "MUST", + "status": "NOT TESTED", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "BIND-EQUIV-003": { + "level": "MUST", + "status": "NOT TESTED", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "BIND-EQUIV-004": { + "level": "MUST", + "status": "NOT TESTED", + "transports": {}, + "errors": [], + "test_ids": [] + }, + "GRPC-SVC-003": { + "level": "MUST", + "status": "NOT TESTED", + "transports": {}, + "errors": [], + "test_ids": [] + } + }, + "per_transport": { + "agent_card": { + "total": 11, + "passed": 9, + "failed": 0, + "skipped": 2 + }, + "grpc": { + "total": 72, + "passed": 0, + "failed": 0, + "skipped": 72 + }, + "jsonrpc": { + "total": 81, + "passed": 66, + "failed": 0, + "skipped": 15 + }, + "http_json": { + "total": 78, + "passed": 64, + "failed": 0, + "skipped": 14 + } + }, + "agent_card": { + "name": "OpenAdapt", + "description": "Runs compiled OpenAdapt workflows on this computer and checks that they saved. A finished run's result carries its signed receipt when Flow wrote one, and any agent can send a handoff to be verified.", + "supportedInterfaces": [ + { + "url": "http://127.0.0.1:9999/a2a/jsonrpc", + "protocolBinding": "JSONRPC", + "protocolVersion": "1.0" + }, + { + "url": "http://127.0.0.1:9999/a2a/rest", + "protocolBinding": "HTTP+JSON", + "protocolVersion": "1.0" + } + ], + "provider": { + "url": "https://openadapt.ai", + "organization": "OpenAdapt" + }, + "version": "2.2.4", + "documentationUrl": "https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/flow/docs/A2A.md", + "capabilities": { + "streaming": true, + "pushNotifications": false, + "extensions": [ + { + "uri": "https://openadapt.ai/extensions/handoff-receipt/v1", + "description": "Task results carry the run's record/run/v1 receipt (in-toto Statement in a DSSE envelope) as an openadapt.handoff-document/v1 artifact part; verify_handoff returns an openadapt.handoff-verdict/v1 verdict.", + "params": { + "verdict_schema": "openadapt.handoff-verdict/v1", + "receipt_predicate": "https://openadapt.ai/record/run/v1", + "envelope": "dsse", + "media_type": "application/vnd.openadapt.handoff+json", + "handoff_schema": "openadapt.handoff-document/v1" + } + } + ], + "extendedAgentCard": false + }, + "defaultInputModes": [ + "application/json" + ], + "defaultOutputModes": [ + "application/json", + "application/vnd.openadapt.handoff+json" + ], + "skills": [ + { + "id": "add_triage_note", + "name": "add_triage_note", + "description": "Sandbox: add a triage note to the first referral in a synthetic clinic app. Nothing real changes. Done means: The note is in the synthetic app's record store, confirmed by reading the store directly after the save. Send a data part {\"skill\": \"add_triage_note\", \"inputs\": {...}, \"request_id\": \"...\"}. A finished run's result includes its signed receipt when Flow wrote one.", + "tags": [ + "openadapt", + "workflow", + "receipt" + ], + "inputModes": [ + "application/json" + ], + "outputModes": [ + "application/json", + "application/vnd.openadapt.handoff+json" + ] + }, + { + "id": "verify_handoff", + "name": "Verify a handoff", + "description": "Send another agent's result with its receipt (an openadapt.handoff-document/v1 document, as a data part or a application/vnd.openadapt.handoff+json file part). Returns who signed it, whether it is intact, which checks passed and which were not checked, and any confirmation read from the other party's system. A valid signature proves who signed, not that the claim is true.", + "tags": [ + "verification", + "receipt", + "handoff", + "in-toto", + "dsse" + ], + "inputModes": [ + "application/json", + "application/vnd.openadapt.handoff+json" + ], + "outputModes": [ + "application/json" + ] + } + ], + "signatures": [ + { + "protected": "eyJhbGciOiJFZERTQSIsImtpZCI6InNlYWwtZWQyNTUxOS1lY2MwMjZjZjNhNTlkMjM4IiwidHlwIjoiSk9TRSJ9", + "signature": "UoPqUEBONPQ-rpdpb84XM5jPKS8nvqy1Zh-VmzIR9ZwLA6IB3ogjO_-A2l9Drdp2Cj7AZYdAo7H_mT9FlH8dCQ", + "header": { + "jwk": { + "kty": "OKP", + "x": "D_BpCD5hEGKhuz1TXeKICbioNVE6QycfpXSEVNnyIoU", + "crv": "Ed25519" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/flow/benchmark/a2a_tck/2026-11-30/tck-run.log b/packages/flow/benchmark/a2a_tck/2026-11-30/tck-run.log new file mode 100644 index 0000000000..c50a811cf4 --- /dev/null +++ b/packages/flow/benchmark/a2a_tck/2026-11-30/tck-run.log @@ -0,0 +1,48 @@ +/lib/python3.14/site-packages/pytest_asyncio/plugin.py:306: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset. +The event loop scope for asynchronous fixtures will default to the fixture scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to "function" scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session". Set it to "fixture-scope" to keep the current behavior. + + warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET)) +......s...ss..s..s..s..s..............sss.ssssss.........sssssssssssssss [ 27%] +ssssssssssssssssssssssssss..s..s..s..s..s..s..s..s..s..s..s..s..s..s..s. [ 54%] +.s..s..s..ssss..s..s..ssssssssssssssssssssssssssssssssssssssssss........ [ 82%] +....sssssssssssssss..s.............ss.........s [100%] +═══════════════════════════════════════════════════════ + A2A TCK Compatibility Report +═══════════════════════════════════════════════════════ +SUT: http://localhost:9999 +Timestamp: 2026-11-30T19:53:39.858728+00:00 + +OVERALL COMPATIBILITY: 78.6% (automated checks) + +┌────────┬────────┬────────┬─────────┬────────┬────────────┬───────┐ +│ Level │ Passed │ Failed │ Skipped │ Manual │ Not tested │ Total │ +├────────┼────────┼────────┼─────────┼────────┼────────────┼───────┤ +│ MUST │ 59 │ 0 │ 33 │ 7 │ 16 │ 115 │ +│ SHOULD │ 5 │ 0 │ 5 │ 2 │ 2 │ 14 │ +│ MAY │ 2 │ 0 │ 2 │ 0 │ 0 │ 4 │ +└────────┴────────┴────────┴─────────┴────────┴────────────┴───────┘ + +BY TRANSPORT: + agent_card: 9/11 (2 skipped) ✓ + grpc: 0/72 (72 skipped) ✓ + jsonrpc: 66/81 (15 skipped) ✓ + http_json: 64/78 (14 skipped) ✓ + + +PENDING MANUAL VERIFICATION (excluded from automated scores): + CARD-CLIENT-001 [MUST]: Clients MUST set the tenant field in every request to exactly the selected AgentInterface tenant, omitting it when unset. This client behavior requires observing the client's outbound requests; it cannot be established by this server-only conformance probe. + CARD-SIGN-001 [MUST]: Before signing, the Agent Card content MUST be canonicalized using the JSON Canonicalization Scheme (JCS) as defined in RFC 8785. + CARD-SIGN-002 [MUST]: The signatures field itself MUST be excluded from the content being signed to avoid circular dependencies. + CARD-SIGN-003 [MUST]: The JWS protected header MUST include alg (algorithm) and kid (key ID) parameters. + CARD-SIGN-004 [MUST]: Expired or revoked keys MUST NOT be used for signature verification. + AUTH-TLS-001 [MUST]: Production deployments MUST use encrypted communication (HTTPS for HTTP-based bindings, TLS for gRPC). + AUTH-TLS-002 [SHOULD]: Implementations SHOULD use modern TLS configurations (TLS 1.3+ recommended) with strong cipher suites. + AUTH-SERVER-001 [SHOULD]: A2A Clients SHOULD verify the A2A Server's identity by validating its TLS certificate against trusted CAs. + BIND-CUSTOM-002 [MUST]: A breaking change to a custom binding MUST use a new URI. Verifying this requires comparing binding versions and their semantics, which cannot be observed from a single server snapshot. +═══════════════════════════════════════════════════════ + + +- Generated html report: file:///reports/tck_report.html - +121 passed, 142 skipped in 0.91s +Command: /bin/python -m pytest tests/compatibility/ --sut-host=http://localhost:9999 --tb=short --media-type-spec-version=1.0.1 -q --compatibility-report=reports/compatibility --html=reports/tck_report.html --self-contained-html --junitxml=reports/junitreport.xml + diff --git a/packages/flow/benchmark/a2a_tck/README.md b/packages/flow/benchmark/a2a_tck/README.md index bc0b908fa0..15e2ff25a7 100644 --- a/packages/flow/benchmark/a2a_tck/README.md +++ b/packages/flow/benchmark/a2a_tck/README.md @@ -1,22 +1,77 @@ -# A2A TCK run against `openadapt-agent serve --a2a` +# A2A TCK runs against `openadapt-agent serve --a2a` -This is the official A2A Technology Compatibility Kit +These runs use the official A2A Technology Compatibility Kit ([a2aproject/a2a-tck](https://github.com/a2aproject/a2a-tck), Apache-2.0, -commit `5e6f37c2d38eb3d7684686243c34d365c83df49b`, 2026-11-18). It was run on -2026-11-21 against the sandbox server, started with this command: - -```bash -openadapt-agent serve --a2a --a2a-port 9999 --sandbox-engine simulated -./run_tck.py --sut-host http://localhost:9999 -``` +commit `5e6f37c2d38eb3d7684686243c34d365c83df49b`, 2026-11-18) against the +sandbox server. - **Python.** The TCK declares Python 3.15. Its `grpcio` wheel crashed on 3.15.0b3 (exit 139), so it ran on Python 3.14.9 with its own dependencies installed. - **Transports.** The card declares only JSON-RPC and HTTP+JSON, so the gRPC tests were skipped. +- **Media type.** The TCK checks against specification 1.0.1 + (`--media-type-spec-version=1.0.1`). + +## Latest run (2026-11-30) + +```bash +openadapt-agent serve --a2a --a2a-port 9999 --sandbox-engine simulated --a2a-tck-scenarios +./run_tck.py --sut-host http://localhost:9999 +``` + +These numbers come from `2026-11-30/compatibility.json` and +`2026-11-30/tck-run.log`: -## Result +| | | +|---|---| +| Automated checks | 121 passed, 0 failed, 142 skipped | +| Agent Card requirements | 6 passed, 0 failed, 3 skipped, 5 manual | +| MUST | 78.7% | +| SHOULD | 71.4% | +| MAY | 100% | +| Overall | 78.6% | + +No automated check fails. The percentages are below 100% because the TCK +counts skipped, untested and manual requirements as not passed. Of the 115 +MUST requirements, 59 pass, 33 are skipped, 16 are not tested and 7 need a +manual check. Most of the rest fall into these groups: + +- **gRPC** (`GRPC-*`). The server doesn't serve gRPC. +- **Push notifications** (`PUSH-*`). The card says `pushNotifications: false`. +- **Cancel** (`CORE-CANCEL-*`). A run is never stopped part way through a + write, so cancelling answers `TaskNotCancelableError`. +- **Authentication scenarios** (`AUTH-*`). The sandbox server listens on + loopback with no token. +- **Manual checks.** Card signing (`CARD-SIGN-*`), TLS, and some client-side + behaviour. + +**What changed since 2026-11-21:** + +- **Error media type (`HTTP_JSON-SVC-001`).** `a2a-sdk` 1.3.1 labels + successful HTTP+JSON responses `application/a2a+json` but labels its error + responses `application/json`. The server now relabels HTTP+JSON responses + as `application/a2a+json`, as 1.0.1 recommends. JSON-RPC and the Agent Card + keep `application/json`. +- **Scripted scenarios (`DM-ART-001`, `DM-MSG-001`, 10 tests).** The TCK asks + the server under test to answer messages whose `messageId` starts with a + `tck-` prefix with scripted results (its `docs/SUT_REQUIREMENTS.md` and + `scenarios/core_operations.feature`). `--a2a-tck-scenarios` turns those + answers on: a text, file, file-URL or data artifact, or a direct Message. + The answers run no workflow and touch no data. The flag needs + `--mode sandbox` and loopback, so a server that runs real workflows never + serves them. +- **Agent Card signing.** The card is now signed with EdDSA by this + computer's Seal key (see [A2A.md](../../docs/A2A.md#the-signed-agent-card)). + The TCK leaves `CARD-SIGN-*` to manual checking. `test_handoff_e2e.py` + verifies the signature with the `a2a-sdk` verifier. + +## First run (2026-11-21) + +```bash +openadapt-agent serve --a2a --a2a-port 9999 --sandbox-engine simulated +./run_tck.py --sut-host http://localhost:9999 +``` These numbers come from `2026-11-21/compatibility.json`: @@ -29,20 +84,9 @@ These numbers come from `2026-11-21/compatibility.json`: | MAY | 100% | | Overall | 75.0% | -**What failed, and why:** - -- **`DM-ART-001` and `DM-MSG-001`** (10 tests). These tests send messages - whose `messageId` starts with a scenario prefix such as `tck-artifact-text`, - and expect the SDK's generated test agent to answer with that exact - artifact or message. OpenAdapt is not that test agent. It answers every - message with its own skills: a workflow run, or `verify_handoff`. The tests - therefore get a failed task with usage text, not the scripted artifact. -- **`HTTP_JSON-SVC-001`** (1 test). HTTP+JSON error responses come from - `a2a-sdk` 1.3.1 with `Content-Type: application/json`. Specification 1.0.1 - expects `application/a2a+json`. That behaviour is in the SDK, not in - OpenAdapt. - -Before two fixes in this pull request, the TCK found two more failures: +The 11 failures were the 10 scripted-scenario tests and the error media type, +both fixed in the latest run. Before two fixes in the pull request that added +the adapter, the TCK found two more failures: - JSON-RPC posts to the interface URL plus `/`, which now has a route. - `ContentTypeNotSupportedError` was not returned, which input-mode @@ -50,9 +94,5 @@ Before two fixes in this pull request, the TCK found two more failures: The Agent Card also now sends `Cache-Control`. -The TCK also lists checks it can't automate, which it marks for manual -verification. Two of them don't apply to this server: - -- **Agent Card signing.** The card is not signed. -- **TLS.** The server listens on loopback over HTTP. Off loopback it needs a - bearer token, and TLS is the deployment's job. +**TLS.** The server listens on loopback over HTTP. Off loopback it needs a +bearer token, and TLS is the deployment's job. diff --git a/packages/flow/docs/A2A.md b/packages/flow/docs/A2A.md index 0201cd1a62..3afcce8506 100644 --- a/packages/flow/docs/A2A.md +++ b/packages/flow/docs/A2A.md @@ -20,6 +20,7 @@ openadapt agent serve --bundles ./bundles --mode production --a2a | A2A | OpenAdapt | |---|---| | Agent Card at `/.well-known/agent-card.json` | Built from the same public workflow list `list_workflows` returns. It never includes step text, recorded values or paths. | +| `signatures` | One JWS signature (`EdDSA`) by this computer's Seal key, the key that signs its run receipts. The extended card is signed too. See [The signed Agent Card](#the-signed-agent-card). | | `supportedInterfaces` | `JSONRPC` at `/a2a/jsonrpc` and `HTTP+JSON` at `/a2a/rest`, protocol version 1.0. | | One skill per workflow | Send a data part `{"skill": NAME, "inputs": {...}, "request_id": ID}`. | | Skill `verify_handoff` | Send another agent's handoff and get the verdict ([HANDOFFS.md](HANDOFFS.md)). | @@ -32,6 +33,55 @@ that task only re-checks the run; it never approves it. Every other outcome is `TASK_STATE_FAILED`. Cancelling a task never stops a run part way through a write; the server answers `TaskNotCancelableError`. +## The signed Agent Card + +Both cards carry a signature as A2A 1.0 section 8.4 describes: a JWS +(RFC 7515) over the card's RFC 8785 canonical form, with `signatures` left +out. + +- **Which fields are signed.** Section 8.4.1's presence rules decide. A + REQUIRED field is always signed, even when empty (`"description": ""`, + `"skills": []`). An optional field that was set is signed even at its + default. Any other field at its default, and any empty list that isn't + REQUIRED, is left out. The REQUIRED markers come from the A2A proto. A card + field the schema doesn't define is refused, never left unsigned. +- **The header is checked whole.** A signature is accepted only when its + protected header holds `alg` (EdDSA), `kid` and optionally `typ` (`JOSE`), + and its unprotected header holds at most `jwk`. A `crit`, a `jku`, or a name + in both headers fails the signature. + +- **The key.** The card is signed with this computer's Seal key, the same + Ed25519 key that signs its run receipts. The protected header is + `{"alg": "EdDSA", "kid": "seal-ed25519-…", "typ": "JOSE"}`, and the `kid` is + the key id in your handoff key registry. If you already pin this computer's + receipt key, the same entry checks its card. +- **The `jwk` header is a convenience.** The unprotected header carries the + public key as a JWK. Don't trust it. Trust the key you pinned, looked up by + `kid`. +- **No key, no server.** If the configured Seal key can't be opened, + `serve --a2a` doesn't start. It never serves an unsigned card instead. + +Check a card with the official SDK (`pip install 'a2a-sdk[signing]'`): + +```python +from a2a.utils.signing import create_signature_verifier + +verify = create_signature_verifier(lambda kid, jku: pinned[kid], ["EdDSA"]) +verify(card) # raises InvalidSignaturesError unless a pinned key signed it +``` + +Or without PyJWT, from the served JSON: + +```python +from openadapt_flow.agent.a2a_server import verify_agent_card + +kid = verify_agent_card(card_json, {key_id: raw_public_key}) +``` + +A valid card signature proves who published the card and that it hasn't +changed: its skills, its interface URLs and its security requirements. It +says nothing about any run. That is what the run's receipt is for. + ## When a run has no receipt Flow writes `receipt.json` after every `openadapt-flow run` and `replay`. @@ -73,6 +123,9 @@ serve them. `--authoring`, `--guard`, `--verify`, `--teach`, Off loopback, the public card lists only `verify_handoff`, and the workflows are in the authenticated extended card. Set `--a2a-public-url` to the address other agents use. +- **The A2A media type.** HTTP+JSON responses, errors included, are + `application/a2a+json`, as specification 1.0.1 recommends. JSON-RPC and + the Agent Card are `application/json`. - **No browser requests.** A request with a browser `Origin` header, or a `Host` the server doesn't answer for, is refused. A web page can't reach the port, even through DNS rebinding. @@ -84,6 +137,10 @@ against this server over HTTP on 127.0.0.1. A program run goes through the governed runner with Flow's run process stubbed, and Flow's receipt writer signs the report. The tests cover: +- the signed Agent Card: verified by `verify_agent_card` and by the + `a2a-sdk` verifier, refused when changed, signed by an unpinned key, unsigned + or relabelled to another algorithm, and no server when the key can't be + opened; - the receipt in the task artifact; - a good handoff, verified; - tampered, unknown-signer and re-stapled handoffs; @@ -94,7 +151,27 @@ signs the report. The tests cover: The same file covers the MCP tools. -The official A2A TCK was run against the sandbox server. 110 automated checks -passed and 11 failed. The Agent Card checks passed 9 of 11, with 0 failed and -2 skipped. For what failed and why, see -[benchmark/a2a_tck](../benchmark/a2a_tck/README.md). +The official A2A TCK was run against the sandbox server on 2026-11-30: 121 +automated checks passed, 0 failed and 142 were skipped (gRPC, push +notifications, cancel and authentication scenarios the server doesn't offer). +The TCK leaves card signing to manual checking. For the details and the +earlier run, see [benchmark/a2a_tck](../benchmark/a2a_tck/README.md). + +A second implementation was also run against the server. The official A2A +JavaScript SDK ran a workflow and sent another party's handoff to +`verify_handoff` over both bindings. It also checked the card signature with +`jose` and `canonicalize`, which share no code with OpenAdapt or the Python +SDK. Every check passed. See +[benchmark/a2a_interop](../benchmark/a2a_interop/README.md). + +### Running the TCK + +The TCK asks the server under test to answer messages whose `messageId` +starts with `tck-` with scripted results. `--a2a-tck-scenarios` turns those +answers on. They run no workflow and touch no data. The flag needs +`--mode sandbox` and loopback, so a server that runs real workflows never +serves them: + +```bash +openadapt-agent serve --a2a --a2a-port 9999 --sandbox-engine simulated --a2a-tck-scenarios +``` diff --git a/packages/flow/openadapt_flow/agent/a2a_server.py b/packages/flow/openadapt_flow/agent/a2a_server.py index b5a5bb6c47..00dd06a607 100644 --- a/packages/flow/openadapt_flow/agent/a2a_server.py +++ b/packages/flow/openadapt_flow/agent/a2a_server.py @@ -19,6 +19,8 @@ * A finished run's receipt travels as an ``openadapt.handoff-document/v1`` artifact part (exact bytes, so its digests hold), marked with the handoff-receipt extension URI. +* The Agent Card (and the extended card) is signed with this computer's Seal + key, the key that signs its receipts (A2A 1.0 section 8.4). * It listens on 127.0.0.1 by default. Any other address needs a bearer token. Every request with a browser ``Origin`` header, or a ``Host`` it doesn't serve, is refused, so a web page can't reach the port (DNS rebinding). @@ -84,6 +86,9 @@ class A2AConfig: #: Bearer token; required unless ``host`` is loopback. token: Optional[str] = None extra_hosts: tuple[str, ...] = field(default_factory=tuple) + #: Answer the A2A TCK's scripted ``tck-*`` scenarios (its SUT_REQUIREMENTS). + #: Sandbox and loopback only; never on a server that runs real workflows. + tck_scenarios: bool = False def __post_init__(self) -> None: if not is_loopback(self.host) and not self.token: @@ -91,6 +96,17 @@ def __post_init__(self) -> None: "--a2a-host other than 127.0.0.1 needs --a2a-token-file: " "anything off this computer must authenticate" ) + if self.tck_scenarios and not is_loopback(self.host): + raise ValueError("--a2a-tck-scenarios is for loopback test runs only") + if self.tck_scenarios and self.public_url: + from urllib.parse import urlparse + + advertised = urlparse(self.public_url).hostname or "" + if advertised != "localhost" and not is_loopback(advertised): + raise ValueError( + "--a2a-tck-scenarios is for loopback test runs only: " + "the advertised URL is not loopback" + ) @property def base_url(self) -> str: @@ -259,6 +275,247 @@ def build_agent_card( return card +# -- signing the Agent Card ----------------------------------------------------------- +# +# A2A 1.0 section 8.4: a card carries JWS signatures (RFC 7515) over its RFC 8785 +# canonical form, with ``signatures`` left out and empty values removed. The +# card is signed with this computer's Seal key, the same Ed25519 key that signs +# its run receipts, so the ``kid`` is the receipt key id a receiver already +# pins. The signer may live in a keychain or a PKCS#11 token, so the JWS is +# built here from ``signer.sign`` rather than by a JOSE library that wants the +# private key. + +CARD_SIGNATURE_ALG = "EdDSA" + + +def _b64url(data: bytes) -> str: + import base64 + + return base64.urlsafe_b64encode(data).rstrip(b"=").decode("ascii") + + +def _b64url_decode(text: str) -> bytes: + import base64 + + return base64.urlsafe_b64decode(text + "=" * (-len(text) % 4)) + + +def _required(fd: Any) -> bool: + from google.api import field_behavior_pb2 + + return ( + field_behavior_pb2.REQUIRED + in fd.GetOptions().Extensions[field_behavior_pb2.field_behavior] + ) + + +def _present_value(fd: Any, value: Any) -> Any: + """One fd value in proto JSON form, with presence rules applied inside.""" + import base64 + + from google.protobuf.descriptor import FieldDescriptor + + if fd.message_type is not None: + if fd.message_type.full_name.startswith("google.protobuf."): + from google.protobuf.json_format import MessageToDict + + return MessageToDict(value) + return _present_fields(value) + if fd.type == FieldDescriptor.TYPE_ENUM: + return fd.enum_type.values_by_number[value].name + if fd.type == FieldDescriptor.TYPE_BYTES: + return base64.b64encode(value).decode("ascii") + if fd.type in ( + FieldDescriptor.TYPE_INT64, + FieldDescriptor.TYPE_UINT64, + FieldDescriptor.TYPE_SINT64, + FieldDescriptor.TYPE_FIXED64, + FieldDescriptor.TYPE_SFIXED64, + ): + return str(value) + return value + + +def _present_fields(message: Any) -> dict[str, Any]: + """A2A 1.0 section 8.4.1 rule 1 over a protobuf message. + + A REQUIRED fd is always present, even at its default. An optional + fd with explicit presence is present when it was set, even to its + default. Any other fd is present only when it differs from its default, + and an empty repeated or map fd is omitted unless REQUIRED. + """ + out: dict[str, Any] = {} + for fd in message.DESCRIPTOR.fields: + required = _required(fd) + value = getattr(message, fd.name) + if fd.message_type is not None and fd.message_type.GetOptions().map_entry: + if not value and not required: + continue + inner = fd.message_type.fields_by_name["value"] + out[fd.json_name] = { + str(k): _present_value(inner, v) for k, v in value.items() + } + elif fd.is_repeated: + if not value and not required: + continue + out[fd.json_name] = [_present_value(fd, v) for v in value] + elif fd.has_presence: + if not message.HasField(fd.name) and not required: + continue + out[fd.json_name] = _present_value(fd, value) + else: + if value == fd.default_value and not required: + continue + out[fd.json_name] = _present_value(fd, value) + return out + + +def canonical_card_bytes(card: Any) -> bytes: + """The bytes an Agent Card signature covers (A2A 1.0 section 8.4.1). + + ``card`` is an ``AgentCard`` message or its served JSON object. A JSON + object is parsed into an ``AgentCard`` first, so a field the schema doesn't + define raises ``ValueError`` instead of going unsigned. Field presence + follows the proto's REQUIRED markers and explicit presence, then RFC 8785. + The ``signatures`` field is excluded. + """ + from a2a.types import AgentCard + from openadapt_types.receipt import jcs + + if isinstance(card, dict): + from google.protobuf.json_format import ParseDict, ParseError + + data = {k: v for k, v in card.items() if k != "signatures"} + try: + message = ParseDict(data, AgentCard()) + except ParseError as exc: + raise ValueError( + f"the Agent Card does not match the schema: {exc}" + ) from None + else: + message = AgentCard() + message.CopyFrom(card) + message.ClearField("signatures") + return jcs(_present_fields(message)).encode("utf-8") + + +def sign_agent_card(card: Any, signer: Any) -> Any: + """Add a detached-payload JWS signature by ``signer`` (a Seal signer). + + The protected header names ``alg`` EdDSA and ``kid`` the Seal key id. The + unprotected header carries the public key as a JWK for convenience only; + a receiver trusts the key it pinned, never the one the card names. + """ + from a2a.types import AgentCardSignature + from google.protobuf import struct_pb2 + from google.protobuf.json_format import ParseDict + + header = {"alg": CARD_SIGNATURE_ALG, "kid": signer.key_id, "typ": "JOSE"} + protected = _b64url(json.dumps(header, separators=(",", ":")).encode("utf-8")) + signing_input = f"{protected}.{_b64url(canonical_card_bytes(card))}".encode("ascii") + signature = _b64url(signer.sign(signing_input)) + jwk = {"kty": "OKP", "crv": "Ed25519", "x": _b64url(signer.public_raw())} + card.signatures.append( + AgentCardSignature( + protected=protected, + signature=signature, + header=ParseDict({"jwk": jwk}, struct_pb2.Struct()), + ) + ) + return card + + +class CardSignatureError(ValueError): + """An Agent Card has no signature by a key the receiver trusts.""" + + +#: The only JOSE header parameters a card signature may carry. ``crit`` and +#: ``jku`` are refused: this verifier understands no extensions and trusts only +#: pinned keys. The unprotected header may carry the signer's ``jwk`` as a +#: convenience; it is never used to choose the key. +_PROTECTED_HEADER = frozenset({"alg", "kid", "typ"}) +_UNPROTECTED_HEADER = frozenset({"jwk"}) + + +def _card_header(item: Any) -> tuple[str, dict[str, Any]]: + """Validate one signature's whole JOSE header (RFC 7515 section 5.2). + + Returns the protected header's encoded form and parsed object. Raises + ``ValueError`` for an unknown or critical parameter, a name in both the + protected and unprotected headers, or a wrong ``alg``, ``kid`` or ``typ``. + """ + if not isinstance(item, dict) or set(item) - {"protected", "signature", "header"}: + raise ValueError("signature entry has unknown fields") + protected = item["protected"] + if not isinstance(protected, str): + raise ValueError("protected header is not a string") + header = json.loads(_b64url_decode(protected)) + if not isinstance(header, dict) or set(header) - _PROTECTED_HEADER: + raise ValueError("protected header has an unsupported parameter") + if header.get("alg") != CARD_SIGNATURE_ALG: + raise ValueError("unsupported alg") + if not isinstance(header.get("kid"), str) or not header["kid"]: + raise ValueError("kid is missing") + if "typ" in header and header["typ"] != "JOSE": + raise ValueError("unsupported typ") + unprotected = item.get("header") or {} + if not isinstance(unprotected, dict) or set(unprotected) - _UNPROTECTED_HEADER: + raise ValueError("unprotected header has an unsupported parameter") + if set(unprotected) & set(header): + raise ValueError("a header parameter appears twice") + return protected, header + + +def verify_agent_card(card: dict[str, Any], trusted: dict[str, bytes]) -> str: + """Check ``card`` (the served JSON) against pinned Ed25519 public keys. + + ``trusted`` maps a key id to its raw 32-byte public key, for example from + the receiver's handoff key registry. Returns the key id of the first valid + signature. Raises :class:`CardSignatureError` when none is valid. Only + ``EdDSA`` is accepted, and the key comes from ``trusted`` by ``kid``, + never from the card's own ``jwk`` header. A signature whose JOSE header + carries anything else (``crit``, ``jku``, a duplicated name) is skipped. + """ + from cryptography.exceptions import InvalidSignature + from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey + + signatures = card.get("signatures") or [] + if not isinstance(signatures, list) or not signatures: + raise CardSignatureError("the Agent Card is not signed") + try: + payload = _b64url(canonical_card_bytes(card)) + except ValueError as exc: + raise CardSignatureError(str(exc)) from None + for item in signatures: + try: + protected, header = _card_header(item) + raw = trusted.get(header["kid"]) + if raw is None: + continue + Ed25519PublicKey.from_public_bytes(raw).verify( + _b64url_decode(str(item["signature"])), + f"{protected}.{payload}".encode("ascii"), + ) + return str(header["kid"]) + except (InvalidSignature, KeyError, TypeError, ValueError): + continue + raise CardSignatureError("no signature on the Agent Card is by a trusted key") + + +def card_signer(bridge: AgentBridge) -> Any: + """The key that signs the card: the bridge's receipt key, else the Seal key. + + Raises when the configured key can't be opened; it never falls back to + serving an unsigned card. + """ + handoffs = getattr(bridge, "handoffs", None) + if handoffs is not None: + return handoffs.signer() + from openadapt_flow.offline_seal import seal_home, signer_for + + return signer_for(seal_home()) + + # -- requests --------------------------------------------------------------------- @@ -336,8 +593,9 @@ def _status_text(result: dict[str, Any]) -> str: class OpenAdaptExecutor: """An ``a2a`` AgentExecutor over one bridge (built lazily, see ``executor_class``).""" - def __init__(self, bridge: AgentBridge) -> None: + def __init__(self, bridge: AgentBridge, *, tck_scenarios: bool = False) -> None: self.bridge = bridge + self.tck_scenarios = tck_scenarios #: A2A task id -> OpenAdapt run id, for re-checks on the same task. self.runs: dict[str, str] = {} @@ -358,6 +616,11 @@ async def execute(self, context: Any, event_queue: Any) -> None: def say(text: str) -> Any: return updater.new_agent_message(parts=[new_text_part(text)]) + scenario = tck_scenario(message.message_id) if self.tck_scenarios else None + if scenario is not None: + await answer_tck_scenario(scenario, updater, event_queue) + return + if context.current_task is None: await event_queue.enqueue_event( Task( @@ -459,6 +722,56 @@ async def cancel(self, context: Any, event_queue: Any) -> None: ) +# -- the A2A TCK's scripted scenarios (sandbox test runs only) ---------------------- +# +# The official TCK (a2aproject/a2a-tck, docs/SUT_REQUIREMENTS.md) asks a server +# under test to answer messages whose messageId starts with a ``tck-`` prefix +# with scripted results (scenarios/core_operations.feature). These are the ones +# OpenAdapt's own skills can't answer. They run no workflow and touch no data, +# and they're served only with ``--a2a-tck-scenarios`` in sandbox mode. + +#: Longest prefix first, so ``tck-artifact-file-url`` isn't read as ``-file``. +TCK_SCENARIOS = ( + "tck-artifact-file-url", + "tck-artifact-file", + "tck-artifact-text", + "tck-artifact-data", + "tck-message-response", +) + + +def tck_scenario(message_id: str) -> Optional[str]: + return next((p for p in TCK_SCENARIOS if message_id.startswith(p)), None) + + +async def answer_tck_scenario(scenario: str, updater: Any, event_queue: Any) -> None: + from a2a.types import Part + from google.protobuf import json_format, struct_pb2 + + if scenario == "tck-message-response": + # A Message, not a Task: no task is created for this request. + await event_queue.enqueue_event( + updater.new_agent_message([Part(text="Direct message response")]) + ) + return + if scenario == "tck-artifact-text": + part = Part(text="Generated text content") + elif scenario == "tck-artifact-file": + part = Part(raw=b"tck", media_type="text/plain", filename="output.txt") + elif scenario == "tck-artifact-file-url": + part = Part( + url="https://example.com/output.txt", + media_type="text/plain", + filename="output.txt", + ) + else: + part = Part( + data=json_format.Parse('{"key": "value", "count": 42}', struct_pb2.Value()) + ) + await updater.add_artifact([part]) + await updater.complete() + + def executor_class() -> type: from a2a.server.agent_execution.agent_executor import AgentExecutor @@ -468,8 +781,23 @@ def executor_class() -> type: # -- the HTTP app ------------------------------------------------------------------- +#: HTTP+JSON media type (A2A 1.0.1 section 11.1). The SDK labels successful +#: REST responses with it but its error responses with application/json. +A2A_JSON_MEDIA_TYPE = b"application/a2a+json" + + +def _a2a_media_type(name: bytes, value: bytes) -> tuple[bytes, bytes]: + """Relabel a REST response's ``application/json`` as the A2A media type.""" + if name.lower() == b"content-type": + base, sep, params = value.partition(b";") + if base.strip().lower() == b"application/json": + return name, A2A_JSON_MEDIA_TYPE + sep + params + return name, value + + class GuardMiddleware: - """Host check, no browser Origin, bearer token, and the extensions header.""" + """Host check, no browser Origin, bearer token, the extensions header, and + the A2A media type on HTTP+JSON responses.""" def __init__(self, app: Any, config: A2AConfig) -> None: self.app = app @@ -494,6 +822,7 @@ async def __call__(self, scope: Any, receive: Any, send: Any) -> None: expected = f"Bearer {self.config.token}" if not hmac.compare_digest(supplied.encode(), expected.encode()): problem = (401, "a bearer token is required") + rest = scope["path"].startswith(REST_PATH) if problem is not None: body = json.dumps({"error": problem[1]}).encode() await send( @@ -501,7 +830,10 @@ async def __call__(self, scope: Any, receive: Any, send: Any) -> None: "type": "http.response.start", "status": problem[0], "headers": [ - (b"content-type", b"application/json"), + ( + b"content-type", + A2A_JSON_MEDIA_TYPE if rest else b"application/json", + ), (b"content-length", str(len(body)).encode()), ] + ([(b"www-authenticate", b"Bearer")] if problem[0] == 401 else []), @@ -516,18 +848,24 @@ async def __call__(self, scope: Any, receive: Any, send: Any) -> None: } async def send_with_extensions(message: Any) -> None: - if message["type"] == "http.response.start" and EXTENSION_URI in requested: + if message["type"] == "http.response.start": message = dict(message) - message["headers"] = list(message.get("headers") or []) + [ - (b"a2a-extensions", EXTENSION_URI.encode()) - ] + headers = list(message.get("headers") or []) + if rest: + headers = [_a2a_media_type(k, v) for k, v in headers] + if EXTENSION_URI in requested: + headers.append((b"a2a-extensions", EXTENSION_URI.encode())) + message["headers"] = headers await send(message) await self.app(scope, receive, send_with_extensions) def build_app(bridge: AgentBridge, config: A2AConfig) -> Any: - """The ASGI app: Agent Card, JSON-RPC and HTTP+JSON bindings.""" + """The ASGI app: Agent Card, JSON-RPC and HTTP+JSON bindings. + + Both cards are signed with :func:`card_signer`'s key. + """ from a2a.server.request_handlers import DefaultRequestHandler from a2a.server.routes import ( create_agent_card_routes, @@ -537,14 +875,27 @@ def build_app(bridge: AgentBridge, config: A2AConfig) -> Any: from a2a.server.tasks.inmemory_task_store import InMemoryTaskStore from starlette.applications import Starlette - card = build_agent_card(bridge, config) + if config.tck_scenarios and not ( + getattr(bridge, "mode", None) == "sandbox" + and getattr(bridge, "sandbox", None) is not None + and getattr(bridge, "bundles_dir", None) is None + and not getattr(bridge, "workflows", None) + ): + # The mode label alone is not enough: the bridge must be backed by + # the sandbox and hold no operator workflows. + raise ValueError( + "--a2a-tck-scenarios needs --mode sandbox: scripted TCK answers are " + "never served beside real workflows" + ) + signer = card_signer(bridge) + card = sign_agent_card(build_agent_card(bridge, config), signer) extended = ( - build_agent_card(bridge, config, extended=True) + sign_agent_card(build_agent_card(bridge, config, extended=True), signer) if card.capabilities.extended_agent_card else None ) handler = DefaultRequestHandler( - agent_executor=executor_class()(bridge), + agent_executor=executor_class()(bridge, tck_scenarios=config.tck_scenarios), task_store=InMemoryTaskStore(), agent_card=card, extended_agent_card=extended, @@ -581,14 +932,27 @@ def serve(bridge: AgentBridge, config: A2AConfig) -> None: import uvicorn + from openadapt_flow.offline_seal import LocalSealError + + try: + app = build_app(bridge, config) + except LocalSealError as exc: + # Never serve an unsigned card in place of a signed one. + raise SystemExit( + f"openadapt-agent: the Agent Card can't be signed, so A2A was not " + f"started: {exc}" + ) from exc + except ValueError as exc: + raise SystemExit(f"openadapt-agent: {exc}") from exc print( f"openadapt-agent: serving over A2A at {config.base_url} (Agent Card " - f"{config.base_url}/.well-known/agent-card.json); " + f"{config.base_url}/.well-known/agent-card.json, signed by " + f"{card_signer(bridge).key_id}); " + ("bearer token required" if config.token else "loopback only"), file=sys.stderr, ) uvicorn.run( - build_app(bridge, config), + app, host=config.host, port=config.port, log_level="warning", diff --git a/packages/flow/openadapt_flow/agent/cli.py b/packages/flow/openadapt_flow/agent/cli.py index 3fb9cbfaac..83959985cf 100644 --- a/packages/flow/openadapt_flow/agent/cli.py +++ b/packages/flow/openadapt_flow/agent/cli.py @@ -661,6 +661,14 @@ def build_parser() -> argparse.ArgumentParser: "must carry. Required off loopback." ), ) + p.add_argument( + "--a2a-tck-scenarios", + action="store_true", + help=( + "For running the official A2A TCK: answer its scripted tck-* " + "messages. Needs --mode sandbox and loopback." + ), + ) p.set_defaults(func=_cmd_serve) repair = sub.add_parser( @@ -863,11 +871,12 @@ def serve(*bridges: Any, **options: Any) -> None: port=args.a2a_port, public_url=args.a2a_public_url, token=a2a_server.read_token(args.a2a_token_file), + tck_scenarios=args.a2a_tck_scenarios, ) except (OSError, ValueError) as exc: print(f"serve: {exc}", file=sys.stderr) return 2 - elif args.a2a_token_file or args.a2a_public_url: + elif args.a2a_token_file or args.a2a_public_url or args.a2a_tck_scenarios: print("serve: the --a2a-* flags need --a2a", file=sys.stderr) return 2 diff --git a/packages/flow/public-artifacts.json b/packages/flow/public-artifacts.json index 3ddde6dc77..6371d6d0e6 100644 --- a/packages/flow/public-artifacts.json +++ b/packages/flow/public-artifacts.json @@ -96,7 +96,12 @@ ".github/workflows/release.yml", ".github/workflows/validate-claims.yml", ".pre-commit-config.yaml", + "benchmark/a2a_interop/2026-11-30/evidence.json", + "benchmark/a2a_interop/interop.mjs", + "benchmark/a2a_interop/package-lock.json", + "benchmark/a2a_interop/package.json", "benchmark/a2a_tck/2026-11-21/compatibility.json", + "benchmark/a2a_tck/2026-11-30/compatibility.json", "benchmark/agent_guard/results.json", "benchmark/agent_test_proof/baselines/dolibarr-claude-verify.json", "benchmark/agent_test_proof/baselines/dolibarr-scripted-readback.json",