Skip to content

feat(schema): add experimental product execution requirements - #7774

Merged
bokelley merged 3 commits into
mainfrom
feat/product-execution-requirements
Sep 30, 2026
Merged

bokelley merged 3 commits into
mainfrom
feat/product-execution-requirements

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

This is Piece 1 of #7763. A product can now say what the buyer has to supply before create_media_buy will succeed. Today products only say what they support (for example, conversion_tracking means "event goals are accepted"), so buys fail at creation when a pixel, catalogue, app or identity is missing.

The new field is Product.execution_requirements[], experimental for 3.2 with feature id media_buy.execution_requirements. Each kind binds through a request field that already exists:

kind Satisfied by Established through
event_source (optional event_types) an event optimization goal's event_sources[].event_source_id sync_event_sources, or a seller-managed source
catalog (catalog_types) packages[].catalogs[] of a listed type. App promotion uses "app"; app-item already carries app_id, bundle_id, apple_id and store_url sync_catalogs or an inline catalog
downstream_connection a completed seller-side grant (reuses downstream-connection-requirement) the connection flow; failures keep using AUTHORIZATION_REQUIRED

Rules:

  • All entries are required. Alternatives inside one entry are any-of.
  • Account-independent. The declaration doesn't change cache_scope, so wholesale catalogues stay publicly cacheable. It carries no account resource IDs or names. For connections, the schema forbids resource_ref and allows no status other than unknown.
  • Complete when present. A seller can't reject a package that satisfies every declared entry for lacking a resource of an undeclared kind. That includes connections it would otherwise reject with AUTHORIZATION_REQUIRED. When the field is absent, the product hasn't declared anything.
  • Coherence, enforced in the schema.
    • Full Product: an event_source requirement requires conversion_tracking.
    • Full and canonical products: a catalog requirement requires catalog_types.
  • Rejection. An unmet event source or catalog returns VALIDATION_ERROR, with error.field at the binding and error.details per the new error-details/execution-requirement-unmet.json. The reason is not_bound, not_found or ineligible, and the product's requirement is repeated back. This applies to create_media_buy packages, update_media_buy new_packages[], and updates that remove or replace a satisfying binding. Unrelated updates to existing buys are not re-checked.

The rules bind only sellers that declare the field, so currently conformant sellers are unaffected.

