pmacs/src
Levi Neuwirth 9110f9f32c fix(window): keep pmacs.window.buffer() infallible with no argument
PR #155 review round 2, self-review of the round-2 commit.

The round-2 change labelled "minor" — resolving both arms of
pmacs.window.buffer() through the acting frontend for uniformity — made
the NO-ARGUMENT arm fallible. `acting_frontend` follows the interactive
origin, which can name a frontend that has no registered view: a bare
`dispatch_key` from an unattached peer does exactly that. `selected_window`
then raises "acting frontend has no layout" instead of answering.

Nothing surfaced that error, because the runtime callers do not pcall it.
killring, syntax, autosave, pair, indent and comment all read
pmacs.window.buffer() on ordinary edits, so the raise silently dropped
the operation: kill_ring_acceptance went 30/30 to 25/5, with
frontend_detached_drops_per_frontend_state reporting only "B has kill
state". main is 30/30, and reverting this one file restored it.

The no-arg arm is back on ambient active_buffer_id() and now documents
why that is deliberate rather than an oversight: dispatch sets
active_frontend to the acting frontend before running a command, so the
two agree on every real path, while only the ambient resolver has the
fallback that makes it total. The explicit-window arm keeps its Q#BP11
layout validation, which is what the arc actually needed.

acc19c pins it through the real path — a buffer.after-edit subscriber
reading pmacs.window.buffer() during a viewless peer's dispatch_key —
rather than by calling the binding directly. Bite-verified:
scripts/bite bbe4152 src/lua_bindings/mod.rs --test
bottom_panel_stage1_acceptance -- acc19c goes red with the exact
"acting frontend has no layout" traceback.

