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 --- core/CHANGELOG.md | 1357 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1357 insertions(+) create mode 100644 core/CHANGELOG.md (limited to 'core/CHANGELOG.md') diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md new file mode 100644 index 00000000..5fcfd378 --- /dev/null +++ b/core/CHANGELOG.md @@ -0,0 +1,1357 @@ +# Changelog + +## Unreleased + +- `pardes` has commands, and they describe themselves: `ps`, `attach`, + `kill` and `new` for sessions, `do WORD` and `words` for the builtins, + `fs ls|read|write|ask|follow|stat|help|complete PATH` for the tree (a + refusal in the session's own words, where a mount says EINVAL), and + `help`, `completion bash|fish|zsh`, `skill` and `version`. `pardes help` + is a map of them; `help CMD` ends in examples; `help WORD` and `help + PATH` print what the session's /commands and /README say, and with no + session running, what a core made in the command's own process says. + A command acts on `-s NAME`, else `$PARDES_9P`, else the only session. + `pardes FILE` and every flag work as before; `--ps`, `--attach`, + `--kill`, `--kill-all`, `--help` and `--version` are the commands' old + spellings, for a release. A file named like a command opens as `./ps`. + The reference's "The pardes command" is `pardes help --all`, written by + `zig build builtins-json -Dplatform=tui`, and a test says when it is + stale. + +- The text pane is a library too, `pardes-editor` (`src/lib_editor.zig`, + docs/next-editor.md): helix's keys on a text kept in memory, for a + program that draws it itself (a sketch with a language of its own). It + is a value of plain data, every capacity in its type, copied anywhere + and outliving the code that made it; each call runs pardes's own + normal.zig and edit.zig on it, built with no pane and no core, and hands + back what is not the text's (a view, `:`, `/`, `s`, a language server, a + macro) to its caller. A grammar can be handed in at run time beside the + compiled-in ones. A package asks for it with `.editor = true`; one that + asks for `pardes-syntax` alone fetches what it did. `zig build hxlib` + runs helix's cases on it, against the goldens and against the file pane. + Nothing a session does changes, and a session dumped before loads after. + The caller can hand it the parse it keeps (`Syntax`), and helix's + tree-sitter walks (Alt-o, Alt-i, Alt-n, Alt-p and kin, `]f`, `mif`) run + in the library on pardes's own functions, Alt-i going back the way + Alt-o came; `replace` rewrites a byte range as one step to undo, the + ranges following, and a drag that rewrites a number every frame can + join its frames into one. A new line's indent comes from that parse + where its grammar has an indent query (a `Language`'s `indents`), as a + file's does from its own, so a language whose lines end in `)` is not + pushed a level in at every line. +- The terminal is a module of its own (`src/term/`: the emulator, its + screen state for replicas, kitty images, the pager's parse), which never + imports the core and is reached through one table of plain-data + entries, `src/Term.zig` the core's side (docs/next-terminal.md). Editing + a terminal's text is the core's, on a copy of its rows, as before, and + predicted echo stays the core's; nothing a session does changes, and a + session dumped before loads after. `zig build core-test` builds the core + without the terminal (no ghostty, no C++): a shell boot is a scratch + pane there and a test that needs a terminal skips; `zig build + shell-test` runs the same tests with it. + +- A diff paged (`git show | pardes -`) is a plumbing message, as acme's + `plumb -i` sends what it shows: `type text/x-diff` to `edit`, which a + default rule makes `showdiff`, its +Pager stacked in a +Diff as before. + Take the rule out and the +Pager stays as text; a program reading + `plumb/edit` sees the diff. The `edit` port shows any message's data + with `action=showdata` (stacked with `showdiff`). + +- A port the plumbing rules name is a file a program reads, + `plumb/`, as Plan 9's plumber serves one: every open reads its + own copy of what is sent there from then on (`cat plumb/edit` sees each + file a look opens), a read held until a message comes. A message to a + port no one reads runs its rule set's `start`, or with `plumb client` + waits for the port's first reader. + +- A look asks the plumber first, as acme's does: once the pane's own + readings are done and a name already open in a pane is focused, what + is looked at is sent (`type text`, `src pardes`, `wdir` the pane's + directory), and only what no rule set takes is Look's own. The default + rules keep every look as it was: the browser for a URL, a bare `.diff` + or `.patch` stacked in a +Diff, `git show` of a commit hash in a git + work tree are now rules of `src/plumbing`, no longer written into + Look. `Diff` takes a file or a revision (`Diff fix.patch`, `Diff + 3f2a9c1`), and a rule's Diff that cannot declines, so the look goes + on. `Plumb` opens your plumbing file (`/plumbing`, `include + basic` until you save one), read at start and applied when saved; the + one-line `Plumb suffix .svg to image` rules are gone, refused in words + (write a rule set: `data matches '.*\.svg'`, `arg isfile $data`, + `plumb to image`). A program a rule starts runs detached, as Plan 9's + plumber starts one, with no pane; a failure to start it is said. + +- A search with a class whose range ends at `\xff` (`[\x80-\xff]`, in an + address, `s`, a plumbing rule) no longer takes the editor down: mvzr + counted the range past a byte's end. + +- The plumber, Plan 9's, is in the session: `plumb/rules` holds its + rules in plumb(6)'s language (rule sets of `object verb arg` lines, + variables, `include`, `matches` over the whole text or around a click, + `isfile` and `isdir` finding a name as a look does), and `plumb/send` + takes a message and sends it where they say, to a port pardes reads + (`edit`, `web`, a loaded kind) or to a word or command started, with + Plan 9's words when it cannot. A session starts with `include basic`, + pardes's rules (`src/plumbing`). Kept in a dump. `$1`-`$9` are refused, + the regular expressions having no submatches. + +- A query pane's row looked at on its address (its gutter) opens the + row's place however the look arrives, as a click there always did: an + empty look written back to the pane's `event` file, and the whole row + written to its `look` file, now take the address the row holds, not a + word of its text. A diff's lines answer all three ways through the same + one function (`look.rowAddressAt`). + +- Each pane's directory over 9P has a `rows` file: a line a body row of a + results pane (+Search, +Callstack, +Diff, a language server's list), + where it points (`path`, line, column, the address's end, where its code + starts) and how it is coloured (runs of `keyword`, `string`, ... and the + grounds `add`, `del`, `emph`, `line`), so a 9P client reads their + addresses as data, not by parsing the text. A write at offset 0 replaces + a pane's rows, a later one adds to them; rows its text cannot hold are + refused. An edit drops them, as before. The editor's own producers set + rows the same one way. + +- A drag draws no guide lines: no dashes where a pane or column would + land, no rail for a carried column, no dashed seam under a pane rule + held. The line between two columns no longer resizes them (nor, at a + pane's corner, the panes too): a press there is a press in the pane. + A column resizes by its box, left of its tag; a pane by its own box, + or in a window by the rule above it. + +- An edit to the core recompiles it about 2 s sooner again (`core-test`, + 16 % fewer of the compiler's instructions, 4.4 MB less code in a Debug + test): a load's note on a field (another build's dump) is written from + the type's and the field's names at run time, where every type and + field had its own copy of the code that writes one; one byte dump's + reader serves a session, a pane and the rest, where each had its own; + and what tells a replica's build from another's (`wire.semantics`) + joins its two long parts on, and the tape's shape writes its numbers + itself and copies each line it builds once, where it formatted them + and copied the line again for each piece, at every compile. + +- An edit to the core recompiles it about 3 s sooner (`core-test`, 13 s to + 10 s): the build keeps each grammar's highlight patterns that pardes + colours once, where every compile of every program that takes the core + did it again, a quarter of its time. A package that depends on pardes + is given the same filtered queries. + +- The 256-colour palette Petscii art and the window draw a palette colour + with is pardes's own (`colors.xterm`), ghostty-vt's default to the entry. + +- Commit patches open as `+Diff-` and reuse only their own + commit's pane, so another paged patch no longer replaces one already open. + +- zstbi is upstream's again (zig-gamedev/zstbi, its main): the fork pinned + for Zig 0.17 was deleted, and a fresh checkout could not fetch it. + +- pardes's syntax is a library: a Zig package that depends on pardes is + given the `pardes-syntax` module (`src/lib_syntax.zig`), with the + grammars, highlighting, declarations, syntax tree and themes as the + editor has them, for a program that draws source text itself. Every + dependency but tree-sitter's runtime is lazy in the manifest, so such a + package fetches the runtime and the grammars of its `tree-sitter` set + and nothing else; `zig build lib-test`, which `unit-test` runs, builds + one (`test/lib`). The markdown grammar is pinned by its commit: its + branch has moved, and a fresh checkout could not fetch it. + +- Enter, `o` and `O` give the new line helix's indent where the file's + grammar has an indent query (bash, C, C#, C++, Clojure, CSS, Elixir, + Fortran, Go, HTML, Java, JavaScript, JSON, Kotlin, OCaml, PHP, Python, + Ruby, Rust, Scala, Zig), from the file's syntax tree; elsewhere the + line's indent as before. Enter between a pair (`()`, `[]`, `{}`, quotes) + puts the closer on a line of its own and the cursor on one a level in. + A closer typed on its own line stays where it is typed, as in helix. + +- A session's end (`Exit`, the last pane's `Del`, its terminal or window + gone) leaves a slim dump in the state file: its panes with their files, + directories and places, not a clean file's text, an undo history or a + terminal's screen. `History` (`SPC f h`) lists the state file's dumps in a + `+History` pane, each as the command that brings it back, `Restore +