Skip to content

feat(targeting): add daypart timezone semantics - #7187

Merged
bokelley merged 4 commits into
mainfrom
hamburg-v21
Sep 2, 2026
Merged

bokelley merged 4 commits into
mainfrom
hamburg-v21

Conversation

@bokelley

@bokelley bokelley commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add per-entry daypart timezone semantics with an inventory_local default and concrete IANA-zone support
  • make supported timezone modes a binding product-level targeting capability, including future-selection requirements
  • validate IANA identifiers across discovery, create, and update in the training seller, and align normative guidance and broadcast examples

Design decisions

  • keep the additive per-entry shape for AdCP 3.2
  • require buyers to resolve user or account preferences to a concrete IANA zone rather than adding mutable aliases
  • declare execution support per product through overlay_support.daypart_targets.timezone_modes; do not add a seller-wide capability
  • use schema shape checks plus runtime IANA TZDB validation

Validation

  • npm run test:targeting-aware-discovery
  • npm run test:schemas
  • npm run typecheck
  • npm run test:json-schema -- --file docs/media-buy/advanced-topics/targeting.mdx
  • npm run test:json-schema -- --file docs/media-buy/product-discovery/media-products.mdx
  • npm run test:json-schema -- --file docs/media-buy/task-reference/get_products.mdx
  • npx vitest run --config server/vitest.config.ts server/tests/unit/training-agent.test.ts -t "enforces product-scoped daypart timezone support"
  • npm run test:owned-links
  • npm run lint:schema-links
  • npm run test:schema-utf8
  • node scripts/check-changeset-protocol-scope.cjs origin/main
  • npx --yes @changesets/cli@^3.0.0 status --since=origin/main

Closes #7174


Open workspace in Conductor

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

