Follow-on to v1.4.35. Removes the operator action that was implicit in the foundation release: instead of self-hosters having to run pnpm tsx scripts/backfill-rollups.ts after upgrading, the worker boot now discovers any account with measurements but no rollup coverage and enqueues a one-shot full fold via pg-boss. Idempotent across reboots and zero reader-path impact (serial concurrency, runs in the background).
What changed
- New
rollup-full-backfillqueue (concurrency = 1) carrying{ userId, enqueuedAt }. The handler invokesrecomputeUserRollups(userId)with the default 5-year window across all four granularities — equivalent to the manual CLI run, but inside the worker process so notsxinstall gymnastics in production images. enqueueBootTimeRollupBackfillruns once atstartReminderWorkerboot after everyboss.worksubscription is in place. The discovery query finds users with at least one row inmeasurementsand zero rows inmeasurement_rollups, then sends one job per uncovered account withsingletonKey: boot-backfill|{userId}so a fast restart while a fold is queued doesn't pile up duplicates.- Best-effort: any error during discovery is captured in the return value and logged through
workerLog; the worker boot never fails because the backfill missed.
Why this matters for self-hosters
v1.4.35 shipped a scripts/backfill-rollups.ts CLI for the one-shot historical fold, but running it on a production container requires pnpm dlx tsx plus a manual symlink for the Prisma client (devDeps + pnpm symlink layout aren't part of the Next.js standalone image). This release moves that work onto the worker boot so the activation path is genuinely zero-touch.
Tests
- 5 new unit cases pin the helper's contract (silent no-op without boss, one job per uncovered user, singleton-key coalesce counted as
skipped, error surfacing, zero-users path). - 2 new integration cases verify against a real Postgres testcontainer: only the uncovered user lands on the queue when a third already-folded user co-exists; zero jobs enqueued when every account is already covered.
- Unit suite 4280 → 4285. Integration suite 228 → 230.
pnpm typecheck+pnpm lintclean.