diff options
Diffstat (limited to 'docs/next-daemon.md')
| -rw-r--r-- | docs/next-daemon.md | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/docs/next-daemon.md b/docs/next-daemon.md index 5a4b939a..014118ef 100644 --- a/docs/next-daemon.md +++ b/docs/next-daemon.md @@ -281,6 +281,10 @@ child; `std.posix.tcgetattr` (an ioctl on that layout) is the right one. ## Phase 4 notes +(Superseded by "Architecture step 5 notes" below: the session's share of +a view is indexed now, and a second local terminal or window is a replica +client; the in-process extra views described here are gone.) + Built 2026-10-29 (`src/views.zig`, the tty and GUI hosts, `daemon.zig`, the snapshot harness and the monkey). Decisions taken at the forks, with the ponytail lens: @@ -4598,3 +4602,49 @@ the journal made redundant. What landed, and what did not and why: the other: 0.86-1.04 ms of the step (the first 2.9) where it was 5.0-6.0, and a client's input step p50 0.32 ms where it was 2.46: a unit's digest no longer hashes the edited file. + +## Architecture step 5 notes: one client path + +Done 2026-11-06 (the `client` line, ยง9.4 step 5 of the clean-room +architecture). A session shows one frontend of its own; every further view +is a replica client. + +- **The views indexed.** A view's share of the session is `Pardes.View` + (the ~42 fields `views.fields` used to name), one of `Pardes.views[4]` + (null while closed), the live one `views[live]` through `Pardes.view()`. + Going into another view is the index; nothing of the session's is copied. + The references were rewritten from the compiler's errors (`p.active` is + `p.view().active`, with `const v = p.view()` hoisted where a function uses + it three times or more). The views are in the digest (a closed one is + null, so a dump and a digest pay for the open ones only); a pane closing + leaves every view's layout at once (`views.gone`), where each parked view + used to keep serials and prune on its way back. An image from before + (the live view as the core's own fields, the others under `views`) loads + into `views[]` once. +- **What stayed swapped.** Each view's share of a pane (`PaneView`: focus, + weights, fold, the body's cursor, ranges, mode, a document's scroll and + size, the step's tag rows and bands) is still the pane's own fields for + the live view and `Pane.pv[k]` for the others, parked and unparked as + before, and still out of the digest. Indexing it as the session's share + was measured and not done: `pane.body` alone is 1,340 references, the + body is a `Text` whose methods serve tags too, a document's scroll lives + in `File.State` (102 references behind a `*State`), and a document's + `cols`/`rows` share their 600 references with a terminal's pty size, which + every view shows; none of the pane code has the live index to hand. +- **One frontend a session.** The daemon answers `other <name>` for an + attach to a session that is attached already (as it did for one of the + other kind), so the second `pardes --attach` or `pardes-gui --attach` on + this machine is a replica client through the replica socket, as a remote + one is. The tty's per-terminal `Screen`s, the `Poster` and its `from` + input, the Gui's window-fields swap (`window_fields`, `GuiWindow`, + `follow`, `route`, `openAnotherWindow`, `closeOtherWindows`), the pump's + `drawOthers` and the harnesses' extra terminals (`start ... views=N`, + `view <k>`, PARDES_TEST_VIEWS, the GUI feed's `view;<k>`, the monkey's + `--views`) are gone. The pump draws the one view this process shows + (`views.shown`: open, no client's, kept for none), through `drawOne` when + a client's input was the last. +- **`--ps`.** A session tells the daemon its clients' pids (SO_PEERCRED on + each replica socket; 0 where it is not Linux) whenever one joins or + leaves; `--ps` lists `client <pid> <command>` under its session. +- **An Upgrade from an older build** with a second terminal of its own lets + that terminal go, its stub told it is detached; the view closes. |
