Skip to content
Open
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/reporting-status-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.status_changed` when the only health change is an obligation moving from `waiting` to `healthy` or `complete` because a `snapshot` revision has `row_count` 0 and 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. Control totals do not determine emptiness. Every informative health transition still fires, including becoming late or overdue, a failure, recovery, a non-empty first revision, and any later revision that changes health. Polling `get_reporting_status` remains authoritative. This is the `reporting.status_changed` companion to the empty-first-snapshot `reporting.ledger_changed` recommendation in #9354; no field, enum, or capability changes.
14 changes: 12 additions & 2 deletions docs/media-buy/reporting-core-implementation-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,15 @@ obligation appears in the first ledger snapshot strictly after `02:00Z`; with
task call, not a seller push or a buyer-hosted callback.
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
`issue_ids`. It SHOULD NOT fire when the only health change is an empty first
snapshot moving an obligation from `waiting` to `healthy` or `complete`: 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. Control
totals do not determine emptiness. Late and overdue transitions, failures
that change health, and recoveries still fire, as do transitions caused by a
non-empty first revision or any later revision. `reporting.ledger_changed`
is the separate optional invalidation
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
Expand Down Expand Up @@ -308,7 +316,9 @@ digest is intentionally retained).
ledger record, `reporting.status_changed` starts a non-incremental current
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 you reliably see it. When that snapshot's only health effect is moving
the obligation from `waiting` to `healthy` or `complete`, it may ring no
status doorbell either.

## 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 @@ -417,7 +417,9 @@ offered. Three doorbells exist, with different purposes:
`issue_ids` matching `issues[].issue_id`, so consumers can project AdCP
reporting issues into durable work items. Repair it with a non-incremental
current summary or periods read: a clock-only transition may have no new
immutable ledger record and therefore no `changes_after` delta.
immutable ledger record and therefore no `changes_after` delta. It SHOULD NOT
fire when the only health change is an empty first snapshot moving the
obligation from `waiting` to `healthy` or `complete` (see below).
- **`reporting.delivery_ready`** (managed-delivery tier only) — positive
readiness for one materialization at a destination. Core configurations
never fire it.
Expand All @@ -441,6 +443,19 @@ snapshot, and every `official` revision, including a zero-row one. Every
adjustment fires. Health transitions remain the separate concern of
`reporting.status_changed`.

A seller SHOULD NOT fire `reporting.status_changed` when the only health change
is an obligation moving from `waiting` to `healthy` or `complete` because a
`snapshot` revision has `row_count` `0` and 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 revision 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.
Every other health transition fires, including becoming `delayed` or
`action_required`, a failure that changes health, a recovery from `delayed` or
`action_required`, a non-empty first revision, and a health transition caused
by any later revision. A later revision that leaves health unchanged remains
the separate concern of `reporting.ledger_changed`.

When offered (advertised via `readiness_notification`),
`reporting.delivery_ready` is an account-anchored doorbell registered through
[`sync_accounts`](/docs/accounts/tasks/sync_accounts) `notification_configs[]`. It is
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 @@ -936,7 +936,9 @@ when the seller declares any reporting notification.
Three optional doorbells: `status_notification` (`reporting.status_changed`) is
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`
current status read — but SHOULD NOT announce an empty first `snapshot` moving
an obligation from `waiting` to `healthy` or `complete`: `row_count` `0` when
no earlier revision of the logical slice was ever committed; `ledger_notification`
(`reporting.ledger_changed`) announces each new revision or adjustment even when
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;
Expand Down
13 changes: 13 additions & 0 deletions docs/reference/implementor-faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ 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.

### Q: Does an empty period need a reporting status doorbell?

**A:** Not when its only health change is the ordinary completion of an empty
first snapshot. A seller SHOULD NOT fire `reporting.status_changed` when a
`snapshot` revision with `row_count` `0` moves its obligation from `waiting` to
`healthy` or `complete` and no earlier revision of that logical slice was ever
committed. Use the slice's commit history for firstness, not the presence of
`supersedes_reporting_revision_id`; control totals do not determine emptiness.
Late and overdue transitions, failures that change health, and recoveries still
fire, as do transitions caused by a non-empty first revision or any later
revision. Polling remains the authoritative path for learning that the empty
period completed.

### Q: Can I reuse a published SDK reporting ledger instead of hand-rolling one?

