Skip to content

fix(schema): tighten viewable_rate goal targets and viewability field scope - #7698

Merged
bokelley merged 1 commit into
mainfrom
prague-v15
Sep 27, 2026
Merged

bokelley merged 1 commit into
mainfrom
prague-v15

Conversation

@bokelley

@bokelley bokelley commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #7697, addressing review feedback that came in after merge. Meant to land before 3.2.0-rc.7 is cut.

Changes

  1. The legacy schema rejects cost_per on viewable_rate. The legacy metric branch allows both cost_per and threshold_rate targets. Before this change, { metric: "viewable_rate", target: { kind: "cost_per", value: 0.5 } } validated, even though "cost per viewable rate" means nothing, and maximum: 1 silently capped the cost at one currency unit. The viewable_rate then branch now requires target.kind: "threshold_rate". The canonical schema only ever allowed threshold_rate, so it's unchanged here.
  2. standard/vendor scope is enforced.
    • Both are now allowed, and optional, on viewed_seconds, whose description already said it's governed by the viewability standard. When omitted, the seller's default applies.
    • Both goal schemas reject them on every other metric, through a new if metric in [viewable_rate, viewed_seconds] / else not(standard|vendor) rule.
    • The field has never been in a published release, so this rejects nothing that validated in a shipped RC.
  3. Migration guide: vendor shapes. Legacy goals carry vendor as a BrandRef; canonical goals carry a BrandKey. The same split already existed for vendor_metric goals. The guide now says to keep domain, brand_id, and countries when converting and to drop the other BrandRef fields.

Testing

  • New cases in tests/viewable-rate-optimization-goal.test.cjs:
    • cost_per on viewable_rate is rejected in the legacy schema, while cost_per on clicks still passes;
    • standard/vendor are accepted on viewed_seconds;
    • standard/vendor are rejected on views and clicks in both schemas.
  • Both new negative tests fail against the schema on main and pass with this change.
  • test:schemas, test:mcp-schema-projection (budgets still fit, no ceiling changes), test:oneof-discriminators, test:composed, test:owned-links, test:examples, test:json-schema, and the pre-commit unit suites and typecheck all pass.
  • Pushed with --no-verify for the same local storyboard version mismatch described in feat(schema): add viewable_rate optimization goal with viewability standard and vendor #7697.

🤖 Generated with Claude Code


Open workspace in Conductor

… scope

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]>

@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 without required review approval.

This PR tightens the unreleased viewable_rate optimization goal (legacy schema rejects cost_per targets; both schemas scope standard/vendor to viewable_rate/viewed_seconds only). The reviewer verified schema↔docs coherence, correct patch changeset, sound if/else rules, and confirmed the field is absent from the published dist/3.2.0-rc.6 — so no published wire contract is broken. No blocking, medium, or governance findings.

However, the PR modifies static/schemas/source/core/canonical-optimization-goal.json and static/schemas/source/core/optimization-goal.json, which fall under the static/schemas/source/** hard approval gate (gated_paths: true), and review_decision is REVIEW_REQUIRED — not APPROVED. Per decision-table row 2, this must escalate for human/CODEOWNERS review; it cannot auto-approve while the gate is unsatisfied.

Escalation reasons

  • static/schemas/source/core/canonical-optimization-goal.json and static/schemas/source/core/optimization-goal.json are under the static/schemas/source/** hard approval gate; review_decision is REVIEW_REQUIRED. Human/CODEOWNERS approval required.

The diff is otherwise clean — once a required approval lands, this falls through to a normal approve.

Why human review

  • Modifies static/schemas/source/core/canonical-optimization-goal.json and static/schemas/source/core/optimization-goal.json under the static/schemas/source/** hard approval gate while review_decision is REVIEW_REQUIRED (not APPROVED) — human/CODEOWNERS review required.
  • 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/**) 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
@bokelley
bokelley merged commit e82f055 into main Sep 27, 2026
62 checks passed
@bokelley
bokelley deleted the prague-v15 branch September 27, 2026 13:15
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.

1 participant