F3: suspended Phpactor start, ConPTY shell in a job, cancel superseded completions, syntax proptest

- lutra_proc::spawn_suspended: CREATE_SUSPENDED, join the kill-on-close
  job, resume via a Tool Help thread snapshot. Opt-in for long-lived
  children (Phpactor); git, php -l and the probe keep spawn because the
  snapshot costs ~60 ms per start.
- lutra_proc::adopt + Guard (Windows): the terminal's ConPTY shell joins a
  job, so processes it started end with the tab or with Lutra.
- lsp.completion cancels the previous pending completion on the same
  server ($/cancelRequest); the cancelled command resolves empty.
- Syntax proptests compare leaf kinds, outline and folding instead of the
  S-expression (tree-sitter-php 0.25.1 keeps a union_type wrapper after
  an undo); Malte's seed added.
- docs/development.md: data dirs, target dir inside the repo, parallel
  builds, deleting ui/node_modules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-10-27 17:28:54 +01:00
parent 7ad3005217
commit ebbc89832c
17 changed files with 468 additions and 36 deletions

View file

@ -1,6 +1,6 @@
# Development
> **Status:** draft · **Last updated:** 2026-10-14
> **Status:** draft · **Last updated:** 2026-10-27
## Prerequisites
@ -18,7 +18,31 @@ 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.
## Data directories
A `--control PORT` instance keeps its settings, recovery journal and webview data in `<temp>/lutra-control/<port>/`, never in your own data directory, so a dev or agent instance cannot change your settings or restore your journal. `--data-dir DIR` or `LUTRA_DATA_DIR=DIR` pick another directory, for any instance:
```sh
cargo run -p lutra-desktop -- --control 7979 --data-dir target/lutra-data .
```
Delete the folder to start fresh.
## Build directories and parallel work
- Keep `CARGO_TARGET_DIR` inside the repository folder: the default `target/`, or `<worktree>/target` per git worktree (`/target/` is gitignored). Antivirus exclusions usually cover the checkout. On Windows, unsigned binaries built outside an excluded folder have taken about 26 s to start each child process (Phpactor, git, the test helpers) against 28 ms inside, which makes tests time out.
- Several builds in parallel (agents, worktrees): give each its own `CARGO_TARGET_DIR` and limit the jobs, e.g. `CARGO_BUILD_JOBS=4`. Delete a worktree's target directory once its work is merged; a full build takes about 10 GB.
## Deleting `ui/node_modules`
pnpm hardlinks packages from its shared store. Deleting `ui/node_modules` with Git Bash `rm -rf` on Windows breaks those links for other checkouts and makes their running Vitest fail with `EBUSY`. Delete it with either of:
```sh
cmd //c "rmdir /s /q ui\node_modules"
node -e "require('fs').rmSync('ui/node_modules',{recursive:true,force:true})"
```
Then run `pnpm --dir ui install` again.
## Robustness: Lutra never crashes
@ -32,6 +56,7 @@ No inline comments. Doc comment blocks above modules, functions, types and field
| Date | Change | Summary |
|---|---|---|
| 2026-10-27 | minor | F3: data directories, build directories inside the repository, parallel builds, deleting `ui/node_modules` |
| 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 |