Skip to content

feat: FEAT-129 Crisis Analytics Dashboard (Supabase-direct v1: views + runbook)#134

Merged
MP2EZ merged 2 commits into
developmentfrom
feat/feat-129-crisis-analytics-dashboard
Jun 6, 2026
Merged

feat: FEAT-129 Crisis Analytics Dashboard (Supabase-direct v1: views + runbook)#134
MP2EZ merged 2 commits into
developmentfrom
feat/feat-129-crisis-analytics-dashboard

Conversation

@MP2EZ
Copy link
Copy Markdown
Owner

@MP2EZ MP2EZ commented Jun 6, 2026

Closes FEAT-129

Operator-only crisis-safety observability over the crisis_detected event that INFRA-214 routes into Supabase analytics_events (vital-interests basis). Re-scoped v1 = Supabase-direct (PostHog-native path superseded by INFRA-214's routing decision). Backend + docs only — no app code ships.

What's included

  • Aggregate views (schema.sql §6b + migration 20260605000000_crisis_analytics_views.sql):
    • crisis_detection_daily — per-day mix by trigger_type × severity_bucket × assessment_type, with intervention_surfaced count.
    • crisis_detection_volume_daily — per-day volume (COUNT(*) authoritative + secondary distinct_sessions).
    • crisis_detection_liveness — total + last_detection_at for the post-release liveness check.
  • Founder runbook docs/development/crisis-analytics-runbook.md — the <5-min post-release confidence check: synthetic-detection liveness assertion, drift scan, monthly PII-free export, three-store latency split.

Privacy (compliance sign-off)

PII-free by construction: bucketed counts only, never user_id/session_id (the lone session_id use is COUNT(DISTINCT …), a cardinality), never SELECT *. Operator-only (not granted to authenticated/anon). k-anonymity NOT claimed (per DPIA v1.2); no low-count suppression (a safety monitor must not hide the first/rare crisis). severity_bucket='undefined' rows are surfaced, not filtered — they made the inline-Q9 emit bug visible (now fixed in DEBUG-218).

Notes

  • Drift alerting is deferred (native Supabase has no insight-alerting — needs pg_cron + edge function; tracked follow-up).
  • Built on commit a3ed368; crisis + compliance sign-off per the work item.

🤖 Generated with Claude Code

MP2EZ and others added 2 commits June 5, 2026 12:22
…+ runbook)

Re-scoped from PostHog-native to Supabase-direct after INFRA-214 routed the
crisis_detected event to Supabase analytics_events (GDPR vital-interests basis;
PostHog legally cannot carry crisis data). v1 = operator-only aggregate views +
founder runbook; automated alerting deferred to a follow-up.

- schema.sql §6b + migration 20260605000000: crisis_detection_daily /
  _volume_daily / _liveness views over crisis_detected. PII-free (bucketed counts;
  never selects user_id/session_id), operator-only (not granted to authenticated/
  anon). No k-anon suppression (DPIA v1.2 drops the claim; a safety monitor must
  not hide the first/rare crisis). severity='undefined' rows surfaced, not filtered
  (makes the inline-Q9 emit bug visible instead of laundering it).
- docs/development/crisis-analytics-runbook.md: post-release liveness check (active
  synthetic-detection assertion, not a bare count), drift scan, monthly compliance
  export, three-store latency split (Sentry/Supabase/PostHog), honest privacy posture.

Crisis + compliance specialist sign-off. Follow-ups: automated alerting infra;
fix inline-Q9 emit (String(undefined) -> real severity_bucket/assessment_type).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@MP2EZ MP2EZ merged commit d08b002 into development Jun 6, 2026
22 checks passed
@MP2EZ MP2EZ deleted the feat/feat-129-crisis-analytics-dashboard branch June 6, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant