@adcp/sdk 16.0.0-beta.3 → 16.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/auth/oauth/diagnose.js +3 -11
- package/dist/lib/auth/oauth/diagnose.mjs +4 -12
- package/dist/lib/auth/oauth/diagnostics.d.mts +2 -1
- package/dist/lib/auth/oauth/diagnostics.d.ts +2 -1
- package/dist/lib/auth/oauth/diagnostics.js +8 -10
- package/dist/lib/auth/oauth/diagnostics.mjs +7 -10
- package/dist/lib/index.d.mts +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +2 -0
- package/dist/lib/index.mjs +7 -1
- package/dist/lib/reporting/consumer-runtime.js +2 -1
- package/dist/lib/reporting/consumer-runtime.mjs +2 -1
- package/dist/lib/reporting/ledger/handler.js +50 -11
- package/dist/lib/reporting/ledger/handler.mjs +50 -12
- package/dist/lib/reporting/ledger/index.d.mts +17 -14
- package/dist/lib/reporting/ledger/index.d.ts +17 -14
- package/dist/lib/reporting/ledger/index.js +32 -20
- package/dist/lib/reporting/ledger/index.mjs +21 -10
- package/dist/lib/reporting/ledger/offering-validation.d.mts +9 -0
- package/dist/lib/reporting/ledger/offering-validation.d.ts +9 -0
- package/dist/lib/reporting/{gcs/bucket-policy.js → ledger/offering-validation.js} +9 -8
- package/dist/lib/reporting/ledger/offering-validation.mjs +8 -0
- package/dist/lib/reporting/ledger/receipts.d.mts +48 -0
- package/dist/lib/reporting/ledger/receipts.d.ts +48 -0
- package/dist/lib/reporting/ledger/receipts.js +186 -0
- package/dist/lib/reporting/ledger/receipts.mjs +161 -0
- package/dist/lib/reporting/ledger/status-ingest.js +3 -3
- package/dist/lib/reporting/ledger/status-ingest.mjs +4 -5
- package/dist/lib/reporting/ledger/types.d.mts +43 -0
- package/dist/lib/reporting/ledger/types.d.ts +43 -0
- package/dist/lib/reporting/ledger/types.js +31 -2
- package/dist/lib/reporting/ledger/types.mjs +26 -1
- package/dist/lib/reporting/pagination.d.mts +6 -0
- package/dist/lib/reporting/pagination.d.ts +6 -0
- package/dist/lib/reporting/{gcs/errors.js → pagination.js} +12 -17
- package/dist/lib/reporting/pagination.mjs +12 -0
- package/dist/lib/reporting/reconciliation.d.mts +1 -0
- package/dist/lib/reporting/reconciliation.d.ts +1 -0
- package/dist/lib/reporting/reconciliation.js +3 -2
- package/dist/lib/reporting/reconciliation.mjs +3 -2
- package/dist/lib/reporting/service/index.d.mts +79 -153
- package/dist/lib/reporting/service/index.d.ts +79 -153
- package/dist/lib/reporting/service/index.js +34 -491
- package/dist/lib/reporting/service/index.mjs +36 -510
- package/dist/lib/reporting/service/scheduler-support.d.mts +43 -0
- package/dist/lib/reporting/service/scheduler-support.d.ts +43 -0
- package/dist/lib/reporting/service/scheduler-support.js +125 -0
- package/dist/lib/reporting/service/scheduler-support.mjs +96 -0
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/signing/canonicalize.d.mts +4 -0
- package/dist/lib/signing/canonicalize.d.ts +4 -0
- package/dist/lib/signing/canonicalize.js +14 -8
- package/dist/lib/signing/canonicalize.mjs +14 -8
- package/dist/lib/signing/content-digest.d.mts +8 -0
- package/dist/lib/signing/content-digest.d.ts +8 -0
- package/dist/lib/signing/content-digest.js +11 -5
- package/dist/lib/signing/content-digest.mjs +10 -5
- package/dist/lib/signing/signer.js +9 -6
- package/dist/lib/signing/signer.mjs +10 -7
- package/dist/lib/signing/web-bot-auth.js +103 -37
- package/dist/lib/signing/web-bot-auth.mjs +108 -37
- package/dist/lib/testing/storyboard/junit.js +16 -3
- package/dist/lib/testing/storyboard/junit.mjs +16 -3
- package/dist/lib/testing/storyboard/request-signing/builder.js +10 -9
- package/dist/lib/testing/storyboard/request-signing/builder.mjs +10 -9
- package/dist/lib/testing/storyboard/runner.js +94 -25
- package/dist/lib/testing/storyboard/runner.mjs +94 -25
- package/dist/lib/testing/storyboard/types.d.mts +6 -0
- package/dist/lib/testing/storyboard/types.d.ts +6 -0
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/version.d.mts +3 -3
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.js +3 -3
- package/dist/lib/version.mjs +3 -3
- package/docs/TYPE-SUMMARY.md +23 -5
- package/docs/guides/REPORTING-GCS-FENCE.md +3 -3
- package/docs/guides/REPORTING-GCS-MANAGED.md +4 -4
- package/docs/guides/REPORTING-LEDGER-CUTOVER.md +7 -7
- package/docs/guides/REPORTING-LEDGER.md +107 -51
- package/docs/guides/REPORTING-OPERATIONS.md +66 -5
- package/docs/guides/REPORTING-STABILITY.md +36 -32
- package/docs/llms.txt +4 -3
- package/docs/migration-14.x-rc-worksheet.md +4 -7
- package/docs/migration-reporting-storage-package.md +186 -0
- package/examples/README.md +1 -1
- package/package.json +13 -78
- package/dist/lib/reporting/azure/index.d.mts +0 -31
- package/dist/lib/reporting/azure/index.d.ts +0 -31
- package/dist/lib/reporting/azure/index.js +0 -266
- package/dist/lib/reporting/azure/index.mjs +0 -249
- package/dist/lib/reporting/bigquery/index.d.mts +0 -246
- package/dist/lib/reporting/bigquery/index.d.ts +0 -246
- package/dist/lib/reporting/bigquery/index.js +0 -633
- package/dist/lib/reporting/bigquery/index.mjs +0 -594
- package/dist/lib/reporting/gcs/adapter.d.mts +0 -38
- package/dist/lib/reporting/gcs/adapter.d.ts +0 -38
- package/dist/lib/reporting/gcs/adapter.js +0 -342
- package/dist/lib/reporting/gcs/adapter.mjs +0 -325
- package/dist/lib/reporting/gcs/bucket-policy.d.mts +0 -3
- package/dist/lib/reporting/gcs/bucket-policy.d.ts +0 -3
- package/dist/lib/reporting/gcs/bucket-policy.mjs +0 -7
- package/dist/lib/reporting/gcs/errors.d.mts +0 -11
- package/dist/lib/reporting/gcs/errors.d.ts +0 -11
- package/dist/lib/reporting/gcs/errors.mjs +0 -16
- package/dist/lib/reporting/gcs/fence.d.mts +0 -41
- package/dist/lib/reporting/gcs/fence.d.ts +0 -41
- package/dist/lib/reporting/gcs/fence.js +0 -250
- package/dist/lib/reporting/gcs/fence.mjs +0 -230
- package/dist/lib/reporting/gcs/index.d.mts +0 -18
- package/dist/lib/reporting/gcs/index.d.ts +0 -18
- package/dist/lib/reporting/gcs/index.js +0 -44
- package/dist/lib/reporting/gcs/index.mjs +0 -14
- package/dist/lib/reporting/gcs/io.d.mts +0 -7
- package/dist/lib/reporting/gcs/io.d.ts +0 -7
- package/dist/lib/reporting/gcs/io.js +0 -95
- package/dist/lib/reporting/gcs/io.mjs +0 -69
- package/dist/lib/reporting/gcs/reader.d.mts +0 -67
- package/dist/lib/reporting/gcs/reader.d.ts +0 -67
- package/dist/lib/reporting/gcs/reader.js +0 -193
- package/dist/lib/reporting/gcs/reader.mjs +0 -169
- package/dist/lib/reporting/gcs/row-provider.d.mts +0 -39
- package/dist/lib/reporting/gcs/row-provider.d.ts +0 -39
- package/dist/lib/reporting/gcs/row-provider.js +0 -225
- package/dist/lib/reporting/gcs/row-provider.mjs +0 -208
- package/dist/lib/reporting/gcs/validation.d.mts +0 -5
- package/dist/lib/reporting/gcs/validation.d.ts +0 -5
- package/dist/lib/reporting/gcs/validation.js +0 -49
- package/dist/lib/reporting/gcs/validation.mjs +0 -25
- package/dist/lib/reporting/ledger/change-feed.d.mts +0 -69
- package/dist/lib/reporting/ledger/change-feed.d.ts +0 -69
- package/dist/lib/reporting/ledger/change-feed.js +0 -107
- package/dist/lib/reporting/ledger/change-feed.mjs +0 -80
- package/dist/lib/reporting/ledger/managed-postgres.d.mts +0 -293
- package/dist/lib/reporting/ledger/managed-postgres.d.ts +0 -293
- package/dist/lib/reporting/ledger/managed-postgres.js +0 -2346
- package/dist/lib/reporting/ledger/managed-postgres.mjs +0 -2332
- package/dist/lib/reporting/ledger/managed-router.d.mts +0 -148
- package/dist/lib/reporting/ledger/managed-router.d.ts +0 -148
- package/dist/lib/reporting/ledger/managed-router.js +0 -280
- package/dist/lib/reporting/ledger/managed-router.mjs +0 -258
- package/dist/lib/reporting/ledger/managed.d.mts +0 -535
- package/dist/lib/reporting/ledger/managed.d.ts +0 -535
- package/dist/lib/reporting/ledger/managed.js +0 -761
- package/dist/lib/reporting/ledger/managed.mjs +0 -729
- package/dist/lib/reporting/ledger/notification-activity.d.mts +0 -332
- package/dist/lib/reporting/ledger/notification-activity.d.ts +0 -332
- package/dist/lib/reporting/ledger/notification-activity.js +0 -1366
- package/dist/lib/reporting/ledger/notification-activity.mjs +0 -1337
- package/dist/lib/reporting/ledger/object-writes.d.mts +0 -128
- package/dist/lib/reporting/ledger/object-writes.d.ts +0 -128
- package/dist/lib/reporting/ledger/object-writes.js +0 -147
- package/dist/lib/reporting/ledger/object-writes.mjs +0 -114
- package/dist/lib/reporting/ledger/postgres.d.mts +0 -689
- package/dist/lib/reporting/ledger/postgres.d.ts +0 -689
- package/dist/lib/reporting/ledger/postgres.js +0 -4462
- package/dist/lib/reporting/ledger/postgres.mjs +0 -4462
- package/dist/lib/reporting/ledger/row-storage-migration.d.mts +0 -59
- package/dist/lib/reporting/ledger/row-storage-migration.d.ts +0 -59
- package/dist/lib/reporting/ledger/row-storage-migration.js +0 -365
- package/dist/lib/reporting/ledger/row-storage-migration.mjs +0 -339
- package/dist/lib/reporting/ledger/row-storage-object.d.mts +0 -203
- package/dist/lib/reporting/ledger/row-storage-object.d.ts +0 -203
- package/dist/lib/reporting/ledger/row-storage-object.js +0 -379
- package/dist/lib/reporting/ledger/row-storage-object.mjs +0 -335
- package/dist/lib/reporting/ledger/row-storage-provider-io.d.mts +0 -44
- package/dist/lib/reporting/ledger/row-storage-provider-io.d.ts +0 -44
- package/dist/lib/reporting/ledger/row-storage-provider-io.js +0 -142
- package/dist/lib/reporting/ledger/row-storage-provider-io.mjs +0 -111
- package/dist/lib/reporting/ledger/row-storage.d.mts +0 -316
- package/dist/lib/reporting/ledger/row-storage.d.ts +0 -316
- package/dist/lib/reporting/ledger/row-storage.js +0 -812
- package/dist/lib/reporting/ledger/row-storage.mjs +0 -802
- package/dist/lib/reporting/s3/index.d.mts +0 -34
- package/dist/lib/reporting/s3/index.d.ts +0 -34
- package/dist/lib/reporting/s3/index.js +0 -347
- package/dist/lib/reporting/s3/index.mjs +0 -340
- package/dist/lib/reporting/service/maintenance.d.mts +0 -148
- package/dist/lib/reporting/service/maintenance.d.ts +0 -148
- package/dist/lib/reporting/service/maintenance.js +0 -185
- package/dist/lib/reporting/service/maintenance.mjs +0 -159
- package/examples/reliable-reporting-service/README.md +0 -169
|
@@ -5,7 +5,7 @@ consumer runtime. Reliable Reporting controls evidence used for billing and
|
|
|
5
5
|
large media-spend decisions. Treat its PostgreSQL state, destination objects,
|
|
6
6
|
signing keys, and authentication registry as financial infrastructure.
|
|
7
7
|
|
|
8
|
-
> **Stability:** the storage
|
|
8
|
+
> **Stability:** the storage this runbook operates lives in `@adcp/reporting-storage`, which is pre-1.0 and experimental. Pin it with `~` (for example `~0.1.0`) and read each minor's changeset before upgrading. See the [Reliable Reporting stability policy](REPORTING-STABILITY.md).
|
|
9
9
|
|
|
10
10
|
## Production topology
|
|
11
11
|
|
|
@@ -80,7 +80,8 @@ Each of these features is opt-in and additive. Enable them one at a time on a
|
|
|
80
80
|
running deployment. See the [ledger guide](REPORTING-LEDGER.md#row-storage)
|
|
81
81
|
for configuration details.
|
|
82
82
|
|
|
83
|
-
Running Core only, without the production service? Pass `maintenance
|
|
83
|
+
Running Core only, without the production service? Pass `maintenance:
|
|
84
|
+
reportingLedgerMaintenance({ ... })` (from `@adcp/reporting-storage`) to
|
|
84
85
|
`createReliableReportingService` so its scheduler (or `runMaintenance()`) does
|
|
85
86
|
the retention, change-feed pruning and abandoned-upload sweeps the production
|
|
86
87
|
service runs for you. See
|
|
@@ -143,6 +144,58 @@ service runs for you. See
|
|
|
143
144
|
for the rule and what it keeps. Compaction cannot be undone; backups hold
|
|
144
145
|
any longer evidence.
|
|
145
146
|
|
|
147
|
+
8. **Orphaned object collection (optional).** The intent sweep deletes only
|
|
148
|
+
what an intent lists. It cannot see an upload whose `PUT` succeeded before the
|
|
149
|
+
intent recorded it, an intent for a binding no running host configures, or an
|
|
150
|
+
intent lost to a database restore, and a bucket lifecycle rule cannot tell
|
|
151
|
+
those objects from committed ones. Enable `orphanCollection`
|
|
152
|
+
(`maintenance.orphanCollection` on the Core-only service) to list each
|
|
153
|
+
configured object binding under `{prefix}/{namespace_key}/` and delete what
|
|
154
|
+
nothing names. Roll it out in this order:
|
|
155
|
+
1. Run it with `dryRun: true` and read `candidates` in the
|
|
156
|
+
`orphan object collection` task result. Confirm they are objects you
|
|
157
|
+
expect to lose.
|
|
158
|
+
2. Enable it for real, with `acknowledgeExclusiveNamespace: true` (see
|
|
159
|
+
below), a modest `limit` (objects examined per binding per pass, default
|
|
160
|
+
1000) and one host.
|
|
161
|
+
|
|
162
|
+
It is built for a long period: a listing that does not finish within `limit`
|
|
163
|
+
continues on the next pass, and a finished one rests for `intervalSeconds`
|
|
164
|
+
(default one day) before the next starts. That position lives in the process,
|
|
165
|
+
so a restart begins a new listing; the cost is bounded by `limit` per pass
|
|
166
|
+
either way. Reduce `limit`, or lengthen `intervalSeconds`, to spend fewer list
|
|
167
|
+
requests.
|
|
168
|
+
|
|
169
|
+
An object is deleted only when all of these hold: its key is a `.jsonl` or
|
|
170
|
+
`.jsonl.gz` object under the binding's owned prefix; it was written more than
|
|
171
|
+
`minAgeSeconds` ago (default 7 days, never less than 1 day, which must stay
|
|
172
|
+
well above the write deadline plus intent expiry); no row set that is not yet
|
|
173
|
+
`pruned` has a chunk at that key and no write intent lists it, at any version;
|
|
174
|
+
and, under the per-object advisory lock every other delete takes, no `live` or
|
|
175
|
+
`unavailable` row set references that exact version and no open intent
|
|
176
|
+
created it, checked under every binding because two bindings can share a
|
|
177
|
+
bucket and prefix (a retired binding kept `readOnly` next to its successor).
|
|
178
|
+
`readOnly` bindings are skipped unless `includeReadOnly: true`. A binding
|
|
179
|
+
whose provider has no `list` is reported as `unsupported` (and as a
|
|
180
|
+
maintenance warning), never silently skipped. Everything under the owned prefix
|
|
181
|
+
with a row-object key counts as written by this SDK, so do not store other
|
|
182
|
+
`.jsonl` files there.
|
|
183
|
+
|
|
184
|
+
**Run it only against the ledger database that owns the namespace.** The
|
|
185
|
+
namespace key comes from the database's installation identity. A clone or
|
|
186
|
+
point-in-time copy of that database that still points at the same bucket
|
|
187
|
+
shares the key, and its collector would delete the objects of every row set
|
|
188
|
+
the original wrote after the copy was taken, because the copy has never heard
|
|
189
|
+
of them. The age threshold does not protect against that, which is why a real
|
|
190
|
+
(not dry) pass needs `acknowledgeExclusiveNamespace: true`: it is your statement
|
|
191
|
+
that this database is the only owner. A clone made by copying the deployment
|
|
192
|
+
copies the flag too, so the flag does not protect it: remove it, or the whole
|
|
193
|
+
option, from every copy. Disable the option on clones, and after
|
|
194
|
+
restoring a database in place expect the collector to delete the objects of the
|
|
195
|
+
row sets the restore lost, which is its purpose.
|
|
196
|
+
The cost grows with bucket size: one listing request per page, plus one
|
|
197
|
+
database query per page and one transaction per deleted object.
|
|
198
|
+
|
|
146
199
|
Alert on these row-storage signals:
|
|
147
200
|
|
|
148
201
|
- `ROWS_INTEGRITY_FAILED` or `ROWS_UNAVAILABLE` from reads. These are never
|
|
@@ -154,6 +207,14 @@ Alert on these row-storage signals:
|
|
|
154
207
|
host does not configure, and `overdue` (expired more than 24 hours ago, still
|
|
155
208
|
unswept) means no host is handling them and their objects are leaking. The
|
|
156
209
|
maintenance helper reports both through `onError`.
|
|
210
|
+
- The `orphan object collection` task reporting `failed` or `unsupported`
|
|
211
|
+
bindings (their provider cannot list, so nothing there is collected). A listing
|
|
212
|
+
that fails is retried from the page that failed (or from the start, if it was
|
|
213
|
+
the first page of a resumed listing). A delete that fails is counted and the
|
|
214
|
+
pass moves on, so one stuck object cannot hold up the rest; it is tried again on
|
|
215
|
+
the next full listing. `referenced` and
|
|
216
|
+
`tooYoung` are normal; a `foreign` count means the prefix holds objects this
|
|
217
|
+
SDK did not write as row objects, which it leaves alone.
|
|
157
218
|
- The `snapshot compaction` task reporting `failed` revisions. Provider deletes
|
|
158
219
|
are failing; the revisions stay `pruning` (reads already answer not-found) and
|
|
159
220
|
the next pass resumes them.
|
|
@@ -328,7 +389,7 @@ For complete GCS file-transfer delivery, private contracts and scoped buyer read
|
|
|
328
389
|
|
|
329
390
|
## Live GCP validation
|
|
330
391
|
|
|
331
|
-
`scripts/validate-reporting-gcp.mjs` runs the built
|
|
392
|
+
`packages/reporting-storage/scripts/validate-reporting-gcp.mjs` (`npm run validate:reporting-gcp`) runs the built `@adcp/reporting-storage` against a real BigQuery
|
|
332
393
|
project and a real GCS bucket. The in-memory doubles in the test suite cannot
|
|
333
394
|
prove how BigQuery names jobs, where it stores load options, or what a real
|
|
334
395
|
bucket policy looks like; this script does. It is not published with the
|
|
@@ -336,7 +397,7 @@ package, so run it from a repository checkout.
|
|
|
336
397
|
|
|
337
398
|
What it checks:
|
|
338
399
|
|
|
339
|
-
- **BigQuery warehouse sink** (`@adcp/
|
|
400
|
+
- **BigQuery warehouse sink** (`@adcp/reporting-storage/bigquery`). It applies the
|
|
340
401
|
ledger migrations into fresh PostgreSQL schemas, commits revisions, creates a
|
|
341
402
|
uniquely named dataset in the destination project from `defaultTablesSql` and
|
|
342
403
|
`currentRowsViewSql`, and runs the sink. It verifies row and revision counts
|
|
@@ -372,7 +433,7 @@ What it checks:
|
|
|
372
433
|
`GCP_BQ_PROJECT`. Load jobs are then created in the destination project, and
|
|
373
434
|
the crash replay fails if the "job already exists" status check looks in the
|
|
374
435
|
client's default project instead.
|
|
375
|
-
- **GCS row provider** (`@adcp/
|
|
436
|
+
- **GCS row provider** (`@adcp/reporting-storage/gcs`). It prints the bucket policy,
|
|
376
437
|
runs the provider probe (uniform bucket-level access, public access
|
|
377
438
|
prevention, lifecycle rules) and `runReportingRowObjectProviderConformanceV1`,
|
|
378
439
|
then commits a revision through an object binding on the bucket and reads it
|
|
@@ -1,76 +1,80 @@
|
|
|
1
1
|
# Reliable Reporting stability policy
|
|
2
2
|
|
|
3
|
-
The Reliable Reporting storage surface is **experimental**. It is new, it has not yet run in production at an adopter, and its shape is still being settled by real use.
|
|
3
|
+
The Reliable Reporting storage surface is **experimental**. It is new, it has not yet run in production at an adopter, and its shape is still being settled by real use. It ships as its own package, `@adcp/reporting-storage`, on its own version line, so a breaking change there is a minor release of that package and never forces a major release of `@adcp/sdk`.
|
|
4
4
|
|
|
5
|
-
This follows how the AdCP protocol treats experimental surfaces (`x-status: experimental` in the schemas, with advance notice of breaking changes).
|
|
5
|
+
This follows how the AdCP protocol treats experimental surfaces (`x-status: experimental` in the schemas, with advance notice of breaking changes), and how other SDKs ship storage (Auth.js `@auth/pg-adapter`, LangGraph's checkpoint packages, OpenTelemetry exporters). The Python SDK is making the same split (adcp-client-python#1510).
|
|
6
6
|
|
|
7
7
|
## What is experimental
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
**Everything exported by `@adcp/reporting-storage`.** The package is pre-1.0 (`0.x`), and each export carries an `@experimental` TSDoc tag that links to this page. Editors show the tag on hover, and some mark the symbol as unstable.
|
|
10
10
|
|
|
11
|
-
| Subpath
|
|
12
|
-
|
|
|
13
|
-
| `@adcp/
|
|
14
|
-
| `@adcp/
|
|
15
|
-
| `@adcp/
|
|
16
|
-
| `@adcp/
|
|
17
|
-
| `@adcp/
|
|
18
|
-
| `@adcp/
|
|
11
|
+
| Subpath | Holds |
|
|
12
|
+
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
|
|
13
|
+
| `@adcp/reporting-storage` | the PostgreSQL ledger store (`PostgresReportingLedgerStore`), its migrations, `sweepExpiredReportingLedgerState`, row storage (`ReportingRowStorageV1`, row bindings, the provider contract and conformance suite, the filesystem provider, the row-storage migration and probe), object writes, the host change feed (`REPORTING_LEDGER_CHANGES_MIGRATION`, change records and cursors), and ledger maintenance (retention, compaction, orphan collection, change-feed pruning, `reportingLedgerMaintenance`) |
|
|
14
|
+
| `@adcp/reporting-storage/managed` | the managed-delivery runtime, `PostgresReportingManagedDeliveryStore`, the adapter contract and the adapter router |
|
|
15
|
+
| `@adcp/reporting-storage/notifications` | notification activity stores, checkpoints and runtime |
|
|
16
|
+
| `@adcp/reporting-storage/service` | `createPostgresReliableReportingProductionService` |
|
|
17
|
+
| `@adcp/reporting-storage/gcs` | the GCS write fence, reader, managed-delivery adapter and row-object provider |
|
|
18
|
+
| `@adcp/reporting-storage/s3` | the S3 row-object provider |
|
|
19
|
+
| `@adcp/reporting-storage/azure` | the Azure Blob row-object provider |
|
|
20
|
+
| `@adcp/reporting-storage/bigquery` | the BigQuery warehouse sink |
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
**The storage interfaces in `@adcp/sdk`.** The contract the package implements stays in the SDK, and it changes together with the package, so it is experimental too: the store, transaction, lease, row-read and revision-metadata interfaces in `@adcp/sdk/reporting/ledger` (`ReportingLedgerStore` and the types it uses), `ReportingReceiptSyncStoreV1`, the store-contract error classes (`ReportingLedgerLeaseLostError`, `ReportingLedgerPeriodRetiredError`, `ReportingLedgerContinuityError`) and the row-storage error types. Their TSDoc carries the `@experimental` tag. A breaking change to one ships as a minor of `@adcp/sdk` together with a matching minor of `@adcp/reporting-storage`, and the changesets say which pair to install.
|
|
21
23
|
|
|
22
|
-
- the
|
|
23
|
-
- row storage (`ReportingRowStorageV1`, row bindings, row encoding, the row-storage migration and probe, and row-store errors) and object writes;
|
|
24
|
-
- the host change feed (`REPORTING_LEDGER_CHANGES_MIGRATION`, change records and cursors);
|
|
25
|
-
- managed delivery (the runtime, the store, the adapter contract, the adapter router and the PostgreSQL store);
|
|
26
|
-
- notification activity stores and checkpoints;
|
|
27
|
-
- the store, transaction, lease and row-read interfaces in `ledger/types`.
|
|
28
|
-
|
|
29
|
-
Within `@adcp/sdk/reporting/service`, the experimental exports are `ReportingRetentionOptionsV1`, `ReportingCompactionOptionsV1`, `ReportingChangeFeedMaintenanceOptionsV1`, `runReportingLedgerMaintenance` and the related maintenance types and error.
|
|
24
|
+
**Storage-facing building blocks in `@adcp/sdk`.** A few exports exist so a store can be written against public API only, and they are covered by the same policy even where their TSDoc is silent: the schedule, instant and evidence helpers on `@adcp/sdk/reporting/ledger` (`compareReportingInstants`, `reportingPeriodDate`, `reportingPeriodSchedule`, `isFrozenCalendarRulesMismatch`, the receipt and verification evidence guards, `isWellFormedUnicodeString`, `getReportingDeliveryOfferingValidatorV1`), and the scheduler primitives and `REPORTING_MANAGED_DELIVERY_COMPOSITION_V1` on `@adcp/sdk/reporting/service`. Application code should not depend on them.
|
|
30
25
|
|
|
31
26
|
### Not experimental
|
|
32
27
|
|
|
33
|
-
These follow normal semver. A breaking change to them ships in a major release
|
|
28
|
+
These follow normal semver. A breaking change to them ships in a major release of `@adcp/sdk`.
|
|
34
29
|
|
|
35
30
|
- The protocol-facing handlers: `createReportingDeliveryHandler`, `createReportingStatusHandler`, `createSyncReportingStatusHandler`, `createSyncReportingReceiptsHandler`, and the status-ingest request and response schemas.
|
|
36
31
|
- `createReportingProducer`, `assertSupportedReportingAuthoritativeParty` and `UnsupportedReportingFeatureError`.
|
|
37
|
-
- The health, coverage, lifecycle, schedule and consumer-status-identity helpers in `@adcp/sdk/reporting/ledger
|
|
38
|
-
- `createReliableReportingService`, `
|
|
32
|
+
- The health, coverage, lifecycle, schedule and consumer-status-identity helpers in `@adcp/sdk/reporting/ledger`, and the canonical row encoding and digests (`row-encoding`) with their golden fixtures.
|
|
33
|
+
- `createReliableReportingService`, its `maintenance` hook and the service conformance runner in `@adcp/sdk/reporting/service`.
|
|
39
34
|
- `@adcp/sdk/reporting/consumer` (buyer reconciliation and worker) and `@adcp/sdk/reporting/source` (source contract and executor). They are separate subpaths with their own `V1` contract suffixes and are not covered by this policy.
|
|
40
35
|
|
|
41
36
|
If you are unsure about a symbol, read its TSDoc. An `@experimental` tag means it is covered. No tag means it is not.
|
|
42
37
|
|
|
43
38
|
## What "experimental" means
|
|
44
39
|
|
|
45
|
-
- **Breaking changes may ship in minor releases
|
|
40
|
+
- **Breaking changes may ship in minor releases of `@adcp/reporting-storage`.** That covers signatures, option names, stored field and column names, migrations, and defaults. While the package is `0.x`, a minor bump (`0.1` to `0.2`) is the one that may break.
|
|
46
41
|
- **Every such change is announced.** The changeset describes the break and includes a migration note, and the release notes carry it. Larger changes also get a `docs/migration-*.md` walkthrough.
|
|
47
|
-
- **The wire protocol is not affected.** Buyer-visible behavior
|
|
42
|
+
- **The wire protocol is not affected.** Buyer-visible behavior the package implements (reporting delivery, `revision_content_sha256`, status, receipts and so on) follows AdCP's own versioning, not this policy. A change to the storage layout does not change what a buyer sees.
|
|
48
43
|
- **Security and correctness fixes are not held back.** If a fix needs a breaking change, it ships in a minor.
|
|
49
44
|
|
|
45
|
+
## How the two packages line up
|
|
46
|
+
|
|
47
|
+
`@adcp/reporting-storage` declares `@adcp/sdk` as a **peer dependency** (`^16.0.0-beta.0` while SDK 16 is in beta), not a dependency. The store, its errors and the handlers share types and symbol-keyed guards, so the host must hold one copy of `@adcp/sdk`. A change to a storage interface in the SDK ships with a matching storage release; the changeset for each says which pair to install. The cloud SDKs (`@aws-sdk/client-s3`, `@azure/storage-blob`, `@google-cloud/storage`) are optional peers of the storage package. `@adcp/sdk` does not import `@adcp/reporting-storage`, and a test and a lint rule keep it that way.
|
|
48
|
+
|
|
50
49
|
## How to pin
|
|
51
50
|
|
|
52
|
-
|
|
51
|
+
Pin the storage package with a tilde range. A caret range on a `0.x` version already stops at the next minor, but `~` states the intent and survives the move to `1.0`.
|
|
53
52
|
|
|
54
53
|
```json
|
|
55
54
|
{
|
|
56
55
|
"dependencies": {
|
|
57
|
-
"@adcp/sdk": "
|
|
56
|
+
"@adcp/sdk": "^16.0.0-beta.0",
|
|
57
|
+
"@adcp/reporting-storage": "~0.1.0-beta.0"
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
Those are the beta pins. A prerelease range such as `~0.1.0` does not match `0.1.0-beta.0`, so use the `-beta.0` form until stable releases exist, then move to `^16.0.0` and `~0.1.0`.
|
|
63
|
+
|
|
64
|
+
- `~0.1.0` (after the first stable release) takes patches only (recommended).
|
|
65
|
+
- An exact version (`"0.1.0-beta.0"`) is stricter still.
|
|
64
66
|
- Read the changelog before widening to a new minor, and apply any migration it names.
|
|
65
67
|
|
|
66
|
-
|
|
68
|
+
`@adcp/sdk` itself can use a caret range as usual, because the SDK's own surface follows semver. While SDK 16 is in beta, install both packages with the `beta` dist-tag (`npm install @adcp/sdk@beta @adcp/reporting-storage@beta`) until stable releases exist.
|
|
67
69
|
|
|
68
70
|
## Migrations
|
|
69
71
|
|
|
70
|
-
Database migrations exported
|
|
72
|
+
Database migrations exported by `@adcp/reporting-storage` (`REPORTING_LEDGER_MIGRATION`, `REPORTING_ROW_STORAGE_MIGRATION` and the others) stay idempotent where practical, and a changeset says when you must re-apply one. See [Reliable Reporting production operations](REPORTING-OPERATIONS.md) and the [ledger guide](REPORTING-LEDGER.md).
|
|
73
|
+
|
|
74
|
+
Coming from the single-package layout (`@adcp/sdk/reporting/ledger`, `/gcs`, `/s3`, `/azure`, `/bigquery`)? See [Reliable Reporting storage moved to `@adcp/reporting-storage`](../migration-reporting-storage-package.md).
|
|
71
75
|
|
|
72
76
|
## When this will change
|
|
73
77
|
|
|
74
|
-
The surface is expected to stabilize after the first production adopter runs on SDK 16 stable. At that point the `@experimental` tags are removed in
|
|
78
|
+
The surface is expected to stabilize after the first production adopter runs on SDK 16 stable. At that point `@adcp/reporting-storage` moves to `1.0.0` and the `@experimental` tags are removed in that release with a changelog note. Breaking changes need a major release from then on.
|
|
75
79
|
|
|
76
80
|
Related: [Seller reporting ledger](REPORTING-LEDGER.md), [Reliable Reporting production operations](REPORTING-OPERATIONS.md).
|
package/docs/llms.txt
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Ad Context Protocol (AdCP)
|
|
2
2
|
|
|
3
|
-
> Generated at: 2026-10-
|
|
4
|
-
> Library: @adcp/sdk v16.0.0-beta.
|
|
3
|
+
> Generated at: 2026-10-16
|
|
4
|
+
> Library: @adcp/sdk v16.0.0-beta.4
|
|
5
5
|
> AdCP major version: 3
|
|
6
6
|
> Canonical URL: https://adcontextprotocol.github.io/adcp-client/llms.txt
|
|
7
7
|
> Note: the `Library` stamp reflects the package.json version at doc-generation time. The narrative below describes the surface that lands on the next-published minor — including any 6.7 helpers documented here ahead of the release tag.
|
|
@@ -2126,6 +2126,7 @@ These docs are available locally in the repo and hosted at https://adcontextprot
|
|
|
2126
2126
|
| Seller quick start (AdCP 3.2) | docs/guides/SELLER-QUICKSTART-3.2.md | [link](https://adcontextprotocol.github.io/adcp-client/guides/SELLER-QUICKSTART-3.2.md) |
|
|
2127
2127
|
| Production durability checklist | docs/guides/PRODUCTION-DURABILITY.md | [link](https://adcontextprotocol.github.io/adcp-client/guides/PRODUCTION-DURABILITY.md) |
|
|
2128
2128
|
| Persistent notification subscriptions | docs/guides/PERSISTENT-NOTIFICATION-RUNTIME.md | [link](https://adcontextprotocol.github.io/adcp-client/guides/PERSISTENT-NOTIFICATION-RUNTIME.md) |
|
|
2129
|
+
| Reliable Reporting storage moved to @adcp/reporting-storage (SDK 16 beta) | docs/migration-reporting-storage-package.md | [link](https://adcontextprotocol.github.io/adcp-client/migration-reporting-storage-package.md) |
|
|
2129
2130
|
| Migrating SDK 13 → 14 | docs/migration-13-to-14.md | [link](https://adcontextprotocol.github.io/adcp-client/migration-13-to-14.md) |
|
|
2130
2131
|
| Getting started / install | docs/getting-started.md | [link](https://adcontextprotocol.github.io/adcp-client/getting-started.md) |
|
|
2131
2132
|
| Build a server-side agent | docs/guides/BUILD-AN-AGENT.md | [link](https://adcontextprotocol.github.io/adcp-client/guides/BUILD-AN-AGENT.md) |
|
|
@@ -2143,7 +2144,7 @@ These docs are available locally in the repo and hosted at https://adcontextprot
|
|
|
2143
2144
|
| Reporting ledger cutover from custom tables | docs/guides/REPORTING-LEDGER-CUTOVER.md | [link](https://adcontextprotocol.github.io/adcp-client/guides/REPORTING-LEDGER-CUTOVER.md) |
|
|
2144
2145
|
| Buyer reporting reconciliation | docs/guides/REPORTING-RECONCILIATION.md | [link](https://adcontextprotocol.github.io/adcp-client/guides/REPORTING-RECONCILIATION.md) |
|
|
2145
2146
|
| Reliable Reporting production operations | docs/guides/REPORTING-OPERATIONS.md | [link](https://adcontextprotocol.github.io/adcp-client/guides/REPORTING-OPERATIONS.md) |
|
|
2146
|
-
| Reliable Reporting stability policy (experimental storage
|
|
2147
|
+
| Reliable Reporting stability policy (experimental storage package) | docs/guides/REPORTING-STABILITY.md | [link](https://adcontextprotocol.github.io/adcp-client/guides/REPORTING-STABILITY.md) |
|
|
2147
2148
|
| Validate your agent (5-command checklist) | docs/guides/VALIDATE-YOUR-AGENT.md | [link](https://adcontextprotocol.github.io/adcp-client/guides/VALIDATE-YOUR-AGENT.md) |
|
|
2148
2149
|
| Async patterns (polling, webhooks, deferred) | docs/guides/ASYNC-DEVELOPER-GUIDE.md | [link](https://adcontextprotocol.github.io/adcp-client/guides/ASYNC-DEVELOPER-GUIDE.md) |
|
|
2149
2150
|
| Async API reference | docs/guides/ASYNC-API-REFERENCE.md | [link](https://adcontextprotocol.github.io/adcp-client/guides/ASYNC-API-REFERENCE.md) |
|
|
@@ -11,8 +11,8 @@ below as the publication/deployment gate.
|
|
|
11
11
|
|
|
12
12
|
| Fact | Value |
|
|
13
13
|
| --- | --- |
|
|
14
|
-
| Exact npm package | `@adcp/sdk@16.0.0-beta.
|
|
15
|
-
| npm integrity | registry-derived after publication; run `npm view @adcp/sdk@16.0.0-beta.
|
|
14
|
+
| Exact npm package | `@adcp/sdk@16.0.0-beta.4` |
|
|
15
|
+
| npm integrity | registry-derived after publication; run `npm view @adcp/sdk@16.0.0-beta.4 dist.integrity` |
|
|
16
16
|
| Node.js runtime | `^20.19.0 || >=22.12.0` |
|
|
17
17
|
| Default AdCP wire release | `3.2.4` |
|
|
18
18
|
| Maintained wire releases | `v2.5`, `v2.6`, `v3`, `3.0.0`, `3.0`, `3.0.1`, `3.0.2`, `3.0.3`, `3.0.4`, `3.0.5`, `3.0.6`, `3.0.7`, `3.0.8`, `3.0.9`, `3.0.10`, `3.0.11`, `3.0.12`, `3.0.13`, `3.0.14`, `3.0.15`, `3.0.16`, `3.0.17`, `3.0.18`, `3.0.19`, `3.0.20`, `3.0.21`, `3.0.22`, `3.0.23`, `3.0.24`, `3.0.25`, `3.1.0`, `3.1`, `3.1.1`, `3.1.2`, `3.1.3`, `3.1.4`, `3.1.5`, `3.1.6`, `3.1.7`, `3.1.8`, `3.1.9`, `3.1.10`, `3.1.11`, `3.1.12`, `3.1.13`, `3.1.14`, `3.1.15`, `3.1.16`, `3.1.17`, `3.1.18`, `3.1.19`, `3.1.20`, `3.1.21`, `3.1.22`, `3.1.23`, `3.1.24`, `3.2.1`, `3.2`, `3.2.2`, `3.2.3`, `3.2.4` |
|
|
@@ -21,8 +21,8 @@ below as the publication/deployment gate.
|
|
|
21
21
|
Install exact production inputs rather than a moving range or dist-tag:
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
npm install --save-exact '@adcp/sdk@16.0.0-beta.
|
|
25
|
-
npm view '@adcp/sdk@16.0.0-beta.
|
|
24
|
+
npm install --save-exact '@adcp/sdk@16.0.0-beta.4'
|
|
25
|
+
npm view '@adcp/sdk@16.0.0-beta.4' dist.integrity
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
### Required and optional peers
|
|
@@ -32,9 +32,6 @@ Install the peer packages used by your application at versions satisfying these
|
|
|
32
32
|
| Peer | Supported range | Installation |
|
|
33
33
|
| --- | --- | --- |
|
|
34
34
|
| `@a2a-js/sdk` | `^1.0.1` | Required |
|
|
35
|
-
| `@aws-sdk/client-s3` | `^3.700.0` | Optional |
|
|
36
|
-
| `@azure/storage-blob` | `^12.23.0` | Optional |
|
|
37
|
-
| `@google-cloud/storage` | `^7.22.0 || ^8.2.0` | Optional |
|
|
38
35
|
| `@modelcontextprotocol/sdk` | `^1.31.0` | Required |
|
|
39
36
|
| `@opentelemetry/api` | `^1.0.0` | Optional |
|
|
40
37
|
| `redis` | `^4.6.0 || ^5.0.0 || ^6.0.0` | Optional |
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# Reliable Reporting storage moved to `@adcp/reporting-storage`
|
|
2
|
+
|
|
3
|
+
**Applies to:** SDK 16 beta. **Kind:** breaking, by design. There are no re-export shims: the moved subpaths are gone from `@adcp/sdk`.
|
|
4
|
+
|
|
5
|
+
The Reliable Reporting storage implementations now ship as their own package, `@adcp/reporting-storage`, on its own version line. `@adcp/sdk` keeps the protocol layer. If you import anything from `@adcp/sdk/reporting/gcs`, `/s3`, `/azure` or `/bigquery`, or the PostgreSQL store, row storage, managed delivery or notification activity from `@adcp/sdk/reporting/ledger`, or `createPostgresReliableReportingProductionService` from `@adcp/sdk/reporting/service`, change those imports. Nothing else changes on the wire, in the database schema, or in the ledger's behavior.
|
|
6
|
+
|
|
7
|
+
Why: storage keeps its own release cadence, as Auth.js, LangGraph and OpenTelemetry do, so a storage fix does not need an SDK release and an experimental storage break does not need an SDK major. The Python SDK is making the same split (adcp-client-python#1510). See [Reliable Reporting stability policy](guides/REPORTING-STABILITY.md).
|
|
8
|
+
|
|
9
|
+
## What to do
|
|
10
|
+
|
|
11
|
+
1. Install the package next to the SDK. `@adcp/sdk` is a peer dependency of it, so the host keeps exactly one copy:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @adcp/sdk@beta @adcp/reporting-storage@beta
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Pin the storage package with `~` (`"@adcp/reporting-storage": "~0.1.0-beta.0"` while SDK 16 is in beta, `"~0.1.0"` after a stable release; a prerelease version is not matched by `~0.1.0`): it is pre-1.0 and every export is experimental. The cloud SDKs are optional peers of the new package, not of `@adcp/sdk` any more, so keep `@aws-sdk/client-s3`, `@azure/storage-blob` and `@google-cloud/storage` in your own dependencies for the providers you use.
|
|
18
|
+
|
|
19
|
+
2. Change the imports using the table below, then run `tsc --noEmit`. A moved name on `@adcp/sdk/reporting/ledger` or `/service` is `TS2305: Module '"@adcp/sdk/reporting/ledger"' has no exported member 'PostgresReportingLedgerStore'`; a deleted subpath is `TS2307: Cannot find module '@adcp/sdk/reporting/gcs'`. At runtime the deleted subpaths fail with `ERR_PACKAGE_PATH_NOT_EXPORTED`, and a stale CommonJS `require` of a moved name on a kept subpath destructures to `undefined` and fails later as `X is not a constructor`, so grep JavaScript too (see [Self-grade](#self-grade)).
|
|
20
|
+
|
|
21
|
+
3. If you pass `maintenance` to `createReliableReportingService`, wrap it (see [`maintenance` is now a factory](#maintenance-is-now-a-factory)).
|
|
22
|
+
|
|
23
|
+
4. Re-run your own tests. No database migration is needed: every migration constant has the same SQL under its new import path.
|
|
24
|
+
|
|
25
|
+
## Import mapping
|
|
26
|
+
|
|
27
|
+
| Old import | New import |
|
|
28
|
+
| -------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
|
|
29
|
+
| `@adcp/sdk/reporting/ledger`: `PostgresReportingLedgerStore`, the ledger, row-storage, object-write and change-feed migrations, `sweepExpiredReportingLedgerState`, row storage (`ReportingRowStorageV1`, bindings, providers contract, filesystem provider, conformance suite), object writes, the change feed | `@adcp/reporting-storage` |
|
|
30
|
+
| `@adcp/sdk/reporting/ledger`: the managed-delivery runtime, `PostgresReportingManagedDeliveryStore`, `REPORTING_MANAGED_DELIVERY_MIGRATION`, the adapter contract and router | `@adcp/reporting-storage/managed` |
|
|
31
|
+
| `@adcp/sdk/reporting/ledger`: notification activity (`createPostgresReportingNotificationActivityRuntime`, `createPostgresReportingNotificationAttemptCheckpoint`, `REPORTING_NOTIFICATION_ACTIVITY_MIGRATION`) | `@adcp/reporting-storage/notifications` |
|
|
32
|
+
| `@adcp/sdk/reporting/ledger`: everything else (the `ReportingLedgerStore` interface and its types, `createReportingDeliveryHandler`, `createReportingStatusHandler`, `createSyncReportingStatusHandler`, `createReportingProducer`, health, coverage, lifecycle, row encoding and digests, `ReportingRowStoreError`) | unchanged: `@adcp/sdk/reporting/ledger` |
|
|
33
|
+
| `@adcp/sdk/reporting/service`: `createPostgresReliableReportingProductionService` and its types | `@adcp/reporting-storage/service` |
|
|
34
|
+
| `@adcp/sdk/reporting/service`: retention, compaction, orphan-collection and change-feed maintenance (`runReportingLedgerMaintenance`, `ReportingRetentionOptionsV1`, `ReportingCompactionOptionsV1`, `ReportingMaintenancePartialFailureError`, and the related types); `ReliableReportingMaintenanceOptionsV1` is now `ReportingLedgerMaintenanceOptionsV1` | `@adcp/reporting-storage` |
|
|
35
|
+
| `@adcp/sdk/reporting/service`: `createReliableReportingService`, the conformance runner | unchanged: `@adcp/sdk/reporting/service` |
|
|
36
|
+
| `@adcp/sdk/reporting/gcs` | `@adcp/reporting-storage/gcs` |
|
|
37
|
+
| `@adcp/sdk/reporting/s3` | `@adcp/reporting-storage/s3` |
|
|
38
|
+
| `@adcp/sdk/reporting/azure` | `@adcp/reporting-storage/azure` |
|
|
39
|
+
| `@adcp/sdk/reporting/bigquery` | `@adcp/reporting-storage/bigquery` |
|
|
40
|
+
| `@adcp/sdk/reporting/consumer`, `@adcp/sdk/reporting/source`, `@adcp/sdk` | unchanged |
|
|
41
|
+
|
|
42
|
+
Before and after:
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
// Before
|
|
46
|
+
import {
|
|
47
|
+
PostgresReportingLedgerStore,
|
|
48
|
+
REPORTING_LEDGER_MIGRATION,
|
|
49
|
+
createReportingProducer,
|
|
50
|
+
} from '@adcp/sdk/reporting/ledger';
|
|
51
|
+
import { createGcsReportingRowObjectProviderV1 } from '@adcp/sdk/reporting/gcs';
|
|
52
|
+
|
|
53
|
+
// After
|
|
54
|
+
import { createReportingProducer } from '@adcp/sdk/reporting/ledger';
|
|
55
|
+
import { PostgresReportingLedgerStore, REPORTING_LEDGER_MIGRATION } from '@adcp/reporting-storage';
|
|
56
|
+
import { createGcsReportingRowObjectProviderV1 } from '@adcp/reporting-storage/gcs';
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Every moved export, by new subpath
|
|
60
|
+
|
|
61
|
+
<details>
|
|
62
|
+
<summary>84 exports of <code>@adcp/reporting-storage</code></summary>
|
|
63
|
+
|
|
64
|
+
`FilesystemReportingRowObjectProviderOptionsV1`, `PostgresReportingLedgerStore`, `PostgresReportingLedgerStoreOptions`, `REPORTING_LEDGER_CHANGES_MIGRATION`, `REPORTING_LEDGER_FINALITY_FENCE_CONSTRAINT`, `REPORTING_LEDGER_FINALITY_WRITER_FENCE_MIGRATION`, `REPORTING_LEDGER_MIGRATION`, `REPORTING_OBJECT_WRITE_AUTHORITY_MIGRATION`, `REPORTING_OBJECT_WRITE_MIGRATION`, `REPORTING_ROW_DEFAULT_KEY_TEMPLATE`, `REPORTING_ROW_KEY_PLACEHOLDERS`, `REPORTING_ROW_NATIVE_VERSION_REF_MAX_LENGTH`, `REPORTING_ROW_OBJECT_REF_MAX_LENGTH`, `REPORTING_ROW_STORAGE_MIGRATION`, `REPORTING_ROW_STORAGE_TABLES`, `ReportingChangeCursorExpiredError`, `ReportingChangeFeedMaintenanceOptionsV1`, `ReportingChangeKindV1`, `ReportingChangeRecordV1`, `ReportingChangesPageV1`, `ReportingCompactionOptionsV1`, `ReportingLedgerMaintenanceOptionsV1`, `ReportingLedgerMaintenanceStoreV1`, `ReportingLedgerMaintenanceTaskNameV1`, `ReportingLedgerMaintenanceTaskResultV1`, `ReportingMaintenancePartialFailureError`, `ReportingObjectRowBindingV1`, `ReportingObjectWriteAuthorityStoreV1`, `ReportingObjectWriteBindingV1`, `ReportingObjectWriteConflictError`, `ReportingObjectWriteContextV1`, `ReportingObjectWriteCursorV1`, `ReportingObjectWriteNotRevokedError`, `ReportingObjectWritePlanV1`, `ReportingObjectWriteScopeV1`, `ReportingObjectWriteStoreV1`, `ReportingObjectWriteV1`, `ReportingOrphanBindingResultV1`, `ReportingOrphanCollectionOptionsV1`, `ReportingOrphanCollectionResultV1`, `ReportingOrphanCollectionStateV1`, `ReportingPgPool`, `ReportingPostgresRowBindingV1`, `ReportingPreparedRowSetV1`, `ReportingRetentionOptionsV1`, `ReportingRowBindingDefinitionV1`, `ReportingRowBindingSelectionInputV1`, `ReportingRowChunkLocatorV1`, `ReportingRowObjectContextV1`, `ReportingRowObjectDeleteInputV1`, `ReportingRowObjectGetInputV1`, `ReportingRowObjectListEntryV1`, `ReportingRowObjectListInputV1`, `ReportingRowObjectLocationV1`, `ReportingRowObjectProviderV1`, `ReportingRowObjectPutInputV1`, `ReportingRowObjectStatInputV1`, `ReportingRowSetHandleV1`, `ReportingRowSetPrepareInputV1`, `ReportingRowStorageOptionsV1`, `ReportingRowStorageV1`, `RunReportingLedgerMaintenanceInputV1`, `assertReportingLedgerMaintenanceOptions`, `assertReportingObjectWriteScope`, `assertReportingRowKeyTemplateV1`, `assertReportingRowPrefixV1`, `createFilesystemReportingRowObjectProviderV1`, `decodeReportingChangeCursorV1`, `encodeReportingChangeCursorV1`, `isLegacyAccountChangeCursor`, `isReportingObjectWriteConflictError`, `isReportingObjectWriteNotRevokedError`, `probeReportingRowStorageSchemaV1`, `renderReportingRowObjectKeyV1`, `reportingLedgerMaintenance`, `reportingObjectWriteName`, `reportingObjectWritePlanFingerprint`, `reportingObjectWriteScopeKey`, `reportingRowAccountKeyV1`, `reportingRowRevisionKeyV1`, `reportingRowWriteIntentIdV1`, `runReportingLedgerMaintenance`, `runReportingRowObjectProviderConformanceV1`, `sweepExpiredReportingLedgerState`
|
|
65
|
+
|
|
66
|
+
</details>
|
|
67
|
+
|
|
68
|
+
<details>
|
|
69
|
+
<summary>35 exports of <code>@adcp/reporting-storage/managed</code></summary>
|
|
70
|
+
|
|
71
|
+
`CreateReportingManagedDeliveryAdapterRouterOptionsV1`, `CreateReportingManagedDeliveryRuntimeOptionsV1`, `PostgresReportingManagedDeliveryStore`, `PostgresReportingManagedDeliveryStoreOptions`, `REPORTING_ADAPTER_PROBE_DEADLINE_MILLISECONDS_V1`, `REPORTING_DESTINATION_PATTERNS_V1`, `REPORTING_DESTINATION_TRANSPORT_PATTERN_V1`, `REPORTING_MANAGED_DELIVERY_MIGRATION`, `ReportingDestinationAuthorizationV1`, `ReportingDestinationPatternV1`, `ReportingDestinationRevocationLeaseV1`, `ReportingManagedDeliveryAdapterRouterV1`, `ReportingManagedDeliveryAdapterV1`, `ReportingManagedDeliveryAdvertisedPoliciesV1`, `ReportingManagedDeliveryLeaseV1`, `ReportingManagedDeliveryProbeErrorV1`, `ReportingManagedDeliveryRouteCountsV1`, `ReportingManagedDeliveryRouteDescriptionV1`, `ReportingManagedDeliveryRouteV1`, `ReportingManagedDeliveryRoutingErrorCodeV1`, `ReportingManagedDeliveryRoutingErrorV1`, `ReportingManagedDeliveryRoutingOperationV1`, `ReportingManagedDeliveryRuntimeV1`, `ReportingManagedDeliveryStore`, `ReportingManagedDeliveryWorkerOptionsV1`, `ReportingManagedDeliveryWorkerResultV1`, `UNROUTED_REPORTING_ROUTE_KEY_V1`, `adjustmentReceiptEvidenceMatches`, `assertCredentialFreeReportingResourceLocationV1`, `assertMaterializationOutcome`, `createReportingManagedDeliveryAdapterRouterV1`, `createReportingManagedDeliveryRuntime`, `readManagedReportingResource`, `receiptEvidenceMatches`, `runManagedDeliveryWorker`
|
|
72
|
+
|
|
73
|
+
</details>
|
|
74
|
+
|
|
75
|
+
<details>
|
|
76
|
+
<summary>20 exports of <code>@adcp/reporting-storage/notifications</code></summary>
|
|
77
|
+
|
|
78
|
+
`PostgresReportingNotificationActivityOptions`, `PostgresReportingNotificationActivityRuntime`, `REPORTING_NOTIFICATION_ACTIVITY_MIGRATION`, `ReportingAccountActivityPageV1`, `ReportingAccountActivityRecordV1`, `ReportingAccountActivityV1`, `ReportingDeliveryReadyActivityV1`, `ReportingLedgerChangedActivityV1`, `ReportingLifecycleActivityV1`, `ReportingNotificationActivityPageV1`, `ReportingNotificationActivityRecordV1`, `ReportingNotificationActivityV1`, `ReportingNotificationAttemptCheckpointV1`, `ReportingNotificationProjectionErrorV1`, `ReportingNotificationRecoveryMetricsV1`, `ReportingNotificationRetryableSuppressionError`, `createPostgresReportingNotificationActivityRuntime`, `createPostgresReportingNotificationAttemptCheckpoint`, `getReportingNotificationActivityMigration`, `recipientTableName`
|
|
79
|
+
|
|
80
|
+
</details>
|
|
81
|
+
|
|
82
|
+
<details>
|
|
83
|
+
<summary>3 exports of <code>@adcp/reporting-storage/service</code></summary>
|
|
84
|
+
|
|
85
|
+
`CreatePostgresReliableReportingProductionServiceOptionsV1`, `PostgresReliableReportingProductionServiceV1`, `createPostgresReliableReportingProductionService`
|
|
86
|
+
|
|
87
|
+
</details>
|
|
88
|
+
|
|
89
|
+
<details>
|
|
90
|
+
<summary>13 exports of <code>@adcp/reporting-storage/gcs</code></summary>
|
|
91
|
+
|
|
92
|
+
`CreateGcsReportingManagedDeliveryAdapterOptionsV1`, `CreateGcsReportingRowObjectProviderOptionsV1`, `GcsReportingObjectFenceV1`, `GcsReportingReadAuthorizationV1`, `GcsReportingReadScopeV1`, `GcsReportingReaderOptionsV1`, `ReportingGcsFenceError`, `createGcsReportingManagedDeliveryAdapterV1`, `createGcsReportingObjectFenceV1`, `createGcsReportingReferenceResolverV1`, `createGcsReportingResourceReaderV1`, `createGcsReportingRowObjectProviderV1`, `isReportingGcsFenceError`
|
|
93
|
+
|
|
94
|
+
</details>
|
|
95
|
+
|
|
96
|
+
<details>
|
|
97
|
+
<summary>2 exports of <code>@adcp/reporting-storage/s3</code></summary>
|
|
98
|
+
|
|
99
|
+
`CreateS3ReportingRowObjectProviderOptionsV1`, `createS3ReportingRowObjectProviderV1`
|
|
100
|
+
|
|
101
|
+
</details>
|
|
102
|
+
|
|
103
|
+
<details>
|
|
104
|
+
<summary>2 exports of <code>@adcp/reporting-storage/azure</code></summary>
|
|
105
|
+
|
|
106
|
+
`CreateAzureBlobReportingRowObjectProviderOptionsV1`, `createAzureBlobReportingRowObjectProviderV1`
|
|
107
|
+
|
|
108
|
+
</details>
|
|
109
|
+
|
|
110
|
+
<details>
|
|
111
|
+
<summary>10 exports of <code>@adcp/reporting-storage/bigquery</code></summary>
|
|
112
|
+
|
|
113
|
+
`BigQueryReportingWarehouseSinkV1`, `CreateBigQueryReportingWarehouseSinkOptionsV1`, `REPORTING_WAREHOUSE_SINK_MIGRATION`, `ReportingBigQueryClientV1`, `ReportingWarehouseRowContextV1`, `createBigQueryReportingWarehouseSinkV1`, `reportingWarehouseCurrentRowsViewSqlV1`, `reportingWarehouseDefaultTablesSqlV1`, `reportingWarehouseJobIdV1`, `reportingWarehouseLoadDeadlineV1`
|
|
114
|
+
|
|
115
|
+
</details>
|
|
116
|
+
|
|
117
|
+
## Behavior changes
|
|
118
|
+
|
|
119
|
+
### `maintenance` is now a factory
|
|
120
|
+
|
|
121
|
+
The SDK does not know what maintenance a store needs, and retention, compaction and orphan collection are about the PostgreSQL store's data model. So `createReliableReportingService({ maintenance })` takes a factory, and `@adcp/reporting-storage` supplies the PostgreSQL one:
|
|
122
|
+
|
|
123
|
+
```ts
|
|
124
|
+
// Before
|
|
125
|
+
createReliableReportingService({
|
|
126
|
+
store,
|
|
127
|
+
maintenance: { retention: { enabled: true }, changeFeed: true },
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
// After
|
|
131
|
+
import { reportingLedgerMaintenance } from '@adcp/reporting-storage';
|
|
132
|
+
|
|
133
|
+
createReliableReportingService({
|
|
134
|
+
store,
|
|
135
|
+
maintenance: reportingLedgerMaintenance({ retention: { enabled: true }, changeFeed: true }),
|
|
136
|
+
});
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Passing the old options object now fails at construction with `maintenance must be a factory, not an options object` (and in TypeScript as `Type '{ retention: ... }' provides no match for the signature '(context: ReliableReportingMaintenanceContextV1): ReliableReportingMaintenanceV1'`). The options are unchanged. The service still hands the factory the retention and recovery-window commitments it advertises, so retention still cannot disagree with what buyers were told, and a configuration the store cannot serve still fails when the service is constructed, not on the first scheduled pass. `service.runMaintenance()` returns the same per-task results, typed as `ReliableReportingMaintenanceTaskResultV1` (`{ task, status, result | error, partialFailure? }`). A store from another package can supply its own factory. `createPostgresReliableReportingProductionService` is unchanged: it takes `retention`, `compaction`, `changeFeed` and `orphanCollection` directly.
|
|
140
|
+
|
|
141
|
+
### `service.setup.migrations` comes from the store
|
|
142
|
+
|
|
143
|
+
`createReliableReportingService` no longer names the PostgreSQL migration. `service.setup.migrations` is the store's own `migrations` list (`ReportingLedgerStore.migrations`, optional). `PostgresReportingLedgerStore` lists `[REPORTING_LEDGER_MIGRATION]`. A store with nothing to install (an in-memory test double), or a decorator over the PostgreSQL store that does not forward `migrations`, gives an empty list.
|
|
144
|
+
|
|
145
|
+
The type changed too: it was the tuple `readonly [typeof REPORTING_LEDGER_MIGRATION]` and is now `readonly string[]`, so `reporting.setup.migrations[0]` is `string | undefined` under `noUncheckedIndexedAccess`, and `pool.query(undefined)` fails at runtime for a store that lists nothing. Apply the list instead:
|
|
146
|
+
|
|
147
|
+
```ts
|
|
148
|
+
for (const sql of reporting.setup.migrations) await pool.query(sql);
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Error classes now live with the interface
|
|
152
|
+
|
|
153
|
+
`ReportingLedgerLeaseLostError`, `ReportingLedgerPeriodRetiredError` and `ReportingLedgerContinuityError` are exported from `@adcp/sdk/reporting/ledger`, where the `ReportingLedgerStore` types are. The package re-throws these exact classes. The protocol layer still recognizes them by `name`, so a store from any package, or another copy of the SDK, is understood.
|
|
154
|
+
|
|
155
|
+
### The Core service refuses managed-delivery offerings
|
|
156
|
+
|
|
157
|
+
A `createReliableReportingService` without a managed-delivery composition still refuses offerings that need Managed Delivery or Reconciled Billing, now naming `@adcp/reporting-storage/service` in the error. A composition built elsewhere opts in with the exported `REPORTING_MANAGED_DELIVERY_COMPOSITION_V1` key, set to the very `store` it passes as `store`. That is an assertion by the composer, not an authentication boundary (the key is a `Symbol.for`, so any code can write it); it exists so a Core-only service cannot advertise offerings it has no runtime for by accident. Applications should not use it.
|
|
158
|
+
|
|
159
|
+
### New exports on `@adcp/sdk`
|
|
160
|
+
|
|
161
|
+
So a store can live outside the SDK against public API only: `compareReportingInstants`, `reportingPeriodDate`, `reportingPeriodSchedule`, `isFrozenCalendarRulesMismatch`, the receipt and verification evidence guards, `isWellFormedUnicodeString` and `getReportingDeliveryOfferingValidatorV1` (from `@adcp/sdk/reporting/ledger`); `reportingManagedDeliveryBindingV1`, `createSyncReportingReceiptsHandler`, `ReportingReceiptSyncStoreV1` and `SyncReportingReceiptsParamsV1` (from `@adcp/sdk/reporting/ledger`; the receipts handler only needs `syncReceiptBatch`); the scheduler helpers `reportingSchedulerErrorMessage`, `reportingSchedulerDelay`, `rotateReportingRoster`, `reportingDeploymentWideAccountIds`, `reportReportingSchedulerError` and `warnReportingSchedulerFailure` (from `@adcp/sdk/reporting/service`); and `DEFAULT_UNKNOWN_ERROR_RECOVERY` (from `@adcp/sdk`).
|
|
162
|
+
|
|
163
|
+
## Other things that moved
|
|
164
|
+
|
|
165
|
+
| Was | Now |
|
|
166
|
+
| ------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
167
|
+
| `scripts/validate-reporting-gcp.mjs` | `packages/reporting-storage/scripts/validate-reporting-gcp.mjs` (`npm run validate:reporting-gcp` still works at the repository root) |
|
|
168
|
+
| `examples/reliable-reporting-lifecycle`, `examples/reliable-reporting-service` | `packages/reporting-storage/examples/...` |
|
|
169
|
+
| Optional peers `@aws-sdk/client-s3`, `@azure/storage-blob`, `@google-cloud/storage` on `@adcp/sdk` | optional peers of `@adcp/reporting-storage` |
|
|
170
|
+
| Experimental policy for `reporting/gcs`, `s3`, `azure`, `bigquery` and the storage exports of `ledger` and `service` | the whole `@adcp/reporting-storage` package is pre-1.0 and experimental; see [REPORTING-STABILITY.md](guides/REPORTING-STABILITY.md) |
|
|
171
|
+
|
|
172
|
+
The consumer-side Postgres persistence (`createPostgresReportingConsumerRuntimeV1`, `REPORTING_CONSUMER_POSTGRES_MIGRATION` under `@adcp/sdk/reporting/consumer`) and webhook activity (`createPostgresReportingWebhookActivityV1`, exported from `@adcp/sdk`) stay in the SDK for now.
|
|
173
|
+
|
|
174
|
+
## Self-grade
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
# 1. no deleted subpath
|
|
178
|
+
grep -rnE "@adcp/sdk/reporting/(gcs|s3|azure|bigquery)" src
|
|
179
|
+
# 2. in every file that still imports the ledger or service subpath, no moved name (this also catches multi-line
|
|
180
|
+
# imports, `require` destructuring and JavaScript, which `tsc` does not check)
|
|
181
|
+
grep -rlE "@adcp/sdk/reporting/(ledger|service)" src | xargs grep -nE "PostgresReporting|createPostgresReliable|REPORTING_[A-Z_]+_MIGRATION|createFilesystemReporting|ReportingRowStorageV1|createReportingManagedDeliveryRuntime|createPostgresReportingNotification|runReportingLedgerMaintenance|\bmaintenance:[[:space:]]*\{"
|
|
182
|
+
# 3. TypeScript
|
|
183
|
+
npx tsc --noEmit
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Every line check 2 prints is either a moved name still imported from the SDK or a `maintenance:` options object to wrap.
|
package/examples/README.md
CHANGED
|
@@ -44,7 +44,7 @@ persists strict accepted state, produces strict readback, and refuses clears the
|
|
|
44
44
|
provider cannot honor.
|
|
45
45
|
|
|
46
46
|
Adding Reliable Reporting Core to an existing seller? Start with the
|
|
47
|
-
[adapter-first installation example](
|
|
47
|
+
[adapter-first installation example](https://github.com/adcontextprotocol/adcp-client/blob/main/packages/reporting-storage/examples/reliable-reporting-service/README.md).
|
|
48
48
|
It uses the durable ledger as the sole authority and shows trusted account,
|
|
49
49
|
source-scope, timezone, and currency resolution without sample reporting data.
|
|
50
50
|
|