The ledger also records two gating facts found on the way: the workspace
sweep must run with an isolated XDG_CONFIG_HOME, because the real user
init.lua installs a local package and the losing race leaks a status
message into painted-frame comparisons; and a latent pre-existing main
bug in the buffer CRDT undo path, which is not this branch's and whose
proptest seed is deliberately not committed here.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012j4omtTMn9v1UfmHQb9ap6
2026-07-24 20:05:51 -04:00
..
audit V0.2-prerequisite pull-forward + M10.11 clean audit round 2026-05-18 10:31:31 -04:00
bin fix(json-yaml): checkpoint reviewed LSP configuration fixes 2026-07-20 16:49:37 -04:00
lua_bindings fix(window): keep pmacs.window.buffer() infallible with no argument 2026-07-24 20:05:51 -04:00
packages feat(persistence): autosave + crash recovery (Arc 3 phase 3) 2026-07-09 10:24:08 -04:00
terminal fix(terminal): implement the Q#BP7 growth re-arm and pin it honestly 2026-07-24 18:32:23 -04:00
ansi.rs fix(vterm): parse VT index operations 2026-07-21 15:31:15 -04:00
async_runtime.rs feat(injections): multi-language injection layers 2026-07-15 12:07:21 +01:00
attach.rs T M11.6 — DispatchIdle signal closes optimistic-apply blindness (#45) 2026-05-21 13:49:48 +00:00
attach_dispatch.rs Initial commit: v0.1.0 2026-05-03 19:51:06 -04:00
attach_reconnect.rs Pin toolchain to 1.95.0 + mechanical clippy/rustc fixes 2026-05-18 11:38:57 -04:00
autosave.rs fix(persistence): adopt clears the old owner's skip cache; failing sweeps are loud 2026-07-09 12:06:49 -04:00
buffer.rs feat: wire major modes through key dispatch 2026-07-21 20:25:48 -04:00
buffer_mirror.rs M10.10: complete optimistic-apply keystroke path + Day-5 corrections 2026-05-15 16:40:46 -04:00
buffer_registry.rs T M4.5 L1: cross-file nav foundations — per-buffer file_path, jump ring, x-file go-to-def 2026-05-19 09:53:29 -04:00
builtin_packages.rs M7 tail: package system, audit lint, lockfile, resolver 2026-05-07 16:50:37 -04:00
cell.rs session 1 commit 2/4: cell wire types moved to pmacs-protocol 2026-05-20 09:20:24 -04:00
code_action.rs T M4.5 L4: WorkspaceEdit resource ops (create/rename/delete file) 2026-05-19 12:31:35 -04:00
command.rs Initial commit: v0.1.0 2026-05-03 19:51:06 -04:00
completion.rs feat(fold): Stage 2 — grid (daemon-rendered) collapse 2026-07-23 19:24:07 -04:00
completion_framework.rs fix(completion): address TUI-validation findings (LSP query gaps, scoping, prefix keys, window scope) 2026-07-07 16:54:14 -04:00
config.rs Collapse if-let nests into let-chains (MSRV-1.95 collapsible_if sweep) 2026-05-18 14:29:36 -04:00
config_registry.rs fix(config): reject wrongly-typed spec fields; make trim-on-save buffer-aware 2026-07-21 18:29:18 -04:00
crdt.rs optimistic-apply daemon support — Loro text-delta hot path for remote inserts 2026-06-10 10:45:23 -04:00
daemon.rs fix(window): wire the side-window split guard and scope the divider drag 2026-07-24 15:07:35 -04:00
daemon_attach.rs CI fixes v2 2026-05-18 13:12:10 -04:00
definition.rs Initial commit: v0.1.0 2026-05-03 19:51:06 -04:00
desktop.rs feat(window): window parameters, fixed extents, and the display policy 2026-07-24 13:53:14 -04:00
diag.rs feat(fold): Stage 2 — grid (daemon-rendered) collapse 2026-07-23 19:24:07 -04:00
display_width.rs feat(render): unify tab-width projection 2026-07-22 15:03:30 -04:00
document_highlight.rs T M4.5: documentSymbol / workspace symbol / documentHighlight 2026-05-18 22:15:03 -04:00
editor.rs fix(terminal): implement the Q#BP7 growth re-arm and pin it honestly 2026-07-24 18:32:23 -04:00
editor_core.rs fix(window): wire the side-window split guard and scope the divider drag 2026-07-24 15:07:35 -04:00
file_io.rs feat(persistence): autosave + crash recovery (Arc 3 phase 3) 2026-07-09 10:24:08 -04:00
fold.rs fix(fold): address PR #142 review round 1 2026-07-23 13:42:20 -04:00
fold_view.rs feat(fold): Stage 2 — grid (daemon-rendered) collapse 2026-07-23 19:24:07 -04:00
font_pref.rs feat(font): FontFacts wire + daemon half (v17, FontPref, producer) 2026-07-18 11:45:51 +01:00
formatting.rs Initial commit: v0.1.0 2026-05-03 19:51:06 -04:00
frontend.rs Implement session-scoped GPU initial targets 2026-07-23 19:03:25 -04:00
fs.rs CI fixes v2 2026-05-18 13:12:10 -04:00
hash.rs feat(persistence): autosave + crash recovery (Arc 3 phase 3) 2026-07-09 10:24:08 -04:00
help.rs feat: wire major modes through key dispatch 2026-07-21 20:25:48 -04:00
highlight.rs Merge branch 'main' into folding-tui 2026-07-23 19:43:13 -04:00
hook.rs Initial commit: v0.1.0 2026-05-03 19:51:06 -04:00
hover.rs feat(fold): Stage 2 — grid (daemon-rendered) collapse 2026-07-23 19:24:07 -04:00
inlay_hint.rs Close pmacs-gpu phase A audit 2026-05-28 12:49:23 -04:00
instance_buffer.rs Collapse if-let nests into let-chains (MSRV-1.95 collapsible_if sweep) 2026-05-18 14:29:36 -04:00
instance_render.rs test(vterm): prove Stage 2 TUI integration 2026-07-21 20:16:23 -04:00
key.rs Fix PTY final-output drain race 2026-05-04 09:44:30 -04:00
keymap_stack.rs feat: wire major modes through key dispatch 2026-07-21 20:25:48 -04:00
keymap_tree.rs Collapse if-let nests into let-chains (MSRV-1.95 collapsible_if sweep) 2026-05-18 14:29:36 -04:00
lib.rs feat(fold): Stage 2 — grid (daemon-rendered) collapse 2026-07-23 19:24:07 -04:00
locations.rs T M4.5: nav requests — references/declaration/typeDefinition/implementation 2026-05-18 21:39:02 -04:00
lockfile.rs Initial commit: v0.1.0 2026-05-03 19:51:06 -04:00
lsp.rs feat(statusline): add composable modeline segments at protocol v18 2026-07-21 12:01:25 -04:00
lsp_status.rs Initial commit: v0.1.0 2026-05-03 19:51:06 -04:00
lua.rs feat(completion): Lua driver, popup bindings, LSP scoping + flush seams 2026-07-07 12:09:25 -04:00
lua_isolation.rs M7 tail: package system, audit lint, lockfile, resolver 2026-05-07 16:50:37 -04:00
main.rs fix(gpu): preserve session isolation during target publish 2026-07-23 21:25:33 -04:00
mcp.rs Collapse if-let nests into let-chains (MSRV-1.95 collapsible_if sweep) 2026-05-18 14:29:36 -04:00
menu.rs feat(fold): Stage 2 — grid (daemon-rendered) collapse 2026-07-23 19:24:07 -04:00
message_bus.rs Initial commit: v0.1.0 2026-05-03 19:51:06 -04:00
minibuffer.rs feat(persistence): state foundation + saveplace + recentf (Arc 3 phase 1) 2026-07-08 17:57:39 -04:00
optimistic.rs feat(edit): auto-pairing (Arc 2) 2026-07-11 17:11:56 +01:00
overlay.rs feat(fold): Stage 2 — grid (daemon-rendered) collapse 2026-07-23 19:24:07 -04:00
overlay_color.rs M10.10 ship gate 2026-05-13 16:28:46 -04:00
overlay_paint.rs feat(window): window parameters, fixed extents, and the display policy 2026-07-24 13:53:14 -04:00
prepare_rename.rs T M4.5: textDocument/prepareRename (backlog item 3) 2026-05-19 14:23:57 -04:00
presence.rs M11.1: semantic-frontend protocol scaffolding (wire + capability) 2026-05-18 19:39:07 -04:00
process.rs fix(vterm): normalize Darwin PTY signal names 2026-07-21 14:37:54 -04:00
project.rs Collapse if-let nests into let-chains (MSRV-1.95 collapsible_if sweep) 2026-05-18 14:29:36 -04:00
project_index.rs T M4.5 L1: cross-file nav foundations — per-buffer file_path, jump ring, x-file go-to-def 2026-05-19 09:53:29 -04:00
protocol.rs Implement session-scoped GPU initial targets 2026-07-23 19:03:25 -04:00
rename.rs T M4.5 L4: WorkspaceEdit resource ops (create/rename/delete file) 2026-05-19 12:31:35 -04:00
rope.rs session 1 commit 3/4: CrdtOp moved to pmacs-protocol 2026-05-20 09:32:09 -04:00
search.rs feat(fold): Stage 2 — grid (daemon-rendered) collapse 2026-07-23 19:24:07 -04:00
semantic_client.rs T M4.5: documentSymbol / workspace symbol / documentHighlight 2026-05-18 22:15:03 -04:00
semantic_render.rs fix(fold): address PR #142 review round 1 2026-07-23 13:42:20 -04:00
semantic_tokens.rs Fix stale TUI styling after edits 2026-05-26 11:15:23 -04:00
signature.rs feat(fold): Stage 2 — grid (daemon-rendered) collapse 2026-07-23 19:24:07 -04:00
socket_path.rs Collapse if-let nests into let-chains (MSRV-1.95 collapsible_if sweep) 2026-05-18 14:29:36 -04:00
state.rs fix(persistence): never clobber unclaimed crash data; buffer-keyed cleanup 2026-07-09 10:52:10 -04:00
statusline.rs fix(statusline): harden narrow-band review edges 2026-07-21 12:43:22 -04:00
symbol.rs T M4.5: documentSymbol / workspace symbol / documentHighlight 2026-05-18 22:15:03 -04:00
syntax.rs feat(web): bundle HTML + CSS grammars + HTML injections 2026-07-23 15:04:10 -04:00
text_view.rs feat(fold): Stage 2 — grid (daemon-rendered) collapse 2026-07-23 19:24:07 -04:00
transport.rs session 3 commit 1/N: move transport codec to pmacs-protocol 2026-05-20 12:07:32 -04:00
view.rs feat(fold): Stage 2 — grid (daemon-rendered) collapse 2026-07-23 19:24:07 -04:00
window.rs fix(window): wire the side-window split guard and scope the divider drag 2026-07-24 15:07:35 -04:00
worker.rs fix(worker): deterministic pool teardown; EditorState::drop signals workers 2026-07-07 15:20:53 -04:00
workers_buffer.rs Collapse if-let nests into let-chains (MSRV-1.95 collapsible_if sweep) 2026-05-18 14:29:36 -04:00