Repository navigation
fix(schema): tighten viewable_rate goal targets and viewability field scope - #7698
Conversation
… 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]>
There was a problem hiding this comment.
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.jsonandstatic/schemas/source/core/optimization-goal.jsonare under thestatic/schemas/source/**hard approval gate;review_decisionisREVIEW_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) matchesstatic/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.
Follow-up to #7697, addressing review feedback that came in after merge. Meant to land before 3.2.0-rc.7 is cut.
Changes
cost_peronviewable_rate. The legacymetricbranch allows bothcost_perandthreshold_ratetargets. Before this change,{ metric: "viewable_rate", target: { kind: "cost_per", value: 0.5 } }validated, even though "cost per viewable rate" means nothing, andmaximum: 1silently capped the cost at one currency unit. Theviewable_ratethenbranch now requirestarget.kind: "threshold_rate". The canonical schema only ever allowedthreshold_rate, so it's unchanged here.standard/vendorscope is enforced.viewed_seconds, whose description already said it's governed by the viewability standard. When omitted, the seller's default applies.if metric in [viewable_rate, viewed_seconds] / else not(standard|vendor)rule.vendoras aBrandRef; canonical goals carry aBrandKey. The same split already existed forvendor_metricgoals. The guide now says to keepdomain,brand_id, andcountrieswhen converting and to drop the otherBrandReffields.Testing
tests/viewable-rate-optimization-goal.test.cjs:cost_peronviewable_rateis rejected in the legacy schema, whilecost_peronclicksstill passes;standard/vendorare accepted onviewed_seconds;standard/vendorare rejected onviewsandclicksin both schemas.mainand 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.--no-verifyfor 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