dsh-plugin-wsl-env 0.28.0 → 0.29.1
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.
- package/CHANGELOG.md +368 -0
- package/CONTRIBUTING.md +68 -12
- package/CONTRIBUTING.zh.md +34 -4
- package/README.md +1 -1
- package/agent/native/linux-aarch64/dsh-wsl-agent +0 -0
- package/agent/native/linux-x86_64/dsh-wsl-agent +0 -0
- package/agent/wsl-agent.sh +15 -4
- package/client.js +540 -160
- package/cordis.patch.yml +28 -7
- package/docs/AGENT-PROTOCOL-V7.md +4 -2
- package/docs/API.md +1 -1
- package/docs/API.zh.md +1 -1
- package/docs/ARCHITECTURE.md +7 -4
- package/docs/ARCHITECTURE.zh.md +6 -4
- package/docs/COMPATIBILITY.md +1 -1
- package/docs/COMPATIBILITY.zh.md +1 -1
- package/docs/CONFIGURATION.md +28 -15
- package/docs/CONFIGURATION.zh.md +20 -11
- package/docs/DIAGNOSTICS.md +45 -19
- package/docs/DIAGNOSTICS.zh.md +33 -15
- package/docs/LIMITATIONS.md +70 -10
- package/docs/LIMITATIONS.zh.md +53 -8
- package/docs/PERFORMANCE.md +29 -1
- package/docs/PERFORMANCE.zh.md +23 -1
- package/docs/QUICKSTART.md +21 -15
- package/docs/QUICKSTART.zh.md +13 -11
- package/docs/README.zh.md +1 -1
- package/docs/RELEASING.md +29 -6
- package/docs/RELEASING.zh.md +9 -0
- package/docs/adr/0002-native-agent.md +50 -2
- package/lib/agent-confined.js +15 -4
- package/lib/agent-errors.d.ts +16 -0
- package/lib/agent-errors.js +19 -0
- package/lib/agent-exec.d.ts +8 -1
- package/lib/agent-exec.js +2 -1
- package/lib/agent-shared.d.ts +85 -2
- package/lib/agent-shared.js +167 -38
- package/lib/agent.d.ts +60 -6
- package/lib/agent.js +177 -28
- package/lib/auto-preset.js +7 -2
- package/lib/doctor-live.d.ts +36 -7
- package/lib/doctor-live.js +61 -12
- package/lib/doctor-process.d.ts +68 -0
- package/lib/doctor-process.js +139 -0
- package/lib/doctor-report.js +11 -109
- package/lib/fs-substrate.js +3 -3
- package/lib/fsio-agent.d.ts +57 -6
- package/lib/fsio-agent.js +168 -75
- package/lib/git-exec.d.ts +7 -1
- package/lib/git-exec.js +14 -2
- package/lib/native-agent.d.ts +25 -4
- package/lib/native-agent.js +52 -9
- package/lib/picker.d.ts +2 -1
- package/lib/picker.js +30 -13
- package/lib/plugin-update.js +18 -14
- package/lib/provider-common.d.ts +112 -0
- package/lib/provider-common.js +171 -0
- package/lib/sandbox-core.js +52 -13
- package/lib/search-exec.d.ts +6 -0
- package/lib/search-exec.js +10 -2
- package/lib/session-runtime.d.ts +46 -1
- package/lib/session-runtime.js +57 -7
- package/lib/session-scope.d.ts +22 -1
- package/lib/session-scope.js +33 -7
- package/lib/shell-env.js +125 -12
- package/lib/socket-isolation.d.ts +12 -4
- package/lib/socket-isolation.js +27 -10
- package/lib/status.d.ts +7 -4
- package/lib/status.js +72 -16
- package/lib/subprocess.js +3 -3
- package/lib/terminal-activity.js +6 -9
- package/lib/wsl-doctor-command.js +36 -80
- package/lib/wsl-filesystem.d.ts +9 -4
- package/lib/wsl-filesystem.js +26 -10
- package/lib/wsl-shell.d.ts +27 -17
- package/lib/wsl-shell.js +83 -24
- package/lib/wsl.d.ts +3 -1
- package/lib/wsl.js +82 -7
- package/package.json +5 -4
- package/scripts/bootstrap.sh +36 -12
- package/scripts/doctor.mjs +514 -201
package/docs/LIMITATIONS.md
CHANGED
|
@@ -48,8 +48,8 @@ operations never use the 9p share.
|
|
|
48
48
|
fails explicitly too (rg's error code 2, because `1` means "no matches").
|
|
49
49
|
Commands and the resident agent both inherit `wsl.exe`'s default PATH, so a
|
|
50
50
|
user-local install under `~/.local/bin` is invisible — install it
|
|
51
|
-
system-wide, or somewhere on that PATH. Install: `wsl.exe -d <distro> -u root -- apt-get install -y bubblewrap
|
|
52
|
-
|
|
51
|
+
system-wide, or somewhere on that PATH. Install: `wsl.exe -d <distro> -u root -- sh -c "apt-get update -qq && apt-get install -y --no-install-recommends bubblewrap git ripgrep inotify-tools"`
|
|
52
|
+
(or the detected family's spelling). `--install` runs it
|
|
53
53
|
only for a missing `bubblewrap`.
|
|
54
54
|
- **`watch()` is coarse invalidation, not per-file notifications**: inotify events
|
|
55
55
|
coalesced to 0.5 s, or a `find -newer` poll loop otherwise. The polling path misses
|
|
@@ -61,6 +61,14 @@ operations never use the 9p share.
|
|
|
61
61
|
- `editText` reads the whole file into memory before writing it back.
|
|
62
62
|
- A distro that dies with a request in flight spends the resident's one rebuild;
|
|
63
63
|
still down, the resident stays out until the app restarts.
|
|
64
|
+
- **The native agent is demoted only on evidence, and tried again** — there is
|
|
65
|
+
one shared agent instance per distro, and it recovers through its own rebuild
|
|
66
|
+
and revival budget rather than being replaced. The reads move to the shell
|
|
67
|
+
agent only when the native entry fails a start and the shell entry then
|
|
68
|
+
starts on the same distro, and native is tried again after five minutes. A
|
|
69
|
+
distro that is down fails both entries alike, which is not held against the
|
|
70
|
+
native one; a failed preparation (copy, digest, execute check) is not
|
|
71
|
+
remembered as a verdict either — the next start prepares again.
|
|
64
72
|
|
|
65
73
|
## The GUI workspace-files service
|
|
66
74
|
|
|
@@ -81,23 +89,67 @@ operations never use the 9p share.
|
|
|
81
89
|
upstream `FileReferenceTraversal` seam:
|
|
82
90
|
[UPSTREAM-FILE-REFERENCE-SEAM.md](UPSTREAM-FILE-REFERENCE-SEAM.md).
|
|
83
91
|
|
|
92
|
+
## Bundled skills
|
|
93
|
+
|
|
94
|
+
`preset-wsl` keeps the row set of the app's own standard mode, and its
|
|
95
|
+
`skill-filesystem` row carries the upstream `customSkillDirs` unchanged: the
|
|
96
|
+
`skills` directory the agent preset package ships inside the app's
|
|
97
|
+
installation. That directory is on the host, while this preset's filesystem is
|
|
98
|
+
the distro's:
|
|
99
|
+
|
|
100
|
+
- **Bundled skills are read through the distro's `/mnt/<drive>/…`**: `wsl-fs`
|
|
101
|
+
maps a host drive path to the distro's mount point and the resident agent
|
|
102
|
+
reads it (measured 2026-11-24: an unpacked host directory resolves and
|
|
103
|
+
lists). A distro that mounts its drives elsewhere (`automount.root` in
|
|
104
|
+
`/etc/wsl.conf`) cannot read them.
|
|
105
|
+
- **A WSL session on the Desktop package has no bundled skills**: the app's
|
|
106
|
+
`node_modules` live inside the `app.asar` archive, `/mnt/c/…/app.asar/…` is
|
|
107
|
+
not a directory inside the distro, and `wsl-fs` refuses it with
|
|
108
|
+
`FS_NOT_DIRECTORY` (measured 2026-11-24). The skill provider treats such a
|
|
109
|
+
root as absent and skips it, so the bundled `dsh-doc` never reaches the tool
|
|
110
|
+
surface, while the other skill roots (the project's and the user's
|
|
111
|
+
directories) are unaffected. The host mode reads the archive through the app
|
|
112
|
+
process and has no such limit.
|
|
113
|
+
|
|
84
114
|
## The sandbox
|
|
85
115
|
|
|
86
116
|
- **The one-shot fallback has only the host deadline** — a killed `wsl.exe` does not
|
|
87
117
|
relay the kill into the distro, so the Linux process tree can outlive the call.
|
|
88
118
|
Prefer `agent: true` and the session runtime for long commands.
|
|
119
|
+
- **A command in flight when the resident is lost is not run again** — a command the
|
|
120
|
+
resident never took (dead, backing off, handshake failed) falls back to the one-shot
|
|
121
|
+
`wsl.exe`. When the resident dies while a command is running, the command may
|
|
122
|
+
already have taken effect: it fails as "state is unknown", with the advice to
|
|
123
|
+
inspect the distro first, and is not executed a second time on the one-shot path.
|
|
89
124
|
- **Batch reads share one native agent per distro** (16 concurrent calls in
|
|
90
125
|
2.4-4.1 ms; first call pays ~70 ms preparation).
|
|
91
126
|
- **aarch64 runs under qemu in CI only** (no Windows-on-ARM machine in reach —
|
|
92
127
|
[COMPATIBILITY.md](COMPATIBILITY.md#scope-decisions)). `auto` still selects the
|
|
93
128
|
packaged binary; `native` refuses on preparation failure; `shell` forces the shell
|
|
94
129
|
agent.
|
|
130
|
+
- **The hosted cloud WSL gate runs the full probe suite as the distro's root
|
|
131
|
+
user** — `.github/workflows/cloud-wsl-gate.yml` executes
|
|
132
|
+
`run-all-when-closed.sh` through `-u root` and enables linger for root only. A
|
|
133
|
+
real deployment uses an ordinary distro user: the unprivileged user namespace,
|
|
134
|
+
the user-level systemd manager and its linger are a different path, so passing
|
|
135
|
+
as root does not prove the non-root path. That path stays with the
|
|
136
|
+
maintainer-run real-machine probes; this gate does not claim to cover it
|
|
137
|
+
(#88).
|
|
95
138
|
- **The session runtime needs systemd and a lingering user manager** — refused on the
|
|
96
139
|
first command with the remedy otherwise; `sessionSandbox` set to `auto`
|
|
97
140
|
(per-command without systemd) or `false` keeps the old per-command shape.
|
|
98
141
|
A hard app crash can leave a stale `dsh-wsl-*.scope`; the
|
|
99
142
|
preflight sweeps stale scopes on the next WSL session (never another live
|
|
100
143
|
session's).
|
|
144
|
+
- **A session runtime is released with the session's agent** — when the agent is
|
|
145
|
+
disposed (upstream's `agent/disposed`), both providers drop their references
|
|
146
|
+
for that session, the scope stops, and the background processes inside it are
|
|
147
|
+
reaped. The current harness (≤ 0.2.2-rc.5) does not dispose an agent when a
|
|
148
|
+
session view is closed — agents live until the app exits — so until then every
|
|
149
|
+
session that ran a command keeps one runtime. A fallback sweep underneath ends
|
|
150
|
+
a session whose runtimes have been quiet for ten minutes with no live agent
|
|
151
|
+
behind them (or that never named a session); a live session's runtime has no
|
|
152
|
+
idle limit.
|
|
101
153
|
- **The sandbox does not govern WSL interop** — reported as `enforcement: partial`.
|
|
102
154
|
`maskWindowsDrive` and `interopVisibility` narrow `/mnt` but are not a closure;
|
|
103
155
|
even `interopVisibility: "disabled"` only produces the `wsl.conf`
|
|
@@ -170,7 +222,10 @@ absolute path to pin one.
|
|
|
170
222
|
(`doctorReport` merges `WslAgent.status()` via `mergeLiveResidentStatus`,
|
|
171
223
|
0.18.0), but the CLI's handshake check still names its probe source
|
|
172
224
|
(`probed: a fresh resident`); without an app-side call the `lastError`
|
|
173
|
-
stays in the app log.
|
|
225
|
+
stays in the app log. A resident that is dead fails the merged check and the
|
|
226
|
+
report's verdict follows; a resident that recovered keeps the fresh probe's
|
|
227
|
+
verdict, and when the reads are not on the native agent the merged detail
|
|
228
|
+
says why.
|
|
174
229
|
- **`dsh-wsl-*.scope` counts are point-in-time**; `--fix` runs the preflight's sweep.
|
|
175
230
|
- **The doctor's `git.win-safe` probe reports the Windows git trust through interop
|
|
176
231
|
`git.exe`** — the `safe.directory` whitelist that WSL change review needs when
|
|
@@ -204,10 +259,11 @@ remedy-only — the remedy text carries the exact command — and the fixable se
|
|
|
204
259
|
is limited to what is safe and reversible (stale scopes, the plugin-owned
|
|
205
260
|
agent cache, the optional packages behind `--install` plus a confirmation, and
|
|
206
261
|
the Windows git safe.directory whitelist behind the same gate). `--fix-owned`
|
|
207
|
-
narrows a
|
|
208
|
-
sidebar
|
|
209
|
-
a package or write Windows-owned
|
|
210
|
-
remedy-only warning is auto-fixable.
|
|
262
|
+
narrows a repair to the plugin-owned two (stale scopes and the cache); the
|
|
263
|
+
sidebar's **修复插件状态** action is exactly that run, while full diagnosis
|
|
264
|
+
itself is read-only. It can never install a package or write Windows-owned
|
|
265
|
+
configuration, and it never implies that a remedy-only warning is auto-fixable.
|
|
266
|
+
The verdict never upgrades the
|
|
211
267
|
sandbox's security statement: `enforcement: partial` is untouched.
|
|
212
268
|
|
|
213
269
|
## Session-start advisories
|
|
@@ -242,9 +298,13 @@ sandbox's security statement: `enforcement: partial` is untouched.
|
|
|
242
298
|
|
|
243
299
|
## Ports
|
|
244
300
|
|
|
245
|
-
- **The port poller keeps the resident agent
|
|
246
|
-
(
|
|
247
|
-
|
|
301
|
+
- **The port poller keeps the resident agent warm for the distros in use** — it
|
|
302
|
+
refreshes every `portsRefreshMs` (10 s by default) while a live session works
|
|
303
|
+
in a distro, and stops with the last of them, which is when the agent can
|
|
304
|
+
idle out. Each round asks WSL which distros are running first: a stopped
|
|
305
|
+
distro is not probed (the probe would boot it) and `DSH_WSL_PORTS` reads
|
|
306
|
+
empty for it. Raising `portsRefreshMs` past the agent's idle timeout brings
|
|
307
|
+
idle shutdown forward, at the cost of staler port facts.
|
|
248
308
|
|
|
249
309
|
## The directory picker
|
|
250
310
|
|
package/docs/LIMITATIONS.zh.md
CHANGED
|
@@ -18,6 +18,12 @@ Windows 侧 share 后端(`substrate: "share"`)在启动时被拒绝;WSL
|
|
|
18
18
|
substrate,并附带恢复路径。一次崩溃可用一次重建;重建耗尽后进入有界复活
|
|
19
19
|
(2/4/8 s),共三次尝试;第 4 次死亡才永久退出,直到应用重启。没有回退
|
|
20
20
|
I/O——这是有意为之。
|
|
21
|
+
- **native agent 的降级只凭证据,并且会自动重试** —— 每个 distro 只有一个共享
|
|
22
|
+
agent 实例,死亡后由它自己的重建与复活预算恢复,不会被换成一个新实例。
|
|
23
|
+
只有当一次启动里失败的是 native 入口、而随后的 shell 入口在同一发行版上
|
|
24
|
+
启动成功时,读操作才改走 shell agent,5 分钟后再试 native。发行版本身宕机
|
|
25
|
+
时两种入口一样失败,不算在 native 头上;准备失败(复制、校验、执行检查)
|
|
26
|
+
也不会被当成结论缓存,下一次启动会重新准备。
|
|
21
27
|
- **变更守卫不是原子的比较并交换。** 创建使用不可替换的 link;覆盖在 rename 前
|
|
22
28
|
会重新校验版本。不匹配时返回 `FS_STALE_VERSION`,但检查与 rename 之间发生的
|
|
23
29
|
变更仍可能被覆盖。
|
|
@@ -44,8 +50,8 @@ Windows 侧 share 后端(`substrate: "share"`)在启动时被拒绝;WSL
|
|
|
44
50
|
provider 错误;工作目录缺失同样显式失败(rg 的错误码 2,`1` 只表示"无
|
|
45
51
|
匹配")。命令与常驻 agent 都继承 `wsl.exe` 的默认 PATH,因此
|
|
46
52
|
`~/.local/bin` 下的用户级安装不可见——请装成系统级,或放在那个 PATH 上。
|
|
47
|
-
安装:`wsl.exe -d <distro> -u root -- apt-get install -y bubblewrap
|
|
48
|
-
|
|
53
|
+
安装:`wsl.exe -d <distro> -u root -- sh -c "apt-get update -qq && apt-get install -y --no-install-recommends bubblewrap git ripgrep inotify-tools"`
|
|
54
|
+
(或检测到的包管理族对应的写法)。`--install` 只在
|
|
49
55
|
缺少 `bubblewrap` 时才执行安装。
|
|
50
56
|
- **`watch()` 是粗粒度失效,不是逐文件通知**:inotify 事件合并到 0.5 s,
|
|
51
57
|
否则使用 `find -newer` 轮询循环。轮询路径会遗漏原地的 `cp -p`,以及恢复
|
|
@@ -77,21 +83,55 @@ Windows 侧 share 后端(`substrate: "share"`)在启动时被拒绝;WSL
|
|
|
77
83
|
`FileReferenceTraversal` 接缝:
|
|
78
84
|
[UPSTREAM-FILE-REFERENCE-SEAM.md](UPSTREAM-FILE-REFERENCE-SEAM.md)。
|
|
79
85
|
|
|
86
|
+
## 内置 skill
|
|
87
|
+
|
|
88
|
+
`preset-wsl` 与应用自带的标准模式保持同一份行集,其中 `skill-filesystem`
|
|
89
|
+
的 `customSkillDirs` 照搬上游,指向应用安装目录里 agent preset 包自带的
|
|
90
|
+
`skills` 目录。该目录在宿主上,而本 preset 的文件系统是发行版的:
|
|
91
|
+
|
|
92
|
+
- **内置 skill 经发行版的 `/mnt/<盘符>/…` 读取**:`wsl-fs` 把宿主盘符路径
|
|
93
|
+
映射到发行版的挂载点,再由常驻 agent 读取(2026-11-24 实测:未打包的
|
|
94
|
+
宿主目录 `resolve` 与 `listDir` 正常)。发行版把盘符挂在别处
|
|
95
|
+
(`/etc/wsl.conf` 的 `automount.root`)时读不到。
|
|
96
|
+
- **Desktop 安装包的 WSL 会话里没有内置 skill**:应用的 `node_modules` 打在
|
|
97
|
+
`app.asar` 归档内,`/mnt/c/…/app.asar/…` 在发行版内不是目录,`wsl-fs`
|
|
98
|
+
以 `FS_NOT_DIRECTORY` 拒绝(2026-11-24 实测);skill 提供方把这类根按
|
|
99
|
+
「不存在」跳过,所以内置的 `dsh-doc` 不会出现在工具面,其余 skill 根
|
|
100
|
+
(项目目录、用户目录)不受影响。宿主模式由应用进程直接读归档,没有
|
|
101
|
+
这个限制。
|
|
102
|
+
|
|
80
103
|
## 沙箱
|
|
81
104
|
|
|
82
105
|
- **一次性回退路径只有宿主截止时间** —— `wsl.exe` 被杀时不会把 kill 传进
|
|
83
106
|
发行版,因此 Linux 进程树可能比调用活得更久。长命令建议
|
|
84
107
|
`agent: true` 并使用会话 runtime。
|
|
108
|
+
- **常驻 agent 丢失时已在途的命令不会重跑** —— 命令尚未到达常驻 agent
|
|
109
|
+
(agent 已死、正在退避、握手失败)时回退到一次性 `wsl.exe`。常驻 agent
|
|
110
|
+
在命令执行途中死亡时,命令可能已经生效:它以「状态未知」失败,并提示先
|
|
111
|
+
检查发行版,不会在一次性路径上再执行一遍。
|
|
85
112
|
- **批量读取按发行版共享一个原生 agent**(16 个并发调用 2.4-4.1 ms;
|
|
86
113
|
第一次调用要付出约 70 ms 的准备)。
|
|
87
114
|
- **aarch64 只在 CI 中于 qemu 下运行**(身边没有 Windows-on-ARM 机器——
|
|
88
115
|
[COMPATIBILITY.md](COMPATIBILITY.md#scope-decisions))。`auto` 仍会选择
|
|
89
116
|
包内二进制;`native` 在准备失败时拒绝;`shell` 强制使用 shell agent。
|
|
117
|
+
- **托管的 cloud WSL 门禁以发行版的 root 用户跑完整探针套件** ——
|
|
118
|
+
`.github/workflows/cloud-wsl-gate.yml` 以 `-u root` 执行
|
|
119
|
+
`run-all-when-closed.sh`,并只为 root 开启 linger。真实部署使用普通 distro
|
|
120
|
+
用户:非特权 user namespace、用户级 systemd 与 linger 是另一条路径,root
|
|
121
|
+
下通过不等于普通用户下通过。普通用户路径仍以真机探针为准,该门禁不声称
|
|
122
|
+
覆盖它(见 #88)。
|
|
90
123
|
- **会话 runtime 需要 systemd 和带 linger 的 user manager** —— 否则在
|
|
91
124
|
第一条命令时被拒绝并给出补救方法;把 `sessionSandbox` 设为 `auto`
|
|
92
125
|
(无 systemd 时即按命令形态)或 `false` 保留旧的按命令形态。应用硬崩溃
|
|
93
126
|
可能留下过期的 `dsh-wsl-*.scope`;预检会在下一个
|
|
94
127
|
WSL 会话时清扫过期 scope(从不清扫其他活跃会话的)。
|
|
128
|
+
- **会话 runtime 随会话的 agent 释放** —— 会话的 agent 被处置(上游的
|
|
129
|
+
`agent/disposed`)时,两个 provider 各自放掉该会话的引用,scope 被停止,
|
|
130
|
+
其中的后台进程一并回收。当前 Harness(≤ 0.2.2-rc.5)在关闭会话视图时并不
|
|
131
|
+
处置 agent,而是保留到应用退出,所以在此之前每个跑过命令的会话各有一个
|
|
132
|
+
runtime。另有一层兜底清扫:runtime 连续 10 分钟没有任何交换、且已没有活跃
|
|
133
|
+
agent 属于该会话(或它从未指明会话)时,该会话结束;会话仍活跃的 runtime
|
|
134
|
+
不设空闲时限。
|
|
95
135
|
- **沙箱不管辖 WSL interop** —— 上报为 `enforcement: partial`。
|
|
96
136
|
`maskWindowsDrive` 和 `interopVisibility` 收窄 `/mnt` 但不是关闭;即使是
|
|
97
137
|
`interopVisibility: "disabled"` 也只是给出 `wsl.conf` 中
|
|
@@ -152,7 +192,9 @@ Windows 侧 share 后端(`substrate: "share"`)在启动时被拒绝;WSL
|
|
|
152
192
|
在跑的那个——存在共享 agent 时,doctorReport 会经
|
|
153
193
|
`mergeLiveResidentStatus` 合入 `WslAgent.status()` 的在驻视角(0.18.0),
|
|
154
194
|
但 CLI 的握手检查仍会标注其探测来源(`probed: a fresh resident`);
|
|
155
|
-
没有应用侧调用时,`lastError`
|
|
195
|
+
没有应用侧调用时,`lastError` 仍留在应用日志里。已经死亡的常驻 agent
|
|
196
|
+
会让合并后的检查失败,报告的 verdict 随之变为 blocked;恢复后的常驻
|
|
197
|
+
agent 沿用新探测的结论,读操作不在 native agent 上时合并详情会写明原因。
|
|
156
198
|
- **`dsh-wsl-*.scope` 计数是某一时刻的快照**;`--fix` 会执行预检的清扫。
|
|
157
199
|
- **doctor 的 `git.win-safe` 探针通过 interop 的 `git.exe` 报告 Windows git
|
|
158
200
|
的信任状态** —— 装了 Windows git 时,WSL 变更审查需要那份
|
|
@@ -180,8 +222,8 @@ doctor 的 `verdict` 在生效配置(应用加载的 profile 层叠加在随
|
|
|
180
222
|
携带确切的命令;可自动修复的集合仅限安全且可逆的部分(过期 scope、插件自有的
|
|
181
223
|
agent 缓存、`--install` 加确认后的可选软件包、以及同一道确认门后的
|
|
182
224
|
Windows git `safe.directory` 白名单)。`--fix-owned` 把运行收窄到插件自有
|
|
183
|
-
的两类(过期 scope
|
|
184
|
-
|
|
225
|
+
的两类(过期 scope 与缓存);侧边栏面板的“修复插件状态”动作正是这次运行,
|
|
226
|
+
完整诊断本身只读。因此它永远不会安装软件包或改写 Windows 所有的配置,也不会暗示仅能手动处理的告警
|
|
185
227
|
可被自动修复。裁决从不升级沙箱的安全声明:
|
|
186
228
|
`enforcement: partial` 不受影响。
|
|
187
229
|
|
|
@@ -210,9 +252,12 @@ Windows git `safe.directory` 白名单)。`--fix-owned` 把运行收窄到插
|
|
|
210
252
|
|
|
211
253
|
## 端口
|
|
212
254
|
|
|
213
|
-
- **端口轮询让常驻 agent
|
|
214
|
-
|
|
215
|
-
|
|
255
|
+
- **端口轮询让常驻 agent 在使用它的发行版上保持保温** —— 只要有存活
|
|
256
|
+
会话在该发行版里工作,就每 `portsRefreshMs`(默认 10 s)刷新一次;会话
|
|
257
|
+
都结束后停止轮询,agent 才会空闲关停。每个周期先向 WSL 确认哪些发行版
|
|
258
|
+
在运行:已停止的发行版不会被探测(探测会把它重新启动起来),
|
|
259
|
+
`DSH_WSL_PORTS` 读作空。把 `portsRefreshMs` 调到超过 agent 的空闲超时可以
|
|
260
|
+
提早恢复空闲关停,代价是端口事实更陈旧。
|
|
216
261
|
|
|
217
262
|
## 目录选择器
|
|
218
263
|
|
package/docs/PERFORMANCE.md
CHANGED
|
@@ -33,6 +33,31 @@ Absolute numbers are machine-dependent; the ratio and the budgets are the point.
|
|
|
33
33
|
| GUI-preview backend: `stat` | — | p95 **2.7 ms** | `pnpm run probe:gui-preview` (20 iterations, 2026-10-19) |
|
|
34
34
|
| GUI-preview backend: listing | — | p95 **5.1 ms** | same |
|
|
35
35
|
| GUI-preview backend: 1 MiB page | — | p95 **63.5 ms/MiB** | same |
|
|
36
|
+
| Whole-file read of 1 MiB (native agent) | — | median **15.0 ms** (26.6 ms with the read window inside the batched frame) | #76, 2026-11-24 |
|
|
37
|
+
| Parsing one 16 MiB response frame (arriving in 64 KiB chunks) | — | **83 ms** of the host event loop (2678 ms when every chunk re-joined one growing string) | same, host side only |
|
|
38
|
+
| Listing a directory of 200 symlinks | — | median **6.1 ms** (136.3 ms with two round trips per link) | same |
|
|
39
|
+
| A 64–256 KiB stdin payload through `wsl.exe` (native agent) | — | median **18–67 ms** (114–117 ms as one write) | #86, 2026-11-24, Windows host Node |
|
|
40
|
+
|
|
41
|
+
The first three rows dated 2026-11-24 were measured on WSL 2 Ubuntu x86_64
|
|
42
|
+
with the native agent started directly inside the distro (no `wsl.exe` hop), as
|
|
43
|
+
the median of 15 runs; the numbers in parentheses are the previous code on the
|
|
44
|
+
same machine. They stand for three structural costs — a read payload
|
|
45
|
+
base64-encoded twice inside a batched frame, a whole frame re-joined and
|
|
46
|
+
re-scanned on every chunk, and two round trips per symlink — so what went away
|
|
47
|
+
is the term that grew with the square of the size, not merely a constant.
|
|
48
|
+
|
|
49
|
+
The stdin row was measured on the same machine from Node v24.17 on the Windows
|
|
50
|
+
host, through `wsl.exe`, as time to result. A frame above one pipe buffer
|
|
51
|
+
(64 KiB) written as one `write()` cost a fixed ~100 ms before the resident had
|
|
52
|
+
the rest of it — its own `ACK` was what arrived late — while the same binary
|
|
53
|
+
started directly inside the distro answered a 68 KiB payload in 14 ms. The
|
|
54
|
+
piece size is not the cause (the same bytes written back to back as several
|
|
55
|
+
pieces pay it too), nor is the reader (`cat` and a line-at-a-time reader see
|
|
56
|
+
68 KiB in under 5 ms); what removes the cost is a timer turn between the
|
|
57
|
+
pieces. Frames between 64 KiB and 512 KiB now go out in pieces; larger ones
|
|
58
|
+
stay one write (a 512 KiB payload: 123 ms as one write, 144 ms pieced). A
|
|
59
|
+
timer turn costs about 10 ms on a Windows host, so it is paid only inside the
|
|
60
|
+
band where the measurement says it wins.
|
|
36
61
|
|
|
37
62
|
The GUI-preview number covers the routed backend operations a preview pays.
|
|
38
63
|
The shipped `workspace-files` service adds its own calls on top; that service
|
|
@@ -51,7 +76,10 @@ node test/probe/fs-queue.mjs # the agent queue, sequential vs concurrent, w
|
|
|
51
76
|
|
|
52
77
|
Both need WSL interop, a working distro and Node; neither boots the harness.
|
|
53
78
|
The queue measurement also needs systemd and a usable native binary; it prints
|
|
54
|
-
wall times and queue metrics but does not enforce latency budgets.
|
|
79
|
+
wall times and queue metrics but does not enforce latency budgets. It prints
|
|
80
|
+
one `stdin write` row per payload size; the step that row is about shows only
|
|
81
|
+
when the probe runs from Node on the Windows host — inside the distro the
|
|
82
|
+
pieces are written just the same, but one write never paid it there. The GUI-preview
|
|
55
83
|
probe reports p50/p95/max and fails when its budgets are exceeded.
|
|
56
84
|
|
|
57
85
|
## What is not measured
|
package/docs/PERFORMANCE.zh.md
CHANGED
|
@@ -31,6 +31,26 @@ GUI 文件树、预览和模型的文件工具都走 agent 路径。设计与权
|
|
|
31
31
|
| GUI 预览后端:`stat` | — | p95 **2.7 ms** | `pnpm run probe:gui-preview`(20 次迭代,2026-10-19) |
|
|
32
32
|
| GUI 预览后端:目录列举 | — | p95 **5.1 ms** | 同上 |
|
|
33
33
|
| GUI 预览后端:1 MiB 页面 | — | p95 **63.5 ms/MiB** | 同上 |
|
|
34
|
+
| 整文件读取 1 MiB(native agent) | — | 中位 **15.0 ms**(读窗口放进批量帧时为 26.6 ms) | #76,2026-11-24 |
|
|
35
|
+
| 解析一个 16 MiB 的响应帧(按 64 KiB 分块到达) | — | 占用宿主事件循环 **83 ms**(逐块拼接到一个增长的字符串时为 2678 ms) | 同上,纯宿主侧 |
|
|
36
|
+
| 列举含 200 个符号链接的目录 | — | 中位 **6.1 ms**(每个链接各走两次往返时为 136.3 ms) | 同上 |
|
|
37
|
+
| 经 `wsl.exe` 的 64–256 KiB stdin 载荷(native agent) | — | 中位 **18–67 ms**(一次写入时为 114–117 ms) | #86,2026-11-24,Windows 宿主 Node |
|
|
38
|
+
|
|
39
|
+
2026-11-24 的前三行在 WSL 2 Ubuntu x86_64 上测得:native agent 直接在
|
|
40
|
+
发行版内启动(不经 `wsl.exe`),取 15 次运行的中位数;括号里是同一台
|
|
41
|
+
机器上改动之前的代码。它们对应三处结构性开销——读载荷在批量帧里被
|
|
42
|
+
base64 编码两次、每来一块就把整帧重新拼接并扫描、每个符号链接各付两次
|
|
43
|
+
往返——所以消除的是随大小平方增长的那一项,而不只是常数。
|
|
44
|
+
|
|
45
|
+
stdin 一行在同一台机器的 Windows 宿主上用 Node v24.17 测得(经
|
|
46
|
+
`wsl.exe`,计时到结果)。超过一个管道缓冲(64 KiB)的帧一次写入,要等
|
|
47
|
+
固定约 100 ms 常驻进程才拿到其余部分——迟到的是它自己的 `ACK`——而同一个
|
|
48
|
+
二进制直接在发行版内启动时,68 KiB 载荷 14 ms 就返回。分片大小不是原因
|
|
49
|
+
(同样的字节背靠背写成多片一样要付),读方也不是(`cat` 和逐行读取器
|
|
50
|
+
5 ms 内拿到 68 KiB);去掉这笔开销的是片与片之间让出一个定时器回合。
|
|
51
|
+
现在 64 KiB 到 512 KiB 之间的帧分片写入,更大的帧保持一次写入(512 KiB
|
|
52
|
+
载荷:一次写入 123 ms,分片 144 ms)。Windows 上一个定时器回合约 10 ms,
|
|
53
|
+
所以只在实测划算的区间内支付。
|
|
34
54
|
|
|
35
55
|
GUI 预览数字覆盖一次预览所支付的、经路由的后端操作。随包的
|
|
36
56
|
`workspace-files` 服务会在其上追加自己的调用;该服务的形态在
|
|
@@ -48,7 +68,9 @@ node test/probe/fs-queue.mjs # the agent queue, sequential vs concurrent, w
|
|
|
48
68
|
|
|
49
69
|
两者都需要 WSL 互操作、可用的发行版和 Node;都不启动 harness。队列测量还
|
|
50
70
|
需要 systemd 和可用的原生二进制;它打印实际耗时和队列指标,但不强制延迟
|
|
51
|
-
|
|
71
|
+
预算。队列测量按载荷大小各打印一行 `stdin write`;那一节只有从 Windows
|
|
72
|
+
宿主的 Node 运行时才看得到台阶——在发行版内运行时分片同样生效,但一次
|
|
73
|
+
写入本来就没有这笔开销。GUI 预览探针报告 p50/p95/max,并在超出预算时失败。
|
|
52
74
|
|
|
53
75
|
## 未测量的内容
|
|
54
76
|
|
package/docs/QUICKSTART.md
CHANGED
|
@@ -27,16 +27,16 @@ supplies the WSL environment.
|
|
|
27
27
|
|---|---|---|
|
|
28
28
|
| Windows 10/11 with WSL 2 | `wsl.exe -l -v` shows `VERSION 2` | `wsl.exe --install` |
|
|
29
29
|
| A distro | one line in the list above | `wsl.exe --install -d Ubuntu` |
|
|
30
|
-
| `bubblewrap` | `wsl.exe -d <distro> -- which bwrap` | `wsl.exe -d <distro> -u root -- apt-get install -y bubblewrap` |
|
|
30
|
+
| `bubblewrap` | `wsl.exe -d <distro> -- which bwrap` | `wsl.exe -d <distro> -u root -- sh -c "apt-get update -qq && apt-get install -y --no-install-recommends bubblewrap"` |
|
|
31
31
|
| systemd + Linger (for the session runtime) | `node <plugin>/scripts/doctor.mjs` (installed) or `pnpm run doctor` (checkout) | `[boot] systemd=true` in `/etc/wsl.conf`, `wsl --shutdown`, then `loginctl enable-linger "$USER"`; or set `sessionSandbox: auto`/`false` |
|
|
32
32
|
| Node `^22.19.0` or `>=24.0.0` | only needed for source/development work | not needed inside the distro to use the published plugin |
|
|
33
33
|
|
|
34
34
|
No terminal at hand? Several ways without one: the sidebar's **WSL
|
|
35
35
|
environment** panel runs a quick doctor check per distro, listing the badge,
|
|
36
36
|
numbered failing items and warnings. Every row offers **快速检查** and
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
**完整诊断**; both are read-only. When the full report finds repairable
|
|
38
|
+
plugin-owned state, a separate **修复插件状态** action appears and re-verifies
|
|
39
|
+
the result. Typing `/wsl-doctor [quick|full|<section>]`
|
|
40
40
|
in the composer also runs host-side and renders in the UI — no model turn, no
|
|
41
41
|
tokens; in a session, ask for a diagnosis and the model runs the `wsl_doctor`
|
|
42
42
|
tool (mounted by this plugin), the verdict landing in the transcript; and the
|
|
@@ -53,8 +53,8 @@ from `wsl.exe -l -v` itself, so no separate version check is needed. Doctor is
|
|
|
53
53
|
read-only unless you pass `--fix`
|
|
54
54
|
(the stale-scope sweep and a broken agent cache, both re-verified; the Windows
|
|
55
55
|
git trust after a confirmation) or `--fix --install` (packages, after a
|
|
56
|
-
confirmation); `--fix-owned` restricts a fix run to
|
|
57
|
-
(the panel's
|
|
56
|
+
confirmation); `--fix-owned` restricts a fix run to plugin-owned state
|
|
57
|
+
(the panel's separate repair action); `--bundle <path>` writes
|
|
58
58
|
the diagnostic file a setup report attaches (`--redact` strips the paths
|
|
59
59
|
from it). A run can be scoped — `--quick` probes the first-command
|
|
60
60
|
prerequisites plus one combined optional-tool probe (~10 s), `--sections
|
|
@@ -96,11 +96,12 @@ or an UNC path directly. The session's commands, file tools, terminal and previe
|
|
|
96
96
|
all run in that distro; a Windows folder keeps the normal Windows environment.
|
|
97
97
|
|
|
98
98
|
The sidebar's **WSL environment** panel is the diagnostic page: it lists the
|
|
99
|
-
installed distros, runs one distro's quick doctor check on
|
|
100
|
-
whether bwrap, systemd and Linger are in place), and offers
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
99
|
+
installed distros, runs one distro's quick or full read-only doctor check on
|
|
100
|
+
demand (showing whether bwrap, systemd and Linger are in place), and offers
|
|
101
|
+
**快速检查** and **完整诊断** on every row. If the full report finds repairable
|
|
102
|
+
plugin-owned state (a stale session scope or a broken agent cache), a separate
|
|
103
|
+
**修复插件状态** action runs `--fix-owned` and re-verifies the result. Check
|
|
104
|
+
actions remain available after a result; the
|
|
104
105
|
row also shows when the check ran, its source (manual, or the page-load
|
|
105
106
|
background refresh), and its result structure (pass/warn/fail/info/skip, plus
|
|
106
107
|
the per-section tallies). Its **Plugin version** card reads the
|
|
@@ -108,11 +109,10 @@ installed/running versions and offers the one-click upgrade described above.
|
|
|
108
109
|
The last result survives a page reload from the local store, and a stored
|
|
109
110
|
result for a running distro is re-checked in the background on load. Each
|
|
110
111
|
checked row offers **清除** and the card **清除全部** to drop local results
|
|
111
|
-
without probing or modifying a distro. The
|
|
112
|
-
|
|
113
|
-
every other warning keeps its manual remedy, and the action never installs
|
|
112
|
+
without probing or modifying a distro. The explicit repair sweeps the scopes and purges the cache when they need it,
|
|
113
|
+
then re-verifies; every other warning keeps its manual remedy, and the action never installs
|
|
114
114
|
packages or rewrites Windows-owned configuration (a check boots a stopped
|
|
115
|
-
distro, so
|
|
115
|
+
distro, so checks and repairs only run on a click). Workspaces still open through
|
|
116
116
|
**Add workspace**; selecting a folder inside a
|
|
117
117
|
distro through the picker makes the app ask once how to open it: **Remote
|
|
118
118
|
WSL** (the default — commands, files and the terminal all run in the distro) or
|
|
@@ -124,6 +124,12 @@ running a non-WSL preset keeps a warning above the composer, with a one-click sw
|
|
|
124
124
|
while the session is still blank and the access-record fix once a turn has started.
|
|
125
125
|
Two distros can be open at once, each with its own environment.
|
|
126
126
|
|
|
127
|
+
The panel keeps its initial guidance brief and puts detailed version and
|
|
128
|
+
check/repair explanations in collapsed disclosures. While an action is running,
|
|
129
|
+
it names the current operation and notes that a stopped distro may start; it
|
|
130
|
+
does not invent a percentage or time estimate. Buttons and disclosures work
|
|
131
|
+
with the keyboard, and status and error updates expose screen-reader semantics.
|
|
132
|
+
|
|
127
133
|
### Open the workspace in VS Code (Remote-WSL)
|
|
128
134
|
|
|
129
135
|
Opening the WSL folder as a Windows UNC share works but is the degraded mode:
|
package/docs/QUICKSTART.zh.md
CHANGED
|
@@ -25,14 +25,14 @@ dsh headless "run the tests" # 单任务、输出答案后退出
|
|
|
25
25
|
|---|---|---|
|
|
26
26
|
| Windows 10/11,启用 WSL 2 | `wsl.exe -l -v` 显示 `VERSION 2` | `wsl.exe --install` |
|
|
27
27
|
| 一个发行版 | 上面列表中有一行 | `wsl.exe --install -d Ubuntu` |
|
|
28
|
-
| `bubblewrap` | `wsl.exe -d <distro> -- which bwrap` | `wsl.exe -d <distro> -u root -- apt-get install -y bubblewrap` |
|
|
28
|
+
| `bubblewrap` | `wsl.exe -d <distro> -- which bwrap` | `wsl.exe -d <distro> -u root -- sh -c "apt-get update -qq && apt-get install -y --no-install-recommends bubblewrap"` |
|
|
29
29
|
| systemd + Linger(会话 runtime 需要) | `node <plugin>/scripts/doctor.mjs`(已安装)或 `pnpm run doctor`(检出目录) | 在 `/etc/wsl.conf` 设置 `[boot] systemd=true`,`wsl --shutdown`,然后 `loginctl enable-linger "$USER"`;或设置 `sessionSandbox: auto`/`false` |
|
|
30
30
|
| Node `^22.19.0` 或 `>=24.0.0` | 仅源码/开发工作需要 | 使用已发布的插件时,发行版内不需要 Node |
|
|
31
31
|
|
|
32
32
|
手边没有终端?有几条不依赖终端的路:侧边栏的 **WSL 环境** 面板按发行版运行
|
|
33
|
-
doctor
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
doctor 快速检查,结果以状态徽标、编号的待修项与告警列出;每行提供 **快速检查**
|
|
34
|
+
与只读的 **完整诊断**;完整诊断发现可修复的插件自有状态后,才显示独立的
|
|
35
|
+
**修复插件状态**(残留 scope、损坏的 agent 缓存),并在修复后复检;在输入框里输入
|
|
36
36
|
`/wsl-doctor [quick|full|<分区>]` 同样在宿主侧执行、直接渲染在 UI,不进模型
|
|
37
37
|
对话、零 token;在会话里请求诊断,模型会运行本插件挂载的 `wsl_doctor` 工具,
|
|
38
38
|
判定落在对话里;会话启动预检在每次会话打开时把同样的判定写进日志,只有 blocked
|
|
@@ -45,7 +45,7 @@ doctor(`scripts/doctor.mjs`,或在检出目录中运行 `pnpm run doctor`)
|
|
|
45
45
|
读取,无需单独确认。doctor 默认只读,除非传入 `--fix`(清理过期 scope、清理损坏的
|
|
46
46
|
agent 缓存,两者都会复检;以及确认后的 Windows git 信任)或
|
|
47
47
|
`--fix --install`(安装软件包,需确认);`--fix-owned` 把修复限定在
|
|
48
|
-
|
|
48
|
+
插件自有状态(面板的“修复插件状态”动作);
|
|
49
49
|
`--bundle <路径>` 写出可附加到问题报告的诊断文件(`--redact`
|
|
50
50
|
将其中的路径脱敏)。运行可以收窄范围——`--quick` 只探首条命令的前置项
|
|
51
51
|
与一次合并的可选工具探测(约 10 秒),`--sections <分区清单>`(逗号分隔)
|
|
@@ -84,18 +84,20 @@ agent 缓存,两者都会复检;以及确认后的 Windows git 信任)或
|
|
|
84
84
|
侧边栏的 **WSL 环境** 面板是诊断页:它列出已安装的发行版,可对单个发行版运行
|
|
85
85
|
一次 doctor 快速检查,显示 bwrap、systemd、Linger 等前置项是否正常;顶部的
|
|
86
86
|
「插件版本」卡片显示已安装与运行中的版本,并提供上文的一键升级;每行固定提供
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
“快速检查”和“完整诊断”两个只读检查按钮;完整诊断发现可修复的插件自有状态
|
|
88
|
+
(残留 session scope 或损坏的 agent 缓存)后,才显示独立的“修复插件状态”按钮,
|
|
89
|
+
修复后会复检;检查按钮在结果出现后仍可再次点击;行内还显示上次
|
|
90
90
|
检查时间、来源(手动,或页面加载时的后台复核)与结果结构(通过/告警/失败/
|
|
91
91
|
信息/跳过,以及分区分布);最后一次结果会从本地存档恢复,正在运行的发行版会在
|
|
92
92
|
页面加载时后台复核;已检查行可“清除”该发行版的结果,卡片头部可“清除全部”;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
不改写 Windows 配置(检查会让停止的发行版启动,所以两种动作都只在点击时执行)。工作区仍在 **添加工作区** 里打开;选中发行版内的文件夹时,应用会问一次打开方式:**Remote WSL**(默认,命令、
|
|
93
|
+
清除只删除本地存档,不探测、不修改发行版;显式修复只清扫残留 scope、清理缓存并逐一复检,其余告警保留各自的手动处理办法,不安装软件包、
|
|
94
|
+
不改写 Windows 配置(检查会让停止的发行版启动,所以诊断和修复都只在点击时执行)。工作区仍在 **添加工作区** 里打开;选中发行版内的文件夹时,应用会问一次打开方式:**Remote WSL**(默认,命令、
|
|
96
95
|
文件与终端都在发行版内)或 **Windows 访问**(把该文件夹当作普通 Windows 共享,经 9p
|
|
97
96
|
读写,没有 Linux 工具链)。选择记录在 `auto-preset` 行的 `windowsWorkspaces` 里,
|
|
98
97
|
对该工作区之后新建的会话同样生效。
|
|
98
|
+
|
|
99
|
+
面板首屏只保留简短说明,版本与检查/修复的详细行为可通过折叠说明查看。检查和修复期间会显示当前动作,并提示可能启动已停止的发行版;不会显示虚构的百分比或耗时。按钮和说明可用键盘操作,状态与错误也提供读屏语义。
|
|
100
|
+
|
|
99
101
|
Windows 访问目录也会在会话内被点明:运行非 WSL preset 的发行版工作区在输入框上方
|
|
100
102
|
常驻一条警示;会话尚未开始时一键切换,已开始后修正访问记录。
|
|
101
103
|
|
package/docs/README.zh.md
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
|
|
32
32
|
桌面应用没有 `dsh` 可执行程序;插件经 **Plugins** 页安装。三步:
|
|
33
33
|
|
|
34
|
-
1. `wsl.exe -d <发行版> -u root -- apt-get install -y bubblewrap`
|
|
34
|
+
1. `wsl.exe -d <发行版> -u root -- sh -c "apt-get update -qq && apt-get install -y --no-install-recommends bubblewrap"`
|
|
35
35
|
2. Plugins 页:**Add plugin** → `dsh-plugin-wsl-env`,启用。
|
|
36
36
|
3. 重启应用,打开发行版内的文件夹;输入 `/wsl-doctor`(宿主侧执行)得到 `ready`/`blocked` 裁决。
|
|
37
37
|
|
package/docs/RELEASING.md
CHANGED
|
@@ -72,11 +72,19 @@ the `wsl.exe` tail on the Windows CI legs or moving the coverage job
|
|
|
72
72
|
`windows-latest`.
|
|
73
73
|
|
|
74
74
|
Run the full real-machine suite when behaviour changed, and keep its output for
|
|
75
|
-
the pull request or the release notes. The
|
|
76
|
-
the
|
|
75
|
+
the pull request or the release notes. The default launcher closes ordinary
|
|
76
|
+
Harness processes itself — a process-tree kill, announced with the PIDs — so a
|
|
77
|
+
closed window or a tray-resident build does not have to be found by hand;
|
|
78
|
+
`--wait-only` keeps the manual-close workflow and kills nothing. Either way the
|
|
79
|
+
run polls until the app is gone, refuses to run while a stale probe instance
|
|
80
|
+
is still up, and bounds each probe with its own deadline
|
|
81
|
+
(`DSH_WSL_ENV_PROBE_TIMEOUT`, default 900 s) — a wedged probe reports as
|
|
82
|
+
`FAIL <probe> (timeout after …)` instead of holding the suite unseen:
|
|
77
83
|
|
|
78
84
|
```bash
|
|
79
85
|
bash test/probe/run-all-when-closed.sh --include-fs
|
|
86
|
+
# with the app closed by hand:
|
|
87
|
+
bash test/probe/run-all-when-closed.sh --include-fs --wait-only
|
|
80
88
|
```
|
|
81
89
|
|
|
82
90
|
See [CONTRIBUTING.md](../CONTRIBUTING.md) for individual probes, prerequisites,
|
|
@@ -120,7 +128,11 @@ CDN's exact-version path
|
|
|
120
128
|
(`download.deepseek.com/dsh-desk/bin/win-x64/deepseek-harness-<version>-win-x64.exe`);
|
|
121
129
|
the CDN publishes no checksum object, so the smoke records the downloaded
|
|
122
130
|
file's sha256 instead of verifying a published one, and requires `dsh
|
|
123
|
-
--version` to report the exact requested version.
|
|
131
|
+
--version` to report the exact requested version. Before executing it, the
|
|
132
|
+
smoke also requires a `Valid` Authenticode signature whose signer CN is
|
|
133
|
+
`Hangzhou DeepSeek Artificial Intelligence Co., Ltd.` (overridable through
|
|
134
|
+
`DSH_OFFICIAL_HARNESS_SIGNER`); the download and the silent install each have
|
|
135
|
+
a 600-second ceiling. The smoke identifies the
|
|
124
136
|
package by its tarball/registry identity (name, version, sha512);
|
|
125
137
|
`--dump-config` proves the profile composes the plugin with no skipped
|
|
126
138
|
entries, and the through-plugin probe (`test/probe/official-smoke-probe.mjs`)
|
|
@@ -141,8 +153,12 @@ in this order:
|
|
|
141
153
|
2. Runs the official-Harness candidate smoke on Windows
|
|
142
154
|
(`candidate-package-smoke`). Publish depends on this job, so a failing
|
|
143
155
|
candidate blocks the release.
|
|
144
|
-
3. Runs
|
|
145
|
-
|
|
156
|
+
3. Runs the source gates in the separate read-only `gates` job, in parallel
|
|
157
|
+
with the Windows smoke: `pnpm test`, `pnpm run test:coverage`, the browser
|
|
158
|
+
suite, and the shipped x86_64 and aarch64 native-agent tests (the latter
|
|
159
|
+
under QEMU). Keeping this job away from publish means the write/OIDC
|
|
160
|
+
credentials never sit beside test code, and a red gate is reported without
|
|
161
|
+
waiting for the 45-minute Windows job.
|
|
146
162
|
4. Downloads the `candidate-package` artifact, verifies its sha512 integrity
|
|
147
163
|
and `pack.json` identity equal the pack job's outputs, asks the registry
|
|
148
164
|
whether this version is already published, and skips the upload when it
|
|
@@ -151,7 +167,7 @@ in this order:
|
|
|
151
167
|
5. Publishes the downloaded candidate tarball with
|
|
152
168
|
`npm publish <tgz> --provenance --access public`. That attaches a signed
|
|
153
169
|
attestation tying the tarball to this workflow run and this commit. A
|
|
154
|
-
tarball publish runs no lifecycle scripts; the
|
|
170
|
+
tarball publish runs no lifecycle scripts; the gates job has already run
|
|
155
171
|
the full chain. A hand-run publish from the package directory keeps the
|
|
156
172
|
`prepublishOnly` hook as its safety net.
|
|
157
173
|
6. Reads back what the registry serves (integrity, file count, README name)
|
|
@@ -212,6 +228,13 @@ node scripts/check-release-tag.mjs vx.y.z
|
|
|
212
228
|
npm publish --registry=https://registry.npmjs.org/ --access public
|
|
213
229
|
```
|
|
214
230
|
|
|
231
|
+
The same script answers the npm dist-tag the workflow publishes under:
|
|
232
|
+
`node scripts/check-release-tag.mjs --dist-tag` prints `next` for any
|
|
233
|
+
version with a prerelease segment and `latest` otherwise, and the tag check
|
|
234
|
+
refuses a version that is not `MAJOR.MINOR.PATCH` with an optional
|
|
235
|
+
`-prerelease`. A prerelease must never move `latest`, so a manual publish of
|
|
236
|
+
one adds `--tag "$(node scripts/check-release-tag.mjs --dist-tag)"`.
|
|
237
|
+
|
|
215
238
|
Set `--registry` explicitly. A local `~/.npmrc` may point at a mirror, and a
|
|
216
239
|
release published to a mirror is not a release.
|
|
217
240
|
|
package/docs/RELEASING.zh.md
CHANGED
|
@@ -23,6 +23,12 @@ Post-release gate: 每个 stable/next tag 在 registry 传播后
|
|
|
23
23
|
- 官方 Harness 安装包从官方 CDN 的精确版本路径解析
|
|
24
24
|
(`download.deepseek.com/dsh-desk/bin/win-x64/deepseek-harness-<version>-win-x64.exe`);
|
|
25
25
|
CDN 不提供官方 checksum,smoke 记录下载文件的 sha256 作为证据而非比对。
|
|
26
|
+
执行前还校验 Authenticode:签名状态必须为 `Valid`,签署者 CN 必须是
|
|
27
|
+
`Hangzhou DeepSeek Artificial Intelligence Co., Ltd.`(可用
|
|
28
|
+
`DSH_OFFICIAL_HARNESS_SIGNER` 覆盖);下载与静默安装各设 600 秒上限。
|
|
29
|
+
- 源码门禁(`pnpm test`、覆盖率、浏览器与原生 agent)在独立的只读 `gates` 任务
|
|
30
|
+
中与 Windows smoke 并行执行;publish 只做 tarball 校验、发布与 registry 回读,
|
|
31
|
+
预算 20 分钟(含最长 10 分钟的传播轮询)。
|
|
26
32
|
- smoke 用 `dsh --version` 验证实际安装版本等于请求版本;两个 Windows 任务在
|
|
27
33
|
smoke 前均先经 `.github/actions/provision-wsl` 安装 distro 与 WSL 前置依赖。
|
|
28
34
|
- smoke 以 tarball/registry 身份(名称、版本、sha512)标识包;`--dump-config`
|
|
@@ -30,6 +36,9 @@ Post-release gate: 每个 stable/next tag 在 registry 传播后
|
|
|
30
36
|
由 `test/probe/official-smoke-probe.mjs` 在官方 CLI 无头启动上覆盖(挂载插件的
|
|
31
37
|
WSL shell executor,属 provider 级证据;session 运行时路径仍以源码门禁为准),
|
|
32
38
|
失败即 FAIL。
|
|
39
|
+
- 发布使用的 dist-tag 由 `scripts/check-release-tag.mjs --dist-tag` 决定:任何带
|
|
40
|
+
预发布段的版本发到 `next`,其余发到 `latest`;tag 检查同时拒绝不是
|
|
41
|
+
`MAJOR.MINOR.PATCH[-pre]` 形式的版本。
|
|
33
42
|
|
|
34
43
|
其余步骤(确定版本、切分变更日志、完整检查、真机探针与发布后核验)见英文版
|
|
35
44
|
[RELEASING.md](RELEASING.md)。
|