diff --git a/chat-rearchitecture.md b/chat-rearchitecture.md index 882beb2..ffb64aa 100644 --- a/chat-rearchitecture.md +++ b/chat-rearchitecture.md @@ -402,6 +402,142 @@ then log results in Section 10 before moving on. - _Next:_ `styles` + `message` template + `GET /message/:id` (single-message primitive). +- **2026-08-06 — Phases 1–7 built & backend verified on brb.city.** + - **All 16 templates + 10 routes written** (ids in the maps above). Structure + `aim` #44 is live at `https://brb.city/aim/`. + - **Design pivot (recorded so §4–6 match reality): identity is fully + client-side.** localStorage holds `aim:handle` + `aim:client_id` (a stable + per-browser UUID). The socket carries them on an `identify` event (presence) + and each `send` (authorship + push exclusion). The server *trusts* the + client's declared identity — correct for a fun playground, and it kills the + "forgets who you are" + session-churn class of bugs outright. No server-side + alias/session juggling remains. + - **The four reported bugs, resolved:** + - *Forgets you* → localStorage handle + one stable alias per handle + (`getOrCreateAlias`), auto-seeded from the logged-in Bliss user. + - *Self-notify push* → subscriptions keyed by `endpoint`, owned by stable + `client_id`; fan-out is `subsExcludingClient(senderClientId)`. Your own + device is structurally excluded regardless of name/session changes. + - *Noisy presence* → counts kept **per person, not per socket**, with a 4s + debounce on sign-off, so tabs/reconnects don't spam. (`arrive`/`depart` in + the WS handler.) + - *Broken single-message* → `getMessageById` rewritten with the correct join; + it's now the backbone of the socket-as-pointer-bus design. + - **Socket-as-bus confirmed live** via a Node `ws` client: `identify` → + presence-line broadcast; `send` → persisted (`message #4`) + a `msg-pointer` + broadcast of exactly + `
` + — no message markup crosses the socket. `GET /aim/message/1` renders the AIM + line (red bold name, gray timestamp) with **unescaped** ``/`` + intact. First-render null-slice bug (Eta ASI: an eval block must not start + with `(`) found & fixed in `transcript`. + - **`req.currentUser` added** (minimal `{id, username}`) in **local** + `index.js` + `getUserById` in `db.js` (syntax-checked). ⚠️ This repo is the + *local* copy; brb.city runs from `/home/nodejs/bliss2` on another host — **the + index.js/db.js change needs deploy + restart there to take effect.** Until + then templates fall back to `"Guest"` (graceful; nothing breaks). + - Seeded one welcome message; cleared all test rows. + +### Verified ✅ vs. remaining ⏳ +- ✅ Fresh schema + library (alias stability, verbatim HTML, range/catchup/push helpers) +- ✅ `GET /message/:id` single-message primitive (unescaped content) +- ✅ `WS /room`: identify→presence, send→persist→pointer broadcast, catchup +- ✅ Full page, `/live`, `/compose`, `/frozen` render without error +- ✅ Socket ships pointers only; message route is the single render source +- ⏳ **Browser check** (Playwright MCP wasn't available this session): the + client paths — compose→`chat:send`→ws-bridge ship, `chat:message` emit on + arrival, localStorage default handle, rename, autoscroll, push subscribe — + are written but not yet driven in a real browser. Do this next session. +- ⏳ **Deploy** local `index.js`/`db.js` to brb.city + restart (pm2 `foo`) to + enable the logged-in-user default. +- ⏳ **Phase 8**: an `aimgpt`-style demo page nesting `/live` + `/compose` (+ the + sheep) to show the parts compose. + +- **2026-08-06 — Browser verification + the send-path bug (found via Playwright).** + - Got Playwright MCP working (it wanted chromium build 1237; symlinked the + installed `chromium-1234` → `chromium-1237` in `~/.cache/ms-playwright`). + - **Sending was broken — real bug, now fixed.** Eta's `<%= %>` HTML-escapes, so + `var dflt = <%= JSON.stringify('Guest') %>;` rendered as + `var dflt = "Guest";` **inside the `