From 09729fc927bca5f05f99de7844069cae445598a1 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 25 Nov 2026 02:03:41 -0300 Subject: Command: a question waiting on the pane lists its answers as `:`'s first rows, a letter typed only filtering them and Tab or a click giving one; `:open ` lists the files the panes show; and the faults the gates met (walk UI, pick-ui SPEC.md ยง10.4, item 4 of line E2): with a question waiting on the pane (Messages.waitingAnswers) its answers are the names' first rows, each after its key in the key ink (`r Reload`, `k Keep mine`, `d Diff`), `answers the question` on their right, the last ruled off from the tag's words as theirs is from the commands; typing filters them as the rest (Names.match on the word), so a letter never answers (`:r` is a line, `:reflow` runs reflow); Enter gives one when the current row is an answer Tab or a click put in the field, or its whole word typed, the tag at rest first (Messages.waiting, Messages.answer); a click (B1, TagState.point) on an answer gives it at once, and on a line of C-r's history puts that line in the field (Prompt.history_row marks a history row's index: a click there was read as an index of the rows); a damaged image's cursor past the rows is held to the last (Command.current); THE STAND-IN: this tree has no questions: Messages.zig's block from `---- a stand-in for line C's questions` to `---- the stand-in's end ----` has `Answer`, `waiting`, `waitingAnswers` and `answer` in the shapes of line C's (vxmpyyst), saying none, and root.zig's allowed_vars line `Messages.zig stub_asked` its test's question: THE MERGE WITH C DELETES BOTH and keeps C's; Command.zig's test asks through the stand-in here and, by `comptime @hasDecl(Messages, "stub_asked")`, through a file changed on disk under unsaved text in C's tree (`ask`, as C's own test asks), nothing to edit; THE FAULT THE SOAK MET (item 2's): `:open ` listed the session's recent files, which are its alone (Core.zig `.authority`): random keys typed `:o ` and the session listed them where a client listed none, so the band under the tag took other rows there (pane tag_rows, rows, the view's rects: the witness's names) and a PDF pane's kind diverged after its view (rtt 30: diverged 31, the tape's answers to the addon short after); now the files the panes show, each once (Command.fileOf, firstOf: replicated, 64 at most); THE FAULT THE 40,000-SEED FUZZ MET (in no code of this line: the dump's layout moved, TagState.worn and Prompt.command, and a seed met it): a dump whose fs.Namespace `opens_len` said 98 of its 64 opens was refused (walk.holdTo), and the load's errdefer (dump.zig loadKnowing) tore the namespace down over `opens[0..opens_len]`: index out of bounds, a panic where a refusal was due; Namespace.deinit holds the length to its opens now; a user restoring a damaged dump could have hit it; TEST FIRST: Command.zig "a question waiting on the pane lists its answers first, each after its key, ruled off; a letter typed only filters them; Tab onto one and Enter gives it" (a click too), fs.zig "a namespace a refused dump left saying more opens than it holds is torn down to its last" (shell-test), item 3's test clicks a history line, item 2's lists the open file; core-test 1025/1192 (167 skipped), shell-test 1239/1242, pane-test 182/184, behaviour-test and its replay 274/277 (the failures A's, as on E's tip), process-test 5 of 146 (the base's: find, builtins, leader, tagnav, ttyhelp), term-test 17/17, kitty-test 45/45; the fuzz at 40,000 join and 1,779 image seeds over a session left in `:theme o` after a Tab (TagState.worn set): pass; THE SOAK, 5 clients, FAILS: diverged 32/0/2 at rtt 30/80/207 (seeds 0-2: a PDF pane's kind state after its view, then the tape's answers to it short; the witness names the band's host pane's and the PDF pane's tag_rows, rows and tag_lead, and the view's rects), and inputs `the mouse in a kind's pane` that may_wait does not list; with `:`'s band held at 0 rows (Command.takes, a temporary edit, put back) the same soak is clean: diverged 0 at 30/80/207, no stop off may_wait: the fault is the band's (A's layout term) in a session with a kind's pane and clients, which no input of the soak reached before `:` (typed by its random keys) opened one; not fixed here Co-Authored-By: Claude Opus 5.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/fs.zig | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'core/fs.zig') diff --git a/core/fs.zig b/core/fs.zig index 6b43ba67..f428212b 100644 --- a/core/fs.zig +++ b/core/fs.zig @@ -1026,7 +1026,9 @@ pub const Namespace = struct { st.mounts.deinit(gpa); for (st.os_paths.items) |entry| gpa.free(entry.path); st.os_paths.deinit(gpa); - for (st.opens[0..st.opens_len]) |*o| o.deinit(gpa); + // A dump refused for its `opens_len` (walk.holdTo) left it saying + // more than it holds when the load's errdefer tears this down. + for (st.opens[0..@min(st.opens_len, st.opens.len)]) |*o| o.deinit(gpa); for (st.pages.items) |*page| page.bytes.deinit(gpa); st.pages.deinit(gpa); for (st.closed_lines.items) |*line| line.bytes.deinit(gpa); @@ -1594,3 +1596,9 @@ test "a write open(2) refuses says its errno in words" { var words: [128]u8 = undefined; try std.testing.expectEqualStrings("no such file or directory", pardes.Messages.errorWords(error.NoSuchFileOrDirectory, &words)); } + +test "a namespace a refused dump left saying more opens than it holds is torn down to its last" { + var st: Namespace = .{}; + st.opens_len = st.opens.len + 34; + st.deinit(std.testing.allocator); +} -- cgit v1.3