dsh-plugin-wsl-env 0.21.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/CHANGELOG.md +119 -0
  2. package/CONTRIBUTING.md +7 -3
  3. package/README.md +11 -9
  4. package/SUPPORT.md +1 -1
  5. package/client.js +153 -33
  6. package/cordis.patch.yml +13 -4
  7. package/docs/AGENT-PROTOCOL-V7.md +4 -4
  8. package/docs/API.md +12 -2
  9. package/docs/ARCHITECTURE.md +59 -19
  10. package/docs/CONFIGURATION.md +44 -13
  11. package/docs/CONFIGURATION.zh.md +44 -8
  12. package/docs/DIAGNOSTICS.md +41 -1
  13. package/docs/DIAGNOSTICS.zh.md +34 -2
  14. package/docs/LIMITATIONS.md +42 -17
  15. package/docs/LIMITATIONS.zh.md +47 -12
  16. package/docs/MIGRATION.md +1 -1
  17. package/docs/PEER-PARITY.md +8 -7
  18. package/docs/QUICKSTART.md +16 -8
  19. package/docs/QUICKSTART.zh.md +22 -4
  20. package/docs/README.zh.md +19 -10
  21. package/docs/RELEASING.md +8 -3
  22. package/docs/REQUIREMENTS.zh.md +11 -6
  23. package/docs/ROADMAP-1.0.md +12 -11
  24. package/docs/ROADMAP.md +10 -8
  25. package/docs/UPSTREAM-FILE-REFERENCE-SEAM.md +3 -2
  26. package/docs/UPSTREAM-FSIO-EXPORT.md +8 -9
  27. package/docs/UPSTREAM-SERVICE-SWAP.md +9 -5
  28. package/docs/UPSTREAM-TERMINAL-TITLE.md +9 -8
  29. package/docs/VALUE.zh.md +5 -5
  30. package/docs/root-fs-routing.md +26 -19
  31. package/lib/agent-confined.d.ts +2 -2
  32. package/lib/agent-confined.js +0 -1
  33. package/lib/agent-exec.d.ts +2 -11
  34. package/lib/agent-protocol.d.ts +6 -5
  35. package/lib/agent.d.ts +5 -5
  36. package/lib/auto-preset.d.ts +4 -3
  37. package/lib/bwrap.d.ts +2 -1
  38. package/lib/client-host.d.ts +1 -1
  39. package/lib/client-host.js +1 -1
  40. package/lib/cwd-prompt-tool.d.ts +4 -20
  41. package/lib/cwd-prompt.d.ts +11 -10
  42. package/lib/distro-route.d.ts +3 -2
  43. package/lib/doctor-live.d.ts +2 -1
  44. package/lib/fs-routing.d.ts +29 -1
  45. package/lib/fs-routing.js +30 -3
  46. package/lib/fs-substrate.d.ts +0 -1
  47. package/lib/fs-substrate.js +0 -1
  48. package/lib/fsio-agent.d.ts +3 -21
  49. package/lib/fsio-agent.js +2 -4
  50. package/lib/git-exec.d.ts +3 -2
  51. package/lib/git-route.d.ts +4 -2
  52. package/lib/git-route.js +4 -2
  53. package/lib/index.d.ts +20 -10
  54. package/lib/index.js +128 -12
  55. package/lib/listing.d.ts +2 -1
  56. package/lib/messages.d.ts +82 -1
  57. package/lib/messages.js +94 -1
  58. package/lib/native-agent.d.ts +3 -2
  59. package/lib/paths.d.ts +2 -1
  60. package/lib/picker.d.ts +1 -14
  61. package/lib/picker.js +1 -2
  62. package/lib/preflight.d.ts +5 -4
  63. package/lib/probe-cache.d.ts +2 -1
  64. package/lib/sandbox-core.d.ts +2 -11
  65. package/lib/sandbox-core.js +1 -1
  66. package/lib/sandbox.d.ts +0 -1
  67. package/lib/sandbox.js +0 -4
  68. package/lib/search-exec.d.ts +2 -1
  69. package/lib/session-runtime.d.ts +3 -2
  70. package/lib/shell-env.d.ts +3 -2
  71. package/lib/shell.d.ts +1 -1
  72. package/lib/shell.js +1 -1
  73. package/lib/subprocess.d.ts +1 -1
  74. package/lib/update-check.d.ts +3 -3
  75. package/lib/wsl-doctor-command.d.ts +133 -0
  76. package/lib/wsl-doctor-command.js +381 -0
  77. package/lib/wsl-doctor-tool.d.ts +101 -16
  78. package/lib/wsl-doctor-tool.js +290 -22
  79. package/lib/wsl.d.ts +3 -2
  80. package/locale/doctor/en.json +30 -0
  81. package/locale/doctor/zh.json +30 -0
  82. package/package.json +29 -31
  83. package/scripts/bootstrap-import.sh +189 -0
  84. package/scripts/doctor.mjs +569 -141
  85. package/scripts/open-wsl-vscode.ps1 +36 -0
  86. package/examples/preset-wsl-session-sandbox.cordis.patch.yml +0 -178
@@ -11,8 +11,9 @@ DSH exposes its capabilities as services. The model-facing tools (`bash`, `read`
11
11
  `write`, `edit`, `glob`, `grep`) consume those services. They never touch a
12
12
  filesystem or a shell directly.
13
13
 
14
- This plugin supplies WSL-backed implementations of three of them, takes over two
15
- root-plane services, and adds three smaller integrations.
14
+ This plugin supplies WSL-backed implementations of three of them, replaces three
15
+ app-level rows (`subprocess`, `fs-sandbox`, `directory-picker`), and adds the
16
+ smaller integrations listed below.
16
17
 
17
18
  ## The three service providers
18
19
 
@@ -28,9 +29,9 @@ overridden.
28
29
 
29
30
  ## The root-plane filesystem takeover
30
31
 
31
- One of the shipped services is session-less — the root `ctx.fs` — so it cannot
32
- be served from an agent preset. The layer replaces its shipped row outright with
33
- a subclass that routes by coordinate:
32
+ The root `ctx.fs` is session-less, so it cannot be served from an agent preset.
33
+ The layer replaces its shipped row outright with a subclass that routes by
34
+ coordinate:
34
35
 
35
36
  | Service | Class | File | What it does |
36
37
  |---|---|---|---|
@@ -60,13 +61,20 @@ into `cordis.patch.yml` — the seam it consumes is an upstream proposal
60
61
  reaching the funnels without it would mean subclassing past module-internal
61
62
  functions.
62
63
 
63
- ## The three smaller integrations
64
+ ## The smaller integrations
64
65
 
65
66
  | Subpath | Class or name | File | What it does |
66
67
  |---|---|---|---|
