Goals
- Validate parsing, dedupe, day/week windows, thresholds.
- Validate public API behavior for current week, history, daily, trends.
- Prevent privacy regressions (no quotes/PII).
- Detect AI drift with golden outputs and schema validation.
- Ensure idempotency across replays and retries.
Sources: beacon-platform/docs/testing.md
Test matrix
Unit
- WhatsApp parsing formats, multi-line handling, system/media filtering.
- Dedup normalization and hashing.
- PII redaction utilities and theme sanitization.
- AI guardrails: schema validation, privacy regex, score clamping.
- Sentiment trend math.
Integration
- Ingest endpoints: /presign, /upload, /files, /exports/progress, /clear.
- Queue handler end-to-end with mocked R2/D1/AI.
- Quota paths and weekly thresholds.
- Public endpoints and HTML renders.
End-to-end
- Local or staging: upload → queue → D1 → public endpoints.
AI testing
- Golden outputs, schema checks, regression detection, privacy checks.
Sources: beacon-platform/docs/testing.md
CI and release gates
- PR: lint, typecheck, unit, integration.
- Nightly: heavier integration and golden-output checks.
- Release: staging smoke tests for /pulse.json, /pulse, /pulse/embed, /pulse/trends.json.
Sources: beacon-platform/docs/testing.md