`--data-dir DIR` / `LUTRA_DATA_DIR` move settings, the recovery journal,
the rendezvous file and the WebView2 user data folder into one directory.
`--control PORT` without either uses `<temp>/lutra-control/<port>/`. The
SHA-256-checked Phpactor cache stays shared from the user's data dir
(`Engine::share_tools_from`). An isolated instance never forwards to or
registers as the user's main instance; `rendezvous::dir()` honours
`LUTRA_DATA_DIR` after `LUTRA_RENDEZVOUS_DIR`, so the CLI finds it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New layer-0 crate lutra-proc: spawn(Command) puts the child into a
kill-on-close group. Windows: one job object per child with
JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE (windows-sys), nested jobs work.
Unix: a new process group plus a /bin/sh watchdog that kills the group
when Lutra's pipe closes (drop, kill, quit or SIGKILL of Lutra).
Child::kill and Drop take the whole group.
Phpactor (supervision spawn) and the php -v probe in lutra-lsp start
through it. Tests kill a parent hard and check that its child is gone
(with and without the parent in a group), plus kill and drop of a tree.
Docs: architecture "Child processes", G6 note.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Engine (`cmd/lsp_nav.rs`, on the pending outcomes of 20d1d28):
- `lsp.definition` (F12) and `lsp.references` (Shift+F12, sorted, with
line previews) return project-relative locations; locations outside
the project, such as PHAR stubs and symlink escapes, are dropped.
- `lsp.prepareRename` uses the word at the cursor when the server has
no prepareProvider.
- `lsp.rename` (F2) applies the workspace edit (`lsp_nav/edit.rs`):
1. Check everything first: inside the project, ranges fit (UTF-16,
CRLF), open buffers unchanged since the request, no file
operations, no incomplete edit.
2. Write closed files atomically through the VFS, restoring earlier
writes when a later one fails.
3. Change open buffers through `buffer.edit` (dirty, undoable).
4. Send each written file to Phpactor as didOpen/didSave/didClose
plus didChangeWatchedFiles; without this its index kept the old
names. Then the summary notification `notification.lsp.renamed`.
UI (`components/editor/nav/`):
- Mod+click goes to the definition, with a pointer cursor while Mod is
held.
- A location picker for several definitions (exclusive modal).
- A References tab in the bottom panel, grouped by file.
- An inline rename field with a use/file count (exclusive modal).
- `BufferSync.beginUndoableRemote` puts the engine's rename edit into
the editor history as one undo step per buffer.
- Catalog strings and tokens only.
Fake LSP server: `--script FILE` with scripted capabilities and
answers (additive next to M3.4's arms).
Tests:
- `crates/engine/tests/lsp_nav.rs` (fake): definition; bad positions;
references; prepareRename; a multi-file rename incl. a closed CRLF
file; refusals for outside the project, a bad range, a stale buffer,
bad names and no server.
- The ignored real-Phpactor test covers definition, references and a
rename and back across 3 files.
- Vitest `ui/tests/nav/`.
Live (Phpactor 2026.06.25.0, Windows, port 7935, tick on):
- definition 93 ms cold / 7-18 ms warm
- references ~140 ms
- prepareRename ~11 ms
- rename 28-59 ms
- index follows written files in 140 ms
- Phpactor 57 MB working set, ~1.6% of a core while ticking idle
Gate: 13 steps, 197 s, Vitest 484 + 1 skipped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Engine (crates/engine/src/cmd/lsp_assist.rs), on M3.5's pending outcomes:
- lsp.completion {id, position, triggerCharacter?}: items with label,
kind, detail, Markdown documentation, insertText, textEdit,
additionalTextEdits, sortText; sorted, capped at 500 (cut lists are
incomplete), snippets turned into plain text.
- lsp.hover {id, position}: Markdown contents and range.
- lsp.signatureHelp {id, position}: signatures with UTF-16 parameter spans.
- The request is queued after every didChange; the answer is converted
in the reply callback, off the engine lock. Positions are checked
against the buffer. Server strings and lists are capped.
- lutra-lsp-fake answers completion and signature help.
Editor (ui/src/components/editor/assist/):
- Completion source with Lutra's triggers (identifiers, $, ->, ?->, ::,
namespace \; not in strings or comments unless asked), the server's
ranking as boost, text edits and imports applied in UTF-16 (CRLF too),
Lucide kind icons.
- Hover documentation (350 ms) and editor.quickDocumentation (Mod+I).
- Signature help on ( and , following the cursor; editor.parameterInfo.
- editor.complete.
- Lutra's own Markdown renderer without HTML (XSS-tested), tokens only.
- Requests wait for the buffer sync to be idle and use runWaiting.
- New dependency @codemirror/autocomplete (MIT, already transitive).
Tests: 6 engine tests against the fake server, 9 unit tests, an ignored
real-Phpactor latency test, 29 Vitest tests; palette and menu tests list
the new UI commands.
Measured with the real Phpactor (Windows 11, debug build, 25 ms tick):
- Completion 61-109 ms while typing (median 76 ms; ~107 ms in the app).
- Hover and signature help ~16 ms median.
- A useful list 2.3 s after opening a file in a 20-class project, ~65 s
for 2,000 classes (indexing).
- Phpactor 56-71 MB working set, ~6% of one core while typing.
Live-checked in the app on port 7934. Docs: Code completion 0% -> 5%
(est.), feature depth ~4.1% -> ~4.6%, breadth 26/155, architecture, G6,
ui-parity, language-parity, roadmap, README.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Step 1 of M3.5: the shared mechanism. M3.4 and M3.5 build on it.
- Engine: `Outcome.pending: Option<Pending>`. `Pending::new(rx, timeout,
finish)`; `Pending::wait()` is called without the engine lock and
returns at the answer, a dropped sender or the deadline (timeout + 1 s).
`Engine::resolve(answered)` then runs `finish(state, reply)` inside the
guard, under the lock. `run_waiting(lock, cmd, params, publish)` does
all three steps for hosts.
- Hosts: `Host::run`, `testkit::EngineBackend` and the control test
backend use `run_waiting`.
- New IPC `engine_execute_waiting` (`#[tauri::command(async)]`, off the
main thread) with `runWaiting()` in `ui/src/ipc.ts`. Only `lsp.*`
requests use it.
Ordering guarantee:
- `engine_execute` stays synchronous on the main thread, so ordinary
commands (`buffer.edit`) still run in call order.
- The order towards the server is fixed under the engine lock:
`buffer.edit` queues its didChange on the session's FIFO queue before
it returns, and `lsp::submit` queues the request on the same queue.
A request therefore sees every edit whose `buffer.edit` returned
first, and the UI awaits the sync's `idle()` before sending one.
Failures:
- A stall is caught by the request timeout, with the deadline as
backstop.
- On restart, close, quit or crash the request is dropped or resolved
as stopped, so the waiter gets an error, never a hang.
Tests: `crates/engine/tests/pending.rs` (answer, lock free while
waiting, dropped sender, deadline, resolve, lsp.restart while a
request is pending) and Vitest for `runWaiting`. Gate: 13 steps,
321 s, Vitest 443 + 1 skipped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- One Phpactor per open project on its own session thread, started when
the toolchain is ready; ordered document sync from buffer.edit and the
pump; lspStatus, diagnosticsChanged, diagnostics.list, lsp.status,
lsp.restart; app.quit stops the server synchronously.
- Phpactor 2026.06.25.0 on Windows: keep-alive $/lutra/tick (its event
loop only runs on stdin input), in-process diagnostics and a polling
watcher through initializationOptions (amphp subprocesses fail), 500 ms
shutdown timeout.
- Editor lint extension (underlines, gutter dots, hover; tokens only) and
a Problems tab in the bottom panel; problems.open Mod+Alt+P.
- Tests: engine tests against the fake server (incl. sync proptest), an
ignored real-Phpactor test, a TCP test, Vitest for lint and Problems.
- Docs: architecture, gaps G6, parity (Inspections 4% est.), ui-parity,
roadmap, ROADMAP.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- crates/terminal: portable-pty sessions (ConPTY on Windows) with reader,
writer and waiter threads, UTF-8 chunking, a 1 MiB output buffer with
backpressure, a non-blocking input queue, resize, kill and exit codes;
default shell pwsh -> powershell -> cmd on Windows, $SHELL or /bin/sh.
- Engine: terminal.create/input/resize/close, terminalOutput (capped per
terminal and per pump, round-robin) and terminalExited through the pump;
terminals close with the project and on app.quit.
- UI: Terminal tab in the bottom panel (tabs next to Find), xterm.js with
the fit addon, sub-tabs, copy/paste, a focus rule that leaves plain Ctrl
keys to the shell, terminal.open (Mod+Shift+T), --lt-terminal-* ANSI
tokens in both themes (text colours AA) and a 4.5:1 minimum contrast.
- Tests: real-shell crate tests (UTF-8, backpressure), engine and TCP
control tests, Vitest with a mocked xterm; live check on port 7936;
docs and parity rows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Autosave saves dirty buffers when the window loses focus (DOM blur and
visibilitychange), when the active tab changes and after
editor.autosave.idleSeconds (default 15) without an edit; three settings,
all on by default. flushDirty() in ui/src/stores/autosave.ts is the one
save-all-dirty-and-wait entry point for later deployment, run and
terminal features: it waits for pending buffer sync, then runs
file.saveAll {skipConflicts: true}; one toast per failed file.
Engine: file.saveAll takes skipConflicts and returns skipped; Buffers
tracks buffers in conflict with their file and the hash of the last
read/written content, so our own save reported late is not a conflict.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The --wait end-to-end test hit its 20 s wall-clock deadline under
parallel-build load. It now waits on the backend's bufferOpened event
and on the process exit through channels, with a generous 120 s limit
that a passing run never approaches. The single-instance control tests
use a 60 s timeout instead of 10 s. The other CLI tests already wait on
the process without a deadline.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- crates/mcp (L5): JSON-RPC 2.0 over stdio, dual era: MCP 2026-07-28
(per-request _meta, server/discover, -32022) and legacy initialize
(2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05). Tools list_commands,
execute_command (app.quit only with confirm: true), screenshot (image
content), read_buffer, get_events (ring of 1000 events via
events.subscribe); resources lutra://buffer/<path> for open buffers.
Engine errors become tool errors with the engine code. Lines capped at
16 MiB, guard around every request, parser and tool args fuzzed.
- lutra mcp [--port PORT] [--no-start] in apps/lutra-cli: connects through
the rendezvous file and token, or starts Lutra.
- Engine: read-only buffer.list command.
- Tests: protocol units + proptest fuzz, integration over the token
listener, stdio end to end. Docs: architecture (MCP), G7, ROADMAP.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The give-up test raced its queued request's 5 s timeout against five
restarts under load. Test options now use request and initialize
timeouts far beyond any restart sequence and the 60 s event wait, the
queued request gets an explicit long timeout, the crash test waits for
the reopened text instead of assuming no live change slips in before the
restart, and the echo callback and shutdown bounds get margin.
Five runs in a row with 16 busy loops in parallel: all green.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A slim header bar in MainLayout with a menu button (Lucide menu) whose
dropdown lists every command with a menuPath, grouped File, Edit, View,
Go, Help, with shortcuts and dimmed disabled entries. Keyboard: arrows,
Home/End, Enter/Space, Escape/Tab, type-ahead. menu.open (Alt+M) opens
it, also over uiCommand. It is an exclusive modal and a launcher under
the one-modal rule. Menu paths for the user-facing engine and UI
commands (buffer.close as File/Close Tab). Catalog strings, Vitest.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- crates/lsp toolchain: PHP from php.executable or PATH, `php -v` with a
5 s timeout and capped output, version parsing (proptest), PHP >= 8.2.
- Pinned Phpactor 2026.06.25.0 (SHA-256 832510fe...59e9); newer releases
need ext-posix and do not start on Windows.
- Download with ureq + rustls (ring, OS roots via rustls-native-certs):
HTTPS only, 32 MiB cap, SHA-256 verified before an atomic write, retry
with backoff. Tests use a local HTTP server only.
- Engine: settings php.executable, phpactor.path, phpactor.autoDownload
(bool and string setting kinds), toolchain.status,
toolchain.downloadPhpactor, toolchainChanged, notifications; worker
thread off the engine lock, results via the pump. Downloads only after
the host calls Engine::allow_downloads (the desktop does).
- Docs: architecture Toolchain section (network access, D15), G6.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
crates/lsp is now a library: Content-Length JSON-RPC framing over stdio
(32 MiB cap, malformed frames dropped and reported, fuzzed), Server::spawn
with initialize/initialized (utf-16, incremental sync, completion, hover,
signatureHelp, definition, references, rename, publishDiagnostics),
typed requests with timeouts and $/cancelRequest, answers to server
requests (configuration nulls, MethodNotFound), events on a bounded
channel, supervision with backoff restarts that reopen documents and
give up after 5 crashes in 2 min, shutdown/exit, and incremental
document sync from lutra_text edits. Tested against a scripted fake
server binary; docs: architecture, G6.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- crates/control: rendezvous file (<data_dir>/instance.json, port + random
token, atomic write, 0600 on Unix, stale detection), token-protected
listener (start_with_token, app.auth first, constant-time compare,
10 s auth timeout), app.focus, and a blocking client (connect_live,
request/execute/subscribe/next_event, open_folder/open_file/reveal)
- lutra-desktop: a normal start forwards its path to a running instance
and exits, otherwise claims the rendezvous; --control instances skip it
unless LUTRA_RENDEZVOUS_DIR is set; non-Unicode args are usage errors
- lutra-cli (binary lutra, now L6): path[:line[:column]] targets, folder ->
project.open, file -> file.open (parent opened without a project, outside
the project refused), editor.reveal, starts the desktop if needed,
--wait until bufferClosed, --version/--help, exit codes 0/1/2
- tests: proptest target parsing, rendezvous read/write/stale, token check
over TCP, forwarding against a test backend, --wait end to end
- docs: architecture, G7, ROADMAP (agent automation 18% est.), roadmap,
README
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One popup with Files / Classes / Symbols tabs (Tab switches), opened by
goto.fileOpen (Mod+P), goto.classOpen (Mod+Alt+C) and goto.symbolOpen
(Mod+T), each with an optional {query} for agents. Live debounced query
against goto.* with stale answers dropped, matched characters marked,
directory / namespace / container column, library rows labelled, an
indexing hint with progress and a re-query on indexReady. Enter or a
click opens through editor.reveal; Escape closes. An exclusive modal and
a launcher: any other command closes it.
goto.file items now carry `library` (PM decision). indexProgress and
indexReady join the ipc event union. Notes in plan/phpstorm/08-goto.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Engine: every open PHP buffer keeps a tree-sitter tree, reparsed
incrementally on a worker thread off the engine lock (200 ms debounce,
edit batches recorded by buffer.edit, full parse when the chain breaks).
syntax.outline {id} returns {items, truncated, version}; outlineChanged
{id} at most every 200 ms per buffer. Replaced trees and outlines are
freed on the worker.
UI: left stripe with Project | Structure in MainLayout, the Structure
tool window (WAI-ARIA tree, Lucide kind icons, signatures, jumps via
editor.reveal), view.toggleStructure on Mod+2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
crates/index: walks the project with the search/VFS rules (vendor as
library), parses .php files from tree-sitter outlines on a worker pool
off the engine lock, updates incrementally from disk and buffers through
an updater thread, caps at 200,000 files, and answers fuzzy file, class
and symbol queries (nucleo-matcher, MPL-2.0 as a separate crate).
Engine: index.status, goto.file, goto.class, goto.symbol; events
indexProgress and indexReady drained by the pump; the index starts on
project.open and is cancelled on close. Tests: unit, incremental,
property (random queries and sources), engine and TCP control tests,
release timing on a generated 20k-file project (3.9-4.2 s).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
crates/search: parallel ignore walk + grep-searcher with the project's
ignore rules (vendor searched as library, node_modules and .git skipped),
literal or regex, case, whole word, include/exclude globs, binary and
> 8 MiB skips, match cap, cancel token, buffer overlay.
Engine: search.find returns {searchId} at once and runs off the lock;
pump_vfs drains results into searchResults (one per file, at most 500
per pump) and searchDone; search.cancel. Testkit: generated search tree.
Tests: library unit and property tests, engine tests, TCP control test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Modal rule (ui/src/commands/modals.ts): palette, settings dialog and the
close question are exclusive; opening one closes the other. Running any
command but palette.open (keyboard, palette, uiCommand) closes the
palette. The restore dialog is queued: hidden while another modal is
open, back with its list intact afterwards.
- recovery.restore / recovery.discard emit recoveryResolved {paths}; the
restore dialog drops the settled paths and closes when none are left.
Rust was needed: discard gave the UI no signal, and a restored entry
stays in the journal as the buffer's own entry.
- Dimmed restored text (C2 screenshot 09) was the dialog overlay, not an
editor style; no editor change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Engine: ui.registerCommands (validated, replaces the previous set),
UI commands in listCommands with ui: true and labelKey, running one
through the engine emits uiCommand {id, params}.
- Frontend: ui/src/commands/ (keymap by key code, fuzzy ranking, Pinia
commands store with handlers, recents and error toasts), the command
palette (Mod+Shift+P), UI commands palette.open, settings.open (Mod+,,
disabled until M1.9b) and view.toggleProjectTree (Mod+1). The editor's
shortcuts.ts moved into the global keymap.
- Tests: engine and control-channel tests for registration and
uiCommand, Vitest for keymap, ranking, store, palette and App wiring.
- Docs: architecture, ui-parity, target-app-parity, gaps, roadmap,
ROADMAP, README.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The host publishes picker, command-line and pump errors as notification
events (Engine::notify, same id sequence) instead of stderr, keeps
notifications and watchFailed published before engine_ready and replays
them after the state replay, so startup warnings (corrupt settings,
journal entries) reach the UI. ipc.ts announces engine_ready once all
subscriptions started together are registered.
Frontend: notifications store and NotificationStack (bottom right, info
auto-dismissed after 5 s, warnings/errors stay, close button and Escape,
at most 5 visible with "+n more", role status/alert); watchFailed maps to
a warning toast; failed commands without their own UI raise an error
toast. Catalog keys notification.settings.*, project.*, vfs.*, watch.*,
command.* plus the runtime allow-list. Docs updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The parent directory of every open buffer is pinned in the project
watcher (workspace::sync_buffer_dirs after every command): it counts
against the cap but is never evicted while a buffer in it is open, so
reloads and fileChangedOnDisk arrive for never-expanded folders.
- file.open on an already-open buffer emits the new bufferFocused {id};
the editor activates that tab and it outranks pending adoptions.
- The project tree shows a "Listing truncated" note row
(project.tree.truncated) after a partly listed directory.
- Tests: engine (pinning, eviction, focus), control channel
(bufferFocused), Vitest (tab switch, race, truncated row).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dirty buffers are written atomically to <data_dir>/recovery/<project-id>/
about 1 s after the last edit (at most 2 s while typing), from pump_vfs,
never per keystroke. Entries are removed on save, close (also force),
forced project close/open and recovery.discard. project.open emits
recoveryAvailable; recovery.list/restore/discard; restored buffers are
dirty and keep line ending and BOM. Corrupt entries are moved aside and
reported as warning notifications.
UI: restore dialog in ui/src/components/recovery (Restore all, Restore
selected, Discard, time, changed-on-disk hint), catalog keys and runtime
allow-list. Tests: crash/restore with CRLF + BOM, corrupt entries, removal
paths, property test of random edits, headless control-channel test,
Vitest for the dialog. Docs: architecture, parity, gaps, ROADMAP.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- theme::LIGHT next to DARK with the 10 new tokens (editor selection,
active line, cursor, gutter, match, font size, tab active/modified,
notice); light fg-muted, accent and error darkened for WCAG AA
- theme.list, theme.systemPreference, themeChanged event when the
resolved theme changes (settings.set/reset appearance.theme, or the
OS preference in system mode)
- desktop init script and window background from the stored setting;
system mode uses a prefers-color-scheme media query for the first frame
- ui/src/theme.ts applies tokens to :root and color-scheme live; editor,
tabs and notice drop their var() fallbacks
- Vitest WCAG AA contrast check against a Rust-maintained snapshot,
DOM tests, headless control-channel test
- docs: architecture Themes, parity rows, ui-parity, gaps, roadmaps
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EngineConfig and Engine::with_config; the desktop resolves Tauri's app
config and data dirs. Settings model (appearance.theme, editor.fontSize,
ui.language) with typed validation, persistence in settings.json via
write_atomic (1 MiB cap, unknown keys kept, corrupt file backed up with a
warning notification), settings.list/get/set/reset, settingsChanged and
notification events. Property test over random settings.json content,
control-channel test for persistence and corrupt-file recovery.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Spec field only, so the editor's close-tab shortcut comes from the
engine like Mod+S and Mod+Alt+S. Registry test checks the three.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The desktop host publishes every engine event, from commands and from a
pump thread that calls Engine::pump_vfs every 100 ms, to control channel
subscribers and to the window as the Tauri event engine://event, in engine
order. ui/src/ipc.ts gets a typed onEngineEvent; its first subscription
calls engine_ready, and the host replays the current project and buffers,
so a project opened from the command line (lutra-desktop --control PORT
PATH) reaches the UI. project.openDialog returns Effect::PickFolder; the
host shows the native folder picker (tauri-plugin-dialog, licence checked)
and opens the choice, one picker at a time, cancel is not an error.
Capabilities shrink to event listen/unlisten.
Contract fix: the M1.5 project UI assumed shapes the engine does not use.
engineEvents.ts now translates engine events ({kind: projectOpened, ...})
and project.children results ({dir, entries, truncated}) into the UI types,
keeping role and truncated; the store maps listings through
toTreeEntries() and the project tests use the real engine shapes.
Verified in the running app on Windows 11: tree of a project given on the
command line, expanding src, a file created on disk appearing live, the
folder picker opening one dialog and opening the chosen folder.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
State holds the open project (VFS project, watcher, watched directories)
and versioned buffers. New commands: project.open/close/children,
file.open/save/saveAll, buffer.get/edit/close. buffer.edit takes UTF-16
change sets based on a version and fails with the new stale_version code;
closing dirty buffers or projects without force fails with
unsaved_changes. Commands queue events (projectOpened, treeChanged,
bufferChanged, dirtyChanged, fileChangedOnDisk, ...) that the engine
returns in Outcome.events; Engine::pump_vfs maps changes on disk to
events and reloads clean buffers. project.children watches listed
directories, capped at 256 native / 32 polling, least recently listed
dropped first.
Control channel: events.subscribe streams {"event": ...} lines, with
bounded per-subscriber queues (lutra_control::Subscribers) and method docs
in methods.rs. testkit's EngineBackend and the desktop Host implement the
new Backend::subscribe. Verified with 14 engine integration tests, a TCP
events test and the running app over the control channel.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- notify 8.2.0 (CC0-1.0) behind the existing Watcher API, allowed by a
crate-scoped [[licenses.exceptions]] entry in deny.toml (owner
decision 2026-10-14, noted in AGENTS.md and NOTICE).
- Native notifications only mark directories dirty; after 100 ms of
quiet (at most 10 intervals) dirty dirs are rescanned and diffed, so
events, debouncing and rename pairing match the polling backend.
- Polling stays as fallback when the native watcher cannot start, and
per directory when a native watch is refused. Lost events or watcher
errors trigger a full rescan; root loss is checked on every tick.
- Additive API: WatchOptions::backend (Auto, Polling) and
Watcher::is_native.
- Watch tests run on both backends (34 vfs tests on Windows).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Project::open canonicalises the root (no \?\ prefix on Windows where
safe); typed errors for missing and non-directory paths.
- Lazy children(dir): dirs first, case-insensitive; kind, ignored flag
and role (vendor/ library, node_modules/ excluded, .git hidden).
- Ignore rules via the ignore crate: .gitignore, .ignore,
.git/info/exclude, global git excludes, with git precedence.
- Watcher: std-only polling (100 ms, watched dirs only) with
create/modify/remove/rename events and a Failed event on root loss.
notify is CC0-1.0 and fails cargo deny; owner decision pending.
- read_text with a 32 MiB cap, UTF-8 + BOM, typed InvalidUtf8 and
UnsupportedEncoding; write_atomic via temp file + rename, keeping
permissions and refusing read-only files.
- 28 tests on temp dirs (30 on Unix: permission and symlink write tests).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lutra-text gets Buffer on a ropey rope: byte/char/UTF-16/line counts,
byte offset <-> (line, column) in UTF-16 code units or chars, absolute
UTF-16 offsets, atomic Edit batches in LSP TextEdit[] semantics, and
\n / \r\n / \r detection with a keep-the-file's-ending save policy.
All conversions return TextError instead of panicking.
ropey 1.6.1 (MIT) without unicode_lines, so only the LSP/CodeMirror
line breaks split lines. proptest moves into workspace deps.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lutra_control::start binds 127.0.0.1:PORT and serves app.ping,
engine.execute, engine.listCommands and ui.screenshot through the Backend
trait the host implements. Lines are capped at 16 MiB, every input gets a
well-formed response with a stable error code, and backend panics become
internal errors. Proptests cover arbitrary lines; a TCP integration test
uses the new testkit EngineBackend.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Command trait with static spec, enabled check and run; Registry rejects
duplicate ids; Engine::execute runs every command inside the guard, which
turns panics into EngineError::Internal and keeps the engine usable.
Effects (Quit) are applied by the host. Theme tokens for Lutra Dark and
Lutra Light render as --lt-* CSS variables and a webview init script.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Edition 2024 workspace with the crates from docs/architecture.md, each
declaring its layer in package.metadata.lutra. Records the M0 architecture
decisions (highlighting, Git library, terminal, text buffer).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>