Skip to content

feat(schemas): add supported_optimization_metrics seller-level capability (closes #4651)#4669

Merged
bokelley merged 1 commit into
mainfrom
bokelley/4651-supported-optimization-metrics
May 17, 2026
Merged

feat(schemas): add supported_optimization_metrics seller-level capability (closes #4651)#4669
bokelley merged 1 commit into
mainfrom
bokelley/4651-supported-optimization-metrics

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

Adds media_buy.supported_optimization_metrics to get_adcp_capabilities response — a seller-level rollup of which optimization metrics any of the seller's products support. Mirrors the product-level metric_optimization.supported_metrics enum in core/product.json exactly.

This is the option Y decision from #4651 — a lightweight capability summary that storyboards can gate on via requires_capability plus a contains: matcher, instead of option X (deeper runner support for inspecting per-product capability arrays).

Why option Y

  • Single discoverable surface. Buyer agents already fetch get_adcp_capabilities for pre-flight filtering; one more rollup array is cheaper than crawling every product's metric_optimization block.
  • Lighter runner change. Storyboard gating only needs a contains: matcher on requires_capability (filed against adcp-client) — no semantic understanding of nested per-product capability claims.
  • Doesn't replace product-level inspection. Per-product metric_optimization.supported_metrics remains the source of truth for buy-time targeting and product selection. This rollup is a seller-level discoverability convenience.

Sync invariant

Sellers MUST keep this in sync with their product catalog: values appear here only if at least one product declares support. If no products support a metric, it MUST NOT appear here. This is a seller responsibility, not a schema-enforced one — enforcement would require cross-document validation which we don't run on capability responses.

Schema details

  • Location: media_buy.supported_optimization_metrics, placed adjacent to other rollup capabilities (audience_targeting, conversion_tracking)
  • Type: array of string enum, uniqueItems: true, minItems: 1
  • Enum: byte-identical to core/product.json metric_optimization.supported_metrics.items.enum["clicks", "views", "completed_views", "viewed_seconds", "attention_seconds", "attention_score", "engagements", "follows", "saves", "profile_visits", "reach"]
  • Optional. Omission = "seller declares no specific guarantees; buyers fall back to per-product inspection." Not added to media_buy.required.

What this unblocks

The metric-buy-mode storyboard scenarios under #4637 (capability-claim contract pattern) — reach_buy_flow, clicks_buy_flow, completed_views_buy_flow. Those scenarios additionally require a contains: matcher for requires_capability (filed against adcp-client); this PR is the schema half.

What this does NOT do

  • Does NOT touch core/product.json metric_optimization block.
  • Does NOT add the corresponding metric-buy-mode storyboards — those land once the contains: matcher ships in adcp-client.
  • Does NOT include vendor-gated metrics or attention-vendor declarations — that's a separate dimension (measurement_terms / measurement vendor catalog).

Refs

Test plan

  • npm run build:schemas succeeds
  • npm run build:compliance succeeds
  • Enum byte-matches core/product.json metric_optimization.supported_metrics.items.enum
  • Precommit (test:unit, test:test-dynamic-imports, test:callapi-state-change, typecheck) green

🤖 Generated with Claude Code

…lity (closes #4651)

Adds media_buy.supported_optimization_metrics as a seller-level rollup of
product-level metric_optimization.supported_metrics. Enum mirrors core/product.json
exactly. Optional, additive — sellers without it fall back to per-product
inspection.

Unblocks metric-buy-mode storyboard gating via requires_capability (#4637).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bokelley bokelley merged commit 7b5734e into main May 17, 2026
13 checks passed
@bokelley bokelley deleted the bokelley/4651-supported-optimization-metrics branch May 17, 2026 15:56
bokelley added a commit that referenced this pull request May 18, 2026
… contains: matcher (#4637) (#4722)

Four new storyboard scenarios in the capability-claim contract pattern, all
gated via the `contains:` matcher (shipped in @adcp/client 7.70 —
adcp-client#1817), all added to `sales-non-guaranteed.requires_scenarios`:

- `performance_buy_flow_roas` — gated on
  `media_buy.conversion_tracking.supported_targets` containing
  `per_ad_spend` (#4639). Certifies ROAS goal acceptance, rejection of
  per_ad_spend without value_field, and delivery surfaces
  `conversion_value` + `roas` alongside `conversions` + CPA.

- `reach_buy_flow` — gated on `media_buy.supported_optimization_metrics`
  containing `reach` (#4669). Certifies reach-unit binding, rejection of
  unsupported reach_unit, and delivery surfaces `reach` + `frequency`.

- `clicks_buy_flow` — gated on `media_buy.supported_optimization_metrics`
  containing `clicks` (#4669). Certifies click goal acceptance and
  delivery surfaces `clicks` + `cost_per_click`. No rejection arm —
  clicks is universal in semantics.

- `completed_views_buy_flow` — gated on
  `media_buy.supported_optimization_metrics` containing `completed_views`
  (#4669). Certifies view_duration_seconds binding, rejection of
  unsupported duration (per optimization-goal.json), and delivery
  surfaces `completed_views` + `completion_rate`.

All four grade `not_applicable` against the embedded training agent —
the training agent doesn't declare `supported_targets` or
`supported_optimization_metrics`. Same anti-façade hygiene as
`event_dedup_flow` (#4664): an agent that doesn't claim a capability is
not held to its scenario.

Refs: #4637, #4639, #4669, #4642, #4664, #4651, adcp-client#1817

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

RFC: capability gating for product-level capabilities (reach / clicks / completed_views storyboards)

1 participant