Commit Graph

651 Commits

Author SHA1 Message Date
Levi Neuwirth 3d28a31573 docs: record tab-width implementation lane
Record the proven implementation head, full local gate results, recovery commands, concurrent vterm overlap, and the advanced side-quest backlog.
2026-07-22 15:04:52 -04:00
Levi Neuwirth 9f7bc77f44 feat(render): unify tab-width projection
Share one fixed eight-column tab-stop contract across core and GPU renderers. Consolidate byte-to-display-column accounting, expand GPU code tabs with source provenance, align caret/hit/decoration geometry, and refresh minimap projection on edits.
2026-07-22 15:03:30 -04:00
Levi Neuwirth 50fd9a08e4 fix(vterm): address stage 3 review round 1
Five findings, all addressed. One was a real defect; one prediction did not
reproduce and is documented as such rather than papered over.

Hover no longer claims durable terminal control (finding 2, the real one).
apply_terminal_gesture claimed the controller before dispatching, including
for Move, which does nothing. A semantic frontend reports motion at pixel
rate, so sweeping the mouse across a passive split's terminal took durable
control, and the next layout sync resized the shared PTY to that background
view's geometry — precisely the theft the controller rule exists to prevent.
Bare motion no longer claims; every deliberate gesture still does.
scripts/bite HEAD src/editor.rs on the new test is a clean behavioral bite.

The terminal-mode presence-sweep skip is removed (finding 1), but the
predicted failure did NOT reproduce. The review reasoned that skipping the
sweep freezes last_broadcast at the abandoned document position. It does
not: the buffer-follow clears the terminal declaration when it ships the
snapshot, so terminal_active is false on the tick a window first shows a
terminal, and the declaration cannot arrive until a later tick — the
frontend learns the buffer id from that very snapshot. One truthful sweep
always lands first. The real-daemon two-frontend test written to catch the
freeze passes against the pre-fix tree; the bite is vacuous and the test is
labelled a regression guard, not fix evidence. The skip goes anyway: it was
load-bearing on tick ordering and bought nothing, and removing it makes
"presence follows the frontend" structural.

Terminal motion is deduplicated by cell (finding 3). Sub-cell motion
resolved to the same coordinate and still crossed the wire, where every
event is a daemon-side gesture. Press and release re-arm the memo so the
first drag after a press still reports. Its unit test cannot bite — the
seam did not exist pre-fix — and says so.

Declarations record only once sent (finding 4).
terminal_declaration_if_changed is now a pure query;
note_terminal_declaration_sent records. A failed write is retried instead of
suppressed as already-declared. The existing a35 test caught the contract
change and now pins both halves.

Unchanged frames skip revalidation (finding 5). The complete-payload
comparison runs before validate; only validated frames are ever stored, so a
frame equal to the baseline has already passed. The chrome tail is factored
into terminal_chrome so both exits emit it identically.

Gates: fmt; strict workspace clippy; 1,757 default + 1,933 CRDT library
tests; Stage 1 9/10, Stage 2 4/4, Stage 3 5/7, statusline 7/8
(default/CRDT); M4 120; required GPU 128; workspace sweep 2,921 across 83
suites; diff check clean.
2026-07-22 14:49:23 -04:00
Levi Neuwirth 9f2f0d5ccd docs: incorporate tab-width framing review
Make protocol-version constraints merge-order independent, require wrapped-tab decoration coverage, and explicitly exclude hover panel sizing.
2026-07-22 14:36:30 -04:00
Levi Neuwirth a8f1283581 docs: frame tab-width rendering parity
Define the fixed cross-frontend tab-stop contract, GPU source projection and mapping rules, core display-width consolidation, minimap behavior, and acceptance gates.
2026-07-22 14:25:19 -04:00
Levi Neuwirth 40111dc2b0
Merge pull request #136 from levineuwirth/locals-query-handoff
Record landed locals-query processing
2026-07-22 17:49:41 +00:00
Levi Neuwirth 6ad3b88854 docs: record landed locals-query processing
Mark PR #134 as shipped in the durable handoff, framing, and side-quest
backlog. Remove the completed volatile lane and advance the canonical recovery
anchor to the merge commit.
2026-07-22 13:30:07 -04:00
Levi Neuwirth 1d0b46f023 docs(vterm): record the stage 3 pull request 2026-07-22 13:29:29 -04:00
Levi Neuwirth bdf2b6e4b4 feat(vterm): protocol v19 terminal frames and a native GPU terminal
Vterm Stage 3 — the final vterm stage. A semantic frontend can now host a
terminal: the daemon ships complete validated cell grids, and pmacs-gpu
renders them with fixed-cell geometry, its own input path, and no document
projection at all.

