Skip to content

feat(reporting): complete seller-side Managed Delivery and Reconciled Billing #1167

Description

@bokelley

Summary

The beta.15 seller reporting stack implements Core reporting only. ReportingStatusHandler explicitly returns empty materializations and receipts, and obligation projection hardcodes reconciliation_mode="delivery_only". Buyer-side reconciliation and sync_reporting_receipts client primitives exist, but there is no corresponding SDK-owned seller path for Managed Delivery or Reconciled Billing.

That makes the optional capabilities present in the generated AdCP 3.2 schemas much harder to implement safely and prevents sellers from honestly advertising those tiers.

Requested seller-side vertical slice

Build the durable seller primitives that extend Core without weakening it:

  1. resolve a frozen destination configuration for an obligation;
  2. materialize the exact canonical revision through a pluggable destination writer;
  3. persist immutable delivery attempts/materializations and expose them in status;
  4. accept and authenticate sync_reporting_receipts idempotently;
  5. enforce receipt replacement, terminal accepted receipts, revision/digest matching, adjustment ordering, and caller visibility;
  6. project reconciliation counts/status and capability dependencies (reconciled_billing requires managed_delivery);
  7. emit transactional reporting delivery/ledger notifications through the reporting outbox.

Object-store/warehouse implementations can be separate adapters. The core SDK should define the contracts, persistence, state machine, and at least one reference destination implementation.

Acceptance criteria

  • Seller-side store/service protocols and PostgreSQL implementations persist immutable materializations, revision receipts, and adjustment receipts.
  • get_reporting_status returns tier-correct materializations/receipts and reconciliation projection, with strict account/consumer-principal isolation.
  • sync_reporting_receipts has a ready-to-mount seller handler with authentication, idempotency, immutable acceptance/replacement, and typed errors.
  • Destination credentials/configuration are resolved from trusted account state, frozen appropriately, and never leaked in status or logs.
  • Materializations are verified against the exact revision canonical content digest, row count, control totals, and declared format before becoming available/delivered.
  • Adjustments and their receipts preserve official-revision/finality rules.
  • Capability helpers enforce tier dependencies and refuse to advertise incomplete implementations.
  • A lifecycle/conformance fixture covers Core -> Managed Delivery -> Reconciled Billing, including corruption, retry, rejected receipt replacement, accepted terminal receipt, and adjustment reconciliation.
  • Existing Core-only deployments remain supported without destination or receipt dependencies.

Adopter impact

Embedded Sales Agent wants GAM, FreeWheel, and other source adapters to plug into one reliable pipeline while the SDK owns protocol state. We should not have to recreate the financial reconciliation state machine in every seller implementation.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions