Add daily Luminate catalog stream tracking
Catalog stream history currently depends on public cumulative Spotify counters and manual native exports. This adds opt-in Luminate collection by ISRC, a 62-day initial backfill and automatic daily refreshes, with saved calendar-day history and equal-period growth through shared REST/MCP logic.
The integration stores worldwide aggregate streams across reporting DSPs separately from Spotify-only public counters. Missing dates stay unknown, explicit zeros remain zero, identity changes suppress comparisons, and correction versions are retained. Daily refreshes reuse unchanged values while recording fresh coverage/provenance receipts. Controls share a 10/minute account throttle across REST/MCP; reads use bounded parallel SQL queries; temporary, authentication and revocation failures remain distinct. Source retrieval time is separate from unavailable upstream update time.
- POST/GET
/api/catalogs/{catalogId}/stream-tracking: enable, pause, refresh and status. - GET
/api/catalogs/{catalogId}/streams: paginated daily history, coverage and growth. - Standard MCP:
manage_catalog_stream_tracking,get_catalog_streams; delegated OAuth remains hidden/denied. - Vercel Cron → durable dispatcher → per-catalog workflow. Atomic day/revision claims prevent duplicate collection; membership/access/revision fences stop revoked writes. Fetch and write are separate memoized steps, with bounded retries and per-recording failure isolation.
Validation: 266 final focused tests passed (39 files); OAuth regression suite 188 passed/1 skipped; lint passed with two generated-workflow warnings; production webpack build and OAuth bundle trace checks passed; disposable PostgreSQL 17 service-role tests passed. A bounded real adapter probe returned 28 daily observations and the expected aggregate total for a verified low-volume recording. Private source records and credentials are excluded from Git.
Release dependencies: database PR https://github.com/recoupable/database/pull/93 must be applied before this API; docs https://github.com/recoupable/docs/pull/354. Configure server-only LUMINATE_API_KEY, LUMINATE_USERNAME, LUMINATE_PASSWORD and existing CRON_SECRET before activation. The three scoped database migrations are applied and verified in production, with anonymous/browser table access denied. Server-only provider credentials are configured. API merge and production collection are pending final CI. MVP limit: 250 recordings/catalog; source window ends two UTC dates before collection. A failed daily claim is eligible for a new run the next day. Live authenticated readback and actual cron execution remain release checks.
The existing public playcount history and native CSV parser/comparator remain available as separate sources. Tracking issue: https://github.com/recoupable/app/issues/2177.