multiuser: token identity, invites + bootstrap, owner-gated runs, fork, user packages; spectator spa; utc house rule

This commit is contained in:
2026-11-14 20:01:15 +00:00
parent 9f85adc3c6
commit 711634cc38
15 changed files with 1134 additions and 105 deletions
+37
View File
@@ -148,6 +148,43 @@ file is the "where did we leave off" map.
turns — completions grew 103 to 668 chars across window one) are
live now.
## The multiuser build (2026-11-14) — DONE
Design round closed (ROADMAP "The multiuser server", QUESTIONS
#22-31); all four phases built and proven the same day:
1. **Storage + identity + auth spine** — `state/deployment.db`
(users, invites; gitignored `state/`), `server/users.mjs`,
bearer-token auth on every route except session/claim, bootstrap
invite on the fresh-deployment condition, owner stamping at create,
acting-user attribution in the request and LLM call logs.
2. **Ownership + fork + packages** — owner gating on every mutation
and every model call; per-run activity locks (turn, ask, turn0,
housekeeping job, fork); `POST /api/runs/:id/fork` (staged copy,
atomic swap, owner replaced, `forked` stamped, window state
mirrored); clerk learns the second packages root (`state/packages`)
and `save-package`; user packages published to all. Ownership is
resolved, never maintained (GM ruling): run.json keeps dead owner
ids, the API reads them as absent; revocation is a db delete plus
closing the revoked user's open windows.
3. **SPA** — claim view, identity in the header, superuser admin on
home, spectator mode (read everything, mutate nothing, fork CTA),
save-as-package on setup, origin in the package picker, garnish
(owner, started/forked at second precision) on run names.
4. **Smoke + docs** — 34-step mock smoke plus a restart check, all
green; UI verified text-safely in the browser (claim, home, admin,
spectator on Irene, owner mode, fork click-through, picker,
setup; zero console errors). README deployment section +
layout updated; test state cleaned (Irene untouched).
Post-verdict cut (GM, same day): sign-out removed — signing in is
permanent and per-browser; the user lifecycle / auth story is a
ROADMAP extension point for a later revisit.
Gotcha learned while testing: the a11y snapshot races async renders —
wait for text that only exists POST-render (a card name, the
window-info line), never the static skeleton; and CSS text-transform
still uppercases wait targets.
## Working agreements with the GM
- **"I draft, you cut"** for all creative content.