summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--docs/GUI-PLAN.md38
-rw-r--r--docs/adr/0001-testable-client-server-cores.md10
2 files changed, 29 insertions, 19 deletions
diff --git a/docs/GUI-PLAN.md b/docs/GUI-PLAN.md
index cb0db91..2789b81 100644
--- a/docs/GUI-PLAN.md
+++ b/docs/GUI-PLAN.md
@@ -24,18 +24,25 @@ Breaking wire change, released for client and server together.
24**Gate:** mismatch refused in both directions, `HELLO` required before auth, 24**Gate:** mismatch refused in both directions, `HELLO` required before auth,
25existing game flows unchanged, new tests for version parsing and gating. 25existing game flows unchanged, new tests for version parsing and gating.
26 26
27## Phase 1 — core boundary and roulette 27## Phase 1 — core boundary and roulette (done)
28 28
29**In progress.** `Command`/`View` exist and all four games are ported: the 29Complete in v4.0.7. Every game plus `Lobby` and `History` are structured views;
30core builds a typed view, frontends send `Command`, and the TUI renders it. 30the core builds the view and frontends send `Command`. The client transport
31Done so far: every game plus `Lobby` and `History` are structured views; the 31(TCP, rustls, TOFU, `HELLO`, auto-login) lives in `client::transport` behind a
32client transport (TCP, rustls, TOFU, `HELLO`, auto-login) lives in 32trust callback. The command line moved out of the core in two pieces:
33`client::transport` behind a trust callback; login and registration are 33`client::input` owns the editor, history and key mapping, and `client::shell`
34`Command`s, so a GUI form never needs a terminal prompt. The command-line 34parses a finished line into a core `Command` or an adapter action (connect,
35editor and key mapping moved to `client::input`; `ClientCore` no longer knows 35login, register, set-credential, host maintenance). `ClientCore` no longer
36keys, the prompt or its history. Remaining: the `Connect` and `Trust` adapter 36holds a `Key`, a prompt buffer, or any of the old TUI-shaped effects
37screens, and replacing the last TUI-shaped effects (`Interactive`, host 37(`Interactive`, `SetPrompt`, `ListHosts`, `ForgetHost`, `AnimateRoulette`); the
38listing, roulette animation) with commands. 38roulette wheel animation is derived from the `Result` view by the adapter.
39"Log out" (`logout`) and "forget saved login" (`forget-login`) are distinct: the
40latter drops the credential for the pinned key and keeps trust.
41
42The `Connect` and `Trust` screens are adapter-owned for now: the terminal asks
43in the transcript, and the GUI will draw them as its own screens over the same
44`client::transport` callback. They are not core state because the core never
45sees a certificate.
39 46
40- Introduce `Command` and `View`; move terminal-only concerns (prompt editing, 47- Introduce `Command` and `View`; move terminal-only concerns (prompt editing,
41 wheel animation, interactive prompts) into the TUI adapter. 48 wheel animation, interactive prompts) into the TUI adapter.
@@ -43,13 +50,14 @@ listing, roulette animation) with commands.
43 `History`, `Game`. 50 `History`, `Game`.
44- Port roulette first: `PlaceBet(BetTarget)`, `SetChip`, `ClearBets`, `Spin`, 51- Port roulette first: `PlaceBet(BetTarget)`, `SetChip`, `ClearBets`, `Spin`,
45 and a `FeltView` carrying chips, cursor, and the last result. 52 and a `FeltView` carrying chips, cursor, and the last result.
46- Add `ForgetLogin` so "log out" and "forget saved login" are distinct in both 53- Add `forget-login` so "log out" and "forget saved login" are distinct in both
47 frontends. 54 frontends.
48- Auto-login stays: a stored credential for the pinned fingerprint logs in 55- Auto-login stays: a stored credential for the pinned fingerprint logs in
49 automatically after the trust check. 56 automatically after the trust check.
50 57
51**Gate:** the TUI behaves exactly as today, its tests now assert on `View` 58**Gate:** met. The TUI behaves as before (same boards, keys and prompts), its
52instead of text where practical, and `ClientCore` contains no terminal types. 59tests drive the real adapter path (`shell::parse`, `Editor`, `game_input`), and
60`ClientCore` contains no terminal types.
53 61
54## Phase 2 — the other three games 62## Phase 2 — the other three games
55 63
diff --git a/docs/adr/0001-testable-client-server-cores.md b/docs/adr/0001-testable-client-server-cores.md
index 2e3cd1e..c19c01a 100644
--- a/docs/adr/0001-testable-client-server-cores.md
+++ b/docs/adr/0001-testable-client-server-cores.md
@@ -16,10 +16,12 @@ exercised from `tests/`.
16- The library (`src/lib.rs`) owns shared logic. `src/bin/client` and 16- The library (`src/lib.rs`) owns shared logic. `src/bin/client` and
17 `src/bin/server` are thin adapters for crossterm, TLS, environment variables, 17 `src/bin/server` are thin adapters for crossterm, TLS, environment variables,
18 and interactive prompts. 18 and interactive prompts.
19- `client::core::ClientCore` owns input, history, commands, game state, and 19- `client::core::ClientCore` owns commands, game state, the current screen, and
20 pending replies. It returns `Effect`s (`Print`, `ReplaceRegion`, `ClearRegion`, 20 pending replies. It returns `Effect`s (`Print`, `Render(View)`, `ClearRegion`,
21 `SetPrompt`, `SendLine`, `Interactive`, ...). The binary applies them; the 21 `SendLine`, `Disconnect`, `Quit`). The binary applies them; the tests apply
22 tests apply them to a headless screen. 22 them to a headless screen. The prompt buffer, history and key mapping live in
23 `client::input`, and `client::shell` parses a finished line, so the core never
24 sees a `Key` or a raw command line.
23- `server::core::ServerCore` owns message handling and receives an injected 25- `server::core::ServerCore` owns message handling and receives an injected
24 `Connection`, `GameRegistry`, and bcrypt cost. The binary only owns the TLS 26 `Connection`, `GameRegistry`, and bcrypt cost. The binary only owns the TLS
25 listener and per-connection thread. 27 listener and per-connection thread.