You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dfffa68
Browse filesBrowse the repository at this point in the historyBrowse files
fix(reporting): model package exclusions and membership edits as the reference model does
Two disagreements with the spec's reference model, found by its differential
generator (adcontextprotocol/adcp 8ee1bfa2) and fixed the same way in the
TypeScript SDK (adcontextprotocol/adcp-client#3620):
- A package_ids exception was modelled as a resolution change: it took the
package out of resolution and started a regime, so a window naming every
package of a buy reset the E a later resolution inherited. It now removes a
period only when one entry covering the period start names every package
resolving the offering that is owed the period, and never splits a regime.
- One excluded_by_buyer entry put every version under in-place membership.
Only the versions whose span an entry overlaps are now; another version
keeps its own account_ids and exclude_account_ids.
The three minimized differential scenarios are vendored from the TypeScript
SDK and pass. explain writes the before_package_added facts
(packages_added_at), sentence and buy facts (packages[].added_at) exactly as
the TypeScript SDK does, and reports a period a package_ids entry removes
under that entry's reason. A test pins the billing stub at an
account-timezone cutover, which both SDKs owe per the cutover text where the
8ee1bfa2 reference model emits none (fixed in the spec for beta.5).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/reporting-subscriptions-coverage.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,7 +125,7 @@ A period that ends at or before the buy's `confirmed_at` is not owed (`before_co
125
125
126
126
A package added to a confirmed buy carries `added_at` on `get_media_buys` (3.3.0-beta.4), and `added_at` is that package's own `confirmed_at`. Each package is owed from the later of the buy's `confirmed_at` and its `added_at` (`confirmed_at` alone when `added_at` is absent: the package was part of the buy at confirmation). The buy owes a period of an offering when the period ends after that instant for at least one package resolving the offering. So the period containing `added_at` is owed in full, earlier periods are owed only through packages the buy already had, and adding a package is never a cutover. When every package resolving the offering was added after the period ended, the reason is `before_package_added`.
127
127
128
-
The package also resolves at the later of the version's `accepted_at` and its own `confirmed_at`, among the offerings available then. A `package_ids` exception removes a period when it names every package resolving the offering that is owed that period, so packages added and removed compose: a package keeps the buy covered from its `added_at` until an entry naming it takes it out.
128
+
The package also resolves at the later of the version's `accepted_at` and its own `confirmed_at`, among the offerings available then. A `package_ids` exception removes a period when it names every package resolving the offering that is owed that period, so packages added and removed compose: a package keeps the buy covered from its `added_at` until an entry naming it takes it out. A `package_ids` exception never changes resolution, so it never starts a cutover.
129
129
130
130
`SubscriptionBuy.from_media_buy` reads `packages[].added_at` into `SubscriptionBuyPackage.added_at`, and `SubscriptionBuy.package_confirmed_at(package_id)` is the instant it is owed from.
131
131
@@ -157,6 +157,8 @@ A timezone change takes effect at its `effective_at`, and each zone owes only it
157
157
158
158
When a cutover hands a billing feed to a schedule with no boundary at E, the stretch from E to the first incoming boundary is owed as one stub period. Its obligation carries `stub: true` (`OwedSubscriptionPeriod.stub`, `ReportingObligationRecord.stub`). Pacing and analytics feeds leave that stretch unowed.
159
159
160
+
This applies at every cutover, an account-timezone change included, as the `cutover` text says. The reference model at adcontextprotocol/adcp 8ee1bfa2 emits no stub at a timezone cutover; the spec fixes that for beta.5, and both SDKs follow the text.
161
+
160
162
### Sticky resolution
161
163
162
164
A package resolves once, when its (buy, version) pair first does: at the later of the version's `accepted_at` and the package's own `confirmed_at` (the buy's, or its `added_at` when later), among the offerings available then. An offering published later never re-resolves it. A resolved offering's `withdrawn_at` is the one change: the package re-resolves among the offerings available then, as a cutover.
Copy file name to clipboardExpand all lines: docs/reporting-subscriptions-seller.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ The reference seller (`python -m adcp reference-seller reporting`) is a complete
53
53
54
54
-**Admission under `max_accounts`.** Candidates are ordered by `authorization.authorized_at`, then `account_id` in byte order, and an admitted account keeps its slot. A waiting candidate carries a `capacity` exception.
55
55
-**Several feeds per purpose.** A caller may hold several pacing or analytics subscriptions for one account. Where two resolve the same offering for a package, the lowest `subscription_id` owes it and the other records an `overridden` exception naming the `package_ids`. Billing stays one per account at a scope level.
56
-
-**Membership in place.** Membership edits (`account_ids`, `exclude_account_ids`) keep the version. A removed account stays listed, `excluded`, with an `excluded_by_buyer` entry from the cutover. An added account gets a closed entry covering the time before it joined.
56
+
-**Membership in place.** Membership edits (`account_ids`, `exclude_account_ids`) keep the version. A removed account stays listed, `excluded`, with an `excluded_by_buyer` entry from the cutover. An added account gets a closed entry covering the time before it joined. On the buyer side, `excluded_by_buyer` entries decide membership only for the versions whose span they overlap; any other version keeps its own lists.
57
57
-**`destination_overrides`.** An account named by an override, by `account_ids` or `operator_domains`, resolves against the override's destination method. Its owed sets carry the override as the version's `destination`, so `bind_managed_generation` binds and checks the override's `path_template`.
58
58
-**Bounded readback.**`prior_versions` lists the 16 newest inline, and the account lists 1,000, each with a total count. `get_principal``reporting_subscription_page` pages the rest from the engine's state.
59
59
-**Partial grants.** A grant that keeps the account covered refuses a task it does not list with `SCOPE_INSUFFICIENT`.
0 commit comments