2026-11-22 — Consent migration applied to the live database
20261121_user_consents.sql is live. Existing accounts are locked until their owners confirm the consents in the app. Verified before and after in rolled-back transactions.
Follows consent records validated on the server. #715 stays open for the legal review.
Order of events (UTC, 2026-11-21)
- #719 merged; production deployment
dpl_6WBJyLALGhzbLxcLWbCbBwbsZMS5ready 22:36./api/studies/healthanswered from a server function, no error-level runtime logs. - Migration applied to project
oxixxrzdrryfztfxladyas20261121_user_consents. The SQL sent is the repo file without its comments.
State after applying
consent_versions: 4 current versions.user_consents: 0 rows. 34consent_required_*policies on 17 tables.handle_new_user()contains the consent step.- Rights:
anoncannot executehas_valid_consents();authenticatedcan executehas_valid_consents()andgrant_consents(), cannot executerecord_consents(), cannot insert intouser_consents. - 4 accounts exist. None has consent records, so all four are locked: they can sign in, read, export and delete, and are asked to confirm in the gate before anything new can be saved.
Verification on the live database (transaction rolled back)
- Signup with the full set: 4 records, server year, despite a client-sent time of 2000-01-01.
- Signup with a partial set containing
false: rejected (22023), nothing created. - Signup without consents: account created, 0 records.
- Existing account:
has_valid_consents()false; insert intochat_sessionsrefused (42501); own profile readable; aftergrant_consents()true and the insert works. - The inserts into
auth.usersran aspostgres, not as the Supabase Auth role.
Not verified
- A real signup and e-mail confirmation through Supabase Auth.
- The gate on the live site with a real login.
Open
- Legal review of the wording (
health_datais registered as2026-11-draft); DPIA. - Mobile consent screens have not been run on a device.
Handover 2026-04-25 — layered drift-prevention epic, P1-P4 open, P5 pending
Session state for the drift-prevention research epic. Five PRs open, one blocker issue, one local file in pending-review state. Plan and memories under ~/.claude/.
2026-11-21 — Signed-in page loads no longer block the Supabase client
The auth state handler awaited a profile query from inside the auth callback. While a stored session is being restored this blocks the client for good: header shows logged-out, no client query runs. Fixed; regression test added.