67
68
  | `dsh-plugin-wsl-env/picker` | `WslDirectoryPicker` | [`lib/picker.js`](../lib/picker.js) | Adds the installed distros to the folder picker, next to the Windows home directory, and lists distro levels from inside the distro (the resident's `find`, one-shot `wsl.exe` when it is out). |
68
69
  | `dsh-plugin-wsl-env/auto-preset` | `auto-preset` | [`lib/auto-preset.js`](../lib/auto-preset.js) | Binds the `wsl` agent preset when a new session's workspace is inside a distro. |
69
70
  | `dsh-plugin-wsl-env/shell-env` | `wsl-shell-env` | [`lib/shell-env.js`](../lib/shell-env.js) | Contributes `DSH_WSL_DISTRO`, `DSH_WSL_SHELL`, `DSH_WSL_HOME` and `DSH_WSL_PORTS` to the managed `DSH_*` namespace, choosing the session workspace's distro (default/pinned facts are probed at mount; other distros are warmed when their session appears). The port list is a snapshot per active distro, refreshed every `portsRefreshMs` (10000 by default), so a server started moments ago may not be listed yet. |
71
+ | `dsh-plugin-wsl-env/preflight` | `wsl-preflight` | [`lib/preflight.js`](../lib/preflight.js) | Runs the environment advisory at session start — and, with `startup: true` (the default), once at plugin load — surfacing the doctor-style verdict as a non-gating warning. |
72
+ | `dsh-plugin-wsl-env/update-check` | `wsl-update-check` | [`lib/update-check.js`](../lib/update-check.js) | Asks the app's plugin manager about a newer stable release about once a day and carries the fact in `DSH_WSL_PLUGIN_UPDATE`; never fetches on its own. |
73
+ | `dsh-plugin-wsl-env/cwd-prompt` | `wsl-cwd-prompt` | [`lib/cwd-prompt.js`](../lib/cwd-prompt.js) | Rewrites the runtime context's working-directory entry to the distro's POSIX form. |
74
+ | `dsh-plugin-wsl-env/cwd-prompt-tool` | `wsl-cwd-prompt-tool` | [`lib/cwd-prompt-tool.js`](../lib/cwd-prompt-tool.js) | Serves the model's read/`cd` tool with the same semantics the harness ships, rewriting the returned `cwd` to the distro's POSIX form. |
75
+ | `dsh-plugin-wsl-env/wsl-doctor-tool` | `wsl-doctor-tool` | [`lib/wsl-doctor-tool.js`](../lib/wsl-doctor-tool.js) | The `wsl_doctor` model tool: the doctor in-process (merging the live resident's state), scoped by `depth`/`section`, rendered as the itemized digest. |
76
+ | `dsh-plugin-wsl-env/wsl-doctor-command` | `wsl-doctor-command` | [`lib/wsl-doctor-command.js`](../lib/wsl-doctor-command.js) | The `/wsl-doctor` UI command: spawns the standalone doctor CLI as a host subprocess and renders the same digest detached from model history. |
77
+ | `dsh-plugin-wsl-env` (bare name) | `wsl-env-client-host` | [`lib/client-host.js`](../lib/client-host.js) | The deliberate no-op host half whose bare-name mount lets the web client roster serve the composer button (`./client`). |
70
78
 
71
79
  Three modules support them and import no DSH package.
72
80
  [`lib/paths.js`](../lib/paths.js) translates paths.
@@ -89,7 +97,8 @@ The environment is per session, not per process:
89
97
  | `subprocess-wsl` | at the app level, called the composition; the shipped `subprocess` row is disabled | because no session identity reaches the terminal controller, see below |
90
98
  | `workspace-files` | shipped, not replaced | its client half is the browser `file` resource provider the Sidebar previews need; it reads WSL paths through the routed root filesystem |
91
99
  | `fs-routing` | at the app level; the shipped `fs-sandbox` row is disabled | the root `ctx.fs` is session-less, and its write fence has no root-plane consumers |
92
- | `directory-picker-wsl`, `wsl-shell-env`, `auto-preset` | at the app level | they answer questions that are not scoped to a single preset; `shell-env` resolves its facts per session workspace |
100
+ | `directory-picker-wsl`, `wsl-shell-env`, `auto-preset`, `wsl-preflight`, `wsl-update-check`, `wsl-cwd-prompt`, `wsl-cwd-prompt-tool`, `wsl-doctor-command`, `wsl-env-client-host` | at the app level | they answer questions that are not scoped to a single preset; `shell-env` resolves its facts per session workspace, and the advisory/diagnosis rows must answer even when a session never opens |
101
+ | `wsl-doctor-tool` | inside `preset-wsl` (model-facing) | the tool surface follows the preset: a session on a Windows folder keeps the shipped tools |
93
102
 
94
103
  The preset mount requires the isolate realms. Without them the registry rejects the
95
104
  providers with `Preset services require isolate realms: shell, fs`.
@@ -162,8 +171,9 @@ profile carrying the value is refused at boot, and no file tool crosses the
162
171
  `realpath` and publication uses the kernel's rename or link.
163
172
  - **Guarded writes** carry their intent to the publication: a `createIfAbsent`
164
173
  publishes with a no-replace link, closing the check-then-write window for
165
- creates outright; an overwrite or edit carries its version into the write op
166
- and the agent re-verifies it before the rename. A mismatch returns
174
+ creates outright; an overwrite, edit, patch, delete or move carries its
175
+ expected version into the operation and the agent re-verifies it before the
176
+ rename or removal (`moveFile` checks both endpoints). A mismatch returns
167
177
  `FS_STALE_VERSION`, but a change after that check can still be overwritten.
168
178
  - **Kernel enforcement** is stage two: a mutation runs on a confined resident —
169
179
  one long-lived agent per (distro, policy), whose bwrap profile binds exactly
@@ -243,12 +253,14 @@ the row keys, and `lib/sandbox-core.js` states its honest ceiling.
243
253
  with one deliberate translation: for a session inside a distro the temp root is the
244
254
  distro's own `/tmp`, and the Windows temp directory is *not* granted, because it lies
245
255
  outside the execution world the policy describes. That avoids a mismatch where `bash`
246
- could write `/tmp` but the write tool could not. The two `/tmp`s are still different
247
- directories — the command's is a fresh tmpfs — see [LIMITATIONS.md](LIMITATIONS.md). The fence is complete for the model's reach: `writeText` and `editText` are
248
- the only mutation calls the model-facing file tools make on the filesystem seam,
249
- so checking those two checks everything the model can mutate. Both providers
250
- report their mode through `sandboxMode`. The tool layer and the Permissions
251
- selector read that value.
256
+ could write `/tmp` but the write tool could not. In the per-command profile
257
+ (`sessionSandbox: false`) the two `/tmp`s are different directories — the
258
+ command's is a fresh tmpfs; the shipped session runtime shares the distro's real
259
+ `/tmp` — see [LIMITATIONS.md](LIMITATIONS.md). The provider's mutation surface is
260
+ `writeText`, `editText`, `patchText`, `deleteFile` and `moveFile`; each runs
261
+ through `checkedTarget`, so the fence covers every mutation the provider can
262
+ serve. Both providers report their mode through `sandboxMode`. The tool layer
263
+ and the Permissions selector read that value.
252
264
 
253
265
  ### Reported enforcement
254
266
 
@@ -366,13 +378,14 @@ step with the checkout, and `pnpm run sync:windows` runs that script.
366
378
  | Type check | `tsc --noEmit` over `test/**` and `types/*.d.ts` (`src/` is checked by the build itself) | no |
367
379
  | Unit tests | `test/*.test.mjs` | no |
368
380
  | Requirements matrix | [`scripts/check-requirements.mjs`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/scripts/check-requirements.mjs) | no; every cited test must exist and stay wired |
381
+ | Doc consistency | [`scripts/check-doc-consistency.mjs`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/scripts/check-doc-consistency.mjs) | no; repeated facts, doctor surface and bilingual pair completeness |
369
382
  | Sandbox probe | [`test/probe/sandbox.sh`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/test/probe/sandbox.sh) | no; it applies the profile arguments directly |
370
383
  | Harness probes | [`test/probe/run.sh`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/test/probe/run.sh), `terminal.sh`, `sandbox-shell.sh`, `interop-shell.sh`, `picker.sh`, `fs-routing.sh`, `missing-wsl.sh`, `sandbox-off.sh`, `native-session.sh` | yes: Windows, WSL2, a mounted profile, and a linked checkout |
371
384
  | Distro probes | [`test/probe/substrate.sh`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/test/probe/substrate.sh), `watch.sh`, `agent.sh`, `exec.sh`, `session-sandbox.sh`, `gui-preview.sh`, `file-reference-9p.sh` | Windows and WSL2, but no harness boot and no profile: they run from a distro terminal with Node available, reaching `wsl.exe` through interop |
372
385
  | Host probe | [`test/probe/mode.sh`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/test/probe/mode.sh) | Windows Node, no harness |
373
386
  | Probe plugins | the `*-probe.mjs` and `*-probe.yml` files in `test/probe/` (plus standalone measurers such as `gui-preview.mjs`, `native-session.mjs`, `fs-probe.mjs`, `fs-queue.mjs`) | loaded or invoked by the scripts above |
374
387
 
375
- `pnpm test` runs `lint:style`, `lint:links`, `lint:requirements`,
388
+ `pnpm test` runs `lint:style`, `lint:links`, `lint:requirements`, `lint:docs`,
376
389
  `test:syntax`, `lint:build`, `lint:types` and `test:unit`, in that order.
377
390
  [`test/probe/run-all-when-closed.sh`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/test/probe/run-all-when-closed.sh)
378
391
  waits for the app to exit and then runs the whole real-machine suite once —
@@ -432,8 +445,16 @@ src/auto-preset.ts per-session environment selection
432
445
  src/bwrap.ts the bwrap command line every confinement site
433
446
  assembles (no imports, so a bare checkout can
434
447
  assert it)
448
+ src/client-host.ts the bare-name host half — a deliberate no-op that
449
+ anchors the browser client
450
+ src/cwd-prompt.ts rewrites the runtime context's working directory
451
+ to the distro's POSIX form
452
+ src/cwd-prompt-tool.ts serves the model's read/cd tool with distro-POSIX
453
+ cwd output
435
454
  src/distro-route.ts the pure distro-mode selector (pinned / workspace /
436
455
  default) shared by shell, fs, preflight and env
456
+ src/doctor-live.ts merges the live resident's status into a collected
457
+ doctor report
437
458
  src/file-reference-wsl.ts the distro-side `@`-completion traversal — built,
438
459
  tested, not yet wired (see above)
439
460
  src/fs.ts the ctx.fs subpath entry point
@@ -444,9 +465,12 @@ src/fs-substrate.ts the agent substrate's provider-shaped operations
444
465
  src/fsio-agent.ts fsio's mechanics over the agent's FS frames
445
466
  src/fsio-text.ts the peer's pure text mechanics, replicated pending
446
467
  the upstream fsio export (UPSTREAM-FSIO-EXPORT.md)
468
+ src/git-exec.ts the agent-backed execution handle for the
469
+ git-snapshot spawn
447
470
  src/git-route.ts which git spawns belong inside the distro (pure)
448
471
  src/index.ts WslShellExecutor (ctx.shell) and WslFileSystem (ctx.fs)
449
472
  src/listing.ts pure directory listing and breadcrumb helpers
473
+ src/messages.ts the en/zh message catalogs and the host-locale wiring
450
474
  src/native-agent.ts native binary selection and preparation
451
475
  src/paths.ts pure conversion between the three path formats
452
476
  src/picker.ts WslDirectoryPicker (ctx.directoryPicker)
@@ -468,7 +492,12 @@ src/subprocess.ts WslSubprocessRuntime (ctx.subprocess), the GUI
468
492
  src/terminal-activity.ts the distro-side activity probe for idle terminal
469
493
  reclamation
470
494
  src/terminal-route.ts which execution world a terminal launch belongs to (pure)
495
+ src/update-check.ts the once-a-day update notice (fact store +
496
+ host-delegated check)
471
497
  src/watcher.ts in-distro file watching for WslFileSystem.watch
498
+ src/wsl-doctor-command.ts the `/wsl-doctor` UI command row (spawns the
499
+ standalone doctor CLI)
500
+ src/wsl-doctor-tool.ts the `wsl_doctor` model tool row (in-process diagnosis)
472
501
  src/wsl.ts wsl.exe interop primitives (no DSH imports)
473
502
  ```
474
503
 
@@ -481,7 +510,8 @@ src/wsl.ts wsl.exe interop primitives (no DSH imports)
481
510
  names the documentation a reader would have acted on that is no longer true.
482
511
  - [`REQUIREMENTS.zh.md`](REQUIREMENTS.zh.md) is the requirements register: every
483
512
  documented behaviour commitment numbered, with where it is specified and what
484
- verifies it, plus the open items (Chinese, maintainer-facing, not packaged).
513
+ verifies it, plus the open items (Chinese, maintainer-facing, shipped in the
514
+ npm package).
485
515
  - [`archive/engineering-record.zh.md`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/docs/archive/engineering-record.zh.md) is the
486
516
  full engineering record, in Chinese: measured contracts, debugging rounds, and
487
517
  the conclusions as they stood then.
@@ -489,7 +519,9 @@ src/wsl.ts wsl.exe interop primitives (no DSH imports)
489
519
  [`archive/README.en.md`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/docs/archive/README.en.md) are two English indexes of the
490
520
  same three archived files, the second so a reader who does not read Chinese can
491
521
  still tell what is there; the records themselves are Chinese.
492
- - [`README.md`](../README.md) is the only statement of current state.
522
+ - [`README.md`](../README.md) and [`docs/README.zh.md`](README.zh.md) are the
523
+ current-state statement; the Chinese README is authoritative and the English
524
+ file is its translation (see the documentation map).
493
525
 
494
526
  ## Diagnostics
495
527
 
@@ -498,4 +530,12 @@ point over everything above: it probes the Windows/WSL versions, the distro
498
530
  and its shell, bubblewrap, systemd/Linger, the peer floor, a fresh agent
499
531
  handshake and the stale session scopes, and reports the versioned
500
532
  `doctorReport` structure (`scripts/doctor.mjs`, `lib/doctor-live.js`) with a
501
- remedy per failure.
533
+ remedy per failure. The same report answers through three surfaces: this
534
+ standalone CLI (peer-free by design, so it starts when the plugin's own
535
+ runtime is broken), the `/wsl-doctor` UI command (spawns the CLI host-side,
536
+ renders detached from model history), and the `wsl_doctor` model tool
537
+ (in-process, merging the live resident's state through `lib/doctor-live.js`).
538
+ A run can be scoped (`--quick`, `--sections <csv>` on the CLI; `depth` /
539
+ `section` on the tool), and the report itemizes every check grouped by
540
+ distro. See [DIAGNOSTICS.md](DIAGNOSTICS.md) for the surfaces and the
541
+ verdict contract.
@@ -1,6 +1,6 @@
1
1
  # Configuration
2
2
 
3
- *A Chinese translation lives at [CONFIGURATION.zh](CONFIGURATION.zh.md); the English version is authoritative.*
3
+ *The Chinese version ([CONFIGURATION.zh](CONFIGURATION.zh.md)) is authoritative; this page is its English translation.*
4
4
 
5
5
  ## Profile patches
6
6
 
@@ -11,9 +11,11 @@ rows and values shipped by this plugin.
11
11
 
12
12
  A profile layer can target a top-level row by `id`. Plugin rows at that level
13
13
  include `fs-routing`, `directory-picker-wsl`, `subprocess-wsl`, `wsl-shell-env`,
14
- `wsl-preflight`, `auto-preset`, and `preset-wsl`. The `wsl-shell` and `wsl-fs`
15
- rows are nested inside `preset-wsl.config.plugins`; a profile entry targeting
16
- either id directly is ignored with a `patch: entry <id> not found` warning.
14
+ `wsl-preflight`, `auto-preset`, `wsl-cwd-prompt`, `wsl-cwd-prompt-tool`,
15
+ `wsl-update-check`, `wsl-doctor-command`, `wsl-env-client-host`, and
16
+ `preset-wsl`. The `wsl-shell`, `wsl-fs` and `wsl-doctor-tool` rows are nested
17
+ inside `preset-wsl.config.plugins`; a profile entry targeting those ids directly
18
+ is ignored with a `patch: entry <id> not found` warning.
17
19
 
18
20
  A row's `config` is replaced as a whole. Include any non-default values from
19
21
  the bundled row that you want to retain. This matters most for `preset-wsl`,
@@ -138,6 +140,7 @@ The root router is app-level, not session-owned, so it does not use
138
140
  | | `startup` | `true` | Also run the same checks once at plugin load — install + restart — against the pinned or WSL-default distro, so the verdict is in the log before any session opens. |
139
141
  | `wsl-shell-env` | `distro` | `''` | Distro used to populate the `DSH_WSL_*` environment facts. |
140
142
  | | `portsRefreshMs` | `10000` | Listening-port snapshot interval, in milliseconds. |
143
+ | `wsl-cwd-prompt` | `enabled` | `true` (shipped) | Rewrite the runtime context's working-directory entry to the distro's POSIX form. |
141
144
  | `wsl-update-check` | `enabled` | `true` | Whether the plugin checks the app's plugin manager for a newer stable release. The result is served as `DSH_WSL_PLUGIN_UPDATE`; the check never installs. |
142
145
  | | `intervalMs` | `86400000` | Check interval, in milliseconds (first check 2–10 minutes after startup); floored at one minute. |
143
146
 
@@ -313,18 +316,39 @@ command errors) follow the harness app's Language setting: the preference is
313
316
  read from the host `locale` entry's `preference` field through the host
314
317
  settings service, and a language switch takes effect without a restart.
315
318
  Chinese (`zh`, including `zh-CN` and `zh-Hans` tags) and English ship; every
316
- other language — and any profile without the settings service, or an unset
317
- preference — renders English. Commands, config keys and file paths inside a
318
- message are never translated. Three message groups stay English by design:
319
- the `FS_*` refusal texts in `fs-decisions` and the fsio replica (the tool
320
- layer matches on those strings byte-for-byte), and the standalone
321
- `scripts/doctor.mjs`, which runs outside the app.
319
+ other language renders English. A profile without the settings service, or
320
+ one whose user never picked a language, falls back to the process's ICU
321
+ default locale — the OS UI language in the desktop app — so a zh-CN Windows
322
+ with a provisional-Chinese UI still renders Chinese; an explicit Settings
323
+ choice always wins over that fallback. Commands, config keys and file paths
324
+ inside a message are never translated. Two message groups stay English by
325
+ design: the `FS_*` refusal texts in `fs-decisions` and the fsio replica (the
326
+ tool layer matches on those strings byte-for-byte). The standalone
327
+ `scripts/doctor.mjs` carries its own catalogs: its fixed skeleton renders in
328
+ the host language — detected from the Windows locale, overridable with
329
+ `--locale <tag>` or `DSH_WSL_DOCTOR_LOCALE` — while per-check titles, details
330
+ and remedies stay English (remedies carry copy-paste commands), and `--json`
331
+ stays language-independent.
322
332
 
323
333
  ## Diagnose configuration and refusals
324
334
 
325
335
  In a session the model can run the diagnosis itself: the `wsl_doctor` tool
326
336
  (mounted inside `preset-wsl`) calls the doctor in-process and returns the
327
- verdict with per-failure remedies — the user just asks for a diagnosis.
337
+ verdict as an itemized listing — every check with an explicit status marker,
338
+ grouped by distro, the copy-paste remedy under every failure — the user just
339
+ asks for a diagnosis. The tool is interactive by design: `depth: "quick"` (the
340
+ default) runs the prerequisites only (~10 s in one distro: host facts, the
341
+ session sandbox quartet, bubblewrap — no smokes, no registry query, no port
342
+ survey) and is the right first call; `section` narrows a follow-up to one area
343
+ (`host`, `sandbox`, `session`, `conf`, `net`, `agent`); `depth: "full"` is
344
+ the complete scan and answers for everything. The `/wsl-doctor` command (the
345
+ `wsl-doctor-command` row, registered when the deployment has a commands
346
+ registry) runs the same diagnosis host-side — grammar
347
+ `[quick|full|<section>] [--distro <name>]` — and renders the same digest in
348
+ the UI, detached from model history. The CLI mirrors the same
349
+ scoping: `--quick` and `--sections <csv>` bound what a run probes, and a
350
+ scoped `--json` report carries its `scope` so a verdict always names the
351
+ scope it answers for (`--fix` still requires a full run).
328
352
  `DSH_WSL_DOCTOR` additionally carries a ready-to-run command that executes
329
353
  the doctor script from inside the distro (the app's own runtime as Node,
330
354
  through interop) — run it as `sh -c "$DSH_WSL_DOCTOR --json"`. And
@@ -335,8 +359,15 @@ the peer floor, a fresh agent handshake, stale session scopes, the known
335
359
  profile-patch and deprecated-key traps — each failure with a copyable remedy.
336
360
  The run ends in a verdict (`ready` or `blocked`) computed under the effective
337
361
  configuration: `--json` is the machine contract (schemaVersion 2), `--fix`
338
- re-verifies what it fixed, `--all` checks every installed distro, `--bundle
339
- <path>` writes the attachable diagnostic file (`--redact` strips the paths).
362
+ re-verifies what it fixed (packages need `--fix --install` and an explicit
363
+ confirmation), `--all` checks every installed distro, `--bundle
364
+ <path>` writes the attachable diagnostic file (`--redact` strips the paths),
365
+ and `--locale <tag>` (or `DSH_WSL_DOCTOR_LOCALE`) selects the skeleton
366
+ language without re-probing. `--yes` skips the confirmation prompt (not the
367
+ confirmation gate itself), and `--read-only` refuses to run together with
368
+ `--fix` or `--install`. `DSH_UPDATE_REGISTRIES` overrides the
369
+ registries the on-demand update check asks (comma-separated; empty skips
370
+ it — for air-gapped machines).
340
371
  See [DIAGNOSTICS.md](DIAGNOSTICS.md) for the verdict contract and the
341
372
  error-code map. With the CLI distribution, `dsh --profile <name> --dump-config` inspects
342
373
  the composed profile without booting it and shows whether a row override
@@ -1,6 +1,6 @@
1
1
  # Configuration
2
2
 
3
- _本文是 [CONFIGURATION](CONFIGURATION.md) 的中文译本,以英文版为准。_
3
+ _本页是权威版本;英文译本见 [CONFIGURATION](CONFIGURATION.md)。_
4
4
 
5
5
  ## Profile patch
6
6
 
@@ -11,9 +11,11 @@ profile 设置存放在 `$DSH_HOME/profiles/<name>/cordis.patch.yml`。可以用
11
11
 
12
12
  profile 层可以按 `id` 指向顶层行。这一层的插件行包括 `fs-routing`、
13
13
  `directory-picker-wsl`、`subprocess-wsl`、`wsl-shell-env`、`wsl-preflight`、
14
- `auto-preset` 和 `preset-wsl`。`wsl-shell` 和 `wsl-fs`
15
- 两行嵌套在 `preset-wsl.config.plugins` 内;直接按这两个 id 配置的
16
- profile 条目会被忽略,并产生 `patch: entry <id> not found` 警告。
14
+ `auto-preset`、`wsl-cwd-prompt`、`wsl-cwd-prompt-tool`、`wsl-update-check`、
15
+ `wsl-doctor-command`、`wsl-env-client-host` 和 `preset-wsl`。
16
+ `wsl-shell`、`wsl-fs` 与 `wsl-doctor-tool` 嵌套在
17
+ `preset-wsl.config.plugins` 内;直接按这些 id 配置的 profile 条目会被忽略,
18
+ 并产生 `patch: entry <id> not found` 警告。
17
19
 
18
20
  一行的 `config` 是整体替换。如果你想保留随包行中的非默认值,
19
21
  必须把它们一并写入。这对 `preset-wsl` 尤其重要:
@@ -136,6 +138,9 @@ Loader 在挂载该行之前会校验宿主和发行版设置;
136
138
  | | `startup` | `true` | 插件加载时(即安装 + 重启后)对 pin 的或 WSL 默认发行版预先运行同一组检查,让判定在任何会话打开之前就出现在日志里。 |
137
139
  | `wsl-shell-env` | `distro` | `''` | 用于填充 `DSH_WSL_*` 环境事实的发行版。 |
138
140
  | | `portsRefreshMs` | `10000` | 监听端口快照的刷新间隔,单位毫秒。 |
141
+ | `wsl-cwd-prompt` | `enabled` | `true`(shipped) | 把 runtime context 的工作目录条目改写为发行版的 POSIX 形式。 |
142
+ | `wsl-update-check` | `enabled` | `true` | 插件是否向应用的插件管理器查询更新的稳定版。结果经 `DSH_WSL_PLUGIN_UPDATE` 送达;该检查从不安装。 |
143
+ | | `intervalMs` | `86400000` | 检查间隔,单位毫秒(启动后 2–10 分钟首查);下限一分钟。 |
139
144
 
140
145
  GUI 文件树和预览通过 `fs-routing` 使用随包的 `workspace-files` 行;
141
146
  它们不使用单独的 WSL 提供者行。要修改其 peer 定义的限额,
@@ -295,14 +300,45 @@ profile 不使用会话 runtime 时,设置 `sessionSandbox: false`。
295
300
  插件的拒绝与修复消息(`sessionSandbox` 预检判定、`bwrap` 的安装与修复提示、
296
301
  发行版/工作目录命令错误)跟随 harness 应用的语言设置:偏好经宿主 settings
297
302
  服务从 `locale` 条目的 `preference` 字段读取,切换语言无需重启应用。
298
- 内置中文(`zh`,含 `zh-CN`、`zh-Hans` 标签)与英文;其他语言——以及
299
- 没有 settings 服务的 profile 或未设置偏好的情况——渲染英文。消息内的
300
- 命令、配置键与文件路径一律不翻译。三组消息按设计保持英文:
303
+ 内置中文(`zh`,含 `zh-CN`、`zh-Hans` 标签)与英文;其他语言渲染英文。
304
+ 没有 settings 服务的 profile、或用户从未在设置中选过语言的情况,回退到
305
+ 进程的 ICU 默认区域设置——桌面应用中即操作系统 UI 语言——因此临时渲染为
306
+ 中文界面的 zh-CN Windows 仍显示中文;显式的设置选择始终优先于该回退。
307
+ 消息内的命令、配置键与文件路径一律不翻译。两组消息按设计保持英文:
301
308
  `fs-decisions` 中的 `FS_*` 拒绝文本与 fsio 复刻(工具层按字节匹配这些
302
- 字符串),以及独立运行的 `scripts/doctor.mjs`(它在应用之外执行)。
309
+ 字符串)。独立运行的 `scripts/doctor.mjs` 自带 catalog:固定骨架按宿主
310
+ 语言渲染——从 Windows 区域设置检测,可用 `--locale <标签>` 或
311
+ `DSH_WSL_DOCTOR_LOCALE` 覆盖——而逐项检查的标题、详情与修复保持英文
312
+ (修复文本携带可复制的命令),`--json` 保持语言无关。
303
313
 
304
314
  ## 诊断配置问题与拒绝
305
315
 
316
+ 在会话中模型可以自行运行诊断:`wsl_doctor` 工具(挂载在 `preset-wsl` 内)
317
+ 进程内调用 doctor,以逐项清单返回判定——每个检查带显式状态标记、按 distro
318
+ 分组、失败项下附可复制的修复——用户只要请求诊断即可。该工具按设计是交互式
319
+ 的:`depth: "quick"`(默认)只跑前置项(单 distro 约 10 秒:宿主事实、会话
320
+ 沙箱四件套、bubblewrap——无冒烟、无 registry 查询、无端口勘察),是正确的
321
+ 首次调用;`section` 把跟进收窄到一个区域(`host`、`sandbox`、`session`、
322
+ `conf`、`net`、`agent`);`depth: "full"` 是完整扫描,对所有检查负责。
323
+ `/wsl-doctor` 命令(`wsl-doctor-command` 行,部署具有命令注册表时注册)在
324
+ 宿主侧运行同样的诊断——语法 `[quick|full|<分区>] [--distro <名称>]`——并把
325
+ 同样的清单渲染在 UI 上,不进模型历史。CLI 镜像同样的范围控制:`--quick` 与
326
+ `--sections <csv>` 限定一次运行探测什么,范围化的 `--json` 报告携带其
327
+ `scope`,裁决总是指明它回答的范围(`--fix` 仍要求完整运行)。
328
+ `DSH_WSL_DOCTOR` 还携带一条现成命令,可在发行版内执行 doctor 脚本(以应用
329
+ 自身的运行时当 Node、经 interop)——运行方式为 `sh -c "$DSH_WSL_DOCTOR --json"`。
330
+ `pnpm run doctor` 是一键环境体检:Windows/WSL 版本、每个发行版的 WSL 模式、
331
+ `.wslconfig` 与 `/etc/wsl.conf` 交叉核对、磁盘、时钟、DNS、发行版及其 shell、
332
+ bubblewrap、systemd/Linger、peer 下限、新 agent 握手、残留会话 scope、已知的
333
+ profile 补丁与废弃键陷阱——每个失败附可复制的修复。运行以生效配置下计算的
334
+ 裁决(`ready` 或 `blocked`)收尾:`--json` 是机器契约(schemaVersion 2),
335
+ `--fix` 复核它修过的项(安装软件包需要 `--fix --install` 并显式确认),
336
+ `--all` 检查每个已装发行版,`--bundle <路径>` 写出可附加的诊断文件
337
+ (`--redact` 脱敏路径),`--locale <标签>`(或 `DSH_WSL_DOCTOR_LOCALE`)
338
+ 无需重新探测即可选择骨架语言。`--yes` 跳过确认提示(不跳过确认门本身),
339
+ `--read-only` 拒绝与 `--fix` 或 `--install` 同用。按需的 registry 更新
340
+ 查询可用 `DSH_UPDATE_REGISTRIES` 覆盖(逗号分隔;置空即跳过,气隙机器适用)。
341
+ 判定契约与错误码地图见 [DIAGNOSTICS.zh.md](DIAGNOSTICS.zh.md)。
306
342
  CLI 发行版可用 `dsh --profile <name> --dump-config` 检查合成后的 profile,
307
343
  无需真正启动;输出会显示某行的覆盖是否生效。桌面应用没有 `dsh` 命令,
308
344
  请直接查看 `cordis.patch.yml` 与 Plugins 页面。
@@ -24,7 +24,12 @@ distro(s) under the expected scope; the smoke legs (`functional.exec`,
24
24
  `functional.sandbox`, `functional.fs`) prove the chain itself — frame I/O,
25
25
  the confined fence, the batched substrate — not just the prerequisites.
26
26
  A leg whose prerequisite failed reports `skipped` with the blocker named;
27
- `skipped` never blocks.
27
+ `skipped` never blocks. A read the transport could not vouch for — `wsl.exe`
28
+ timed out or wedged mid-probe, common when several distros are probed
29
+ concurrently and one of them is cold-booting — reports `unknown` after one
30
+ automatic retry, names the flake in its detail, and never blocks or feeds a
31
+ config verdict: a flaked read of `/etc/wsl.conf` says the read failed, never
32
+ that the file is broken. Rerun the doctor for a clean answer.
28
33
 
29
34
  `--fix` ends in a re-verified report: every fix is followed by a fresh probe
30
35
  of what it claims to have fixed, the affected checks carry the after state,
@@ -38,6 +43,41 @@ configuration) for a setup report; `--redact` replaces home and DSH paths
38
43
  with `<redacted-*>` placeholders. The bundle contains no file contents, no
39
44
  environment variables, and no telemetry.
40
45
 
46
+ ## The surfaces
47
+
48
+ The doctor answers through three surfaces with one report:
49
+
50
+ - **The standalone CLI** — `node scripts/doctor.mjs [distro] [--all] [--json] [--quick] [--sections host,sandbox,session,conf,net,agent] [--fix] [--install] [--yes] [--read-only] [--bundle <path>] [--redact] [--locale <tag>]`
51
+ (the same line `--help` prints).
52
+ The authoritative surface: it loads **no peer dependency and no host
53
+ service**, so it still starts when the plugin's own runtime is the thing
54
+ that is broken. Only pure, peer-free `lib/` modules are imported; the two
55
+ helpers that used to live behind peer-tainted modules (`lib/index.js`,
56
+ `lib/update-check.js`) are inlined and drift-pinned against the lib exports
57
+ by `test/doctor.test.mjs`. Exit 0 = `ready`, 1 = `blocked`, 2 = refused
58
+ (`--read-only` with `--fix`/`--install`, or `--fix` on a scoped run).
59
+ - **The `/wsl-doctor` UI command** — the composer button drops a
60
+ `/wsl-doctor [quick|full|<section>] [--distro <name>]` line; the commands
61
+ registry executes it host-side, the handler spawns the standalone CLI, and
62
+ the itemized report renders detached from model history (no model turn, no
63
+ tokens). Without a command adapter (headless, ACP) the row is a no-op and
64
+ the CLI is the surface. Without `--distro` the handler names the distro from
65
+ the session's live working directory (the agent-scoped `workingDirectory`
66
+ service first, then the Session header's `cwd`); when neither yields a WSL
67
+ UNC path the CLI's effective configuration decides, and the shipped `auto`
68
+ probes **every** installed distro — a sweep that costs minutes on a machine
69
+ with several (a scoped quick run is seconds). The handler therefore bounds
70
+ the subprocess (120 s when it has a distro, 60 s when the configuration has
71
+ to choose, both below the command dispatcher's own deadline) so a stalled or
72
+ unscoped run settles with a message naming the target it examined and how to
73
+ narrow it.
74
+ - **The `wsl_doctor` model tool** — in-process via `doctorReport()`, so the
75
+ live resident's state merges in. The collection is asynchronous: the doctor
76
+ subprocess never blocks the Host, the tool call's cancellation kills it, and
77
+ a two-minute deadline plus a bounded drain window settle a run whose child
78
+ never reports. This is the only surface that depends on the model path; use
79
+ the command or the CLI when the plugin's runtime itself is under suspicion.
80
+
41
81
  ## The map
42
82
 
43
83
  Class legend:
@@ -19,17 +19,49 @@
19
19
  `verdict: ready` 表示首条命令应在目标 distro、预期 scope 下成功;smoke 腿
20
20
  (`functional.exec`、`functional.sandbox`、`functional.fs`)证明链路本身——
21
21
  帧 I/O、受限围栏、批量 substrate——而不只是前置条件。前置失败的腿以
22
- `skipped` 报告并点名阻断者;`skipped` 永不阻断。
22
+ `skipped` 报告并点名阻断者;`skipped` 永不阻断。传输层无法担保的读数——
23
+ `wsl.exe` 超时或探测中途卡死(多个 distro 并发探测、其中一个正在冷启动时
24
+ 最常见)——在自动重试一次后报告 `unknown`,detail 点名该次抖动;`unknown`
25
+ 永不阻断,也不构成配置裁决:`/etc/wsl.conf` 读数抖动说明的是读取失败,
26
+ 而不是文件损坏。重跑 doctor 即可得到干净答案。
23
27
 
24
28
  `--fix` 以复验报告收尾:每个修复后都跟着一次对它声称修好的东西的全新探查,
25
29
  受影响的检查项携带 after 状态,verdict 重算——`ready`,或剩余阻断者。
26
30
  会改写用户或 distro 所有文件的修复(`.wslconfig`、`/etc/wsl.conf`、WSL1
27
- 转换、安装 distro)永不开户自动化;remedy 文本会写明。
31
+ 转换、安装 distro)永不开启自动化;补救文本会写明。
28
32
 
29
33
  `--bundle <path>` 写出本地 JSON 文件(报告 + 版本 + 生效配置)供 setup
30
34
  report 附带;`--redact` 把 home 与 DSH 路径替换为 `<redacted-*>` 占位符。
31
35
  bundle 不含文件内容、环境变量,也没有遥测。
32
36
 
37
+ ## 三个入口
38
+
39
+ doctor 通过三个入口给出同一份报告:
40
+
41
+ - **独立 CLI**——`node scripts/doctor.mjs [distro] [--all] [--json] [--quick] [--sections host,sandbox,session,conf,net,agent] [--fix] [--install] [--yes] [--read-only] [--bundle <路径>] [--redact] [--locale <标签>]`
42
+ (与 `--help` 输出同一行)。
43
+ 这是权威入口:它**不加载任何 peer 依赖、任何宿主服务**,即使插件的运行时
44
+ 本身就是故障源,它也能启动。只 import 纯净、无 peer 的 `lib/` 模块;原先
45
+ 挂在 peer 污染模块(`lib/index.js`、`lib/update-check.js`)后面的两个
46
+ helper 已内联,并由 `test/doctor.test.mjs` 与 lib 导出对拍防漂移。
47
+ 退出码 0 = `ready`,1 = `blocked`,2 = 拒绝(`--read-only` 与
48
+ `--fix`/`--install` 同用,或对范围化运行使用 `--fix`)。
49
+ - **`/wsl-doctor` UI 命令**——composer 按钮投下
50
+ `/wsl-doctor [quick|full|<分区>] [--distro <名称>]`;命令面在宿主侧执行,
51
+ handler 子进程运行独立 CLI,逐项报告直接渲染在 UI 上、不进模型历史
52
+ (无模型回合、零 token)。没有命令适配器的部署(headless、ACP)中该行是
53
+ no-op,CLI 就是入口。未给 `--distro` 时,handler 从会话当前工作目录解析
54
+ 发行版(先读 agent 作用域的 `workingDirectory` 服务,再退回 Session 头部
55
+ 记录的 `cwd`);两者都给不出 WSL UNC 路径时,由 CLI 的生效配置决定,而
56
+ 随包预设的 `auto` 会逐个检查**所有**已安装发行版——多发行版机器上是数分钟
57
+ 的开销(收窄到单个发行版的 quick 运行只需数秒)。因此 handler 给子进程设了
58
+ 时限(解析出发行版时 120 秒、交给配置决定时 60 秒,均低于命令面自身的
59
+ 截止时间),停摆或未收窄的运行会给出消息,说明本次检查的目标与如何收窄。
60
+ - **`wsl_doctor` 模型工具**——经 `doctorReport()` 进程内采集,会合并常驻
61
+ agent 的实时状态。采集是异步的:doctor 子进程不再阻塞宿主,工具调用的取消
62
+ 会杀掉它,而两分钟时限加上有界的管道排空窗口,能让子进程不再报告时也有
63
+ 结论。这是唯一依赖模型链路的入口;怀疑插件运行时本身时,用命令或 CLI。
64
+
33
65
  ## 地图
34
66
 
35
67
  类别图例:
@@ -1,6 +1,6 @@
1
1
  # Limitations
2
2
 
3
- *A Chinese translation lives at [LIMITATIONS.zh](LIMITATIONS.zh.md); the English version is authoritative.*
3
+ *The Chinese version ([LIMITATIONS.zh](LIMITATIONS.zh.md)) is authoritative; this page is its English translation.*
4
4
 
5
5
  What the plugin does not do, and why. A limitation that is documented is a design
6
6
  boundary; one that is not is a bug report waiting to happen. Each entry states the
@@ -17,8 +17,8 @@ operations never use the 9p share.
17
17
  bits; `chmod` when a new file must be executable.
18
18
  - **When the agent is out, file operations fail closed** — `FS_IO_ERROR` naming the
19
19
  substrate, with the recovery path. One crash rides a single rebuild; a spent
20
- rebuild enters bounded revival (2/4/8 s); three deaths are permanent until the app
21
- restarts. There is no fallback I/O — deliberately.
20
+ rebuild enters bounded revival (2/4/8 s) for three attempts; the fourth death
21
+ is permanent until the app restarts. There is no fallback I/O — deliberately.
22
22
  - **The mutation guard is not atomic compare-and-swap.** Creates use a no-replace
23
23
  link; overwrites re-verify the version before the rename. A mismatch returns
24
24
  `FS_STALE_VERSION`, but a change between check and rename can still be overwritten.
@@ -82,8 +82,9 @@ operations never use the 9p share.
82
82
  packaged binary; `native` refuses on preparation failure; `shell` forces the shell
83
83
  agent.
84
84
  - **The session runtime needs systemd and a lingering user manager** — refused on the
85
- first command with the remedy otherwise; `sessionSandbox: false` keeps the old
86
- per-command shape. A hard app crash can leave a stale `dsh-wsl-*.scope`; the
85
+ first command with the remedy otherwise; `sessionSandbox` set to `auto`
86
+ (per-command without systemd) or `false` keeps the old per-command shape.
87
+ A hard app crash can leave a stale `dsh-wsl-*.scope`; the
87
88
  preflight sweeps stale scopes on the next WSL session (never another live
88
89
  session's).
89
90
  - **The sandbox does not govern WSL interop** — reported as `enforcement: partial`.
@@ -98,10 +99,12 @@ operations never use the 9p share.
98
99
  remedies and distro/workdir errors follow the app's Language setting
99
100
  ([CONFIGURATION.md](CONFIGURATION.md#message-language)); the `FS_*` refusal texts
100
101
  in `fs-decisions` and the fsio replica stay byte-identical English because the
101
- tool layer matches on those strings, and the standalone `scripts/doctor.mjs`
102
- always prints English because it runs outside the app and cannot read the
103
- host's locale preference. A remedy composed at probe time keeps the language
104
- the probe ran in until that probe runs again.
102
+ tool layer matches on those strings. The standalone `scripts/doctor.mjs`
103
+ localizes only its fixed skeleton — verdict, marks, summary, hints — through
104
+ its own catalogs, detected from the Windows locale (`--locale <tag>` /
105
+ `DSH_WSL_DOCTOR_LOCALE` override); per-check titles, details and remedies
106
+ stay English because remedies carry copy-paste commands, and `--json` stays
107
+ language-independent.
105
108
  - A workspace directory deleted mid-session fails with a runner error; the plugin
106
109
  does not recreate it. A configured `cwd` that does not exist is reported as an
107
110
  error naming the directory.
@@ -147,6 +150,16 @@ about the machine and the configuration, not about a session: the
147
150
  [DIAGNOSTICS.md](DIAGNOSTICS.md#the-map)) are per-call decisions the doctor
148
151
  cannot predict, and `ready` does not promise them away.
149
152
 
153
+ **`/wsl-doctor` without a resolvable distro still sweeps the configuration.**
154
+ The command names the distro from the session's working directory; a session on
155
+ a Windows folder, or one whose cwd cannot resolve, leaves the target to the
156
+ effective configuration, and the shipped `auto` probes every installed distro —
157
+ measured at ~4 minutes for eight on the development machine, against seconds
158
+ for a scoped run. Pass `--distro <name>` when that is not what you want (the
159
+ CLI's `--all` says the same thing explicitly). The handler bounds an unresolved
160
+ run at 60 s (a resolved one at 120 s) so it settles with the narrowing hint
161
+ instead of leaving the card "executing" for the dispatcher's whole budget.
162
+
150
163
  The doctor reads and reports; it never rewrites user- or distro-owned files.
151
164
  `.wslconfig`, `/etc/wsl.conf`, a WSL1 conversion and distro installation are
152
165
  remedy-only — the remedy text carries the exact command — and the fixable set
@@ -189,14 +202,19 @@ the sandbox's security statement: `enforcement: partial` is untouched.
189
202
  app. Two alternatives: the doctor's `git.win-safe` probe reports the state, and a
190
203
  machine **without** Windows git needs nothing — the provider routes discovery into
191
204
  the distro and translates the output into UNC form.
192
- - **Colon-separated multi-directory `GIT_*` values pass through untranslated.**
193
- The git environment translation rewrites single Windows directory values; a
194
- colon-separated list (no current caller sets one) is forwarded as-is.
195
- - **A NEW tab's title reads `WSL`** whatever it runs — the controller titles from the
196
- composition's profile before the provider rewrites the launch, and a plugin cannot
197
- correct the default ([UPSTREAM-TERMINAL-TITLE.md](UPSTREAM-TERMINAL-TITLE.md)).
198
- The menu ships host candidates (`powershell`, `cmd`): a manually selected shell is
199
- titled after itself; double-click rename also works.
205
+ - **A multi-directory `GIT_*` value is translated, not skipped — and a
206
+ Windows-form list comes out wrong.** The translation applies the single-value
207
+ translator to every `GIT_*` value unchecked, so a list folds onto the first
208
+ drive's mount (`C:\a;D:\b` becomes `/mnt/c/a;D:/b`); only a POSIX-form colon
209
+ list (`/a:/b`) passes through verbatim (no current caller sets a list).
210
+ - **A NEW tab's title reads `WSL`** whatever it runs — the controller stamps
211
+ `title: shell.name` from the composition's profile only after `spawnTerminal`
212
+ has returned, after the provider's rewrite has already run, and it never reads
213
+ back the program the launch really started (the spawn spec carries no
214
+ display-name field), so a plugin cannot correct the default
215
+ ([UPSTREAM-TERMINAL-TITLE.md](UPSTREAM-TERMINAL-TITLE.md)). The menu ships
216
+ host candidates (`powershell`, `cmd`): a manually selected shell is titled
217
+ after itself; double-click rename also works.
200
218
  - **Distro terminals ARE reclaimed when idle** — the handle counts the marked
201
219
  processes through the resident agent (exactly one at its prompt = `idle`; a nested
202
220
  shell or an `ssh-agent` from startup files reads `busy` by design). Threshold: the
@@ -225,3 +243,10 @@ the sandbox's security statement: `enforcement: partial` is untouched.
225
243
  Host runs with `ELECTRON_RUN_AS_NODE=1`, which the launcher inherits, so
226
244
  `Code.exe` starts as Node and exits 1. Not owned by this repository:
227
245
  [UPSTREAM-OPEN-IN-APP.md](UPSTREAM-OPEN-IN-APP.md).
246
+ - **WSL files open again, but relative Markdown images no longer render in the
247
+ WSL preview.** The router's `processPath` now answers in UNC host spelling —
248
+ the shape `session.openWorkspacePath` / `workspacePathApplications` verify
249
+ (issue #37) — and the client's `fileMediaUrl` rejects a `\\`-prefixed path, so
250
+ a Markdown preview's relative image does not resolve. Chat images already had
251
+ that gap (the Session cwd is UNC). The same spelling is why the GUI change
252
+ feed, `stat.absolutePath`, and the preview header's path label carry UNC.