The conformance suite
The conformance suite is a set of black-box tests and byte-level fixtures that check whether an implementation follows Agent Messaging. Every test belongs to one of the profiles that section 1.6 of the specification defines. It lives in the specification's repository on GitHub, in the conformance/ folder next to SPEC.md.
What a server must implement
Section 1.6 of the specification defines two profiles for a server, meaning the infrastructure that runs a network: its mesh servers, the control plane that issues credentials, and the platform services.
The core profile
Every server must implement it. It covers the envelope and signing, the key chain and live revocation, stopping agents, the registry, discovery and presence, requests, responses and tasks, events and feeds, files, rooms, admission and the knock, subjects and limits, and the binding.
The full specification
It adds the parts a deployment decides for itself, such as the tenancy model, how owners sign in, delegation to many places, verified names, the sandbox, metering and the other extensions. A server says which of these it offers.
Three kinds of test
- Core. What every Agent Messaging server must pass. A server that runs only the core profile runs these as its health check.
- Platform. Parts that section 1.6 makes deployment-defined, as the reference deployment offers them. A core server may leave these out.
- Naming. Tests of Agent Naming registrars, which are not messaging servers. They belong to Agent Naming's own suite and run here until they move there.
Every test declares its profile, and a check in the repository fails on a test that does not, so no test can drop out of the core set by accident.
How the tests run
The tests exercise a running server over its real wire, and nothing is mocked in process. They speak the reference binding, NATS JetStream, so they run against any server on that binding. A run of the core profile has no default address: it stops until you name the server to test.
# once: the shared dependencies cd conformance/peering && npm install cd .. # the core profile, against your server MESH_WS_URL=wss://mesh.example.com MESH_CREDS_FILE=~/mesh.creds \ STOREFRONT_BASE=https://api.example.com node run.mjs
run.mjs runs the core tests of both suites on one
board and prints the specification version and the profile it tested. A test
whose setting is missing reports env-skip and names the setting. The adapter
tests (c12, c13 and c15) also need the reference adapter, which comes with
the reference SDKs.
- MESH_WS_URL is the server's NATS WebSocket address. Every live test needs it.
- MESH_CREDS_FILE is a NATS credentials file for the suite. It defaults to ~/.agentmesh/mesh.creds.
- STOREFRONT_BASE is the server's HTTPS API, where the credential doors and the key check are. c19, c20, c22, c24 and c24b need it.
- MESH_IDENTITY_FILE is an agent identity the suite signs as and mints credentials for. c10 opens its room as this agent, so an account on the server must own it. c20, c24 and c24b mint credentials for it.
- MESH_CONFORMANCE_AGENTS_FILE holds standing keys for the agents the suite registers, which a server needs when registration requires a name.
- REGISTRAR is an Agent Naming registrar for the adapter tests, and ECHO_TARGET is an agent for t02 and t05 to send to. Without ECHO_TARGET, the suite starts its own echo agent with the reference adapter.
node run.mjs --profile platform # the deployment-defined parts node run.mjs --profile naming # the registrar tests node run.mjs --profile all # everything node run.mjs --only c05 # one test node run.mjs --ci # fail on a regression against expectations.json node run.mjs --update # record this run as the new baseline
Outside the core profile, an address you leave unset falls back to the reference deployment, and the run prints a banner naming each one that did. The README lists every setting.
What a result means
Each test reports pass, fail, error or env-skip. A test whose prerequisite is missing reports env-skip and names what is missing, so a missing prerequisite never shows up as a pass. A test that was given credentials it could not use reports not-validated, which counts as a failure.
A red test means there is a defect either in the code or in the specification. Which of the two it is gets decided explicitly, in writing, and nobody edits a test just to make it pass. Every test names the sections of the specification it checks.
The 32 core tests
The tests numbered c are in the core/ folder and the tests numbered t are in peering/. The section numbers refer to the specification; EXT-5 and EXT-6 are the rooms and admission extensions, and "naming" refers to the Agent Naming specification.
| test | what it checks | sections |
|---|---|---|
| c01 | Events reach the subscribers whose pattern matches, signed, and do not reach anyone else. | 6.6, 6.7, 14.2 |
| c01b | A durable subscriber that was away receives the events published while it was gone. | 6.7, 18.3, 18.6 |
| c02 | A task moves through its states on the wire, and a finished task cannot change again. | 7.2, 7.3, 14.1 |
| c03 | An unsigned or altered envelope is rejected at the wire before any handler sees it. | 4.4, 4.5, 5.3 |
| c04 | A request that is sent twice runs only once. | 5.5, 18.8 |
| c05 | Stream chunks arrive in order, the stream ends cleanly, and a forged chunk never reaches the receiver. | 10.5, 11.2, 11.6 |
| c06 | Presence goes offline when heartbeats stop, and the agent's manifest stays where it was. | 8.4, 9.5, 9.6 |
| c07 | Messages from anonymous senders are dropped before the handler, and messages from registered senders are passed on. | EXT-6 |
| c09 | A message over the 1 MB cap fails quickly with a defined error, and a smaller one goes through. | 18.9 |
| c10 | Members of an access-controlled room can talk, and expelling a member revokes its credential at the server. | EXT-5, 15.3 |
| c11 | A mailbox holds messages for an offline agent, the agent collects them when it returns, and its reply reaches the sender. | 6.4, 6.5, 16.4, 18.3, 18.6, 18.7 |
| c12 | In pipe mode the adapter hands each message to a fresh process and sends what the process prints back as the reply. | 6.4 |
| c13 | In inbox mode messages queue up, and a session collects them and replies. | 6.4, 16.4 |
| c14 | An agent's declared interaction style is stored and can be found through discovery. | 8.2, 8.3a, 9.3 |
| c15 | Streaming requests go through admission, so a blocked sender never reaches the agent's command. | 11, EXT-6 |
| c16 | The server refuses a connection that does not authenticate. | 4.6, 18.2 |
| c18 | A feed delivers what its owner publishes, and the current value of a feed can be read. | 6.6a, 18.3 |
| c19 | Without an account behind it, no credential is issued and nothing is delivered. | 4.1, 4.8, 6.2 |
| c20 | A revoked credential is cut off in seconds, and a revoked agent key is refused. | 4.8, 4.10, 5.3, 18.2 |
| c22 | The key check answers revoked for a stopped agent, and reports no stop for a key nobody stopped. | 4.12, 5.3, 9.2 |
| c23 | The presence lookup answers from signed heartbeats only: an unknown node reads offline, its own heartbeat makes it online, and a heartbeat signed by another key changes nothing. | 9.6, 10.10 |
| c24 | A credential answer says where the mesh is: its name, its wire version, and a list of transport addresses whose scheme names the binding. | 18.1, 18.10, 20.1 |
| c24b | On the NATS binding, a credential answer also carries the list of NATS addresses that clients older than 0.7 read, holding the same addresses. A server on another binding skips this test. | 18.10 |
| t01 | An envelope verifies offline, whatever carried it, and any tampering breaks it. | 4.5, 21.1 |
| t02 | A message that has passed through more hops than allowed is dropped. | 5, 21.2 |
| t03 | Ordinary credentials cannot use the reserved peering subjects. | 14.1 |
| t04 | Every subject in the subject table can be rewritten across a network boundary and back. | 14.1, 21.3 |
| t05 | An agent's describe document can be read before admission, over the network. | 8.7, 10.14 |
| t06a | A resolver discards a card that is not signed. | naming 5.3 |
| t06b | The card from a handle's anchor domain wins over the registrar's card. | naming 5.2, 5.5 |
| t09 | Trust attestations verify offline, with or without the reference code. | 9.7, 21 |
| t14 | A signed card whose key the authority does not publish is discarded. | naming 5.3 |
The 5 tests of deployment-defined parts
These check parts that a server may leave out under section 1.6, as the reference deployment offers them.
| test | what it checks | sections |
|---|---|---|
| c08 | The reference deployment's retired no-signup doors answer 410 and issue no credential. | 4.1, 18.10 |
| c21 | When one of an agent's places signs out it can no longer act, and the agent's other places still can. | 4.10, 4.11 |
| c22b | A provider advisory is signed by the agent's own key, listed, and shown on the key check. | 4.12, 5.3, 9.2 |
| t05b | An agent's describe document can be read before admission, over HTTPS. | 8.7, 10.14 |
| t10 | A request and a describe cross a gateway between two peered networks with the envelope intact. | 9.7, 10.14, 21 |
The 5 registrar tests
These check what has to hold when a handle moves between Agent Naming registrars. Several need two registrars, and the scripts in peering/rig/ set those up on one machine.
| test | what it checks | sections |
|---|---|---|
| t07 | A handle can move to a new custodian with its key unchanged, and nobody's pinned record raises an alarm. | naming 5.6 |
| t08 | After a handle moves out, the old registrar refers to the new one and cannot issue the handle again. | naming 5.6, 7.8 |
| t11 | Hijacked, forged, replayed and stale re-home statements are refused. | naming 5.6, 7.8 |
| t12 | A handle that has moved still resolves at its old address, because referrals are followed. | naming 5.6 |
| t13 | A registrar taking a handle in trusts only a configured peer, and only what that peer has signed. | naming 5.6, 7.8 |
The 29 byte-level fixtures
Two implementations that both look correct can still produce different bytes, and different bytes under a signature mean a signature that does not verify. The JSON fixtures in conformance/ pin the exact bytes and decisions in the places where that tends to happen. An implementation in any language can load them and compare. They are test vectors, which unit tests read, and they need no running server.
Envelopes, signatures and delivery
- canonical-json.json: canonical JSON (RFC 8785) as the specification uses it (5.3).
- signature-tags.json: the versioned prefixes on vouch attestations, room descriptors and admission rosters (4.4, EXT-5, EXT-6).
- manifest-signing.json: the manifest's key claim, which the TypeScript and Rust SDKs must both sign to the same bytes (8.3).
- accept-signal.json: the accept that a responder sends when a live handler takes a request, and the queued acknowledgement (6.4a).
- sender-preflight.json: the checks a sending SDK makes before it publishes anything (6.4b).
- inbound-protections.json: the five obligations a receiver owes the sender, starting with duplicate rejection and a freshness window (22).
- feeds.json: the feed subject grammar and payloads that the SDKs, the adapter and the server must agree on (6.6a, 14.1, 18.3).
- rests-on.json: what a statement rested on, and the freshness verdict a verifier computes from it (5.6).
- delegation.json: one agent acting from many places, with its delegations and approvals (4.11).
Tasks, budgets and descriptions
- cancel.json: the cancel request, its reasons and the canceled task update (10.8).
- task-origin.json: the request that created a Task and who asked for its cancellation, as the server observed them (7.1, 10.8).
- budget.json: the budget block and the refusals that go with it (7.7).
- five-questions.json: the five questions every agent answers, taken from its describe document (3.3.1, 10.14).
- job-manifest.json: the signed record of what an agent delivered for one completion of a job.
- deliverable-records.json: deliverable records and the input, interim and output roles derived from them.
- rooms-entry.json: the room transcript entry that every room surface hands to a browser (EXT-5).
- trial.json: trial declarations, their admission order and their refusals.
Names
- naming.json: the naming wire formats that a registrar and an adapter must both reproduce.
- naming-gate.json: the rule that an agent without a standard handle sends nothing, and what the sender is told.
Metering and commerce
- metering.json: the meter event, the observed meters, the usage receipt and the request an answer's events name (13.5, 19.2).
- commerce.json: the SKU and price shapes, the agreement document and the rating arithmetic (19).
- allowance.json: the owner allowance document and its refusals (EXT-8).
Companion specifications
- pact-identity.json and pact-delegated.json: the PACT Identity and PACT Delegated requirements, for both roles.
- The fixtures for the Agent SoW clauses on pricing, data use, disputes, reporting, subcontracting, liability and service floors are kept with Agent SoW, in sow/conformance of the Common Agent Standards repository.