Skip to content

Catalog envelope-level fields and migrate to allOf shared-envelope pattern #3535

Description

@bokelley

Context

PR #3493 introduced the allOf \$ref to core/version-envelope.json pattern for fields that appear on every AdCP request and response. The pattern eliminates per-schema duplication (was 127 inline copies, now one source of truth).

Multiple other envelope-level fields exist as inline-per-schema definitions today and would benefit from the same factoring. This issue catalogs them and serves as a tracker for follow-up PRs.

Don't bundle. Each candidate has its own deprecation/migration story. Land them as separate additive PRs across 3.x.

Candidates

idempotency_key

  • Currently inlined on mutating requests (create_media_buy, update_media_buy, sync_creatives, etc.).
  • ~50+ source files affected.
  • Companion field replayed (currently in core/protocol-envelope.json's payload contract) is the response-side correlation.
  • Factor into core/idempotency-envelope.json referenced via allOf from mutating-request schemas; keep replayed in the protocol envelope.

governance_context

  • Already exists on core/protocol-envelope.json for the transport-layer wrapper.
  • The request-side shape (when a buyer presents an upstream-issued JWS token to a seller on a governed task) isn't envelope-factored — it appears inline on relevant request schemas.
  • 3.1 makes governance verification MUST for sellers; this is the moment to factor cleanly.

context and ext

  • Already \$ref'd to core/context.json and core/ext.json, but referenced as inline properties (context: { \$ref: ... }) rather than allOf-composed.
  • Inconsistent with the new envelope pattern.
  • Migration is mechanical and additive — pull context and ext into the shared envelope allOf, keep the per-schema properties empty for these fields. Wire-compatible.

replayed and other protocol-envelope payload fields

  • core/protocol-envelope.json describes the protocol-layer wrapper (context_id, task_id, status, message, payload, replayed, push_notification_config, governance_context, timestamp).
  • The wrapper is added by the transport (MCP, A2A, REST), not the AdCP payload.
  • Worth a re-read to confirm what belongs in the wrapper vs. in a payload-level envelope.

Plan

For each candidate above, file a separate PR that:

  1. Adds (or refactors) a core/<name>-envelope.json schema.
  2. Removes the inline definitions from each affected request/response.
  3. Composes via allOf: [{ \$ref: ... }] at the schema root.
  4. Confirms npm run build:schemas, npm run test:schemas, npm run test:composed, npm run test:examples are green.

Use PR #3493 as the template — it shows the pattern end-to-end.

What this issue is NOT

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    claude-triagedIssue has been triaged by the Claude Code triage routine. Remove to re-triage.schemaJSON Schema source-of-truth: definitions, codegen artifacts, validation, hygiene

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions