H6: isolated data directory for dev and live-check instances
`--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>
This commit is contained in:
parent
e5891ddeb4
commit
ba70b0f43a
10 changed files with 418 additions and 29 deletions
|
|
@ -71,6 +71,7 @@ As built in M0:
|
|||
- **Security:** only the user may read the token. Unix: the file is created with mode `0600`. Windows: it lives in the user's roaming AppData folder, whose inherited ACL grants the user, `SYSTEM` and Administrators only (checked with `icacls` in the M3.7 live check); Lutra sets no ACL of its own. Both listeners bind `127.0.0.1` only. On the token listener the first request must be `app.auth {token}` within 10 s (`AUTH_TIMEOUT`); a wrong token, another method or garbage gets `unauthorized` and the connection is closed. Tokens are compared in constant time. The `--control PORT` listener stays open (no token) for development and agents; it is opt-in and documented as such.
|
||||
- **Second start:** `lutra-desktop [PATH]` without `--control` reads the rendezvous file first. If the listener answers, accepts the token and pings, the start forwards `PATH` (folder → `project.open`, file → `file.open`), calls `app.focus` and exits 0. If the file is missing, unreadable, invalid, or its port refuses or rejects the token, it is stale: this start becomes the instance and replaces the file. Two starts in the same instant can both become instances; the later file wins (accepted, rare).
|
||||
- **Development instances:** a start with `--control PORT` skips the single instance (no forwarding, no rendezvous file) so parallel agents' instances never forward to each other, unless `LUTRA_RENDEZVOUS_DIR` is set, which opts it into the single instance in that directory (used for isolated live checks).
|
||||
- **Data directory isolation (H6):** `lutra-desktop --data-dir DIR` or `LUTRA_DATA_DIR=DIR` makes an isolated instance (`apps/lutra-desktop/src/datadir.rs`): `EngineConfig { config_dir: DIR, data_dir: DIR }` (settings, `recovery/`), the rendezvous file in `DIR`, and the webview's own data in `DIR/webview` (`WebviewWindowBuilder::data_directory`, the WebView2 user data folder, so local storage is separate too). `--control PORT` without either uses `<temp>/lutra-control/<port>/`, kept between runs. The managed tools stay shared: `Engine::share_tools_from(user app_data_dir)` makes the toolchain look for (and, only if missing, download) `tools/phpactor/<version>/` there, SHA-256 checked as before. Rendezvous order: `LUTRA_RENDEZVOUS_DIR` if set; else none for `--control`; else the isolated directory; else the default. `rendezvous::dir()` (CLI, `lutra mcp`) honours `LUTRA_DATA_DIR` after `LUTRA_RENDEZVOUS_DIR`, so `lutra` finds an isolated instance started with the same environment. An isolated instance therefore never forwards to, or registers as, the user's main instance.
|
||||
- **New methods:** `app.auth {token}` (always succeeds on the open listener) and `app.focus` (restore, show and focus the main window; `focus_failed` without a window; `Backend::focus` has a default that fails, so test backends need no change).
|
||||
- **`lutra` CLI** (`apps/lutra-cli`, binary `lutra`, now L6 so it can use `lutra-control`): `lutra [--wait] [PATH[:LINE[:COLUMN]]]...`.
|
||||
- **Targets:** up to two trailing `:N` groups are a 1-based line and column (`N` all digits, something before it; on Windows a lone drive letter is never split). If the path part does not exist but the whole argument does, the argument is the path. Paths are made absolute against the current directory without resolving symlinks.
|
||||
|
|
@ -544,6 +545,7 @@ Watched directories: the VFS watcher is non-recursive, so `project.children` wat
|
|||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-10-25 | minor | H6: isolated data directory (`--data-dir`, `LUTRA_DATA_DIR`, `--control` temp dir), shared tools dir, rendezvous order |
|
||||
| 2026-10-22 | minor | M3.5: definition, references, rename (`lsp_nav`, workspace edits, undoable remote edits, nav UI) |
|
||||
| 2026-10-22 | minor | M3.4: code assistance (`lsp.completion`, `lsp.hover`, `lsp.signatureHelp` on pending outcomes; editor completion source, hover, signature help, safe Markdown, assist UI commands), Phpactor latency and resources |
|
||||
| 2026-10-22 | minor | M3.5 step 1: pending outcomes (`Pending`, `Engine::resolve`, `run_waiting`), `engine_execute_waiting` / `runWaiting` |
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ cargo xtask ci # the full quality gate, run before every commit
|
|||
cargo xtask fixtures # create Symfony and Laravel reference projects in target/fixtures/
|
||||
```
|
||||
|
||||
A `--control PORT` instance keeps its settings, recovery journal and webview data in `<temp>/lutra-control/<port>/`, never in your own data directory; `--data-dir DIR` or `LUTRA_DATA_DIR=DIR` pick another directory. Delete the folder to start fresh.
|
||||
|
||||
## Robustness: Lutra never crashes
|
||||
|
||||
Shipped code returns errors instead of panicking (see AGENTS.md › Never crash). The engine guard catches panics at every entry point, keeps buffers intact and reports an internal error. Unsaved buffers are journaled so a restart can restore them.
|
||||
|
|
@ -30,5 +32,6 @@ No inline comments. Doc comment blocks above modules, functions, types and field
|
|||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-10-25 | minor | Isolated data directory for `--control` instances (H6) |
|
||||
| 2026-10-14 | minor | Node.js 22.12+ required by the frontend toolchain |
|
||||
| 2026-10-13 | major | Initial draft |
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ G4 progress: M2.1 added the structural half in `crates/syntax`: tree-sitter PHP
|
|||
|
||||
G11 progress: M1.7 added the crash-recovery journal: unsaved buffers are written atomically about 1 s after the last edit and offered back after a crash; corrupt entries are skipped with a warning. Covered by a property test (random edits, crash, restore equals the buffer) and a headless control-channel test; not yet checked by killing the running app (gaming mode). Open: journal writes run under the engine lock (8.5 ms for 1 MiB, release), two instances on one project share a journal, local history.
|
||||
|
||||
G11 progress (H6): development and live-check instances no longer share the user's data. `--data-dir PATH` / `LUTRA_DATA_DIR` move settings, the recovery journal, the rendezvous file and the WebView2 user data (local storage) into one directory; `--control PORT` without either uses `<temp>/lutra-control/<port>/`. The Phpactor cache stays shared from the user's data directory. An isolated instance never forwards to or registers as the user's main instance. A unit test drives an isolated `--control` engine through the control channel (`settings.set`, journal write) and checks the user directory is byte-for-byte unchanged.
|
||||
|
||||
G14 progress: M1.11 moved every UI string in `ui/src` into the English catalog `ui/src/i18n/en.json` behind `t(key, params?)`, enforced by `vue/no-bare-strings-in-template` and a catalog test. Messages the engine sends (`EngineError.message`, the slogan from `app.about`) are still English text; they need message keys with params before a second language can cover them.
|
||||
|
||||
G5 progress: M2.3 landed the find-in-files backend: `crates/search` (parallel walk with the project's ignore rules, literal or regex, case, whole word, globs, binary and size skips, match cap, cancel) and the engine commands `search.find` / `search.cancel` with streamed `searchResults` and `searchDone` events; dirty buffers are searched in their buffer text. First result on a generated 20k-file tree 10–43 ms (release, measured). M2.4 added the Find tool window in a new bottom panel (options, globs, grouped and highlighted results, counts, cancel, truncated hint, keyboard navigation, `editor.reveal`, `find.open` `Mod+Alt+F` with prefill). M2.5 added the first symbol index (`crates/index`: every project file, PHP declarations from tree-sitter outlines, vendor as library, parallel build off the engine lock, incremental on disk and buffer changes, cancelled on project close) and the commands `index.status`, `goto.file`, `goto.class`, `goto.symbol` with `indexProgress`/`indexReady` events; a generated 20k-file project (88 MB of PHP) indexes in 3.9–4.2 s (release, measured, target 5 s), queries take 2–12 ms. M2.6 added the go-to popup (Files / Classes / Symbols tabs, `Mod+P`, `Mod+Alt+C`, `Mod+T`, live fuzzy results with marked characters, library rows labelled, indexing hint, `editor.reveal`). Open in G5: replace in files, scopes and history, go-to extras (recent files on an empty query, a non-project toggle, `:line`, file-type filter), an index that survives restarts, changes in directories the non-recursive watcher does not watch, usages.
|
||||
|
|
@ -50,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 | G11 note: isolated data directory for dev and live-check instances (H6) |
|
||||
| 2026-10-22 | minor | G6 shrunk: definition, references, rename (M3.5) |
|
||||
| 2026-10-22 | minor | G6 shrunk: completion, hover and signature help (M3.4) |
|
||||
| 2026-10-21 | minor | G6 shrunk: engine wiring and diagnostics (M3.3) |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue