Phase 1: server slim-down for v2
Wholesale server rewrite per NEXT-PLAN.md. The server is now identity +
signaling + ephemeral outbox; it holds no chat content.
- New v2 schema (server/schemas/index.ts): users (with identity_pub),
webauthn_credentials, webauthn_challenges, sessions, projects,
project_members (with wrapped_project_key BLOB), invites, outbox.
v1 schema entirely dropped; no migration from v1 — wipe + re-seed.
- server/db.ts: single global SQLite, no per-project DBs, no LRU pool.
Periodic TTL sweep on outbox + webauthn_challenges.
- server/auth.ts: WebAuthn register + authenticate ceremonies via
@simplewebauthn/server. PRF extension input passed as base64url for
the browser to decode. First-ever signup is founder; subsequent
requires invite token.
- server/outbox.ts: stage / pendingFor / ack. Opaque ciphertext rows
per (recipient_user_id, project_id).
- server/projects.ts: project + member CRUD, accepts wrapped_project_key
from owner / invitee.
- server/ws.ts: outbox WS gateway. Subscribe → flush pending. Send →
fanout via outbox.stage to each recipient, live-deliver to subscribed
peers. Ack → delete.
- server/index.ts: slim Fastify entry wiring the new routes.
- server/snapshot.ts: deleted (was for per-project SQLite snapshots).
- src/shared/schema.ts: slimmed to v2 types only — Identity, ProjectMeta,
Member, OutboxEntry, WsClientEvent, WsServerEvent. Conversation/Turn/
ProjectFile move to the client CRDT layer (later phases).
Frontend is intentionally broken after this commit (it still imports
Conversation/Turn/etc. from the shared schema). Phase 2+ will rewire
the browser side. Server typecheck + boot + /health + /api/auth/
register/begin all verified.
Phase 1: server slim-down for v2
Wholesale server rewrite per NEXT-PLAN.md. The server is now identity +
signaling + ephemeral outbox; it holds no chat content.
- New v2 schema (server/schemas/index.ts): users (with identity_pub),
webauthn_credentials, webauthn_challenges, sessions, projects,
project_members (with wrapped_project_key BLOB), invites, outbox.
v1 schema entirely dropped; no migration from v1 — wipe + re-seed.
- server/db.ts: single global SQLite, no per-project DBs, no LRU pool.
Periodic TTL sweep on outbox + webauthn_challenges.
- server/auth.ts: WebAuthn register + authenticate ceremonies via
@simplewebauthn/server. PRF extension input passed as base64url for
the browser to decode. First-ever signup is founder; subsequent
requires invite token.
- server/outbox.ts: stage / pendingFor / ack. Opaque ciphertext rows
per (recipient_user_id, project_id).
- server/projects.ts: project + member CRUD, accepts wrapped_project_key
from owner / invitee.
- server/ws.ts: outbox WS gateway. Subscribe → flush pending. Send →
fanout via outbox.stage to each recipient, live-deliver to subscribed
peers. Ack → delete.
- server/index.ts: slim Fastify entry wiring the new routes.
- server/snapshot.ts: deleted (was for per-project SQLite snapshots).
- src/shared/schema.ts: slimmed to v2 types only — Identity, ProjectMeta,
Member, OutboxEntry, WsClientEvent, WsServerEvent. Conversation/Turn/
ProjectFile move to the client CRDT layer (later phases).
Frontend is intentionally broken after this commit (it still imports
Conversation/Turn/etc. from the shared schema). Phase 2+ will rewire
the browser side. Server typecheck + boot + /health + /api/auth/
register/begin all verified.
Phase 1: server slim-down for v2
Wholesale server rewrite per NEXT-PLAN.md. The server is now identity +
signaling + ephemeral outbox; it holds no chat content.
- New v2 schema (server/schemas/index.ts): users (with identity_pub),
webauthn_credentials, webauthn_challenges, sessions, projects,
project_members (with wrapped_project_key BLOB), invites, outbox.
v1 schema entirely dropped; no migration from v1 — wipe + re-seed.
- server/db.ts: single global SQLite, no per-project DBs, no LRU pool.
Periodic TTL sweep on outbox + webauthn_challenges.
- server/auth.ts: WebAuthn register + authenticate ceremonies via
@simplewebauthn/server. PRF extension input passed as base64url for
the browser to decode. First-ever signup is founder; subsequent
requires invite token.
- server/outbox.ts: stage / pendingFor / ack. Opaque ciphertext rows
per (recipient_user_id, project_id).
- server/projects.ts: project + member CRUD, accepts wrapped_project_key
from owner / invitee.
- server/ws.ts: outbox WS gateway. Subscribe → flush pending. Send →
fanout via outbox.stage to each recipient, live-deliver to subscribed
peers. Ack → delete.
- server/index.ts: slim Fastify entry wiring the new routes.
- server/snapshot.ts: deleted (was for per-project SQLite snapshots).
- src/shared/schema.ts: slimmed to v2 types only — Identity, ProjectMeta,
Member, OutboxEntry, WsClientEvent, WsServerEvent. Conversation/Turn/
ProjectFile move to the client CRDT layer (later phases).
Frontend is intentionally broken after this commit (it still imports
Conversation/Turn/etc. from the shared schema). Phase 2+ will rewire
the browser side. Server typecheck + boot + /health + /api/auth/
register/begin all verified.