dsh-plugin-wsl-env 0.24.0 → 0.26.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 (94) hide show
  1. package/CHANGELOG.md +136 -0
  2. package/CODE_OF_CONDUCT.md +85 -0
  3. package/CODE_OF_CONDUCT.zh.md +85 -0
  4. package/CONTRIBUTING.md +19 -3
  5. package/CONTRIBUTING.zh.md +200 -0
  6. package/README.md +18 -6
  7. package/SECURITY.md +12 -0
  8. package/SECURITY.zh.md +108 -0
  9. package/SUPPORT.md +2 -0
  10. package/SUPPORT.zh.md +99 -0
  11. package/client.js +409 -8
  12. package/cordis.patch.yml +17 -0
  13. package/docs/AGENT-PROTOCOL-V7.md +2 -2
  14. package/docs/API.md +2 -0
  15. package/docs/API.zh.md +38 -0
  16. package/docs/ARCHITECTURE.md +30 -9
  17. package/docs/ARCHITECTURE.zh.md +511 -0
  18. package/docs/COMPATIBILITY.md +2 -0
  19. package/docs/COMPATIBILITY.zh.md +117 -0
  20. package/docs/CONFIGURATION.md +45 -2
  21. package/docs/CONFIGURATION.zh.md +39 -3
  22. package/docs/DIAGNOSTICS.md +12 -2
  23. package/docs/DIAGNOSTICS.zh.md +5 -1
  24. package/docs/LIMITATIONS.md +60 -9
  25. package/docs/LIMITATIONS.zh.md +45 -9
  26. package/docs/MIGRATION.md +6 -3
  27. package/docs/MIGRATION.zh.md +91 -0
  28. package/docs/PEER-PARITY.md +63 -51
  29. package/docs/PERFORMANCE.md +2 -0
  30. package/docs/PERFORMANCE.zh.md +59 -0
  31. package/docs/QUICKSTART.md +21 -6
  32. package/docs/QUICKSTART.zh.md +16 -4
  33. package/docs/README.zh.md +28 -19
  34. package/docs/RELEASING.md +19 -14
  35. package/docs/REQUIREMENTS.zh.md +6 -3
  36. package/docs/ROADMAP-1.0.md +1 -1
  37. package/docs/UPSTREAM-FILE-REFERENCE-SEAM.md +1 -1
  38. package/docs/UPSTREAM-FSIO-EXPORT.md +5 -4
  39. package/docs/UPSTREAM-OPEN-IN-APP.md +33 -11
  40. package/docs/UPSTREAM-PROMPT-ADAPTERS.md +85 -0
  41. package/docs/UPSTREAM-SESSION-NOTICE.md +7 -0
  42. package/docs/VALUE.md +146 -0
  43. package/docs/VALUE.zh.md +15 -13
  44. package/docs/root-fs-routing.md +1 -1
  45. package/lib/agent-confined.d.ts +7 -1
  46. package/lib/agent-confined.js +3 -3
  47. package/lib/auto-preset-seam.d.ts +45 -0
  48. package/lib/auto-preset-seam.js +47 -0
  49. package/lib/auto-preset.d.ts +33 -10
  50. package/lib/auto-preset.js +148 -44
  51. package/lib/bwrap.d.ts +14 -0
  52. package/lib/bwrap.js +11 -0
  53. package/lib/cwd-prompt.d.ts +41 -3
  54. package/lib/cwd-prompt.js +125 -8
  55. package/lib/doctor-live.d.ts +30 -0
  56. package/lib/doctor-live.js +37 -0
  57. package/lib/doctor-report.d.ts +50 -0
  58. package/lib/doctor-report.js +172 -0
  59. package/lib/fs-routing.d.ts +1 -1
  60. package/lib/fs-routing.js +1 -1
  61. package/lib/fs.d.ts +1 -1
  62. package/lib/fs.js +1 -1
  63. package/lib/index.d.ts +6 -1464
  64. package/lib/index.js +5 -2120
  65. package/lib/messages.d.ts +20 -1
  66. package/lib/messages.js +31 -3
  67. package/lib/open-in-app.d.ts +206 -0
  68. package/lib/open-in-app.js +300 -0
  69. package/lib/preflight.d.ts +7 -4
  70. package/lib/preflight.js +27 -13
  71. package/lib/preset-choice.d.ts +13 -0
  72. package/lib/preset-choice.js +18 -1
  73. package/lib/provider-common.d.ts +58 -0
  74. package/lib/provider-common.js +123 -0
  75. package/lib/sandbox-core.d.ts +1 -0
  76. package/lib/sandbox-core.js +4 -2
  77. package/lib/session-runtime.d.ts +7 -1
  78. package/lib/session-runtime.js +9 -2
  79. package/lib/shell.d.ts +1 -1
  80. package/lib/shell.js +1 -1
  81. package/lib/status.js +2 -1
  82. package/lib/writable-roots.d.ts +109 -0
  83. package/lib/writable-roots.js +257 -0
  84. package/lib/wsl-doctor-command.js +2 -1
  85. package/lib/wsl-doctor-tool.js +2 -2
  86. package/lib/wsl-filesystem.d.ts +692 -0
  87. package/lib/wsl-filesystem.js +897 -0
  88. package/lib/wsl-shell.d.ts +742 -0
  89. package/lib/wsl-shell.js +965 -0
  90. package/lib/wsl.d.ts +1 -1
  91. package/lib/wsl.js +1 -1
  92. package/package.json +48 -24
  93. package/scripts/doctor.mjs +1 -1
  94. package/scripts/profile-preset.mjs +17 -5
