From 99f5b10eccd95aa0066ea6fe6bb75f367ab56a47 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 18 Nov 2026 22:03:14 -0300 Subject: core: src/ becomes core/, pardes.zig its root.zig (the reorganisation's tree, step 2d), and every mention of a src/ path follows: the build's paths, the core's imports of its root, the tests that read the repository's files by path (lspbench's, look.zig's spans over core/look.zig), the comments that cite files, the documents and the manual (the typst corpus reads core/tutor.txt and core/plumbing); left as they were: the /src tree's served names (src/pardes.zig and the rest are the 9P tree's, not the repository's), the CHANGELOG's history, fixtures that are only strings; fs-unit-test runs from the core's root (a module of the core rooted at fs.zig had the runtime's and the devices' `core` be fs.zig); nothing else changes: the ledger (pardes.test.* now root.test.*), frames byte-identical, replicas and process-test the base's Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- docs/typ/building.typ | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'docs/typ/building.typ') diff --git a/docs/typ/building.typ b/docs/typ/building.typ index 9026aa4f..5273298e 100644 --- a/docs/typ/building.typ +++ b/docs/typ/building.typ @@ -76,7 +76,7 @@ must share with its session; `pardes --help` lists every flag. == As a library A Zig package that depends on pardes is given one module and nothing of -the editor: `pardes-syntax` (`src/lib_syntax.zig`), for a program that +the editor: `pardes-syntax` (`core/lib_syntax.zig`), for a program that draws source text itself and wants it parsed and coloured as pardes has it. @@ -118,7 +118,7 @@ package, and `zig build lib-test` builds and runs it. === The editor -`pardes-editor` (`src/lib_editor.zig`) is the text pane as a library: +`pardes-editor` (`core/lib_editor.zig`) is the text pane as a library: helix's keys on a text kept in memory, no files, commands, builtins, prompts or views. A package asks for it, and is then given uucode, mvzr and vaxis's grapheme width besides; one that does not fetches nothing more. @@ -161,7 +161,7 @@ zig build core-test core tests on the core without a terminal (no ghostty that needs a terminal skips; the one to iterate on zig build shell-test the same tests and the native shell's, with the terminal, without the perf gate -zig build term-test the terminal module's own tests (src/term/) +zig build term-test the terminal module's own tests (core/term/) zig build pane-test pane, output and namespace integration tests zig build kitty-test kitty graphics conformance of terminal panes, at the core zig build kitty-harness kitty graphics through a pane end to end (a fake kitty @@ -209,7 +209,7 @@ zig build cheatsheet render the cheatsheet PDF (needs typst) [--replay-with=]` records and replays the tty cases' real sessions, their shells' and files' answers on the tape. - The tutor's practice blocks (`# keys:`, `# before`, `# after` in - `src/tutor.txt`) are typed by hand; nothing runs them. What pins that + `core/tutor.txt`) are typed by hand; nothing runs them. What pins that behaviour is `hxdiff`, which replays `test/hxcases` against goldens recorded from a real helix, and its `--parity`, which runs each case in a file pane and in a shell and demands they agree. @@ -278,12 +278,12 @@ effects such as spawning processes. decides who serves it. - The root module is chosen by platform: `main.zig` (tui, gui), `macos.zig`. The macOS shell is a library whose host owns `main()`. -- The terminal is a module of its own, `term` (`src/term/`): the +- The terminal is a module of its own, `term` (`core/term/`): the emulator (ghostty-vt), kitty images (wuffs, zstbi), the pager's parse and the replicas' screen state. It never imports the core; the core - reaches it through one table of plain-data entries (`src/plain/term.zig`, - through `src/Term.zig`), chosen at compile time. The records both name - (cells, colours, keys) are `plain` (`src/plain/plain.zig`, std only). + reaches it through one table of plain-data entries (`abi/term.zig`, + through `core/Term.zig`), chosen at compile time. The records both name + (cells, colours, keys) are `plain` (`abi/plain.zig`, std only). Every product is built with the terminal; core-test's core is built without it, so its compile names no ghostty, wuffs, zstbi or C++. - `memory.limits` is the one home for the core's capacities (selections, @@ -291,13 +291,13 @@ effects such as spawning processes. allocator is a DebugAllocator over its arena's reserved region, thread safe, its checks in Debug builds only. -Code map: `src/panes.zig` and the pane kinds it names (`src/File.zig`, -`src/Terminal.zig`, ...), `src/layout.zig`, `src/fs.zig` (host access, -mounts and resolution) and `src/pardes.zig` (input), with one file per +Code map: `core/panes.zig` and the pane kinds it names (`core/File.zig`, +`src/Terminal.zig`, ...), `core/layout.zig`, `core/fs.zig` (host access, +mounts and resolution) and `core/root.zig` (input), with one file per thing beside them (`edit.zig`, `normal.zig`, `look.zig`, `exec.zig`, -`mouse.zig`, ...). `src/ninep/` is the control tree, `src/daemon.zig` the -per-user daemon and a terminal's stub, `src/wire.zig` the input -wire a remote client will speak, `src/lsp/` the +`mouse.zig`, ...). `core/ninep/` is the control tree, `runtime/daemon.zig` the +per-user daemon and a terminal's stub, `abi/wire.zig` the input +wire a remote client will speak, `core/lsp/` the language-server client; `test/` holds harnesses, goldens and helix cases, `build/` the process tests' build steps. @@ -318,7 +318,7 @@ edit) the file's revision reject a stale reply. A process that never calls == The daemon and detached sessions -One `pardes --daemon` per user (`src/daemon.zig`) listens on +One `pardes --daemon` per user (`runtime/daemon.zig`) listens on `pardes-daemon.sock` in the runtime directory, its `.lock` flocked for its life; the first session that finds none starts it (a double fork and an exec) and it exits a second after it holds nothing. It is nobody's parent: @@ -343,7 +343,7 @@ own process, ended by its hangup. A replica (a client running its own copy of the core, phase 5 of `docs/next-daemon.md`) connects to `pardes-replica.sock`, a stream socket -beside it that `ssh -L` can forward. `src/wire.zig` is its +beside it that `ssh -L` can forward. `abi/wire.zig` is its protocol (its `version`): fixed-width little-endian fields, a 5-byte header (tag, then a u32 length), the hello, a ping, the input events. The hello names a session and carries the client's semantics hash (the protocol, @@ -354,9 +354,9 @@ nobody has, in words, and hands an accepted connection to its session (`SCM_RIGHTS`), which welcomes it and from then on is the one it talks to: the session sends the dump the client loads, then each step's tape and its terminals' screens, and the client sends its inputs -(`src/replica.zig`; #doc("running") draws it). +(`core/replica.zig`; #doc("running") draws it). -#word("Upgrade") (`src/upgrade.zig`) execs the path the session was started +#word("Upgrade") (`runtime/upgrade.zig`) execs the path the session was started from, at a step boundary, after asking it `--version`: the session's dump is committed to the state file as `upgrade-` (the build before wrote `pardes-upgrade-.dump`, which this one still reads, for one release), and its pty masters, @@ -383,10 +383,10 @@ shared code. - The engine (`fs.Server`) owns fids, permissions, directory reads, flushes and what a hangup releases; it allocates nothing and makes no OS - calls. The control tree in `src/ninep/` is its backend: `tree.zig` + calls. The control tree in `core/ninep/` is its backend: `tree.zig` (nodes, dispatch), `pane.zig`, `ctl.zig`, `cols.zig`, `addr.zig`, `pty.zig`, `events.zig` (event and log), `screen.zig`, `sources.zig`. - `src/9p.zig` names the editor's engine settings: msize 65536, 256 fids, + `runtime/9p.zig` names the editor's engine settings: msize 65536, 256 fids, 128 held reads a connection, names up to 255 bytes. - A read, write, open, clunk, remove or truncating wstat can park; a walk, attach, stat, create or rename cannot. Every Rread is clamped to the -- cgit v1.3