summaryrefslogtreecommitdiff
path: root/docs/next-daemon.md
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-17 18:43:09 -0300
committerGabriel Schneider <[email protected]>2026-11-17 18:43:24 -0300
commit484841325bb35b0bb7c55f7980178388c4e39c71 (patch)
treeb1a674c1f310e9e2befae9a9b3f0a2294e8c8568 /docs/next-daemon.md
parentb23665597fcfd486e8f15942da25ce5708b77226 (diff)
downloadpardes-484841325bb35b0bb7c55f7980178388c4e39c71.tar.gz
pardes-484841325bb35b0bb7c55f7980178388c4e39c71.zip
docs: the manual and the notes made true about how pardes runs: next-daemon.md's opening says what is built and points at the new page, and its design's lines that went otherwise (a supervisor, subreaper, spawner and 9P root; every session a child of the daemon; the stub passing its terminal, no fork; the join's fork child; one socket; /n/<host>) are marked so; the guide's closed terminal (only while the daemon keeps it) and closed window (it ends the session unless it has clients), and its daemon that kept all of it; the reference's /sessions (client lines), bare attach (as a client), another machine's attach (built: HOST:NAME), three clients not four; building.typ's replica paragraph (no ping-only session, no platform in the hash); macos.md's Attach word and src/detached/, both gone; next-daemon.md's window client font and touchpad, both built since
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'docs/next-daemon.md')
-rw-r--r--docs/next-daemon.md48
1 files changed, 39 insertions, 9 deletions
diff --git a/docs/next-daemon.md b/docs/next-daemon.md
index bda6c763..382b3098 100644
--- a/docs/next-daemon.md
+++ b/docs/next-daemon.md
@@ -8,7 +8,13 @@
> snappy.
Designed 2026-10-29 in discussion (the user, the coordinator, a survey
-agent). Nothing here is built yet. Paths are relative to the repo.
+agent), and built since, phase by phase (phases 1 to 6, then the
+architecture steps): each phase's notes below say what was built, and where
+it went otherwise than the design that follows. Where the build differs, the
+design's line is kept and marked *Built otherwise*. What runs today, in the
+words ruled on 2026-11-17 (session, client, far, frontend, detached,
+attach), is the manual's "How pardes runs" (`docs/typ/running.typ`); where
+it goes next is `docs/next-run.md`. Paths are relative to the repo.
## Decided by the user
@@ -29,7 +35,10 @@ agent). Nothing here is built yet. Paths are relative to the repo.
authority and the other clients do not.
- **One long-lived daemon per user per machine.** It supervises one child
process per session, postgres-style. Nothing is left dangling, and the
- core is not de-globalised.
+ core is not de-globalised. *Built otherwise* (Phase 3 notes): the daemon
+ spawns nothing and is nobody's parent; every session registers with it,
+ and it keeps the list of sessions and a dup of each pty master. The user
+ ruled on 2026-11-17 that it stays so.
## What today's seam is, and why it goes
@@ -50,8 +59,13 @@ smallest common grid across them.
- **Processes.**
- The daemon is subreaper, spawner, fd holder, registry and 9P root.
+ *Built otherwise:* fd holder and registry only, and the switchboard of
+ the replica socket; no subreaper, no spawner, no 9P (`src/daemon.zig`
+ "It spawns nothing and is nobody's parent").
- Every session is a child of the daemon: a GUI window, a tty session
- behind a stub, or a headless session.
+ behind a stub, or a headless session. *Built otherwise:* none is; a
+ terminal's session is its stub's child (it forks itself off), a window's
+ or a `--detach` one is the process that was started.
- A session is always an in-process authority with its own local view,
so the regular path does not change. Replicas exist only for extra
clients or remote ones.
@@ -61,11 +75,17 @@ smallest common grid across them.
- The session child drives that fd directly. The stub forwards SIGWINCH
and exits with the session's status.
- Detach: the session drops the fd and the stub exits. No fork happens.
+
+ *Built otherwise:* `pardes` in a terminal forks its session off itself
+ and stays as its stub (`daemon.forkSession`); the stub forwards WINCH,
+ TERM, INT, QUIT and HUP. Only `pardes --attach` passes a terminal's fd,
+ through the daemon, to a detached session.
- **GUI detach.** The window is destroyed and the process carries on
headless. Closing a window that has no other client attached quits it.
- **Shells survive a session crash.** After each `forkShell`, the session
sends the daemon a dup of the pty master, so the shells do not get
- SIGHUP. Being subreaper only decides who reaps them.
+ SIGHUP. Being subreaper only decides who reaps them. *Built otherwise:*
+ the daemon is no subreaper; init (or `systemd --user`) reaps them.
- **The recorder.** It is null when no client is attached. When one is,
it appends what the authority consumed, in order:
- every step's host tape (the results of the ~30 `turn.yield()` sites);
@@ -101,11 +121,14 @@ smallest common grid across them.
- The authority never rolls back.
- **Join.** The authority forks a writer child at a step boundary; the
child streams the dump. The authority buffers the events after it for
- the joiner.
+ the joiner. *Built otherwise* (Still open, 5): no fork; the step dumps the
+ state and a writer thread streams the texts.
- **Remote.**
- - `ssh -L` of the daemon's one socket.
+ - `ssh -L` of the daemon's one socket. *Built otherwise:* of its second
+ socket, `pardes-replica.sock`, a stream socket beside the daemon's own.
- The daemon hands a replication connection's socket to its session.
- - A remote daemon mounts as `/n/<host>`.
+ - A remote daemon mounts as `/n/<host>`. *Not built* (Phase 6: 9P round
+ trips notes): the daemon serves no 9P.
## Determinism leaks (the survey's census)
@@ -3583,7 +3606,11 @@ Not done, and why:
owes (an image's, a PDF's lane) waits for its unit; a local window's
paint-ahead is the core's, which a client's moves only by units.
- **No glide in a client, and a touchpad's fractions round to rows** (the
- core's clock is the session's there, above).
+ core's clock is the session's there, above). *Built since:* a
+ touchpad's fractions are the client window's own picture, and only its
+ whole rows go to the session (`gui.zig`, the test "detached trackpad
+ scrolling keeps fractions local and queues whole rows for replication");
+ a wheel's notch is still whole rows with no glide.
- **The notice a client gets is in its title and its log, not its frame**
(the session's words: joined again, let go, refused). The tty's draws
them on its notice band, which the window's frame has no slot for
@@ -3592,7 +3619,10 @@ Not done, and why:
session's `Font`, `Fonts` and `WindowOpacity` move the session's own
window, and a client's follows them only through its core (the scene
effects do; the font does not). `Fonts` reads the machine's font
- directories untaped, so its list is the session machine's.
+ directories untaped, so its list is the session machine's. *Built
+ since:* a client follows the session's font request by the face's name,
+ when that face is installed on the client's machine (`gui.zig`
+ `syncReplicaFont`); its opacity is still its own.
- **An EffectCode's sources differ by backend** (Vulkan or GL): a client of
another build's window reads the session's.
- **A terminal's client draws a window session's pictures as cells**, never