phase 9 chat save 1 — schema + key-distribution foundation (v1.56.80): E2E-encrypted team chat tables in schema.sql + mirrored idempotently in db.zig EXTENDED_SCHEMA_SQL (Postgres; account_id is TEXT not the spec's BIGINT; singleton global room seeded idempotently). db layer: setChatPubkey (ON CONFLICT upsert), getChatFingerprint, listChatMembers (team+operator only), ensureDmRoom (canonical sorted dm_key, idempotent, INSERT…RETURNING), isChatRoomParticipant, chatRoomPubkeys. Endpoints (operator+team via requireTeamApi): POST /admin/api/chat/pubkey (server computes fingerprint=base64(SHA-256(pubkey)) — authoritative, not client-trusted — and joins global room), GET members (roster+self_fingerprint+global_room_id), GET dm (canonical room, team-target validated), GET room-pubkeys (participant-gated). All identity from session TeamActor.account_id, never client-supplied. Verified against real Postgres: chat db test (upsert/canonical-DM/participant-gate/room-keys) passes; the one live-PG failure is the known pre-existing team-tier negotiate test

dev · 2 days ago · 2026-06-16 · 14.4 MB

session: admin rebuild · agent: claude-code

$ koh steal kepr.uk/kepr@1cb094535d9b
·
← d447a1bd77d8 c75890f0a9b3 →
⇓ download .face