1 Commits

Author SHA1 Message Date
Alex Newman
ccd907dc58 feat(telemetry): PostHog historical backfill — anonymized daily rollups + inferred install date (#2912)
* feat(telemetry): add PostHog historical backfill module (Phase 1)

One-time anonymized daily-rollup backfill: collectDailyRollups with pinned
aggregation semantics, sessions-first install-day inference, deterministic
v5 event uuids, 9-step gated transport (marker/consent/debug gates,
historicalMigration client, marker only on clean shutdown). Whitelist
additions in scrub.ts/common.ts, extended PostHog test mock, full (a)-(k)
test coverage. Per plans/2026-06-11-posthog-historical-backfill.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(telemetry): wire historical backfill into worker startup + docs disclosure

Fire-and-forget runHistoricalBackfill call in initializeBackground after
the worker_started capture (non-blocking, marker-gated one-shot, retries
on next start if delivery fails). New "Historical backfill" section in
docs/public/telemetry.mdx documenting what is sent, the once-per-install
marker, identical consent gates, and upload-time geo caveat. Phases 3-4
of plans/2026-06-11-posthog-historical-backfill.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs(telemetry): document dual-layer error handling on backfill call site

runHistoricalBackfill never rejects by contract; the .catch is the
unhandled-rejection backstop for the fire-and-forget call. Addresses
Greptile review on #2912.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 18:10:39 -07:00