Protocol v19 appends three variants after their enums' final v18 members:
InstanceMessage::TerminalFrame (daemon-gated), and FrontendEvent::
TerminalResize / TerminalPointer (frontend-gated). It is the first bump to
gate in both directions, so criterion 28 pins each filter independently and
byte pins on StatuslineSegments and MenuPointer guard the placements.

pmacs-protocol gains src/terminal.rs: the shared row/column/visible-cell/
grapheme/metadata bounds, TerminalProcessState, TerminalSelectionSpan, and
TerminalFrame::validate — the ONE structural policy the daemon runs before
emission and the frontend runs after decode. src/terminal/* re-exports them
so no duplicate type exists, and unicode-width becomes a workspace dependency
so the screen and the validator measure glyph columns with one table. A new
8 MiB aggregate glyph bound keeps the largest legal frame (measured:
13,437,863 bytes) under the unchanged 16 MiB transport cap rather than
widening every connection's allocation ceiling.

The semantic producer suppresses the whole document family for a terminal
buffer while keeping the status band, theme, font, statusline, menu, and
minibuffer, and compares the complete ordered payload rather than
screen_generation — scroll, selection, and process state all change without
advancing it.

Two things the framing did not spell out, both found by the real-daemon
acceptance:

The Viewport gate keys on the authenticated source's ACTIVE buffer, not the
buffer the message names. Viewport also aligns the window to what it
declares, so a stale document viewport in flight when a command opened a
terminal dragged the frontend straight back off it: the window oscillated,
every terminal declaration was refused, and no frame ever arrived, with
nothing logged anywhere.

The producer clears terminal mode on every exit path. The daemon uses that
flag to suppress CursorByte and the presence sweep, so an early return that
left it set kept both suppressed after the frontend returned to a document.

pmacs-gpu/src/terminal.rs is a pure cell-space paint planner, unit-testable
without a GPU. The renderer builds one shaped buffer per text run, so a wide
or cluster glyph's advance can never choose the next column's origin.

Criterion 37 needed a seam rather than a fixture: pmacs-gpu depends only on
pmacs-protocol, so attach::connect's reader sink was generalized and a
--headless-probe mode added. The acceptance drives a real daemon, a real
/bin/sh child, the real attach client, and real composited pixels in one
path — which is how both defects above were found.

Gates: fmt; strict workspace clippy; 1,757 default + 1,933 CRDT library
tests; vterm Stage 1 9/10, Stage 2 4/4, Stage 3 4/5 acceptance
(default/CRDT); statusline 7/8; M4 120; required GPU 127; workspace sweep
2,919 across 83 suites; diff check clean.
2026-07-22 13:28:35 -04:00
Levi Neuwirth 8cbb9f4377
Merge pull request #134 from levineuwirth/locals-query-processing
Process Tree-sitter locals queries
2026-07-22 17:24:49 +00:00
Levi Neuwirth e5db4a98f8 test: enforce locals-query coverage
Assert that every bundled local-sensitive highlight query has a non-empty,
compilable locals query. Clarify the upstream-parity worst-case complexity of
lexical reference resolution in the framing document.
2026-07-22 13:05:33 -04:00
Levi Neuwirth 08ea6a3e12 docs: record locals-query pull request
Link PR #134 from the durable handoff and active-work lane now that the
implementation is published for review.
2026-07-22 12:31:18 -04:00
Levi Neuwirth cdeb5fb7cd docs: record locals-query implementation lane
Replace the obsolete fail-closed locals note with the settled lexical-facts
contract and record the feature branch, verification, and recovery commands in
the active-work ledger.
2026-07-22 12:29:39 -04:00
Levi Neuwirth 47ffe5dcff syntax: process bundled locals queries
Compile grammar locals metadata, resolve lexical definitions and references
once per settled layer, and apply local property predicates in both highlight
producers. Restore non-shadowed JavaScript builtins while suppressing local
shadows, with lexical, viewport, render, and edit-freshness regressions.
2026-07-22 12:28:31 -04:00
Levi Neuwirth 42a28b90c7 docs: frame locals-query processing
Define grammar locals metadata, lexical resolution semantics, shared local
predicate filtering, settle-time caching, producer coverage, and acceptance
criteria for shadowed versus non-shadowed builtins.
2026-07-22 12:03:37 -04:00
Levi Neuwirth 8bd82981f5
Merge pull request #133 from levineuwirth/modeline-handoff
Record landed modeline detection
2026-07-22 15:47:15 +00:00
Levi Neuwirth 3adac8c4cb 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.
2026-07-22 11:46:45 -04:00
Levi Neuwirth 9b8b312848 docs: record landed modeline detection
Advance the durable baseline to PR #132, remove the completed volatile lane,
and record the shared language pin, bounded modeline contract, Vterm Stage 2
landing, remaining deferrals, and current roadmap state.
2026-07-22 11:30:45 -04:00
Levi Neuwirth 1dd47fcad1
Merge pull request #132 from levineuwirth/modeline-detection
Detect language from modelines
2026-07-22 15:24:25 +00:00
Levi Neuwirth b45e5ee5ec Merge canonical main into modeline detection
Integrate landed Vterm Stage 2 before the approved modeline merge. Preserve the
active modeline lane in the volatile ledger and record the full integrated gate
results.
2026-07-22 10:56:35 -04:00
Levi Neuwirth 86fc1bccae
Merge pull request #130 from levineuwirth/vterm-tui
feat(vterm): compose terminal views in the TUI
2026-07-22 14:48:04 +00:00
Levi Neuwirth 506912a069 docs(vterm): record current-main integration gates
Record the resolved mode-system integration head, exact post-integration
verification, and isolated M4 timeout reruns before the authorized merge.
2026-07-22 10:29:54 -04:00
Levi Neuwirth 3f0252fb97 Merge canonical main into vterm-tui
Integrate mode-system wiring and handoff updates before PR #130 lands.
Preserve per-frontend terminal dispatch while resolving major-mode keymaps,
and expose mode, terminal, and LSP statusline providers together.
2026-07-22 10:28:56 -04:00
Levi Neuwirth 88a371efdb docs: checkpoint modeline implementation
Record the implementation head, completed acceptance contract, full gate
results, and pull-request handoff for modeline detection.
2026-07-22 10:02:54 -04:00
Levi Neuwirth f8d05d2134 feat: detect language from modelines
Parse bounded Emacs and Vim modelines, normalize common aliases, and give
explicit file metadata precedence over inferred language. Pin one fresh-load
language decision for syntax, LSP, pairing, comments, and initial major mode,
while preserving the LSP path guard and explicit mode overrides.

Cover supported forms, rejection boundaries, precedence, unknown modes,
shebang and modeline pinning, reopen behavior, and pathless buffers.
2026-07-22 10:02:20 -04:00
Levi Neuwirth d5e59a9dcf docs: approve modeline detection framing
Record user approval of Revision 2 and mark implementation active in the
isolated modeline lane.
2026-07-22 09:44:35 -04:00
Levi Neuwirth f521413bce docs: checkpoint revised modeline framing
Record the review-complete Revision 2 framing head and approval boundary in
the active-work ledger.
2026-07-22 09:41:25 -04:00
Levi Neuwirth 6b4f3c3b38 docs: correct Vim modeline framing
Match Vim's real direct and set-form tokenization, reject nonexistent colon
assignments, clarify suffix scanning and trust, extend aliases, and pin the
shebang-edit regression in acceptance.
2026-07-22 09:41:06 -04:00
Levi Neuwirth 49efa805b5 docs(vterm): record PR 130 review round 2
Update the durable handoff and active-work ledger with the second-review
fix checkpoint and exact final gate evidence.

Co-authored-by: OpenAI Codex <codex@openai.com>
2026-07-22 09:10:30 -04:00
Levi Neuwirth b9a7e40855 fix(vterm): harden view anchors and interactive authority
Clamp anchors into partially evicted wrapped lines, require authenticated
interactive origins, and avoid per-mouse cell snapshots. Restore dispatcher
rationale, named context errors, and focused regressions for the corrected
contracts.

Co-authored-by: OpenAI Codex <codex@openai.com>
2026-07-22 09:09:44 -04:00
Levi Neuwirth 5a39ac4a9c docs: record modeline framing lane
Advance the canonical base after the mode-system handoff merge and preserve
the draft modeline framing branch, checkpoint, scope, and recovery command.
2026-07-22 09:05:49 -04:00
Levi Neuwirth 47a7f4cefd docs: frame modeline language detection
Define bounded Emacs and Vim modeline parsing, alias normalization,
explicit precedence, one pinned language decision shared by syntax and LSP,
and the acceptance contract for load-time mode detection.
2026-07-22 09:05:02 -04:00
Levi Neuwirth d5d9b9c1ca
Merge pull request #131 from levineuwirth/mode-system-handoff
Record landed mode system
2026-07-22 12:50:12 +00:00
Levi Neuwirth aafa47514c docs: record landed mode system
Move mode-system wiring from the active ledger into the durable handoff,
refresh the side-quest priorities, and preserve the macOS acceptance lessons
from the final CI review round.
2026-07-22 08:40:35 -04:00
Levi Neuwirth b4b925df49
Merge pull request #129 from levineuwirth/mode-system-wiring
Wire major modes through key dispatch
2026-07-22 12:38:16 +00:00
Levi Neuwirth 2e332b579c docs(vterm): record PR 130 review round 1
Align the durable handoff with the approved escape-prefix contract, record the performance and lifecycle hardening, update the Stage 2 verification map, and publish exact final gate evidence in the active-work ledger.
2026-07-22 08:29:33 -04:00
Levi Neuwirth 1b4d022fd1 test: preserve mode segments with long paths
Widen the daemon acceptance grid so each split can show a macOS temporary
path and the following mode segment without protected-right clipping.
2026-07-22 08:28:57 -04:00
Levi Neuwirth 8702791de9 fix(vterm): honor terminal escape and view contracts
Require the fixed C-c escape before editor-local terminal bindings, reject context-implicit Lua operations from document windows, and make controller replacement atomic per frontend. Borrow screen rows during view projection instead of deep-cloning retained history, preserve view anchors through zero-area layouts, and remove redundant detach paths.

Add focused child-input coverage for unescaped bound keys and C-c C-c, plus controller, zero-area, context-error, and clone-free projection assertions.

Co-authored-by: OpenAI Codex <codex@openai.com>
2026-07-22 08:28:18 -04:00
Levi Neuwirth 4c382ae797 fix: harden mode acceptance startup
Give the daemon its normal five-second handshake window before switching
the mode-system acceptance client to short frame polling. Document reload
and session-persistence boundaries and correct stale describe-key guidance.
2026-07-22 08:18:18 -04:00
Levi Neuwirth 6725e9a598 docs(active-work): record Vterm Stage 2 PR
Record the published branch checkpoint and PR #130 as the active review lane. Preserve the explicit no-merge-without-authorization boundary.
2026-07-21 21:40:48 -04:00
Levi Neuwirth d2fca0c3ad docs(active-work): record gated Vterm Stage 2 lane
Replace the obsolete framing-only recovery entry with the integrated branch head, exact verification evidence, and portable worktree command.
2026-07-21 21:39:17 -04:00
Levi Neuwirth da8f6aeae4 fix(vterm): harden integrated Stage 2 behavior
Resolve post-main integration drift in authenticated routing, terminal view projection, Lua installation, and inherited acceptance callers. Preserve the terminal statusline provider alongside the landed Themes provider and record the final Stage 2 gate evidence.

Co-authored-by: OpenAI Codex <codex@openai.com>
2026-07-21 21:38:08 -04:00
Levi Neuwirth 692c3c5fdc docs: record mode system review lane
Record the portable branch, pull request, implementation checkpoint,
verification, and cross-machine recovery command for mode-system wiring.
2026-07-21 20:27:03 -04:00
Levi Neuwirth 99cd7ec240 feat: wire major modes through key dispatch
Store a detected major mode on each buffer and expose it through Lua.
Resolve mode-scoped bindings in dispatch, describe-key, and help links,
including exact encoded mode context after entering the help buffer.

Initialize modes once at buffer load, preserve explicit overrides and
clears across switches, and publish the mode through a per-window
statusline provider. Add daemon acceptance for the complete mode lifecycle.
2026-07-21 20:25:48 -04:00
Levi Neuwirth 0ddff24589 Merge canonical main into vterm-tui
Integrate config-registry and handoff updates landed after the Stage 2
framing branch was cut.
2026-07-21 20:18:53 -04:00
Levi Neuwirth dc9225778a test(vterm): prove Stage 2 TUI integration
Add cross-surface Lua, shared-view, clipboard, authenticated routing,
BEL, resize, and real-host PTY acceptance. Ensure terminal-local keymaps
run before raw child transport and document the criterion-to-test map.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-21 20:16:23 -04:00
Levi Neuwirth a548850423 docs: require truthful authorship attribution
Remove the standing instruction to claim Claude co-authorship and clarify
that commit trailers and PR attribution must reflect actual contributions.
2026-07-21 19:49:05 -04:00
Levi Neuwirth 424f82be5f docs: frame mode system wiring
Record approved decisions and acceptance criteria for major-mode storage,
dispatch, introspection, initialization, and statusline integration.
2026-07-21 19:49:05 -04:00
Levi Neuwirth f1a2f755a5
Merge pull request #128 from levineuwirth/handoff-2026-07-20
docs: refresh cross-machine continuity
2026-07-21 23:25:44 +00:00
Levi Neuwirth 0dacac7e8d feat(vterm): compose terminal views in the TUI
Render exact per-frontend terminal snapshots inside split-window content rects,
route terminal key, paste, focus, and mouse input through durable controllers,
and preserve logical row anchors across reflow, selection, and scrollback.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-21 19:21:50 -04:00