Repository navigation
feat(reporting): deterministic admission and resolution, overrides, paging, in-place membership - #8619
Conversation
17095cc to
02d55ba
Compare
There was a problem hiding this comment.
Ladon verdict: Escalate to human review
Escalate — gated-paths hard approval gate not satisfied.
This PR modifies 11 files under static/schemas/source/**, which are under the repo's deterministic hard approval gate (gated_paths: true). The required review status is REVIEW_REQUIRED, not APPROVED, so per decision table row 2 the outcome must be escalate rather than approve.
The reviewer found no Critical/High/Medium findings: schema↔docs coherence verified across all 11 schema files and 5 doc pages, changeset correctly scoped as minor to static/schemas/source/**, no undiscriminated oneOf regression (destination_overrides uses anyOf+not, a known walker-safe pattern), no dist/** edits, and the x-added-in sweep is correctly updated. The diff itself is clean.
However, a clean diff does not lift the gate — only a human/CODEOWNERS approval (review_decision: APPROVED) does.
Escalation reasons:
- Modifies protocol source-of-truth schema files under
static/schemas/source/**(gated path); human/CODEOWNERS review required becausereview_decisionisREVIEW_REQUIRED, notAPPROVED.
Why human review
- Gated paths: PR modifies 11 files under static/schemas/source/** (hard approval gate) and review_decision is REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS review required before merge.
- 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-delivery-offering.json (modified) matchesstatic/schemas/source/**; static/schemas/source/core/reporting-subscription-coverage.json (modified) matchesstatic/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/**; static/schemas/source/media-buy/sync-reporting-receipts-request.json (modified) matchesstatic/schemas/source/**; static/schemas/source/media-buy/sync-reporting-status-request.json (modified) matchesstatic/schemas/source/**; static/schemas/source/protocol/get-principal-request.json (modified) matchesstatic/schemas/source/**; static/schemas/source/protocol/get-principal-response.json (modified) matchesstatic/schemas/source/**; static/schemas/source/protocol/sync-principal-request.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.
…aging, in-place membership Makes normative what the TS and Python SDKs implement for experimental reporting subscriptions: sticky max_accounts admission ordered by authorized_at then account_id byte order (accounts without buys count), per-package resolution fixed per (buy, version) until withdrawal, and billing subscriptions on match exact with dimensions. For scale it adds destination_overrides, bounded inline readback with counts and a paged get_principal reporting_subscription_page read, and in-place membership edits recorded as excluded_by_buyer intervals. Several pacing or analytics subscriptions may now apply to one account and purpose; billing stays one. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… account_id Coverage depends only on get_reporting_status in allowed_tasks. A grant without sync_reporting_receipts or sync_reporting_status keeps the account covered, and the seller refuses the missing task with SCOPE_INSUFFICIENT rather than as an unknown identifier. A seller advertising subscriptions publishes every managed-delivery offering with a row schema that requires account_id and keys on it, as both SDKs already assume. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… owes its packages' union The reference model now resolves each (buy, version) pair once, at the later of accepted_at and confirmed_at, and re-resolves only when the resolved offering is withdrawn. resolution-change-is-a-cutover becomes a-newly-available-offering-never-re-resolves, and withdrawal-of-the-resolved-offering-is-a-cutover is new. The selection rule says a buy owes every offering any of its packages resolves, so it can owe two even under exact or finest. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
02d55ba to
269c4b9
Compare
There was a problem hiding this comment.
Ladon verdict: Escalate to human review
Escalate — gated schema paths require human/CODEOWNERS approval.
This PR modifies 11 files under static/schemas/source/**, which fall under a hard, non-overridable approval gate (gated_paths: true). The current GitHub review decision is REVIEW_REQUIRED, not APPROVED, so the gate (decision table row 2) is not satisfied and Ladon cannot auto-approve regardless of how clean the diff is.
The reviewer pass was clean: no critical/high/medium findings. The only executable change (stickyResolution in coverage.cjs) was verified against the re-ruled coverage vectors; schema↔docs coherence holds across billing MUST, destination_overrides, sticky admission, partial-grant/SCOPE_INSUFFICIENT, and the inline caps. No undiscriminated oneOf, no dist/** mutation, changeset appropriate for the unreleased experimental surface. No prior blockers to re-surface.
Escalation reasons
- Modifies 11 files under
static/schemas/source/**(hard approval gate) whilereview_decisionisREVIEW_REQUIRED, notAPPROVED— human/CODEOWNERS review required before merge.
Once a human/CODEOWNERS approval is recorded, this clean diff can fall through to approve on a subsequent run.
Why human review
- Modifies 11 files under static/schemas/source/** (hard approval gate) and review_decision is REVIEW_REQUIRED, not APPROVED — human/CODEOWNERS review required before merge.
- 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-delivery-offering.json (modified) matchesstatic/schemas/source/**; static/schemas/source/core/reporting-subscription-coverage.json (modified) matchesstatic/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/**; static/schemas/source/media-buy/sync-reporting-receipts-request.json (modified) matchesstatic/schemas/source/**; static/schemas/source/media-buy/sync-reporting-status-request.json (modified) matchesstatic/schemas/source/**; static/schemas/source/protocol/get-principal-request.json (modified) matchesstatic/schemas/source/**; static/schemas/source/protocol/get-principal-response.json (modified) matchesstatic/schemas/source/**; static/schemas/source/protocol/sync-principal-request.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.
|
Ladon found no blocking or medium findings. It escalated only because the change touches the gated schema paths. The owner approved the beta.3 set, including the decisions listed in this PR (admission by |
Summary
AdCP 3.3.0-beta.3, PR C of three: determinism and scale for experimental reporting subscriptions (
media_buy.reporting_subscriptions).1. Normative versions of what both SDKs implement
max_accountsadmission (newx-adcp-validation.admission). Admission is sticky and per subscription, ordered by coverage start and thenaccount_idin byte order. Coverage start here means the account'sauthorization.authorized_at. The key doesn't depend on the subscription, so a principal's subscriptions with the same scope and limit admit the same accounts. An admitted account keeps its place until it leaves coverage, and a waiting account carries an opencapacityexception. Accounts without covered buys count: a buyer computes admission fromlist_accountsalone, and an account holds its place before its first buy, so that buy is reported.max(accepted_at, confirmed_at)(or when a package is added). It stays fixed until the resolved offering is withdrawn. A newly added offering never re-resolves it; a new version resolves afresh. This replaces the old "adding an offering is a resolution change" bullet.match: exactwithdimensions, enforced by the schema (previously SHOULD).2. Scale
destination_overrides[]: each entry routes{account_ids | operator_domains}to adestination_id, with an optionalpath_template. Anaccount_idsentry wins over anoperator_domainsentry; duplicates fail the request. Override destinations share the main destination's pattern and transport, so routing never changes resolution. Changing overrides is a destination change, so it needs a new version.destination_override_refsreads them back.accounts_with_exceptionsandaccounts_unauthorizedstay capped at 1,000, now inaccount_idbyte order.prior_versionsis now bounded at the 16 newest. Each list carries a required total (*_count, enforced throughdependencies).get_principalgains an optionalreporting_subscription_pagerequest (subscription_id,list,pagination), and thecurrentresult adds the page. The item schemas moved todefinitionsso the inline lists and the page share them.account_ids, and changingexclude_account_ids, no longer bumpsubscription_version(newx-adcp-validation.membership). Each edit is a cutover for that account alone, recorded asexcluded_by_buyerintervals:accepted_atgets a closed interval over the time before it joined.subscription_coverage, asexcluded, while the entry is retained.3. Several pacing or analytics subscriptions per purpose
Two active pacing or analytics subscriptions at the same scope level may both apply to an account, for example hourly plus daily, or two breakdowns. Where both resolve the same offering for a package, the lower
subscription_idin byte order owes it. The other records a buy-leveloverriddenexception withpackage_ids, whichpackage_idsnow allows. Billing stays one per account at a scope level, andsync-principal-requestvalidation is narrowed to billing.4. Settled from the DX plan (owner-approved scope addition)
get_reporting_statusinallowed_tasks. A grant withoutsync_reporting_receiptsorsync_reporting_statuskeeps the account covered and readable. The seller refuses the missing task for that account withSCOPE_INSUFFICIENT, not with the unknown-identifier shape, which stays reserved for lost authority (feat(reporting): revocation means no access; wind down with a reduced grant #8607). A billing obligation the buyer can't receipt stays receipt-pending, and that pending receipt is the buyer's, never a seller delay. This is what both SDKs do.account_idon delivered rows. A seller advertising subscriptions publishes every managed-delivery offering (one withmethod) with a row schema that declaresaccount_idas a required string and lists it inprimary_keys. Without the column, stamped rows fail validation; without the key, rows from several accounts in one consolidated destination can collide. Core offerings are exempt. The rule is in the newx-adcp-validation.subscription_rowson the offering and in the subscriptiondestinationrule.5. Coverage vectors (adcp#8616)
The reference model now uses sticky resolution.
resolution-change-is-a-cutoverbecomesa-newly-available-offering-never-re-resolves, withchanged_from_originrecording the re-ruling, andwithdrawal-of-the-resolved-offering-is-a-cutoveris new. The selection rule now says a buy owes the union of its packages' resolutions, so it can owe two offerings even underexactorfinest, as thepackages-on-different-products-resolve-different-offeringsvector already pins.Owner decisions (approved)
authorized_at, thenaccount_id(approved). It is the only key identical across a principal's subscriptions.account_idssubscription still replaces all-accounts subscriptions of the same purpose, even ones that resolve different offerings. Only same-level multiplicity changed.prior_versionsis now capped. An earlier test pinned it as deliberately uncapped. Paging makes the cap safe, but the test change reverses that pin.account_idinprimary_keys, not only as a required column, is my call. It is stricter than "the schema allows it", which is what the SDKs check.Test plan
npm run build:schemas && npm run build:compliance(no symbol-link changes)test:schemas,test:json-schema,test:compliance-snippets,test:owned-links, the MCP projection and analysis tests, and the bounds tests. No capabilities shape change:max_accountsgets a description only, so no repin.test:docs-navlive-source checks pass. The snapshot checks needdist/docs, which the sparse worktree omits.overridden, and the paged read request and response shapes.Rebased onto #8622 and #8617 (both merged). The merged reference model re-derives every vector case, including the billing stub and notice-period cases, under sticky resolution, and the property tests pass.
🤖 Generated with Claude Code