feat(confidence-engine): add authenticated investigation persistence

This commit is contained in:
2026-09-08 17:15:46 +01:00
parent b949eea831
commit 6dd447e56a
6 changed files with 193 additions and 3 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ The product direction is a **facilitated investigation** presented across three
**Authentication boundary:** Supabase Auth magic links gate product and CE API routes. Sessions are cookie-backed and `/auth/callback` exchanges the auth code before returning to `/`. This does not alter localStorage investigation persistence or introduce user ownership into CE snapshots; dedicated `confidence_engine` PostgreSQL persistence remains future work.
**Database contract (v0.62b):** A pending version-controlled migration defines `confidence_engine.investigations` outside `public`. Its platform metadata is `id`, `user_id`, and timestamps; the CE payload remains an opaque JSONB `snapshot`. Authenticated RLS ownership is `user_id = auth.uid()`. The migration is not yet applied, `confidence_engine` is not yet exposed through PostgREST, and localStorage remains the production persistence authority.
**Database contract (v0.62b):** The applied `confidence_engine.investigations` schema sits outside `public`. Its platform metadata is `id`, `user_id`, and timestamps; the CE payload remains an opaque JSONB `snapshot`. Authenticated RLS ownership is `user_id = auth.uid()`, and external PostgREST configuration exposes the schema. Server save/load/list capability is available through the authenticated/RLS path, but localStorage remains the production persistence authority; controlled cutover and legacy migration are future work.
The user controls which question to investigate, how deeply to investigate it, when to say Done for now, whether Current Understanding is sufficient, whether to reopen work, and when to review the Report. The engine facilitates — it does not steer or prioritise.