ADR 0007: A2A inbound adapter
Status
Accepted (2026-10-30).
Context
The fleet gives every bounded context three transports with no overlap: Kafka and
CloudEvents carry FACTS (ADR 0004), MCP carries an agent's TOOLS (ADR 0005), and the
Agent2Agent protocol (A2A) carries the DELEGATION of a goal between agents. A2A is never a
data-sync channel. This context already exposes a read-only MCP surface (ADR 0005): one
tool, get_checkout_session. Opening and confirming a session authorize and capture a
shopper's money and stay on REST only.
Decision
cmd/a2ais a third deployable besidecmd/apiandcmd/mcp, over the SAMEGetSessionuse case (internal/adapters/inbound/a2a, built ona2aproject/a2a-go/v2v2.7.0). It is a message-only agent (no Task lifecycle): the skill is a transactional read.- ONE curated, goal-shaped skill,
checkout_session_status("where does a checkout session stand"), derived from the MCP toolget_checkout_session. Write gate: a skill may change state only if the MCP surface already offers that write. The MCP charter is read-only, so this agent is read-only. It never widens what the context exposes: no open-session, no confirm. No write use case, no outbox, no relay, no policy, no Kafka, no sibling gateway is wired (TestA2AAdapterIsReadOnlyAndHasNoOutboundClient, an allowlist sensor over the adapter andcmd/a2a). There is no outbound A2A client either. - Input contract:
{"skill":"<id>","arguments":{...}}as a Data part (or a Text part holding the same JSON). Decoding is strict: unknown fields and trailing data are refused. - Domain rejections and bad requests are ANSWERED in-band as RFC 7807-shaped
problems in the message envelope, never as JSON-RPC errors, with the REST adapter's classification: 404not-found(unknown, malformed or over-longsessionId), 400invalid-argument/unknown-skill/malformed-skill-request, 500internal-error(logged with the trace id; the detail text is adapter-owned so infrastructure details never reach the caller). The 409, 422, 502 and 503 classes of the REST adapter belong to writes and sibling calls this agent does not make. - The answer carries references only (
shopperId,shipToAddressId), never the PSP token. - Each skill run is an OTel span
a2a.skill <id>with the attributea2a.skill, likemcp.tool <name>. - Endpoints:
A2A_ADDR(default:8093); JSON-RPC at BOTH/and/a2a; the Agent Card at/.well-known/agent-card.json;GET /healthz.A2A_AGENT_URLis mandatory: the absolute http(s) URL advertised on the card, refused at boot otherwise (the chart defaults it to the in-cluster Service DNS anda2a.agentUrloverrides it). - No authentication, consistent with the fleet decision of 2026-09-11 (ADR 0005): the card
declares no security schemes on purpose. Real Postgres only; the binary runs the idempotent
embedded migrations at boot like
cmd/mcpand has no in-memory mode. - Chart:
a2a-deployment/service/route.yaml,a2a:values block (default OFF, route a separate switch),checkout.a2aFullname; the gateway path is/api/a2a/checkout, prefix rewritten to/. Dockerfile:cmd/*is built by loop,/app/a2aships in the image.
Consequences
- A third deployable that shares the database of
cmd/api. It never writes, so it cannot put anything in the outbox; the CloudEvents of this context still leave only fromcmd/api. - A write skill (for example confirming a session) needs its own ADR and an MCP write first.
TestA2AAdapterDependencyRulekeeps the adapter additive: only application and domain below it, nothing depends on it. Re-adopting auth is a user decision plus an ADR.- Related: ADR 0004, ADR 0005.