Skip to content

feat(schema): add viewable_rate optimization goal with viewability standard and vendor - #7697

Merged
bokelley merged 2 commits into
mainfrom
prague-v15
Sep 27, 2026
Merged

bokelley merged 2 commits into
mainfrom
prague-v15

Conversation

@bokelley

@bokelley bokelley commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Closes #7696.

Why

The optimization docs already describe viewability as a standard metric goal. optimization-reporting.mdx uses viewable_rate as its example of the standard metric flow, going through metric_optimization.supported_metrics and optimization_goals[] (kind: metric). Neither goal schema accepted it. The conversion-tracking docs pointed buyers at metric: "views" + threshold_rate: 0.70 for viewability, with no way to say whether that meant MRC or GroupM. This PR fills the gap in the schema; the docs already described the behavior.

What

Goal schemas (optimization-goal.json and canonical-optimization-goal.json, kind: "metric"):

  • Adds viewable_rate to the metric enum.
  • standard (enums/viewability-standard.json): required when metric is viewable_rate.
  • vendor: optional. Canonical uses brand-key.json to match the canonical vendor_metric branch; legacy uses brand-ref.json.
  • threshold_rate.value has maximum: 1 for viewable_rate.
  • standard and vendor are declared in the static properties map, so the canonical branch's additionalProperties: false accepts them. if/then is used only for the conditional required and the maximum.

Capabilities:

  • viewable_rate added to product.metric_optimization.supported_metrics and to get_adcp_capabilities supported_optimization_metrics.
  • New optional metric_optimization.supported_viewability_standards, following the supported_reach_units / supported_view_durations pattern.

Coexistence with performance_standards: normative text in the conversion-tracking docs. When a package has both a viewability goal and a viewability performance standard for the same standard, buyers SHOULD NOT set the goal below the standard. A lower goal never relaxes the standard; sellers MUST keep evaluating the standard at its own threshold. This replaces the triage memo's buyer-side MUST plus conformance storyboard, because a goal set below the standard is redundant, not harmful. It avoids adding a new rejection path during the RC.

Docs: metric goal field table, metric table, strategy table, prerequisites, product capabilities, and the migration guide. The "Target viewability" recipe now uses viewable_rate instead of views.

Budget bumps

The new fields are inlined everywhere the goal schema is referenced, so they push three measured limits:

  • Media-buy model-context budget: 440 → 442 KiB. The new size is 450,732 bytes; control_media_buy and buy_products grow about 1.3 KiB each.
  • PARITY_COMPILE_LIMIT: 1,250,000 → 1,260,000. comply_test_controller was already at 1,249,930, and this adds about 1.8 KB.
  • Schema-analysis definition_instances: 671 → 672 (one more reference to the viewability standard enum).

Follow-ups (not in this PR)

Testing

  • New tests/viewable-rate-optimization-goal.test.cjs checks both schemas: a valid goal is accepted, a missing or invalid standard is rejected, a value above 1 is rejected, and thresholds on other metrics stay unbounded. It also checks the capability enums. The file is registered in test:schemas.
  • Full npm test passes locally.
  • Pushed with --no-verify: the local pre-push storyboard matrix fails before running any storyboards, because the local compliance cache is 3.2.0-rc.6 and the training agent advertises only up to 3.2-rc.3. This PR touches neither. The CI storyboard workflow is the real check.

🤖 Generated with Claude Code


Open workspace in Conductor

…andard and vendor

The optimization docs already listed viewable_rate as a standard metric
optimization goal, but neither goal schema accepted it. Add viewable_rate
to the kind: "metric" branch of both optimization-goal.json and
canonical-optimization-goal.json, with a required viewability standard, an
optional measurement vendor, and threshold_rate.value bounded to 1.
Products and seller capabilities can advertise viewable_rate, and products
can declare supported_viewability_standards.

Closes #7696

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 review.

