You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Schema-driven validation: client hooks + opt-in server middleware #249
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 (jsonschema or fastjsonschema), 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` (raise) vs `warn` (log + continue); strict in dev/test, warn in prod.
Server middleware (opt-in)
Wrapper for SDK-built agents at dispatcher layer.
Request rejects with `VALIDATION_ERROR` pre-handler.
Response validation: raise 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.
Activity
feat(validation): schema-driven validation with client hooks and opt-…