From 3adac8c4cb977371a85422587ffffd13a478650c Mon Sep 17 00:00:00 2001 From: Levi Neuwirth Date: Wed, 22 Jul 2026 11:46:45 -0400 Subject: [PATCH 1/7] docs(vterm): carry approved stage 3 framing onto the implementation branch Revision 8 of docs/vterm-framing.md was reviewed and approved on the documentation branch vterm-stage3-framing. Stage 3 is implemented on this branch, cut from canonical main, rather than stacked on that branch. The framing locks additive protocol v19 (TerminalFrame, TerminalResize, TerminalPointer), an 8 MiB aggregate glyph-byte bound under the unchanged 16 MiB transport cap, dual viewport declaration after every semantic snapshot, authenticated per-view routing, and a fixed-cell native GPU renderer. Criteria 28-37 are the scope of this branch. --- docs/active-work.md | 62 ++--- docs/agent-handoff.md | 59 ++-- docs/roadmap-2026-07.md | 17 +- docs/vterm-framing.md | 596 ++++++++++++++++++++++++++++++---------- 4 files changed, 526 insertions(+), 208 deletions(-) diff --git a/docs/active-work.md b/docs/active-work.md index 49e000f..0d9ce3d 100644 --- a/docs/active-work.md +++ b/docs/active-work.md @@ -14,7 +14,8 @@ backlog. machine-local: `origin` may name this canonical URL, a release mirror, or something else, and therefore has no authority by name alone. - Canonical base at this snapshot: - `githubsucks/main` @ `86fc1bc` (Vterm Stage 2 #130 merged; protocol v18). + `githubsucks/main` @ `1dd47fc` (modeline detection #132 merged atop Vterm + Stage 2 #130; protocol v18). - On the transfer source, `origin/main` named a release mirror at `d3fa632` and lagged badly. On the current destination, `origin` names the canonical URL. This difference is why all recovery begins by @@ -48,44 +49,43 @@ git worktree list git status --short --branch ``` -The first command must expose `86fc1bc` or a newer intentional main. +The first command must expose `1dd47fc` or a newer intentional main. If it does not, stop and repair the remote/fetch configuration. -## Modeline detection implementation lane +## Vterm Stage 3 framing lane -- Portable branch: `githubsucks/modeline-detection` -- Approved framing head: `6b4f3c3` -- Implementation head: `f8d05d2` -- Base: originally canonical `main` @ `d5d9b9c`; current canonical `main` - @ `86fc1bc` (Vterm Stage 2 #130) is integrated before merge. -- PR: #132, , open against - canonical `main` and explicitly authorized for merge. -- State: Revision 2's bounded Emacs/Vim parser, explicit-over-inferred - precedence, alias normalization, shared fresh-load language pin, LSP path - guard, and all thirteen acceptance criteria are implemented. Protocol - remains v18. -- Verification: - - focused modeline + shebang-pin acceptance before integration: 7 passed on - default LuaJIT and 7 passed on non-default Lua 5.4; - - post-integration `cargo fmt --check`; - - post-integration `cargo clippy --workspace --all-targets -- -D warnings`; - - post-integration `cargo test --lib`: 1,753 passed; - - post-integration `cargo test --lib --features crdt`: 1,929 passed; - - post-integration `cargo test --test m4_acceptance -- --skip basedpyright`: - 120 passed, 3 ignored, 1 filtered; - - post-integration `PMACS_REQUIRE_GPU=1 cargo test -p pmacs-gpu`: 109 passed; - - post-integration `cargo test --workspace -- --skip basedpyright`: 2,888 - passed across 82 suites, 19 ignored, 1 filtered; - - `git diff --check`. -- Next: push the current-main integration and merge PR #132 as authorized. +- Portable branch: `githubsucks/vterm-stage3-framing` +- Framing contract commit: `d7bb831`; Revision 8 review fixes: `c72dfea`; + both follow canonical-main integration. +- Base: canonical `main` @ `1dd47fc` (modeline detection #132 atop Vterm + Stage 2 #130), protocol v18. +- PR: none. This is framing only; no Stage 3 implementation branch exists. +- State: `docs/vterm-framing.md` Revision 8 maps criteria 28–37, has passed + one external review, and awaits explicit user approval. It locks additive + protocol v19 `TerminalFrame`, `TerminalResize`, and `TerminalPointer`; an + 8 MiB aggregate glyph-byte bound under the unchanged 16 MiB transport cap; + dual viewport declaration for the first terminal frame; authenticated + per-view semantic routing; and a fixed-cell native GPU renderer/input/cache + contract. +- Stage 2 is landed as PR #130 at merge `86fc1bc`. Stage 3 starts from that + integrated substrate and does not reopen its TUI/Lua/controller contracts. +- Review: no architectural defect. `c72dfea` makes the measured-size fixture + maximize style and cluster-prefix overhead, names the GPU clipboard signal + path without implying child OSC 52 support, and aligns Arc 5/internal-stage + naming. +- Verification: documentation-only `git diff --check`; framing consistency + search. No runtime gates apply before implementation. +- Next: explicit user approval. After approval, create `vterm-gpu` from the + then-current canonical main and implement criteria 28–37; do not stack the + feature on this documentation branch. Recovery worktree on a machine that does not already own the branch: ```sh git worktree add --track \ - -b modeline-detection \ - ../pmacs-modeline-detection \ - githubsucks/modeline-detection + -b vterm-stage3-framing \ + ../pmacs-vterm-stage3-framing \ + githubsucks/vterm-stage3-framing ``` ## Parked lane: kill-ring browser + persistence diff --git a/docs/agent-handoff.md b/docs/agent-handoff.md index ef07948..52e6e9a 100644 --- a/docs/agent-handoff.md +++ b/docs/agent-handoff.md @@ -1,10 +1,10 @@ # Agent handoff — cross-machine continuity -**Last updated: 2026-07-22, after Vterm Stage 2 PR #130 review round 2 -was addressed and approved for merge; mode system wiring (#129) and its -handoff (#131), config registry (#127), Vterm Stage 1 terminal core (#126), -and completed Themes Arc 4 (#120/#124/#125) are landed on `main`. Vterm -Stage 3 is not implemented.** +**Last updated: 2026-07-22, after Vterm Stage 2 landed as PR #130 and +modeline detection landed as #132. Mode system wiring (#129), config registry +(#127), Vterm Stage 1 terminal core (#126), and completed Themes Arc 4 +(#120/#124/#125) are also on `main`. Vterm Stage 3 framing Revision 8 has +passed one external review and is not implemented.** This file is the bridge between development machines. If you are an agent reading this on a fresh clone: this document plus the `docs/*-framing.md` @@ -18,9 +18,9 @@ commands, read `docs/active-work.md` immediately after this file. ## 1. Where the project stands (2026-07-22) -- `main` @ `d5d9b9c` (mode system handoff #131), protocol **v18** - (`SUPPORTED=[6..18]`; v16 = `ThemeFacts`, v17 = `FontFacts`, v18 = - `StatuslineSegments`). +- `main` @ `1dd47fc` (modeline detection #132 atop Vterm Stage 2 #130), + protocol **v18** (`SUPPORTED=[6..18]`; v16 = `ThemeFacts`, v17 = + `FontFacts`, v18 = `StatuslineSegments`). - **Config registry LANDED — #127** (`docs/config-registry-framing.md` rev 3; merge `2e37c04`; two review rounds). `pmacs.config` is the typed, introspectable options registry the backlog ranked first, and @@ -246,10 +246,11 @@ commands, read `docs/active-work.md` immediately after this file. behavioral bite; the original `main`/crate-root bite remains explicitly weaker compile-time API evidence. - Stage 3 owns `pmacs-gpu/src/attach.rs`, authenticated source routing, - protocol-owned wire types/limits, and a deliberate complete-frame limit - decision: 16 MiB is insufficient; use a measured legal-worst cap or - aggregate bound, never silent chunking. - - **Stage 2 TUI is implemented on `vterm-tui`** (`docs/vterm-framing.md` + protocol-owned wire types/limits, and complete-frame semantic projection. + Revision 8 chooses a shared 8 MiB aggregate glyph-byte bound whose measured + legal maximum stays below the unchanged 16 MiB transport cap; over-bound + snapshots are rejected, never truncated or silently chunked. + - **Stage 2 TUI LANDED ON `main` — #130** (`docs/vterm-framing.md` Revision 7, criteria 15–27). `TerminalViewKey` keys per-frontend/window projection state over one shared process/screen; logical row anchors retain scroll/selection through reflow. One authenticated frontend controls at @@ -286,16 +287,26 @@ commands, read `docs/active-work.md` immediately after this file. removes owned cell snapshots from terminal mouse routing. The framing now records the transient v18 semantic-controller boundary and bracketed-paste injection deferral. - - Current-main integration (`3f0252f`) preserves per-frontend terminal - dispatch while applying the landed mode-scoped keymap, and exposes the - `mode`, `terminal`, and `lsp` statusline providers together. - - Post-integration gate: `cargo fmt --check`; strict workspace Clippy; + - Current-main integration (`3f0252f`) preserved per-frontend terminal + dispatch while applying the landed mode-scoped keymap, and exposed the + `mode`, `terminal`, and `lsp` statusline providers together. PR #130 merged + at `86fc1bc`. + - Final integrated gate: `cargo fmt --check`; strict workspace Clippy; 1,753 default + 1,929 CRDT library tests (3 ignored each); mode-system acceptance 1 default + 1 CRDT; Stage 1 acceptance 9 default + 10 CRDT; Stage 2 acceptance 4 default + 4 CRDT; statusline acceptance 7 default + 8 CRDT; M4 114 passed (3 ignored, 1 filtered); required GPU 109; workspace 2,882 passed across 82 suites (19 ignored, 1 filtered); `git diff --check` clean. + - **Stage 3 framing is Revision 8 on `vterm-stage3-framing`**: additive + protocol v19 complete frames/events, dual viewport bootstrap, common + validation/aggregate limits, authenticated semantic view adapters, and + fixed-cell GPU rendering/input/cache behavior. Criteria 28–37 are mapped. + First review found no architectural defect; `c72dfea` pins maximal style + and cluster-prefix overhead in the measured frame fixture, corrects the + GPU clipboard criterion, and distinguishes Arc 5 stage 2 from its internal + Stages 1–3. No implementation branch or PR exists pending explicit user + approval. - **PARKED: kill-ring browser + persistence.** Revision 2 framing is preserved on branch `kill-ring-browser`, but its `0efb5cd` scout is stale and must be repeated before implementation. No PR or implementation is @@ -312,8 +323,9 @@ commands, read `docs/active-work.md` immediately after this file. fix (#101). - **Arc 4 (themes + extensibility) COMPLETE** — named UI faces (#120), live GPU font preferences (#124), statusline providers (#125). - - **Arc 5 terminal stage ACTIVE** — compile mode (#113) and Vterm terminal - core (#126) landed; Vterm TUI is the next formal stage. + - **Arc 5 terminal stage ACTIVE** — compile mode (#113), Vterm terminal + core (#126), and Vterm TUI (#130) landed; protocol/GPU Stage 3 is framed + and awaiting approval. - **Config registry COMPLETE (#127)** — not a numbered arc; it was the cross-cutting substrate ranked first on `docs/side-quest-backlog.md`'s north star, and it unblocks the @@ -551,8 +563,12 @@ currently accepted for `autosave.interval-ms`, where a per-buffer value is meaningless. **Tab width is NOT a config gap** — see §5. Mode system (SHIPPED #129): minor modes, `buffer.after-mode-change`, -mode-scoped settings, modeline detection, `describe-mode`, and persistence of -explicit major-mode overrides/clears across sessions. +mode-scoped settings, `describe-mode`, and persistence of explicit major-mode +overrides/clears across sessions. +Modeline detection (SHIPPED #132): bounded first/last-line Emacs `-*-` +and Vim `ft=`/`filetype=` parsing, explicit-over-inferred precedence, +alias normalization, and shared fresh-load language pinning for +syntax/highlight/LSP startup. Highlight/detection (from the #114–#118 side-quest + injections #122): locals-query processing (run each grammar's LOCALS_QUERY so `#is?`/`#is-not? local` is honored instead of the current fail-closed @@ -564,8 +580,7 @@ comment schemes), child-tree incrementality + range-scoped layer rebuild runtime/Lua-registered languages (v1 resolves only against `BUILTIN_LANGUAGES`), and the next injection *consumers* gated on new grammars — HTML/CSS/GraphQL/SQL (`