Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/ledger-changed-empty-first-snapshot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"adcontextprotocol": patch
---

Reliable Reporting (experimental): a seller SHOULD NOT fire `reporting.ledger_changed` for an empty first snapshot revision, meaning a `snapshot` revision with `row_count` 0 when no earlier revision of the same logical slice was ever committed. Firstness comes from the slice's commit history, not from whether `supersedes_reporting_revision_id` is present, because a predecessor may have aged out of retention. A short-period pacing feed commits a revision for every period, including quiet ones, so a five-minute feed can ring 288 doorbells per account per day with nothing changed. Every other revision still fires: one with rows, any later snapshot, and every `official` revision, including a zero-row one. Every adjustment still fires. Unchanged: every elapsed period still gets its obligation and revision, `get_reporting_status` with `changes_after` still returns every revision, polling stays authoritative, and `reporting.status_changed` still announces health transitions. Buyers already poll, so they learn about empty periods by reading. The advisory rule is recorded as `x-adcp-validation.empty_first_snapshot` on `core/reporting-ledger-changed-webhook.json`; the webhook, notification-type, and capability descriptions and the reporting docs now say the same. No field, enum, or capability changes.
14 changes: 10 additions & 4 deletions docs/media-buy/reporting-core-implementation-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,13 @@ obligation appears in the first ledger snapshot strictly after `02:00Z`; with
If you do offer push, Core's doorbell is `reporting.status_changed` — an
invalidation for health transitions in either direction, with stable
`issue_ids`. `reporting.ledger_changed` is the separate optional invalidation
for every new revision or adjustment, including changes that leave health
untouched. `reporting.delivery_ready` belongs to the managed-delivery tier
and never fires for Core configurations.
for each new revision or adjustment, including changes that leave health
untouched. It SHOULD NOT fire for an empty first snapshot: a `snapshot`
revision with `row_count` `0` when no earlier revision of the same logical
slice was ever committed. Firstness comes from that commit history, not from
whether `supersedes_reporting_revision_id` is present. The revision is still
committed and readable through `changes_after`. `reporting.delivery_ready`
belongs to the managed-delivery tier and never fires for Core configurations.
- **No delivery machinery.** Core offerings omit `method`: the status ledger
and its immutable revision metadata are required, while any existing
`get_media_buy_delivery` read or legacy reporting webhook remains an
Expand Down Expand Up @@ -302,7 +306,9 @@ digest is intentionally retained).
7. **Treat push as a wake-up.** `reporting.ledger_changed` starts a
`changes_after` repair. Because a clock-only health transition may commit no
ledger record, `reporting.status_changed` starts a non-incremental current
summary or periods read. Poll periodically even when notifications are enabled.
summary or periods read. Poll periodically even when notifications are enabled:
an empty first snapshot revision may ring no ledger doorbell, so your poll is
how you reliably see it.

## How to verify

Expand Down
17 changes: 16 additions & 1 deletion docs/media-buy/task-reference/get_reporting_status.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,24 @@ offered. Three doorbells exist, with different purposes:
readiness for one materialization at a destination. Core configurations
never fire it.
- **`reporting.ledger_changed`** (any tier, including Core) — invalidation
for every new revision or adjustment, even when an already-healthy period
for each new revision or adjustment, even when an already-healthy period
remains healthy. Its record identity lets receivers deduplicate; repair uses
the receiver's own durable checkpoint rather than trusting event order.
It SHOULD NOT fire for an empty first snapshot (see below).

A seller SHOULD NOT fire `reporting.ledger_changed` for a `snapshot` revision
with `row_count` `0` when no earlier revision of the same logical slice was ever
committed. Firstness comes from the slice's commit history, not from whether
`supersedes_reporting_revision_id` is present: a later correction still fires
when its predecessor has aged out of retention and the field is absent. Control
totals do not affect whether a revision is empty. A short-period
pacing feed commits one of these for every quiet period, and a doorbell for each
one announces nothing. The period still gets its obligation and its revision,
and a `changes_after` read still returns that revision; receivers learn about
empty periods by reading. Every other revision fires: one with rows, any later
snapshot, and every `official` revision, including a zero-row one. Every
adjustment fires. Health transitions remain the separate concern of
`reporting.status_changed`.