@@ -0,0 +1,117 @@
1
+ # 兼容性矩阵
2
+
3
+ [English](COMPATIBILITY.md)
4
+
5
+ 以下是 [`ROADMAP-1.0.md`](ROADMAP-1.0.md)(WSL-202)中支持分级的实测证据。
6
+ 下表的每一行都于 **2026-10-26** 在同一台机器的真实 WSL2 发行版上执行
7
+ (x86_64、Windows 11、WSL 2、内核 6.18),探针套件位于
8
+ [`test/probe/`](https://github.com/Big-Dao/dsh-plugin-wsl-env/tree/main/test/probe/),
9
+ 从每个发行版内部针对全新的 `--depth 1` 克隆运行。aarch64 原生 agent 另在 CI
10
+ 中每次 push 于 qemu 下执行——见
11
+ [`.github/workflows/ci.yml`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/.github/workflows/ci.yml)
12
+ 中的 `native-package` 作业;仅 VM 验证是既定决策——见下文“范围决策”。
13
+
14
+ ## 矩阵
15
+
16
+ | | Ubuntu(宿主,Tier 1) | Debian 13.5 | Fedora 44 | openSUSE Tumbleweed | Arch | Alpine 3.22 |
17
+ |---|---|---|---|---|---|---|
18
+ | init | systemd | systemd | systemd | systemd | systemd | busybox/OpenRC |
19
+ | libc | glibc | glibc | glibc | glibc | glibc | musl |
20
+ | bwrap | 0.12 | 0.12 | 0.12 | 0.13.1 | 0.13.1 | 0.12 |
21
+ | node | 24 | 20.19 | 22.23 | 26.12 | 26.12 | 22.23 |
22
+ | `sandbox.sh` | 14/14 | 14/14 | 14/14 | 14/14 | 14/14 | 15/15 |
23
+ | `agent.sh` | 11/11 | 11/11 | 11/11 | 11/11 | 11/11 | 11/11 |
24
+ | `exec.sh` | 5/5 | 5/5 | 5/5 | 5/5 | 5/5 | 5/5 |
25
+ | `substrate.sh` | 8/8 | 8/8 | 8/8 | 8/8 | 8/8 | 8/8 |
26
+ | `watch.sh` | 7/7 | 7/7 | 7/7 | 7/7 | 7/7 | 5/5 |
27
+ | `session-sandbox.sh` | 10p 1s | 10p 1s | 3p 1r 1s | 3p 1r 1s | 3p 1r 1s | 3p 1d 1s |
28
+
29
+ `p` = 通过,`s` = 跳过,`r` = 竞态,`d` = 已声明限制。每行结论依据
30
+ [`ROADMAP-1.0.md`](ROADMAP-1.0.md):Ubuntu、Debian、Fedora、openSUSE 和
31
+ Arch 为**已支持**;Alpine 在非 systemd 范围声称的全部内容上为**已支持**,
32
+ 但 `sessionSandbox: auto` 范围更窄。
33
+
34
+ **Debian 已端到端验证**:除发行版内部套件外,四个 harness 级探针
35
+ (`run.sh`、`terminal.sh`、`picker.sh`、`fs-routing.sh`)也针对
36
+ `wslfs-debian` profile 通过(2026-10-26)——是完整技术栈,而非只有发行版内
37
+ 那一半。
38
+
39
+ ## 首次运行发现的陷阱:工作区根目录缺失
40
+
41
+ Debian 的 harness 级运行暴露出一个真实发现:**当工作区根目录尚不存在时,
42
+ 受限常驻进程拒绝启动**。bwrap profile 绑定工作区根目录
43
+ (`--bind <root> <root>`),bwrap 要求绑定源存在,而在刚导入的发行版上,
44
+ 探针的工作区(`~/.dsh-fsprobe`)并不存在。对该根目录执行 `mkdir -p` 后,
45
+ 十个失败步骤全部变绿。此前每次 Ubuntu 运行都因早期探针留下了该目录,所以
46
+ 这个陷阱从未在那里触发。任何工作区,只要其目录由首次写入惰性创建,在全新
47
+ 发行版上都会撞上同一堵墙。已在 aa12b49 修复:受限工厂的 prepare 钩子现在
48
+ 在 bwrap 运行前创建根目录(`mkdir -p`),握手失败时若仍发生,会携带常驻
49
+ 进程的 stderr,`substrate.sh` 还新增一条全新根目录分支,每次运行都针对不
50
+ 存在的工作区根目录启动常驻进程,并已在 Debian(glibc)和 Alpine(musl)上
51
+ 验证。
52
+
53
+ ## 两处已解释的差异
54
+
55
+ - **`session-sandbox.sh`,后台存活分支(Fedora、openSUSE、Arch)。**
56
+ 同为 systemd 的发行版在通过 `wsl.exe` 驱动时对该检查出现分化(Debian
57
+ 通过,另外三个不通过):探针只给 0.5 s 窗口,而 WSL 会话拆除与之竞态。
58
+ 这是探针上下文造成的假象,不是插件的主张——插件的后台进程保证依托
59
+ systemd 瞬态 scope,而该分支探针自身标注为“从 WSL 终端运行”。在 Alpine
60
+ 上,同一分支**按声明**失败:没有 systemd 时插件不承诺后台存活,
61
+ `sessionSandbox: auto` 改为报告更窄的按命令范围。
62
+
63
+ - **`watch.sh` 在 Alpine 上(5/5)。** 两项检查在其他发行版上走 inotify
64
+ 快速路径,在那里走轮询回退;两种行为都已发布且都有断言,所以计数更低
65
+ 反映的是该内核/libc 上被覆盖的路径更少,而不是承诺更弱。
66
+
67
+ ## Tier 2 安装说明(那些陷阱,免得下一次导入重新踩坑)
68
+
69
+ | 发行版 | 关键的安装步骤 |
70
+ |---|---|
71
+ | Debian | 首次启动可能在 OOBE 完成前卡死(`wsl.exe` exec 和 `--terminate` 都会挂起)。等状态变为 Stopped 后执行一次 `wsl --terminate <distro>`,再以 root 启动以跳过 OOBE。systemd 开箱即 PID 1。 |
72
+ | Alpine | 导入 **minirootfs** tarball(`wsl --import`),不要用 standard/cloud 镜像。创建普通用户并在 `/etc/wsl.conf` 中设置 `[user] default=…`——导入后的默认用户是 root,而 root agent 写出的 0600 文件探针用户无法读取。安装 `coreutils util-linux`(busybox 的 `mktemp`/`ps` 缺少所用选项)以及用于 `useradd` 的 `shadow`。 |
73
+ | Fedora / openSUSE / Arch | systemd 开箱即 PID 1。openSUSE:用 `zypper --non-interactive`(裸 `-y` 仍会提示);Arch:`pacman -Sy --needed`。 |
74
+
75
+ 在最小 Alpine 镜像上,**shell** agent 的 FSB 枚举需要 GNU `findutils`
76
+ (BusyBox 的 `find` 缺少 `-printf`);随包的原生 agent 不需要,`auto` 会
77
+ 优先选择它。仅在锁定 `agentBackend: shell` 时才安装 `findutils`——doctor
78
+ 会解码该失败并指出这个包。
79
+
80
+ 各处使用的依赖:`bash bubblewrap git nodejs`(node 20–26 均通过;插件的
81
+ `engines` 下限针对 harness 宿主,而非探针节点)。每个发行版的探针运行方式,
82
+ 在发行版内部执行:
83
+
84
+ ```sh
85
+ git clone --depth 1 https://github.com/Big-Dao/dsh-plugin-wsl-env.git
86
+ cd dsh-plugin-wsl-env
87
+ for p in sandbox session-sandbox agent exec substrate watch; do bash test/probe/$p.sh; done
88
+ ```
89
+
90
+ harness 级探针(`run.sh`、`terminal.sh`、`picker.sh`、`fs-routing.sh`)还
91
+ 需要关闭应用,并使用 `run.sh` 头部给出的临时 `wslfs` profile;在第二个
92
+ 发行版上,复制该 profile 并设置其 `distro:` 键。
93
+
94
+ ## 范围决策
95
+
96
+ - **aarch64 仅在 VM 中验证;物理硬件不在范围内(决定日期 2026-10-27)。**
97
+ qemu-user CI 分支每次 push 都对随包二进制执行完整的 18 项检查套件,覆盖
98
+ agent 自身的代码路径;真实硬件唯一能补充的,是对 aarch64 芯片边缘案例的
99
+ 暴露,而本项目可触及的 Windows-on-ARM 设备都无法提供这种暴露。支持表将 aarch64
100
+ 标记为“supported (executed in CI)”,并保持如此。
101
+
102
+ - **Windows 10 未单独验证(决定日期 2026-10-27)。** 插件的全部表面是
103
+ `wsl.exe`、发行版和 UNC 共享;在 WSL2 上,这些组件在 Windows 10 与
104
+ Windows 11 上相同,版本相关行为位于上游 WSL 本身,而不在本插件挂载的
105
+ 任何内容中。上表测量的是 Windows 11;欢迎通过支持渠道提交 Win10 报告,
106
+ 但不计划单独验证。
107
+
108
+ ## 尚未测量
109
+
110
+ - 由真实 WSL 终端会话驱动的非 systemd 会话范围(探针跳过的分支)。
111
+ - ~~容器镜像~~——2026-10-27 关闭:`test/agent-container.mjs` 在 CI 中于
112
+ `debian:stable-slim`、`alpine:3`、`fedora:latest`、
113
+ `opensuse/tumbleweed` 和 `archlinux` 容器内运行真实的 shell agent
114
+ (`agent-containers` 作业,每个镜像一个),各 7 项检查——与就地 digest
115
+ 的握手、PING、带退出码和两个流的 EXEC、SETENV,以及在各系列实际有差异处
116
+ 检查 `sha256sum`/`base64` 是否存在(Alpine 上是 busybox,其他地方是
117
+ coreutils)。首次执行 35/35。
@@ -1,6 +1,6 @@
1
1
  # Configuration
2
2
 
3
- *The Chinese version ([CONFIGURATION.zh](CONFIGURATION.zh.md)) is authoritative; this page is its English translation.*
3
+ [中文](CONFIGURATION.zh.md)
4
4
 
5
5
  ## Profile patches
6
6
 
@@ -68,6 +68,7 @@ after a plugin upgrade that changes the preset.
68
68
  | `sandbox` | `true` | Confine commands with `bwrap`. A missing or unusable `bwrap` fails closed. `false` runs commands without confinement. |
69
69
  | `interopVisibility` | Unset; effective default is `visible` | `visible`, `masked`, or `disabled`. When set, this takes precedence over `maskWindowsDrive`. See [Windows interop](#windows-interop). |
70
70
  | `maskWindowsDrive` | `false` | For confined commands, mount an empty tmpfs over `/mnt`. See [Windows interop](#windows-interop). |
71
+ | `writableRoots` | `[]` | Extra distro directories granted read-write under `workspace-write` (`~` allowed), for toolchain caches or a linked worktree's shared Git directory. Each entry must be an existing physical directory; entries already inside the workspace, `/tmp` or `/dev/shm`, or nested inside another grant, are ignored. Put the same list on `wsl-fs`. See [Toolchain caches](#toolchain-caches-and-extra-writable-roots). |
71
72
  | `cwd` | `''` | Default workdir. Empty uses the distro user's home. |
72
73
  | `timeoutMs` / `maxTimeoutMs` | `120000` / `600000` (shipped) | Default per-call timeout and the maximum timeout a call may request. |
73
74
  | `wslPath` | `wsl.exe` | Path to `wsl.exe`. |
@@ -83,12 +84,54 @@ after a plugin upgrade that changes the preset.
83
84
  | `sandbox` | `true` | Check writes against the sandbox policy. Confined writes fail closed if `bwrap` is unavailable. |
84
85
  | `sessionSandbox` | `false`; shipped `true` | Use the same session runtime as `wsl-shell`. `auto` falls back to a per-policy confined resident when the session runtime is unavailable. |
85
86
  | `maskWindowsDrive` | `false` | Hide `/mnt` from confined mutations. Reads are unaffected. |
87
+ | `writableRoots` | `[]` | Same key and rules as on `wsl-shell`. Confined writes and commands must see one mount table, so configure the same list on both rows. See [Toolchain caches](#toolchain-caches-and-extra-writable-roots). |
86
88
  | `substrate` | `agent` (shipped) | File operations use the in-distro agent. The legacy `share` value is refused at startup. |
87
89
  | `cwd` | `''` | Base directory for relative paths. Empty uses the distro user's home. |
88
90
  | `watchMaxDepth` | `0` | Watch the full tree. A positive depth uses bounded polling and can miss changes below the bound until a change above it triggers the callback. |
89
91
  | `wslPath` | `wsl.exe` | Path to `wsl.exe`. |
90
92
  | `diffBasisMaxBytes` | `10485760` | UTF-8 byte limit per side of an overwrite diff. Larger files are written without a diff. |
91
93
 
94
+ ### Toolchain caches and extra writable roots
95
+
96
+ The default `workspace-write` grants only the session workspace and the temp
97
+ areas (`/tmp`, the distro's real `/tmp` under the session runtime). npm, pnpm,
98
+ cargo and friends keep their package caches under `$HOME`, so installing a
99
+ dependency that is not already cached fails with `EROFS`. Configure the same
100
+ list on the **nested** `wsl-shell` and `wsl-fs` rows; `pnpm run preset
101
+ --writable-roots '~/.npm,~/.cache'` writes both into the printed `preset-wsl`
102
+ block, or edit the block by hand:
103
+
104
+ ```yaml
105
+ - id: wsl-shell
106
+ config:
107
+ writableRoots: ['~/.npm', '~/.cache', '~/.local/share/pnpm']
108
+ - id: wsl-fs
109
+ config:
110
+ writableRoots: ['~/.npm', '~/.cache', '~/.local/share/pnpm']
111
+ ```
112
+
113
+ Rules:
114
+
115
+ - `~` and `~/...` expand against the distro user's home; every other entry must
116
+ be an absolute Linux path.
117
+ - The directory must already exist and must be a physical directory (symlinks
118
+ are refused). Create it with `mkdir -p` first, or let one unconfined command
119
+ create it.
120
+ - Entries already inside the workspace, `/tmp` or `/dev/shm`, or nested inside
121
+ another grant, are ignored: they are already writable, and binding them would
122
+ only add a symlink-redirection risk.
123
+ - Keep both rows equal; otherwise commands and confined writes can see
124
+ different mount tables, and the session runtime keys diverge.
125
+ - It applies only to `workspace-write`. `read-only` ignores it, and
126
+ `danger-full-access` does not go through the sandbox at all.
127
+ - Security boundary: executable content in a granted directory (for example a
128
+ package cache's binaries) can be used by a later build or command. This is an
129
+ explicit narrowing of the sandbox, not a way to turn it off; `enforcement`
130
+ stays `partial`.
131
+ - The shared `sandboxPolicy.additionalWritableRoots` is honored too (same-distro
132
+ UNC or Linux spelling), but it applies to the whole profile. When the same
133
+ profile also serves Windows sessions, prefer the plugin key above.
134
+
92
135
  ### `fs-routing`
93
136
 
94
137
  This top-level row serves root-level `ctx.fs` calls. It routes distro UNC paths
@@ -139,7 +182,7 @@ The root router is app-level, not session-owned, so it does not use
139
182
  | `auto-preset` | `preset` | `wsl` | Preset to bind when a session workspace is inside a distro. An explicit operator selection is preserved. |
140
183
  | | `attempts` | `6` | Number of attempts to bind the preset. |
141
184
  | | `retryMs` | `150` | Delay between attempts, in milliseconds. |
142
- | | `windowsWorkspaces` | `[]` | Distro directories opened for Windows access (UNC paths). Sessions under them keep the host preset; the add-workspace prompt writes here, and Settings can change it back. |
185
+ | | `windowsWorkspaces` | `[]` | Distro directories opened for Windows access (UNC paths). Sessions under them keep the host preset; the add-workspace prompt writes here, and Settings can change it back. A session in one of them is called out above the composer and in the **WSL environment** panel, with the way back to the distro environment. |
143
186
  | `wsl-status` | `cacheMs` | `15000` | How long one distro's verdict stays fresh in memory, in milliseconds (the last result is persisted separately). |
144
187
  | | `timeoutMs` | `90000` | Deadline for one check or repair run, in milliseconds. |
145
188
  | | `wslPath` | `wsl.exe` | `wsl.exe` used to list the distros. |
@@ -1,6 +1,6 @@
1
- # Configuration
1
+ # 配置
2
2
 
3
- _本页是权威版本;英文译本见 [CONFIGURATION](CONFIGURATION.md)。_
3
+ [English](CONFIGURATION.md)
4
4
 
5
5
  ## Profile patch
6
6
 
@@ -65,6 +65,7 @@ profile 层;检测到时会打印应使用的块。`--out` 会整体替换目
65
65
  | `sandbox` | `true` | 用 `bwrap` 约束命令。`bwrap` 缺失或不可用时关闭(fail closed)。`false` 则不加约束地运行命令。 |
66
66
  | `interopVisibility` | 未设置;有效默认值为 `visible` | `visible`、`masked` 或 `disabled`。设置后优先于 `maskWindowsDrive`。见 [Windows interop](#windows-interop)。 |
67
67
  | `maskWindowsDrive` | `false` | 对受限命令,在 `/mnt` 上挂载空的 tmpfs。见 [Windows interop](#windows-interop)。 |
68
+ | `writableRoots` | `[]` | `workspace-write` 下额外可写的发行版目录(`~` 可用),用于工具链缓存或 linked worktree 的共享 Git 目录。条目必须是已存在的物理目录;已在工作区、`/tmp`、`/dev/shm` 内或嵌套在另一条授权内的条目会被忽略。`wsl-fs` 上应配置同一列表。见[工具链缓存](#工具链缓存与额外可写目录)。 |
68
69
  | `cwd` | `''` | 默认工作目录。空则使用发行版用户家目录。 |
69
70
  | `timeoutMs` / `maxTimeoutMs` | `120000` / `600000`(shipped) | 默认的单次调用超时,以及一次调用可请求的最大超时。 |
70
71
  | `wslPath` | `wsl.exe` | `wsl.exe` 的路径。 |
@@ -80,12 +81,47 @@ profile 层;检测到时会打印应使用的块。`--out` 会整体替换目
80
81
  | `sandbox` | `true` | 按沙箱策略检查写入。`bwrap` 不可用时,受限写入关闭(fail closed)。 |
81
82
  | `sessionSandbox` | `false`;shipped 为 `true` | 使用与 `wsl-shell` 相同的会话 runtime。`auto` 在会话 runtime 不可用时回退到按策略约束的常驻 agent。 |
82
83
  | `maskWindowsDrive` | `false` | 对受限变更隐藏 `/mnt`。读取不受影响。 |
84
+ | `writableRoots` | `[]` | 与 `wsl-shell` 的键同义、同规则。受限写入与命令必须看到同一挂载表,因此两行应配置同一个列表。见[工具链缓存](#工具链缓存与额外可写目录)。 |
83
85
  | `substrate` | `agent`(shipped) | 文件操作使用发行版内 agent。旧值 `share` 在启动时被拒绝。 |
84
86
  | `cwd` | `''` | 相对路径的基准目录。空则使用发行版用户家目录。 |
85
87
  | `watchMaxDepth` | `0` | 监视整棵树。正值深度使用有界轮询,可能遗漏边界以下的变更,直到边界之上发生变更触发回调。 |
86
88
  | `wslPath` | `wsl.exe` | `wsl.exe` 的路径。 |
87
89
  | `diffBasisMaxBytes` | `10485760` | 覆盖写入 diff 每一侧的 UTF-8 字节上限。更大的文件不带 diff 直接写入。 |
88
90
 
91
+ ### 工具链缓存与额外可写目录
92
+
93
+ 默认的 `workspace-write` 只授予会话工作区和临时区(`/tmp`,会话 runtime 下是
94
+ 发行版的真实 `/tmp`)。npm、pnpm、cargo 等把包缓存写在 `$HOME` 下,所以安装一个
95
+ 尚未缓存的依赖会以 `EROFS` 失败。给**嵌套的** `wsl-shell` 和 `wsl-fs` 两行配置
96
+ 同一组目录即可;用 `pnpm run preset --writable-roots '~/.npm,~/.cache'` 可以把
97
+ 它们写进打印出的 `preset-wsl` 块,或手工在块内添加:
98
+
99
+ ```yaml
100
+ - id: wsl-shell
101
+ config:
102
+ writableRoots: ['~/.npm', '~/.cache', '~/.local/share/pnpm']
103
+ - id: wsl-fs
104
+ config:
105
+ writableRoots: ['~/.npm', '~/.cache', '~/.local/share/pnpm']
106
+ ```
107
+
108
+ 规则:
109
+
110
+ - `~` 和 `~/...` 按发行版用户家目录展开;其他条目必须是绝对 Linux 路径。
111
+ - 目录必须已经存在,且必须是物理目录(symlink 会被拒绝)。先 `mkdir -p`,
112
+ 或让一次不受限命令创建它。
113
+ - 已经位于工作区、`/tmp`、`/dev/shm` 内,或嵌套在另一条授权内的条目会被忽略:
114
+ 它们本来就已可写,绑定它们只会增加 symlink 重定向的风险。
115
+ - 两行必须一致;否则命令和受限写入可能看到不同的挂载表,会话 runtime 也会按
116
+ 不同的 key 各建一份。
117
+ - 只影响 `workspace-write`。`read-only` 忽略它;`danger-full-access` 本来就不
118
+ 经过沙箱。
119
+ - 安全边界:授权目录里的可执行内容(例如包缓存里的二进制)可以被后续构建或
120
+ 命令使用。这是**显式收窄**沙箱,不是关闭沙箱;`enforcement` 仍是 `partial`。
121
+ - 共享的 `sandboxPolicy.additionalWritableRoots` 也会被插件采用(同发行版 UNC
122
+ 或 Linux 拼写),但它作用于整个 profile;同一 profile 里还有 Windows 会话时,
123
+ 用上面的插件键更安全。
124
+
89
125
  ### `fs-routing`
90
126
 
91
127
  这个顶层行为根级 `ctx.fs` 调用提供服务。它把发行版 UNC 路径
@@ -136,7 +172,7 @@ Loader 在挂载该行之前会校验宿主和发行版设置;
136
172
  | `auto-preset` | `preset` | `wsl` | 会话工作区位于发行版内时绑定的 preset。操作者的显式选择会被保留。 |
137
173
  | | `attempts` | `6` | 绑定 preset 的尝试次数。 |
138
174
  | | `retryMs` | `150` | 两次尝试之间的延迟,单位毫秒。 |
139
- | | `windowsWorkspaces` | `[]` | 以 Windows 访问方式打开的发行版目录(UNC 路径)。这些路径下的会话保留宿主 preset;添加工作区时的访问方式选择会写入这里,设置页可改回。 |
175
+ | | `windowsWorkspaces` | `[]` | 以 Windows 访问方式打开的发行版目录(UNC 路径)。这些路径下的会话保留宿主 preset;添加工作区时的访问方式选择会写入这里,设置页可改回。落在这些目录的会话会在输入框上方与 **WSL 环境** 面板中被点明,并提供回到发行版环境的办法。 |
140
176
  | `wsl-status` | `cacheMs` | `15000` | 单个发行版判定在内存中的新鲜时间,单位毫秒(最后一次结果另行持久化)。 |
141
177
  | | `timeoutMs` | `90000` | 单次检查或修复运行的死线,单位毫秒。 |
142
178
  | | `wslPath` | `wsl.exe` | 列出发行版用的 `wsl.exe`。 |
@@ -1,5 +1,7 @@
1
1
  # Diagnostics: the doctor and the error-code map
2
2
 
3
+ [中文](DIAGNOSTICS.zh.md)
4
+
3
5
  Every refusal this plugin produces is named. This page is the map between
4
6
  those names and the doctor: for each error code, whether the `doctor`
5
7
  (`pnpm run doctor`, or `node scripts/doctor.mjs --json`) covers its
@@ -19,8 +21,9 @@ names the opt-out, both as warnings), so the verdict answers under the
19
21
  the shipped preset — not the shipped defaults. The `config.effective` check
20
22
  reports what was read and from where.
21
23
 
22
- `verdict: ready` means the first command should succeed in the target
23
- distro(s) under the expected scope; the smoke legs (`functional.exec`,
24
+ `verdict: ready` means every check this run covered passed in the target
25
+ distro(s) under the expected scope; it is not a promise about a later
26
+ command. The smoke legs (`functional.exec`,
24
27
  `functional.sandbox`, `functional.fs`) prove the chain itself — frame I/O,
25
28
  the confined fence, the batched substrate — not just the prerequisites.
26
29
  `functional.exec` / `functional.fs` run the shell agent; when `auto` or
@@ -104,6 +107,12 @@ posts the full-run action (`--fix-owned`, labeled 修复 or 完整检查):
104
107
  never reports. This is the only surface that depends on the model path; use
105
108
  the command or the CLI when the plugin's runtime itself is under suspicion.
106
109
 
110
+ One check is surface-dependent by construction: `session.preset-seam` reports
111
+ whether `auto-preset` could wrap the host's `agents.createSession` in this
112
+ process. That is host-process state, so the standalone CLI cannot see it; the
113
+ command, the panel and the model tool merge the row in. A missing row in a CLI
114
+ report means "not observable from a subprocess", not "the seam is fine".
115
+
107
116
  ## The map
108
117
 
109
118
  Class legend:
@@ -119,6 +128,7 @@ Class legend:
119
128
  |---|---|---|---|
120
129
  | `SANDBOX_UNAVAILABLE` | environment | `sandbox.bwrap`, `sandbox.bwrap-usable`, `functional.sandbox` | the requested confinement cannot be enforced (no usable bubblewrap) |
121
130
  | `FS_SANDBOX_DENIED` | policy | `functional.sandbox` (the fence shape) | the file-effect policy refused the write, or the kernel refused it at the resident's profile |
131
+ | `SANDBOX_INVALID_ROOT` | configuration | — (the per-entry `writableRoots` check runs on first use; the doctor does not pre-run it) | an extra writable root is malformed, names another world, or fails the physical-directory check |
122
132
  | `FS_OUTSIDE_DISTRO` | policy | `config.effective` (the effective `distro`) | the path names another distro's share while the fence is pinned |
123
133
  | `FS_IO_ERROR` | environment | `distro.reachable`, `distro.disk`, `host.disk`, `agent.handshake`, `agent.home-writable`, `functional.exec`, `functional.fs` | the catch-all: an agent outage, a wedged distro, a full disk, an unmappable path |
124
134
  | `FS_NOT_FOUND` | data | — | the path does not exist — the ordinary answer |
@@ -1,5 +1,7 @@
1
1
  # 诊断:doctor 与错误码地图
2
2
 
3
+ [English](DIAGNOSTICS.md)
4
+
3
5
  本插件产生的每一个拒绝都有名字。本页是这些名字与 doctor 的对照表:
4
6
  对每个错误码,说明 `doctor`(`pnpm run doctor`,或
5
7
  `node scripts/doctor.mjs --json`)是否覆盖其前置条件、由哪个检查 id 应答。
@@ -18,7 +20,8 @@
18
20
  关闭隔离(`sandbox: false` 且 `sessionSandbox: false`),沙箱检查发出
19
21
  **警告**点名 UNCONFINED 状态,并跳过围栏冒烟——醒目,但不阻断。
20
22
 
21
- `verdict: ready` 表示首条命令应在目标 distro、预期 scope 下成功;smoke 腿
23
+ `verdict: ready` 表示本次运行覆盖的检查在目标 distro、预期 scope 下全部通过,
24
+ 不保证之后每条命令都成功;smoke 腿
22
25
  (`functional.exec`、`functional.sandbox`、`functional.fs`)证明链路本身——
23
26
  帧 I/O、受限围栏、批量 substrate——而不只是前置条件。`functional.exec` /
24
27
  `functional.fs` 运行 shell agent;当 `auto` 或 `native` 选中 native 二进制时,
@@ -96,6 +99,7 @@ doctor 通过三个入口给出同一份报告;侧边栏的 **WSL 环境** 面
96
99
  |---|---|---|---|
97
100
  | `SANDBOX_UNAVAILABLE` | environment | `sandbox.bwrap`、`sandbox.bwrap-usable`、`functional.sandbox` | 所请求的隔离无法强制(无可用 bubblewrap) |
98
101
  | `FS_SANDBOX_DENIED` | policy | `functional.sandbox`(围栏形状) | 文件效果策略拒绝了写入,或内核在驻留 agent 的 profile 处拒绝 |
102
+ | `SANDBOX_INVALID_ROOT` | configuration | —(`writableRoots` 的逐项检查在首次使用时进行,doctor 不预跑) | 额外可写目录格式错误、指向另一个世界,或未通过物理目录检查 |
99
103
  | `FS_OUTSIDE_DISTRO` | policy | `config.effective`(生效的 `distro`) | 围栏钉死时路径指向另一 distro 的共享 |
100
104
  | `FS_IO_ERROR` | environment | `distro.reachable`、`distro.disk`、`host.disk`、`agent.handshake`、`agent.home-writable`、`functional.exec`、`functional.fs` | 兜底:agent 失联、distro 僵死、磁盘满、无法映射的路径 |
101
105
  | `FS_NOT_FOUND` | data | — | 路径不存在——普通答案 |
@@ -1,6 +1,6 @@
1
1
  # Limitations
2
2
 
3
- *The Chinese version ([LIMITATIONS.zh](LIMITATIONS.zh.md)) is authoritative; this page is its English translation.*
3
+ [中文](LIMITATIONS.zh.md)
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
@@ -101,6 +101,16 @@ operations never use the 9p share.
101
101
  [ARCHITECTURE.md](ARCHITECTURE.md#reported-enforcement).
102
102
  - **`bubblewrap` must be installed**, or both providers fail with the install
103
103
  command; a session-start preflight surfaces the same text as an advisory warning.
104
+ - **`workspace-write` does not grant the package-manager caches under `$HOME`
105
+ by default** — npm's `~/.npm`, pnpm's store and cargo's `~/.cargo/registry`
106
+ live outside the workspace, so installing a dependency that is not already
107
+ cached fails with `EROFS`. Grant them explicitly with `writableRoots` (see
108
+ [CONFIGURATION](CONFIGURATION.md#toolchain-caches-and-extra-writable-roots));
109
+ executable content in a granted directory can be used by a later build, so
110
+ this narrows the sandbox rather than turning it off, and `enforcement` stays
111
+ `partial`. Entries must be existing physical directories; entries already
112
+ covered by the workspace, `/tmp` or `/dev/shm`, or nested inside another
113
+ grant, are not bound.
104
114
  - **Message localization is partial by design** — the preflight verdicts, `bwrap`
105
115
  remedies and distro/workdir errors follow the app's Language setting
106
116
  ([CONFIGURATION.md](CONFIGURATION.md#message-language)); the `FS_*` refusal texts
@@ -184,12 +194,33 @@ sandbox's security statement: `enforcement: partial` is untouched.
184
194
 
185
195
  ## Session-start advisories
186
196
 
187
- - **There is no session-UI notice seam in DSH 0.2.1.** `wsl-preflight` failures go
188
- to the host log and the session's runtime context (model-visible next assembly) —
189
- advisory only, never installing or cancelling. The upstream ask:
190
- [UPSTREAM-SESSION-NOTICE.md](UPSTREAM-SESSION-NOTICE.md).
197
+ - **There is no session-UI notice seam in DSH 0.2.1.** A blocked `wsl-preflight`
198
+ verdict goes to the host log and the session's runtime context (model-visible
199
+ next assembly) — advisory only, never installing or cancelling. A ready
200
+ verdict is log-only: "the prerequisite is usable" is not a model action. The
201
+ upstream ask: [UPSTREAM-SESSION-NOTICE.md](UPSTREAM-SESSION-NOTICE.md).
191
202
  - **The runtime-context entry is a repeated snapshot, not a dismissible
192
203
  notification.** Removing the `wsl-preflight` row silences the probe entirely.
204
+ A blocked message marks its remedy as operator action to ask the user about;
205
+ ready verdicts are not sent.
206
+ - **The access-mode reminder is plugin-owned UI, not a notice seam.** It renders
207
+ in the composer dock when the client's session list carries the `agentPreset`
208
+ projection; the `auto-preset` settings row supplies the target preset and the
209
+ recorded directories, and an unreadable or throwing row falls back to `wsl`
210
+ with no recorded directories — a visible warning, never silence. It never
211
+ infers an environment from the path alone. Without the web client (CLI,
212
+ headless) the same state reaches the operator only through the log, and the
213
+ model through the runtime-context entry.
214
+ - **The creation-time preset binding depends on the host's private controller
215
+ shape.** `auto-preset` wraps `sessionController.agents.createSession` so a
216
+ distro workspace's first mount is already the WSL preset; 0.2.1 replaced the
217
+ older `ensureSession(sessionId, cwd, …, presetId)` frame with that request
218
+ object. If a future host changes it again, the wrapper goes inactive: sessions
219
+ still adopt the WSL preset after creation through `agent/created`, but a first
220
+ turn that starts inside that window can run on the host environment (the
221
+ Windows ACL sandbox cannot carry a `\\wsl.localhost` path). The mount warns,
222
+ and the doctor's `session.preset-seam` row reports active/inactive — in the
223
+ in-app surfaces only, because the standalone CLI cannot see host-process state.
193
224
 
194
225
  ## Ports
195
226
 
@@ -253,10 +284,16 @@ sandbox's security statement: `enforcement: partial` is untouched.
253
284
 
254
285
  ## Host "Open in app"
255
286
 
256
- - **Opening VS Code from "Open in app" can fail independently of this plugin** — the
257
- Host runs with `ELECTRON_RUN_AS_NODE=1`, which the launcher inherits, so
258
- `Code.exe` starts as Node and exits 1. Not owned by this repository:
259
- [UPSTREAM-OPEN-IN-APP.md](UPSTREAM-OPEN-IN-APP.md).
287
+ - **The plugin's "Open in VS Code (WSL)" menu item works; the shipped "Open in
288
+ app" item still does not.** The `wsl-open-in-app` row scrubs
289
+ `ELECTRON_RUN_AS_NODE` from the **editor child's** environment, so VS Code
290
+ starts as an application; the route converts a WSL UNC workspace to its
291
+ `vscode-remote` URI and the editor lands in Remote-WSL. The scrub is
292
+ deliberately child-scoped: deleting the name from the Host process
293
+ environment breaks Node-mode helpers such as the Windows Job runner. The
294
+ shipped item keeps inheriting the flag and still fails; that half belongs
295
+ upstream: [UPSTREAM-OPEN-IN-APP.md](UPSTREAM-OPEN-IN-APP.md). Nothing patches
296
+ `app.asar`, so an app upgrade cannot drop the plugin's half.
260
297
  - **WSL files open again, but relative Markdown images no longer render in the
261
298
  WSL preview.** The router's `processPath` now answers in UNC host spelling —
262
299
  the shape `session.openWorkspacePath` / `workspacePathApplications` verify
@@ -264,3 +301,17 @@ sandbox's security statement: `enforcement: partial` is untouched.
264
301
  a Markdown preview's relative image does not resolve. Chat images already had
265
302
  that gap (the Session cwd is UNC). The same spelling is why the GUI change
266
303
  feed, `stat.absolutePath`, and the preview header's path label carry UNC.
304
+
305
+ ## Sidebar terminal font
306
+
307
+ - **The terminal font is a DSH user setting, not a plugin setting.** On
308
+ `0.2.2-rc.2` the sidebar terminal renders `ui-theme.terminalFontFamily` (an
309
+ empty value falls back to the built-in `ui-monospace`/Consolas stack), and
310
+ that field lives in the profile's `cordis.patch.yml`. Set it once in
311
+ **Settings → General → Fonts → terminal font** rather than hand-editing the
312
+ profile; a hand-added row is lost when Desktop's fatal recovery renames the
313
+ profile patch to a `.bak-*` sibling. If the choice must survive that recovery,
314
+ mirror the complete `ui-theme` row in `$DSH_HOME/cordis.patch.yml` — the
315
+ home-level layer is not renamed, and a patch replaces the row's whole config,
316
+ so restate every field you keep. The plugin does not own renderer typography
317
+ and never writes this setting.
@@ -1,6 +1,6 @@
1
- # Limitations
1
+ # 限制与不承诺
2
2
 
3
- _本页是权威版本;英文译本见 [LIMITATIONS](LIMITATIONS.md)。_
3
+ [English](LIMITATIONS.md)
4
4
 
5
5
  插件不做什么,以及为什么。写进文档的限制是设计边界;
6
6
  没写进文档的迟早会变成 bug 报告。每一条都说明限制本身和补救方法;
@@ -96,6 +96,13 @@ Windows 侧 share 后端(`substrate: "share"`)在启动时被拒绝;WSL
96
96
  [ARCHITECTURE.md](ARCHITECTURE.md#reported-enforcement)。
97
97
  - **必须安装 `bubblewrap`**,否则两个提供者都会带着安装命令失败;
98
98
  会话启动预检会以建议性警告的形式给出同样的文本。
99
+ - **`workspace-write` 默认不授予 `$HOME` 下的包管理器缓存** —— npm 的
100
+ `~/.npm`、pnpm 的 store、cargo 的 `~/.cargo/registry` 都在工作区之外,
101
+ 安装一个尚未缓存的依赖会以 `EROFS` 失败。用 `writableRoots` 显式授权
102
+ (见 [CONFIGURATION](CONFIGURATION.zh.md#工具链缓存与额外可写目录));
103
+ 授权目录里的可执行内容可被后续构建使用,这是收窄沙箱,不是关闭它,
104
+ `enforcement` 仍是 `partial`。条目必须是已存在的物理目录;已被工作区、
105
+ `/tmp`、`/dev/shm` 覆盖或嵌套在另一条授权内的条目不绑定。
99
106
  - **消息本地化按设计只覆盖一部分** —— 预检判定、`bwrap` 修复提示与
100
107
  发行版/工作目录错误跟随应用的语言设置
101
108
  ([CONFIGURATION.zh.md](CONFIGURATION.zh.md#消息语言));`fs-decisions`
@@ -166,12 +173,26 @@ Windows git `safe.directory` 白名单)。`--fix-owned` 把运行收窄到插
166
173
 
167
174
  ## 会话启动建议
168
175
 
169
- - **DSH 0.2.1 没有会话 UI 通知接缝。** `wsl-preflight` 的失败进入宿主日志
176
+ - **DSH 0.2.1 没有会话 UI 通知接缝。** `wsl-preflight` 的阻塞裁决进入宿主日志
170
177
  和会话的 runtime context(下次组装时对模型可见)——仅供参考,从不安装、
171
- 从不取消。对上游的请求见:
178
+ 从不取消。ready 裁决只写日志:“前置项可用”不是模型的动作。对上游的请求见:
172
179
  [UPSTREAM-SESSION-NOTICE.md](UPSTREAM-SESSION-NOTICE.md)。
173
180
  - **runtime context 条目是重复的快照,不是可关闭的通知。**
174
- 移除 `wsl-preflight` 行即可让该探针完全静音。
181
+ 移除 `wsl-preflight` 行即可让该探针完全静音。阻塞消息把修复标记为用户操作;
182
+ ready 裁决不再发送。
183
+ - **访问方式提醒是插件自有 UI,不是通知接缝。** 只要客户端的会话列表带有
184
+ `agentPreset` 投影,它就渲染在输入框上方;`auto-preset` 设置行提供目标 preset
185
+ 与已记录目录,读取失败或抛错时回退到 `wsl` 且视为无记录——显示警示,绝不静默。
186
+ 它绝不只凭路径猜测环境。没有 Web 客户端时(CLI、headless),同一状态只通过
187
+ 日志到达操作者,通过 runtime context 条目到达模型。
188
+ - **创建期环境绑定依赖宿主私有的 controller 形状。** `auto-preset` 包装
189
+ `sessionController.agents.createSession`,使发行版工作区的首次挂载就是 WSL
190
+ preset;0.2.1 用这个请求对象替换了更早的
191
+ `ensureSession(sessionId, cwd, …, presetId)` 帧。宿主将来再改形状时包装会
192
+ 失效:会话仍会经 `agent/created` 在创建后切换到 WSL preset,但落在这个窗口内
193
+ 开始的首轮可能在宿主环境里运行(Windows ACL 沙箱无法承载
194
+ `\\wsl.localhost` 路径)。挂载时会告警,doctor 的 `session.preset-seam`
195
+ 行报告 active/inactive——只在应用内界面可见,独立 CLI 看不到宿主进程状态。
175
196
 
176
197
  ## 端口
177
198
 
@@ -227,13 +248,28 @@ Windows git `safe.directory` 白名单)。`--fix-owned` 把运行收窄到插
227
248
 
228
249
  ## 宿主的"在应用中打开"
229
250
 
230
- - **从"在应用中打开"启动 VS Code 可能独立于本插件而失败** ——
231
- 宿主带着 `ELECTRON_RUN_AS_NODE=1` 运行,启动器会继承它,于是
232
- `Code.exe` 以 Node 身份启动并以退出码 1 结束。不属于本仓库管:
233
- [UPSTREAM-OPEN-IN-APP.md](UPSTREAM-OPEN-IN-APP.md)。
251
+ - **插件的"在 VS Code 中打开(WSL)"菜单项可用;随包的"在应用中打开"仍然
252
+ 失败。** `wsl-open-in-app` 行只从**编辑器子进程**的环境里删除
253
+ `ELECTRON_RUN_AS_NODE`,VS Code 因此按应用启动;路由把 WSL UNC 工作区转换为
254
+ `vscode-remote` URI,编辑器直接进入 Remote-WSL。这个清理刻意只作用于子进程:
255
+ 从 Host 进程环境删除会破坏 Windows Job runner 这类需要继承该变量的
256
+ Node 模式辅助进程。随包入口仍继承该变量,所以仍然失败;那一半属于上游:
257
+ [UPSTREAM-OPEN-IN-APP.md](UPSTREAM-OPEN-IN-APP.md)。两半都不修改
258
+ `app.asar`,应用升级不会丢掉插件这一半。
234
259
  - **WSL 文件可以正常打开,但预览里的相对 Markdown 图片不再渲染** ——
235
260
  路由的 `processPath` 现在返回 UNC 宿主拼写,这是
236
261
  `session.openWorkspacePath` / `workspacePathApplications` 校验所要求的形态
237
262
  (issue #37);客户端 `fileMediaUrl` 拒绝 `\\` 开头的路径,因此 Markdown
238
263
  预览中的相对图片无法解析。聊天侧因 cwd 本就是 UNC,此前已有同一缺口。
239
264
  GUI change feed、`stat.absolutePath` 与预览头部的路径标签的 UNC 形态也源于同一拼写。
265
+
266
+ ## 侧栏终端字体
267
+
268
+ - **终端字体是 DSH 用户设置,不是插件设置。** 在 `0.2.2-rc.2` 上,侧栏终端渲染
269
+ `ui-theme.terminalFontFamily`(空值回退到内置 `ui-monospace`/Consolas 栈),
270
+ 该字段存放在 profile 的 `cordis.patch.yml`。请在
271
+ **设置 → 通用 → 字体 → 终端字体** 里设置一次,不要手改 profile;Desktop 的
272
+ 致命错误恢复会把 profile patch 改名为 `.bak-*` 兄弟文件,手加的行随之丢失。
273
+ 若该选择必须熬过这次恢复,请把完整的 `ui-theme` 行镜像到
274
+ `$DSH_HOME/cordis.patch.yml`:home 层不会被改名,但 patch 会替换该行的整个
275
+ config,因此要重述所有保留字段。插件不拥有渲染层字体,也从不写这项设置。
package/docs/MIGRATION.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Configuration stability and migration
2
2
 
3
+ [中文](MIGRATION.zh.md)
4
+
3
5
  What a release may change, how a breaking configuration change is announced and
4
6
  carried, and which gates a release must clear. The version table in
5
7
  [RELEASING.md](RELEASING.md#1-decide-the-version) is the source for the bump; this
@@ -74,11 +76,12 @@ shows the composed value.
74
76
  | Gate | How | Runs where |
75
77
  |---|---|---|
76
78
  | Config docs and CHANGELOG current | review the diff; `lint:links` covers cross-references | CI |
77
- | `pnpm test` | style, links, requirement citations, doc consistency, syntax, build freshness, tsc, 48 unit files | CI (Node 22/24, Ubuntu + Windows) |
79
+ | `pnpm test` | style, links, requirement citations, doc consistency, syntax, build freshness, tsc, and the unit files | CI (Node 22/24, Ubuntu + Windows) |
78
80
  | `pnpm run test:coverage` | lines 85 / branches 84 / functions 70 | CI (Node 24, Ubuntu) |
79
- | Peer line tested | `peer-canary` workflow resolves `next` and runs the scratch upgrade | CI schedule/manual |
81
+ | `pnpm run test:browser` | the plugin web bundle in headless Chromium (layout, clicks, badge timing); install Chromium once | CI (`browser` job, Ubuntu) and the release `Gates` |
82
+ | Peer line tested | floor `>=0.2.2-rc.2`; the `peer-canary` workflow resolves `next` and runs the scratch upgrade | CI schedule/manual |
80
83
  | Packed install/upgrade/uninstall | `pnpm run e2e:install` (temp `DSH_HOME`, 0.17.1 → current over the peer raise, marker) | manual, this machine (10/10 on 2026-11-06; the origin moved 0.11.0 → 0.17.1 because dsh 0.2.2-rc.1 rightly rejects the exact-pin era) |
81
- | Real-machine probe suite | `test/probe/run-all-when-closed.sh --include-fs` (needs the app closed) | manual; 15/15 on 2026-10-31 and again 2026-11-05 (docs/superpowers/probe-runs/); the suite grew to 17 on 2026-11-06 — the first 17-probe run on the same day passed 16 and failed the new `two-distro.sh` on a wrong assertion vehicle (session-scoped `DSH_WSL_DISTRO` is absent on a direct `ctx.shell` seam); after the probe was reworked to per-distro `/tmp` markers it passed alone, giving all 17 probes a pass on this machine (2026-11-06-probe-suite.md) |
84
+ | Real-machine probe suite | `test/probe/run-all-when-closed.sh --include-fs` (needs the app closed) | manual; 15/15 on 2026-10-31 and again 2026-11-05 (docs/superpowers/probe-runs/); the suite grew to 17 on 2026-11-06 — the first 17-probe run on the same day passed 16 and failed the new `two-distro.sh` on a wrong assertion vehicle (session-scoped `DSH_WSL_DISTRO` is absent on a direct `ctx.shell` seam); after the probe was reworked to per-distro `/tmp` markers it passed alone, giving all 17 probes a pass on this machine (2026-11-06-probe-suite.md); 17/17 again on 2026-11-12 against the rc.2 host |
82
85
  | Clean Win11 + Ubuntu first run ≤ 5 min | a clean machine, a stopwatch | **not run** (the project's machine is already configured) |
83
86
  | aarch64 executed | the native 18-check suite under qemu in CI | **run in CI** (physical aarch64 WSL is out of scope; see COMPATIBILITY.md) |
84
87
  | No open P0 bug for 30 days | issue tracker | time-based; cannot be asserted from a checkout |