Skip to content

feat(reporting): prior_versions carry configuration; sub-daily local periods restart at local midnight - #8588

Merged
bokelley merged 1 commit into
mainfrom
bokelley/beta2-prior-versions-and-notes
Oct 29, 2026
Merged

bokelley merged 1 commit into
mainfrom
bokelley/beta2-prior-versions-and-notes

Conversation

@bokelley

@bokelley bokelley commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Last protocol fixes planned for 3.3.0-beta.2.

  • prior_versions[].configuration. Each prior version on the subscription readback now carries the configuration it had: scope, selector, destination, reconciliation_mode. Sellers MUST include it. Before, after losing local state a buyer knew when a prior version was accepted and superseded, but not what it covered, so it couldn't recompute that version's owed periods. Raised by the Python SDK implementation.

  • Sub-daily local periods were anchored to 1970 offsets (found in the protocol expert review). period_generation added elapsed hours to local midnight on 1970-01-01, so:

    • account_timezone PT1H periods in Asia/Singapore ran 07:30–08:30 local, because its 1970 offset was +07:30;
    • Asia/Kathmandu hours started at :15;
    • America/New_York PT6H boundaries drifted an hour with DST.

    Under a local alignment (account_timezone, source_timezone, billing_cycle), a sub-daily duration now MUST divide 24h. Its boundaries are local wall-clock multiples counted afresh from each local midnight: a 23-hour DST day has 23 hourly periods and a 25-hour day 25. A nonexistent wall time yields no boundary, and a repeated one yields one boundary per offset. Durations under a local alignment can't mix date and time components. utc alignment is unchanged. The training agent's hourly scheduler already floors to the hour, so it agrees for whole-hour zones.

  • What's new in 3.3 gains beta.2 notes for the account change outcomes (feat(accounts): change outcomes, visible sync_accounts reviews, countries semantics (beta.1 feedback) #8580, feat(accounts): opt-in separate account on a change; ACCOUNT_CHANGE_REQUIRES_NEW_ACCOUNT #8582) and the reporting-subscription clarifications (feat(reporting): settle reporting-subscription ambiguities found by the SDK implementations #8585).

Tests: tests/reporting-subscriptions.test.cjs adds two tests. test:schemas, test:json-schema, test:compliance-snippets, the MCP projection and capabilities bounds tests, test:docs-nav, and test:owned-links pass locally.

🤖 Generated with Claude Code


Open workspace in Conductor

…periods restart at local midnight

- Each prior_versions entry on the subscription readback carries the
  configuration that version had (sellers MUST include it), so a buyer that
  lost local state can recompute it.
- Fix sub-daily local periods: anchored to 1970 local midnight plus elapsed
  hours, they started at 07:30 in Asia/Singapore and drifted with DST. They
  now restart at each local midnight on wall-clock multiples; the duration
  must divide 24h.
- What's new in 3.3: beta.2 notes for account change outcomes and the
  reporting-subscription clarifications.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
"superseded_at": { "type": "string", "format": "date-time", "description": "The next version's accepted_at, the cutover instant: this version owes its periods that start before it, in full." },
"configuration": {
"$ref": "/schemas/core/reporting-subscription.json",
"description": "The configuration this version had: its scope, selector, destination, and reconciliation_mode. Sellers MUST include it, so a buyer that lost local state can recompute this version's owed periods."

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.

Medium: The description says "Sellers MUST include it," but configuration is not added to the prior_versions.items.required array (still ["subscription_version", "accepted_at", "superseded_at"]). The MUST is unenforced: a seller that omits it emits a schema-valid readback that defeats this field's stated purpose — recomputing a prior version's owed periods after local-state loss. Note the file's own top-level configuration (L122) is in required; the nested entry is the inconsistent sibling. Add configuration to the items' required list.

@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 published protocol schema source files under static/schemas/source/**, which are under a deterministic hard approval gate (gated_paths: true). The current review_decision is REVIEW_REQUIRED, not APPROVED, so the gate is not satisfied. Per decision rule row 2, the outcome must be escalate.

No blocking (critical/high) findings were identified. The reviewer confirms schema↔docs coherence (prior_versions[].configuration $refs reporting-subscription.json with all expected fields present), a correct changeset (both changes Normative-on-experimental-surface), no oneOf/immutability/patch-eligibility issues, and tests added for both changes.

One non-blocking Medium remains for human attention:

  • static/schemas/source/core/reporting-subscription-state.json:39 — prior_versions[].configuration carries "Sellers MUST include it" but is not listed in the items' required[], unlike the file's own top-level configuration. The MUST is unenforced by the schema.

Escalation reasons:

  • Modifies gated schema source files (static/schemas/source/core/reporting-schedule.json, static/schemas/source/core/reporting-subscription-state.json) under static/schemas/source/** — human/CODEOWNERS approval required; review_decision is REVIEW_REQUIRED.

Medium findings

  • static/schemas/source/core/reporting-subscription-state.json:39 — prior_versions[].configuration MUST is unenforced by required[]

Why human review

  • Modifies gated schema source files static/schemas/source/core/reporting-schedule.json and static/schemas/source/core/reporting-subscription-state.json under static/schemas/source/** — requires human/CODEOWNERS approval (review_decision is REVIEW_REQUIRED, not APPROVED)
  • Non-blocking Medium: reporting-subscription-state.json:39 prior_versions[].configuration MUST is unenforced by required[] — worth a human eye alongside the gate review
  • This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/core/reporting-schedule.json (modified) matches static/schemas/source/**; static/schemas/source/core/reporting-subscription-state.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 29, 2026
@bokelley
bokelley merged commit 1afc1da into main Oct 29, 2026
66 checks passed
@bokelley
bokelley deleted the bokelley/beta2-prior-versions-and-notes branch October 29, 2026 19:01
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