Skip to content

feat(schema): migrate prose required-when rules to x-adcp-validation (#3827)#3835

Merged
bokelley merged 1 commit intomainfrom
bokelley/x-adcp-validation-migration
May 2, 2026
Merged

feat(schema): migrate prose required-when rules to x-adcp-validation (#3827)#3835
bokelley merged 1 commit intomainfrom
bokelley/x-adcp-validation-migration

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

@bokelley bokelley commented May 2, 2026

Closes #3827.

Summary

Migrates five rule-bearing fields on get_adcp_capabilities from prose-only constraints to machine-readable x-adcp-validation annotations. Storyboard runners and SDK validators can now enforce these invariants programmatically; before this PR, the rules existed only in English description text and required prose-parsing.

Fields migrated

Field Sub-key Rule
request_signing.required_for subset_of Every operation listed must also appear in supported_for
request_signing.warn_for disjoint_with + subset_of Disjoint with required_for; subset of supported_for
webhook_signing.supported verifier_constraints.must_equal_when Must be true when seller advertises mutating-webhook emission via media_buy.reporting_delivery_methods or content_standards.supports_webhook_delivery (closes a downgrade vector)
identity.key_origins verifier_constraints.purpose_anchoring Every purpose listed must have a corresponding signing posture declared elsewhere on the response

Sub-key vocabulary extended

docs/reference/schema-extensions.mdx now documents three new sub-keys:

  • forbidden_when (inverse of required_when)
  • disjoint_with (item-level mutual exclusion across array fields)
  • subset_of (item-level subset constraint across array fields)

Excluded (already enforced natively)

  • adcp.idempotency — discriminated oneOf already encodes the replay_ttl_seconds invariant
  • webhook_signing.algorithmsenum on each item already enforces the allowlist

Backwards compatibility

Strictly additive on the wire. JSON Schema validators ignore unknown x- keys per draft-07. Verifiers that don't read x-adcp-validation continue to work. Storyboard runners that don't yet recognize a sub-key skip it and emit an "unrecognized validation rule" warning per the existing convention.

Test plan

  • npm run build:schemas
  • npm run test:schemas (7 passed)
  • npm run test:json-schema (255 passed)
  • npm run test:composed (32 passed)
  • Server typecheck
  • Storyboards green (CI)
  • CodeQL passes

🤖 Generated with Claude Code

…3827)

Five fields on get_adcp_capabilities gain machine-readable normative
constraints that storyboard runners and SDK validators can enforce
programmatically. Previously these rules lived only in description prose
and required English-parsing to enforce.

Fields migrated:
- request_signing.required_for — subset_of "request_signing.supported_for"
  (an operation can't be required without being supported)
- request_signing.warn_for — disjoint_with "request_signing.required_for"
  plus subset_of "request_signing.supported_for" (mutually exclusive
  with required_for; both subsets of supported)
- webhook_signing.supported — verifier_constraints.must_equal_when keyed
  on media_buy.reporting_delivery_methods including "webhook" or
  media_buy.content_standards.supports_webhook_delivery being true.
  Closes a downgrade vector — emitting state-changing webhooks unsigned
  lets an on-path attacker forge delivery callbacks.
- identity.key_origins — verifier_constraints.purpose_anchoring mapping
  each purpose to the signing posture that must be declared elsewhere
  on the response (request_signing purpose requires non-empty
  supported_for/required_for; webhook_signing requires supported:true;
  governance_signing requires governance in supported_protocols;
  tmp_signing requires non-empty trusted_match.surfaces).

Sub-key vocabulary extended in docs/reference/schema-extensions.mdx:
- forbidden_when (inverse of required_when)
- disjoint_with (item-level mutual exclusion across array fields)
- subset_of (item-level subset constraint across array fields)

Excluded as already-enforced-natively:
- adcp.idempotency — discriminated oneOf already encodes the
  replay_ttl_seconds invariant.
- webhook_signing.algorithms — enum on each item already enforces the
  allowlist.

Backwards compatibility: strictly additive on the wire. JSON Schema
validators ignore unknown x- keys per draft-07. Verifiers that don't
read x-adcp-validation continue to work; storyboard runners gain
enforceable assertions for invariants that were previously prose-only.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bokelley bokelley merged commit e9a79a0 into main May 2, 2026
18 checks passed
@bokelley bokelley deleted the bokelley/x-adcp-validation-migration branch May 2, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate prose required-when rules to x-adcp-validation extension across all schemas

1 participant