Simplify prepared analytics storage and separate shared report logic from SQL persistence, without changing the visible admin or visit-recording semantics.
Add pure @goto/analytics for canonical versioned JSON contracts, UTC period/day helpers, one batch encoding boundary, and lightweight readers.
Replace opaque report keys/shared period/empty/selection handling with explicit overview/domain/link identities and separate summary_json / details_json columns in analytics_reports.
Keep cards/tables on small summaries; details contain self-contained daily points and browser/OS breakdowns. Remove stored weekly/monthly series; no Chart.js or client grouping work is included.
Validate and serialize the batch before report invalidation/pruning. Keep the DB publisher focused on mapping pre-encoded rows and atomic SQL publication, without reparsing/recomputing reports.
Preserve grouped snapshot queries, request-time outcomes, finite retention, zero-policy handling and the existing hourly workflow/jitter. Migration 0007_analytics_reports replaces only the derived cache; retained raw visits remain the rebuild source.
Update workspace dependencies, private-package release metadata, both CI providers' dependency gates, and development source mounts/build ownership for the new package.
Commit structure
feat(analytics): add shared report document contracts — pure package, helpers/codecs, focused tests and workspace metadata.
refactor(analytics): switch to daily JSON report storage — coordinated persistence/worker/admin cutover, integration wiring and obsolete code removal.
Validation
Four independent review categories and affected correction re-reviews clean: readability, correctness/security, test quality and explicit reference parity.
Full pnpm verify passes: schema, builds, typechecks (Svelte 0 errors/0 warnings), formatting/lint, 508 workspace unit tests, 6 development-script tests, 7 Chromium integrations and 5 worker service cases.
Fresh pruned web/worker artifacts pass an isolated outside-repository smoke: dependencies contained, new cache preparation/pruning, separate daily JSON readers, six authenticated SSR scopes, valid-only/base metrics, compiled Piscina persistence and natural shutdown.
SQL projection regression test observes real SQLite statements, protecting summary-only versus details-only reads without full SQL snapshots.
No raw capture, authentication, public configuration or visible layout changes; no new analytics HTTP service or compatibility/rollback framework. Performance has not been benchmarked, and Docker execution remains owner-only. Local configuration, databases, seeded data, credentials and planning/review evidence are excluded.
## Summary
Simplify prepared analytics storage and separate shared report logic from SQL persistence, without changing the visible admin or visit-recording semantics.
- Add pure `@goto/analytics` for canonical versioned JSON contracts, UTC period/day helpers, one batch encoding boundary, and lightweight readers.
- Replace opaque report keys/shared period/empty/selection handling with explicit overview/domain/link identities and separate `summary_json` / `details_json` columns in `analytics_reports`.
- Keep cards/tables on small summaries; details contain self-contained daily points and browser/OS breakdowns. Remove stored weekly/monthly series; no Chart.js or client grouping work is included.
- Validate and serialize the batch before report invalidation/pruning. Keep the DB publisher focused on mapping pre-encoded rows and atomic SQL publication, without reparsing/recomputing reports.
- Preserve grouped snapshot queries, request-time outcomes, finite retention, zero-policy handling and the existing hourly workflow/jitter. Migration `0007_analytics_reports` replaces only the derived cache; retained raw visits remain the rebuild source.
- Update workspace dependencies, private-package release metadata, both CI providers' dependency gates, and development source mounts/build ownership for the new package.
## Commit structure
1. `feat(analytics): add shared report document contracts` — pure package, helpers/codecs, focused tests and workspace metadata.
2. `refactor(analytics): switch to daily JSON report storage` — coordinated persistence/worker/admin cutover, integration wiring and obsolete code removal.
## Validation
- Four independent review categories and affected correction re-reviews clean: readability, correctness/security, test quality and explicit reference parity.
- Full `pnpm verify` passes: schema, builds, typechecks (Svelte 0 errors/0 warnings), formatting/lint, **508 workspace unit tests**, **6 development-script tests**, **7 Chromium integrations** and **5 worker service cases**.
- Fresh pruned web/worker artifacts pass an isolated outside-repository smoke: dependencies contained, new cache preparation/pruning, separate daily JSON readers, six authenticated SSR scopes, valid-only/base metrics, compiled Piscina persistence and natural shutdown.
- Frozen/offline dependency restore, changeset status, whitespace and committed-source hash checks pass.
- SQL projection regression test observes real SQLite statements, protecting summary-only versus details-only reads without full SQL snapshots.
No raw capture, authentication, public configuration or visible layout changes; no new analytics HTTP service or compatibility/rollback framework. Performance has not been benchmarked, and Docker execution remains owner-only. Local configuration, databases, seeded data, credentials and planning/review evidence are excluded.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Simplify prepared analytics storage and separate shared report logic from SQL persistence, without changing the visible admin or visit-recording semantics.
@goto/analyticsfor canonical versioned JSON contracts, UTC period/day helpers, one batch encoding boundary, and lightweight readers.summary_json/details_jsoncolumns inanalytics_reports.0007_analytics_reportsreplaces only the derived cache; retained raw visits remain the rebuild source.Commit structure
feat(analytics): add shared report document contracts— pure package, helpers/codecs, focused tests and workspace metadata.refactor(analytics): switch to daily JSON report storage— coordinated persistence/worker/admin cutover, integration wiring and obsolete code removal.Validation
pnpm verifypasses: schema, builds, typechecks (Svelte 0 errors/0 warnings), formatting/lint, 508 workspace unit tests, 6 development-script tests, 7 Chromium integrations and 5 worker service cases.No raw capture, authentication, public configuration or visible layout changes; no new analytics HTTP service or compatibility/rollback framework. Performance has not been benchmarked, and Docker execution remains owner-only. Local configuration, databases, seeded data, credentials and planning/review evidence are excluded.