When offered (advertised via `readiness_notification`),
`reporting.delivery_ready` is an account-anchored doorbell registered through
Expand Down
4 changes: 3 additions & 1 deletion docs/protocol/get_adcp_capabilities.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,9 @@ tier-independent invalidation for health transitions in either direction —
valid for Core, since it names no destination, and repaired through a full
current status read; `ledger_notification`
(`reporting.ledger_changed`) announces each new revision or adjustment even when
health is unchanged; and `readiness_notification` (`reporting.delivery_ready`)
health is unchanged, but SHOULD NOT announce a `snapshot` revision with
`row_count` `0` when no earlier revision of its logical slice was ever committed;
and `readiness_notification` (`reporting.delivery_ready`)
is managed-delivery-only positive readiness. Ledger changes repair through
`changes_after`; health-only changes use a non-incremental summary or periods read.

Expand Down
12 changes: 10 additions & 2 deletions docs/reference/implementor-faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,17 @@ adjustment separately.

### Q: How does a buyer learn about a correction that does not change health?

**A:** `reporting.ledger_changed` is the optional doorbell for every new
**A:** `reporting.ledger_changed` is the optional doorbell for each new
revision or adjustment. It is separate from `reporting.status_changed`, which
only reports health transitions. Push remains optional and non-authoritative:
only reports health transitions. A correction always rings it: a superseding
snapshot, an `official` revision, and every adjustment fire. A seller SHOULD NOT
fire it for an empty first snapshot: a `snapshot` revision with `row_count` `0`
when no earlier revision of the same logical slice was ever committed. Firstness
comes from commit history, not the presence of `supersedes_reporting_revision_id`;
control totals do not determine emptiness. This lets a short-period pacing feed
avoid ringing once per quiet period. That revision is still committed and
returned by `changes_after`.
Push remains optional and non-authoritative:
after fully consuming a periods read, persist `changes_checkpoint` and pass it
as `changes_after` to repair missed, duplicate, or out-of-order events without
re-reading the entire retained history.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"contract_version": "3.3",
"feature": "media_buy.reporting_subscriptions",
"status": "experimental",
"description": "Canonical, SDK-independent coverage vectors for experimental principal-level reporting subscriptions: for each input, every period the seller owes. Each case gives the buyer-side input and either the exact owed periods (expected, one row per buy, resolved offering, and period, and expected_obligations, the same rows grouped the way obligations carry them) or the input error (expected_error). Every expected row is derived from the spec text cited in spec_refs. scripts/reference/reporting-coverage is a brute-force reference model, written from the same text, that reproduces every case; tests/reporting-subscription-coverage-vectors.test.cjs runs it. Each case validates against case.schema.json in this directory. Like the feature, the vectors are experimental and change with it.",
"description": "Canonical, SDK-independent vectors for experimental principal-level reporting subscriptions. cases covers every period the seller owes: each entry gives the buyer-side input and either the exact owed periods (expected, one row per buy, resolved offering, and period, and expected_obligations, the same rows grouped the way obligations carry them) or the input error (expected_error). ledger_notification_cases covers the reporting.ledger_changed recommendation for committed records. Every expected result is derived from the spec text cited in spec_refs. scripts/reference/reporting-coverage is a brute-force reference model for the coverage cases; tests/reporting-subscription-coverage-vectors.test.cjs runs it. Each coverage case validates against case.schema.json in this directory. Like the feature, the vectors are experimental and change with it.",
"tzdata": {
"version": "2026f",
"source": "https://data.iana.org/time-zones/releases/tzdata2026f.tar.gz",
Expand All @@ -16,8 +16,117 @@
"now": "Only resolved periods are expected: those whose period_end is at or before input.now.",
"input": "The input is what the buyer holds: its subscription versions as the get_principal readback shows them, the account's grants and timezone, the buys it can see through get_media_buys, the seller's offerings, and this subscription's get_reporting_status subscription_coverage entry for the account. case.schema.json describes each field.",
"expected_error": "When the input cannot determine coverage, expected_error gives the error code and detail an SDK raises, from error-codes.json in this directory (COVERAGE_INPUT_INCOMPLETE or COVERAGE_INPUT_INVALID). wire_valid is false when the input also fails AdCP schema validation.",
"vocabularies": "error-codes.json freezes the error codes SDKs raise for subscriptions and coverage; reason-codes.json freezes the reasons a period is or is not owed. Both SDKs use them verbatim."
"vocabularies": "error-codes.json freezes the error codes SDKs raise for subscriptions and coverage; reason-codes.json freezes the reasons a period is or is not owed. Both SDKs use them verbatim.",
"ledger_notifications": "ledger_notification_cases freezes the recommended reporting.ledger_changed decision for a committed record. slice_commit_count_before is the number of revisions previously committed for the same logical slice, including revisions whose retention window has ended. should_not_fire is an advisory SHOULD NOT outcome; fire identifies records outside that exception."
},
"ledger_notification_cases": [
{
"id": "empty-first-snapshot-zero-rows",
"rule": "A rowless snapshot is the first revision because the slice has no earlier commit, so the seller should not fire reporting.ledger_changed; control totals do not change emptiness.",
"spec_refs": [
"static/schemas/source/core/reporting-ledger-changed-webhook.json#/x-adcp-validation/empty_first_snapshot"
],
"slice_commit_count_before": 0,
"record": {
"kind": "revision",
"finality": "snapshot",
"row_count": 0,
"control_totals": [
{ "name": "spend", "value": "12.00" }
]
},
"expected": "should_not_fire"
},
{
"id": "empty-first-snapshot-without-control-totals",
"rule": "A rowless snapshot is the first revision because the slice has no earlier commit, so the seller should not fire reporting.ledger_changed.",
"spec_refs": [
"static/schemas/source/core/reporting-ledger-changed-webhook.json#/x-adcp-validation/empty_first_snapshot"
],
"slice_commit_count_before": 0,
"record": {
"kind": "revision",
"finality": "snapshot",
"row_count": 0,
"control_totals": []
},
"expected": "should_not_fire"
},
{
"id": "first-snapshot-with-rows-and-zero-control-total",
"rule": "A first snapshot with rows fires reporting.ledger_changed even when its profile-specific control total is zero.",
"spec_refs": [
"static/schemas/source/core/reporting-ledger-changed-webhook.json#/x-adcp-validation/empty_first_snapshot"
],
"slice_commit_count_before": 0,
"record": {
"kind": "revision",
"finality": "snapshot",
"row_count": 2,
"control_totals": [
{ "name": "spend", "value": "0.00" }
]
},
"expected": "fire"
},
{
"id": "empty-correction-after-predecessor-retention",
"rule": "A rowless correction fires because the slice has an earlier commit, even after that predecessor aged out and supersedes_reporting_revision_id is absent.",
"spec_refs": [
"static/schemas/source/core/reporting-ledger-changed-webhook.json#/x-adcp-validation/empty_first_snapshot"
],
"slice_commit_count_before": 1,
"record": {
"kind": "revision",
"finality": "snapshot",
"row_count": 0,
"control_totals": []
},
"expected": "fire"
},
{
"id": "empty-superseding-snapshot",
"rule": "A rowless superseding snapshot fires because the logical slice already has an earlier committed revision.",
"spec_refs": [
"static/schemas/source/core/reporting-ledger-changed-webhook.json#/x-adcp-validation/empty_first_snapshot"
],
"slice_commit_count_before": 1,
"record": {
"kind": "revision",
"finality": "snapshot",
"row_count": 0,
"control_totals": [],
"supersedes_reporting_revision_id": "rrv_prior"
},
"expected": "fire"
},
{
"id": "zero-row-first-official",
"rule": "An official revision fires even when it is the slice's first commit and has zero rows.",
"spec_refs": [
"static/schemas/source/core/reporting-ledger-changed-webhook.json#/x-adcp-validation/empty_first_snapshot"
],
"slice_commit_count_before": 0,
"record": {
"kind": "revision",
"finality": "official",
"row_count": 0,
"control_totals": []
},
"expected": "fire"
},
{
"id": "reporting-adjustment",
"rule": "Every reporting adjustment fires reporting.ledger_changed.",
"spec_refs": [
"static/schemas/source/core/reporting-ledger-changed-webhook.json#/x-adcp-validation/empty_first_snapshot"
],
"record": {
"kind": "adjustment"
},
"expected": "fire"
}
],
"cases": [
{
"id": "baseline",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"ledger_notification": {
"type": "string",
"const": "reporting.ledger_changed",
"description": "Optional tier-independent invalidation for every newly committed revision or post-official adjustment, even when health does not change. Receivers repair through get_reporting_status changes_after; polling remains authoritative."
"description": "Optional tier-independent invalidation for each newly committed revision or post-official adjustment, even when health does not change. A seller SHOULD NOT fire it for an empty first snapshot: a snapshot revision with row_count 0 when no earlier revision of the same logical slice was ever committed. Firstness comes from the slice's commit history, not the presence of supersedes_reporting_revision_id. Receivers repair through get_reporting_status changes_after; polling remains authoritative."
},
"offerings": {
"type": "array",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"$id": "/schemas/core/reporting-ledger-changed-webhook.json",
"title": "Reporting Ledger Changed Webhook",
"x-status": "experimental",
"description": "Optional account-anchored invalidation fired for every newly committed reporting revision or post-official adjustment, whether or not health changes. Valid in every reporting tier. Receivers repair from their own durable changes_after checkpoint through get_reporting_status; this event is never the source of truth.",
"description": "Optional account-anchored invalidation fired for a newly committed reporting revision or post-official adjustment, whether or not health changes. A seller SHOULD NOT fire it for an empty first snapshot revision (see x-adcp-validation.empty_first_snapshot). Valid in every reporting tier. Receivers repair from their own durable changes_after checkpoint through get_reporting_status; this event is never the source of truth.",
"type": "object",
"properties": {
"idempotency_key": { "type": "string", "minLength": 16, "maxLength": 255, "pattern": "^[A-Za-z0-9_.:-]{16,255}$", "description": "Random per distinct fire and stable across transport retries, scoped to the authenticated sender." },
Expand Down Expand Up @@ -35,7 +35,8 @@
}
],
"x-adcp-validation": {
"logical_record": "One destination-independent revision or adjustment produces one logical account event even when it fans out through multiple obligations or delivery configurations. Receivers use changes_after to resolve the affected obligations and deduplicate by the immutable record identity."
"logical_record": "One destination-independent revision or adjustment produces one logical account event even when it fans out through multiple obligations or delivery configurations. Receivers use changes_after to resolve the affected obligations and deduplicate by the immutable record identity.",
"empty_first_snapshot": "The seller SHOULD NOT fire this event for a revision that meets all three conditions: (a) no earlier revision of the logical slice was ever committed; (b) its finality is snapshot; and (c) row_count is 0. Firstness comes from the slice's commit history, not from whether supersedes_reporting_revision_id is present: a predecessor may have aged out of retention, and a later revision still fires when that field is absent. Control totals do not determine whether a revision is empty. The seller still commits the obligation and the revision for that period, and get_reporting_status with changes_after still returns it; receivers learn about empty periods by reading, not from this event. Every other revision fires: a revision with rows, any later snapshot revision, and every official revision, including a zero-row official revision. Every adjustment fires."
},
"additionalProperties": true
}
Loading
Loading