This PR modifies published protocol source under static/schemas/source/**, which is under a hard, deterministic approval gate (gated_paths: true). The required review status is REVIEW_REQUIRED, not APPROVED, so the gate is not satisfied and the PR cannot be auto-approved (decision table row 2).

The change itself is clean and additive: it adds viewable_rate as a kind: "metric" optimization goal, closing an omission where the delivery side already carried the viewability.viewable_rate leaf but neither goal schema accepted it. The reviewer verified schema↔docs coherence, the if/then conditional (requires standard, bounds threshold ≤1), a correct minor changeset for a non-breaking change, no new undiscriminated oneOf, and adequate test coverage wired into test:schemas. No blocking findings; one Low non-blocking note about cost_per capping (never bites — metric is new, cost_per deprecated).

Gated files needing human/CODEOWNERS review:

  • static/schemas/source/core/canonical-optimization-goal.json
  • static/schemas/source/core/optimization-goal.json
  • static/schemas/source/core/product.json
  • static/schemas/source/protocol/get-adcp-capabilities-response.json

Once review_decision becomes APPROVED, this falls through to a normal approve.

Why human review

  • Gated paths touched (static/schemas/source/**: canonical-optimization-goal.json, optimization-goal.json, product.json, get-adcp-capabilities-response.json) and review_decision is REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS approval required before merge.
  • This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/core/canonical-optimization-goal.json (modified) matches static/schemas/source/**; static/schemas/source/core/optimization-goal.json (modified) matches static/schemas/source/**; static/schemas/source/core/product.json (modified) matches static/schemas/source/**; static/schemas/source/protocol/get-adcp-capabilities-response.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 27, 2026
adcp-client-python now pins audited signed releases and refuses to sync a
pinned version from anywhere but the official signed artifact. The PR
bundle reuses the package version (3.2.0-rc.6, which is pinned) but is an
unpublished candidate, so the Generate Python SDK job failed on every
schema PR with "ADCP_SKIP_SIGNATURE is forbidden for an audited signed
release". The job already verifies the bundle's provenance and checksum,
so remove only the candidate version's pin from the disposable SDK
checkout.

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 paths touched and review not yet approved.

This PR adds a new viewable-rate optimization goal, modifying protocol schema source under static/schemas/source/** (canonical-optimization-goal.json, optimization-goal.json, product.json, get-adcp-capabilities-response.json) and a workflow under .github/workflows/**. These paths are under a hard, deterministic approval gate (gated_paths: true), and the current GitHub review decision is REVIEW_REQUIRED, not APPROVED. Per decision rule row 2, Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded.

The reviewer found no Critical/High/Medium findings. The delta since the prior escalate pass is a single clean, correctly-guarded 6-line change to validate-schema-bundle.yml (checksum/provenance verified upstream, ADCP_SKIP_SIGNATURE already set, idempotent rm -f, no production surface). The diff is mechanically clean and includes a proper changeset and schema↔docs coherence, but the gate is unsatisfied.

Escalation reasons

  • Gated paths touched (static/schemas/source/**: canonical-optimization-goal.json, optimization-goal.json, product.json, get-adcp-capabilities-response.json; .github/workflows/validate-schema-bundle.yml) and review_decision is REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS approval required before merge.

Why human review

  • Gated paths touched (static/schemas/source/** and .github/workflows/**) and review_decision is REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS approval required before merge (decision rule row 2).
  • This PR touches a path under a hard, non-overridable approval gate (.github/workflows/validate-schema-bundle.yml (modified) matches .github/workflows/**; static/schemas/source/core/canonical-optimization-goal.json (modified) matches static/schemas/source/**; static/schemas/source/core/optimization-goal.json (modified) matches static/schemas/source/**; static/schemas/source/core/product.json (modified) matches static/schemas/source/**; static/schemas/source/protocol/get-adcp-capabilities-response.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.

@bokelley
bokelley merged commit 2785fcb into main Sep 27, 2026
64 checks passed
@bokelley
bokelley deleted the prague-v15 branch September 27, 2026 10:41
bokelley added a commit that referenced this pull request Sep 27, 2026
… scope (#7698)

Follow-up review on #7697:

- The legacy goal shape accepted a cost_per target on viewable_rate,
  which has no meaning, and the maximum: 1 then silently capped a cost.
  The viewable_rate branch now requires target.kind threshold_rate.
- standard and vendor are now allowed on viewed_seconds, whose
  description already said it is governed by the viewability standard,
  and both goal shapes reject them on every other metric.
- The migration guide documents the BrandRef-to-BrandKey vendor mapping
  between legacy and canonical goals.

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.

Optimization goals: add viewable_rate (standard + vendor) as a threshold_rate metric

1 participant