ADR 0011: A2A inbound adapter
Status
Accepted (2026-10-29).
Context
The fleet has three transports with no overlap: Kafka + CloudEvents carries FACTS, MCP carries an agent's TOOLS, and Agent2Agent (A2A) carries the DELEGATION of a goal between agents, never data sync. node-topology already has the first two (the outbox relay of ADR 0005 and the read-only MCP server of ADR 0008); it had no way for a peer agent to hand it a goal ("which station delivers to 013, and when does it operate?") instead of choreographing six tool calls.
ADR 0003 makes this context an Open Host Service for reads: it consumes no topic and calls no sibling. A2A is one more driving adapter over those same reads; it does not change that direction.
Decision
- A third driving adapter, a separate binary.
internal/adapters/inbound/a2ais built ongithub.com/a2aproject/a2a-go/v2(pinned v2.7.0) and served bycmd/a2aover JSON-RPC 2.0 on HTTP: the Agent Card at/.well-known/agent-card.json, the JSON-RPC endpoint at BOTH/and/a2a, an open/healthz.cmd/a2ais cloned fromcmd/mcp(same composition, same Postgres repositories, same boot migrations behindbootretry, same observability standard of ADR 0010) and listens onA2A_ADDR(default:8093; 8080 is the api, 8090 the mcp server).A2A_AGENT_URL, the absolute http(s) URL advertised on the card, is MANDATORY: the binary refuses to boot, before touching the database or binding a listener, when it is unset, relative or not http(s). - A message-only agent with two curated, goal-shaped READ skills, not one per
endpoint. The input contract is
{"skill":"<id>","arguments":{...}}as a data part (or a text part holding the same JSON); the answer is one agent message with a data part (the envelope{skill, data | problem}) and a text part (a one-line summary), bound to the caller's context id.serving_station(postalPrefix): resolves the delivery station serving a postal prefix and returns the assignment (deliveryStationNodeId,regionId,assignmentVersion) together with that station's node and CURRENT operational profile (operating hours, holidays, handling time, cutoffs, throughput cap). A composition ofResolveServiceAreaandGetNode; MCP-derived (resolve_service_area+get_node).find_nodes(type?, regionId?, status?): the nodes matching the filters (AND), by id ascending, each with its profile revision (the full profile isserving_station's job, so a listing stays small). TheListNodesuse case; MCP-derived (list_nodes). Lanes, regions, single-node reads and the whole write side are not skills: they stay MCP tools and REST operations.
- The write gate: the agent is READ-ONLY. A skill may change state only if
the context's MCP surface already offers that write, and the MCP charter
(ADR 0008,
governance_test.go) is read-only. SoDepsholds three read use cases and nothing that can write,cmd/a2awires no write use case, no outbox writer, no publisher and no Kafka adapter and never starts the relay (it consumes no topic anyway), so this binary can never append to the outbox.internal/architecture/a2a_fitness_test.gopins it (everyDepsfield is aGet*/List*/Resolve*use case); the wire tests pin that write-shaped skill ids (register_node,assign_service_area,suspend_node) are answered as unknown skills and that no store row, outbox row or aggregate version moves through any skill; the integration test proves the same against real Postgres. Because there is no write skill there is no delegated-write outbox proof to run: facts keep leaving exclusively from REST through the api's transactional outbox and relay. - Strict input. Requests decode with
DisallowUnknownFieldsand reject trailing data, so a misspelt filter (statuz) can never silently widen a query to every node; absent arguments are the empty object and each skill's own required-argument check answers. A U+0000 in any string argument is refused as an invalid argument (Postgres cannot compare it; REST answers 400 for it too). - Problems are ANSWERED, never raised. Domain rejections and bad requests
travel in the message envelope as RFC 9457-shaped problems (
typeis the stable slug, like the REST adapter'stype), never as JSON-RPC errors, with the REST adapter's status classification (internal/adapters/inbound/http/problems.go):not-found404 (unassigned prefix),validation-failed422 (a type or status that is not an enumeration value), adapter-ownedmalformed-skill-request,unknown-skillandinvalid-argument400 (REST's malformed-body class), andinternal-error500 whose detail never carries the underlying error text (it is logged). Only the errors a READ can raise are mapped, as in the MCP adapter; the 409 and 503 classes of REST need a write or a readiness probe and cannot occur here. No shared domain error text in this context names a deprecated alias, so no adapter-owned detail rewrite was needed. - Observability. One OTel span per skill (
a2a.skill <id>, attributea2a.skill), mirroringmcp.tool, under the server span and the request log of ADR 0010; the binary exports asnode-topology-a2a. - No auth, no outbound. The surface is unauthenticated like REST and MCP
(fleet-wide revert of 2026-09-11); the card declares no security scheme.
Access control is the in-cluster ClusterIP boundary. No outbound A2A client
exists in this repository: the context calls no sibling, and
a2a_fitness_test.gofails the build on any non-test import of the SDK'sa2aclientpackage or of the SDK outside the adapter andcmd/a2a. - Helm.
a2a-deployment,a2a-serviceanda2a-routemirror the mcp templates (componenta2a, command/app/a2a, port 8093, thea2a:values block DEFAULT OFF, helpernode-topology.a2aFullname).A2A_AGENT_URLdefaults tohttp://<release>-a2a.<namespace>.svc.cluster.local:8093/and is overridable witha2a.agentUrl; the optional gateway route/api/a2a/node-topologyrewrites to/, so the card stays reachable under the same prefix. The Deployment gets the database and observability env and NOKAFKA_BROKERS,EVENT_PUBLISHERor relay env. The render test derives the mandatory variables from the"<VAR> is required"boot errors ofcmd/a2a; the selector test pins that each Service selects exactly one Deployment. The Dockerfile already builds everycmd/*binary into/app.
Consequences
- A peer agent can ask the goal-shaped questions in one message instead of composing MCP tool calls; the answers come from this context's own tables through the same use cases as REST and MCP (one action surface, three protocols).
- Adding a skill is a reviewed act (an amendment of this ADR): the card test,
the skill table and the
Depsfitness test change together. A write skill additionally needs the MCP charter to offer that write first and an integration test proving the delegated write leaves UNPUBLISHED outbox rows. - A second read surface to keep consistent with the REST/MCP views; the DTOs are adapter-owned and mapped from the application views, so domain structs never cross the boundary.
- One more Deployment per environment when
a2a.enabled=true; the environment that deploys it supplies the gateway parentRefs (and may overridea2a.agentUrlwith the gateway path for off-cluster callers).