M4.1: Git backend through the installed git
New crate lutra-vcs (L3): a safe git runner (argument arrays, no prompts, GIT_OPTIONAL_LOCKS=0 for reads, timeouts 30 s / 120 s for hooks, output caps, one spawn function for H1's kill-on-close helper), porcelain v2 / -z parsers (property-tested), Repo operations (status, stage, unstage before the first commit, commit and amend, show at HEAD/index, branches, checkout with remote tracking, branch creation checked by check-ref-format) and a .git poll (RepoWatch). Engine: git.status, git.stage, git.unstage, git.commit, git.show, git.branches, git.checkout, git.createBranch on pending outcomes, off the engine lock; gitChanged after changes and debounced 300 ms on .git or project changes; setting git.executable (section Git). Tests against real temp repositories, engine tests through run_waiting, docs (architecture, gaps G8, Git parity row, roadmap M4 row). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
cd8c34b094
commit
13e7b0aa12
28 changed files with 3485 additions and 9 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Architecture
|
||||
|
||||
> **Status:** M0 decisions recorded, M1 workspace, desktop bridge, tabs and editor, message catalog, engine construction, settings, themes, the recovery journal, notifications, UI commands, the palette, the settings dialog, the app icon and the syntax layer documented; M2 highlighting and `editor.reveal`, plus the search backend, the Find tool window, the symbol index, the Structure tool window and the go-to popup; M3 CLI and single instance, LSP client library, toolchain (PHP detection, Phpactor download), the app menu, MCP server, autosave and `flushDirty`, integrated terminal; engine ↔ Phpactor wiring and diagnostics (M3.3), pending outcomes (M3.5), completion, hover and signature help (M3.4); C5 child process groups (H1), settings dialog string and path controls and assist settings (H4), the banner-aligned themes and diagnostic/VCS tokens (H5) · **Last updated:** 2026-10-25
|
||||
> **Status:** M0 decisions recorded, M1 workspace, desktop bridge, tabs and editor, message catalog, engine construction, settings, themes, the recovery journal, notifications, UI commands, the palette, the settings dialog, the app icon and the syntax layer documented; M2 highlighting and `editor.reveal`, plus the search backend, the Find tool window, the symbol index, the Structure tool window and the go-to popup; M3 CLI and single instance, LSP client library, toolchain (PHP detection, Phpactor download), the app menu, MCP server, autosave and `flushDirty`, integrated terminal; engine ↔ Phpactor wiring and diagnostics (M3.3), pending outcomes (M3.5), completion, hover and signature help (M3.4); C5 child process groups (H1), settings dialog string and path controls and assist settings (H4), the banner-aligned themes and diagnostic/VCS tokens (H5); Git backend (M4.1) · **Last updated:** 2026-10-25
|
||||
|
||||
## Overview
|
||||
|
||||
|
|
@ -13,6 +13,7 @@ crates/mcp (L5) MCP server over stdio (the CLI supplies the connection
|
|||
crates/engine (L4) command registry, workspace state, guard, recovery journal, theme tokens
|
||||
crates/lsp (L3) LSP client (Phpactor first), later DAP client
|
||||
crates/terminal (L3) pseudo-terminal sessions (portable-pty)
|
||||
crates/vcs (L3) Git through the installed git command
|
||||
crates/index (L2) symbol index, usages, later type inference
|
||||
crates/vfs (L2) project model, file watching, ignore rules, encodings
|
||||
crates/search (L2) find in files (ignore + grep-searcher crates)
|
||||
|
|
@ -544,6 +545,34 @@ Watched directories: the VFS watcher is non-recursive, so `project.children` wat
|
|||
- **Errors:** one error toast per failed file, `notification.save.failed {name, reason}`; a failure of `file.saveAll` itself becomes `notification.command.failed`. Autosave shows the same failure of the same file only once until it saves again; `flushDirty()` called by a feature shows it every time. Skipped conflicts raise no toast: the tab already shows the changed-on-disk notice.
|
||||
- **Safety net:** the recovery journal is unchanged; it covers everything between saves.
|
||||
|
||||
### Git backend (M4.1)
|
||||
|
||||
- **Owner decision D20:** Git runs through the user's installed `git` (minimum 2.30), found through the setting `git.executable` (string, section `git`; `""` means `git` from `PATH`). No network operation exists (no fetch, pull, push), and no call can open a credential or terminal prompt.
|
||||
- **Crate `lutra-vcs` (L3, `crates/vcs`):**
|
||||
- `runner::run` is the only way git starts, and `runner::spawn` the only place a process starts, through H1's `lutra_proc::spawn`, so git and its hooks die with Lutra. Arguments are an array, never a shell. Every call gets `--no-pager --literal-pathspecs -c core.quotepath=false -c color.ui=false`, `GIT_TERMINAL_PROMPT=0`, `GCM_INTERACTIVE=never`, `GIT_OPTIONAL_LOCKS=0` for reads, no console window on Windows, and the variables that redirect git (`GIT_DIR`, `GIT_WORK_TREE`, `GIT_INDEX_FILE`, …) removed.
|
||||
- Timeouts: 30 s; commit, checkout and branch creation 120 s (hooks). A call past its timeout, or whose stdout passes its cap, is killed (a guard kills and reaps the child on every early return).
|
||||
- Caps: status 64 MiB, one file 32 MiB, other reads 16 MiB, stderr 16 KiB (the error text, also a failing hook's output; stdout is used when stderr is empty).
|
||||
- Output is read only from machine formats: `status --porcelain=v2 -z --branch`, `cat-file --batch-check`, `for-each-ref` with NUL-separated fields, `show -s --format=%H%x00%s`. The parsers are property-tested with random bytes. Paths git prints that are not UTF-8 (Unix only) become U+FFFD instead of failing the status.
|
||||
- `Git::detect(setting)` runs `git --version`; `Git::open(dir)` runs `rev-parse --show-toplevel --absolute-git-dir --git-common-dir --show-prefix` and gives `None` outside a work tree (the repository containing the project root; a nested repository wins). Paths in and out of `Repo` are project-relative with `/`; the prefix maps them to the repository root, and files outside the project are left out of the status. Input paths are refused when empty, absolute, with `..`, NUL or line breaks; they go to git through `--pathspec-from-file=- --pathspec-file-nul`, so any count and any name works.
|
||||
- Operations: `status` (untracked files one by one, ignored files not listed), `head` (branch information only, `--untracked-files=no`), `stage` (`add -A`), `unstage` (`reset -q HEAD`, or `rm --cached` before the first commit), `commit` (`-F -` from stdin, `--cleanup=whitespace` so lines starting with `#` stay), `show` (the blob as stored: no smudge filters, no line-ending conversion, so LFS stays a pointer and nothing reaches the network; binary when a NUL is in the first 8000 bytes, the text is not UTF-8, or the entry is a submodule; a UTF-8 BOM is dropped), `branches`, `checkout` (local branch: `switch`; remote branch `origin/x`: `switch --track`, a local tracking branch), `create_branch` (name checked with `check-ref-format --branch`, which must echo the name unchanged, so `@{-1}` is refused; `switch -c` or `branch --end-of-options`). Names and revisions starting with `-` are refused. Changes hold a per-repository mutex.
|
||||
- `RepoWatch` polls `HEAD`, `index`, `MERGE_HEAD`, `ORIG_HEAD`, `packed-refs` and the files under `refs/heads` and `refs/remotes` (at most 4,096) every 250 ms on its own thread, comparing size and modification time. The project watcher never sees `.git`, and OS notifications on a directory whose object store churns on every commit would be noisier than a few `stat` calls. `rebase()` takes the current state as the baseline after Lutra's own change.
|
||||
- **Engine (`crates/engine/src/cmd/git.rs`):** every `git.*` command returns a pending outcome (M3.5). Under the lock it parses its params and takes the setting, the cached git and the cached repository; a `lutra-git` thread detects git and opens the repository when they are not cached, runs the call and fills a reply slot (the `Pending` channel only signals). The finish caches git (per setting value) and the repository (per project root), starts the watch, and emits `gitChanged` after a change. At most 32 calls run at once. Hosts and the UI call these commands with `run_waiting` / `runWaiting`.
|
||||
- **Commands** (all need a project):
|
||||
- `git.status` → `{available, error?, repo: {root, branch?, detached, head?, upstream?, ahead?, behind?} | null, files: [{path, origPath?, index, worktree}]}`. Without a usable git: `available: false` and the reason. Outside a repository: `repo: null, files: []` (and `error` if git refused, such as an unsafe owner). `root` is the work tree root as git prints it (absolute, `/`).
|
||||
- `git.stage {paths}` / `git.unstage {paths}` → `{}`; for a staged rename pass both paths.
|
||||
- `git.commit {message, amend?}` → `{commit, summary}`; a blank message is `invalid_params`.
|
||||
- `git.show {path, ref: "HEAD"|"index"}` → `{text|null, binary, tooLarge}`.
|
||||
- `git.branches` → `{current|null, local: [{name, head, upstream?}], remote: [{name, head}]}` sorted by name, without `origin/HEAD`.
|
||||
- `git.checkout {branch}` → `{}`; git's refusal is the error text. Open buffers follow through the file watcher.
|
||||
- `git.createBranch {name, from?, checkout}` → `{}`.
|
||||
- Bad paths, names or messages are `invalid_params`; everything git refuses is `failed` with git's message; no project is `disabled`.
|
||||
- **Event `gitChanged {available, repo, filesChanged: true}`:** after every successful change (in the same outcome), and 300 ms after the last change the `.git` watch or the project watcher reported (at most 2 s after the first), from a `head()` query on its own thread. The UI re-queries `git.status`.
|
||||
- **Measured** (debug build, Windows 11, git 2.47.1, over the control channel on port 7941, so each number includes the round trip and the pending wait):
|
||||
- A temp repository: the first `git.status` 367 ms (it detects git and opens the repository), then 80–96 ms; `git.stage` 171 ms, `git.show` 153 ms, `git.commit` 279 ms, `git.createBranch` 244 ms, `git.branches` 73 ms, `git.checkout` 247–257 ms. A blank message is refused at once (`invalid_params`).
|
||||
- The Lutra repository (336 tracked files): first `git.status` 208 ms, then 102–111 ms.
|
||||
- A generated repository with 20,000 committed PHP files, 5 modified and 1 untracked: first `git.status` 1.5 s (cold file cache), then 90–98 ms.
|
||||
- **Tests:** `crates/vcs/tests/repo.rs` (13 tests against real temp repositories: initial repository without HEAD, stage/unstage/commit, amend, modified/deleted/renamed, CRLF with `core.autocrlf`, Unicode and space paths, literal pathspecs and a non-UTF-8 name on Unix, detached HEAD, branches, remote tracking checkout from a clone, a refused checkout, a file over the cap, binary, BOM and Latin-1 files, a failing pre-commit hook, nothing staged, a project inside a repository, the watch); unit and property tests of the parsers; `crates/engine/tests/git.rs` (4 tests through `run_waiting`: the command shapes, `gitChanged` after changes and from outside changes, no repository, a missing git, no project). Tests skip with a message when git is not installed.
|
||||
|
||||
## Decisions (M0)
|
||||
|
||||
| Question | Decision | Why |
|
||||
|
|
@ -561,6 +590,7 @@ Watched directories: the VFS watcher is non-recursive, so `project.children` wat
|
|||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-10-25 | minor | M4.1: Git backend (`lutra-vcs`, `git.*` commands, `gitChanged`, `git.executable`) |
|
||||
| 2026-10-24 | minor | H4: string and path controls in the settings dialog (`pick_file` IPC), assist settings (auto popup, completion delay, hover delay) read live |
|
||||
| 2026-10-25 | minor | H5: banner-aligned light and dark palettes, `DIAGNOSTIC_TOKENS` and `VCS_TOKENS`, completion icon colours by kind, contrast test extended |
|
||||
| 2026-10-25 | minor | H6: isolated data directory (`--data-dir`, `LUTRA_DATA_DIR`, `--control` temp dir), shared tools dir, rendezvous order |
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Gaps
|
||||
|
||||
> **Status:** M0 closed G1; G2 under way (text buffer, engine buffers, tabs and editor in the app, recovery journal, autosave); G3 M1 part done (project tree, palette, settings dialog with string and path controls, themes) plus the app menu (M3.9); G4 under way (tree-sitter outline and folding library, Lezer highlighting, Structure tool window); G5 under way (search backend, Find tool window, symbol index, go-to popup); G6 under way (LSP client library, PHP detection, Phpactor download, engine wiring and diagnostics, completion and hover, definition, references and rename, Phpactor dies with Lutra); G7 under way (`lutra` CLI and single instance, MCP server, integrated terminal); G14 English UI catalog in place · **Last updated:** 2026-10-24
|
||||
> **Status:** M0 closed G1; G2 under way (text buffer, engine buffers, tabs and editor in the app, recovery journal, autosave); G3 M1 part done (project tree, palette, settings dialog with string and path controls, themes) plus the app menu (M3.9); G4 under way (tree-sitter outline and folding library, Lezer highlighting, Structure tool window); G5 under way (search backend, Find tool window, symbol index, go-to popup); G6 under way (LSP client library, PHP detection, Phpactor download, engine wiring and diagnostics, completion and hover, definition, references and rename, Phpactor dies with Lutra); G7 under way (`lutra` CLI and single instance, MCP server, integrated terminal); G8 under way (Git backend, M4.1); G14 English UI catalog in place · **Last updated:** 2026-10-25
|
||||
|
||||
Every known shortfall, ranked. This is the work list: unless the owner gives a task, take the highest open gap. Hours are agent wall-clock hours for one agent, all estimated.
|
||||
|
||||
|
|
@ -13,7 +13,7 @@ Every known shortfall, ranked. This is the work list: unless the owner gives a t
|
|||
| G5 | Search and navigation: find in files, go to file/class/symbol, first index | M2 | ~35 h |
|
||||
| G6 | Language server: completion, definition, hover, rename via Phpactor (~~PHP detection and Phpactor download~~, M3.1; ~~engine wiring and diagnostics~~, M3.3; ~~completion, hover, signature help~~, M3.4; ~~definition, references, rename~~, M3.5) | M3 | ~15 h |
|
||||
| G7 | ~~Terminal~~ (M3.6: PTY sessions, xterm.js sub-tabs in the bottom panel; settings, persistence, links and search still open), ~~`lutra` CLI and single instance~~ (M3.7: open folders and files at a line, `--wait`, forwarding a second start, token-protected rendezvous), ~~MCP server~~ (M3.8: `lutra mcp` with list/execute every command, screenshot, read buffer, recent events, open buffers as resources; still missing: resource and tool change notifications, progress for long commands), files outside the open project (the CLI refuses them; needs out-of-project buffers or a second window), `lutra diff` | M3 | ~16 h |
|
||||
| G8 | Git integration | M4 | ~150 h |
|
||||
| G8 | Git integration: ~~backend through the installed git~~ (M4.1: status, stage/unstage, commit and amend, file contents at HEAD/index, branches, checkout, branch creation, `gitChanged`; no UI yet), Changes window, gutter markers and status colours, diff viewer, branch popup, log, blame, conflicts, stash, remotes | M4 | ~148 h |
|
||||
| G9 | Debugger, test runner, Composer, run configurations | M5 | ~300 h |
|
||||
| G10 | Own indexer, type inference, inspections, refactorings | M6 | ~800 h |
|
||||
| G11 | Stability: crash-free operation on real projects and machines (~~recovery journal~~, M1.7) | ongoing | ~95 h |
|
||||
|
|
@ -52,6 +52,7 @@ G6 progress: M3.2 landed the LSP client library in `crates/lsp`: JSON-RPC framin
|
|||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-10-25 | minor | G8 shrunk: Git backend (M4.1) |
|
||||
| 2026-10-24 | patch | G3/G6: string and path settings in the dialog, completion and tooltip settings (H4) |
|
||||
| 2026-10-25 | minor | G11 note: isolated data directory for dev and live-check instances (H6) |
|
||||
| 2026-10-24 | minor | G6: Phpactor no longer outlives Lutra (H1) |
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Milestones
|
||||
|
||||
> **Status:** M0 done, M1 done, M2 in progress · **Last updated:** 2026-10-22
|
||||
> **Status:** M0–M3 done, M4 in progress (C5) · **Last updated:** 2026-10-24
|
||||
|
||||
Hours are agent wall-clock hours for one agent; M0 and M1 so far are measured, the rest estimated. Since cycle C1 (factor 0.07) M1–M3 were scaled ×0.1 to ×0.15 (measured factors: C1 0.07, C2 0.10, C3 0.14, C4 0.17; next cycle ×0.18); M4–M6 keep their first raw estimates (multiply by ~0.1 for the calibrated value).
|
||||
|
||||
|
|
@ -10,7 +10,7 @@ Hours are agent wall-clock hours for one agent; M0 and M1 so far are measured, t
|
|||
| M1 | Editor and project: open folder, tree, tabs, editor, save, recovery, palette, settings, themes | done 2026-10-16 (M1.1 text, M1.2 VFS, M1.5 tree UI, M1.3 engine workspace, M1.4 desktop bridge, M1.6 tabs and editor, M1.11 message catalog, M1.9a settings backend, M1.10 themes, M1.7 recovery journal, M1.12 notifications, M1.13 C1 follow-ups, M1.8 command palette and keymap, M1.14 app icon, M1.9b settings dialog; C2 live checks pending, gaming mode) | ~5.6 (measured: C1 2.5, C2 3.1) |
|
||||
| M2 | Syntax and search: highlighting, structure, find in files, go to file/class/symbol | done 2026-10-17 (C3: M2.1 tree-sitter syntax, M2.2 highlighting + `editor.reveal`, M2.3 search backend, M2.4 Find tool window, M2.5 symbol index + go-to commands, M2.6 go-to popup, M2.7 Structure tool window) | ~6.1 (measured) |
|
||||
| M3 | LSP, terminal, CLI: completion, diagnostics, go to definition, hover, rename; terminal; `lutra` CLI and MCP — **MVP** | done 2026-10-22 (C4: M3.1 PHP detection and Phpactor download, M3.2 LSP client, M3.3 engine wiring and diagnostics, M3.4 completion, hover and signature help, M3.5 definition, references and rename, M3.6 integrated terminal, M3.7 CLI and single instance, M3.8 MCP server, M3.9 app menu, M3.10 autosave; live check with real key presses pending) | ~14 (measured) |
|
||||
| M4 | Git: status, diff, commit, branches, log, blame, conflicts | not started | ~150 |
|
||||
| M4 | Git: status, diff, commit, branches, log, blame, conflicts | in progress (C5: M4.1 backend done) | ~148 |
|
||||
| M5 | Debugger (Xdebug via DAP), PHPUnit/Pest runner, Composer, run configurations | not started | ~300 |
|
||||
| M6 | Own indexer and inspections; Symfony, Laravel, Shopware, WordPress support | not started | ~1,100 |
|
||||
| M7 | Workbench and tools: Deployment (FTP/SFTP/local mappings, upload/download, compare with server, save before deploy, optional upload on save per server), Local History, diff tool (files/folders), scratch files, macros, keymap editor, user themes, plug-in system, Database tools and SQL, HTTP Client, SSH/Docker/Vagrant/WSL, File Watchers, external tools, TODO view, tasks and contexts | not started | ~900 |
|
||||
|
|
@ -34,6 +34,7 @@ By the raw estimates the alpha gate needs M1–M4 plus cross-platform verificati
|
|||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-10-24 | minor | M4.1 Git backend; M4 in progress |
|
||||
| 2026-10-22 | minor | C4 review: M3 done (~14 h measured) |
|
||||
| 2026-10-22 | minor | M3.5 definition, references, rename |
|
||||
| 2026-10-22 | minor | M3.4 completion, hover and signature help |
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ Hours are the estimated agent wall-clock hours for one agent to reach behaviour
|
|||
| Inspections and quick-fixes | 8 | 4% (est.) | Lutra's own inspections and their settings, severities per inspection, quick-fixes (LSP code actions), suppression, inspection profiles, running inspections on a scope, PHP lint syntax errors on Windows, the editor's problem counter and scrollbar marks, next/previous problem, a current-file Problems view and severity filters, external tools (PHPStan, Psalm, PHP_CodeSniffer) | ~290 (est.) | M3.3: diagnostics from Phpactor (worse reflection: missing members, unknown classes, …) as wavy underlines, gutter markers and hover messages in the editor (`ui/src/components/editor/lint.ts`, tokens only), and a Problems tab in the bottom panel grouped by file with click to reveal (`ui/src/components/problems/`, `problems.open` `Mod+Alt+P`); engine `diagnosticsChanged`, `diagnostics.list`, `lspStatus` (`crates/engine/src/lsp/`). Tests: 10 engine tests against a fake server incl. a sync proptest, a TCP test, 16 Vitest tests, an ignored test against the real PHAR. Checked in the app on Windows 11 with the real Phpactor (port 7933): five errors underlined and listed; first diagnostics 2.7 s after `file.open`, 2.7–2.9 s after an edit (debug build, measured, incl. Phpactor's 1 s debounce). Graded against `plan/phpstorm/11-problems.md`: the depth comes from Phpactor, Lutra has no inspections of its own |
|
||||
| Refactoring | 7 | 3% (est.) | rename: preview of all changes, comments/strings and text occurrences, scope, renaming files with classes, one undo across files (closed files written on disk are not undone by the editor); extract variable/method/constant, inline, move, change signature, safe delete, pull up/push down, introduce parameter | ~244 (est.) | M3.5: Rename (`lsp.prepareRename` then `lsp.rename`, F2) through Phpactor with an inline field over the symbol that shows how many uses in how many files change. The workspace edit is checked completely first (inside the project, ranges fit, open buffers unchanged since the request, no file operations); then closed files are written atomically through the VFS (written ones restored if a later write fails), open buffers change through `buffer.edit` (dirty, one undo step each in the editor), Phpactor reindexes the written files (sent as `didOpen`/`didSave`/`didClose`; its index followed in 140 ms, measured) and a summary notification follows. Live: renaming a method used in 3 files took 28 ms (open buffer + 2 closed files, CRLF kept). Tests: `crates/engine/tests/lsp_nav.rs` (multi-file rename incl. a closed CRLF file, an edit outside the project refused, a bad range refused, a buffer edited meanwhile refused; ignored real-Phpactor rename and rename back), Vitest `ui/tests/nav/`. |
|
||||
| Code style and formatting | 4 | 0% | everything | ~120 (est.) | — |
|
||||
| Git | 8 | 0% | everything | ~150 (est.) | — |
|
||||
| Git | 8 | 1% (est.) | everything visible: Changes window, commit UI, gutter markers, status colours, diff viewer, branch widget (C5 wave 2/3); log, blame, conflicts, stash, remotes (C6); ignored files in the status; chunk staging | ~148 (est.) | M4.1 (backend only, reachable through the palette, control channel and MCP): `git.status`, `git.stage`, `git.unstage` (also before the first commit), `git.commit {message, amend}` with hooks, `git.show` at HEAD or the index, `git.branches`, `git.checkout` (remote → tracking branch), `git.createBranch`; `gitChanged` after changes and from a `.git` poll plus the project watcher. Runs the installed git ≥ 2.30 (`git.executable`), porcelain v2 / `-z` only, no prompts, timeouts and caps, off the engine lock. Tests against real temp repositories (`crates/vcs/tests/repo.rs`, `crates/engine/tests/git.rs`). Graded against `plan/phpstorm/16-vcs-basics.md`: nothing a user sees yet, so the score stays near zero. |
|
||||
| Terminal | 3 | 15% (est.) | renaming and splitting tabs, sessions kept across restarts, search in the output, clickable paths and links, drag and drop, command completion, terminal settings (shell path, start directory, environment, font, cursor shape, bell, copy on selection, middle-click paste), a key back to the editor, the PHP interpreter in `PATH`, a terminal in a file's directory, confirmation before killing a running process, moving a terminal into the editor | ~26 (est.) | M3.6: `crates/terminal` runs the shell in a pseudo terminal (`portable-pty`: ConPTY on Windows, Unix pty elsewhere) on its own reader, writer and waiter threads: UTF-8 split across reads joined, invalid bytes U+FFFD, a 1 MiB output buffer per session with backpressure (the shell waits, nothing is dropped while it runs), a non-blocking input queue, resize, kill, exit codes. Engine `terminal.create {cwd?, shell?, cols, rows}` / `terminal.input` / `terminal.resize` / `terminal.close`, events `terminalOutput` (≤ 64 KiB per terminal and 256 KiB per pump, round-robin) and `terminalExited {code}`; terminals close with the project and on `app.quit`. UI: a Terminal tab in the bottom panel (tabs next to Find), xterm.js with the fit addon, several terminals as sub-tabs (Local, Local (2)…) with close and new buttons, output replayed after collapsing the panel, copy (`Mod+Shift+C`, `Ctrl+C` with a selection) and paste (`Mod+Shift+V`, `Ctrl+V`), a focus rule that leaves plain Ctrl keys to the shell, Lutra's own ANSI colours (`--lt-terminal-*`, all text colours ≥ 4.5:1), `terminal.open` `Mod+Shift+T`. Tests: 8 session tests with real `cmd.exe` (echo, exit code, input, 6,000 multibyte characters without U+FFFD, 30,000 lines through a full buffer without losing a line, resize, kill, spawn errors) and UTF-8 proptests (`crates/terminal`), 3 engine tests (`crates/engine/tests/terminal.rs`), a TCP control test create → output → input → exit (`crates/control/tests/terminal.rs`), 20 Vitest tests with a mocked xterm (`ui/tests/terminal/`). Live check (Windows 11, debug build with bundled UI, control port 7936, temp project): `terminal.open` showed a pwsh prompt in the project root, first `terminalOutput` 0.2–0.5 s after the command; `php -v` printed PHP 8.4.24 within 0.5–1.5 s; `dir` listed the project; resizing the window changed the shell's width 144 → 190 → 105 → 142 columns (pwsh `WindowSize`); a second terminal as sub-tab "Local (2)"; Find and Terminal as bottom tabs; dark and light screenshots read; `exit 3` gave `terminalExited {code: 3}`; `app.quit` ended the app and its shells (measured). The live check found two bugs, fixed before the commit: xterm's own black viewport background showed as a bar under the last row, and programs printing ANSI white (PSReadLine) were unreadable on the light theme, so xterm now enforces a 4.5:1 minimum contrast. Typing, clicking and copy/paste were not driven in the app (the control channel has no input method); Vitest covers them. Graded against `plan/phpstorm/10-terminal.md` |
|
||||
| Run configurations | 2 | 0% | everything | ~50 (est.) | — |
|
||||
| Debugger | 5 | 0% | everything | ~120 (est.) | — |
|
||||
|
|
@ -65,6 +65,7 @@ The project tree is the first user-visible feature (Project view 8%, estimated);
|
|||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-10-25 | minor | M4.1: Git 0% → 1% (est.), Git backend without UI; hours 150 → 148 |
|
||||
| 2026-10-25 | minor | H5: Settings row evidence (banner-aligned themes, diagnostic and VCS tokens); score unchanged |
|
||||
| 2026-10-24 | minor | H4: Settings 7% → 8% (est.), string and path controls, completion and tooltip settings; hours 60 → 58 |
|
||||
| 2026-10-22 | minor | C4 review: breadth recounted against the feature map, 32/155 |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue