First step of docs/agent-os/15-oss-integration-plan.md: wire the REAL upstream A2A spec as the interop source of truth instead of trusting hand-authored schemas. - Vendor canonical a2a.proto from A2A/specification into packages/a2a-sdk/schemas/canonical/ (+ provenance README). - canonical-conformance.test.ts parses the proto and asserts the canonical AgentCard/AgentSkill field sets EXACTLY match a declared canonical->Recoder mapping (recoderField | null for documented intentional gaps). Upstream A2A drift (added/removed/renamed fields) now fails CI until consciously mapped. Does not rip out the existing hand-authored schemas — adds a drift gate on top, as planned. Verified: a2a-sdk 28/28 tests (+5 new), check-types 0. Refs: docs/agent-os/15-oss-integration-plan.md (Wave 0) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
24 lines
1.2 KiB
Markdown
24 lines
1.2 KiB
Markdown
# Canonical A2A schema (vendored)
|
|
|
|
`a2a.proto` is vendored verbatim from the upstream Agent2Agent (A2A) protocol
|
|
specification (`A2A/specification/a2a.proto` in this monorepo, which mirrors
|
|
[a2aproject/A2A](https://github.com/a2aproject/A2A)). It is the **source of truth**
|
|
for cross-agent interop field names.
|
|
|
|
It is intentionally NOT generated into Zod/TS here. Recoder's `packages/a2a-sdk`
|
|
schemas are a Recoder-domain layer that maps onto — but does not 1:1 mirror — the
|
|
canonical wire shapes. The relationship is enforced, not assumed:
|
|
|
|
- `src/canonical-conformance.test.ts` parses this proto and asserts the canonical
|
|
`AgentCard` / `AgentSkill` field sets exactly match a **declared mapping** to
|
|
Recoder fields (`canonical field -> recoder field | null-for-intentional-gap`).
|
|
- When upstream A2A adds or removes a field, the test fails until the mapping is
|
|
consciously updated — drift on the interop contract can never land silently.
|
|
|
|
## Updating
|
|
|
|
1. Refresh `A2A/specification/a2a.proto` from upstream.
|
|
2. `cp -f A2A/specification/a2a.proto packages/a2a-sdk/schemas/canonical/a2a.proto`
|
|
3. Run `pnpm --dir packages/a2a-sdk test`; update the mapping in
|
|
`canonical-conformance.test.ts` for any added/removed/renamed canonical fields.
|