Repository navigation
feat(reporting): owe the period in which a buy is confirmed - #8593
Conversation
The subscription start bound is the later of accepted_at and authorized_at; a buy is owed every period that ends after its confirmed_at and overlaps its flight. Before, confirmed_at also moved the start to the next boundary, so an ASAP buy owed nothing for its first day and a buy confirmed Nov 12 owed nothing for November on a monthly billing feed, disagreeing with the account-level ledger. An empty flight (stop at or before start) owes nothing. 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 path requires human/CODEOWNERS review.
This PR modifies four protocol-source schemas under static/schemas/source/**, which is a deterministic hard approval gate (gated_paths: true). The current review_decision is REVIEW_REQUIRED, not APPROVED, so the gate is not satisfied and the PR cannot be auto-approved (decision table row 2).
Escalation reasons
- Modifies gated schema files requiring human/CODEOWNERS approval:
static/schemas/source/core/reporting-subscription-coverage.jsonstatic/schemas/source/core/reporting-subscription-state.jsonstatic/schemas/source/core/reporting-subscription.jsonstatic/schemas/source/media-buy/get-reporting-status-response.json
The reviewer reported a clean, coherent change: the coverage-start rule now owes a buy from the period ending after confirmed_at (mid-period confirmation owes the full period), with verified schema↔docs coherence across all four schemas and five docs pages, untouched dist/3.3.0-beta.1 artifacts, and a correct minor changeset on an x-status:experimental surface. No MUST FIX, no blocking, no medium findings. This is an experimental-surface refinement, but the semantic coverage-rule change plus the deterministic gate warrant a human sign-off before merge.
No critical/high/medium findings — the escalation is driven solely by the unsatisfied gated-path approval requirement, not by code defects.
Why human review
- Gated path: static/schemas/source/core/reporting-subscription-coverage.json modified — human/CODEOWNERS review required (review_decision is REVIEW_REQUIRED, not APPROVED)
- Gated path: static/schemas/source/core/reporting-subscription-state.json modified — human/CODEOWNERS review required
- Gated path: static/schemas/source/core/reporting-subscription.json modified — human/CODEOWNERS review required
- Gated path: static/schemas/source/media-buy/get-reporting-status-response.json modified — human/CODEOWNERS review required
- This PR touches a path under a hard, non-overridable approval gate (static/schemas/source/core/reporting-subscription-coverage.json (modified) matches
static/schemas/source/**; static/schemas/source/core/reporting-subscription-state.json (modified) matchesstatic/schemas/source/**; static/schemas/source/core/reporting-subscription.json (modified) matchesstatic/schemas/source/**; static/schemas/source/media-buy/get-reporting-status-response.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.
Owner decision on the protocol expert's P0 #1, for 3.3.0-beta.2.
Change. The subscription start bound is the first boundary at or after the later of the version's
accepted_atand the account'sauthorized_at. A buy is then owed every period that ends after itsconfirmed_atand overlaps its flight, so a mid-period confirmation owes that period in full.Why.
confirmed_atused to move the start to the next boundary:core/reporting-obligation.jsonscope_resolution).Also: a flight whose stop time is at or before its
start_time(a buy canceled before it starts) overlaps no period and owes nothing. Both SDKs had that bug, found in expert review.Updated:
reporting-subscription.jsoncoverage;get-reporting-status-responsenote;sync_principal,get_principal,get_reporting_status, and the reporting implementation guide;tests/reporting-subscriptions.test.cjs, plus an empty-flight case.The SDK stacks (adcp-client #3505/#3508/#3509, adcp-client-python #1696/#1698/#1699) keep this rule in one function and will adopt it.
🤖 Generated with Claude Code
Open workspace in Conductor