**A:** Partly, and the honest answer depends on which contract version the SDK
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 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.",
"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; status_notification_cases covers the reporting.status_changed recommendation for health transitions. 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 @@ -17,7 +17,8 @@
"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.",
"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_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.",
"status_notifications": "status_notification_cases freezes the recommended reporting.status_changed decision for a health transition. 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 transitions outside that exception."
},
"ledger_notification_cases": [
{
Expand Down Expand Up @@ -127,6 +128,201 @@
"expected": "fire"
}
],
"status_notification_cases": [
{
"id": "empty-first-snapshot-waiting-to-healthy",
"rule": "A rowless snapshot is the slice's first revision and its only health effect is waiting to healthy, so the seller should not fire reporting.status_changed; control totals do not change emptiness.",
"spec_refs": [
"static/schemas/source/core/reporting-status-changed-webhook.json#/x-adcp-validation/empty_first_snapshot"
],
"slice_commit_count_before": 0,
"transition": {
"scope": "obligation",
"previous_health": "waiting",
"health": "healthy"
},
"cause": {
"kind": "revision",
"finality": "snapshot",
"row_count": 0,
"control_totals": [
{ "name": "spend", "value": "12.00" }
]
},
"expected": "should_not_fire"
},
{
"id": "empty-first-snapshot-waiting-to-complete",
"rule": "A rowless snapshot is the slice's first revision and its only health effect is waiting to complete, so the seller should not fire reporting.status_changed.",
"spec_refs": [
"static/schemas/source/core/reporting-status-changed-webhook.json#/x-adcp-validation/empty_first_snapshot"
],
"slice_commit_count_before": 0,
"transition": {
"scope": "obligation",
"previous_health": "waiting",
"health": "complete"
},
"cause": {
"kind": "revision",
"finality": "snapshot",
"row_count": 0,
"control_totals": []
},
"expected": "should_not_fire"
},
{
"id": "non-empty-first-snapshot",
"rule": "A first snapshot with rows fires reporting.status_changed when it moves the obligation from waiting to healthy, even when its profile-specific control total is zero.",
"spec_refs": [
"static/schemas/source/core/reporting-status-changed-webhook.json#/x-adcp-validation/empty_first_snapshot"
],
"slice_commit_count_before": 0,
"transition": {
"scope": "obligation",
"previous_health": "waiting",
"health": "healthy"
},
"cause": {
"kind": "revision",
"finality": "snapshot",
"row_count": 2,
"control_totals": [
{ "name": "spend", "value": "0.00" }
]
},
"expected": "fire"
},
{
"id": "empty-later-snapshot-after-predecessor-retention",
"rule": "A rowless later snapshot 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-status-changed-webhook.json#/x-adcp-validation/empty_first_snapshot"
],
"slice_commit_count_before": 1,
"transition": {
"scope": "obligation",
"previous_health": "waiting",
"health": "healthy"
},
"cause": {
"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-status-changed-webhook.json#/x-adcp-validation/empty_first_snapshot"
],
"slice_commit_count_before": 1,
"transition": {
"scope": "obligation",
"previous_health": "waiting",
"health": "complete"
},
"cause": {
"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 reporting.status_changed when it moves the obligation from waiting to complete, even when it is the slice's first commit and has zero rows.",
"spec_refs": [
"static/schemas/source/core/reporting-status-changed-webhook.json#/x-adcp-validation/empty_first_snapshot"
],
"slice_commit_count_before": 0,
"transition": {
"scope": "obligation",
"previous_health": "waiting",
"health": "complete"
},
"cause": {
"kind": "revision",
"finality": "official",
"row_count": 0,
"control_totals": []
},
"expected": "fire"
},
{
"id": "obligation-becomes-late",
"rule": "A clock-driven transition from waiting to delayed fires reporting.status_changed.",
"spec_refs": [
"static/schemas/source/core/reporting-status-changed-webhook.json#/x-adcp-validation/empty_first_snapshot"
],
"transition": {
"scope": "obligation",
"previous_health": "waiting",
"health": "delayed"
},
"cause": {
"kind": "clock"
},
"expected": "fire"
},
{
"id": "obligation-becomes-overdue",
"rule": "A clock-driven transition from delayed to action_required fires reporting.status_changed.",
"spec_refs": [
"static/schemas/source/core/reporting-status-changed-webhook.json#/x-adcp-validation/empty_first_snapshot"
],
"transition": {
"scope": "obligation",
"previous_health": "delayed",
"health": "action_required"
},
"cause": {
"kind": "clock"
},
"expected": "fire"
},
{
"id": "obligation-failure",
"rule": "A failure that moves a healthy obligation to action_required fires reporting.status_changed.",
"spec_refs": [
"static/schemas/source/core/reporting-status-changed-webhook.json#/x-adcp-validation/empty_first_snapshot"
],
"transition": {
"scope": "obligation",
"previous_health": "healthy",
"health": "action_required"
},
"cause": {
"kind": "failure"
},
"expected": "fire"
},
{
"id": "empty-first-snapshot-recovery",
"rule": "Recovery from delayed to healthy fires reporting.status_changed even when the recovering record is a rowless first snapshot.",
"spec_refs": [
"static/schemas/source/core/reporting-status-changed-webhook.json#/x-adcp-validation/empty_first_snapshot"
],
"slice_commit_count_before": 0,
"transition": {
"scope": "obligation",
"previous_health": "delayed",
"health": "healthy"
},
"cause": {
"kind": "revision",
"finality": "snapshot",
"row_count": 0,
"control_totals": []
},
"expected": "fire"
}
],
"cases": [
{
"id": "baseline",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"status_notification": {
"type": "string",
"const": "reporting.status_changed",
"description": "Optional tier-independent invalidation doorbell for health transitions in either direction, including clock-driven waiting-to-delayed and delayed-to-action_required. Valid for Core: it names no destination. Polling status_task remains the authoritative recovery path whether or not this is offered."
"description": "Optional tier-independent invalidation doorbell for health transitions in either direction, including clock-driven waiting-to-delayed and delayed-to-action_required. A seller SHOULD NOT fire it when the only health change is an empty first snapshot moving an obligation from waiting to healthy or complete: 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. Valid for Core: it names no destination. Polling status_task remains the authoritative recovery path whether or not this is offered."
},
"ledger_notification": {
"type": "string",
Expand Down
Loading
Loading