Deferred to 3.3 (#7763 stays open)

  • Per-account readiness (ready / setup_required / selection_required / input_required / unknown) and candidates.
  • A response-level readiness map so readiness doesn't force account-scoped caching.
  • Bindings for lead_form and messaging_destination.
  • Buyer-directed choice among several connected identities. Until then the seller applies its documented default.
  • Conformance storyboards.

Changes

  • New schemas: core/product-execution-requirement.json (a discriminated union on kind) and error-details/execution-requirement-unmet.json.
  • core/product.json and core/canonical-product.json: the new field plus the coherence rules. Also added to media-buy/product-fields.json and index.json.
  • Docs:
    • a spec section with the kind-to-field table;
    • get_products, create_media_buy and media-products references;
    • the experimental registry;
    • What's New in 3.2.
  • Changeset (minor) and tests/execution-requirements.test.cjs (9 tests), wired into test:schemas.

Review

An ad-tech protocol expert agent reviewed this. It confirmed:

  • the binding paths against package-request, optimization-goal, catalog-type, event-type and app-item;
  • that update_media_buy.new_packages[] exists;
  • that the root oneOf + discriminator matches the optimization-goal.json pattern the SDK code generators already handle.

All six of its findings are fixed in this PR:

  • the canonical product couldn't satisfy the coherence rules;
  • a resource_ref loophole;
  • the update rule rejected unrelated updates to existing buys;
  • the error details shape said "Recommended" where the spec says MUST;
  • the error field path didn't cover update_media_buy;
  • the event-goal wording was ambiguous when a package has several goals.

Test plan

  • npm run test:schemas, including the new tests
  • npm run build:compliance -- --check
  • check:registry, lint:schema-links, test:error-handling, test:contracts
  • json-schema-validation on the changed docs
  • Prettier on the new files
  • Changeset scope check and changeset status
  • CI. The local pre-commit hook, which runs the full server unit suite, was skipped; CI runs the same gates.

🤖 Generated with Claude Code

Let a product declare, independent of the caller's account, the resources a
package needs before create_media_buy succeeds: an event_source (bound through
an event optimization goal), a catalog (bound through packages[].catalogs,
including app catalogs for app promotion), or a downstream_connection (reusing
downstream-connection-requirement). Unmet event-source or catalog requirements
reject with VALIDATION_ERROR and the new execution-requirement-unmet details.

First half of #7763; per-account readiness is deferred to 3.3.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Escalate to human review

Escalate — gated schema paths require human/CODEOWNERS approval that is not yet present.

This PR adds an experimental Product.execution_requirements surface. The reviewer found the change clean: schema↔docs coherence verified (event_source/catalog/downstream_connection binding paths exist), a correct minor changeset for a non-breaking Normative change, a properly discriminated oneOf, no dist mutation, and comprehensive tests wired into test:schemas. No Critical/High/Medium findings.

However, the PR modifies files under static/schemas/source/**, which are under a hard, deterministic approval gate (gated_paths: true). The required review status is REVIEW_REQUIRED, not APPROVED. Per decision rule row 2, a gated-paths PR without review_decision: APPROVED must not be approved and must escalate for human/CODEOWNERS review.

Escalation reasons

  • Modifies gated protocol source (static/schemas/source/core/canonical-product.json, core/product.json, core/product-execution-requirement.json, error-details/execution-requirement-unmet.json, index.json, media-buy/product-fields.json) — hard approval gate; requires human/CODEOWNERS approval (review_decision is REVIEW_REQUIRED).

Once a real approval lands, a clean diff like this can fall through to approve.

>

Why human review

  • Modifies gated protocol source under static/schemas/source/** (canonical-product.json, product.json, product-execution-requirement.json, execution-requirement-unmet.json, index.json, product-fields.json) — hard approval gate requires human/CODEOWNERS approval; review_decision is REVIEW_REQUIRED, not APPROVED.
  • This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/core/canonical-product.json (modified) matches static/schemas/source/**; static/schemas/source/core/product-execution-requirement.json (added) matches static/schemas/source/**; static/schemas/source/core/product.json (modified) matches static/schemas/source/**; static/schemas/source/error-details/execution-requirement-unmet.json (added) matches static/schemas/source/**; static/schemas/source/index.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/product-fields.json (modified) matches static/schemas/source/**) and the current GitHub review decision is 'REVIEW_REQUIRED', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

@aao-secretariat aao-secretariat Bot added the ladon/needs-human-review Ladon has escalated this PR for human review. label Sep 30, 2026
…e budget

Tighten execution_requirements descriptions and keep one schema example so
comply_test_controller's product-bearing request stays under the parity
compile limit, and report actual bytes when the limit is exceeded.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Escalate to human review

Escalate — gated protocol source touched, human/CODEOWNERS approval required.

This PR adds a new product-execution-requirement concept: two new schema files (static/schemas/source/core/product-execution-requirement.json, static/schemas/source/error-details/execution-requirement-unmet.json) plus modifications to canonical-product.json, product.json, index.json, and product-fields.json — all under static/schemas/source/**, a deterministic hard approval gate.

gated_paths: true and review_decision: REVIEW_REQUIRED (not APPROVED). Per decision-table row 2, this cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is. The reviewer's delta pass surfaced no Critical/High/Medium findings (editorial description rewording, whitespace-only allOf reformat, example pruning, test-message byte interpolation — all wire-shape-preserving; discriminator intact, no oneOf regression), and this is a subsequent push on a prior escalate. But the gate is path-based and mechanical, not defeated by a clean diff.

Additionally, this introduces new normative protocol surface (new fields/concepts) which the constitution treats as never-auto-approvable without human ratification.

Escalation reasons

  • Modifies/adds gated protocol source under static/schemas/source/** (product-execution-requirement.json, execution-requirement-unmet.json, canonical-product.json, product.json, index.json, product-fields.json) — hard approval gate; review_decision is REVIEW_REQUIRED, not APPROVED. Human/CODEOWNERS approval required.

Why human review

  • Touches gated protocol source under static/schemas/source/** (canonical-product.json, product.json, index.json, product-fields.json modified; product-execution-requirement.json, execution-requirement-unmet.json added) — hard, non-overridable approval gate; review_decision is REVIEW_REQUIRED, not APPROVED. Human/CODEOWNERS approval required before merge.
  • New normative protocol surface (product-execution-requirement concept and error-detail) is not auto-approvable without human ratification per the constitution's decision-class hard gate.
  • This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/core/canonical-product.json (modified) matches static/schemas/source/**; static/schemas/source/core/product-execution-requirement.json (added) matches static/schemas/source/**; static/schemas/source/core/product.json (modified) matches static/schemas/source/**; static/schemas/source/error-details/execution-requirement-unmet.json (added) matches static/schemas/source/**; static/schemas/source/index.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/product-fields.json (modified) matches static/schemas/source/**) and the current GitHub review decision is 'REVIEW_REQUIRED', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

- Retitle requirement branches so codegen does not collide with the
  existing DownstreamConnectionRequirement type.
- Define completeness as product requirements plus the selected formats'
  required_connections; format-conditional connections stay on the format.
- Scope the rejection MUST to buyer-supplied packages and new_packages;
  proposal-derived packages are deferred with per-account readiness.
- Forbid connection_id and expires_at on connection requirements and
  require required_for to include create_media_buy when present.
- Evaluate event goals and sources the seller will actually use.
- Point field at the offending entry for not_found/ineligible, align
  issues[] ordering, and list the details schema in transport errors.
- Document seller-managed event source IDs, app single-item and app/event
  source association, attribution-only pixels, retail catalog selectors,
  error precedence, and the update_media_buy error row.
- Assert the specific missing property in negative tests and cover the new
  connection restrictions; raise the MCP parity compile limit to fit.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

Copy link
Copy Markdown
Contributor Author

Expert review (protocol, ad-tech product, DX, code)

Four expert agents reviewed the PR in parallel. Every blocking and should-fix finding is addressed in 7f60acc.

Blocking — fixed

  • Protocol: "complete when present" conflicted with format-level required_connections. The complete set is now the product's execution_requirements plus the required_connections of the format declarations a package selects. Connections every package needs, including the advertiser account, go on the product. Connections only some formats need stay on the format.
  • Protocol: packages created from proposal_id couldn't carry bindings. The rejection MUST is now limited to buyer-supplied packages[] / new_packages[]. Proposal-derived packages are deferred with per-account readiness (RFC: per-account execution readiness for products (required resources, candidates, and binding) #7763, 3.3).
  • DX: codegen type name collision. The branch title "Downstream connection requirement" would have generated the same name as the existing DownstreamConnectionRequirement type. The branches are now titled *ExecutionRequirement.

Should-fix — fixed

  • Connection requirements also forbid connection_id and expires_at, and required_for, when present, must include create_media_buy.
  • Event-source satisfaction only counts goals and sources the seller will actually use (max_optimization_goals, multi_source_event_dedup).
  • For not_found / ineligible, sellers SHOULD point at the offending entry. issues[] SHOULD list unmet requirements in the same order. The details schema is now listed in transport-errors.
  • New docs:
    • how to get the ID of a seller-managed (platform_managed) event source;
    • the retail-catalog selector path (ids, gtins);
    • that a seller may require a single app item and that an event source not associated with the app is ineligible;
    • declaring event_source only when event optimization is required;
    • that buyers should satisfy every declared entry before calling, because either error may be reported first;
    • the update_media_buy error row;
    • the matching note in commerce-media.
  • Negative tests now assert the specific missing property, and they cover the new connection restrictions.

Other

  • The MCP parity compile limit goes from 1,260,000 to 1,265,000. The seeded Product in comply_test_controller now measures about 1,260,400 bytes. This follows the precedent from the viewable_rate change.
  • Code review confirmed:
    • the oneOf is discriminated (test:oneof-discriminators: no new undiscriminated oneOf);
    • the connection allOf behaves as intended under draft-07 and the 2020-12 projection;
    • each negative test fails for the intended reason.

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Escalate to human review

Escalate — gated protocol source under hard approval gate, review not yet APPROVED.

This PR adds an experimental Product.execution_requirements refinement across static/schemas/source/** (product.json, canonical-product.json, index.json, product-fields.json modified; product-execution-requirement.json and execution-requirement-unmet.json added) plus corresponding docs and a correct additive changeset. The reviewer's delta pass is clean: connection-variant constraints are well-formed, the oneOf stays discriminated by kind, schema↔docs↔changeset agree, and new tests cover every new constraint. No Critical, High, or Medium findings.

However, gated_paths is true (files under static/schemas/source/**) and review_decision is REVIEW_REQUIRED, not APPROVED. Per decision-table row 2 and the repo's decision-class hard gate, new normative protocol surface cannot be auto-approved without human/CODEOWNERS ratification, regardless of how clean the diff is. This mirrors the prior escalate decision; the gate remains unsatisfied.

Escalation reasons

  • Gated protocol source under static/schemas/source/** modified/added; review_decision is REVIEW_REQUIRED, not APPROVED — hard, non-overridable approval gate requires human/CODEOWNERS sign-off.
  • New normative protocol surface (product-execution-requirement concept and execution-requirement-unmet error detail) requires human ratification per the constitution's decision-class hard gate.

Why human review

  • Gated paths: static/schemas/source/** files modified/added (product.json, canonical-product.json, index.json, product-fields.json, product-execution-requirement.json, execution-requirement-unmet.json) and review_decision is REVIEW_REQUIRED, not APPROVED — hard approval gate requires human/CODEOWNERS review before merge.
  • New normative protocol surface (Product.execution_requirements concept and execution-requirement-unmet error detail) requires human ratification per the constitution's decision-class hard gate.
  • This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/core/canonical-product.json (modified) matches static/schemas/source/**; static/schemas/source/core/product-execution-requirement.json (added) matches static/schemas/source/**; static/schemas/source/core/product.json (modified) matches static/schemas/source/**; static/schemas/source/error-details/execution-requirement-unmet.json (added) matches static/schemas/source/**; static/schemas/source/index.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/product-fields.json (modified) matches static/schemas/source/**) and the current GitHub review decision is 'REVIEW_REQUIRED', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

@ohalushchak-exadel

Copy link
Copy Markdown
Contributor

Thanks for splitting this out. From the implementer side, the static declaration maps cleanly onto a per-product requirements table we already keep, and the event-source binding works as specified. Two points, plus one question:

1. Several connected identities and the "documented default" rule. For publisher identity, the PR says that "with several eligible connected identities, the seller applies its documented default". Combined with "complete when present", a seller that declares the identity requirement can't reject a package because the buyer didn't say which identity to use. For social platforms, a single ad account often has several Pages or profiles (brands, markets), and running ads as the wrong one is a visible brand error, not a detail a default can safely settle. Until the 3.3 buyer-choice work lands, could a seller that has no configured default for the account reject with a correctable error (for example AUTHORIZATION_REQUIRED or VALIDATION_ERROR with a reason such as selection_required) instead of picking one? Otherwise the safe move for such sellers is to leave execution_requirements undeclared, which loses the benefit.

2. App promotion binding. The PR binds app promotion through catalogs[] of type app. On some platforms the app is also the event source for optimisation: the app's install and in-app events are what the goal optimises on. So a seller would naturally satisfy it through optimization_goals[].event_sources[] instead. Could the spec either allow an app-promotion product to declare the requirement as event_source, or say explicitly that an app catalog item also satisfies the event-source binding, so both implementation styles conform without duplicate inputs?

Question: platform-side subsets of a catalog. Catalogue-sales products often target a subset the advertiser already defined on the platform (a product set) rather than a whole catalog. catalog supports ids, tags, category and query filters, but there's no way to reference an existing platform-side subset by its ID. Is the intent to express those subsets as filters, or should catalog get a reference field in 3.3 alongside the other bindings?

@bokelley

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed read — these are the right questions to push on before this lands.

1. Multi-identity and the "documented default"

The concern is accurate: a seller with no configured default for a specific ad account is stuck, and the safe exit today is to leave execution_requirements undeclared — which loses the feature's value for that product. The spec reached for "documented default" as the minimum viable bridge, but it assumes the seller has a default to apply, and that assumption doesn't always hold.

That said, I'd lean against patching it in 3.2 with a free-form VALIDATION_ERROR / selection_required. The 3.3 per-account readiness work already has selection_required as an explicit named state (it's in the deferred list). Introducing it now as an untyped reason string would pre-empt that design with a shape 3.3 will need to supersede, and since this surface is experimental, the cost is paid twice. The cleaner path is to fast-track the 3.3 selection_required readiness entry for publisher_identity connections, at least as a minimal addition — sellers who can't use a documented default can then return a correctable, spec-typed response rather than staying silent on the requirement.

Worth flagging to @bokelley: should the 3.3 selection_required scope expand to cover this pattern, or is there a simpler per-account readiness signal we can ship earlier?

2. App catalog ↔ event_source cross-satisfaction

These bindings are intentionally separate: catalog: ["app"] declares which app is being promoted; event_source declares which optimization events are required. On some platforms they reference the same app entity, but the satisfaction paths diverge — a catalog entry binds through packages[].catalogs[], an event source binds through optimization_goals[].event_sources[]. A product that requires both declares both kinds, and the buyer provides both inputs. Adding a cross-satisfaction rule ("app catalog also satisfies event_source") would merge two distinct concepts and make the binding model harder to reason about for both sellers and code generators.

The practical concern — buyers having to name the app twice — is real, and it's a case where 3.3's account-readiness candidates map could help (the seller could pre-validate that the app's event sources are connected without the buyer supplying them explicitly). That feels like the right fix rather than blurring the binding semantics here.

Question: platform-side catalog subsets

The 3.2 intent is filters (ids, tags, category, query). A dedicated reference field for platform-side product sets (a "use this product set I already defined on the platform" handle) is deferred — it would sit alongside lead_form and messaging_destination in the 3.3 account-scoped bindings. For now, buyers express targeting subsets as filters on the catalog they provide, which covers most common cases even if it can't reference pre-built platform sets by ID.


Generated by Claude Code

@ohalushchak-exadel

Copy link
Copy Markdown
Contributor

Thanks, that reasoning works for me on all three.

On point 1, one data point for scoping the 3.3 work: on the social platforms we integrate with, essentially every product runs as a Page or profile, so a publisher-identity connection is required on every package. With "complete when present" plus "apply the documented default", a seller without a per-account default can't declare execution_requirements for any of those products in 3.2, not just the identity-specific ones. So I'd support fast-tracking the selection_required readiness entry for publisher_identity connections, even as a minimal first slice ahead of the full per-account readiness map. That's the piece that makes the field usable for social sellers.

@bokelley
bokelley merged commit 2b80738 into main Sep 30, 2026
64 checks passed
@bokelley
bokelley deleted the feat/product-execution-requirements branch September 30, 2026 07:51
bokelley added a commit that referenced this pull request Sep 30, 2026
… and cost targets

Keep the GA wording over main's rc.53 pin bumps in the docs pages, and keep
main's exact rc.53 pins in Addie certification text until @adcp/sdk 14.0.0
publishes. Add #7774 (experimental execution requirements) and #7778
(outcome_target cost_per) to the 3.2.1 release notes and what's new.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
bokelley added a commit that referenced this pull request Sep 30, 2026
GA wording for release notes, what's new, migration guide, versions,
versioning, roadmap, intro, FAQ and long-tail pages; 3-2-beta becomes
"AdCP 3.2 prerelease history"; docs.json banner; RELEASING.md and playbook
release topology; GA homepage strip (new dismissal cookie); Addie knowledge
snapshot and GA curriculum wording migration (613); CODE_VERSION bump; patch
changeset. The docs.json default-version flip is left to release-docs.yml
at the v3.2.1 tag.

Release notes also cover the GA-day fixes: governance storyboards (#7788,
#7803), brand-rights interim fix (#7792), strict sf-binary under the 3.2
signing profile (adcp-client#3073), execution requirements (#7774), cost
targets (#7778, #7799).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
bokelley added a commit that referenced this pull request Sep 30, 2026
GA wording for release notes, what's new, migration guide, versions,
versioning, roadmap, intro, FAQ and long-tail pages; 3-2-beta becomes
"AdCP 3.2 prerelease history"; docs.json banner; RELEASING.md and playbook
release topology; GA homepage strip (new dismissal cookie); Addie knowledge
snapshot and GA curriculum wording migration (613); CODE_VERSION bump; patch
changeset. The docs.json default-version flip is left to release-docs.yml
at the v3.2.1 tag.

Release notes also cover the GA-day fixes: governance storyboards (#7788,
#7803), brand-rights interim fix (#7792), strict sf-binary under the 3.2
signing profile (adcp-client#3073), execution requirements (#7774), cost
targets (#7778, #7799).

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ladon/needs-human-review Ladon has escalated this PR for human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants