Repository navigation
feat(reporting): prior_versions carry configuration; sub-daily local periods restart at local midnight - #8588
Conversation
…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." |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) understatic/schemas/source/**— human/CODEOWNERS approval required;review_decisionisREVIEW_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) 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.
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_generationadded elapsed hours to local midnight on 1970-01-01, so:account_timezonePT1H periods in Asia/Singapore ran 07:30–08:30 local, because its 1970 offset was +07:30;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.utcalignment 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.cjsadds two tests.test:schemas,test:json-schema,test:compliance-snippets, the MCP projection and capabilities bounds tests,test:docs-nav, andtest:owned-linkspass locally.🤖 Generated with Claude Code
Open workspace in Conductor