M4: client shell, sign-in and protocol client #67

Closed
opened 2026-11-20 22:31:44 +01:00 by SirStone · 1 comment
Owner

Part of #63

Goal

New client package builds; sign-in page when no session; POST /join; WS proto=2; hello reset; pure reducer skeleton; DOM overlay shell.

Acceptance criteria

  • Unit tests for envelope/ack/reducer/hello reset
  • E2e join -> canvas -> hello/roster for GM and player
  • No data before join
  • Wrong/unknown key identical
  • Proto mismatch shows reload
  • Revoked returns to sign-in
  • vite build dist served by nginx
  • Standing gate: full devbox run test green on a clean checkout, no test weakened or skipped, and the behaviour above proven at the seam(s) listed under "Proven at".

User stories covered

  • 1 — As a player, I want the shared link to show only a sign-in page when I have no session, so that a stranger sees no game data.
  • 2 — As a player, I want to paste my player key and land on the map, so that joining takes one step.
  • 3 — As a player whose key is refused, I want the same plain "key not recognised" answer for a wrong and an unknown key, so that I learn nothing about valid keys.
  • 4 — As a GM, I want to sign in with the GM key the same way, so that there is one door for everyone.
  • 9 — As a player, I want the client to show "reload" when the server reports a protocol mismatch, so that I get the client that matches the server.
  • 10 — As a player, I want the client to stop reconnecting and return to sign-in when my key is replaced or my player is removed, so that it does not hammer a dead session.

Proven at

client reducer, WS client, DOM shell; e2e

Notes

  • Size: M (about one agent session, ~100K tokens). Lane: C (client core).
Part of #63 ## Goal New client package builds; sign-in page when no session; `POST /join`; WS `proto=2`; `hello` reset; pure reducer skeleton; DOM overlay shell. ## Acceptance criteria - [ ] Unit tests for envelope/ack/reducer/`hello` reset - [ ] E2e join -> canvas -> hello/roster for GM and player - [ ] No data before join - [ ] Wrong/unknown key identical - [ ] Proto mismatch shows reload - [ ] Revoked returns to sign-in - [ ] `vite build` dist served by nginx - [ ] Standing gate: full `devbox run test` green on a clean checkout, no test weakened or skipped, and the behaviour above proven at the seam(s) listed under "Proven at". ## User stories covered - 1 — As a player, I want the shared link to show only a sign-in page when I have no session, so that a stranger sees no game data. - 2 — As a player, I want to paste my player key and land on the map, so that joining takes one step. - 3 — As a player whose key is refused, I want the same plain "key not recognised" answer for a wrong and an unknown key, so that I learn nothing about valid keys. - 4 — As a GM, I want to sign in with the GM key the same way, so that there is one door for everyone. - 9 — As a player, I want the client to show "reload" when the server reports a protocol mismatch, so that I get the client that matches the server. - 10 — As a player, I want the client to stop reconnecting and return to sign-in when my key is replaced or my player is removed, so that it does not hammer a dead session. ## Proven at client reducer, WS client, DOM shell; e2e ## Notes - Size: M (about one agent session, ~100K tokens). Lane: C (client core).
SirStone added the ready-for-agentenhancement labels 2026-11-20 22:31:44 +01:00
SirStone added a new dependency 2026-11-20 22:31:45 +01:00
SirStone added a new dependency 2026-11-20 22:31:45 +01:00
Author
Owner

Done in 3c0258e.

  • New client/ package (Vite + TS + PixiJS v8, plain DOM): pure reducer seam with no Pixi import, append-only slice registry via build-time glob, proto 2 WS client (envelope/ack/closing mapping), sign-in via POST /join (same refusal for wrong/unknown key), DOM shell/HUD, Pixi stage only after a live hello.
  • hello resets every slice; closing{proto-mismatch} shows reload and stops; closing{revoked} returns to sign-in and clears the view.
  • E2e moved into the client package (client/e2e/, playwright-core owned there; still outside tools/), served from the real Vite build through the TLS/HTTP2 nginx: join -> canvas -> hello/roster for GM and player, no data before join, identical wrong/unknown refusal, proto mismatch, revoked.
  • devbox run client-test = Vitest seam (43 tests); devbox run e2e builds and runs the browser gate; devbox run test unchanged. The #66 stub dist is now local to tools/vhost.test.mjs, so the server gate needs no npm install.
  • Extended rules for the fan-out (T7 fog, T8/T9 tokens, T10 walls, T11/T12 panels) documented in client/README.md (file-disjoint slice + render module per ticket) with a pointer from DESIGN §7.1.

Gates on the rebased tree (97f618c): devbox run test 154/154 + evidence, devbox run client-test 43/43, devbox run e2e 4/4. results/* reverted.

Done in 3c0258e. - New `client/` package (Vite + TS + PixiJS v8, plain DOM): pure reducer seam with no Pixi import, append-only slice registry via build-time glob, `proto` 2 WS client (envelope/ack/`closing` mapping), sign-in via `POST /join` (same refusal for wrong/unknown key), DOM shell/HUD, Pixi stage only after a live `hello`. - `hello` resets every slice; `closing{proto-mismatch}` shows reload and stops; `closing{revoked}` returns to sign-in and clears the view. - E2e moved into the client package (`client/e2e/`, playwright-core owned there; still outside `tools/`), served from the real Vite build through the TLS/HTTP2 nginx: join -> canvas -> hello/roster for GM and player, no data before join, identical wrong/unknown refusal, proto mismatch, revoked. - `devbox run client-test` = Vitest seam (43 tests); `devbox run e2e` builds and runs the browser gate; `devbox run test` unchanged. The #66 stub dist is now local to `tools/vhost.test.mjs`, so the server gate needs no npm install. - Extended rules for the fan-out (T7 fog, T8/T9 tokens, T10 walls, T11/T12 panels) documented in `client/README.md` (file-disjoint slice + render module per ticket) with a pointer from DESIGN §7.1. Gates on the rebased tree (97f618c): `devbox run test` 154/154 + evidence, `devbox run client-test` 43/43, `devbox run e2e` 4/4. `results/*` reverted.
Sign in to join this conversation.