pmacs/src
Levi Neuwirth f86c966090 fix(config): reject wrongly-typed spec fields; make trim-on-save buffer-aware
Review round 1, findings 2-4 plus doc notes. Finding 1 landed in fd80bcb.

Finding 3 --- spec fields meaningless for the declared type are now
rejected. DEFINE_SPEC_FIELDS whitelists all nine keys for every type and
the kind parser only reads its own arm's fields, so
`{ type = "string", choices = {...} }` silently defined a string that
accepts anything (the author meant enum) and `min` on a boolean was
dropped. These are typo-shaped bugs the R50 whitelist structurally
cannot see: the key is spelled correctly, it is on the wrong type.
`check_fields_relevant_to_kind` closes it with a pointed error naming
the misplaced field, and a companion test pins that each field is still
accepted where it belongs, including `min`/`max` on number as well as
integer.

Finding 4 --- the after_buffer_removed purge had no end-to-end test.
Every existing test called ConfigRegistry::remove_buffer directly, so
deleting the three lines wired into mod.rs would have left the whole
suite green. The new acceptance test kills a buffer through
pmacs.buffer.remove (the real remove_buffer_and_fire route) and asserts
the locals are gone; bite-verified by removing the hunk and watching it
fail.

Finding 2 (the half with a natural buffer) --- editing.trim-on-save is
now resolved against the buffer being saved rather than the global
chain. Reading globally meant set_local was accepted, stored, and
reported by describe, then never consulted: a pin the user believes in
that does nothing, which is the shape F1 exists to prevent. Two tests,
one for the override and one for the global fallback the change could
have broken; the override test fails against the old global read.

Both new save tests initially passed VACUOUSLY and were rewritten:
pmacs.editor.save() is the raw save, while buffer.before-save fires
inside the buffer.save COMMAND (default.lua:224), and save() no-ops on
an unmodified buffer --- so the original form asserted on a file that
was never rewritten. They now insert content to dirty the buffer and go
through pmacs.command.invoke("buffer.save").

The other half of finding 2 --- a per-buffer autosave.interval-ms is
semantically meaningless yet still accepted --- is recorded as a named
deferral proposing a define-time `scope = "global"` flag, alongside
deferrals for bound-parse field naming and StartupOnly reset symmetry.
Also recorded: interval_ms(1e30) now raises instead of storing a
nonsense float, an improvement but a real divergence from "the wrapper's
shape stays exactly as it was".

Doc: the module header cited framing revision 2; the shipped doc is
revision 3, whose corrections are what the code implements.

Gates: fmt, clippy -D warnings, --lib (1691), --lib --features crdt
(1865), lua54 backend, config_registry_acceptance (16), editops (72),
autosave (29), PMACS_REQUIRE_GPU=1 pmacs-gpu (109), and the full
workspace sweep (2806 tests, exit 0). git diff --check clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 18:29:18 -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(config): reject wrongly-typed spec fields; make trim-on-save buffer-aware 2026-07-21 18:29:18 -04:00
packages feat(persistence): autosave + crash recovery (Arc 3 phase 3) 2026-07-09 10:24:08 -04:00
terminal fix(vterm): harden terminal cell and input invariants 2026-07-21 16:27:43 -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
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(vterm): add Stage 1 terminal core 2026-07-21 14:20:28 -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
completion.rs feat(protocol): v15 CompletionPopup message + producer + daemon gate (Q#C5) 2026-07-07 17:10:31 -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 feat(statusline): add composable modeline segments at protocol v18 2026-07-21 12:01:25 -04:00
daemon_attach.rs CI fixes v2 2026-05-18 13:12:10 -04:00
definition.rs
desktop.rs feat(persistence): autosave + crash recovery (Arc 3 phase 3) 2026-07-09 10:24:08 -04:00
diag.rs perf(themes): PR #120 round 5 -- O(1) frozen counts via store totals 2026-07-15 11:19:03 +01:00
document_highlight.rs T M4.5: documentSymbol / workspace symbol / documentHighlight 2026-05-18 22:15:03 -04:00
editor.rs fix(vterm): harden terminal cell and input invariants 2026-07-21 16:27:43 -04:00
editor_core.rs feat(themes): named UI faces + ThemeFacts channel (protocol v16) 2026-07-14 16:11:09 +01:00
file_io.rs feat(persistence): autosave + crash recovery (Arc 3 phase 3) 2026-07-09 10:24:08 -04:00
font_pref.rs feat(font): FontFacts wire + daemon half (v17, FontPref, producer) 2026-07-18 11:45:51 +01:00
formatting.rs
frontend.rs feat(statusline): add composable modeline segments at protocol v18 2026-07-21 12:01: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 Collapse if-let nests into let-chains (MSRV-1.95 collapsible_if sweep) 2026-05-18 14:29:36 -04:00
highlight.rs feat(statusline): add composable modeline segments at protocol v18 2026-07-21 12:01:25 -04:00
hook.rs
hover.rs Collapse if-let nests into let-chains (MSRV-1.95 collapsible_if sweep) 2026-05-18 14:29:36 -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 M10.10 ship gate 2026-05-13 16:28:46 -04:00
key.rs
keymap_stack.rs Collapse if-let nests into let-chains (MSRV-1.95 collapsible_if sweep) 2026-05-18 14:29:36 -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(config): typed configuration registry with buffer-local scope 2026-07-21 18:29:18 -04:00
locations.rs T M4.5: nav requests — references/declaration/typeDefinition/implementation 2026-05-18 21:39:02 -04:00
lockfile.rs
lsp.rs feat(statusline): add composable modeline segments at protocol v18 2026-07-21 12:01:25 -04:00
lsp_status.rs
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
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 pmacs context menu: registry + open-menu state types (Q#CM1/Q#CM2) 2026-06-27 21:42:28 -04:00
message_bus.rs
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 fix(compile): PR #113 round 6 — idempotent split-complete attachment, no-op edit guard, handle disposal 2026-07-14 10:17:56 +01:00
overlay_color.rs M10.10 ship gate 2026-05-13 16:28:46 -04:00
overlay_paint.rs feat(tui): line-number gutter (UX arc sub-arc 1, TUI half) 2026-07-06 13:38:38 -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 feat(statusline): add composable modeline segments at protocol v18 2026-07-21 12:01: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(themes): named UI faces + ThemeFacts channel (protocol v16) 2026-07-14 16:11:09 +01:00
semantic_client.rs T M4.5: documentSymbol / workspace symbol / documentHighlight 2026-05-18 22:15:03 -04:00
semantic_render.rs fix(statusline): harden narrow-band review edges 2026-07-21 12:43:22 -04:00
semantic_tokens.rs Fix stale TUI styling after edits 2026-05-26 11:15:23 -04:00
signature.rs Collapse if-let nests into let-chains (MSRV-1.95 collapsible_if sweep) 2026-05-18 14:29:36 -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(json-yaml): JSON + YAML grammars and language servers 2026-07-20 16:49:37 -04:00
text_view.rs feat(tui): diagnostic gutter signs riding the line-number gutter (sub-arc 2) 2026-07-06 19:17:43 -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 fix(compile): PR #113 round 6 — idempotent split-complete attachment, no-op edit guard, handle disposal 2026-07-14 10:17:56 +01:00
window.rs fix(compile): PR #113 round 6 — idempotent split-complete attachment, no-op edit guard, handle disposal 2026-07-14 10:17:56 +01: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