Why
Companion to adcontextprotocol/adcp-client#688. Field-name drift between server responses and the AdCP spec is being caught late — by running storyboards, not by the SDK. Two recent examples (TS side):
- `targeting` vs `targeting_overlay` (response drift)
- `catalog_type` vs `type` (request drift)
The bundled JSON schemas published with each AdCP release are the source of truth. SDKs are the leveraged place to enforce them.
What
Mirror the TS validator shape so the three SDKs converge:
Core
- Load bundled schemas from `dist/schemas//bundled/*.json` (self-contained `$ref`s).
- Compile once (e.g. santhosh-tekuri/jsonschema), cache by task + direction.
- Emit `VALIDATION_ERROR` with JSON Pointer, message, schema path. Match the existing AdCP L3 error envelope.
- Non-strict on `additionalProperties` for extension safety.
Client hooks (on by default)
- Validate outgoing requests before send.
- Validate incoming responses on receive.
- `strict` (error) vs `warn` (log + continue); strict in dev/test, warn in prod.
Server middleware (opt-in)
- HTTP middleware for SDK-built agents at dispatcher layer.
- Request rejects with `VALIDATION_ERROR` pre-handler.
- Response validation: error in dev/test, log + metric in prod.
Async response variants
- Select schema by response shape (`task_id`/`status`), not task name, for `-async-response-` cases.
Scope
- Published AdCP tools only.
- Shape validation only — does not replace semantic checks.
- Version pinned to SDK's declared AdCP version.
Sequence
TS (adcontextprotocol/adcp-client#688) prototypes first. Go ports shape, error code, and pointer format.
Why
Companion to adcontextprotocol/adcp-client#688. Field-name drift between server responses and the AdCP spec is being caught late — by running storyboards, not by the SDK. Two recent examples (TS side):
The bundled JSON schemas published with each AdCP release are the source of truth. SDKs are the leveraged place to enforce them.
What
Mirror the TS validator shape so the three SDKs converge:
Core
Client hooks (on by default)
Server middleware (opt-in)
Async response variants
Scope
Sequence
TS (adcontextprotocol/adcp-client#688) prototypes first. Go ports shape, error code, and pointer format.