/v1/accounting/*, /api/accounting, and
get_accounting_status) use that SQL ledger.
Storage boundary
ClickHouse continues to support legacy request telemetry and cost dashboards. An exact-accounting ClickHouse projection is not part of this release. No supported accounting endpoint reads ClickHouse, the reserved SQL projection table has no producer, and nopending_delivery field is exposed. Projection
schema, consumer, replay, deduplication, recovery, and central projection-health
reporting are deferred together so the product never reports a queue that no
worker maintains.
The producer-side SQLite outbox is different from that deferred projection. It
is supported and exposes pending, rejected, failed_delivery, oldest age,
memory depth, and capture failures through AccountingOutbox.health().
Compatibility matrix
Acceptance evidence
The committed gates are repeatable and use synthetic identities only:test_accounting_postgres_release.pymigrates a disposable PostgreSQL, creates a runtime role without schema-create or ledger-delete privileges, and verifies immutable revisions, independent sides, concurrent activation, Decimal rating, concurrent deduplication, mixed receipts, project/tenant isolation, acquisition privacy, delayed pinned prices, restart, and lost ack.test_livekit_accounting_integration.pyuses native LiveKit STT, TTS, LLM, and realtime base instances. It covers registration timing, cancellation, cache and realtime quantities, missing measurements, streaming segments, stable duplicate replay, ownership modes, tracing context, outage retention, and failed-delivery health.test_release_boundary.pyinstalls a fail-on-use ClickHouse sentinel and proves the supported accounting API/dashboard reads remain SQL-only and do not exposepending_delivery. It also freezes the legacy export privacy boundary.test_accounting_sync_example.pyruns the executable synchronization example against the ASGI API, including readback hash verification and delayed usage pinned to an older active price.
Skipped tests are classified by prerequisite and capability:
The three expected failures are pre-existing contracts outside the accounting
v1 boundary: one storage-architecture reach-through and two open telemetry
security gaps (unauthenticated audit-log read and an unscoped legacy project
parameter). They do not affect the principal-aware
/v1/accounting/*,
dashboard accounting, or tenant-bound MCP accounting paths verified here. They
do block claiming those separate architecture/security items complete.
Deployment and forward recovery
Deployment order:- Back up PostgreSQL and upgrade the collector so migration
a6c9e2f4b817is applied. - Start with the restricted runtime role and verify
/healthplus accounting capability discovery. - Synchronize and read back acquisition and selling revisions independently; activate only after canonical hashes and complete dimension sets match.
- Prepare one binding per offering, configure ownership, then roll producers forward. Monitor every producer outbox before using ledger totals for an invoice.
- Reconcile selling totals and completeness before retiring any legacy report.
downgrade() raises before changing schema so an automated rollback cannot
erase the ledger or API-key project allowlists.