summaryrefslogtreecommitdiff
path: root/src/hunks.zig
Commit message (Collapse)AuthorAge
* plumber: the pager sends (docs/next-plumber.md, phase 4): a +Pager filled ↵Gabriel Schneider20 hours
| | | | with a diff (File.looksLikeDiff, pager_diff) is a plumbing message, as acme's `plumb -i` sends what it shows: fillPager's last call is Plumb.paged, which sends src pager, dst edit, wdir the +Pager's directory, type text/x-diff, `action=showdata filename=<the +Pager's name>` (quoted as mesg.c quotes), the text as data; the default rules' last set makes it showdiff (attr delete action, attr add action=showdiff, plumb to edit), and the edit port's showdata and showdiff (Plumb.show, acme's plumbshow) show the data in the pane filename names, the sender's own first, else a new clean pane of that name, showdiff then restacking it in a +Diff in its place (hunks.paged, the code the pager's hook called, unchanged); text paged that is no diff is not sent, where the record had every page sent: the look rules would read it whole, `type is text` holding (a `matches` over a MiB of output, up to the regular expressions' 300 ms budget, at each page), and a page of one line naming a file would ask the disk; the rules in force are read once and kept until their text changes (Plumb.parsed, by its hash, derived state: each process's own), measured in a fast build per send: 29k instructions to read the default rules, a URL's send 37k before, 8.3k after, a word's look 69k before, 40k after, a look that opens a file 262k before (its send 63k), 233k after (34k); test: a diff paged is stacked by the default rule, text that is no diff stays a +Pager, without the rule the +Pager stays as text, and another sender's showdata and showdiff; the design record gains what phases 2-4 did otherwise (detached starts with no output kept, only diffs paged sent, own ports asking nobody, the rules read once); plumber.zig's defaults end with the paged rule; the reference, the default rules' file and the changelog say so
* plumber: a look sends what it looks at (docs/next-plumber.md, phase 2): ↵Gabriel Schneider20 hours
| | | | after the pane's own readings and once a name already open in a pane is focused (never sent), lookAt sends the trimmed name, type text, src pardes (term from a raw terminal, a kind's name from its pane), wdir the pane's directory, with what resolveLookTarget found of it (Plumb.Seen: isfile and isdir take it, so no second stat and Look's own readings of a URL or `//` stay no file); a message the rules give back to `edit` as sent is Look's own (Sent.look) and runs lookAt's switch on that target, one nothing takes or a started word declines is Look's own too, whose `.url` arm is now the word's search; the edit port's open of another message runs with look_text, which now means "unplumbed", so the edit port's lookAt never sends again (the recursion trap); the three diff hooks become the default rules of the record's §5.2 (a bare .diff/.patch to `Diff $file`, a commit hash in the editor to `Diff $0`, after the two edit sets), and `Diff` takes a file or a revision, a rule's Diff declining in silence (Pardes.plumb_declined) where it cannot (no hunk, not readable, no .git above): hunks.lookedAt and lookedAtCommit go, their bodies in hunks.word, the `needs` check of the bare form in the word, PaneKind.diff gone; the old one-line `Plumb` word, Core.plumb, look.Port, plumbRuleError, plumbTarget and resolve's rules block go: bare, `Plumb` opens <config>/plumbing as Config opens init (both through builtins.openConfigFile; `include basic` in a new one), an argument is refused in words, Save applies it (host_io.writeFile beside reapplyInitFile, Plumb.saved), and boot reads it (Plumb.boot in applyStartupConfig); a started program now runs detached as Plan 9's plumber's (the coordinator's decision for the user's question 4): Effect.start, every host's host_io.startDetached (double fork, setsid, /dev/null for 0-2, every other fd closed, argv exec'd in wdir with no shell, the child's errno back through a close-on-exec pipe, said as `plumb start: <prog>: <why>`), so exec_dir goes; resolveLookTarget's and Plumb.Send.search's directory walk is one look.Dirs; test: look.zig's Plumb test rewritten onto the rules (a rule's word, an open pane unsent, the hover's resolve, a URL with no web rule searched for) and a hash inside and outside a git work tree; addons.zig's Plumb test onto plumb/rules (a port no kind reads, its kind gone: Look's own); Plumb.zig: the word, the save and boot; replicas.zig gains a URL (speculated whole, confirmed, no rollback) and a hash, each the authority's and a replica's own; every look golden unchanged; the reference quotes src/plumbing whole and says the order, the changelog says so
* hunks: the +Diff's editor side in one place: openDiff, showDiffText and ↵Gabriel Schneider20 hours
| | | | | | | diffSource move from Output.zig, the `Diff` word's body and PaneKind.diff's test from builtins.zig, lookCommit (as lookedAtCommit) and its test from look.zig; builtins.zig's Diff is its one registration (its doc, traits and `run = hunks.word`); the three open hooks a plumber's rules would replace are a call each, look.zig's `hunks.lookedAt` (a bare look at a .diff or .patch) and `hunks.lookedAtCommit` (a commit hash) and ninep/ctl.zig's `hunks.paged` (a +Pager filled with a diff), their conditions inside them; the diff language (diff.zig, syntax.zig's highlightDiff, look's diff-line address) stays where the languages are; code locality's far share 0.575 before and after (codeloc.py --compare); goldens unchanged Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* hunks: format stacks for a narrow Ctx, not a *Pardes: its two allocators, ↵Gabriel Schneider20 hours
| | | | | | | `source(dir, path)` (a file as a look from dir finds it), `declarations(path, bytes)` and the one setting, tslocations; Output.openDiff gives the editor's, its reads the same taped sites as before (locations.sourceText: an open pane's text, else fs.read) and its declarations the locations cache's, so a replica still replays the authority's bytes; displayWidth from File.zig itself; the four format tests read the disk through a Ctx of their own and stop booting a whole Pardes (the look and refill tests still drive the editor); goldens unchanged Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* colors: a style byte's four high bits are grounds a theme resolves, not a ↵Gabriel Schneider20 hours
| | | | | | | diff's: syntax.ground_add and ground_del (a row's hue), ground_emph (the stronger ground), ground_line (the faint one), the byte as it was; DiffTints moves from File.zig to colors.zig as Grounds (an add and a del Ground: row, emph, line, ink), the same Oklab mixes and marker contrast; the painter has one rule, a row's first byte says its ground (emph the stronger to the pane's edge, line the faint, neither none, its marker in the hue) and a later byte's emph is its cell's, so it stops asking the pane's colour algorithm (`row_tint = algo == .diff`) and works the grounds out once a frame only for a row that names a hue; highlightDiff marks an added or removed line's first byte emph, the strong row a .diff's rows always had; recolorDiffOutput reads the same Grounds; goldens unchanged (diffview, pagercolor, diffstack), render of the 50k-line file 11,723,421 user instructions a frame before and 11,724,208 after (+0.007%, perf stat over ReleaseFast pardes-perf, 210 frames less 10) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* addons: an addon can hand the frontend a GPU scene (ABI 3.1), and a snake ↵Gabriel Schneider20 hours
| | | | | | | | | | | | | | drawn by shaders does; a commit's patch keeps its own +Diff pane; a real ZLS checked through the window build ABI 3.1 appends an optional `gpu` callback and its context to pa_paint: one self-contained sketchbook SGPU v1 scene for the pane, at most 4 MiB, copied during the call, the last successful call winning. The SDL frontend runs it on its own GPU through sketchbook's executor and composites its target texture into the pane; replicas carry the scene beside the authoritative pane frame; cells and rasters stay the fallback for terminals, older hosts and frontends without an executor. addons/snake_shader is such an addon (`zig build snake-shader`, the SnakeShader word: a board that follows its pane, buffered turns, a CRT look), with test/gpu_snake.py, test/gpu_snake_interaction.py and test/gpu_upgrade.py. Commit patches open as `+Diff-<short-hash>` and reuse only their own commit's pane, so another paged patch no longer replaces one already open. The language-server client looks in the standard per-user bin directory, which desktop launchers often leave out of PATH, and takes an empty answer that beats the startup progress notification onto the wire; test/real_zls.py checks imports, hover, references, rename previews, diagnostics and completion against a real ZLS from a private home. The dump's schema reader skips two fields older builds persisted, and a replica's shadow of a kind ticks when the authority's does. The reference, the guide, the building and setup notes and the changelog say so. The working copy as it stood on 2026-11-12; message written by Claude from the diff, at the author's request.
* idioms #14, the rest: wire's has_cell_pixels (@hasField on a struct that ↵Gabriel Schneider12 days
| | | | | | | always has the field) goes with its comptime branches, syntax's predicate ops are a stringToEnum switch, the public surfaces of sam_edit, locations, Names, Macro, selection_pipe, recent and builtins_json name their sets (OutOfMemory, Writer.Error), and std.fs.path and max_path_bytes are std.Io.Dir's Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* client #1, the views indexed: a view's share of the session is Pardes.View ↵Gabriel Schneider12 days
| | | | | | | (the ~42 fields views.fields named: size, cell metrics, columns, rects, focus, jumps, pointer, gestures, prefixes, frontend), one of Pardes.views[4] (null when closed), the live one views[live] through Pardes.view() (index field `view` renamed `live`); going into another view is the index plus the panes' shares, which stay swapped (park and unpark now move only Pane.pv); views.zig loses fields, Part over Pardes, Parked, kept, emptied and the session half of every copy, and a pane closing leaves every view's layout at once (views.gone, at the two places a slot is freed) instead of the serials each parked view kept; drawOne and within put the drawn view's own share back whole; the views are in the digest now (tape's per-field parts name views[k].field), so a fresh view's col_x/col_w default to zeros, not undefined; the dump keeps every open view in the core and the panes' shares of the others under `shares`; an image from before (live view as the core's own fields, the rest under `views`) loads them into views[] once; the ~2,400 references rewritten mechanically from the compiler's errors (p.active is p.view().active, `const v = p.view()` hoisted in 823 places), Kind.zig (4 lines) and addon_test.zig (3) among them, macos.zig by pattern (not compiled here); tape's watched host writes read the live view's frontend and active; perf.zig's accessor lines change its harness hash, the debug baselines re-keyed to it (their numbers the base's); no golden changes; gates: core-test 956/956 both, unit-test 1487/1488 tui and 1530/1531 gui, behaviour-test 248/248 both, pane-test 171/172, snap all 105 ok, process-test 0 of 37 failed tui, replicas ok Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* config, exec, look: Placement, BootShell, LookWord, DirLook and DiffLook go, ↵Gabriel Schneider13 days
| | | | | | | with what each kept of pardes before it took acme's ways (exec's pardesPlace, atFoot, belowParent, pardesDoc and evictLonePristineTty with mouse.zig's call, layout's splitParent and columnFitsHalves that only they called, look's ls in a terminal for a directory, the word and patch looks' other branches, the SPC c p key, their Help and builtins-JSON rows, their lines in docs/typ and a changelog line), and the tests of them: Dir.zig's "DirLook terminal: a look at a directory opens a terminal there, no pane listing it", pardes.zig's "first document fallback splits like Term from the originating pane", "first document keeps its originating shell and only opens a column when it fits", "BootShell keep leaves the untouched boot shell a dragged document joins; replace closes it" and "a Look on a directory does not type ls into an occupied terminal", keys.zig's "keys: SPC j n and SPC j p walk on from the place a Look's +Search listing chose, its keyboard left in the file", look_and_exec.zig's "look-and-exec: a second LookWord list look in a directory refills its +Search rather than stacking another", placement.zig's "placement: Placement pardes puts a new pane right under the asking one, and bare it steps back to acme", output.zig's "LookNext/LookPrev keeps the result output a Look chose through a no-match answer, and a stale serial once it is deleted", and the snapshot scripts that turned them on (cmdword, doccol, look-dir, lookpanes, rsearch, splitparent, ttylook); the Del question's test makes its middle panes the acme way, a New at the column's foot, and the others that turned one on for their layout run without it Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* locations: one appendRow copies a row's path and colours onto a list being ↵Gabriel Schneider13 days
| | | | | | | built, for appendMetadata, hunks' Out.row and Query's writeRow, which each copied, appended and freed on failure by hand Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
* Audit (misc): std mkdir -p and JSON escaping, a 9P late failure's errno from ↵Gabriel Schneider2026-10-23
| | | | | | ctl.failureErrno, dead switches and dumpHex out Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Callstack lists every caller and pages a tree too big for one query; memory ↵Gabriel Schneider2026-10-23
| | | | | | | | | | | | | | | | bounds and resident-size fixes Callstack walks while the server answers, counts on the message row past a second, puts test callers last at each level, and ends a tree past one query's memory (memory.limits.arena.lsp_query, a 256 MiB region taken and given back per query) in a row whose Callstack shows the next page. Grep reads whole files. New hard limits: undo text per file, image decode pixels, the LSP snapshot of other open files, one paste. Safe builds no longer fill worst-case buffers with 0xAA (memory.unfilled), big regions are kept off transparent huge pages, and malloc_trim runs after big results. Also: Look's git show pages into a +Diff, and dropped marks in File. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Def and Refs in a language-served file's tag, a diff viewer's tinted word ↵Gabriel Schneider2026-10-22
edits, context rows that hold still under a scroll, and the pardes skill Def and Refs (gd, gr, Ctrl-click; chorded 2-1 at the selection) for a file a language server speaks for; hunks.zig stacks a unified diff as a diff viewer does, its changed words on a tinted ground as delta's do; the tree-sitter context rows stay put while the body glides under a scroll; .agents/skills gains the pardes skill beside pardes-9p.