M3.1: PHP detection and pinned Phpactor download

- 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>
This commit is contained in:
danny 2026-10-18 11:25:20 +02:00
parent 78709dd76b
commit 50f36cce8b
23 changed files with 2577 additions and 10 deletions

View file

@ -81,6 +81,10 @@
"notification.settings.unavailable": "Settings cannot be loaded ({error}). The defaults are used and changes are not saved.",
"notification.stack.label": "Notifications",
"notification.stack.more": "+{count} more",
"notification.toolchain.downloadDone": "Phpactor {version} is ready, downloaded and verified in {seconds} s.",
"notification.toolchain.downloadFailed": "Phpactor {version} could not be downloaded: {reason}",
"notification.toolchain.downloadStarted": "Downloading Phpactor {version} from GitHub for PHP language features…",
"notification.toolchain.phpMissing": "PHP language features need PHP {min} or newer: {reason}. Install PHP or set the PHP executable in Settings.",
"notification.vfs.pumpFailed": "Applying changes on disk failed: {reason}",
"notification.watch.failed": "Lutra stopped watching the project for changes on disk: {reason}",
"palette.label": "Command palette",
@ -115,8 +119,15 @@
"settings.editor.fontSize.label": "Editor font size",
"settings.error.int": "Enter a whole number",
"settings.error.intRange": "Enter a whole number from {min} to {max}",
"settings.php.executable.description": "Path to the PHP executable (8.2 or newer) that runs Phpactor. Leave empty to use php from PATH.",
"settings.php.executable.label": "PHP executable",
"settings.phpactor.autoDownload.description": "When a PHP project opens and Phpactor is missing, download the pinned Phpactor release from GitHub and check its SHA-256. This is the only network access Lutra makes.",
"settings.phpactor.autoDownload.label": "Download Phpactor automatically",
"settings.phpactor.path.description": "Path to your own phpactor.phar. Leave empty to use the pinned, verified Phpactor that Lutra downloads.",
"settings.phpactor.path.label": "Phpactor PHAR",
"settings.section.appearance": "Appearance",
"settings.section.editor": "Editor",
"settings.section.php": "PHP",
"settings.ui.language.description": "Language of the interface. More languages follow.",
"settings.ui.language.label": "Language",
"settings.ui.language.value.en": "English",

View file

@ -57,6 +57,10 @@ const RUNTIME_KEYS = new Set([
"notification.settings.corrupt",
"notification.settings.corruptNotMoved",
"notification.settings.unavailable",
"notification.toolchain.downloadDone",
"notification.toolchain.downloadFailed",
"notification.toolchain.downloadStarted",
"notification.toolchain.phpMissing",
"notification.vfs.pumpFailed",
"notification.watch.failed",
"settings.appearance.theme.description",
@ -66,8 +70,15 @@ const RUNTIME_KEYS = new Set([
"settings.appearance.theme.value.system",
"settings.editor.fontSize.description",
"settings.editor.fontSize.label",
"settings.php.executable.description",
"settings.php.executable.label",
"settings.phpactor.autoDownload.description",
"settings.phpactor.autoDownload.label",
"settings.phpactor.path.description",
"settings.phpactor.path.label",
"settings.section.appearance",
"settings.section.editor",
"settings.section.php",
"settings.ui.language.description",
"settings.ui.language.label",
"settings.ui.language.value.en",