Skip to content

feat(reporting): settle period arithmetic and cutover edge cases from the coverage vectors - #8622

Merged
bokelley merged 1 commit into
mainfrom
bokelley/beta3-period-arithmetic-edge-cases
Oct 31, 2026
Merged

bokelley merged 1 commit into
mainfrom
bokelley/beta3-period-arithmetic-edge-cases

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

AdCP 3.3.0-beta.3: period arithmetic and cutover edge cases that came up while building the canonical coverage vectors and the independent reference model (#8616). Each ruling is stated normatively, and the vectors and reference model in static/compliance/source/test-vectors/reporting-subscriptions/ and scripts/reference/reporting-coverage/ now pin it.

# Question Ruling Vectors
1 Midnight-gap zones (Havana, Santiago, Cairo): PT24H vs P1D, and does PT2H nest? Changed. Under a local alignment, each local date's day start (its first instant: local midnight, or the first instant after a gap at midnight) is always a boundary. Days nest in every sub-daily schedule, and PT24H equals P1D, with no 47-hour period. P1D already landed there by "advance by the gap". New: havana-pt24h-equals-p1d-when-midnight-does-not-exist, havana-pt2h-nests-in-the-day. Properties: PT24H = P1D in every zone; day starts nest in every sub-daily schedule.
2 Lord Howe's 30-minute DST gives 90-minute "hourly" periods Confirmed. It is literal wall-clock reading, consistent with "a wall time that does not exist yields no boundary". Now stated in the text. Existing lord-howe-* cases unchanged.
3 Two cutovers inside one period: E undefined Normative carry-forward. E is never earlier than the outgoing side's own start, so when T comes before the outgoing side owed anything, the incoming side carries that start forward. This is what both SDKs and the model already do. two-cutovers-inside-one-period unchanged.
4 Reactivation after a change made while inactive can overlap the last owed period Defined. Coverage resumes at the first boundary at or after the later of the reactivation instant and the end of the last period owed before deactivation, computed like a cutover's E. A reactivation before that end is a cutover at it. New: reactivation-after-a-schedule-change-never-owes-twice (UTC day to Tokyo day, reactivated mid-day). The model implements it.
6 UTC aliases Kept narrow: exactly UTC and Etc/UTC. Other tzdata links (Etc/GMT, GMT, Etc/Universal, Zulu) don't match. a-utc-offering-matches-only-utc-or-etc-utc unchanged.
8a Sub-daily billing_cycle ignores the anchor Made invalid. billing_cycle requires a date component, enforced by the schema in reporting-schedule.json and reporting-schedule-offering.json. New: sub-daily-billing-cycle-is-refused (wire_valid: false).
8b utc P7D weeks start on Thursday Kept, stated explicitly, for utc, account_timezone and source_timezone. Another week start uses billing_cycle with a period_anchor on that day. No new field. p7d-* cases unchanged.
8c status_retention_days Exact 24-hour days (86,400 s), not civil days, wherever it bounds a window. The model already uses exact days.

Items 5 and 7 went to the PRs that own those rules:

Owner decisions

  • Item 1 changes behavior that sellers and SDKs may already implement: sub-daily boundaries in midnight-gap zones. Both SDKs need the day-start rule.
  • Item 8a newly rejects sub-daily billing_cycle schedules (experimental surface).

Test plan

  • npm run build:schemas && npm run build:compliance (no symbol-link changes)
  • test:schemas (which includes the coverage vectors, the reference model and the property tests), test:json-schema, test:compliance-snippets, test:owned-links, the MCP projection and analysis tests, and the bounds tests
  • test:docs-nav live-source checks pass. The snapshot checks need dist/docs, which the sparse worktree omits.

🤖 Generated with Claude Code

@bokelley
bokelley marked this pull request as ready for review October 31, 2026 00:24
@bokelley
bokelley force-pushed the bokelley/beta3-period-arithmetic-edge-cases branch from c7c4b7a to 5941e6e Compare October 31, 2026 00:26

@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 four files under static/schemas/source/**, which are under a hard, deterministic approval gate (gated_paths: true). review_decision is REVIEW_REQUIRED, not APPROVED, so the gate is not satisfied and the PR cannot auto-approve (decision table row 2).

The reviewer found no blocking or medium findings — the experimental reporting-subscription period-arithmetic changes are coherent across schema, docs, reference model, and vectors; schema↔docs coherence verified; changeset present and correctly minor for an experimental Normative tightening; no dist/** touched; no oneOf regression. On the merits this is a clean diff. But the gated-path rule stands until a human/CODEOWNERS approval lands.

Escalation reasons

  • Modifies gated schema files (reporting-delivery-capabilities.json, reporting-schedule-offering.json, reporting-schedule.json, reporting-subscription.json) under static/schemas/source/**; review_decision is REVIEW_REQUIRED. Human/CODEOWNERS approval required before merge.

Non-blocking follow-up noted by reviewer (pre-existing): a mixed date+time billing_cycle duration (P1DT12H) stays schema-valid though the reference model rejects it — worth closing in a later pass.

Why human review

  • Modifies gated schema files under static/schemas/source/** (reporting-delivery-capabilities.json, reporting-schedule-offering.json, reporting-schedule.json, reporting-subscription.json); 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/reporting-delivery-capabilities.json (modified) matches static/schemas/source/**; static/schemas/source/core/reporting-schedule-offering.json (modified) matches static/schemas/source/**; static/schemas/source/core/reporting-schedule.json (modified) matches static/schemas/source/**; static/schemas/source/core/reporting-subscription.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 Oct 31, 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 schema paths require human/CODEOWNERS approval.

The reviewer found no blocking, Medium, or load-bearing Low findings: schema↔docs coherence holds (period_generation, period_timezone UTC-alias, coverage/cutover, status_retention_days all match sync_principal.mdx and get_reporting_status.mdx), the billing_cycle sub-daily rejection regex is sound, the reference-model (calendar.cjs/coverage.cjs) edits and new test vectors are internally consistent, no new undiscriminated oneOf, no dist/ edits, and a correctly-scoped minor changeset is present (optional→invalid tightening downgrades Breaking→Normative on x-status:experimental).

However, this PR modifies four files under static/schemas/source/**, which is a deterministic hard approval gate (gated_paths: true), and review_decision is REVIEW_REQUIRED — not APPROVED. Per decision rule row 2, a clean diff cannot auto-approve while the gate is unsatisfied.

Escalation reasons

  • static/schemas/source/core/reporting-delivery-capabilities.json, reporting-schedule-offering.json, reporting-schedule.json, reporting-subscription.json are under the static/schemas/source/** hard approval gate; human/CODEOWNERS review is required (review_decision = REVIEW_REQUIRED).

Why human review

  • Modifies gated schema files under static/schemas/source/** (reporting-delivery-capabilities.json, reporting-schedule-offering.json, reporting-schedule.json, reporting-subscription.json); review_decision is REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS approval required.
  • This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/core/reporting-delivery-capabilities.json (modified) matches static/schemas/source/**; static/schemas/source/core/reporting-schedule-offering.json (modified) matches static/schemas/source/**; static/schemas/source/core/reporting-schedule.json (modified) matches static/schemas/source/**; static/schemas/source/core/reporting-subscription.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.

… the coverage vectors

Rulings on ambiguities the canonical coverage vectors surfaced (#8616): the
local day start is always a boundary (PT24H equals P1D and days nest in
sub-daily schedules where midnight does not exist); Lord Howe's 90-minute
hour stands; E never precedes the outgoing side's own start; reactivation
resumes after the last period owed before deactivation; UTC aliases are
exactly UTC and Etc/UTC; billing_cycle needs a date component; P7D weeks
start on Thursday; status_retention_days counts 24-hour days. The reference
model and vectors pin each.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@bokelley
bokelley force-pushed the bokelley/beta3-period-arithmetic-edge-cases branch from 5941e6e to ddc1b9d Compare October 31, 2026 01:38

@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 files require human/CODEOWNERS approval.

This PR modifies four files under static/schemas/source/** (reporting-delivery-capabilities.json, reporting-schedule-offering.json, reporting-schedule.json, reporting-subscription.json), which are under a hard, deterministic approval gate. gated_paths is true and review_decision is REVIEW_REQUIRED (not APPROVED), so decision-table row 2 fires: Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

The reviewer reported a clean pass with no Critical/High/Medium findings: schema↔docs coherence holds, the changeset is present and correctly scoped (minor, experimental wire-tightening on 3.3.0-beta.3), the new not regex correctly rejects sub-daily billing_cycle with a matching vector, the reactivation branch in coverage.cjs traces correctly, no released dist/** artifact is touched, and no new undiscriminated oneOf is introduced.

Escalation reasons

  • Modifies gated schema files under static/schemas/source/core/** and review_decision is REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS approval required (row 2, hard gate).

Note: prior decision was escalate for the same reason; the gate remains unsatisfied (review still not APPROVED). The escalation persists on the deterministic path-based gate, not on new findings (none exist).

Why human review

  • Modifies gated schema files under static/schemas/source/core/** (reporting-delivery-capabilities.json, reporting-schedule-offering.json, reporting-schedule.json, reporting-subscription.json); review_decision is REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS approval required.
  • This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/core/reporting-delivery-capabilities.json (modified) matches static/schemas/source/**; static/schemas/source/core/reporting-schedule-offering.json (modified) matches static/schemas/source/**; static/schemas/source/core/reporting-schedule.json (modified) matches static/schemas/source/**; static/schemas/source/core/reporting-subscription.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.

Copy link
Copy Markdown
Contributor Author

Ladon's non-blocking note, that a mixed date-and-time billing_cycle duration (P1DT12H) is still schema-valid: this predates the PR. The period_generation text already forbids mixing date and time under account_timezone, source_timezone, and billing_cycle, and the reference model refuses it (local-duration-cannot-mix-date-and-time). Enforcing it in the schema would cover all three local alignments, not just billing, so I'm leaving it for a separate tightening rather than widening this PR. Owner approval for the gated schema paths was given for the beta.3 set, so this is being merged by admin.

@bokelley
bokelley merged commit 2a28649 into main Oct 31, 2026
86 of 88 checks passed
@bokelley
bokelley deleted the bokelley/beta3-period-arithmetic-edge-cases branch October 31, 2026 02:22
mikemeier pushed a commit to gotom-io/adcp-client that referenced this pull request Nov 10, 2026
A sub-daily billing_cycle was routed to the local sub-daily calendar,
which aligns to local midnight and ignores period_anchor, so every
boundary was off by the anchor's time of day. adcontextprotocol/adcp#8622
makes a sub-daily billing_cycle invalid; refuse it.

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.

1 participant