pmacs/src
Levi Neuwirth 9fee5618ee
feat(window): a destination any async continuation can capture
Journey Stage 1a built `pmacs.window.commit_to` for the continuation
boundary --- "the listing settles a tick or more later, and by then the
ambient frontend, selected window, and active buffer may all name
something else" --- but nothing outside the `path.open-directory`
dispatch could mint a destination to hand it. Every other async Lua
continuation therefore resolved its target from ambient state a tick
after the request, which is PR #227's P1a finding: run `git.status` in
frontend A, let B become active, and A's panel opens in B.

This is the prerequisite lane #227 blocks on
(`docs/destination-capture-framing.md`, revision 5). No adopter here:
git's adoption is #227's work, since a prerequisite that converts its
own first consumer cannot be reviewed separately from it.

Three parts.

**`pmacs.window.capture_destination()`** returns the same
nonconstructible userdata for the current frontend. No arguments, and
that is load-bearing rather than minimal (Q#DC-1): a Lua-supplied
frontend id would reintroduce exactly the fabrication hole the userdata
design closes. Profile-blind for the same kind of reason (Q#DC-4) ---
capture freezes what is true now, and what a commit depends on is
declared later, at the commit.

**`DirectoryDestination` -> `ViewDestination`**, with the Lua userdata
and the capture renamed to match. The captured triple was already
generic; only its name and its capture site were not. The document pair
is now `Option`, set and cleared together, so a frontend with no live
document window still captures rather than returning nothing and
sending the caller back to the ambient state this exists to replace.

**`commit_to(dest, body [, profile])`** (Q#DC-2/Q#DC-5), a closed set of
two. The document profile keeps all four preflight checks. The panel
profile keeps only the first --- the requesting frontend still has a
layout --- because a panel result does not occupy the captured document
window, does not replace its buffer, and does not need it to exist, so
each of the other three would refuse for a reason unrelated to what the
continuation does. Omitting the profile means `"document"`, which is
what makes the preservation promise contractual rather than careful:
every existing two-argument caller keeps all four checks by definition
of the signature.

The profile argument is typed `mlua::Value`, NOT `Option<String>`, so
its error is REACHABLE: with the narrower type mlua rejects a number or
a table during argument conversion, before the closure body runs, and
the message naming the accepted values never appears. That is the same
trap the `dest` argument documents one position to its left. `nil` and
absence are the same answer; anything else is refused by one message
that names both accepted values.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016bqGA6s9tTUFzYpbeW3tai
2026-08-10 14:11:43 +02:00
..
audit V0.2-prerequisite pull-forward + M10.11 clean audit round 2026-05-18 10:31:31 -04:00
bin fix(lsp): close review round 1 on the resource-op delete guard 2026-07-29 11:45:43 -04:00
lua_bindings feat(window): a destination any async continuation can capture 2026-08-10 14:11:43 +02:00
packages feat(persistence): autosave + crash recovery (Arc 3 phase 3) 2026-07-09 10:24:08 -04:00
terminal feat(terminal): copy mode over retained scrollback 2026-07-26 10:10:27 -04:00
ansi.rs fix(vterm): parse VT index operations 2026-07-21 15:31:15 -04:00
async_runtime.rs test(stage2a): unit pins for the URI teardown and the bus order 2026-07-29 18:23:41 -04:00
attach.rs feat(release): binaries on tag — Distribution Stage 1 2026-08-01 14:40:47 -04: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
bootstrap.rs feat(bootstrap): make the ambient storage roots a parameter 2026-07-31 18:48:07 -04:00
buffer.rs wip(stage2a): name provenance plus the View rename hook 2026-07-29 17:38:21 -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 test: the report itself, at a real PTY — and §1.1 was wrong 2026-08-07 19:37:46 +02:00
crdt.rs fix(buffer): fan out generated writes, and clear the history that exists 2026-07-26 13:43:22 -04:00
daemon.rs feat(window): a destination any async continuation can capture 2026-08-10 14:11:43 +02: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(view): horizontal scroll, text and decorations together 2026-08-07 22:43:17 +02:00
diag.rs feat(view): horizontal scroll, text and decorations together 2026-08-07 22:43:17 +02: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 feat(window): a destination any async continuation can capture 2026-08-10 14:11:43 +02:00
editor_core.rs feat(window): a destination any async continuation can capture 2026-08-10 14:11:43 +02: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 feat(protocol): LineWrapFacts at v22, and the GPU stops inheriting a default 2026-08-07 16:54:13 +02:00
fs.rs fix(dired): address PR #165 review round 1 2026-07-25 15:21:26 -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 feat(view): horizontal scroll, text and decorations together 2026-08-07 22:43:17 +02: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(bootstrap): make the ambient storage roots a parameter 2026-07-31 18:48: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 fix(stage2a): close review round 1 — four unreported failures 2026-07-29 21:28:16 -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 docs: absorb the v1.1.0 release, and correct what it made stale 2026-08-01 18:09:59 -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(view): horizontal scroll, text and decorations together 2026-08-07 22:43:17 +02:00
overlay_color.rs M10.10 ship gate 2026-05-13 16:28:46 -04:00
overlay_paint.rs feat(view): wrap-aware coordinates, breaking in and additive out 2026-08-07 13:07:54 +02: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(test): retire R2 and R4 — two readiness predicates weaker than their assertions 2026-08-05 13:41:05 +02: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(protocol): LineWrapFacts at v22, and the GPU stops inheriting a default 2026-08-07 16:54:13 +02: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(view): horizontal scroll, text and decorations together 2026-08-07 22:43:17 +02:00
semantic_client.rs T M4.5: documentSymbol / workspace symbol / documentHighlight 2026-05-18 22:15:03 -04:00
semantic_render.rs feat: ui.line-wrap, resolved once and told to both frontends 2026-08-07 18:02:21 +02: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(panel): close Stage 2A review round 2 (2 P1, 1 P2) 2026-07-26 10:38:21 -04:00
symbol.rs T M4.5: documentSymbol / workspace symbol / documentHighlight 2026-05-18 22:15:03 -04:00
syntax.rs feat(lean4): editing surface + Stage 1 acceptance (Q#LN5, LN6, LN17) 2026-07-25 09:59:48 -04:00
text_view.rs feat(view): horizontal scroll, text and decorations together 2026-08-07 22:43:17 +02: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(view): horizontal scroll, text and decorations together 2026-08-07 22:43:17 +02:00
window.rs feat(view): horizontal scroll, text and decorations together 2026-08-07 22:43:17 +02:00
worker.rs fix(worker): deterministic pool teardown; EditorState::drop signals workers 2026-07-07 15:20:53 -04:00
workers_buffer.rs fix(dired): address PR #165 review round 1 2026-07-25 15:21:26 -04:00