This PR modifies six files under static/schemas/source/**, which are under a hard, deterministic approval gate (gated_paths: true). The current review_decision is REVIEW_REQUIRED, not APPROVED, so per decision rule row 2 the outcome must be escalate.

The change itself looks clean: additive daypart timezone semantics (new optional timezone field: inventory_local | IANA) plus product-scoped daypartSupport/daypartRequirement capability shapes. The reviewer verified schema↔docs coherence across all six schema files and their docs pages, confirmed the Normative (non-breaking) change is correctly carried by a minor changeset, found no new undiscriminated oneOf, no dist mutation, no breaking wire change, and coherent fail-closed server validation and test coverage. No blocking or Medium findings.

Because the diff is additive/Normative (not Breaking) and has no actionable findings, this escalation is driven purely by the unsatisfied approval gate — a human/CODEOWNERS approval on the gated schema files is required before merge.

Escalation reasons:

  • Touches gated schema files (static/schemas/source/core/daypart-target.json, product-allocation.json, targeting-overlay-requirements.json, targeting-overlay-support.json, targeting.json, and static/schemas/source/media-buy/get-products-request.json) while review_decision is REVIEW_REQUIRED — human/CODEOWNERS approval required.

Why human review

  • Gated paths under static/schemas/source/** are modified while review_decision is REVIEW_REQUIRED (not APPROVED); human/CODEOWNERS approval is required before merge.
  • This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/core/daypart-target.json (modified) matches static/schemas/source/**; static/schemas/source/core/product-allocation.json (modified) matches static/schemas/source/**; static/schemas/source/core/targeting-overlay-requirements.json (modified) matches static/schemas/source/**; static/schemas/source/core/targeting-overlay-support.json (modified) matches static/schemas/source/**; static/schemas/source/core/targeting.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/get-products-request.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 2, 2026

@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 under static/schemas/source/** are modified while review_decision is REVIEW_REQUIRED (not APPROVED).

The reviewer's subsequent pass is clean: the schema refactor extracts shared iana-timezone.json and daypart-timezone-mode.json, references them via $ref across daypart-target and targeting-overlay-{requirements,support}, and registers both in index.json. The new not:{const:"inventory_local"} on iana-timezone.json keeps the accepted wire union unchanged; the iana_timezones tightening lands only on unreleased x-added-in:3.2.0 fields; the minor changeset is correct; parity/$ref tests track the change. No critical/high/medium findings.

However, this PR touches multiple files under the hard, non-overridable approval gate (static/schemas/source/**) and the current GitHub review decision is REVIEW_REQUIRED, not APPROVED. Per decision-table row 2, the gate is not satisfied and Ladon cannot auto-approve regardless of how clean the diff is. The prior escalate stands on the same unchanged gate condition.

Escalation reasons:

  • Gated files under static/schemas/source/** are modified and review_decision is REVIEW_REQUIRED — human/CODEOWNERS approval is required before merge.

Why human review

  • Gated paths under static/schemas/source/** are modified (daypart-target.json, iana-timezone.json, product-allocation.json, targeting-overlay-requirements.json, targeting-overlay-support.json, targeting.json, daypart-timezone-mode.json, index.json, get-products-request.json) while review_decision is REVIEW_REQUIRED, not APPROVED. This is a hard, code-enforced approval gate — human/CODEOWNERS approval is required before merge regardless of how clean the diff is.
  • This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/core/daypart-target.json (modified) matches static/schemas/source/**; static/schemas/source/core/iana-timezone.json (added) matches static/schemas/source/**; static/schemas/source/core/product-allocation.json (modified) matches static/schemas/source/**; static/schemas/source/core/targeting-overlay-requirements.json (modified) matches static/schemas/source/**; static/schemas/source/core/targeting-overlay-support.json (modified) matches static/schemas/source/**; static/schemas/source/core/targeting.json (modified) matches static/schemas/source/**; static/schemas/source/enums/daypart-timezone-mode.json (added) matches static/schemas/source/**; static/schemas/source/index.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/get-products-request.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 enabled auto-merge (squash) September 2, 2026 17:41

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

This PR modifies and adds files under static/schemas/source/**, a hard, path-based approval gate (gated_paths: true). The current review_decision is REVIEW_REQUIRED, not APPROVED, so decision-table row 2 fires: the gate is not satisfied and the PR cannot be auto-approved regardless of how clean the diff is.

The reviewer surfaced no critical/high/medium findings. The delta is a single correctness fix in scripts/mcp-schema-projection.cjs (pruneUnusedRootDefinitions now descends into nested $defs reached via $ref, so definitions like #/$defs/Kept/$defs/Local are no longer falsely pruned), covered by the updated test at tests/mcp-schema-projection.test.cjs:264. Clean pass with no new findings — the prior escalation persists solely because the gate is still unsatisfied, not because of any actionable defect.

This also introduces new protocol wire surface (daypart timezone semantics: new iana-timezone.json, daypart-timezone-mode.json enum, and modifications to targeting/product schemas). Such schema changes warrant human/CODEOWNERS review for wire-shape fidelity, schema↔docs coherence, and breaking-class classification before merge.

Blocking findings: none.

Escalation reasons:

  • Files under static/schemas/source/** (daypart-target.json, iana-timezone.json [added], product-allocation.json, targeting-overlay-requirements.json, targeting-overlay-support.json, targeting.json, daypart-timezone-mode.json [added], index.json, get-products-request.json) are under a hard approval gate and review_decision is REVIEW_REQUIRED, not APPROVED. Human/CODEOWNERS approval is required before merge.

Why human review

  • Files under static/schemas/source/** are modified/added (daypart-target.json, iana-timezone.json [added], product-allocation.json, targeting-overlay-requirements.json, targeting-overlay-support.json, targeting.json, daypart-timezone-mode.json [added], index.json, get-products-request.json) while review_decision is REVIEW_REQUIRED, not APPROVED — hard path-based approval gate requires human/CODEOWNERS approval before merge.
  • This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/core/daypart-target.json (modified) matches static/schemas/source/**; static/schemas/source/core/iana-timezone.json (added) matches static/schemas/source/**; static/schemas/source/core/product-allocation.json (modified) matches static/schemas/source/**; static/schemas/source/core/targeting-overlay-requirements.json (modified) matches static/schemas/source/**; static/schemas/source/core/targeting-overlay-support.json (modified) matches static/schemas/source/**; static/schemas/source/core/targeting.json (modified) matches static/schemas/source/**; static/schemas/source/enums/daypart-timezone-mode.json (added) matches static/schemas/source/**; static/schemas/source/index.json (modified) matches static/schemas/source/**; static/schemas/source/media-buy/get-products-request.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.

@garvitkaushik-123

Copy link
Copy Markdown
Collaborator

Correction to the minor notes above: the daypart_targets: [] bullet is wrong. targeting.json and product-allocation.json already carry minItems: 1 on main, so the schema rejects the empty array and the handler is consistent with it. Disregard that point. The two blockers and the other two minor notes stand.

bokelley commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

@garvitkaushik-123 CI is fully green (60/60 checks), including Python and TypeScript SDK generation and all storyboards. Ladon and three independent expert passes found no substantive blockers; this is ready for the required human schema approval when you have a moment. Auto-merge is armed.

@bokelley
bokelley requested a review from patmmccann September 2, 2026 18:37
@bokelley
bokelley merged commit efa8dbc into main Sep 2, 2026
62 of 63 checks passed
@bokelley
bokelley deleted the hamburg-v21 branch September 2, 2026 19:30
@garvitkaushik-123

Copy link
Copy Markdown
Collaborator

Apologies, my first point was wrong and I shouldn't have gated you on it.

I went back and checked main: daypart-target.json had properties days, start_hour, end_hour, label with additionalProperties: false, and targeting.json had no timezone anywhere. So viewer-local was never expressible on the wire, and the 3.1 "daypart definitions MUST declare their timezone semantics" rule was unimplementable as written. This PR is repairing that section, not removing a capability. Retracting blocker 1. At most it's worth one changelog line for anyone who read the 3.1 prose and planned around it.

Blocker 2 I'd downgrade to a correctness note rather than a gate. isValidDaypartTimezone accepts aliases and non-canonical casing (US/Eastern, CET, america/new_york) while iana_timezones.includes() compares exact strings, so the two disagree. My suggested fix was also sloppy: canonicalizing through Intl is ICU-version-dependent (Asia/Kolkata normalizes backwards to Asia/Calcutta on Node 26) and widens equivalence in odd ways (EST resolves to America/Panama). The real ask is just that validation and matching agree, whichever direction you prefer. Reasonable as a follow-up.

One thing I did miss and is worth a look: timezone_modes: ["iana"] without inventory_local is schema-valid, and since omitted timezone defaults to inventory_local, such a product would reject any daypart entry that omits timezone. Probably worth either requiring inventory_local in the enum set or documenting the interaction.

Sorry for the noise. Nothing here blocks merge.

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.

daypart_targets has no timezone semantics (screen-local vs single zone)

2 participants