@adcp/sdk 14.0.0-rc.37 → 14.0.0-rc.39
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/bin/adcp-storyboard-summary.js +286 -0
- package/bin/adcp.js +221 -10
- package/dist/lib/conformance/schemaLoader.d.mts +1 -1
- package/dist/lib/conformance/schemaLoader.d.ts +1 -1
- package/dist/lib/core/AgentClient.d.mts +6 -1
- package/dist/lib/core/AgentClient.d.ts +6 -1
- package/dist/lib/core/AgentClient.js +9 -0
- package/dist/lib/core/AgentClient.mjs +9 -0
- package/dist/lib/core/ConversationTypes.d.mts +29 -0
- package/dist/lib/core/ConversationTypes.d.ts +29 -0
- package/dist/lib/core/SingleAgentClient.d.mts +3 -1
- package/dist/lib/core/SingleAgentClient.d.ts +3 -1
- package/dist/lib/core/SingleAgentClient.js +9 -1
- package/dist/lib/core/SingleAgentClient.mjs +9 -1
- package/dist/lib/core/TaskExecutor.d.mts +13 -1
- package/dist/lib/core/TaskExecutor.d.ts +13 -1
- package/dist/lib/core/TaskExecutor.js +216 -18
- package/dist/lib/core/TaskExecutor.mjs +216 -19
- package/dist/lib/index.d.mts +5 -2
- package/dist/lib/index.d.ts +5 -2
- package/dist/lib/index.js +10 -1
- package/dist/lib/index.mjs +10 -1
- package/dist/lib/media-buy/action-assessment.d.mts +77 -0
- package/dist/lib/media-buy/action-assessment.d.ts +77 -0
- package/dist/lib/media-buy/action-assessment.js +300 -0
- package/dist/lib/media-buy/action-assessment.mjs +284 -0
- package/dist/lib/media-buy/action-constraints.d.mts +9 -0
- package/dist/lib/media-buy/action-constraints.d.ts +9 -0
- package/dist/lib/media-buy/action-constraints.js +170 -0
- package/dist/lib/media-buy/action-constraints.mjs +146 -0
- package/dist/lib/media-buy/action-contracts.d.mts +40 -0
- package/dist/lib/media-buy/action-contracts.d.ts +40 -0
- package/dist/lib/media-buy/action-contracts.js +304 -0
- package/dist/lib/media-buy/action-contracts.mjs +267 -0
- package/dist/lib/media-buy/action-metadata.generated.d.mts +37 -0
- package/dist/lib/media-buy/action-metadata.generated.d.ts +37 -0
- package/dist/lib/media-buy/action-metadata.generated.js +128 -0
- package/dist/lib/media-buy/action-metadata.generated.mjs +101 -0
- package/dist/lib/media-buy/action-types.d.mts +106 -0
- package/dist/lib/media-buy/action-types.d.ts +106 -0
- package/dist/lib/{types/v3-1-beta/tools.generated.js → media-buy/action-types.js} +2 -2
- package/dist/lib/media-buy/actions.d.mts +6 -0
- package/dist/lib/media-buy/actions.d.ts +6 -0
- package/dist/lib/media-buy/actions.js +38 -0
- package/dist/lib/media-buy/actions.mjs +9 -0
- package/dist/lib/media-buy/available-actions.d.mts +2 -1
- package/dist/lib/media-buy/available-actions.d.ts +2 -1
- package/dist/lib/media-buy/available-actions.js +4 -3
- package/dist/lib/media-buy/available-actions.mjs +4 -3
- package/dist/lib/media-buy/compatibility.js +3 -0
- package/dist/lib/media-buy/compatibility.mjs +3 -0
- package/dist/lib/media-buy/index.d.mts +4 -0
- package/dist/lib/media-buy/index.d.ts +4 -0
- package/dist/lib/media-buy/index.js +3 -1
- package/dist/lib/media-buy/index.mjs +1 -0
- package/dist/lib/media-buy/legacy-action-ids.d.mts +1 -0
- package/dist/lib/media-buy/legacy-action-ids.d.ts +1 -0
- package/dist/lib/media-buy/legacy-action-ids.js +50 -0
- package/dist/lib/media-buy/legacy-action-ids.mjs +26 -0
- package/dist/lib/media-buy/mutations.d.mts +70 -0
- package/dist/lib/media-buy/mutations.d.ts +70 -0
- package/dist/lib/media-buy/mutations.js +525 -0
- package/dist/lib/media-buy/mutations.mjs +498 -0
- package/dist/lib/media-buy/preflight.d.mts +20 -69
- package/dist/lib/media-buy/preflight.d.ts +20 -69
- package/dist/lib/media-buy/preflight.js +100 -336
- package/dist/lib/media-buy/preflight.mjs +111 -333
- package/dist/lib/media-buy/targeting-input.d.mts +7 -4
- package/dist/lib/media-buy/targeting-input.d.ts +7 -4
- package/dist/lib/media-buy/types.d.mts +55 -7
- package/dist/lib/media-buy/types.d.ts +55 -7
- package/dist/lib/protocols/rawResponseCapture.d.mts +12 -0
- package/dist/lib/protocols/rawResponseCapture.d.ts +12 -0
- package/dist/lib/protocols/rawResponseCapture.js +33 -3
- package/dist/lib/protocols/rawResponseCapture.mjs +32 -3
- package/dist/lib/registry/types.generated.d.mts +377 -9
- package/dist/lib/registry/types.generated.d.ts +377 -9
- package/dist/lib/reporting/content-mismatch.d.mts +126 -0
- package/dist/lib/reporting/content-mismatch.d.ts +126 -0
- package/dist/lib/reporting/content-mismatch.js +90 -0
- package/dist/lib/reporting/content-mismatch.mjs +66 -0
- package/dist/lib/reporting/evidence.d.mts +1 -0
- package/dist/lib/reporting/evidence.d.ts +1 -0
- package/dist/lib/reporting/evidence.js +32 -3
- package/dist/lib/reporting/evidence.mjs +31 -3
- package/dist/lib/reporting/index.d.mts +3 -1
- package/dist/lib/reporting/index.d.ts +3 -1
- package/dist/lib/reporting/index.js +3 -0
- package/dist/lib/reporting/index.mjs +2 -0
- package/dist/lib/reporting/ledger/handler.d.mts +51 -1
- package/dist/lib/reporting/ledger/handler.d.ts +51 -1
- package/dist/lib/reporting/ledger/handler.js +306 -38
- package/dist/lib/reporting/ledger/handler.mjs +304 -37
- package/dist/lib/reporting/ledger/health.d.mts +12 -0
- package/dist/lib/reporting/ledger/health.d.ts +12 -0
- package/dist/lib/reporting/ledger/health.js +15 -2
- package/dist/lib/reporting/ledger/health.mjs +13 -1
- package/dist/lib/reporting/ledger/index.d.mts +3 -0
- package/dist/lib/reporting/ledger/index.d.ts +3 -0
- package/dist/lib/reporting/ledger/index.js +7 -1
- package/dist/lib/reporting/ledger/index.mjs +3 -0
- package/dist/lib/reporting/ledger/lifecycle.d.mts +31 -4
- package/dist/lib/reporting/ledger/lifecycle.d.ts +31 -4
- package/dist/lib/reporting/ledger/lifecycle.js +244 -37
- package/dist/lib/reporting/ledger/lifecycle.mjs +244 -37
- package/dist/lib/reporting/ledger/managed-postgres.d.mts +231 -0
- package/dist/lib/reporting/ledger/managed-postgres.d.ts +231 -0
- package/dist/lib/reporting/ledger/managed-postgres.js +1797 -0
- package/dist/lib/reporting/ledger/managed-postgres.mjs +1776 -0
- package/dist/lib/reporting/ledger/managed.d.mts +355 -0
- package/dist/lib/reporting/ledger/managed.d.ts +355 -0
- package/dist/lib/reporting/ledger/managed.js +661 -0
- package/dist/lib/reporting/ledger/managed.mjs +633 -0
- package/dist/lib/reporting/ledger/notification-activity.d.mts +222 -0
- package/dist/lib/reporting/ledger/notification-activity.d.ts +222 -0
- package/dist/lib/reporting/ledger/notification-activity.js +1139 -0
- package/dist/lib/reporting/ledger/notification-activity.mjs +1110 -0
- package/dist/lib/reporting/ledger/postgres.d.mts +161 -1
- package/dist/lib/reporting/ledger/postgres.d.ts +161 -1
- package/dist/lib/reporting/ledger/postgres.js +1153 -21
- package/dist/lib/reporting/ledger/postgres.mjs +1152 -21
- package/dist/lib/reporting/ledger/producer.d.mts +8 -0
- package/dist/lib/reporting/ledger/producer.d.ts +8 -0
- package/dist/lib/reporting/ledger/producer.js +146 -52
- package/dist/lib/reporting/ledger/producer.mjs +146 -51
- package/dist/lib/reporting/ledger/types.d.mts +358 -1
- package/dist/lib/reporting/ledger/types.d.ts +358 -1
- package/dist/lib/reporting/ledger/types.js +3 -0
- package/dist/lib/reporting/ledger/types.mjs +2 -0
- package/dist/lib/reporting/reconciliation.d.mts +362 -2
- package/dist/lib/reporting/reconciliation.d.ts +362 -2
- package/dist/lib/reporting/reconciliation.js +1051 -7
- package/dist/lib/reporting/reconciliation.mjs +1053 -7
- package/dist/lib/reporting/service/conformance.d.mts +35 -0
- package/dist/lib/reporting/service/conformance.d.ts +35 -0
- package/dist/lib/reporting/service/conformance.js +89 -0
- package/dist/lib/reporting/service/conformance.mjs +68 -0
- package/dist/lib/reporting/service/index.d.mts +182 -0
- package/dist/lib/reporting/service/index.d.ts +182 -0
- package/dist/lib/reporting/service/index.js +793 -0
- package/dist/lib/reporting/service/index.mjs +787 -0
- package/dist/lib/reporting/source/index.d.mts +2 -1
- package/dist/lib/reporting/source/index.d.ts +2 -1
- package/dist/lib/reporting/source/index.js +16 -3
- package/dist/lib/reporting/source/index.mjs +12 -1
- package/dist/lib/reporting/source/inline.d.mts +88 -1
- package/dist/lib/reporting/source/inline.d.ts +88 -1
- package/dist/lib/reporting/source/inline.js +1161 -163
- package/dist/lib/reporting/source/inline.mjs +1166 -163
- package/dist/lib/reporting/source/manifest.js +12 -7
- package/dist/lib/reporting/source/manifest.mjs +12 -7
- package/dist/lib/reporting/source/source.d.mts +26 -0
- package/dist/lib/reporting/source/source.d.ts +26 -0
- package/dist/lib/reporting/source/source.js +71 -2
- package/dist/lib/reporting/source/source.mjs +65 -1
- package/dist/lib/schemas/index.d.mts +22 -1
- package/dist/lib/schemas/index.d.ts +22 -1
- package/dist/lib/schemas/index.js +7 -0
- package/dist/lib/schemas/index.mjs +7 -0
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/server/create-adcp-server.d.mts +18 -0
- package/dist/lib/server/create-adcp-server.d.ts +18 -0
- package/dist/lib/server/create-adcp-server.js +52 -2
- package/dist/lib/server/create-adcp-server.mjs +52 -2
- package/dist/lib/server/decisioning/account.d.mts +1 -1
- package/dist/lib/server/decisioning/account.d.ts +1 -1
- package/dist/lib/server/decisioning/index.d.mts +1 -0
- package/dist/lib/server/decisioning/index.d.ts +1 -0
- package/dist/lib/server/decisioning/platform.d.mts +3 -0
- package/dist/lib/server/decisioning/platform.d.ts +3 -0
- package/dist/lib/server/decisioning/runtime/from-platform.js +88 -10
- package/dist/lib/server/decisioning/runtime/from-platform.mjs +88 -10
- package/dist/lib/server/decisioning/specialisms/reporting.d.mts +38 -0
- package/dist/lib/server/decisioning/specialisms/reporting.d.ts +38 -0
- package/dist/lib/{types/v3-1-beta/index.js → server/decisioning/specialisms/reporting.js} +2 -8
- package/dist/lib/server/decisioning/specialisms/reporting.mjs +0 -0
- package/dist/lib/server/index.d.mts +4 -2
- package/dist/lib/server/index.d.ts +4 -2
- package/dist/lib/server/index.js +5 -0
- package/dist/lib/server/index.mjs +4 -0
- package/dist/lib/server/media-buy-action-resolver.d.mts +63 -0
- package/dist/lib/server/media-buy-action-resolver.d.ts +63 -0
- package/dist/lib/server/media-buy-action-resolver.js +297 -0
- package/dist/lib/server/media-buy-action-resolver.mjs +285 -0
- package/dist/lib/server/media-buy-actions.d.mts +7 -8
- package/dist/lib/server/media-buy-actions.d.ts +7 -8
- package/dist/lib/server/media-buy-actions.js +57 -14
- package/dist/lib/server/media-buy-actions.mjs +63 -14
- package/dist/lib/server/notification-subscriptions/index.d.mts +2 -2
- package/dist/lib/server/notification-subscriptions/index.d.ts +2 -2
- package/dist/lib/server/notification-subscriptions/index.js +2 -0
- package/dist/lib/server/notification-subscriptions/index.mjs +2 -0
- package/dist/lib/server/notification-subscriptions/postgres-runtime.d.mts +3 -1
- package/dist/lib/server/notification-subscriptions/postgres-runtime.d.ts +3 -1
- package/dist/lib/server/notification-subscriptions/postgres-runtime.js +1 -0
- package/dist/lib/server/notification-subscriptions/postgres-runtime.mjs +1 -0
- package/dist/lib/server/notification-subscriptions/runtime.d.mts +12 -1
- package/dist/lib/server/notification-subscriptions/runtime.d.ts +12 -1
- package/dist/lib/server/notification-subscriptions/runtime.js +102 -16
- package/dist/lib/server/notification-subscriptions/runtime.mjs +101 -16
- package/dist/lib/server/notification-subscriptions/types.d.mts +104 -1
- package/dist/lib/server/notification-subscriptions/types.d.ts +104 -1
- package/dist/lib/server/webhook-emitter.d.mts +40 -5
- package/dist/lib/server/webhook-emitter.d.ts +40 -5
- package/dist/lib/server/webhook-emitter.js +23 -12
- package/dist/lib/server/webhook-emitter.mjs +23 -12
- package/dist/lib/storage/interfaces.d.mts +14 -2
- package/dist/lib/storage/interfaces.d.ts +14 -2
- package/dist/lib/testing/compliance/comply.d.mts +9 -3
- package/dist/lib/testing/compliance/comply.d.ts +9 -3
- package/dist/lib/testing/compliance/comply.js +158 -3
- package/dist/lib/testing/compliance/comply.mjs +159 -4
- package/dist/lib/testing/compliance/storyboard-tracks.js +7 -5
- package/dist/lib/testing/compliance/storyboard-tracks.mjs +7 -5
- package/dist/lib/testing/compliance/summary.js +10 -1
- package/dist/lib/testing/compliance/summary.mjs +10 -1
- package/dist/lib/testing/index.d.mts +1 -1
- package/dist/lib/testing/index.d.ts +1 -1
- package/dist/lib/testing/index.js +2 -0
- package/dist/lib/testing/index.mjs +3 -1
- package/dist/lib/testing/storyboard/agent-routing.d.mts +12 -43
- package/dist/lib/testing/storyboard/agent-routing.d.ts +12 -43
- package/dist/lib/testing/storyboard/agent-routing.js +75 -13
- package/dist/lib/testing/storyboard/agent-routing.mjs +70 -12
- package/dist/lib/testing/storyboard/index.d.mts +1 -0
- package/dist/lib/testing/storyboard/index.d.ts +1 -0
- package/dist/lib/testing/storyboard/index.js +3 -0
- package/dist/lib/testing/storyboard/index.mjs +2 -0
- package/dist/lib/testing/storyboard/junit.d.mts +1 -1
- package/dist/lib/testing/storyboard/junit.d.ts +1 -1
- package/dist/lib/testing/storyboard/junit.js +21 -2
- package/dist/lib/testing/storyboard/junit.mjs +21 -2
- package/dist/lib/testing/storyboard/probes.d.mts +130 -0
- package/dist/lib/testing/storyboard/probes.d.ts +130 -0
- package/dist/lib/testing/storyboard/probes.js +682 -10
- package/dist/lib/testing/storyboard/probes.mjs +683 -3
- package/dist/lib/testing/storyboard/request-signing/builder.d.mts +16 -5
- package/dist/lib/testing/storyboard/request-signing/builder.d.ts +16 -5
- package/dist/lib/testing/storyboard/request-signing/grader.d.mts +44 -1
- package/dist/lib/testing/storyboard/request-signing/grader.d.ts +44 -1
- package/dist/lib/testing/storyboard/request-signing/grader.js +46 -22
- package/dist/lib/testing/storyboard/request-signing/grader.mjs +43 -21
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.d.mts +86 -11
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.d.ts +86 -11
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.js +119 -25
- package/dist/lib/testing/storyboard/request-signing/probe-dispatch.mjs +117 -26
- package/dist/lib/testing/storyboard/request-signing/synthesize.js +22 -2
- package/dist/lib/testing/storyboard/request-signing/synthesize.mjs +22 -2
- package/dist/lib/testing/storyboard/runner.d.mts +103 -0
- package/dist/lib/testing/storyboard/runner.d.ts +103 -0
- package/dist/lib/testing/storyboard/runner.js +1090 -268
- package/dist/lib/testing/storyboard/runner.mjs +1096 -261
- package/dist/lib/testing/storyboard/seeding.d.mts +4 -1
- package/dist/lib/testing/storyboard/seeding.d.ts +4 -1
- package/dist/lib/testing/storyboard/seeding.js +55 -24
- package/dist/lib/testing/storyboard/seeding.mjs +55 -24
- package/dist/lib/testing/storyboard/test-kit.d.mts +37 -3
- package/dist/lib/testing/storyboard/test-kit.d.ts +37 -3
- package/dist/lib/testing/storyboard/test-kit.js +8 -2
- package/dist/lib/testing/storyboard/test-kit.mjs +7 -2
- package/dist/lib/testing/storyboard/types.d.mts +132 -10
- package/dist/lib/testing/storyboard/types.d.ts +132 -10
- package/dist/lib/testing/storyboard/types.js +17 -0
- package/dist/lib/testing/storyboard/types.mjs +16 -0
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/testing/storyboard/validations.js +16 -0
- package/dist/lib/testing/storyboard/validations.mjs +16 -0
- package/dist/lib/testing/test-controller.d.mts +1 -1
- package/dist/lib/testing/test-controller.d.ts +1 -1
- package/dist/lib/types/buy-products.d.ts +71 -6
- package/dist/lib/types/control-media-buy.d.ts +25 -11
- package/dist/lib/types/core.generated.d.mts +69 -10
- package/dist/lib/types/core.generated.d.ts +69 -10
- package/dist/lib/types/create-media-buy.d.ts +71 -6
- package/dist/lib/types/forward-compat-error-codes.d.mts +7 -6
- package/dist/lib/types/forward-compat-error-codes.d.ts +7 -6
- package/dist/lib/types/index.d.mts +2 -2
- package/dist/lib/types/index.d.ts +2 -2
- package/dist/lib/types/schemas.generated.d.ts +8040 -8116
- package/dist/lib/types/schemas.generated.js +1074 -309
- package/dist/lib/types/schemas.generated.mjs +1068 -309
- package/dist/lib/types/tools.generated.d.mts +65 -6
- package/dist/lib/types/tools.generated.d.ts +65 -6
- package/dist/lib/types/update-media-buy.d.ts +71 -6
- package/dist/lib/utils/redact-secrets.d.mts +1 -1
- package/dist/lib/utils/redact-secrets.d.ts +1 -1
- package/dist/lib/utils/redact-secrets.js +1 -1
- package/dist/lib/utils/redact-secrets.mjs +1 -1
- package/dist/lib/v2/projection/cache-versions.d.mts +0 -1
- package/dist/lib/v2/projection/cache-versions.d.ts +0 -1
- package/dist/lib/v2/projection/cache-versions.js +1 -15
- package/dist/lib/v2/projection/cache-versions.mjs +1 -14
- package/dist/lib/v2/projection/canonical-properties.js +2 -2
- package/dist/lib/v2/projection/canonical-properties.mjs +3 -3
- package/dist/lib/v2/projection/registry.d.mts +1 -1
- package/dist/lib/v2/projection/registry.d.ts +1 -1
- package/dist/lib/v2/projection/registry.js +2 -2
- package/dist/lib/v2/projection/registry.mjs +3 -3
- package/dist/lib/validation/schema-loader.d.mts +9 -1
- package/dist/lib/validation/schema-loader.d.ts +9 -1
- package/dist/lib/validation/schema-loader.js +65 -8
- package/dist/lib/validation/schema-loader.mjs +64 -8
- package/dist/lib/version.d.mts +5 -5
- package/dist/lib/version.d.ts +5 -5
- package/dist/lib/version.js +3 -8
- package/dist/lib/version.mjs +3 -8
- package/dist/lib/wholesale-feed-sync/index.d.mts +1 -0
- package/dist/lib/wholesale-feed-sync/index.d.ts +1 -0
- package/dist/lib/wholesale-feed-sync/protocol-types.d.mts +42 -0
- package/dist/lib/wholesale-feed-sync/protocol-types.d.ts +42 -0
- package/dist/lib/wholesale-feed-sync/protocol-types.js +16 -0
- package/dist/lib/wholesale-feed-sync/protocol-types.mjs +0 -0
- package/dist/lib/wholesale-feed-sync/sync.d.mts +6 -6
- package/dist/lib/wholesale-feed-sync/sync.d.ts +6 -6
- package/dist/lib/wholesale-feed-sync/sync.js +3 -1
- package/dist/lib/wholesale-feed-sync/sync.mjs +3 -1
- package/dist/lib/wholesale-feed-sync/types.d.mts +15 -14
- package/dist/lib/wholesale-feed-sync/types.d.ts +15 -14
- package/dist/lib/wholesale-feed-sync/webhook-notification.d.mts +7 -5
- package/dist/lib/wholesale-feed-sync/webhook-notification.d.ts +7 -5
- package/dist/lib/wholesale-feed-sync/webhook-notification.js +45 -0
- package/dist/lib/wholesale-feed-sync/webhook-notification.mjs +44 -0
- package/docs/CLI.md +1 -1
- package/docs/TYPE-SUMMARY.md +118 -4
- package/docs/guides/ASYNC-API-REFERENCE.md +62 -1
- package/docs/guides/ASYNC-DEVELOPER-GUIDE.md +25 -0
- package/docs/guides/ASYNC-DOCUMENTATION-INDEX.md +3 -0
- package/docs/guides/BUYER-QUICKSTART-3.2.md +5 -0
- package/docs/guides/DURABLE-BUYER-WRITES.md +337 -0
- package/docs/guides/EXISTING-PLATFORM.md +80 -1
- package/docs/guides/MEDIA-BUY-3.2-COMPATIBILITY.md +57 -0
- package/docs/guides/MEDIA-BUY-ACTION-ASSESSMENT.md +300 -0
- package/docs/guides/REPORTING-LEDGER.md +654 -3
- package/docs/guides/REPORTING-RECONCILIATION.md +50 -0
- package/docs/guides/REPORTING-SOURCE-EXECUTOR.md +63 -1
- package/docs/guides/SELLER-QUICKSTART-3.2.md +2 -0
- package/docs/guides/VALIDATE-YOUR-AGENT.md +35 -0
- package/docs/guides/idempotency-crash-recovery.md +4 -0
- package/docs/llms.txt +4 -2
- package/docs/migration-14.x-rc-worksheet.md +60 -5
- package/docs/migration-7.9-to-7.10.md +7 -5
- package/examples/README.md +17 -0
- package/examples/durable-buyer-writes/caller.ts +745 -0
- package/examples/durable-buyer-writes/worker.ts +240 -0
- package/examples/reliable-reporting-service/README.md +100 -0
- package/examples/seller-3.2-starter.ts +7 -8
- package/examples/targeting-input-existing-platform.ts +153 -0
- package/package.json +41 -29
- package/skills/build-seller-agent/SKILL.md +2 -0
- package/skills/build-seller-agent/specialisms/signed-requests.md +11 -1
- package/skills/cross-cutting.md +28 -11
- package/compliance/cache/3.1.0-beta.7/domains/brand/index.yaml +0 -160
- package/compliance/cache/3.1.0-beta.7/domains/brand/scenarios/distributed_brand_resolution.yaml +0 -415
- package/compliance/cache/3.1.0-beta.7/domains/brand/scenarios/single_side_trust_extension.yaml +0 -454
- package/compliance/cache/3.1.0-beta.7/domains/creative/index.yaml +0 -339
- package/compliance/cache/3.1.0-beta.7/domains/creative/scenarios/billing_out_of_band.yaml +0 -153
- package/compliance/cache/3.1.0-beta.7/domains/creative/scenarios/creative_lifecycle_webhooks.yaml +0 -389
- package/compliance/cache/3.1.0-beta.7/domains/creative/scenarios/native_in_feed.yaml +0 -543
- package/compliance/cache/3.1.0-beta.7/domains/governance/index.yaml +0 -682
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/index.yaml +0 -781
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/audience_buy_flow.yaml +0 -380
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/available_actions.yaml +0 -565
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/billing_finality_delivery.yaml +0 -354
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/canonical_formats.yaml +0 -711
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/clicks_buy_flow.yaml +0 -264
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/completed_views_buy_flow.yaml +0 -344
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/create_media_buy_async.yaml +0 -234
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/creative_fate_after_cancellation.yaml +0 -419
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/creative_reception.yaml +0 -247
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/delivery_reporting.yaml +0 -357
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/dependency_impairment.yaml +0 -633
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/dependency_impairment_cardinality.yaml +0 -800
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/event_dedup_flow.yaml +0 -399
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/frequency_cap_enforcement.yaml +0 -309
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/governance_approved.yaml +0 -214
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/governance_conditions.yaml +0 -199
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/governance_denied.yaml +0 -204
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/governance_denied_recovery.yaml +0 -252
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/invalid_transitions.yaml +0 -289
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/inventory_list_no_match.yaml +0 -148
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/inventory_list_targeting.yaml +0 -276
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/measurement_accountability.yaml +0 -244
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/measurement_terms_rejected.yaml +0 -203
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/pending_creatives_to_start.yaml +0 -274
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/per_creative_conversion_attribution.yaml +0 -500
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/performance_buy_flow.yaml +0 -428
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/performance_buy_flow_roas.yaml +0 -470
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/product_signal_targeting.yaml +0 -373
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/proposal_finalize.yaml +0 -399
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/proposal_finalize_asap_timing.yaml +0 -264
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/proposal_not_found_errors.yaml +0 -257
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/provenance_audit_observation.yaml +0 -333
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/provenance_enforcement.yaml +0 -517
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/provenance_truth_of_claim.yaml +0 -294
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/reach_buy_flow.yaml +0 -823
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/refine_finalize_exclusivity.yaml +0 -360
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/refine_products.yaml +0 -148
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/vendor_metric_accountability.yaml +0 -293
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/vendor_metric_catalog_precondition.yaml +0 -307
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/scenarios/vendor_metric_optimization_flow.yaml +0 -576
- package/compliance/cache/3.1.0-beta.7/domains/media-buy/state-machine.yaml +0 -442
- package/compliance/cache/3.1.0-beta.7/domains/signals/index.yaml +0 -266
- package/compliance/cache/3.1.0-beta.7/domains/sponsored-intelligence/index.yaml +0 -256
- package/compliance/cache/3.1.0-beta.7/index.json +0 -356
- package/compliance/cache/3.1.0-beta.7/protocols/brand/index.yaml +0 -160
- package/compliance/cache/3.1.0-beta.7/protocols/brand/scenarios/distributed_brand_resolution.yaml +0 -415
- package/compliance/cache/3.1.0-beta.7/protocols/brand/scenarios/single_side_trust_extension.yaml +0 -454
- package/compliance/cache/3.1.0-beta.7/protocols/creative/index.yaml +0 -339
- package/compliance/cache/3.1.0-beta.7/protocols/creative/scenarios/billing_out_of_band.yaml +0 -153
- package/compliance/cache/3.1.0-beta.7/protocols/creative/scenarios/creative_lifecycle_webhooks.yaml +0 -389
- package/compliance/cache/3.1.0-beta.7/protocols/creative/scenarios/native_in_feed.yaml +0 -543
- package/compliance/cache/3.1.0-beta.7/protocols/governance/index.yaml +0 -682
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/index.yaml +0 -781
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/audience_buy_flow.yaml +0 -380
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/available_actions.yaml +0 -565
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/billing_finality_delivery.yaml +0 -354
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/canonical_formats.yaml +0 -711
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/clicks_buy_flow.yaml +0 -264
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/completed_views_buy_flow.yaml +0 -344
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/create_media_buy_async.yaml +0 -234
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/creative_fate_after_cancellation.yaml +0 -419
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/creative_reception.yaml +0 -247
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/delivery_reporting.yaml +0 -357
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/dependency_impairment.yaml +0 -633
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/dependency_impairment_cardinality.yaml +0 -800
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/event_dedup_flow.yaml +0 -399
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/frequency_cap_enforcement.yaml +0 -309
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/governance_approved.yaml +0 -214
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/governance_conditions.yaml +0 -199
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/governance_denied.yaml +0 -204
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/governance_denied_recovery.yaml +0 -252
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/invalid_transitions.yaml +0 -289
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/inventory_list_no_match.yaml +0 -148
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/inventory_list_targeting.yaml +0 -276
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/measurement_accountability.yaml +0 -244
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/measurement_terms_rejected.yaml +0 -203
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/pending_creatives_to_start.yaml +0 -274
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/per_creative_conversion_attribution.yaml +0 -500
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/performance_buy_flow.yaml +0 -428
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/performance_buy_flow_roas.yaml +0 -470
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/product_signal_targeting.yaml +0 -373
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/proposal_finalize.yaml +0 -399
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/proposal_finalize_asap_timing.yaml +0 -264
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/proposal_not_found_errors.yaml +0 -257
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/provenance_audit_observation.yaml +0 -333
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/provenance_enforcement.yaml +0 -517
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/provenance_truth_of_claim.yaml +0 -294
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/reach_buy_flow.yaml +0 -823
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/refine_finalize_exclusivity.yaml +0 -360
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/refine_products.yaml +0 -148
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/vendor_metric_accountability.yaml +0 -293
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/vendor_metric_catalog_precondition.yaml +0 -307
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/scenarios/vendor_metric_optimization_flow.yaml +0 -576
- package/compliance/cache/3.1.0-beta.7/protocols/media-buy/state-machine.yaml +0 -442
- package/compliance/cache/3.1.0-beta.7/protocols/signals/index.yaml +0 -266
- package/compliance/cache/3.1.0-beta.7/protocols/sponsored-intelligence/index.yaml +0 -256
- package/compliance/cache/3.1.0-beta.7/specialisms/audience-sync/index.yaml +0 -313
- package/compliance/cache/3.1.0-beta.7/specialisms/brand-rights/index.yaml +0 -350
- package/compliance/cache/3.1.0-beta.7/specialisms/brand-rights/scenarios/governance_denied.yaml +0 -226
- package/compliance/cache/3.1.0-beta.7/specialisms/collection-lists/index.yaml +0 -359
- package/compliance/cache/3.1.0-beta.7/specialisms/content-standards/index.yaml +0 -572
- package/compliance/cache/3.1.0-beta.7/specialisms/creative-ad-server/index.yaml +0 -409
- package/compliance/cache/3.1.0-beta.7/specialisms/creative-generative/generative-seller.yaml +0 -807
- package/compliance/cache/3.1.0-beta.7/specialisms/creative-generative/index.yaml +0 -758
- package/compliance/cache/3.1.0-beta.7/specialisms/creative-template/index.yaml +0 -510
- package/compliance/cache/3.1.0-beta.7/specialisms/governance-aware-seller/index.yaml +0 -143
- package/compliance/cache/3.1.0-beta.7/specialisms/governance-aware-seller/scenarios/governance_multi_agent_rejected.yaml +0 -117
- package/compliance/cache/3.1.0-beta.7/specialisms/governance-delivery-monitor/index.yaml +0 -441
- package/compliance/cache/3.1.0-beta.7/specialisms/governance-spend-authority/denied.yaml +0 -221
- package/compliance/cache/3.1.0-beta.7/specialisms/governance-spend-authority/index.yaml +0 -330
- package/compliance/cache/3.1.0-beta.7/specialisms/property-lists/index.yaml +0 -482
- package/compliance/cache/3.1.0-beta.7/specialisms/sales-broadcast-tv/index.yaml +0 -738
- package/compliance/cache/3.1.0-beta.7/specialisms/sales-catalog-driven/index.yaml +0 -840
- package/compliance/cache/3.1.0-beta.7/specialisms/sales-guaranteed/index.yaml +0 -601
- package/compliance/cache/3.1.0-beta.7/specialisms/sales-non-guaranteed/index.yaml +0 -546
- package/compliance/cache/3.1.0-beta.7/specialisms/sales-proposal-mode/index.yaml +0 -586
- package/compliance/cache/3.1.0-beta.7/specialisms/sales-social/index.yaml +0 -919
- package/compliance/cache/3.1.0-beta.7/specialisms/signal-marketplace/index.yaml +0 -424
- package/compliance/cache/3.1.0-beta.7/specialisms/signal-marketplace/scenarios/governance_denied.yaml +0 -211
- package/compliance/cache/3.1.0-beta.7/specialisms/signal-owned/index.yaml +0 -317
- package/compliance/cache/3.1.0-beta.7/specialisms/sponsored-intelligence/index.yaml +0 -59
- package/compliance/cache/3.1.0-beta.7/test-kits/acme-outdoor-live.yaml +0 -78
- package/compliance/cache/3.1.0-beta.7/test-kits/acme-outdoor.yaml +0 -223
- package/compliance/cache/3.1.0-beta.7/test-kits/billing-gate-runner.yaml +0 -115
- package/compliance/cache/3.1.0-beta.7/test-kits/bistro-oranje.yaml +0 -126
- package/compliance/cache/3.1.0-beta.7/test-kits/distributed-brand-runner.yaml +0 -281
- package/compliance/cache/3.1.0-beta.7/test-kits/nova-motors.yaml +0 -262
- package/compliance/cache/3.1.0-beta.7/test-kits/osei-natural.yaml +0 -126
- package/compliance/cache/3.1.0-beta.7/test-kits/parallel-dispatch-runner.yaml +0 -196
- package/compliance/cache/3.1.0-beta.7/test-kits/rate-limit-trip-runner.yaml +0 -172
- package/compliance/cache/3.1.0-beta.7/test-kits/signed-requests-runner.yaml +0 -155
- package/compliance/cache/3.1.0-beta.7/test-kits/single-side-trust-runner.yaml +0 -294
- package/compliance/cache/3.1.0-beta.7/test-kits/substitution-observer-runner.yaml +0 -688
- package/compliance/cache/3.1.0-beta.7/test-kits/summit-foods.yaml +0 -125
- package/compliance/cache/3.1.0-beta.7/test-kits/webhook-receiver-runner.yaml +0 -265
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/001-minimal-plan.json +0 -43
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/002-full-plan.json +0 -217
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/003-bookkeeping-stripped.json +0 -60
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/004a-human-review-omitted.json +0 -43
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/004b-human-review-explicit-null.json +0 -49
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/005a-policy-categories-order-1.json +0 -53
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/005b-policy-categories-order-2.json +0 -57
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/006a-ext-trace-v1.json +0 -49
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/006b-ext-trace-v2.json +0 -53
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/007-unicode-objectives.json +0 -43
- package/compliance/cache/3.1.0-beta.7/test-vectors/plan-hash/008-numeric-canonicalization.json +0 -65
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/README.md +0 -220
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/canonicalization.json +0 -241
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/keys.json +0 -60
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/001-no-signature-header.json +0 -24
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/002-wrong-tag.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/003-expired-signature.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/004-window-too-long.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/005-alg-not-allowed.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/006-missing-covered-component.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/007-missing-content-digest.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/008-unknown-keyid.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/009-key-ops-missing-verify.json +0 -27
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/010-content-digest-mismatch.json +0 -33
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/011-malformed-header.json +0 -27
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/012-missing-expires-param.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/013-expires-le-created.json +0 -27
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/014-missing-nonce-param.json +0 -27
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/015-signature-invalid.json +0 -28
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/016-replayed-nonce.json +0 -35
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/017-key-revoked.json +0 -38
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/018-digest-covered-when-forbidden.json +0 -28
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/019-signature-without-signature-input.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/020-rate-abuse.json +0 -34
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/021-duplicate-signature-input-label.json +0 -31
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/022-multi-valued-content-type.json +0 -31
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/023-multi-valued-content-digest.json +0 -32
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/024-unquoted-string-param.json +0 -31
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/025-jwk-alg-crv-mismatch.json +0 -43
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/026-non-ascii-host.json +0 -31
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/027-webhook-registration-authentication-unsigned.json +0 -25
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/negative/028-unsigned-protocol-method-required.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/001-basic-post.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/002-post-with-content-digest.json +0 -31
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/003-es256-post.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/004-multiple-signature-labels.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/005-default-port-stripped.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/006-dot-segment-path.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/007-query-byte-preserved.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/008-percent-encoded-path.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/009-percent-encoded-unreserved-decoded.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/010-percent-encoded-slash-preserved.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/011-ipv6-authority.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/request-signing/positive/012-ipv6-authority-default-port-stripped.json +0 -30
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/README.md +0 -211
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/keys.json +0 -61
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/001-wrong-tag.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/002-expired-signature.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/003-window-too-long.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/004-alg-not-allowed.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/005-missing-authority-component.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/006-missing-content-digest.json +0 -25
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/007-unknown-keyid.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/008-wrong-adcp-use.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/009-content-digest-mismatch.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/010-malformed-signature-input.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/011-signature-without-input.json +0 -25
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/012-missing-expires-param.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/013-expires-le-created.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/014-missing-nonce-param.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/015-signature-invalid.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/016-replayed-nonce.json +0 -37
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/017-key-revoked.json +0 -32
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/018-rate-abuse.json +0 -33
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/019-revocation-stale.json +0 -32
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/020-key-ops-missing-verify.json +0 -41
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/negative/021-base64-alphabet-mixing.json +0 -26
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/001-basic-post.json +0 -24
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/002-es256-post.json +0 -24
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/003-multiple-signature-labels.json +0 -24
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/004-default-port-stripped.json +0 -24
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/005-percent-encoded-path.json +0 -24
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/006-query-byte-preserved.json +0 -24
- package/compliance/cache/3.1.0-beta.7/test-vectors/webhook-signing/positive/007-body-without-idempotency-key.json +0 -25
- package/compliance/cache/3.1.0-beta.7/universal/billing-gate-dispatch.yaml +0 -450
- package/compliance/cache/3.1.0-beta.7/universal/canonical-format-validate-input.yaml +0 -640
- package/compliance/cache/3.1.0-beta.7/universal/capability-discovery.yaml +0 -125
- package/compliance/cache/3.1.0-beta.7/universal/collection-lists-pagination-integrity.yaml +0 -306
- package/compliance/cache/3.1.0-beta.7/universal/comply-controller-mode-gate.yaml +0 -141
- package/compliance/cache/3.1.0-beta.7/universal/content-standards-pagination-integrity.yaml +0 -326
- package/compliance/cache/3.1.0-beta.7/universal/deterministic-testing.yaml +0 -1430
- package/compliance/cache/3.1.0-beta.7/universal/error-compliance-signals.yaml +0 -377
- package/compliance/cache/3.1.0-beta.7/universal/error-compliance.yaml +0 -528
- package/compliance/cache/3.1.0-beta.7/universal/fictional-entities.yaml +0 -307
- package/compliance/cache/3.1.0-beta.7/universal/get-media-buys-pagination-integrity.yaml +0 -160
- package/compliance/cache/3.1.0-beta.7/universal/get-signals-pagination-integrity.yaml +0 -211
- package/compliance/cache/3.1.0-beta.7/universal/idempotency.yaml +0 -861
- package/compliance/cache/3.1.0-beta.7/universal/notification-config-event-scope.yaml +0 -119
- package/compliance/cache/3.1.0-beta.7/universal/notification-config-lifecycle.yaml +0 -337
- package/compliance/cache/3.1.0-beta.7/universal/notification-config-rejections.yaml +0 -107
- package/compliance/cache/3.1.0-beta.7/universal/pagination-integrity-creative-formats.yaml +0 -265
- package/compliance/cache/3.1.0-beta.7/universal/pagination-integrity-list-accounts.yaml +0 -245
- package/compliance/cache/3.1.0-beta.7/universal/pagination-integrity.yaml +0 -263
- package/compliance/cache/3.1.0-beta.7/universal/property-lists-pagination-integrity.yaml +0 -307
- package/compliance/cache/3.1.0-beta.7/universal/read-tool-idempotency.yaml +0 -405
- package/compliance/cache/3.1.0-beta.7/universal/runner-output-contract.yaml +0 -1266
- package/compliance/cache/3.1.0-beta.7/universal/schema-validation-signals.yaml +0 -181
- package/compliance/cache/3.1.0-beta.7/universal/schema-validation.yaml +0 -548
- package/compliance/cache/3.1.0-beta.7/universal/security.yaml +0 -539
- package/compliance/cache/3.1.0-beta.7/universal/signed-requests.yaml +0 -217
- package/compliance/cache/3.1.0-beta.7/universal/stale-response-advisory.yaml +0 -295
- package/compliance/cache/3.1.0-beta.7/universal/storyboard-schema.yaml +0 -2136
- package/compliance/cache/3.1.0-beta.7/universal/v3-envelope-integrity.yaml +0 -117
- package/compliance/cache/3.1.0-beta.7/universal/version-negotiation.yaml +0 -130
- package/compliance/cache/3.1.0-beta.7/universal/webhook-emission.yaml +0 -411
- package/compliance/cache/3.1.0-beta.7/universal/wholesale-feed-bulk-webhooks.yaml +0 -82
- package/compliance/cache/3.1.0-beta.7/universal/wholesale-feed-product-webhooks.yaml +0 -83
- package/compliance/cache/3.1.0-beta.7/universal/wholesale-feed-products.yaml +0 -151
- package/compliance/cache/3.1.0-beta.7/universal/wholesale-feed-signal-webhooks.yaml +0 -83
- package/compliance/cache/3.1.0-beta.7/universal/wholesale-feed-signals.yaml +0 -149
- package/dist/lib/types/v3-1-beta/index.d.mts +0 -1
- package/dist/lib/types/v3-1-beta/index.d.ts +0 -1
- package/dist/lib/types/v3-1-beta/index.mjs +0 -1
- package/dist/lib/types/v3-1-beta/tools.generated.d.mts +0 -26788
- package/dist/lib/types/v3-1-beta/tools.generated.d.ts +0 -26788
- /package/dist/lib/{types/v3-1-beta/tools.generated.mjs → media-buy/action-types.mjs} +0 -0
|
@@ -1,95 +1,302 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { canonicalJsonV1 } from "../source/index.mjs";
|
|
3
|
+
import { moreSevereReportingHealthV1, projectManagedDelivery } from "./handler.mjs";
|
|
4
|
+
import { compareReportingInstants } from "./instant.mjs";
|
|
3
5
|
import { projectReportingObligationHealthV1 } from "./health.mjs";
|
|
4
|
-
async function
|
|
6
|
+
async function resolveLedgerAsOf(input, attempt) {
|
|
7
|
+
const resolved = await input.store.readLedgerInstant?.() ?? (input.now ?? (() => /* @__PURE__ */ new Date()))().toISOString();
|
|
8
|
+
if (input.ledgerAsOf === void 0) return resolved;
|
|
9
|
+
if (input.store.readLedgerInstant) {
|
|
10
|
+
return attempt === 0 && compareReportingInstants(input.ledgerAsOf, resolved) <= 0 ? input.ledgerAsOf : resolved;
|
|
11
|
+
}
|
|
12
|
+
if (attempt === 0) return input.ledgerAsOf;
|
|
13
|
+
return compareReportingInstants(resolved, input.ledgerAsOf) > 0 ? resolved : input.ledgerAsOf;
|
|
14
|
+
}
|
|
15
|
+
async function reconcileEachIsolated(input, obligationIds) {
|
|
16
|
+
assertNotificationModesCompatible(input.store, input.subscribers);
|
|
17
|
+
for (const reporting_obligation_id of obligationIds) {
|
|
18
|
+
try {
|
|
19
|
+
await reconcileReportingStatusLifecycleV1({
|
|
20
|
+
store: input.store,
|
|
21
|
+
reporting_obligation_id,
|
|
22
|
+
// Selection needs one instant; each reconcile resolves its own so the
|
|
23
|
+
// watermark it writes is the cutoff it actually read at. The sweep's
|
|
24
|
+
// instant is handed down only as a fallback clock, for a store that
|
|
25
|
+
// has none of its own — pinning it would put the sweep's cutoff into
|
|
26
|
+
// every watermark, which is the skew problem over again.
|
|
27
|
+
...input.pinnedLedgerAsOf !== void 0 ? { ledgerAsOf: input.pinnedLedgerAsOf } : {},
|
|
28
|
+
now: () => new Date(input.ledgerAsOf),
|
|
29
|
+
subscribers: input.subscribers
|
|
30
|
+
});
|
|
31
|
+
} catch {
|
|
32
|
+
await input.store.recordLifecycleFailure?.({ reporting_obligation_id }).catch(() => void 0);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return obligationIds.length;
|
|
36
|
+
}
|
|
37
|
+
const MAX_LIFECYCLE_CAS_ATTEMPTS = 3;
|
|
38
|
+
function assertNotificationModesCompatible(store, subscribers) {
|
|
39
|
+
if (store.transactionalNotificationActivity === true && (subscribers?.length ?? 0) > 0) {
|
|
40
|
+
throw new Error("Transactional reporting notification activity and legacy subscribers are mutually exclusive");
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
async function retryLifecycle(input, attempt) {
|
|
44
|
+
if (attempt + 1 >= MAX_LIFECYCLE_CAS_ATTEMPTS) {
|
|
45
|
+
await input.store.recordLifecycleFailure?.({ reporting_obligation_id: input.reporting_obligation_id }).catch(() => void 0);
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
return reconcileReportingStatusLifecycleV1(input, attempt + 1);
|
|
49
|
+
}
|
|
50
|
+
async function reconcileReportingStatusLifecycleV1(input, attempt = 0) {
|
|
5
51
|
const obligation = await input.store.getObligation(input.reporting_obligation_id);
|
|
6
52
|
if (!obligation) throw new Error("Reporting obligation is unavailable");
|
|
53
|
+
const transactionalNotifications = input.store.transactionalNotificationActivity === true;
|
|
54
|
+
assertNotificationModesCompatible(input.store, input.subscribers);
|
|
55
|
+
let ledgerAsOf = await resolveLedgerAsOf(input, attempt);
|
|
7
56
|
const revisions = await input.store.listRevisions(obligation.reporting_obligation_id);
|
|
8
|
-
|
|
57
|
+
let projected = revisions;
|
|
58
|
+
const projectCore = (at) => projectReportingObligationHealthV1(
|
|
59
|
+
obligation,
|
|
60
|
+
projected,
|
|
61
|
+
at,
|
|
62
|
+
compareReportingInstants(obligation.period.end, at) <= 0
|
|
63
|
+
);
|
|
64
|
+
let coreProjection = projectCore(ledgerAsOf);
|
|
65
|
+
let composed = await composeManagedLifecycleProjection(
|
|
66
|
+
{ store: input.store, ledgerAsOf },
|
|
9
67
|
obligation,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Date.parse(obligation.period.end) <= Date.parse(input.ledgerAsOf)
|
|
68
|
+
projected,
|
|
69
|
+
coreProjection
|
|
13
70
|
);
|
|
71
|
+
const visibleRevisionIds = composed.visibleRevisionIds;
|
|
72
|
+
const scoped = visibleRevisionIds ? revisions.filter((value) => visibleRevisionIds.includes(value.reporting_revision_id)) : revisions;
|
|
73
|
+
if (composed.resolvedLedgerAsOf !== void 0 && compareReportingInstants(composed.resolvedLedgerAsOf, ledgerAsOf) !== 0 || scoped.length !== projected.length) {
|
|
74
|
+
ledgerAsOf = composed.resolvedLedgerAsOf ?? ledgerAsOf;
|
|
75
|
+
projected = scoped;
|
|
76
|
+
coreProjection = projectCore(ledgerAsOf);
|
|
77
|
+
composed = await composeManagedLifecycleProjection(
|
|
78
|
+
{ store: input.store, ledgerAsOf },
|
|
79
|
+
obligation,
|
|
80
|
+
projected,
|
|
81
|
+
coreProjection
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
const projection = composed.projection;
|
|
14
85
|
const transitions = await input.store.listTransitions(obligation.reporting_obligation_id);
|
|
15
|
-
|
|
86
|
+
const pendingTransitions = transitions.filter((value) => !value.notifiedAt);
|
|
87
|
+
if (transactionalNotifications && pendingTransitions.length > 0) {
|
|
88
|
+
throw new Error(
|
|
89
|
+
"Drain or explicitly resolve legacy pending reporting transitions before enabling transactional notification activity"
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
for (const pending of pendingTransitions) {
|
|
93
|
+
if (pending.previousHealth === pending.health) {
|
|
94
|
+
await input.store.markTransitionNotified(pending.transitionId, ledgerAsOf);
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
16
97
|
if (await notifyTransition(pending, obligation.account.account_id, input.subscribers)) {
|
|
17
|
-
await input.store.markTransitionNotified(pending.transitionId,
|
|
98
|
+
await input.store.markTransitionNotified(pending.transitionId, ledgerAsOf);
|
|
18
99
|
}
|
|
19
100
|
}
|
|
20
101
|
const latest = transitions.at(-1);
|
|
21
|
-
if (latest &&
|
|
102
|
+
if (latest && compareReportingInstants(ledgerAsOf, latest.occurredAt) < 0) return null;
|
|
22
103
|
const previousHealth = latest?.health ?? "waiting";
|
|
104
|
+
const finality = observedFinality(projected);
|
|
105
|
+
const previousFinality = await resolveFinalityBaseline(
|
|
106
|
+
input.store,
|
|
107
|
+
obligation.reporting_obligation_id,
|
|
108
|
+
latest,
|
|
109
|
+
finality
|
|
110
|
+
);
|
|
23
111
|
const nextIssueIds = new Set(projection.issues.map((issue) => issue.issueId));
|
|
24
|
-
const transition = previousHealth === projection.health ? void 0 : {
|
|
112
|
+
const transition = previousHealth === projection.health && previousFinality === finality ? void 0 : {
|
|
25
113
|
transitionId: `rst_${createHash("sha256").update(
|
|
26
114
|
canonicalJsonV1([
|
|
27
115
|
obligation.reporting_obligation_id,
|
|
28
116
|
previousHealth,
|
|
29
117
|
projection.health,
|
|
118
|
+
previousFinality,
|
|
119
|
+
finality,
|
|
30
120
|
[...nextIssueIds].sort(),
|
|
31
|
-
|
|
121
|
+
ledgerAsOf
|
|
32
122
|
])
|
|
33
123
|
).digest("base64url").slice(0, 32)}`,
|
|
34
124
|
reporting_obligation_id: obligation.reporting_obligation_id,
|
|
35
125
|
previousHealth,
|
|
36
126
|
health: projection.health,
|
|
127
|
+
previousFinality,
|
|
128
|
+
finality,
|
|
37
129
|
issueIds: [...nextIssueIds].sort(),
|
|
38
|
-
occurredAt:
|
|
130
|
+
occurredAt: ledgerAsOf
|
|
39
131
|
};
|
|
132
|
+
if (composed.obligatedConsumerRosterVersion !== void 0 && input.store.readObligatedConsumerRosterVersion) {
|
|
133
|
+
const current = await input.store.readObligatedConsumerRosterVersion({
|
|
134
|
+
reporting_obligation_id: obligation.reporting_obligation_id
|
|
135
|
+
});
|
|
136
|
+
if (current !== composed.obligatedConsumerRosterVersion) {
|
|
137
|
+
return retryLifecycle(input, attempt);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
40
140
|
const applied = await input.store.applyLifecycleProjection({
|
|
41
141
|
reporting_obligation_id: obligation.reporting_obligation_id,
|
|
42
142
|
expectedRevisionIds: revisions.map((value) => value.reporting_revision_id),
|
|
43
143
|
expectedPreviousHealth: previousHealth,
|
|
144
|
+
expectedPreviousFinality: previousFinality,
|
|
44
145
|
expectedObligationState: obligation.state,
|
|
45
146
|
expectedAttemptCount: obligation.attemptCount,
|
|
46
147
|
projectedIssues: projection.issues,
|
|
47
|
-
ledgerAsOf
|
|
48
|
-
...transition ? { transition } : {}
|
|
148
|
+
ledgerAsOf,
|
|
149
|
+
...transition ? { transition } : {},
|
|
150
|
+
...composed.managedStateVersion !== void 0 ? {
|
|
151
|
+
expectedManagedStateVersion: composed.managedStateVersion,
|
|
152
|
+
processedManagedStateVersion: composed.managedStateVersion
|
|
153
|
+
} : {},
|
|
154
|
+
...composed.obligatedConsumerRosterVersion !== void 0 ? {
|
|
155
|
+
processedObligatedConsumerRosterVersion: composed.obligatedConsumerRosterVersion,
|
|
156
|
+
// The re-check above is outside any transaction, so it leaves a
|
|
157
|
+
// window the store closes by fencing on the same value.
|
|
158
|
+
expectedObligatedConsumerRosterVersion: composed.obligatedConsumerRosterVersion
|
|
159
|
+
} : {}
|
|
49
160
|
});
|
|
50
|
-
if (!applied.applied
|
|
161
|
+
if (!applied.applied) return retryLifecycle(input, attempt);
|
|
162
|
+
if (!transition || !applied.transitionInserted) return null;
|
|
163
|
+
if (transactionalNotifications) return { ...transition, notifiedAt: ledgerAsOf };
|
|
164
|
+
if (transition.previousHealth === transition.health) {
|
|
165
|
+
await input.store.markTransitionNotified(transition.transitionId, ledgerAsOf);
|
|
166
|
+
return { ...transition, notifiedAt: ledgerAsOf };
|
|
167
|
+
}
|
|
51
168
|
const notified = await notifyTransition(transition, obligation.account.account_id, input.subscribers);
|
|
52
|
-
if (notified) await input.store.markTransitionNotified(transition.transitionId,
|
|
53
|
-
return notified ? { ...transition, notifiedAt:
|
|
169
|
+
if (notified) await input.store.markTransitionNotified(transition.transitionId, ledgerAsOf);
|
|
170
|
+
return notified ? { ...transition, notifiedAt: ledgerAsOf } : transition;
|
|
171
|
+
}
|
|
172
|
+
const CONSUMER_SCOPED_RECEIPT_ISSUE_CODES = /* @__PURE__ */ new Set([
|
|
173
|
+
"RECEIPT_REQUIRED",
|
|
174
|
+
"RECEIPT_REJECTED",
|
|
175
|
+
"ADJUSTMENT_RECEIPT_REQUIRED",
|
|
176
|
+
"ADJUSTMENT_RECEIPT_REJECTED"
|
|
177
|
+
]);
|
|
178
|
+
async function composeManagedLifecycleProjection(input, obligation, revisions, coreProjection) {
|
|
179
|
+
if (!input.store.getManagedLifecycleProjection) return { projection: coreProjection };
|
|
180
|
+
const managed = await input.store.getManagedLifecycleProjection({
|
|
181
|
+
reporting_obligation_id: obligation.reporting_obligation_id,
|
|
182
|
+
ledgerAsOf: input.ledgerAsOf
|
|
183
|
+
});
|
|
184
|
+
if (!managed) return { projection: coreProjection };
|
|
185
|
+
const stored = await input.store.listAdjustments(obligation.reporting_obligation_id);
|
|
186
|
+
const visibleAdjustmentIds = managed.visibleAdjustmentIds;
|
|
187
|
+
const adjustments = visibleAdjustmentIds ? stored.filter((value) => visibleAdjustmentIds.includes(value.reporting_adjustment_id)) : stored.filter((value) => compareReportingInstants(value.createdAt, input.ledgerAsOf) <= 0);
|
|
188
|
+
const rosterAuthoritative = managed.obligatedConsumerRosterComplete === true && managed.receiptEvidenceComplete !== false;
|
|
189
|
+
const observed = rosterAuthoritative ? [] : managed.consumers;
|
|
190
|
+
const byConsumer = new Map(observed.map((value) => [value.consumer_id, value]));
|
|
191
|
+
for (const consumerId of managed.obligatedConsumerIds ?? []) {
|
|
192
|
+
if (!byConsumer.has(consumerId)) {
|
|
193
|
+
const submitted = managed.consumers.find((value) => value.consumer_id === consumerId);
|
|
194
|
+
byConsumer.set(consumerId, submitted ?? { consumer_id: consumerId, receipts: [], adjustmentReceipts: [] });
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
const consumers = [...byConsumer.values()];
|
|
198
|
+
if (!consumers.length || managed.binding.reconciliation_mode === "consumer_receipt" && !rosterAuthoritative) {
|
|
199
|
+
consumers.push({ receipts: [], adjustmentReceipts: [] });
|
|
200
|
+
}
|
|
201
|
+
let health = coreProjection.health;
|
|
202
|
+
let satisfied = coreProjection.satisfied;
|
|
203
|
+
let suppressedReceiptIssue = false;
|
|
204
|
+
const issues = new Map(coreProjection.issues.map((value) => [value.issueId, value]));
|
|
205
|
+
for (const consumer of consumers) {
|
|
206
|
+
const projected = projectManagedDelivery({
|
|
207
|
+
obligation,
|
|
208
|
+
binding: managed.binding,
|
|
209
|
+
revisions,
|
|
210
|
+
adjustments,
|
|
211
|
+
materializations: managed.materializations,
|
|
212
|
+
materializationHistory: managed.materializationHistory,
|
|
213
|
+
receipts: consumer.receipts,
|
|
214
|
+
adjustmentReceipts: consumer.adjustmentReceipts,
|
|
215
|
+
base: coreProjection,
|
|
216
|
+
ledgerAsOf: input.ledgerAsOf,
|
|
217
|
+
// Scoped to the consumer being projected. An acceptance A left behind
|
|
218
|
+
// must never settle the obligation for B, which would let a webhook go
|
|
219
|
+
// complete while B's own read still says action_required.
|
|
220
|
+
// The anonymous fail-safe consumer owns no acceptances. Matching every
|
|
221
|
+
// tombstone to it let one consumer's pruned acceptance satisfy the
|
|
222
|
+
// stand-in for "someone unknown may still owe a receipt", flipping an
|
|
223
|
+
// incomplete-roster obligation to complete while real consumers were
|
|
224
|
+
// still pending.
|
|
225
|
+
tombstonedAcceptedSubjects: consumer.consumer_id === void 0 ? [] : (managed.tombstonedAcceptedSubjects ?? []).filter((value) => value.consumerId === consumer.consumer_id),
|
|
226
|
+
tombstonedDeliveredRevisionIds: managed.tombstonedDeliveredRevisionIds
|
|
227
|
+
});
|
|
228
|
+
if (!projected) continue;
|
|
229
|
+
health = moreSevereReportingHealthV1(health, projected.projection.health);
|
|
230
|
+
satisfied = satisfied && projected.projection.satisfied;
|
|
231
|
+
for (const issue of projected.projection.issues) {
|
|
232
|
+
if (CONSUMER_SCOPED_RECEIPT_ISSUE_CODES.has(issue.code)) {
|
|
233
|
+
suppressedReceiptIssue = true;
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
issues.set(issue.issueId, issue);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
if (suppressedReceiptIssue) {
|
|
240
|
+
const issueId = `reporting-issue.reconciliation-outstanding.${obligation.reporting_obligation_id}`;
|
|
241
|
+
issues.set(issueId, {
|
|
242
|
+
issueId,
|
|
243
|
+
reporting_obligation_id: obligation.reporting_obligation_id,
|
|
244
|
+
code: "RECEIPT_REQUIRED",
|
|
245
|
+
severity: "action_required",
|
|
246
|
+
responsibleParty: "buyer",
|
|
247
|
+
recommendedAction: "contact_buyer",
|
|
248
|
+
openedAt: obligation.expectedAt,
|
|
249
|
+
observedAt: input.ledgerAsOf
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
return {
|
|
253
|
+
projection: { ...coreProjection, health, satisfied, issues: [...issues.values()] },
|
|
254
|
+
...managed.managedStateVersion !== void 0 ? { managedStateVersion: managed.managedStateVersion } : {},
|
|
255
|
+
...managed.obligatedConsumerRosterVersion !== void 0 ? { obligatedConsumerRosterVersion: managed.obligatedConsumerRosterVersion } : {},
|
|
256
|
+
...managed.resolvedLedgerAsOf !== void 0 ? { resolvedLedgerAsOf: managed.resolvedLedgerAsOf } : {},
|
|
257
|
+
...managed.visibleRevisionIds !== void 0 ? { visibleRevisionIds: managed.visibleRevisionIds } : {}
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
async function resolveFinalityBaseline(store, reporting_obligation_id, latest, observed) {
|
|
261
|
+
if (!latest) return "none";
|
|
262
|
+
if (latest.finality) return latest.finality;
|
|
263
|
+
if (store.resolveTransitionFinalityBaseline) {
|
|
264
|
+
return store.resolveTransitionFinalityBaseline(reporting_obligation_id);
|
|
265
|
+
}
|
|
266
|
+
return observed;
|
|
267
|
+
}
|
|
268
|
+
function observedFinality(revisions) {
|
|
269
|
+
if (revisions.some((value) => value.finality === "official")) return "official";
|
|
270
|
+
return revisions.length > 0 ? "snapshot" : "none";
|
|
54
271
|
}
|
|
55
272
|
async function retryReportingStatusNotificationsV1(input) {
|
|
56
273
|
const pending = await input.store.listPendingTransitions({
|
|
57
274
|
...input.account_id ? { account_id: input.account_id } : {},
|
|
58
275
|
limit: input.limit ?? 100
|
|
59
276
|
});
|
|
277
|
+
const ledgerAsOf = input.ledgerAsOf ?? await input.store.readLedgerInstant?.() ?? input.fallbackLedgerAsOf ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
60
278
|
const obligationIds = [...new Set(pending.map((value) => value.reporting_obligation_id))];
|
|
61
|
-
|
|
62
|
-
await reconcileReportingStatusLifecycleV1({
|
|
63
|
-
store: input.store,
|
|
64
|
-
reporting_obligation_id,
|
|
65
|
-
ledgerAsOf: input.ledgerAsOf,
|
|
66
|
-
subscribers: input.subscribers
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
return obligationIds.length;
|
|
279
|
+
return reconcileEachIsolated({ ...input, ledgerAsOf, pinnedLedgerAsOf: input.ledgerAsOf }, obligationIds);
|
|
70
280
|
}
|
|
71
281
|
async function reconcileReportingStatusDeadlinesV1(input) {
|
|
72
282
|
const limit = input.limit ?? 1e3;
|
|
73
283
|
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 1e3) throw new RangeError("limit must be 1..1000");
|
|
74
|
-
const
|
|
75
|
-
if (!Number.isFinite(
|
|
284
|
+
const ledgerAsOf = input.ledgerAsOf ?? await input.store.readLedgerInstant?.() ?? input.fallbackLedgerAsOf ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
285
|
+
if (!Number.isFinite(Date.parse(ledgerAsOf))) throw new TypeError("ledgerAsOf must be an RFC 3339 instant");
|
|
286
|
+
await input.store.refreshObligatedConsumerRosterVersions?.({
|
|
287
|
+
...input.account_id ? { account_id: input.account_id } : {},
|
|
288
|
+
limit
|
|
289
|
+
});
|
|
76
290
|
const due = (await input.store.listLifecycleDueObligations({
|
|
77
|
-
ledgerAsOf
|
|
291
|
+
ledgerAsOf,
|
|
78
292
|
...input.account_id ? { account_id: input.account_id } : {},
|
|
79
293
|
limit
|
|
80
294
|
})).map((value) => value.reporting_obligation_id);
|
|
81
|
-
|
|
82
|
-
await reconcileReportingStatusLifecycleV1({
|
|
83
|
-
store: input.store,
|
|
84
|
-
reporting_obligation_id,
|
|
85
|
-
ledgerAsOf: input.ledgerAsOf,
|
|
86
|
-
subscribers: input.subscribers
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
return due.length;
|
|
295
|
+
return reconcileEachIsolated({ ...input, ledgerAsOf, pinnedLedgerAsOf: input.ledgerAsOf }, due);
|
|
90
296
|
}
|
|
91
297
|
async function notifyTransition(transition, accountId, configured) {
|
|
92
298
|
const subscribers = (configured ?? []).filter((value) => value.account_id === accountId);
|
|
299
|
+
if (subscribers.length === 0) return true;
|
|
93
300
|
if (subscribers.length > 64) throw new Error("Reporting status subscriber fanout exceeds 64");
|
|
94
301
|
const results = await Promise.allSettled(
|
|
95
302
|
subscribers.map(
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import type { ReportingMaterialization, SyncReportingReceiptsResponse } from '../../types/index.mjs';
|
|
2
|
+
import type { ReportingPgPool } from './postgres.mjs';
|
|
3
|
+
import type { ReportingManagedDeliveryBindingV1, ReportingLedgerStore } from './types.mjs';
|
|
4
|
+
import { type ReportingDestinationAuthorizationV1, type ReportingDestinationRevocationLeaseV1, type ReportingManagedDeliveryLeaseV1, type ReportingManagedDeliveryAdvertisedPoliciesV1, type ReportingManagedDeliveryStore, type ReportingReceiptBatchInputV1 } from './managed.mjs';
|
|
5
|
+
/**
|
|
6
|
+
* Additive migration owned by #2944. It intentionally does not alter the Core
|
|
7
|
+
* tables so the #2943 notification/activity bridge can evolve that schema
|
|
8
|
+
* independently. Apply after REPORTING_LEDGER_MIGRATION in the same schema.
|
|
9
|
+
*/
|
|
10
|
+
export declare const REPORTING_MANAGED_DELIVERY_MIGRATION: string;
|
|
11
|
+
export interface PostgresReportingManagedDeliveryStoreOptions {
|
|
12
|
+
/**
|
|
13
|
+
* The `automated_recovery_window_seconds` this deployment advertises.
|
|
14
|
+
*
|
|
15
|
+
* The capability is agent-wide and immutable once published, while bindings
|
|
16
|
+
* arrive over time, so validating only at startup leaves the window open:
|
|
17
|
+
* an agent advertising 60s starts clean and a 900s binding installed an hour
|
|
18
|
+
* later silently makes the published promise false until the next restart.
|
|
19
|
+
* Set here, `installBinding` refuses any Core configuration whose recovery
|
|
20
|
+
* window exceeds the advertised bound, inside the same transaction that
|
|
21
|
+
* checks binding eligibility. `createReportingManagedDeliveryRuntime` adopts
|
|
22
|
+
* its own advertised value into the store at wiring time, so setting it
|
|
23
|
+
* explicitly is only needed when bindings are installed without a runtime.
|
|
24
|
+
*/
|
|
25
|
+
advertisedRecoveryWindowSeconds?: number;
|
|
26
|
+
/**
|
|
27
|
+
* The `status_retention_days` this deployment advertises.
|
|
28
|
+
*
|
|
29
|
+
* Supply it together with `evidenceRetentionDays` so the store can refuse a
|
|
30
|
+
* retention shorter than a horizon you have already promised. Pruning
|
|
31
|
+
* evidence the capability document still says is queryable is a broken
|
|
32
|
+
* promise, not a capacity optimisation.
|
|
33
|
+
*/
|
|
34
|
+
statusRetentionDays?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Days of managed evidence an account is still accountable for.
|
|
37
|
+
*
|
|
38
|
+
* MAX_MATERIALIZATIONS_PER_ACCOUNT and MAX_RECEIPTS_PER_CONSUMER are
|
|
39
|
+
* lifetime counts. Left unbounded they are a one-way door: a long-lived
|
|
40
|
+
* account eventually reaches them and then stops planning materializations
|
|
41
|
+
* and refuses every receipt, permanently, with no operator-visible way back
|
|
42
|
+
* — evidence is immutable, so nothing ever frees capacity.
|
|
43
|
+
*
|
|
44
|
+
* Setting this makes the caps active-scope: only evidence recorded inside
|
|
45
|
+
* the window counts against them, and `pruneExpiredEvidence` can delete what
|
|
46
|
+
* falls outside it. Choose a value at least as long as the
|
|
47
|
+
* `status_retention_days` you advertise, since that is the period you
|
|
48
|
+
* promised the metadata stays queryable. Omit it to keep the previous
|
|
49
|
+
* lifetime accounting with no pruning.
|
|
50
|
+
*/
|
|
51
|
+
evidenceRetentionDays?: number;
|
|
52
|
+
}
|
|
53
|
+
export declare class PostgresReportingManagedDeliveryStore implements ReportingManagedDeliveryStore {
|
|
54
|
+
private readonly pool;
|
|
55
|
+
private readonly evidenceRetentionDays;
|
|
56
|
+
private readonly statusRetentionDays;
|
|
57
|
+
private readonly pendingRecoveryWindowSeconds;
|
|
58
|
+
private policyRegistered;
|
|
59
|
+
/**
|
|
60
|
+
* Durably records the agent-wide advertised recovery window.
|
|
61
|
+
*
|
|
62
|
+
* Written to the database, not held in memory: the promise is agent-wide,
|
|
63
|
+
* so a second store instance — in this process or another replica — must be
|
|
64
|
+
* held to the same value, and `installBinding` must read it inside its own
|
|
65
|
+
* transaction rather than trusting whatever the local object happens to
|
|
66
|
+
* know. Multiple replicas monotonically retain the smallest registered
|
|
67
|
+
* maximum: a shorter recovery promise is stronger and can never be widened
|
|
68
|
+
* by a later runtime.
|
|
69
|
+
*/
|
|
70
|
+
adoptAdvertisedRecoveryWindowSeconds(seconds: number): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Durably records the advertised `status_retention_days`.
|
|
73
|
+
*
|
|
74
|
+
* Retention is enforced against the widest promise any runtime registered
|
|
75
|
+
* over this database, so a store configured with a short evidence retention
|
|
76
|
+
* cannot prune inside a horizon a differently configured runtime published.
|
|
77
|
+
*/
|
|
78
|
+
adoptAdvertisedStatusRetentionDays(days: number): Promise<void>;
|
|
79
|
+
/** Registers the complete capability policy under one lock and transaction. */
|
|
80
|
+
adoptAdvertisedPolicies(policy: ReportingManagedDeliveryAdvertisedPoliciesV1): Promise<ReportingManagedDeliveryAdvertisedPoliciesV1>;
|
|
81
|
+
/**
|
|
82
|
+
* Flushes constructor-supplied promises into the durable registry.
|
|
83
|
+
*
|
|
84
|
+
* Called from every entry point that depends on them, so a store built with
|
|
85
|
+
* options behaves identically to one a runtime adopted into.
|
|
86
|
+
*/
|
|
87
|
+
private ensurePolicyRegistered;
|
|
88
|
+
private upsertPolicy;
|
|
89
|
+
private upsertPolicies;
|
|
90
|
+
private validateRecoveryWindow;
|
|
91
|
+
private readPolicyRow;
|
|
92
|
+
private readPolicy;
|
|
93
|
+
constructor(pool: ReportingPgPool, options?: PostgresReportingManagedDeliveryStoreOptions);
|
|
94
|
+
/** SQL fragment scoping a count to the active retention window, if one is set. */
|
|
95
|
+
private activeScope;
|
|
96
|
+
/**
|
|
97
|
+
* Deletes managed evidence that has aged out of `evidenceRetentionDays`.
|
|
98
|
+
*
|
|
99
|
+
* Only ever removes evidence the deployment no longer promises: nothing
|
|
100
|
+
* inside the retention window, nothing still `pending` or leased, and no
|
|
101
|
+
* receipt batch inside its own replay retention. Immutable evidence stays
|
|
102
|
+
* immutable while it is retained — this frees capacity at the far end of the
|
|
103
|
+
* window rather than rewriting anything. Returns what it removed so a
|
|
104
|
+
* scheduler can page through with `limit`.
|
|
105
|
+
*/
|
|
106
|
+
pruneExpiredEvidence(input: {
|
|
107
|
+
account_id: string;
|
|
108
|
+
limit?: number;
|
|
109
|
+
}): Promise<{
|
|
110
|
+
materializations: number;
|
|
111
|
+
receipts: number;
|
|
112
|
+
batches: number;
|
|
113
|
+
}>;
|
|
114
|
+
probe(coreStore: ReportingLedgerStore): Promise<boolean>;
|
|
115
|
+
listInstalledRecoveryWindowSeconds(): Promise<number[]>;
|
|
116
|
+
authorizeDestination(input: Omit<ReportingDestinationAuthorizationV1, 'revoked_at' | 'cleanup_completed_at'>): Promise<void>;
|
|
117
|
+
revokeDestination(input: {
|
|
118
|
+
account_id: string;
|
|
119
|
+
destination_ref: string;
|
|
120
|
+
generation: number;
|
|
121
|
+
revoked_at: string;
|
|
122
|
+
}): Promise<boolean>;
|
|
123
|
+
installBinding(binding: ReportingManagedDeliveryBindingV1): Promise<{
|
|
124
|
+
inserted: boolean;
|
|
125
|
+
}>;
|
|
126
|
+
planMaterializations(input?: {
|
|
127
|
+
account_id?: string;
|
|
128
|
+
limit?: number;
|
|
129
|
+
}): Promise<number>;
|
|
130
|
+
claimMaterialization(input: {
|
|
131
|
+
owner: string;
|
|
132
|
+
now: string;
|
|
133
|
+
lease_milliseconds: number;
|
|
134
|
+
account_id?: string;
|
|
135
|
+
}): Promise<ReportingManagedDeliveryLeaseV1 | null>;
|
|
136
|
+
/**
|
|
137
|
+
* Fails materializations that have used every delivery attempt.
|
|
138
|
+
*
|
|
139
|
+
* The claim predicate stops handing them out, so without this they would
|
|
140
|
+
* stay `pending` — invisible to the planner, which skips an obligation with
|
|
141
|
+
* any pending row, and so never retried or replanned.
|
|
142
|
+
*/
|
|
143
|
+
failExhaustedMaterializations(input?: {
|
|
144
|
+
account_id?: string;
|
|
145
|
+
limit?: number;
|
|
146
|
+
}): Promise<number>;
|
|
147
|
+
settleMaterialization(input: {
|
|
148
|
+
lease: ReportingManagedDeliveryLeaseV1;
|
|
149
|
+
now: string;
|
|
150
|
+
/** Retention the database must see satisfied, not just the worker. */
|
|
151
|
+
minimum_resource_retention_days?: number;
|
|
152
|
+
outcome: {
|
|
153
|
+
status: 'available' | 'delivered';
|
|
154
|
+
resource: NonNullable<ReportingMaterialization['resource']>;
|
|
155
|
+
verification: NonNullable<ReportingMaterialization['verification']>;
|
|
156
|
+
} | {
|
|
157
|
+
status: 'failed';
|
|
158
|
+
failure_code: string;
|
|
159
|
+
};
|
|
160
|
+
}): Promise<boolean>;
|
|
161
|
+
claimRevocation(input: {
|
|
162
|
+
owner: string;
|
|
163
|
+
now: string;
|
|
164
|
+
lease_milliseconds: number;
|
|
165
|
+
account_id?: string;
|
|
166
|
+
authorization_revocation_seconds?: number;
|
|
167
|
+
steal_after_milliseconds?: number;
|
|
168
|
+
}): Promise<ReportingDestinationRevocationLeaseV1 | null>;
|
|
169
|
+
completeRevocation(input: {
|
|
170
|
+
lease: ReportingDestinationRevocationLeaseV1;
|
|
171
|
+
completed_at: string;
|
|
172
|
+
}): Promise<boolean>;
|
|
173
|
+
releaseRevocation(input: {
|
|
174
|
+
lease: ReportingDestinationRevocationLeaseV1;
|
|
175
|
+
backoff_milliseconds?: number;
|
|
176
|
+
}): Promise<boolean>;
|
|
177
|
+
getReadableResource(input: {
|
|
178
|
+
account_id: string;
|
|
179
|
+
resource_ref: string;
|
|
180
|
+
}): Promise<{
|
|
181
|
+
materialization: {
|
|
182
|
+
reporting_materialization_id: string;
|
|
183
|
+
reporting_revision_id: string;
|
|
184
|
+
reporting_obligation_id: string;
|
|
185
|
+
delivery_config_id: string;
|
|
186
|
+
delivery_config_version: number;
|
|
187
|
+
destination_ref: string;
|
|
188
|
+
feed_purpose: import("../../types/tools.generated.mjs").ReportingFeedPurpose;
|
|
189
|
+
method: "file_transfer" | "dataset_share" | "warehouse_materialization";
|
|
190
|
+
transport?: string;
|
|
191
|
+
attempt: number;
|
|
192
|
+
status: "pending" | "available" | "delivered" | "failed";
|
|
193
|
+
ready_at?: string;
|
|
194
|
+
failed_at?: string;
|
|
195
|
+
failure_code?: string;
|
|
196
|
+
resource?: import("../../types/index.mjs").ReportingResource;
|
|
197
|
+
verification?: import("../../types/index.mjs").ReportingVerification;
|
|
198
|
+
created_at: string;
|
|
199
|
+
};
|
|
200
|
+
binding: ReportingManagedDeliveryBindingV1;
|
|
201
|
+
} | null>;
|
|
202
|
+
isAuthorizationCurrent(input: {
|
|
203
|
+
account_id: string;
|
|
204
|
+
destination_ref: string;
|
|
205
|
+
generation: number;
|
|
206
|
+
}): Promise<boolean>;
|
|
207
|
+
syncReceiptBatch(input: ReportingReceiptBatchInputV1): Promise<SyncReportingReceiptsResponse['results']>;
|
|
208
|
+
/**
|
|
209
|
+
* Rebuilds a prior batch response from the compact replay record plus the
|
|
210
|
+
* append-only receipt rows, re-checking authorization exactly as the first
|
|
211
|
+
* call did so a revoked destination cannot be replayed back into disclosure.
|
|
212
|
+
*/
|
|
213
|
+
/**
|
|
214
|
+
* Replays a prior batch response exactly.
|
|
215
|
+
*
|
|
216
|
+
* An exact same-key replay is side-effect free and returns the caller its own
|
|
217
|
+
* previously recorded verdict, so later revocation of the destination does
|
|
218
|
+
* not change it. Downgrading a replay to `failed` once authorization ended
|
|
219
|
+
* broke the protocol-wide rule that a replayed idempotency key returns the
|
|
220
|
+
* same response, and bought nothing: the body is the caller's own receipt
|
|
221
|
+
* echoed back with the verdict it already received, so a revoked caller
|
|
222
|
+
* learns nothing it did not already hold. Fail-closed still governs every
|
|
223
|
+
* path that *accepts* new evidence — `loadReceiptEvidence` joins
|
|
224
|
+
* `revoked_at IS NULL` — and nothing here reads another consumer's rows.
|
|
225
|
+
*/
|
|
226
|
+
private replayReceiptBatch;
|
|
227
|
+
private recordReceipt;
|
|
228
|
+
private loadReceiptEvidence;
|
|
229
|
+
private transaction;
|
|
230
|
+
private query;
|
|
231
|
+
}
|