You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 11, 2026. It is now read-only.
Visitor analytics can become high-volume quickly. After schema, collection, API, UI, and optional online enrichment are available, the module needs operational safeguards: rollup jobs, retention purge, config validation, readiness checks, and documentation.
This issue closes the operational and compliance loop for the Visitor Analytics epic.
Objective
Add visitor analytics rollup, retention purge, readiness/config checks, and documentation for online/offline operation, privacy, and security.
Aggregate awcms_mini_visit_events into awcms_mini_visitor_daily_rollups.
Support idempotent reruns for a date or date range.
Roll up per tenant and per area.
Populate human visitors, human pageviews, bot pageviews, authenticated unique users, public unique visitors, admin unique users, top paths, top browsers, top devices, and top countries where available.
Purge behavior:
Delete or anonymize raw/old detail according to retention config.
Preserve rollups within rollup retention.
Prefer small batches to avoid long locks.
Record purge summary to audit log.
Config/readiness checks:
VISITOR_ANALYTICS_RAW_IP_ENABLED=true without safe retention should fail readiness.
VISITOR_ANALYTICS_RAW_USER_AGENT_ENABLED=true without safe retention should warn/fail according to severity.
VISITOR_ANALYTICS_GEO_ENABLED=true without trusted source should fail.
VISITOR_ANALYTICS_EVENT_RETENTION_DAYS must be valid positive integer.
VISITOR_ANALYTICS_RAW_DETAIL_RETENTION_DAYS must be valid and should not exceed event retention unless explicitly justified.
VISITOR_ANALYTICS_ROLLUP_RETENTION_DAYS should not be shorter than event retention.
VISITOR_ANALYTICS_HASH_SALT should be required or strongly warned when stable hashing is enabled.
bun run security:readiness passes or reports expected warnings for safe defaults.
bun run check passes.
Security and privacy notes
Visitor analytics data can identify or profile users when combined with username, IP, user-agent, and location; default retention must be conservative.
Raw IP and raw user-agent should be short-lived and disabled by default.
Rollups should avoid storing personally identifiable detail.
Purge jobs must not silently delete audit trail entries except according to the existing audit retention mechanism.
Avoid long-running transactions and table locks during purge.
Context
Visitor analytics can become high-volume quickly. After schema, collection, API, UI, and optional online enrichment are available, the module needs operational safeguards: rollup jobs, retention purge, config validation, readiness checks, and documentation.
This issue closes the operational and compliance loop for the Visitor Analytics epic.
Objective
Add visitor analytics rollup, retention purge, readiness/config checks, and documentation for online/offline operation, privacy, and security.
Scope
Add scripts:
Add package scripts:
{ "analytics:rollup": "bun scripts/visitor-analytics-rollup.ts", "analytics:purge": "bun scripts/visitor-analytics-purge.ts" }Rollup behavior:
awcms_mini_visit_eventsintoawcms_mini_visitor_daily_rollups.Purge behavior:
Config/readiness checks:
VISITOR_ANALYTICS_RAW_IP_ENABLED=truewithout safe retention should fail readiness.VISITOR_ANALYTICS_RAW_USER_AGENT_ENABLED=truewithout safe retention should warn/fail according to severity.VISITOR_ANALYTICS_GEO_ENABLED=truewithout trusted source should fail.VISITOR_ANALYTICS_EVENT_RETENTION_DAYSmust be valid positive integer.VISITOR_ANALYTICS_RAW_DETAIL_RETENTION_DAYSmust be valid and should not exceed event retention unless explicitly justified.VISITOR_ANALYTICS_ROLLUP_RETENTION_DAYSshould not be shorter than event retention.VISITOR_ANALYTICS_HASH_SALTshould be required or strongly warned when stable hashing is enabled.Docs to update/add:
docs/awcms-mini/visitor-analytics.mddocs/awcms-mini/18_configuration_env_reference.mddocs/awcms-mini/deployment-profiles.mddocs/awcms-mini/20_threat_model_security_architecture.mdOut of scope
Acceptance criteria
bun run analytics:rollupexists and runs with Bun only.bun run analytics:purgeexists and runs with Bun only.bun run config:validatepasses.bun run security:readinesspasses or reports expected warnings for safe defaults.bun run checkpasses.Security and privacy notes
Dependencies
Depends on #617, #618, #620, and #621. Complements #622 and #623.
Repository audit addendum — privacy defaults and consent
Platform hardening epic: #679
The 2026-07-11 repository audit found two privacy-default gaps that belong in this existing operational/privacy issue rather than a duplicate issue:
.env.exampleenables visitor analytics by default.Extend this issue's scope and acceptance criteria as follows: