# Changelog

All notable changes to this project are documented here. The format follows
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project uses
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

The reasoning and the measurements behind each entry are in the archived
engineering record,
[docs/archive/engineering-record.zh.md](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/docs/archive/engineering-record.zh.md)
(Chinese, repository only — it is history, never a second README). A `§`
reference below points at that record's numbering unless it names another
document: the 0.1.0 entry's `design-history §` references are to
[docs/archive/design-history.zh.md](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/docs/archive/design-history.zh.md), which
keeps the superseded designs under the section numbers they had while they
were part of the record.

## [Unreleased]

## [0.29.0] - 2026-11-23

WSL panel release: diagnosis and repair are separate actions, with clearer
progress feedback and accessible controls.

### Changed

- **Full diagnosis is read-only.** Repairing plugin-owned state now requires a
  separate explicit action, followed by verification; it does not install
  packages or rewrite Windows configuration.
- **The WSL panel is more concise and accessible.** Detailed guidance starts
  collapsed, and checks/repairs state the current action and possible distro
  startup without inventing progress or elapsed-time estimates. Controls work
  with the keyboard, and status/error updates expose screen-reader semantics.
- **Release workflow hardening.** The workflow default permission is now
  `contents: read`; only the publish job holds `contents: write` and
  `id-token: write`. The `upload-artifact` and `download-artifact` actions are
  pinned to commit SHAs like the other actions. No plugin runtime behavior
  changed.

### Verification

- `pnpm test`, `pnpm run test:coverage`, and `pnpm run test:browser` passed.
  The Windows/WSL real-machine probe suite was not run in this Linux
  environment, which has no WSL or Harness installation.

## [0.28.0] - 2026-11-22

Release-evidence release: the official-package smoke gates publication and
post-release verification end to end on a real runner, the local probe suite
closes the app itself, and the hosted gate's evidence became falsifiable. No
plugin runtime behavior changed.

### Added

- **`pnpm run probe:all-closed` closes ordinary Harness processes itself.**
  The local full-suite entry ends any running Harness (a leftover probe
  instance counts) with a process-tree kill, waits for the exits, and then
  runs the suite; a probe instance that survives the close is refused
  fail-closed, and a failed taskkill surfaces instead of silently sharing the
  machine with the suite. The hosted gate drives the same runner in wait-only
  mode, so its evidence stays synchronous with the step that reads it.

### Changed

- **Release workflows now gate publication and post-release verification
  through official-package smoke evidence.** The existing source compatibility
  gate remains authoritative for full Windows/WSL probe coverage. The
  candidate tarball is packed on Linux so the shipped shell scripts keep their
  executable bits; the official installer resolves from the official CDN's
  exact-version path; the smoke verifies the installed `dsh --version` and
  runs a shell command, a workspace file operation, and a sandbox refusal
  through the tarball-installed plugin on a headless official-CLI boot with
  the plugin's shell executor mounted; `workflow_dispatch` dry-runs the
  candidate path without publishing. Validated end to end by dispatch dry run
  44926384431; hosted WSL provisioning is watchdog-protected against runner
  hangs.

### Fixed

- **The hosted Windows gate's probe evidence is falsifiable.** The suite runs
  against a staged ext4 checkout instead of a silent base64 handoff, requires
  positive probe evidence, derives the suite pass count from the summary, and
  asserts the bwrap marker and dbus prerequisite; documentation claims that
  no real FULL PASS run backed were downgraded. The terminal probe pins
  `/bin/bash` and runs against a prewarmed distro, so first-run provisioning
  output can no longer be mistaken for terminal results.
- **`pnpm run sync:windows` verifies the Windows mirror's content and tolerates
  the drvfs metadata.** The script excludes the untracked agent artifacts
  (`.v2c`, `.video_agent`), skips the utime/chmod/chown calls the `/mnt/c`
  mirror rejects, tolerates the additive mirror's extra files, and fails only
  when a source file is missing or differs. A confined shell's read-only
  `/mnt/c` now reports the `danger-full-access`/plain-terminal remedy instead
  of a tar error.

## [0.27.0] - 2026-11-19

Minor release: harden the opt-in sandbox's process-authority surface and add the diagnostics and panel upgrades around it.

### Added

- **The WSL environment panel now shows the plugin's version and upgrades it
  in one click.** A **插件版本** card reports the installed and running
  versions, asks the host's plugin manager (`listVersions`) for the newest
  installable stable release, and labels a newer compatible release with a
  reminder. **一键升级** posts to the new `wsl-plugin-update` route, which calls
  the host's `updateBundle` only after that click; the panel reports
  `applied`, `restart-required`, rollback, pending build scripts, and a
  `not-updatable`/old-host fallback instead of claiming success. The route
  caches its read for `wsl-plugin-update.cacheMs` (ten minutes by default), and
  the periodic check remains read-only.

- **The WSL environment panel clears stored check results.** Each checked row
  offers **清除** and the card offers **清除全部**: both `DELETE`
  `/api/wsl-env/status` (with or without `?distro=<name>`), which drops the
  in-memory and persisted verdict so the next load shows "not checked" again.
  Clearing is host-local — it lists and probes no distro — so it still works
  when `wsl.exe` or the doctor is unavailable; the panel disables it while a
  check is in flight so an answer cannot restore a cleared row.

- **`socketIsolation` masks the sockets a confined process would use to escape
  the mount profile.** The key applies to the command, write and routed rows
  (`wsl-shell`, `wsl-fs`, `fs-routing`). `off` keeps the previous behavior;
  `session-bus` binds `/dev/null` over `$XDG_RUNTIME_DIR/bus` and
  `$XDG_RUNTIME_DIR/systemd/private`, so `systemd-run --user`/`systemctl --user`
  fail inside the profile; `strict` also masks `/run/dbus/system_bus_socket`,
  the container sockets the distro user can reach, and `/run/WSL` — the WSL
  interop transport — so a Windows executable copied into the workspace fails
  at the host bridge. The doctor's
  `sandbox.isolation` row reports the effective stance and the detected
  surfaces; `pnpm run preset --socket-isolation` (or `--strict`, which also
  enables the `/mnt` mask) writes the nested rows, and the top-level
  `fs-routing` row takes the same value by hand. The masks are a narrowing,
  not a closure: same-user `/proc` and other IPC remain, the distro-wide
  interop switch is still `[interop] enabled=false`, `enforcement` stays
  `partial`, and `pnpm run probe:sandbox` proves the default reaches the user
  manager while both stances do not (and strict blocks a copied PE).

- **The doctor names the effective `workspace-write` writable roots, and a
  real-machine probe proves them.** `sandbox.grants` lists the `writableRoots`
  configured on both nested rows, expands `~`, checks the physical-directory
  rule, names a missing, unreadable or symlinked root with its remedy, and
  warns when `wsl-shell` and `wsl-fs` disagree. `pnpm run probe:cache-write`
  drives the per-command bwrap profile and the session runtime with a temporary
  cache root: the granted directory is writable and an ungranted sibling stays
  `EROFS`.

### Changed

- **The panel's check actions are two fixed buttons: 快速检查 and 完整检查.**
  No row relabels its action to **重新检查** after a result, and the full run
  no longer appears as **修复** when it can repair plugin-owned state. Both
  buttons are present before and after a check, and every click runs the doctor
  again; **完整检查** still performs the `--fix-owned` run and shows its
  before → after rows.

## [0.26.4] - 2026-11-18

Patch release: bound a wedged resident agent's request, localize the remaining
UI text, harden the v7 FS frame, and keep the picker's category level in one
language. Documentation and internal refactors ride along.

### Fixed

- **The picker's first category level no longer mixes two languages.** The
  entries were labelled before `preferredDistro`/`homeOf` awaited, while the
  crumbs were labelled after; if the harness's stored locale preference
  arrived during those awaits, one level rendered half in the default OS
  language and half in the chosen one. Build every label after the awaits so
  one response uses one catalog.
- **Protocol hardening for the v7 FS frame (#55).** Four independent gaps:
  an out-of-order FSB record is now refused as `FS_IO_ERROR` instead of being
  attributed to the next op by line position; the FS budget grows with the
  content a `write`/`move` must handle (30 s base, one second per MiB, ten
  minutes maximum) instead of failing a multi-GB move at a fixed 30 s; the
  directory picker and port survey now pass explicit capture caps instead of
  allowing a transport-sized RES line; and the SETENV section of
  `docs/AGENT-PROTOCOL-V7.md` names the real two-field frame.
- **All plugin-authored UI text follows the harness locale (#50).** The status
  route's errors, the open-in-app route's refusals, the directory picker's
  breadcrumbs and branch labels, and the `/wsl-doctor` command's usage,
  errors, description, and hint were hardcoded Chinese while the rest of the
  plugin followed the Language setting. They now render through
  `src/messages.ts`; a new style check rejects raw CJK literals anywhere under
  `src/` except the catalog, so the next such string fails the gate instead of
  reaching an English-locale user.
- **A written request that is never ACKed no longer hangs the agent queue
  (#49).** The execution watchdog was armed only by the dequeue `ACK`, so a
  resident that stayed alive but stopped dequeuing (a wedged `wait`, a blocked
  stdin pipe) left the request pending forever and the serial queue behind it
  blocked. A separate, looser frame-written ceiling (120 s) now turns that
  state into a transport failure: the resident is killed, the request fails as
  unknown-state/`AgentUnavailableError`, and the caller's usual fallback
  applies. An ACK replaces it with the existing execution budget.

### Changed

- **Release and CI hardening (#52).** The release workflow now compares the
  registry's `dist.integrity` with the local `npm pack` product, not just the
  file count and readme name; the stale `0.2.1-rc.2` entries were removed from
  `minimumReleaseAgeExclude` and the restore condition is recorded; and
  `docs/RELEASING.md` records the deliberate decision to run `npm-publish`
  without required reviewers. The nightly `probes` schedule and its
  `probe-heartbeat` were removed after confirming no self-hosted runner is
  registered for the repository: the manual `probes` dispatch now fails loudly
  when the runner has no WSL topology, and real-machine evidence comes from the
  local closed-app suite (`test/probe/run-all-when-closed.sh --include-fs`).
- **The filesystem and shell providers share their runtime bookkeeping and
  config narrowing (#54).** The two classes kept identical maps for distro
  homes, held session runtimes, the session-runtime preflight, and the `auto`
  verdicts; a semantic change had to be made twice. Those four now live in
  `ProviderRuntimeBook` (`provider-common.ts`), and the 30 repeated
  `this.config as unknown as …` casts collapse to one private `wslConfig`
  accessor per row. No behavior change; the provider, session-runtime, and
  boot suites pin the existing semantics.
- **The takeover report identifies providers by a symbol brand, not
  `instanceof` (#53).** `takeover-report` used to import the three provider
  classes to tell this plugin's `subprocess`/`fs`/`directoryPicker` from the
  shipped ones, which pulled the whole filesystem provider graph — including
  `agent-shared`'s module-load script digest — into every diagnostic surface
  that reads the report, including the preset realm. Each provider now carries
  a `Symbol.for` brand on its prototype and the report compares that, so the
  doctor snapshot loads only the marker module. A static import-graph test
  keeps the provider stack out of `lib/takeover-report.js`.

### Documentation

- **Documentation and comment drift swept, with the peer floor now checked
  mechanically (#51).** SUPPORT advertised the old `0.2.2-rc.1` peer floor;
  `lint:docs` now compares the support page's version literals with
  `package.json` and fails on a stale one. API and CONFIGURATION gained the
  `./open-in-app` / `wsl-open-in-app` surface, CONFIGURATION documents the
  host `directory-picker-browse-surface` row and the command-only scope of
  `/mnt` masking, REQUIREMENTS' R20 test count and R29/R30 baselines are
  current, the roadmap and parity notes state their real baselines, and four
  displaced or duplicated source comments were put back on their declarations.

## [0.26.3] - 2026-11-17

Promotes 0.26.3-rc.0 after the HMR gate passed: a 0.26.1 profile with a live
session upgraded through the plugin manager returned `application: applied`
with no rollback, and after a restart the three takeover services were this
plugin's classes. No code changes since the release candidate; its notes
follow.

## [0.26.3-rc.0] - 2026-11-17

First release candidate for 0.26.3: a live enable or HMR upgrade no longer
rolls back on the three same-name takeovers, the in-app doctor names the
provider that is actually serving them, and the directory picker survives a
WSL that cannot answer.

### Added

- **The in-app doctor names the provider actually serving the three takeover
  services.** `providers.takeover` (the `wsl_doctor` tool, `/wsl-doctor`, and
  the sidebar panel) reports which class serves `subprocess`, `fs`, and
  `directoryPicker`; a failed live takeover — the HMR upgrade that renders
  `service "subprocess" has been registered at <LocalSubprocessRuntime>` and
  rolls back (#39) — now shows as a warning with the restart/install remedy
  instead of a silently healthy report. The standalone CLI cannot observe live
  services, so the row exists only on the in-app surfaces. See
  [DIAGNOSTICS.md](docs/DIAGNOSTICS.md#effective-providers-in-app-only).
- **`test/hot-swap.test.mjs` pins the live same-name swap semantics.** It
  mounts the real `LocalSubprocessRuntime` and the rows the loader actually
  uses against the host's cordis and asserts the states the install path
  depends on: the rejected immediate registration while a live consumer holds
  the provision, the takeover after the release, the idle swap, and the
  deferral of all three takeover rows. A host change that alters the race
  fails this file instead of a user's upgrade. The release gates now also name
  the real-machine HMR update path
  ([MIGRATION.md](docs/MIGRATION.md#gates-a-release-must-clear)).

### Fixed

- **The directory picker browses Windows directories even when WSL is
  unavailable.** `list()` resolved the preferred distro before the host walk;
  on a machine where `wsl.exe` cannot answer (not installed, broken, or a
  failing probe) a Windows folder could not be listed at all. The preferred
  distro is only the dialog's Home affordance, so its failure now falls back to
  the host home while a cancelled call still cancels; distro levels still
  surface their own error. Caught by the Windows CI leg of
  `test/provider-takeover.test.mjs`, which now pins the fallback.
- **The directory picker's one-shot fallback listed an empty directory.**
  `runCapture` strips NUL bytes because `wsl.exe` writes its own diagnostics as
  UTF-16LE, but the fallback feeds it `find -print0` output, whose NUL
  separators are data: every name collapsed into one and the level came back
  empty whenever the resident agent was unavailable (a stopped distro's first
  browse, or an exhausted rebuild budget). The picker now uses
  `runCaptureRaw`, which keeps the separators while the generic capture keeps
  its UTF-16 recovery. Found and pinned by
  `test/provider-takeover.test.mjs`; `test/wsl.test.mjs` pins both capture
  contracts.
- **A live enable or HMR plugin upgrade no longer fails on the three
  same-name takeovers, so the plugin manager no longer rolls the update back
  (#39).** The `subprocess`, `fs`, and `directoryPicker` rows used to register
  their providers immediately; when the outgoing shipped provider was still
  registered — the HMR `updateBundle` window, or a busy-profile enable — cordis
  threw `service "…" has been registered at <…>`, the row entered FAILED, and
  `updateBundle` deleted the target version and reinstalled the old one. The
  rows now mount through `src/service-takeover.ts`:
  they register immediately when the name is free (the cold path, unchanged)
  and otherwise stay active, watch `internal/service` for the slot, and
  register when the outgoing provision releases. The install/update succeeds;
  the takeover lands when the shipped provider drains, or at the next restart
  when a dependent outlives the recomposition. The in-app doctor's
  `providers.takeover` row names whichever provider still serves a name
  ([LIMITATIONS.md](docs/LIMITATIONS.md#enabling-the-plugin-on-a-running-profile)).

## [0.26.2] - 2026-11-17

One theme: a broken distro's failures surface as the program's own —
actionable exit codes and remedies instead of opaque provider errors — while
the doctor's quick pass spots the missing tools before the model does.

### Fixed

- **A search in a distro without ripgrep reports rg's failure, not an opaque
  provider error.** The file-search tool reads rg's exit dialect (`1` = no
  matches, `2` = rg failed), but `search-exec.js` treated only
  `AgentUnavailableError` as a cue: the native resident's `SpawnError` — a
  missing `rg` on the PATH the agent inherits from `wsl.exe`, which never
  holds `~/.local/bin` — rejected `done`, and the tool rendered
  "subprocess failed before reporting an outcome (ripgrep provider failure)".
  The handle now synthesizes the documented shape: exit 127 with a message
  naming the program, the distro, the user-local-PATH cause, and the
  `scripts/bootstrap.sh <distro> --install` remedy. A missing working
  directory becomes rg's error code 2 with the relay-shaped `chdir(...)` line
  — never `1`, which the tool reads as "no matches". The one-shot fallback
  translates the relay's `execvpe(rg) failed: No such file or directory` the
  same way, and pins `WSL_UTF8=1` so that line (and every other relay
  diagnostic) arrives readable. A spawn failure deliberately does not retry
  one-shot: `wsl.exe --cd` does not fail on a missing directory — it warns and
  runs the command in `/` — so the retry could turn a wrong directory into a
  successful empty search. Pinned by `test/search-exec.test.mjs`;
  `docs/LIMITATIONS.md` and `docs/ARCHITECTURE.md` record the failure shapes
  and the PATH fact.

- **A git snapshot on a distro without git reports git's failure instead of a
  silently empty change review.** `git-exec.js` had the same only-
  `AgentUnavailableError` cue: the native resident's `SpawnError` (a missing
  system `git` on the agent's inherited PATH) rejected `done`, and the
  one-shot fallback would have been worse — `wsl.exe --cd <missing>` runs git
  in `/`, where "not a git repository" reads as "no changes". The handle now
  settles a missing program as exit 127 with the bootstrap remedy, a missing
  directory as git's own `fatal: cannot change to ...` at exit 128, and
  post-processes the one-shot relay's `execvpe(git) failed` / `chdir(...)
  failed` lines into the same shapes (that path now pins `WSL_UTF8=1`). The
  relay parsers are shared from `wsl.ts` (`execProgramFailure` joins
  `workdirFailure`); pinned by `test/git-exec.test.mjs` and
  `test/shell.test.mjs`, with `docs/LIMITATIONS.md` and
  `docs/ARCHITECTURE.md` recording the contract.

- **A discovery answer's UNC translation no longer depends on the transport.**
  When the host has no Windows git, the snapshot's sentinel `rev-parse`
  discovery call routes into the distro; with the resident out, the one-shot
  fallback returned that call's Linux absolute paths untranslated, so
  `workspace-changes` resolved them in the host's coordinate system instead of
  `\\wsl.localhost\<distro>`. The fallback now passes the delegated stdout
  through `translateDiscoveryOutput` exactly as the agent path does, carrying
  the delegate's per-stream cut flags over. Pinned by
  `test/git-exec.test.mjs`.

- **The directory picker can no longer create a directory in `/` while
  reporting the requested target.** `createDirectory`'s one-shot fallback ran
  a relative `mkdir -- <name>` under `--cd <parent>`; a parent that vanished
  makes `wsl.exe` warn, run in `/`, and exit 0 — where a writable root (a
  root-default image) turns that into a created `/name` reported as the UNC
  target. The argv now names the absolute target on both transports
  (`distroMkdirArgv`), and the picker maps the agent's `CwdError` /
  `SpawnError` to `DirectoryPickerError` instead of leaking an opaque provider
  error. Pinned by `test/listing.test.mjs`; the peer-bound row itself remains
  probe-covered.

### Changed

- **The doctor's quick pass now includes the optional-tool probe.**
  `tools.rg`, `tools.git` and `tools.inotifywait` ran only in a full scan, so
  a distro without ripgrep surfaced at the model's first `grep`/`glob` and not
  in the sidebar's quick check. One combined in-distro probe (a single
  `wsl.exe`, not three) now answers all three in the quick profile too; a
  missing `rg` warns with the install remedy, and a probe that answers nothing
  reports `info` instead of fabricating "missing". Pinned by
  `test/doctor.test.mjs`; `docs/CONFIGURATION.md`, `docs/QUICKSTART.md` and
  `docs/DIAGNOSTICS.md` describe the quick scope, and the READMEs' `glob`/
  `grep` troubleshooting row names the failure (exit 127) alongside the
  slowness.

## [0.26.1] - 2026-11-16

One theme: the peer self-check now answers for the set the running plugin
actually loads, so a stale tree beside the runtime mirror can no longer fail
it; the README/docs pass that leads with the desktop-app path ships too.

### Fixed

- **The `peers.versions` self-check no longer reports a stale `node_modules`
  above the runtime mirror.** A linked plugin's declared peers are resolved by
  the host's profile projection onto the installation's single copies, but the
  doctor is a separate process: its native lookup walked past the mirror into
  whatever `node_modules` sat above it — after a harness upgrade, the previous
  installation's tree — and failed the check against versions the plugin never
  loads. The in-app spawners now hand the versions this process resolved to the
  doctor in `DSH_WSL_DOCTOR_PEERS`; a present map is authoritative even when it
  is partial or empty, so a peer the host could not resolve is unchecked rather
  than backfilled from the plugin's tree. The standalone CLI, which has no
  projection, counts only a copy at the plugin's own peer position and reports
  peers it cannot see as unchecked instead of failed.
  Pinned by `test/doctor.test.mjs` (host-map preference, malformed-map fallback,
  the peer-position walk, and the collector's hand-off).
  `docs/DIAGNOSTICS.md`, `docs/ARCHITECTURE.md` and `docs/PEER-PARITY.md` record
  the two answers and why they differ.

### Documentation

- **The user-facing docs demonstrate only the desktop app's path.** The
  Windows desktop app ships no `dsh` executable, so the install, verify,
  upgrade, uninstall and troubleshooting steps no longer present the
  `dsh ...` forms of the npm CLI distribution as an alternative — the
  Plugins page, the profile's `package.json` and `cordis.patch.yml`, and the
  doctor surfaces are the only demonstrated way. The CLI keeps one home: the
  README's "Do I need this plugin?" decision table, where it is the
  alternative to this plugin, not a way to use it. MIGRATION's local
  verification block, the ROADMAP-1.0 P1.3 gate, the first-use record
  template, the probe profile headers (the `dsh wslfs ...` lines become the
  real `ELECTRON_RUN_AS_NODE` launch documented in the header of
  `test/probe/run.sh`) and the update-check service comment carry the same
  reality; the CHANGELOG's older entries are history and stay as written.

- **The README pair is now a one-page pitch: a one-line definition that
  names DSH's two delivery forms and the one combination the plugin serves,
  a bilingual without/with diagram pair, a three-step install, and short
  sections that link the owning document for every detail.** The diagrams
  carry the core pain and label the two workspace modes — a Windows
  workspace gets CMD/PowerShell, a WSL workspace only reaches POSIX through
  stateless `wsl.exe` wrappers — and the first "Why this plugin" bullet
  states it. The contrast table, the doctor walkthrough, the configure
  table and the architecture/sandbox detail moved out of the README; the
  CLI install commands moved to QUICKSTART §0, the upgrade/uninstall and
  no-host-patch notes to QUICKSTART §2, the "Why Linux, not PowerShell"
  essay into VALUE's six-sources section, and VALUE also gained a
  Remote-SSH comparison for the Windows host (reach, sshd setup, in-distro
  footprint, sandbox). Anchored headings keep their names, the decision
  table stays, and the sandbox section keeps the `partial` wording. The
  diagram SVGs ship in the tarball. `pnpm test`: 119 pass.

## [0.26.0] - 2026-11-12

One theme: adapted to DeepSeek Harness `0.2.2-rc.2` without patching the host —
installation stays plugin-only, and a WSL workspace gains the durable
open-in-app bridge plus a visible host-mode guard.

### Changed

- **Installation is plugin-only: the plugin no longer patches the installed
  desktop app.** The durable open-in-app bridge lives entirely in the
  `wsl-open-in-app` row; the plugin never edits `resources/app.asar`. That
  simplifies upgrades on both sides: replacing the desktop app cannot drop the
  bridge, and updating the plugin needs only a reinstall and restart — no
  archive re-patch, no post-upgrade re-patch checklist, and no local byte
  patching of the host bundle. The shipped "Open in app" item still inherits
  `ELECTRON_RUN_AS_NODE` and remains an upstream fix; the plugin's
  **在 VS Code 中打开（WSL）** item works on an unpatched archive.
  `test/probe/open-in-app-patch.sh` now only reports the bridge and archive
  state instead of prescribing a patch.

- **Chinese versions of the community documentation.** README, QUICKSTART,
  CONFIGURATION, LIMITATIONS, DIAGNOSTICS, COMPATIBILITY, PERFORMANCE,
  MIGRATION, API, ARCHITECTURE, CONTRIBUTING, SECURITY, SUPPORT,
  CODE_OF_CONDUCT and VALUE now ship with Chinese pages alongside English;
  the npm tarball carries both sides of every pair.

- **Adapted to DeepSeek Harness `0.2.2-rc.2`.** The peer floor moves from
  `>=0.2.2-rc.1` to `>=0.2.2-rc.2` and the dev pins follow the rc.2 line; the
  web client declares the conversation, context-menu and session UI packages
  its new surfaces use. The parity audit was re-walked against the rc.2
  tarballs: `dsh-fs-local` is 1035 lines (its permission/IO arms now route
  through `fsErrorFromErrno`), `dsh-bash-local` is byte-identical, and hashes
  plus line references are in `docs/PEER-PARITY.md`.

### Added

- **A durable open-in-app bridge.** The
  `wsl-open-in-app` row registers `POST /api/wsl-env/open-in-app` on the
  authenticated `/api` channel, and the Session header menu gains
  **在 VS Code 中打开（WSL）**: it converts a WSL UNC workspace to its
  `vscode-remote` URI and launches VS Code with `--folder-uri`, landing in
  Remote-WSL instead of the 9p share. The route scrubs `ELECTRON_RUN_AS_NODE`
  from the editor child's environment only; deleting it from the Host process
  environment breaks Node-mode helpers such as the Windows Job runner. The
  shipped "Open in app" item remains broken until upstream scrubs its own child
  environment. The route refuses every non-WSL path.
  `docs/UPSTREAM-OPEN-IN-APP.md` records the remaining upstream fix.
- **A distro workspace opened without the distro environment is now called out.**
  When a workspace inside a WSL distro runs a non-WSL preset — recorded Windows
  access (9p), a session that became interactive before adoption, or a profile
  without the WSL preset — the session shows a persistent warning above the
  composer naming the consequence (PowerShell commands, 9p file access, no Linux
  toolchain) and the fix that applies: a one-click switch while the session is
  blank, and the `windowsWorkspaces` correction once a turn has started. The
  session header keeps a small **WSL工作区正以Windows模式打开** marker after the warning is
  collapsed, the **WSL environment** panel lists the recorded directories, and
  `auto-preset` logs the state and publishes it as a runtime-context entry so the
  model does not assume a Linux toolchain. The reminder is plugin-owned client UI;
  `docs/UPSTREAM-SESSION-NOTICE.md` still records the general upstream gap.

### Fixed

- **The open-in-app route classifies a rejected launcher.** A launcher that
  throws or rejects now answers the same `502` as a failed spawn instead of
  letting an unhandled rejection escape the request handler.

- **The host-mode advisory and adoption fail open.** A settings read that
  throws is treated like an unavailable record: the web reminder falls back to
  the `wsl` target and warns instead of disappearing. `auto-preset` treats a
  throwing volatile `windowsWorkspaces` getter as an empty record, so a config
  read can neither silence the warning nor fail session creation, and a host
  payload without an agent context still logs the advisory.

- **The creation-time preset binding calls the host's current API again.** The
  host replaced `sessionController.agents.ensureSession(sessionId, cwd, …,
  presetId)` with `agents.createSession({ cwd, agentPreset, … })` in 0.2.1; the
  old wrapper had been silently inactive since, so a distro workspace's first
  mount could still be the host preset until the deferred adoption ran. The row
  now fills `agentPreset` in the create request (forwarding `sessionId` and
  `reusable` untouched), retries with the caller's choice when the preset
  registry refuses the target, and reports its state as the doctor's
  `session.preset-seam` check — a warning instead of a log line when a future
  host changes the shape again.

## [0.25.0] - 2026-11-11

One theme: the model reads its prompt facts in the distro's own terms, and
`workspace-write` can grant the toolchain caches the policy had always
advertised.

### Added

- **`writableRoots` on `wsl-shell` and `wsl-fs`.** `workspace-write` still grants
  only the session workspace and the temp areas by default, but a row can now
  name extra distro directories to bind read-write — the package-manager caches
  npm, pnpm and cargo write under `$HOME`, and a linked worktree's shared Git
  directory. Entries accept `~`/`~/...` and absolute Linux paths, must be
  existing physical directories, and are ignored when already writable inside
  the workspace, `/tmp` or `/dev/shm`, or nested inside another grant. The two
  rows should carry the same list. `pnpm run preset --writable-roots
  '~/.npm,~/.cache'` writes it into both nested rows of the printed block.
  CONFIGURATION documents the cache recipes and the security trade-off.

- **Prompt adapters for the Windows-shaped prompt facts.** A WSL session now
  carries a one-sentence `wsl:shell` note (the shell tool is named `bash` but
  runs the distro's login shell with `-lc`), a POSIX-only `sandbox:policy` line
  built from `ctx.sandboxPolicy` (mode, workspace and `additionalWritableRoots`,
  no UNC path, plus the conditional `partial` enforcement note), and no
  `harness:source` value — the host's `app.asar` Windows path is not a readable
  checkout from the distro. The adapters are temporary and each names the
  upstream change that retires it in
  [docs/UPSTREAM-PROMPT-ADAPTERS.md](docs/UPSTREAM-PROMPT-ADAPTERS.md).

### Changed

- **A ready preflight verdict is log-only.** Only a blocked `wsl-preflight`
  verdict reaches the session's runtime context, and its remedy is marked as
  operator action (ask the user before running anything). "The prerequisite is
  usable" is not a model action; it stays in the host log, which still carries
  the verdict on every session.
- **`ready` no longer promises the next command.** The `wsl_doctor` tool
  description and its ready note say ready covers the checks in that run; the
  older "the first command should succeed" was a step past what the probes
  prove. The doctor and quickstart docs, and both READMEs, state the same.

### Fixed

- **Confined WSL operations now honor the policy's `additionalWritableRoots`.**
  The fence accepted a same-distro UNC extra root while the bwrap profile (and
  the confined-write resident's cache key) dropped it, so an approved write
  failed with `EROFS` or `FS_IO_ERROR`; a Linux-spelled entry was refused by the
  fence even though it is the execution-world spelling. Both sources now resolve
  through `lib/writable-roots.js` into one effective Linux list used by the
  command profile, the confined-write resident and the session runtime, and the
  session-runtime keys include the grants.

## [0.24.0] - 2026-11-10

One theme: the diagnosis becomes something to act on — a sidebar panel
that checks a distro and repairs the plugin-owned state — while the
doctor's catalog is triaged and answers the effective configuration.

### Added

- **A diagnostic status panel with a safe repair action, and a real choice when
  a WSL workspace is added.** The navigation column now carries **WSL
  environment**: the installed distros with an on-demand quick doctor check per
  distro (bwrap, systemd, Linger and the other prerequisites, through the same
  standalone CLI as `/wsl-doctor`). A checked row also offers a full run, labeled
  **修复** when a finding is repairable and **完整检查** otherwise: a `POST` to
  the same authenticated route runs the doctor with `--fix-owned`, sweeps stale
  session scopes and purges a broken agent cache, then re-verifies both and
  answers with the before → after `fix.*` rows. The result names what was
  fixed, what failed re-verification, and what remains manual, so the button
  never promises a fix it cannot apply. Each checked row carries its last check
  time (date and time, with a relative hint), its source (manual or the page-load
  background refresh), and a result structure — per-status totals and
  per-section tallies — so the next action is visible at a glance. The last
  result per distro is persisted under
  `$DSH_HOME/cache/dsh-plugin-wsl-env/status.json` (falling back to `~/.dsh`),
  so a page reload or an app restart still shows it; on load, stored results
  for running distros are re-checked in the background, and a failed
  background run overwrites the stored result exactly as observed. Results are
  never labeled expired. The panel opens no workspace, runs no session, and never installs packages or
  rewrites Windows-owned configuration; a click is the only thing that boots a
  stopped distro. Adding a workspace through the picker now asks once how a
  distro folder is opened — **Remote WSL** (the default) or **Windows access**
  (the folder as a 9p share under the host environment). The choice is
  persisted in the `auto-preset` row's `windowsWorkspaces` volatile field, which
  the auto-preset hook reads so later sessions in that workspace keep the host
  preset; the prompt switches the workspace's blank session before its first
  turn.

- **A checked distro row expands to every check the run executed.** The row
  already showed the failures, the warnings and the per-section tallies; a green
  verdict was still an assertion the user had to trust. **查看检查详情（N 项）**
  now opens the full list, grouped by the doctor's sections (host / sandbox /
  session / conf / net / agent), each row with its status mark, id, evidence and
  (for a non-ok row) its remedy. The catalog rows a quick run never touches are
  counted in one line — "the full run covers N more" — instead of being listed
  as fake results, and the list is part of the persisted view, so a reload keeps
  it. The detail is also carried for `error` rows (empty) and for older stored
  views (defaulted), so a stale cache cannot break the panel.

- **`--fix` repairs the agent cache too, and `--fix-owned` scopes a run to
  plugin-owned state.** A non-executable (or non-runnable) entry under
  `~/.cache/dsh-wsl/agent` is purged and re-inventoried, and a failed handshake
  is re-probed after the purge. `--fix-owned` narrows the fix loop to the stale-scope sweep and the
  cache purge (it implies `--fix`, skips the package install and the Windows
  git whitelist, and refuses `--install`); the sidebar's repair action uses it.

- **Four checks for failure modes the catalog missed.**
  `functional.native` execs the cached native binary and verifies its HELLO
  self-digest against the content-addressed cache directory (`skipped` on a
  fresh machine, `fail` under `agentBackend: native`, `warn` under `auto`);
  `agent.home-writable` creates and executes a temp file under `$HOME` to catch
  a read-only home or a `noexec` mount before the native cache is extracted;
  `host.disk` reads the Windows volume that holds the VHDX (fail < 2 GiB,
  warn < 5 GiB), which `distro.disk` cannot see; `distro.unc` proves Windows can
  read `\\wsl.localhost\<distro>`, the path the GUI file service, picker and
  open-in-app use. `distro.wsl-conf-interop` also probes the WSLInterop binfmt
  handler when interop is **enabled**, so a stale boot that breaks `git.exe` /
  `explorer.exe` is named instead of surfacing as command-not-found.

- **The folder picker starts at a category level, not inside one home directory.**
  It now opens on
  a category level with **Windows 路径** and **WSL 发行版**; the Windows branch
  starts at the drive roots (`C:\`, `D:\`, …) instead of at one account's home
  directory, and the WSL branch lists the installed distros. Every level keeps
  a **工作区** crumb, so either world is one click away. `includeHostHome` now
  gates the Windows branch as a whole.

### Changed

- **The doctor's check catalog was triaged row by row.** The merged rows carry
  their facts together instead of in info-only satellites:
  `host.platform` replaces `host.windows` + `host.wsl` and now fails below the
  WSL 2 build floor (19041); `distro.identity` replaces `distro.shell` +
  `distro.home`; the package family folded into the install remedy (no row) and
  the architecture into `agent.native`; `config.profiles` folded into
  `config.deprecated`. `distro.kernel` is gone. A `substrate: share` profile now
  **fails** the verdict instead of warning: the fs provider throws at
  construction, so the plugin does not boot that profile.

- **The sandbox checks answer the effective configuration.** With
  `sandbox: false` on every row *and* `sessionSandbox: false`, nothing is
  confined, so the doctor no longer blocks on a missing bwrap: `sandbox.bwrap`
  reports a warning that names the UNCONFINED posture, and the usability and
  fence-smoke rows skip with that reason. An explicit opt-out is conspicuous,
  never silent.

- **The agent checks are config-aware too.** `agent.native`, `agent.cache` and
  the new `agent.home-writable` fail only when `agentBackend: native` makes the
  backend mandatory; under `auto` they warn (the shell agent still serves the
  command), and a missing native binary under `shell` is context. A cache entry
  is now probed for **execution**, not just the mode bit: a `noexec` mount and a
  binary that cannot start both count as broken.

- **The Windows entry can run the agent chain.** The doctor translates the
  package root through the distro's automount root (`C:\...` ->
  `/mnt/c/...`, or the configured root), so `agent.handshake`, `functional.exec`
  and `functional.fs` run on the real Windows surface instead of being skipped
  as "the script path is a Windows path"; automount-disabled distros report the
  honest skip. The digest check still reads the script through the host path.

- **The quick profile no longer probes the optional tools** (`rg`, `git`,
  `inotifywait`): they are feature-degradation warnings, not first-command
  prerequisites, and each is a process spawn per distro.

- **The WSL preset reads as a variant of 标准模式 and sits beside it.** The mode
  picker listed `WSL 模式` as a fifth peer; it is now `标准模式（WSL）` with
  `order: 1`, so it appears directly under 标准模式 (equal orders sort by id, and
  `standard` precedes `wsl`). The composition is unchanged.

### Removed

- **The doctor's registry update check is gone.** `update.latest` and its two
  registry GETs were not a diagnosis: the plugin's delegated update service and
  the app's Versions page already answer the question, and the doctor's promise
  is a read-only pass over the machine. `DSH_UPDATE_REGISTRIES` is no longer
  read anywhere (the env-var escape hatch left with the check).

- **The composer's WSL 诊断 pill is gone.** Its menu duplicated the sidebar
  panel's per-distro quick check, which now also lists the numbered failing
  items and the warnings. `/wsl-doctor` itself is unchanged and still runs when
  typed in the composer.

### Fixed

- **The doctor no longer misreads a top-level `insert:` of the WSL providers as
  a nested-row id patch.** `config.preset-trap` matched an indented
  `- id: wsl-shell` / `wsl-fs` line, so probe profiles that deliberately
  `insert:` those rows at the top level were warned about a patch they do not
  have. Only a root-level id entry — the one that truly targets a top-level row
  and matches nothing — is reported now, and the remedy names the `insert:`
  alternative. Verified against the host's profiles: the probe profiles that
  insert these rows at the top level now scan clean.

- **A full doctor run on a BusyBox distro no longer blocks on the shell
  fallback.** The FSB batch failure now decodes its `BAD <op>|<reason>|<base64>`
  payload instead of printing base64, and names the cause: the shell agent's
  GNU `find -printf` floor, which BusyBox lacks (`find: unrecognized: -printf`).
  When `auto`/`native` selects the packaged native agent, the smoke legs over
  the shell agent warn (it is the fallback) while `functional.native` runs the
  same HELLO + EXEC + FSB chain over the cached native binary; the verdict
  stays `ready`. Under `agentBackend: shell`, or when neither backend answers,
  the leg still blocks — with `findutils` as the remedy, not a restart. The
  family probe now knows `apk`, so Alpine's install remedies are `apk add`
  rather than an apt command.

- **A full run with nothing to repair is narrated as a check.** The action is
  the same `--fix-owned` run either way, but the row used to say **修复中…**
  even when the button read **完整检查**: the pill, the busy label and the
  running hint now follow the button's intent (检查中… / 完整检查中… / "正在运行
  完整检查"), so a plain full diagnosis never claims to be repairing anything.

## [0.23.1] - 2026-11-10

### Fixed

- **The distro root refuses cleanly again instead of reaching the Windows
  opener.** 0.23.0 stripped the share root's trailing separator so
  `verifyDesktopPath` would close for `\\wsl.localhost\<distro>`; the check
  passed, then the Host handed that share root to Explorer as
  `file://wsl.localhost/<distro>`, which Windows rejects with a network-error
  dialog. The root keeps the substrate's trailing separator, so the Host-path
  check refuses it with the documented `Path has no verified Host path`; paths
  inside the distro are unaffected. Supporting the root itself needs the opener
  to accept a share root (upstream), and is not claimed here.

## [0.23.0] - 2026-11-10

One headline: the root filesystem answers host spelling where the Host's path
consumers read it, so "Open in app" and "Reveal in file manager" work on WSL
files again.

### Fixed

- **"Open in app" and "Reveal in file manager" work on WSL files again
  (issue #37).** The root router answered `processPath` for a distro target in
  Linux form, while the Host's `verifyDesktopPath` requires
  `processPath(resolve(processPathFromHostPath(hostPath))) === hostPath` and
  `processPathFromHostPath` is the inherited host implementation — a Linux
  answer can never reproduce a UNC host path. Every file gesture routed through
  `session.openWorkspacePath` / `session.workspacePathApplications` (the
  preview header's application menu, the file context menu's "Show in folder",
  the deliverables open route) was refused with `Path has no verified Host
  path`. The router now answers the target's canonical UNC — the same answer the
  session `WslFileSystem` and the
  shipped host backend give — and strips the share root's trailing separator so
  a distro-root workspace closes too. `displayPath` stays Linux and `contains`
  still compares POSIX coordinates. Known cost: the GUI change feed and
  `stat.absolutePath` now carry the UNC spelling, and the client's
  `fileMediaUrl` rejects a `\\`-prefixed path, so relative Markdown images in a
  WSL preview no longer resolve (chat images already had that gap).

- **`/wsl-doctor` no longer spends minutes "executing" and then dies as an
  opaque "operation was aborted".** The command resolved the session's distro
  through its own app-level context, but the `workingDirectory` service lives in
  the *agent's* scope, so the lookup missed: the handler fell back to the
  shipped `auto` configuration, which probes **every** installed distro
  (measured 234 s for the eight on this machine, against ~9 s scoped), and the
  command dispatcher's deadline cut the run off with `This operation was
  aborted` — naming neither the target nor a next step. The handler now reads
  the live cwd from the agent-scoped service, falls back to the Session header's
  `cwd`, and bounds the CLI subprocess — 120 s with a resolved distro, 60 s when
  the configuration has to choose, both below the dispatcher's deadline — so a
  stalled or unscoped run settles with a message naming the target it examined
  and how to narrow it (`--distro <name>`, `quick`, or a section). Three concurrent `/wsl-doctor` sweeps had also saturated `wsl.exe`
  enough that every new WSL agent handshake timed out at 15 s; the scoped run
  removes that load.

- **The `wsl_doctor` tool no longer blocks the Host process while the doctor
  runs.** `doctorReport()` collected the report with `spawnSync`, freezing the
  Host's event loop for up to the two-minute deadline: the tool card sat
  "executing", every other tool stalled behind it, and the call could not be
  cancelled. The collector now spawns the CLI asynchronously, forwards the tool
  call's abort signal (cancellation kills the child), enforces a deadline with
  a bounded post-exit drain window so a grandchild holding the pipes cannot
  stall it, and caps the captured output at 4 MiB. The rejection text now names
  which of those ended the run.

## [0.22.0] - 2026-11-08

One theme: the doctor's report becomes something a human can read and act on —
every check itemized with an explicit status marker, the run reachable as a
global `/wsl-doctor` command that renders outside model history, and the fixed
skeleton localized to the host language.

### Added

- **The `wsl_doctor` tool is interactive: quick first, sections for
  follow-ups, per-section tallies in every answer.** The old shape was one
  blocking call (100 s+ across every distro) that returned a bare verdict
  plus the fail list — the conversation hung and the result said nothing
  about what had been tested. The tool now takes `depth: "quick"` (the
  prerequisites: host facts, the session quartet, bubblewrap — ~10 s in one
  distro, no smokes, no registry, no port survey) and `section` (one of
  host/sandbox/session/conf/net/agent) for focused follow-ups; `depth:
  "full"` stays the complete scan. Every digest carries per-section tallies
  (ok/warn/fail/unknown), so the passed checks are visible instead of
  silent. The CLI mirrors the scoping (`--quick`, `--sections <csv>`, a
  `scope` block in the scoped `--json` report; `--fix` still requires a full
  run). One tool, multiple calls — the progress story is the call sequence,
  because the tool pipeline has no mid-execution event channel (verified
  end-to-end: `dsh-tools` contract, `dsh-session` event map, and the
  conversation UI's surface projection all lack one; to be proposed
  upstream).

- **The doctor's report itemizes every check, and `/wsl-doctor` runs it
  detached from model history.** A scoped run used to say nothing about the
  checks its profile never executed, and a multi-distro report flattened into
  one undifferentiated block. `digestReport` now carries per-distro tallies
  (first-appearance order, the session's distro flagged) and an itemized
  listing — every check with an explicit `[OK]`/`[WARN]`/`[FAIL]`/`[INFO]`/
  `[SKIP]`/`[??]` marker, its title and what it found, the copy-paste remedy
  under every failure; scoped runs surface untouched checks as `[SKIP]` rows
  driven by a check catalog. The `wsl_doctor` tool's structured result field
  is `report` now, and `depth` defaults to `quick`. The new `/wsl-doctor`
  command registers globally and spawns the standalone doctor CLI as a host
  subprocess: the report renders without consuming tokens, and the diagnosis
  still answers when the plugin's own runtime is what is broken. The composer
  button becomes a mode menu (quick/full + the six sections); deployments
  without a command adapter keep the CLI.

- **The doctor's fixed skeleton localizes.** Check catalogs live in
  `locale/doctor/{en,zh}.json`; a `--locale` flag and `DSH_WSL_DOCTOR_LOCALE`
  override exist, and the Windows locale is detected through `reg query`
  (no PowerShell startup). `--json` stays language-independent.
  `installMessagesLocale` falls back to the OS ICU locale when no Settings
  preference was stored, so a provisional-Chinese UI renders Chinese; an
  explicit Settings choice always wins.

### Fixed

- **A transport flake no longer reports a config verdict.** Under the
  doctor's concurrent probing of several distros on one VM, `wsl.exe` calls
  can time out (`Wsl/Service/WSAETIMEDOUT`) or answer from a cold,
  mid-boot distro — and those reads were reported as authoritative `fail`s:
  a static `/etc/wsl.conf` read broken one run and fine the next. Every
  in-distro probe now retries once after a settle delay when a capture smells
  like a flake (execFile deadline, or WSL's own wedged-service error text);
  a flake that survives the retry reports the new `unknown` status — it
  names the flake in its detail, never blocks, and never feeds a config
  verdict. The smoke sessions (EXEC/FSB, the confined fence) retry once on
  failure too, so the most alarming row in the report cannot rest on one
  wedged transport. A one-shot flake recovers invisibly; a persistent one
  earns a rerun remedy, not a false remedy for a healthy machine.

## [0.21.0] - 2026-11-08

One theme: the doctor and the preflight reach the GUI — the readiness probes
run at plugin load, the doctor lands as a composer button and a per-session
`DSH_WSL_DOCTOR` fact, and the bare package name becomes the client host half
that makes both loadable.

### Changed

- **BREAKING: `.` is now the no-op web client host half; the shell executor
  moved to `dsh-plugin-wsl-env/shell`.** The web app's client-modules roster
  only scans Loader rows whose name is an exact package name, so the doctor's
  composer button (declared under `dsh.client`) loads only when the package
  is mounted at its bare name — and the shell executor that used to own `.`
  cannot run at the composition root without shadowing the shipped host
  shell. The bundle's patch layer therefore mounts the bare name as a no-op
  row (`wsl-env-client-host`) that puts the package on the web bundle list,
  while the preset mounts the executor through the explicit `./shell` subpath.
  The doctor button is the plugin's own feature again — the interim
  `dsh-wsl-env-doctor-button` companion bundle is removed. A profile that
  mounted `dsh-plugin-wsl-env` directly for the executor must switch to
  `dsh-plugin-wsl-env/shell`.

### Added

- **The preflight runs at plugin load, not only at session open.** A new
  `startup` key (default `true`) on `wsl-preflight` runs the same `bwrap` and
  session-runtime probes once at mount — install plus restart — against the
  pinned or WSL-default distro, so the verdict is in the log before any
  session opens. A session on that distro repeats only the runtime-context
  entry (a shared single-flight verdict plus per-process dedupe keeps the log
  to one line); other distros keep the session-open check unchanged, and
  `startup: false` restores the old behavior exactly.

- **The doctor entered the GUI.** A new `DSH_WSL_DOCTOR` fact rides every
  distro session: a ready-to-run command that executes the doctor from
  inside the session, using the app's own runtime as Node through interop —
  a GUI user can ask the model for a diagnosis (`sh -c
  "$DSH_WSL_DOCTOR --json"`) without a terminal or a separate Node install.
  The session-start preflight now publishes its verdict on healthy sessions
  too (`WSL preflight: ready — …`), so the transcript reads as a verdict on
  every session start, not only on failures. And a new `wsl_doctor` tool
  (mounted inside `preset-wsl`) lets the model run the doctor itself —
  in-process through `doctorReport()` with the live resident's state merged
  in — returning the verdict, blockers and per-failure remedies to the
  transcript. The whole entry is the plugin's own; the page-level action
  proposed upstream (discussion #12499) was withdrawn the same day as
  unnecessary coupling — the cohesive shape needs no upstream surface.


- **The doctor's verdict closes the loop: green means the first command
  works.** The report moves to schemaVersion 2 — `verdict: ready | blocked`,
  `blockers`, per-distro verdicts and per-check `distro` /
  `blocksFirstCommand` — computed under the **effective configuration** (the
  profile layers the app loads, not the shipped defaults): a missing systemd
  only blocks under `sessionSandbox: true`, while `auto` names its fallback
  and `false` names the opt-out. New checks: the per-distro WSL mode (WSL1
  named as the root cause, with the `--set-version` remedy), `.wslconfig`
  validation with its semantics (the silent-ignore trap, unknown keys,
  memory hazards, `localhostForwarding`), `/etc/wsl.conf` cross-checks
  (boot/interop/automount against the runtime, terminate remedies), the
  disk, the clock and DNS. Three smoke legs prove the chain — one EXEC
  frame, the confined fence (write inside runs, write outside is refused),
  one FSB batch over a temp dir that is cleaned up. `--all` (and the
  effective `auto`/`default` target set) check every installed distro; one
  wedged distro cannot mask the others. `--fix` ends in a re-verified
  report: every fix is followed by a fresh probe, the affected checks carry
  the after state, and the Windows git trust whitelist joins the fixable set
  behind the confirmation gate. `--bundle <path>` writes the attachable
  diagnostic file (`--redact` strips home and DSH paths), deprecated profile
  keys (`substrate: share`, `distro: ''`) are named with their migration, and
  per-phase timings ride the report. The doctor targets every installed
  distro the effective configuration can reach; remedies that would rewrite
  user- or distro-owned files stay manual, and the verdict never upgrades the
  `enforcement: partial` statement. [DIAGNOSTICS.md](docs/DIAGNOSTICS.md)
  maps every error code to its check or its transient class.


- **The plugin's refusal messages follow the harness language.** A new
  `lib/messages.js` catalog renders the `sessionSandbox` preflight verdicts,
  the `bwrap` install and repair hints, and the distro/workdir command errors
  in English or Chinese, selected from the host `locale` entry's `preference`
  field through an optional `settings` injection (the base bundle's service; a
  profile without it, an unset preference, or any other language keeps
  English). The read refreshes on `settings/document-updated`, so switching
  the app's language takes effect without a restart. Commands, config keys
  and file paths stay verbatim in both catalogs. The English templates are the
  shipped texts byte-for-byte, and three groups stay English by design — the
  `FS_*` refusals in `fs-decisions` and the fsio replica (the tool layer
  matches on those strings) and the standalone `scripts/doctor.mjs` — see
  [CONFIGURATION.md — Message language](docs/CONFIGURATION.md#message-language)
  and [LIMITATIONS.md](docs/LIMITATIONS.md).

- **The plugin notices its own updates.** A new `wsl-update-check` row asks the
  app's plugin manager for this package's version list on a slow timer (first
  check 2–10 minutes after startup, then once a day; `intervalMs` configures
  it, floored at one minute, and `enabled: false` stops the check). When the
  stable channel has moved, the managed `DSH_WSL_PLUGIN_UPDATE` variable in
  every distro session carries the fact, deprecation and "requires a newer
  DSH" marks included; every other answer — no host plugin-manager, a linked
  checkout, an unreachable registry — stays silent at debug level. The check
  never fetches on its own and never installs: upgrading stays manual (Plugins
  page, or `dsh plugin add`), then a restart, because the harness has no hot
  reload. `node scripts/doctor.mjs` gained an `update.latest` section that
  asks the same question on demand, `DSH_UPDATE_REGISTRIES` pins or empties
  its registry list.


### Fixed

- **The tool rows mount again: the context reads are declared.** Both tool
  rows (`wsl-cwd-prompt-tool`, `wsl-doctor-tool`) read `ctx.tools` (and the
  `workingDirectory` service) without exporting `inject`, so cordis 4 threw
  `cannot get property "tools" without inject` at activation — the shipped
  `working_directory` tool stayed disabled with no replacement registered.
  Both rows now declare `inject = ["tools", "workingDirectory"]`. The
  `wsl_doctor` tool additionally resolves its collector per call instead of
  reading a `ctx.doctor` service nothing provides: a provided `doctor`
  service through the optional `ctx.get`, else the test seam's `doctor`
  property, else the package's own `doctorReport` — a required inject of a
  nonexistent service would have failed the whole `preset-wsl` mount.

## [0.19.0] - 2026-11-06

One theme: the wire and the doctor catch up with the substrate — protocol v7
(WSL-312), the live-resident report (WSL-313), and the probe/e2e evidence a
behaviour change owes the release notes.

### Added

- **`doctor --wsl <path>` pins the `wsl.exe` every probe uses.** The doctor's
  probes resolved `wsl.exe` from `PATH`, so a PATH race (one probe seeing one
  binary, the next another) could not be ruled out; the flag rebinds every
  probe and `doctorReport` forwards it, and the reject path carries the full
  diagnostics.

- **`./index` is a public subpath.** The composition root's named surface
  (`WslShellExecutor`, `WslFileSystem`, `doctorReport`,
  `effectiveMaskWindowsDrive`, the row factories) is importable as
  `dsh-plugin-wsl-env/index`, so tooling that wants the doctor's report or the
  composition root's symbols no longer reaches into `lib/index.js` by file
  path. The exports map and the generated `lib/index.d.ts` are the contract;
  `docs/API.md` is the tour.

- **Agent protocol v7 (WSL-312): concurrent-ready FS frames, structured
  errors, batched reads, and the peer's patch/delete/move operations.** HELLO
  now advertises capabilities (`conc`, `batch`); failed FS ops answer with the
  structured `FSERR|id|reason|b64` line; the new `FSB` batch frame answers a
  GUI-preview-shaped stat+list+read in one round trip
  (`test/probe/gui-preview-batch.sh` measures it); and the FS vocabulary grows
  `delete`/`move` with the peer's guard dialects. `patchText` applies hunks
  in-process through `@deepseek-ai/dsh-fs-patch` (new peer dependency), so the
  `FS_PATCH_MISMATCH` dialect is the peer's byte-for-byte. Both agent
  implementations ship v7 in lockstep (shell script + native binaries for
  x86_64/aarch64), the host accepts agents 6–7 and gates every v7 frame on the
  negotiated version, and the `0.18.0` declared gap for the peer's three new
  operations is closed. Design: [docs/AGENT-PROTOCOL-V7.md](docs/AGENT-PROTOCOL-V7.md);
  evidence: `agent/native/spike/test.mjs` (28 checks), `test/fs-substrate.test.mjs`
  (17), `test/agent-protocol.test.mjs` (20).

- **The doctor can now report a live resident's failures (WSL-313).** The
  CLI's handshake check states its probe source ("probed: a fresh resident")
  and keeps saying that a live resident's `lastError` is host-private — the
  CLI is a separate process and no IPC is invented. The merge happens only
  where the context is reachable: `doctorReport(distro)` in `lib/index.js`
  collects the shipped script as a subprocess and folds
  `sharedAgent(distro).status()` in via `mergeLiveResidentStatus`
  (`lib/doctor-live.js`) — a snapshot that answers for no resident changes
  nothing; a `dead` live resident fails the check; a `lastError` on a running
  one surfaces as `warn` with deaths/pending named, and the report tally
  follows.

### Changed

- **A failed login-shell probe now refuses the command instead of silently
  running it under bash.** `wsl-shell`'s `shell` key stays empty by default and
  resolves the distro user's login shell (`getent passwd`, then `$SHELL`); when
  both probes fail — a cold distro, a flaky first `wsl.exe` call, a musl distro
  without `getent` — the executor used to answer the literal `bash` for that
  one call, running the command under an interpreter the user never configured
  and telling no one. The resolvers now throw the refusal `runInDistro` used
  before its removal (the distro, both probes, and the `shell:` escape hatch); the failure is
  still not cached, so a retry re-probes; and the tool's self-presentation
  reads `shell` rather than a bash that nothing resolved.

- **`toLinuxPath` no longer accepts a `distro` option.** The mapping is
  coordinate-only and read no pin: the option was forwarded into the function's
  own recursion and never consulted. The signature narrows to
  `{ cwd?: string }`, the seven call sites that passed the pin drop it, and
  every mapping result is unchanged — `test/paths.test.mjs` pins the UNC, drive
  and relative forms without the option.

### Removed

- **`runInDistro`.** The `./wsl` helper had no callers left: the shell
  resolvers and the `shell-env` row probe through their own paths, so what
  remained was dead public surface on a package whose exported names and error
  codes are API. Its refusal wording is not lost — the executor's resolvers
  throw `dsh-plugin-wsl: distro "…" named no usable shell (passwd probe and
  $SHELL both failed)`, which the Changed entry above describes. The ignored
  `toLinuxPath` option went in the same pass.

### Fixed

- **The published name survives a power loss with its contents.** The shell
  agent synced the staged file but not the containing directory, so the
  rename that published a write or a move could vanish on restart while the
  data survived (REVIEW 2026-10-03, still-open 1). After the publish rename —
  both the write path and the move-over path — the agent now fsyncs the
  destination's containing directory (`sync -d`, best effort: sync builds
  without `-d` and filesystems refusing a directory fsync degrade to the
  peer's promise silently). The native agent keeps its file-level `sync_all`
  until its next build; the divergence is declared in `docs/PEER-PARITY.md`
  (divergence 6).
- **A wedged unit-test file now fails in three minutes instead of hanging the
  run.** `node --test` has no per-file deadline, and `--test-timeout` bounds
  only tests a file has registered — a script-style suite that leaves a handle
  alive behind an unsettled top-level await hangs before registration, and the
  runner's "Promise resolution is still pending" message never arrives because
  the loop never drains. `scripts/test-watchdog.mjs` now wraps `test:unit` and
  `test:coverage`: the command runs untouched, and at the 180 s deadline the
  wrapper interrupts the process group (SIGINT, so node prints its
  "Interrupted while running" list naming the still-running file;
  `taskkill /T` on Windows) and exits 124. `DSH_TEST_WATCHDOG_MS` overrides the
  deadline. Observed shape: `test/shell-env.test.mjs` sat 584 s inside a 587 s
  run, so every re-run paid the caller's whole command budget.

- **The coverage gate now proves every shipped module is measured.** Node's
  coverage is load-based: `lib/git-exec.js` and the three peer-bound rows
  (`picker`, `auto-preset`, `subprocess`) had no row at all, so the 96.65%
  headline was computed over 35 of 41 modules. `test/git-exec.test.mjs` — nine
  checks that passed but were in neither gate list — is wired into both, and
  `scripts/coverage-gate.mjs` wraps `test:coverage`: every `lib/*.js` must be
  measured or carry a reason in `test/coverage-allowlist.json`, every measured
  module must clear 85/70/60 (line/branch/function), and a stale allowlist
  entry fails the run. `test/provider.test.mjs` also asserts the
  `lib/shell.js` and `lib/fs.js` re-exports now, so the measured set is 38 of
  41 instead of 35.

- **Two test-harness defects that could hang the gate or misreport it.** The
  `check()` helper in `test/doctor.test.mjs` called its body synchronously
  while two checks were `async`: `PASS` printed before any assertion ran, a
  rejection escaped as an unhandled one, and the fixture cleanup could delete
  the fake `wsl.exe` while `doctorReport` was still spawning it. The helper now
  awaits. The live-agent helpers in `test/fs-substrate.test.mjs` and
  `test/fsio-agent.test.mjs` close in `finally`, and the `close()` methods of
  the three script-backed harnesses bound the SHUTDOWN wait at 2 s and kill on
  timeout, so a failing check cannot leak a `sh` that makes `node --test` wait
  forever.

### Documentation

- **The install steps no longer assume a `dsh` executable.** The Windows
  desktop app ships `DeepSeek Harness.exe` only — the CLI entry lives inside
  `resources/app.asar`, and the probe scripts start it through
  `ELECTRON_RUN_AS_NODE`. The README, QUICKSTART (both languages),
  CONFIGURATION, MIGRATION, ARCHITECTURE, SUPPORT and the first-use template
  now lead with the desktop path (**Plugins** in the sidebar, then **Add
  plugin** — which writes the profile's `package.json` and
  `dsh.profile.bundles`) and label the
  `dsh ...` forms as the CLI distribution's.

- **The README asks whether the plugin is needed before it says how to install
  it.** A harness that can live in the distro — the CLI in a terminal, or
  `dsh web` in a browser — needs no bridge at all, and the new decision table
  says so. It also records the one trap when the two are mixed: `desktop` is
  the Electron app's reserved profile, and the npm CLI refuses to manage that
  profile's plugins.

- **The desktop start line is the executable, not a command.** The installer's
  shortcut launches `DeepSeek Harness.exe` with no arguments, and the GUI opens
  the profile it is configured with — the one the Plugins page writes into.
  `dsh --profile <name>` stays a CLI-distribution line.

## [0.18.0] - 2026-11-05

Track the desktop `0.2.2-rc.1` release: the bundle layer is regenerated from
its shipped patch file, the peer floor moves to the `0.2.2-rc.1` npm line with
the peer-parity re-run the layering rule requires, and the one genuinely broken
path is documented with its operator rule.

### Changed

- **Raised the peer floor and dev pins to the `0.2.2-rc.1` npm line, with the
  peer-parity re-run the layering rule requires.** All ten `@deepseek-ai/dsh-*`
  peers move to `0.2.2-rc.1` (`peerDependencies >=0.2.2-rc.1`), cordis to
  `^4.1.0` with dev pins `4.1.0`, and schemastery to `^3.19.0` — the release's
  own pairing. Two companion fixes rode the move: the `cordis-plugin-*` dev
  pins (`*`) resolved to `1.0.x`, which cordis 4.1.0 breaks at boot (the
  `internal/config` waterfall dereferences a null `parent`; both pins are now
  the release's `1.1.0`), and the `pnpm-workspace.yaml`
  `minimumReleaseAgeExclude` list follows the pins as pnpm rewrites it.
  `src/` changes, all defensive and documented in
  [PEER-PARITY.md](docs/PEER-PARITY.md): the peer's new `patchText`/
  `deleteFile`/`moveFile` operations are refused honestly on the distro side
  (`FS_IO_ERROR` naming the substrate gap — the inherited host implementation
  would target the wrong filesystem) and routed by the usual coordinates
  otherwise; `wslWritableRoots` now honors `additionalWritableRoots` under the
  upstream together-grant contract (a same-distro UNC extra root is granted,
  a Windows-path extra root in a distro workspace fails closed with the
  peer's `SandboxInvalidRootError`). The parity table was re-walked against
  the `0.2.2-rc.1` tarballs: every replicated read/edit string survived
  verbatim, both declared divergences stand, and the line references were
  re-recorded (`dsh-fs-local`'s `lib/index.js` grew 909 → 1048 lines).

### Fixed

- **Adapted to the desktop `0.2.2-rc.1` release.** The `preset-wsl` row is
  regenerated from the release's `standard.patch.yml` (`dsh-v0.2.2-rc.1`):
  `tool-fs` pins `applyPatch: false` (the base `patchText` is the host-side
  implementation and must not quietly cross the 9p share for a distro
  workspace), the removed `tool-subagent-list-agents` row is dropped,
  `tool-subagent` moves from `modelSelectionSettings` to
  `modelSelection` + `modelDiscovery`, and `tool-plugin-manager` follows the
  shipped contextual disable. No `src/` changes were needed: every peer
  symbol the plugin imports survives unchanged in the release's bundled
  copies (`dsh-fs-local` gained patch machinery the preset keeps disabled;
  `dsh-sandbox`'s `writableRoots` now honors `additionalWritableRoots`,
  matching the upstream dialect), and the compatibility audit ran against
  the release's bundled peer copies. The `peerDependencies` floor against
  the freshly published `0.2.2-rc.1` npm line is raised in its own
  commit — the peer-parity re-run the layering rule requires — not in
  this one.
- Documented the one genuinely broken path: **enabling the bundle through
  the GUI on a running profile fails on app `0.2.2-rc.1`** while sessions
  hold the replaced services, because cordis 4.1.0 retains a disposing
  provider's registrations until its dependents drain
  ([UPSTREAM-SERVICE-SWAP.md](docs/UPSTREAM-SERVICE-SWAP.md) — mechanism,
  isolated repro on both version pairs, and upstream remediation
  directions; [LIMITATIONS.md](docs/LIMITATIONS.md) records the
  operator rule: the selection persists and a restart applies it).
  Cold-boot composition is unaffected and verified against the release's
  actual bundle layers.

## [0.17.1] - 2026-11-01

### Fixed

- **The npm package now ships the Chinese user docs** (`QUICKSTART.zh.md`,
  `CONFIGURATION.zh.md`, `LIMITATIONS.zh.md` — added to the files list after
  the packaging link check caught their absence from the 0.17.0 tarball), and
  `package.json`'s Chinese `description` is readable again instead of
  `\uXXXX` escapes (a release-script `ensure_ascii` slip; the parsed value
  was always correct). No shipped-code changes.

## [0.17.0] - 2026-11-01

### Changed

- **Git snapshot spawns are now agent-first with a one-shot fallback.**
  Protocol v6 adds a stdin payload to the EXEC frame (a seventh header field
  flagging one trailing base64 line), which is what lets `workspace-changes`'
  snapshot calls — including `check-ignore -z --stdin` — run on the warm
  resident agent instead of a one-shot `wsl.exe`. Measured on `ubuntu`
  (2026-11-01): ~232 ms per one-shot git call (nearly all `wsl.exe` process
  startup) against ~1.6 ms on the resident — a 6-8 call snapshot saves well
  over a second. The per-stream caps map onto the agent's single wire cap with
  a client-side per-stream slice (`lib/git-exec.js`), and the environment
  rides the agent's per-request `env` (`env --` argv prefix, no `SETENV`
  pollution) carrying only the translated `GIT_*` names. Both agents speak v6
  (the shell agent decodes the payload through command substitution, which
  strips trailing newlines — NUL separators survive; the native binary
  delivers bytes verbatim), so host library and shipped binaries upgrade
  together; the doctor's handshake reports any mismatch.

- **WSL change review no longer requires Windows git.** When
  `resolveExecutable('git')` fails on the host, the provider answers with a
  distro sentinel (`/usr/bin/git`); every workspace-changes spawn — the
  `rev-parse` discovery included — then routes into the distro, and the
  snapshot facade translates the discovery call's absolute-path output lines
  into UNC form (`translateDiscoveryOutput`). A machine with Windows git is
  unchanged (host discovery + `safe.directory` whitelist). The
  `resolveExecutable` override is scoped to the one name and only fires on
  the super's failure.

- **The doctor probes the Windows git trust.** A new `git.win-safe` check
  reports the `safe.directory` whitelist state through interop `git.exe`:
  `ok` when the `\\wsl.localhost` share is whitelisted, a warn with the
  copy-paste remedy when Windows git does not trust it, and an info (nothing
  to do) when there is no Windows git — the distro fallback covers WSL change
  review entirely.

### Documentation

- The architecture and upstream-promotion documents reflect the v6 protocol
  and the shell-menu candidates; the promotion map records the measurement
  that superseded the git one-shot decision.
- The full real-machine suite re-ran 15/0 on 2026-11-01 after the protocol
  change landed, and again after the documentation refresh. The safe.directory
  prerequisite for WSL change review is now documented with its one-time
  remedy.

- **The shell menu now offers host shells instead of a single entry.**
  `terminal-controller`'s `shellCandidates` grows from `[]` to
  `[wsl.exe, powershell, cmd]` while the default profile stays
  `shell: { path: wsl.exe, name: WSL }`. `wsl.exe` dedupes into the default's
  `wsl` kind; `powershell` and `cmd` are launches this terminal really starts —
  host sessions already run PowerShell outright (`hostSessions`), and a manually
  selected shell is titled after itself, which moves the tab-title workaround
  from a user-layer edit into the plugin's own composition
  ([#8769](https://github.com/deepseek-ai/deepseek-harness/discussions/8769)
  remains the real fix for the default entry's title).

## [0.16.0] - 2026-10-31

The schema-validated routing row: the root-plane router stops silently
ignoring a mistyped or wrong-typed distro key, and the first pass of the
community-optimization plan stamps the routing documentation and the 1.0
roadmap with dated, current evidence.

### Changed

- **`fs-routing` row config is now validated at load time.**
  `WslRoutingFileSystem.Config` no longer blindly reuses
  `LocalFileSystem.Config`: it is a `z.intersect` of the host row's schema and
  the distro-side keys (`distro`, `wslPath`, `distroCwd`, `sandbox`,
  `maskWindowsDrive`, `restrictToDistro`, `watchMaxDepth`). The Loader now
  refuses to mount the row when a key fails its schema — previously a typo or
  a wrong type was silently ignored and the distro side ran on defaults. A
  `null` field value still falls back to the schema default, which matches how
  the Loader treats optional keys. Composition tests mount the row through the
  real Loader to assert both the accepted defaults and the rejected values.

### Fixed

- `docs/root-fs-routing.md` claimed a 12-probe suite with no routing probe, a
  unit file outside the test lists, and a 10/10 composition test. All three
  had drifted: the suite is 15 probes with `--include-fs` and includes
  `fs-routing.sh`, `test/fs-routing.test.mjs` entered both test lists on
  2026-10-19 (OI-7), and the composition test is 12/12. A header note stamps
  the 2026-10-31 review.
- `docs/ROADMAP-1.0.md` still described WSL-101 as implemented in the working
  tree; it shipped in 0.13.0, and the status now records which acceptance leg
  has real-machine evidence and which leg (concurrent two-distro) is still
  missing. WSL-104's "routing probe has never been executed" claim is replaced
  by the dated 2026-10-31 single-machine 15/0 result; the metrics row's probe
  count moves to the current 15-with-fs breakdown.

## [0.15.0] - 2026-10-27

The compatibility-matrix release: the support table and its evidence, the
container and nightly legs that keep it current, two fresh-distro first-run
fixes the run surfaced, and the interop stance in one configuration key.

### Changed

- **WSL-310: `scripts/bootstrap-import.sh` — a rootfs tarball becomes a
  plugin-ready distro in one pass.** The command automates the import traps
  the compatibility-matrix run documented: ELF-header architecture detection
  (walking bin/ candidates, tolerant of the SIGPIPE an early-exiting dd
  causes), `wsl --import` with an idempotent already-exists branch, the OOBE
  wedge unstick, `/etc/wsl.conf` with `[boot] systemd` and `[user] default`
  (an imported default-root distro makes the agent run as root), per-family
  package-manager install including `systemd-sysv` — docker-export tarballs
  strip `/sbin/init`, which is what broke the systemd boot chain — Linger as
  root, and a final doctor pass. Verified on Debian 13.5 (systemd family:
  every check green after the one mandated `wsl --shutdown`) and the Alpine
  minirootfs (OpenRC: the non-systemd profile per WSL-201, systemd checks
  reported as the declared degradation).

### Fixed

- **WSL-307: the confined resident's spawn preparation is now a named
  self-heal checklist.** WSL-305 fixed the missing workspace root; the same
  fresh-distro class has more members (no `sh`, no `base64`, no `sha256sum` —
  minirootfs ships almost none of this). The confined factory's `prepare` now
  runs one `sh -c` round trip whose first failing step names itself
  (`workspace-root`, `interpreter`, `base64`, `sha256sum`), and the failure
  reaches the caller as `spawn checklist step '<name>' failed in <distro>`
  instead of a bare handshake code. The root rides as `$1`, never
  interpolated into the script body. Verified end to end on Debian with an
  absent workspace root: the checklist creates it and the first confined
  write lands.

### Fixed

- **WSL-306: a directory name containing a newline lists as one exact row in
  the picker.** The picker's distro-side listing was `ls -1ALp` line-parsed —
  a newline in a name split into two rows or dropped out entirely. The
  listing is now `find -L <dir> -maxdepth 1 -mindepth 1 -type d -print0`
  (NUL-separated, `-type d` filtering in the distro where `-L` resolves
  symlinks), sorted host-side. Busybox find supports every flag — verified on
  alpine:3, debian:stable-slim and fedora:latest with a newline-named
  fixture, and the picker probe now carries that fixture against the real
  composition. The LIMITATIONS entry retires.

### Fixed

- **The nightly sandbox probe no longer crashes when the runner workspace sits
  outside the C: drive.** The probe's bwrap-profile builder imported
  `lib/bwrap.js` by a raw Windows path; on a self-hosted runner whose
  workspace is on another drive the ESM loader rejects the `d:` scheme and
  the first nightly run failed. The import now goes through
  `pathToFileURL` (same hardening applied to the watcher probe).

- **The nightly probes job now tests the WSL topology, not the presence of
  the binary.** The scheduled runs land on GitHub-hosted `windows-latest`
  runners — no self-hosted runner carries that label, so the hosted fleet
  picks the job up — and a hosted Windows image ships `wsl.exe` on PATH with
  no distro behind it. The old `command -v wsl.exe` guard therefore always
  passed, and the sandbox leg died inside wsl.exe itself: the last run
  aborted on the `wslpath` translation with wsl.exe's own UTF-16 "no
  installed distributions" surfacing as null bytes and exit 127 under the
  step's `-e -o pipefail`. The guard now requires the default distro to
  actually launch (`WSL_UTF8=1 wsl.exe -e true`); where it does not, the job
  reports `skip all` — the honest no-op CONTRIBUTING now states. Where a
  default distro does launch, the sandbox probe runs inside it through
  `wsl.exe -e`, which is where the script's header and CONTRIBUTING already
  place it: bubblewrap exists only there, so the leg could never pass from
  Git Bash. The leg also picks up the `USER` resolution its sibling got in
  the preceding fix (that hardening claimed `sandbox.sh` but changed only
  `session-sandbox.sh`; a non-login `wsl.exe -e` shell needs it too). The
  probe holds all 14 expectations under `env -u USER` in a distro.

### Added

- **`scripts/open-wsl-vscode.ps1` — open a WSL folder in VS Code through
  Remote-WSL.** Opening the UNC share in VS Code is the degraded mode: files
  cross 9p, the terminal is PowerShell, extensions run on Windows. The
  helper translates a WSL UNC path (or a Linux path + distro) into the
  `vscode-remote://wsl+<distro>` folder URI, so VS Code's server runs inside
  the distro — local ext4, distro shell, distro extensions. The quickstart
  documents it next to the workspace-opening step.

### Changed

- **The doctor gains a cross-distro sessions view (WSL-309) and marks live
  residents (WSL-313's observable half).** A new survey after the runtime
  checks lists every running distro with its `dsh-wsl-*.scope`, the scope
  state and the resident pids the distro's own cgroup attests — the
  concurrent-sessions coordinate routing made possible, made visible. The
  agent.handshake check now notes when a live resident is already running in
  the surveyed distro (and that its fresh probe cannot read that resident's
  last error). The scope report records resident pids alongside the stale
  verdict. Idle countdowns and lastError stay host-side — no IPC exists, and
  the boundary is documented in LIMITATIONS.

- **The real-machine probes now run nightly on the self-hosted runner.** A
  schedule trigger (21:30 UTC) fires only the `probes` job — every hosted job
  skips the event — so the Tier 1 "probe suite 100%, nightly" metric collects
  its evidence on its own instead of waiting for a manual dispatch. A
  dedicated concurrency group folds a backlog of missed nights (runner
  offline) into the newest run. The probes still require the harness app to
  be closed; a night where it was open reports honestly red.

- **The shell agent now runs in CI inside the non-Ubuntu containers it
  claims to support.** `test/agent-container.mjs` drives the real
  `wsl-agent.sh` over the v5 frames inside `docker run` for
  `debian:stable-slim`, `alpine:3`, `fedora:latest`, `opensuse/tumbleweed`
  and `archlinux` — seven checks each: the HELLO handshake with the
  in-place script digest, PING, EXEC with exit code and both streams, SETENV
  reaching later commands, and the presence of `sha256sum`/`base64` where
  the families actually differ (busybox on Alpine, coreutils elsewhere). The
  `agent-containers` CI job runs one container per matrix leg. 35/35 on
  first execution; this closes the container leg of WSL-202's acceptance.

## [0.14.0] - 2026-10-27

This release fixes the first-run trap the compatibility-matrix run found on a
freshly imported distro, and ships the measured support table the run produced.

### Fixed

- **WSL-305: the confined resident now creates the workspace root before its
  first spawn.** The bwrap profile binds the workspace root and bwrap refuses
  a missing bind source, so on a freshly imported distro the first confined
  write failed with a bare `FS_IO_ERROR: agent exited during handshake
  (code=1)` and a misleading remedy. `agent-confined.js` gained a `prepare`
  hook (workspace-write only — the only mode that binds the root) that runs
  `mkdir -p` on the Linux-spelled root before bwrap runs, idempotently and
  ignoring its own outcome: bwrap stays the authority, and a refusal still
  reaches the caller. That refusal now carries evidence: the handshake
  failure's message includes a bounded tail of the resident's stderr (the
  half-day of diagnosis this cost came from it being swallowed). Three new
  checks cover the prepare hook, its argv, and the stderr ride-on; a
  fresh-root leg in `substrate.sh` exercises the absent-root spawn end to
  end on a real distro.

### Changed

- **Debian is verified end to end, and the run found a first-run trap.**
  The four harness-level probes pass against a `wslfs-debian` profile on a
  freshly imported Debian 13.5, completing the full stack on top of the
  distro-internal suite (`docs/COMPATIBILITY.md`). Getting there surfaced one
  real finding: the confined resident refuses to start when the workspace
  root does not exist yet — the bwrap profile binds the root, bwrap requires
  the bind source to exist, and a fresh distro has nothing to bind. Creating
  the root first turns all ten failing steps green; prior Ubuntu runs had it
  left over from earlier probes. The finding is documented in the matrix page
  with the suggested spawn-preparation fix.

- **The compatibility matrix moves from prose to a measured page.**
  `docs/COMPATIBILITY.md` records the WSL-202 evidence: six real WSL2 distros
  (Ubuntu, Debian 13.5, Fedora 44, openSUSE Tumbleweed, Arch, Alpine 3.22)
  executed the distro-internal probe suite on one machine on 2026-10-26, and
  the page explains the two observed differences instead of hiding them — the
  `session-sandbox` background-survival leg races WSL session teardown on
  three systemd distros (probe artifact, not a plugin claim), and on Alpine
  the same leg fails by declaration, because non-systemd distros get the
  narrower `sessionSandbox: auto` scope exactly as P1.1/WSL-201 promises. The
  page also records the per-distro import traps (Debian OOBE wedge, Alpine
  minirootfs defaulting to root, busybox mktemp, zypper's interactive prompt)
  and the reproduction commands. Not yet measured: real aarch64 hardware, the
  container-image matrix.

- **The aarch64 native agent is executed in CI, not only built.** The
  `native packages` job installs qemu's user-mode emulator and binfmt
  registration (`qemu-user` + `qemu-user-binfmt`; noble has no real
  `qemu-user-static` package) and runs the full
  18-check spike suite under qemu-user against both the freshly built aarch64
  musl binary and the committed `agent/native/linux-aarch64/dsh-wsl-agent` —
  the binary a Windows-on-ARM session would load. User-mode emulation
  exercises every check (the static musl binary and the v5 frames are
  host-OS-free), verified locally first: 18/18 under `qemu-aarch64`, with
  `/proc/self/exe` resolving to the target so the HELLO digest binding holds
  unchanged. This closes the "build-tested only" gap on WSL-202; a run on
  real aarch64 hardware remains open.

## [0.13.2] - 2026-10-26

This release tracks DeepSeek Harness `0.2.1-rc.3`: the peer declarations become
floor ranges so a newer harness installs the plugin unchanged, and the
lockfile's transitive `undici` moves past a security advisory that Dependabot
could not clear on its own.

### Fixed

- **`undici` in the lockfile moves to the security-fixed `8.12.3` via a pnpm
  override.** `undici` rides in only as an exact transitive pin of
  `@deepseek-ai/dsh-http-proxy` — a package upstream controls — so Dependabot's
  security job could resolve no patched version (it reports "the latest
  possible version … is 8.11.2" and fails). `pnpm-workspace.yaml` now carries
  `overrides: { undici: '>=8.12.3' }` (the pnpm 11 settings home; the
  `package.json` `pnpm` field is no longer read), the lockfile swaps the one
  package, and the override comment records that it is retired when upstream
  moves the pin. Nothing under `src/` reads `undici`; the check chain is
  unaffected.

### Changed

- **The peer declarations become floor ranges, so a newer harness installs
  the plugin unchanged.** The `@deepseek-ai/dsh-*` entries in
  `peerDependencies` move from the exact pin to `>=0.2.1-rc.3`, and
  `@deepseek-ai/cordis` / `@deepseek-ai/schemastery` widen from `~` to `^`
  (`^4.0.5`, `^3.18.5`). An app that ships a newer harness release now
  satisfies the peers without waiting for a plugin release — same-line rc
  bumps and every stable release install cleanly; only a brand-new
  prerelease line (`0.2.2-rc.1` against `>=0.2.1-rc.3`) still warns, because
  semver admits a prerelease only against a comparator on its own tuple and
  no range can promise an unpublished line. That residue is what the weekly
  peer-canary is for: it still resolves the `next` dist-tag into a scratch
  tree and flags when the line moves past a floor — the signal to re-run the
  `docs/PEER-PARITY.md` comparison and raise the floor in the commit that
  matches the harness release. The devDependencies keep their exact pins, so
  the gates stay reproducible and the parity audit keeps naming one line.
  `scripts/doctor.mjs` learned the new shapes (`peerSatisfied` now reads `>=`
  and `^`, and its `compareVersions` orders prerelease identifiers by semver
  §11 — `rc.10` above `rc.9`), `scripts/peer-canary.mjs` parses and preserves
  the shapes, and `AGENTS.md`, `CONTRIBUTING.md`, `SUPPORT.md` and
  `docs/PEER-PARITY.md` state the new policy.

- **The dev pin line moves to DeepSeek Harness `0.2.1-rc.3`.** Every
  `@deepseek-ai/dsh-*` pin in `devDependencies` goes from `0.2.1-rc.2` to
  `0.2.1-rc.3` — the release the `next` dist-tag resolves to — and
  `pnpm-lock.yaml` refreshes with it. `@deepseek-ai/cordis` and
  `@deepseek-ai/schemastery` stay at `4.0.5` / `3.18.5`: upstream's `vendor/`
  did not change on this line.

  No module under `src/` changed, and that is the finding. The three peers
  this plugin subclasses or replicates ship byte-identical `lib/index.js`
  files on rc.3 — `dsh-fs-local` (the fsio dialect, still 909 lines), `dsh-fs`
  (the `FsVersion` brand) and `dsh-bash-local` (the spill machinery) — so
  every line reference in `docs/PEER-PARITY.md` still names the same code;
  only the tarballs' digests changed, and the parity doc now carries the
  `0.2.1-rc.3` ones with the re-check dated 2026-10-26. That byte-identity is
  also the evidence behind the new peer floor: the same code answers above
  rc.3. Upstream's release notes for the line are UI- and LLM-side
  (navigation entry customization, analytics, the official `/models`
  listing): the one composition-visible change is a new `entry-customization`
  UI row in the app's own `cordis.patch.yml`, which rides with the app's
  bundle rather than this plugin's layer. `preset-wsl` needed no
  regeneration — `packages/bundle/web-app/presets/standard.patch.yml` is
  byte-identical on rc.3 — and the provenance comment in `cordis.patch.yml`
  now names the rc.3 tree.

## [0.13.1] - 2026-10-19

A patch release restoring `wsl-shell-env`: the component mounts again, and the
managed `DSH_*` facts it contributes now reach commands on the default
resident-agent path.

### Changed

- **Upstream proposals filed.** The session-notice seam
  ([#10263](https://github.com/deepseek-ai/deepseek-harness/discussions/10263)),
  the `spawnSpec` seam (#10261), the fsio export (#10262), the UNC-workspace bug
  (#10260) and the WSL-workspaces RFC (#10264) now point at their discussions;
  the local drafts carry the links.

### Fixed

- **`wsl-shell-env` no longer fails to activate.** The row sweeps the
  live-agent list at mount to warm facts for sessions that opened before it,
  but declared only `shellEnv` in `inject` and read `ctx.agents` as a property.
  Cordis 4 refuses that read — `cannot get property "agents" without inject` —
  so `apply()` rejected and the plugin manager listed the component as 异常
  (`包含的组件 → 异常`), with the whole contribution missing from shell calls.
  The sweep now reads the service through `ctx.get("agents")`, the sanctioned
  access for a service this row does not inject: activation no longer depends
  on an agent loop, and the sweep still runs when one is composed.
  `wsl-preflight` carried the same property read inside a `try`/`catch`, where
  the throw silently disabled its mount sweep; it gets the same fix.
  `test/shell-env.test.mjs` and the real-cordis check in
  `test/preflight.test.mjs` mount both rows against the guard.

- **The managed `DSH_*` namespace now reaches commands on the default
  resident-agent path.** `ShellExecSpec.dshEnv` was forwarded only by the
  one-shot `wsl.exe` fallback; `executeViaAgent` dropped it before
  `agent.exec` — after the mount fix above, the row registered its facts but
  no model shell call could see `DSH_HOME`, `DSH_SESSION_ID` or any
  `DSH_WSL_*` value (`env | grep '^DSH_'` was empty). The handle now carries
  the merged map (`env` first, `dshEnv` last — the same order the one-shot
  path uses) into the agent's `SETENV` frames. `test/agent-exec.test.mjs` and
  `test/provider.test.mjs` pin the frame, and both checks fail against the
  previous build.

## [0.13.0] - 2026-10-19

This release ships the P0/P1 hardening batch: session-scoped `auto`
sandboxing, resident-agent recovery with doctor coverage, the packed-install
E2E, measured GUI-preview and `@`-reference probes, and the docs/community
entry points.

### Added

- **`pnpm run preset` — the `preset-wsl` override helper.** `wsl-shell` and
  `wsl-fs` sit inside `preset-wsl`'s `config.plugins`, so a patch that targets
  them by id is ignored with only a loader warning. The helper prints the
  complete `preset-wsl` block, applies `distro`/`sessionSandbox`/`sandbox`/
  `maskWindowsDrive`/`agentBackend`, and `--check` fails loudly with the exact
  block to paste when a layer carries the nested id patch. See
  [docs/CONFIGURATION.md](docs/CONFIGURATION.md#configure-wsl-shell-and-wsl-fs).

- **Session-notice upstream payload ready.** The exact title, body and `gh`
  command for the session-visible notice proposal are in
  `docs/upstream/proposal-session-notice.md`; it remains unfiled (a maintainer
  action).

- **Configuration stability and migration policy.** `docs/MIGRATION.md` records
  the below-1.0 freeze (new keys preserve behavior, removals refuse at boot with
  a migration, meaning changes get a note), the deprecation path with the
  `substrate: "share"` and `distro: ''` cases, and the release-gate table with
  the manual legs (probe suite, clean machine, aarch64) marked unrun.
  RELEASING and SUPPORT link it.

- **Upstream promotion pack documented.** `docs/upstream/promotion-pack.md`
  records the `packages/wsl/*` layout (ten capability packages plus an
  integration package), the seam/RFC index, what the composition boot test
  covers and its gaps, and the install proof. Promotion stays packaging and
  proof, not a dependency.

- **`@`-reference traversal cost measured; seam deferred.** The Windows walk
  over the WSL share is ~56× the ext4 walk on a 520-entry tree (84.7 ms vs
  1.5 ms) and is now reproducible with `pnpm run probe:file-reference`.
  `docs/UPSTREAM-FILE-REFERENCE-SEAM.md` records the three-function seam, the
  ready (unwired) plugin consumer, and the decision to keep the 9p walk until
  upstream exposes the funnel.

- **Community loop: issue forms, triage targets and a contributor path.**
  Feature-request and setup-report forms (the setup form requires
  `doctor --json`), a chooser that disables blank issues, SUPPORT's P1
  three-business-day target and two-to-four-week cadence, and a
  `good first issue` path in CONTRIBUTING.

- **Quickstart and performance entry pages.** `docs/QUICKSTART.md` is the
  five-minute path (prerequisites, install, first session, Node/Python/Rust/Go
  and monorepo recipes, honest Tier 1/Tier 2 table); `docs/PERFORMANCE.md`
  records the 9p-vs-agent numbers and the GUI-preview baseline with reproduction
  commands. The visual demo is explicitly still missing.

- **GUI-preview latency has a measured baseline.** `pnpm run probe:gui-preview`
  drives the routed backend's `stat`, `listDir` and 1 MiB `readByteRange` with
  p50/p95 budgets (stat 100 ms, listing 500 ms, page 1 s/MiB). On this machine:
  p95 2.7 ms / 5.1 ms / 63.5 ms per MiB. No optimization follows; the
  `workspace-files` row is untouched.

- **LSP seam researched and deferred.** `docs/UPSTREAM-LSP-SEAM.md` records that
  the harness ships `dsh-lsp`/`dsh-lsp-stdio`/`dsh-tool-lsp` but the 0.2.1-rc.2
  base composition mounts none of them, and that a WSL provider needs a
  preset-scoped subprocess provider plus URI translation. The prototype is
  deferred behind an explicit trigger; no LSP claim is made in the README.

- **Peer-upgrade canary.** A weekly workflow resolves the `next` dist-tag of
  every pinned peer, tests that line in a scratch copy (`pnpm test` + the
  composition boot test), and publishes the exact version delta in the run
  summary; a moved line that fails fails the run. `pnpm run canary:peers`
  performs the check locally.

- **The strict profile is documented and probed.** `maskWindowsDrive: true` with
  `sandbox: true` hides `/mnt` from confined profiles; CONFIGURATION describes
  the trade-offs and the visible/masked/disabled interop matrix, and
  `probe:sandbox` now asserts the masked leg (empty `/mnt`, unreachable Windows
  binary, writable workspace). Enforcement stays `partial`; the binfmt content
  escape and the distro-level closure are stated.

- **Install/upgrade/uninstall E2E.** `pnpm run e2e:install` packs the tree,
  installs it into a fresh `%TEMP%` `DSH_HOME`, composes `--dump-config`, removes
  it, and upgrades from the previous minor with a marker proving the profile
  layer survived. `test/packaging.test.mjs` keeps the packed file list honest in
  `pnpm test`.

- **The doctor probes the resident agent.** `agent.handshake` starts the
  shipped shell agent in the distro, reads its HELLO (pid, protocol, script
  digest) and stops it, so a missing or stale agent script is a named check
  instead of a first-command failure. It also reports the agent cache and the
  live/stale `dsh-wsl-*.scope` counts.

- **`pnpm run doctor` — one command for the environment prerequisites.** Reports
  Windows/WSL versions, the distro and its login shell, bubblewrap usability,
  systemd / the user manager / `systemd-run` / Linger, the optional tools, peer
  versions, the native-agent cache, stale `dsh-wsl-*.scope` units and the
  profile-patch trap that silently ignores `wsl-shell`/`wsl-fs` overrides. Each
  failure carries one copy-paste remedy; `--json` is the machine shape, and
  `--fix` only sweeps stale scopes unless `--install` plus a confirmation allows
  a package install. `diagnose` is now the read-only alias.

### Changed

- **`sessionSandbox: auto` — the session runtime is an optimization, not a
  prerequisite.** `wsl-shell` and `wsl-fs` accept `true`, `false` or `"auto"`;
  `auto` uses the systemd user scope when it is available and otherwise falls
  back to the per-command `bwrap` profile — still confined, never unconfined —
  reporting `sessionScope: "session" | "per-command"` in the command result.
  A failed verdict is re-probed at most once a minute, so installing systemd or
  enabling Linger upgrades without an app restart. `true` keeps refusing with
  the existing remedy; `false` is unchanged.

- **The session preflight also checks the session-runtime prerequisites.** It
  now probes systemd as PID 1, the user manager, `systemd-run` and Linger —
  not only `bubblewrap` — when a distro session opens, and publishes the same
  advisory to the session's runtime context as well as the log. `sessionSandbox:
  false` on the `wsl-preflight` row skips the session half. DSH 0.2.1 has no
  session-notice seam; the ask is recorded in
  [docs/UPSTREAM-SESSION-NOTICE.md](docs/UPSTREAM-SESSION-NOTICE.md) and the
  boundary in [docs/LIMITATIONS.md](docs/LIMITATIONS.md#session-start-advisories).
  Advisory only: nothing is installed and fail-closed behavior is unchanged.

- **The distro follows the workspace.** `distro: ''`/`'auto'` now selects the
  distro from the request workdir or target UNC; `'default'` forces WSL's
  default, and an explicit name still pins. Shell, files, root-plane routing,
  the GUI terminal and `shell-env` all use the same rule, and the shared agent,
  substrate, home and session-runtime state are cached per distro. A pinned
  profile still refuses a foreign UNC with `FS_OUTSIDE_DISTRO`. This changes the
  previous meaning of `distro: ''` (WSL's default): set `'default'` to keep that
  posture.

### Fixed

- **A dead resident revives with bounded backoff instead of staying dead for
  the process lifetime.** A failure that spends the one permitted rebuild now
  leaves the agent `dead` with a revival scheduled (2 s, 4 s, 8 s); the next
  call after the delay gets a fresh transport and its own single rebuild, and
  nothing from the dead generation is replayed. After three deaths the state is
  permanent and the refusal names the restart remedy. `status()` exposes the
  live state, pid, last error and pending count for diagnostics.

- **A cancelled command's signal can no longer kill the next one.** The
  out-of-band USR1 carries no request id: a signal meant for a timed-out
  command could land after the agent had moved on, and the next command then
  died with exit 138 but reported `completed`. A host timeout no longer sends
  the signal at all (the in-distro watcher is the one that kills that
  command), and an explicit cancel now waits briefly and is dropped once the
  request answered or a newer request is running.

- **A missing workdir is reported with its path on the native agent.** The
  native agent reports the failed spawn as reason `spawn`, without naming the
  directory; the executor now treats that as its own error class and retries
  the command on the one-shot path, whose `chdir(<path>) failed` warning names
  the directory.

## [0.12.0] - 2026-10-19

The GUI file service keeps the shipped `workspace-files` row: its server-only
replacement dropped the browser `file` resource provider and broke Sidebar
previews. The shipped row now serves WSL paths through `fs-routing`. The
`wsl-shell.maskWindowsDrive` wiring fix ships with it.

### Fixed

- **`wsl-shell.maskWindowsDrive` reaches the per-command sandbox.** The shell
  executor built its `WslSandbox` without the configured key. With
  `sessionSandbox: false` the per-command profile therefore left `/mnt`
  visible after the operator asked for the mask; with `sessionSandbox: true`
  the runtime still masked the drive, but the decorated result reported
  `windowsDrive: "visible"`. The executor now passes the value, matching
  `wsl-fs` and `fs-routing`.

- **Sidebar previews work: the GUI file service keeps the shipped
  `workspace-files` row.** The former `workspace-files-wsl` takeover replaced
  that row with a server-only subclass, which dropped the browser `file`
  resource provider and made every Sidebar preview report "The file resource
  service is unavailable." The shipped row now serves WSL paths through
  `fs-routing`, so the server and client halves stay paired. The trade-off is
  GUI-only: a listing, `stat` or page read takes roughly four to six agent round
  trips instead of one, and a deep page read streams the preceding lines through
  the pipe. The model's file tools, search and `@` references are unaffected.

## [0.11.0] - 2026-10-18

The shared read agent is the native binary (A7): unconfined reads now use the
packaged static-musl agent with the shell as the fallback, cutting 16
concurrent reads from 342-614 ms to 2.4-8.2 ms. The A6 FS measurement and
metrics ship with it.

### Added

- **The shared read agent is native (A7).** `WslAgent` gained an async
  `prepare()` hook; `sharedAgent` uses it to select the packaged native binary
  through `agentBackend` (`auto`/`native`), with the shell as the fallback
  (`shell`, a failed preparation, or a native HELLO/runtime failure; the reads
  never fail closed). The A6 probe measures 16 concurrent shared reads at
  2.4-8.2 ms, down from 342-614 ms on the shell. The native shared agent also
  serves the picker, the subprocess activity probes and the non-session
  command path, so those inherit EXEC concurrency.

- **`WslAgent.metrics()`.** Per-kind queue wait (sent -> ACK), execution time
  (ACK -> settle), in-flight peak, rejected and cancelled counters; the
  47-check lifecycle suite covers the counters and the reset.

- **`test/probe/fs-queue.mjs`.** A live measurement of both FS agents. The A6
  run showed the shared shell reads were the batch bottleneck (16 concurrent
  `stat`/`read`/`list` at 342-614 ms, queue up to 583 ms) while native FS ops
  execute in 0.2-0.3 ms; the A7 run measures the native shared reads at
  2.4-8.2 ms. v6's lock removal only takes 16 native writes from 7.7 ms to
  ~5 ms, so it stays deferred.

### Changed

- **The plan after the A6 measurement: A7 (native shared reads) landed, v6
  deferred.** [`docs/ROADMAP.md`](docs/ROADMAP.md) records the done, next and
  deferred steps; ADR 0002, LIMITATIONS and the READMEs describe the native
  shared reads and the v6 deferral.

- `test/probe/fs-queue.mjs` and the README/LIMITATIONS/ROADMAP describe the
  native shared reads; `test/agent-shared.test.mjs` covers the shell selection.

## [0.10.0] - 2026-10-18

The native in-distro agent is the default session-runtime backend: `agentBackend: auto`
selects the packaged static-musl binary for the distro's architecture, the shipped
shell agent stays as the fallback, and `native`/`shell` keep the strict and forced
modes. The peer line moves to DeepSeek Harness `0.2.1-rc.2`, which is the desktop
app's own version line. No module under `src/` changed, and that is the
finding, not an omission: every peer artifact this plugin subclasses or
replicates is byte-identical to the one shipped for `0.2.0-rc.2`, except one
added field in the `dsh-api-workspace-files` class that `WorkspaceFilesWsl`
extends (and that package's regenerated typert artifacts), so the seams the
code is built on did not move. What did move is the shipped composition — the
standard agent preset — and the plugin's embedded `preset-wsl` is regenerated
from it.

### Added

- **The watcher uses inotify when it can.** With `inotifywait` installed and an
  unbounded directory target, the in-distro watcher now uses recursive inotify
  watches and coalesces events to one callback per 0.5s instead of polling
  `find`. A file target, a positive `watchMaxDepth`, or a missing
  `inotify-tools` keeps the polling fallback, so the backend is optional. The
  polling mtime-old blind spot does not apply to the inotify path.

- **`sessionSandbox` runs one session's commands in one scope.** With the key
  on, the shell executor acquires the runtime for `(distro, workspace,
  policy)` on the first command, reuses it for the session, runs the command
  WITHOUT the per-command bwrap wrap (the runtime's own mounts confine it),
  and releases it from the preset scope's disposer — closing the agent and
  stopping the unit, whose cgroup reaps the session's leftovers. On in the
  shipped preset; requires `agent: true`, systemd as PID 1, a reachable user
  manager, `systemd-run` and `Linger`. The preflight refuses with the remedy
  when one is missing (only a success is cached, so following the remedy
  needs no app restart); set `sessionSandbox: false` for the per-command
  shape. Validated on a live session: `ps -p 1` is systemd, the command's
  cgroup is the `dsh-wsl-*.scope`, a background process and `/tmp` survive
  across commands, and the unit disappears after the session ends.

- **The session-runtime registry.** `src/session-runtime.ts` refcounts one
  agent per `(distro, workspace, policy)`, composes the systemd user scope
  prefix with a bwrap mount profile that avoids a PID namespace (and binds the
  real `/tmp` under `workspace-write`), and tears a runtime down by closing the
  agent and then stopping the scope. `--unshare-pid` is now a profile option
  (default true), and the agent accepts an explicit lease independent of the
  idle close. Tests cover the refcount, the mode-specific mounts, the mask in
  the key, the explicit lease, and the close-then-stop order. It is wired into
  the shell executor behind `sessionSandbox`, with a preflight that refuses
  with a remedy; the filesystem provider's unification is next.

- **The session-scoped sandbox's launcher primitives.** `src/session-scope.ts`
  builds the systemd user unit name, the `systemd-run --user --scope` prefix,
  the stop argv and the preflight probe argv; unit tests pin the shapes and the
  sanitization. ADR 0001 records the runtime-ownership decision the wiring
  still has to make (the agent is a per-distro singleton today). No behavior
  change yet.

- **`docs/VALUE.zh.md` states what the plugin is worth, in Chinese**, for a
  reader deciding whether to install it: the three misalignments it removes,
  six values each with its mechanism and the evidence that backs it, the
  comparison against no integration / desktop remoting / putting the CLI in
  WSL, the costs and limits stated before the sale, how the claims are
  proven, and a rule for when not to use it. It is linked from both readme
  indexes and sits beside the reference docs, never in place of them.

### Changed

- **The peer pins move to the `0.2.1-rc.2` line**: `@deepseek-ai/dsh-*` at
  `0.2.1-rc.2`, `@deepseek-ai/cordis` at `~4.0.5`, `@deepseek-ai/schemastery`
  at `~3.18.5`, with `pnpm-lock.yaml` refreshed. pnpm's release-age policy
  records the exact closure it had to exempt in `pnpm-workspace.yaml`, the way
  the harness repository does. The three seam packages were compared byte for
  byte against the previous pin: `dsh-fs-local`'s `lib/index.js` (the fsio
  dialect this plugin replicates), `dsh-fs`'s, and `dsh-bash-local`'s (the
  spill machinery and the `spawnSpec` seam) are identical files, so every line
  reference in `docs/PEER-PARITY.md` and `docs/UPSTREAM-SPAWN-SEAM.md` still
  names the same code — only the tarballs' digests changed, and
  `docs/PEER-PARITY.md` now carries the `0.2.1-rc.2` ones. `cordis@4.0.5` and
  `schemastery@3.18.5` likewise publish the same bytes as `4.0.4` and
  `3.18.4` except for their manifests. Elsewhere: `dsh-fs@0.2.1-rc.2` drops its
  unpublished `./invariant` export subpath (nothing here imported it),
  `dsh-subprocess-local`'s new code is Linux systemd scope selection (this
  plugin spawns `wsl.exe` from a Windows host), `dsh-api-workspace-files` adds
  one `resource` field to its own lookup registration, and the typert protocol
  gained modules.
- **`preset-wsl` is regenerated from the shipped standard preset.** The rows
  that arrived are the clock-reading `time-context` row, `tool-schedule`, and
  the disabled `tool-plugin-market/tools` row; the rows that left are
  `tool-ralph` and the disabled `subagent_codex` / `subagent_claude_code`
  entries, whose providers the preset no longer declares anywhere. The two
  `tool-subagent` rows drop `backgroundMode`, the plan-mode section's first
  sentence now says the plan is approved *through* `exit_plan_mode`, and
  `persona.suffix` is gone: the host plane's new `working-directory` row
  reports the Session's cwd, so the "Your working directory is …" suffix is no
  longer the mechanism. The three deliberate deviations from the shipped copy
  — the `wsl-env` realm wrapping every row, the fixed shell-tool choice, and
  the preset's identity — are unchanged, and the transformation is now
  [scripts/build-preset-wsl.mjs](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/scripts/build-preset-wsl.mjs) rather than the
  machine-local generator the block used to name: it takes the shipped file and
  prints the row, and its output is the committed block byte for byte.
- `docs/UPSTREAM-TERMINAL-FONT.md` closes: the `0.2.1-rc.2` line made the
  terminal font a user setting (`--dsh-font-family-terminal` /
  `--dsh-terminal-font-size`), so the hardcoded stack it argued against is now
  only the fallback appended after the user's list.
  `docs/UPSTREAM-TERMINAL-TITLE.md` was re-checked against the new tag and is
  unchanged, including after the terminal controller's 0.2.1 rework: the tab
  title is still built from `shell.name` alone.

### Fixed

- **The GUI file service loads again from a linked install** (`workspace-files-wsl`
  failed to import, and the Desktop host then died on a `write EOF`). The module
  imports `@deepseek-ai/dsh-api-workspace-files` and
  `@deepseek-ai/dsh-typert-protocol` at runtime, but both were declared only as
  dev dependencies. The runtime's linked-plugin resolver routes a bare import
  to the installation package only when the plugin's own manifest lists that
  name under `peerDependencies` (`dsh-app-boot`'s `readPeerNames` /
  `routeLinked`), so the import missed, the entry never activated, and Desktop
  exited 1; the fatal `write EOF` is the shell writing to that already-exited
  host. Both names are peers now, and `test/peers.test.mjs` scans every
  `lib/*.js` import so an undeclared runtime package fails the check chain
  instead of the app.

- **A warm native-agent cache no longer kills the Host on startup.** The
  in-distro copy script prints the cache path and exits *without reading stdin*
  when the digest already matches. `copyBinary` still streamed the packaged
  binary into that closed pipe and left stdin's `error` event unhandled; on
  Windows the write surfaced as `write EOF` and took the Host down before the
  UI could load, so the first run (cold cache) worked and every later start
  crashed. The write error is absorbed now — the exit code and stdout already
  decide the result — and a POSIX regression check runs an early-exit script
  against a payload larger than any pipe buffer.

- **The root-plane router survives its first distro target, and that path now
  has a regression test.** Three defects sat behind the same runtime failure:
  - `WslRoutingFileSystem` kept its state in ES `#private` fields. Cordis
    invokes a service method with a shadow receiver (the traceable proxy
    `ReflectService` builds), and private members do not cross it, so the first
    routed call threw `Cannot read private member #distro from an object whose
    class did not declare it`. The fields are plain now, exactly like the host
    backend's own `config` and `locks`.
  - Constructing the distro backend with the router's context re-registered
    `fs` in the same scope (`service "fs" has been registered`). The backend
    now receives an `fs`-isolated child scope, while `sandboxPolicy` still
    resolves from the parent. The router captures its construction context,
    because `this.ctx` inside a method is the *caller's* context, not its own.
  - The row dropped the `static inject = ["sandboxPolicy"]` declaration the
    shipped `fs-sandbox` row carries, although the backend it constructs reads
    `ctx.sandboxPolicy.defaultMode`. That service is provided by a sibling row,
    not an ancestor, so the fiber could not resolve it and construction failed
    with `cannot get property "sandboxPolicy" without inject`. The declaration
    is restored.

  The `0.2.1-rc.2` line's new `working-directory` row resolves the session cwd
  through the root `ctx.fs`, which is what first exercised the distro branch.
  `test/composition.test.mjs` now boots the takeover row through the Loader
  and drives the whole routing table through the service proxy — distro side
  stubbed at the backend surface, host side over a temp workspace, with the
  policy supplied from a sibling fiber as in the app — so all three defects
  fail the unit suite instead of a session.

- **The GUI file service confines every read to the workspace, not just
  listings.** `stat`, `read` and `readBytes` passed the joined Linux path
  straight to `stat`/`sed`/`tail`, so an absolute path outside the workspace,
  a `..` traversal, a symlink leaving it, or another distro's UNC name were
  served — while `list` already resolved the real path and refused escapes
  with `workspace-file/outside-workspace`. All four ops now share one guard:
  `realpath -L` on the target and the root, then the same root/under-root
  test, so an escape is the same refusal whichever op asks. The new checks
  drive the real `sh` guard against a temp root (absolute sibling, `..`,
  symlink out, symlink in, the root itself) and assert the refusal mapping in
  all three ops.

- **The resident transport owns its generation and its pipes.** Three
  lifecycle leaks shared one cause — state keyed by "the current process"
  instead of by the process that actually emitted the event:
  - Every spawn now owns a generation; its `error`, `exit`, `stdout` and
    `stderr` handlers return unless `this.process` is still that child, so a
    stale exit can no longer settle a newer start, null a newer transport, or
    let a stale watchdog kill it. `handshakeTimer`, the ACK-armed watchdog and
    the frame-cap kill all bind to their own child.
  - `close()` settles the requests it interrupts, fails a start it interrupts,
    and destroys the host's ends of `stdin`/`stdout`/`stderr` after the exit.
    A descendant that inherited a pipe's write end can no longer keep the
    read side — and the fd — open until it exits.
  - The agent's lease and timeout watchdogs now spawn with `/dev/null` stdio,
    so their `sleep` children do not hold the protocol pipes after the agent
    exits. Without this, killing the watchdog subshell left the `sleep` as an
    orphan holding the write ends for up to the full lease window (12 minutes
    at the shipped 720 s), which is what kept a test process alive after every
    check had already passed.

  The fake transport covers the stale-exit and stdio-teardown checks; the real
  `sh` agent is spawned with a 720 s lease and asserted to close its pipes
  immediately after `SHUTDOWN`.

- **Cancellation reaches the command the agent is blocked on.** The stdin loop
  is serial: a `KILL` frame written while a command ran sat in the pipe until
  that command finished, and by then the id no longer matched, so the frame
  was dropped. A request aborted mid-flight kept running to its own timeout; a
  request aborted while queued ran in full later, with its answer discarded as
  noise. Protocol 5 adds the agent shell's PID to `HELLO`; on abort the host
  delivers `SIGUSR1` from a second `wsl.exe`, and the agent's trap kills the
  request's process group — TERM, then KILL after the same 3 s grace the
  timeout watcher uses. A request cancelled while it was still queued stays in
  the pending map and is signalled on its `ACK`, so it is killed the moment it
  becomes the running one; its late `RES` only cleans up. A PID-namespaced
  confined resident is never signalled by its HELLO pid (that PID does not
  exist in the distro and could name an unrelated process) — there the KILL
  frame remains the fallback, and filesystem ops are short by construction.
  The `KILL` frame stays as the fallback everywhere.

  The fake transport covers the started, queued and confined cases; the real
  `sh` agent is asked to run `sleep 30`, receives `USR1` after its ACK, and is
  asserted to answer with a non-zero exit well before the sleep ends.

- **The agent's ACK is emitted only once the request's child exists.** It used
  to be printed just before `run_capture`, i.e. before `CURRENT_PID` was set.
  The host arms its execution watchdog and delivers `USR1` on the ACK, so both
  could race the spawn: a cancellation right after the ACK found an empty
  `CURRENT_PID`, dropped the signal, and the command ran to its own timeout.
  `run_capture` now prints the ACK after `CURRENT_PID=$!`, which is what the
  host's comment always claimed it meant.

- **The GUI page contract no longer returns its EOF probe line.** `pageArgv`
  reads one line past the requested page so EOF is decidable from the yield;
  `distroRead` returned every line it got and derived `lines`/`eof` from the
  probe, so an N-line page carried N+1 lines, a page ending exactly at the file
  reported `eof: false`, and `bytes` added the line count on top of the UTF-8
  length (over-charging CRLF files and refusing pages that fit). The probe is
  split off before counting, `eof` means "no line past the page", and `bytes`
  is the page's own UTF-8 length. Tests cover truncation, exact EOF, and the
  byte cap.

- **The resident's pending queue is bounded.** One resident refuses a request
  past `maxPending` (64 by default) with a clear "requests in flight" error
  instead of growing its map — and the retained frame lines — without bound.
  A single frame's size is still the caller's.

- **The output budget now bounds the capture while the command runs.** The
  agent wrote stdout and stderr to two unbounded files and applied
  `maxOutputBytes` only while encoding the `RES`, so a chatty command could
  fill the distro's `/tmp` — and a huge answer could exceed the 256 MiB frame
  cap and kill the shared agent. With a budget, both streams are captured
  through FIFOs drained by a bounded `dd` reader; the rest is discarded, so
  the files stay within a block or two of the budget. The readers are given a
  one-second grace once the request's own process is gone and then stopped, so
  a background descendant holding the FIFO cannot delay the answer — and the
  grace lets a just-exited command's output reach the file before the reader
  is stopped. The block slack is what distinguishes "exactly at the cap" from
  "cut". The unbounded path (`FS` frames) still writes files directly. Tests
  cover `yes` capped at 1 KiB (`truncated: true`) and `sleep & echo` answered
  without waiting for the background child.

- **Confined file mutations share the session runtime.** With `wsl-fs`
  `sessionSandbox: true` (the shipped preset), a confined `writeText`/`editText`
  acquires the same `(distro, workspace, policy)` runtime as the shell
  executor: one agent, one mount profile, one real `/tmp`, and the same scope
  lifecycle. Reads stay on the plain shared agent; the app-level `fs-routing`
  backend keeps the mode off because it is not session-owned. A failed
  preflight refuses the write with the systemd/linger remedy.

- **A closed watcher signals its loop by PID.** The heartbeat alone cannot
  rely on the pipe closing when the host kills `wsl.exe`, so the loop now
  announces its shell PID (`P <pid>`) before READY and `close()` sends it
  `TERM` through a second `wsl.exe`; the TERM trap removes the stamp. The
  real-machine watch probe now asserts the loop is gone, matching the script's
  own argv rather than the `pgrep` wrapper. This is the fix the probe found
  when the heartbeat-only version was tried on the real transport.

- **A failed port scan keeps the last successful snapshot.** The ports
  environment fact was set to an empty list on any scan failure, which the
  model reads as "nothing is listening". A failed scan (agent out, non-zero
  exit) now leaves the previous list in place and logs a debug line; only a
  successful empty scan produces an empty list.

- **The stale-scope sweep recognizes the native agent.** It looked only for
  `wsl-agent.sh` in the scope's cgroup, so a live native session scope (whose
  agent is `dsh-wsl-agent`) could be stopped at the next session preflight.
  The liveness check now accepts either marker; a scope with only leftover
  background processes is still reaped.

- **The native EXEC timeout is seconds.** The spike read the v5 EXEC frame's
  timeout field as milliseconds, so a 120 s budget killed every command after
  120 ms; longer commands exited 143 on the native session. It now converts
  seconds (`Duration::from_secs`), and the spike's check runs a 300 ms command
  under a 2 s budget so the unit cannot regress silently.

- **The inotify watcher is reaped promptly on close and on a vanished
  directory.** The blocking FIFO read is woken by a one-second marker, so the
  TERM trap runs and the target check reports `E` within a second of the
  directory disappearing. The real-machine probe's close and vanished-target
  checks now pass with `inotify-tools` installed; the pre-watch creation check
  was also corrected (a file created before the watch is not the polling
  mtime blind spot).

- **A closed watcher no longer leaks its distro-side loop.** `close()` kills
  `wsl.exe` but cannot signal the loop inside the distro, and a loop that only
  writes on changes would sleep and poll forever. Each tick now writes an
  ignored `H` heartbeat; a `PIPE` trap turns the closed pipe's SIGPIPE into a
  clean exit through the stamp-removing EXIT trap. The host ignores `H`; the
  real-`sh` check closes the pipe and asserts the loop exits and the stamp is
  gone.

- **A distro target contains only targets in the same distro.** `contains()`
  compared Linux path strings, so another distro's share (or a `..`-bearing
  key) could test as contained when the spelling lined up. It now compares the
  distro coordinate and lexically normalizes the paths; the resolver remains
  the canonicalizer for symlinks.

- **A `notdir` failure reports `FS_NOT_DIRECTORY`.** The wire reason was
  mapped to `FS_NOT_FOUND`, so a path whose parent is a regular file looked
  like a missing path. It now carries the specific code the tool layer already
  knows, so the model gets the right remedy.

- **Stale session scopes are swept.** A hard kill of the app can leave a
  `dsh-wsl-*.scope` and its background processes behind. The session preflight
  now lists those units and stops one only when its cgroup has no
  `wsl-agent.sh`; a live agent means another session still owns it. The sweep
  runs once per distro per process (a failed spawn re-arms it) and is a no-op
  without a user manager. Validated on a live user manager: two
  `dsh-wsl-test-sweep*` scopes with only a `sleep` were stopped while the
  session's own scope (with its live agent) stayed active.

- **`watch()` accepts a file target.** The poll loop treated every
  non-directory as vanished, so `ctx.fs.watch` on a regular file failed
  immediately with "no longer exists". A file is now watched by its
  `mtime:size` fingerprint — a rename-over or an in-place write fires — and a
  removal reports the target as gone. Directory watching is unchanged. A
  real-`sh` check runs the loop against a temp file (READY, a size change, a
  removal).

### Notes

- **The native-session probe.** `test/probe/native-session.mjs` (also in the
  real-machine suite and the self-hosted probes job) exercises the packaged
  native binary end to end: the cache/digest, the session scope, EXEC, FS
  write/read, a KILL that reaps the request group while the agent survives, a
  wrong HELLO digest failing the handshake, and the scope/cache teardown. It
  is 8/8 on the live machine. The probe found two integration bugs, both
  fixed here: a valid cache is now reused instead of rewritten (rewriting a
  binary a live session is running fails with ETXTBSY), and the agent's stdin
  now has an error listener so `close()` after a failed handshake (EPIPE) does
  not crash the host.

- **Static musl packages for x86_64 and aarch64.** The package now ships
  `agent/native/linux-x86_64/dsh-wsl-agent` (static-pie musl, 635,752 bytes,
  sha256 `5920bdd5…`) and `agent/native/linux-aarch64/dsh-wsl-agent` (static
  musl, 535,136 bytes, sha256 `cf7dd150…`), both stripped. One static binary
  runs on glibc and musl distros, so Alpine no longer depends on the shell
  fallback. A CI job builds both (x86_64 via musl-gcc, aarch64 via
  cargo-zigbuild), tests the x86_64 build and uploads the `native-package`
  artifact; the committed binaries are the reviewed result.

- **The native HELLO binds the process to the binary.** The native agent
  hashes `/proc/self/exe` and puts the sha256 in its HELLO digest; the host
  passes the digest it copied into the cache as `expectedDigest`, so a binary
  swapped after the copy check fails the handshake before accepting a request.
  The spike is 18/18 (the new check compares the handshake to the file's
  sha256). The shell agent's script digest is unchanged.

- **The packaged native binary.** `agent/native/linux-x86_64/dsh-wsl-agent`
  ships in the npm `files`; `agentBackend: auto` resolves it for a distro whose
  `uname -m` is x86_64/amd64 (aarch64 is mapped but has no binary yet), with
  `DSH_WSL_AGENT_NATIVE` still the development override. After the sha256 copy
  the host executes the binary once with `</dev/null` and only then selects it,
  so a glibc/musl mismatch falls back to the shell agent. The CI builds the
  spike from source and runs its suite against both that build and the
  committed package binary. The musl and aarch64 builds are the next step.

- Added **`wsl-shell.agentBackend`**: `auto` (the default) uses the native
  in-distro agent when a verified source is available — the development
  override `DSH_WSL_AGENT_NATIVE`, and later the packaged per-arch binary —
  else the shipped shell agent; `native` fails the first command instead of
  falling back; `shell` forces the shell agent. Commands and confined writes
  share the session runtime, so both follow the selection. With no source and
  the default, behavior is unchanged (shell).

- Added the opt-in **native agent host wiring**: `DSH_WSL_AGENT_NATIVE=<host
  path>` makes the session runtime sha256 the binary into
  `~/.cache/dsh-wsl/agent/<sha>/dsh-wsl-agent` (never from `/mnt/c`), verify
  the distro-side digest, and spawn it under the session scope/bwrap with USR1
  off (the native reads KILL frames). The shared FS-read agent, the one-shot
  fallback and the default remain the shell agent; only x86_64 is accepted.
  `scripts/native-wiring-check.mjs` verifies the copy + real runtime + EXEC/FS
  end to end. Packaging/musl/default rollout is still pending.

- Added the **native agent spike** (ADR 0002 stage 2) under
  `agent/native/spike`: a std-only Rust event loop for HELLO/PING/SHUTDOWN/
  SETENV/EXEC/KILL with per-request process groups, plus the FS
  `stat`/`lstat`/`read`/`write`/`list`/`realpath` surface (mode, no-replace,
  expected version, staging + fsync + atomic publication; the `dsh-fs` side
  channel in the RES stderr). Its manual check passes 16/16 (concurrent EXECs,
  KILL without a second `wsl.exe`, timeout group kill, output cut with the pipe
  still drained, FS stat/lstat/read/list/realpath matching the shell,
  write/refusal, side channel, dot-dot refusal, expected-version stale replace,
  setuid mode, EXEC differential). The host wiring remains; the shell agent
  stays the shipped peer.

- Added **ADR 0002 — native in-distro agent (design)**: goals and non-goals,
  language/distribution options (Rust static binaries, copied to the user's
  cache), the v5-compatible spike and v6 concurrency protocol, the event-loop
  process model, the host integration/copy/verify path, the security and test
  matrix, the migration stages, and the triggers that would justify building
  it. Implementation is deferred; the shell agent remains the shipped peer.

- Documented the one-shot fallback's timeout boundary: the host deadline kills
  `wsl.exe`, not the distro-side tree; the session runtime's scope is the
  cleanup path, and a systemd-scoped one-shot is not shipped.


- Gates on the new pins: style 9/9, syntax 7/7 members and 3/3 chain members
  against `schemastery@3.18.5`, build freshness 74 artifacts, `tsc --noEmit`
  clean, unit suite 30/30 files, coverage 98.42% lines / 84.20% branches /
  96.01% functions. The real-machine probes were not re-run: they need
  Windows and WSL, and their peer-verify legs are covered by the byte
  comparison above.

## [0.9.0] - 2026-10-06

A usability round over the sandbox failure path: the failure stops being a
wall the first command walks into, and becomes a message that arrives early
and says how to fix it.

The bwrap refusal now classifies its cause — missing versus
present-but-failing — and prints the direct install command in the distro's
own package family (apt/dnf/pacman/zypper) instead of a hardcoded `apt-get`
line; every consumer composes it from one place. A new `wsl-preflight`
service runs the same shared probe when a distro session opens and surfaces
an unusable bwrap as a warning with the full remedy, moving the discovery
moment ahead of the first failed command — advisory only, never installing.
`pnpm run diagnose` collects a read-only, paste-ready diagnostic report for
issues, and the three bare wsl-probe failures (no distro, no `$HOME`, no
shell) now carry their next steps. The agent probe's parity legs classify
the nested-interop service timeout (`Wsl/Service/WSAETIMEDOUT`, observed on
WSL 3.0.1.0) as SKIP with the evidence attached, so an environment failure
that prevents the comparison reads as what it is instead of a parity
violation.

## [0.8.0] - 2026-10-06

The toolchain's TypeScript story completes (pnpm, a checkJs gate, and 36 of 36
modules with their declarations shipped), and with it three behaviour fixes
land: the byte-window cap is enforced, the agent path's EXEC capture budget is
honoured, and the filesystem's host-path mapping speaks its synchronous
contract.

One theme: the toolchain moves from npm to pnpm. `pnpm-lock.yaml` replaces
`package-lock.json`, CI installs through corepack with
`pnpm install --frozen-lockfile` (the `packageManager` field pins pnpm 11.7.0,
matching the harness repository), and the three dependencies with install
scripts (`@deepseek-ai/dsh-subprocess-local`, `koffi`, `node-pty`) are
allow-listed in `pnpm-workspace.yaml` — pnpm 11 blocks dependency build
scripts by default. With it: `engines` and the CI matrix align with the harness
host's own floor (`^22.19.0 || >=24.0.0`), so the Node 20 legs are gone, and
the per-target lock test drops its unused `withResolvers` gate, a Node 22+ API
that hung those legs on every push.

The unit suite also takes on the integration layer. `test/provider.test.mjs`
boots the REAL `WslShellExecutor` and `WslFileSystem` with substitutes only at
the seams that would reach `wsl.exe` — the agent, the substrate, the
confinement — so the guard chain, the mutation routing, the agent execution
path with its result decoration, the one-shot fallback and the runner-failure
remap are measured: `lib/index.js` goes from 60% lines / 9% functions covered
to 97%/90% when it joins, and measures 97.49% lines / 95.16% functions in the
released tree. The coverage gate's branch threshold moves with it, 85 to 84 —
the newly measured layer's uncovered tail is the distro-resolution branches
(`defaultDistro`'s no-distro throw, `linuxHomePath`'s refusals, the watcher's
real spawn internals) that need a live `wsl.exe`, and RELEASING.md records
the bar for raising it again: cover that tail on the Windows CI legs, or move
the coverage job to `windows-latest`. And the probes join CI: a
`workflow_dispatch` job — named for the self-hosted Windows runner, though it
carries the hosted `windows-latest` label — runs five of them: `sandbox`
unconditionally, since it needs only bubblewrap in the default distro, then
`mode`, `terminal`, `picker` and `missing-wsl` where the harness app is
present. The `sandbox` leg fails, not skips, where bubblewrap is absent, so a
dispatch to a hosted runner is no green no-op. Separately,
`test/probe/run-all-when-closed.sh`'s suite gains the four probes it was
missing — `agent`, `watch`, `substrate`, `exec`.

One more theme: the whole repository comes under a TypeScript check gate.
`tsc --noEmit` under `strict`/`checkJs` now runs as part of `pnpm test` over
`lib/**`, `test/**` and the probe scripts — a scope that narrows to what is
NOT generated once the migration completes, `lib/**` leaving the gate for the
build program below — with the types taken from the peer packages' own
declarations and the service augmentations loaded through
`types/dsh-services.d.ts`. The gate's first pass surfaced the seam work this
package already carries: the private `spawnSpec` the WSL spawn directory needs
(`docs/UPSTREAM-SPAWN-SEAM.md` bridges it) and a synchronous-contract violation
in `processPathFromHostPath`, pending a design decision.

Extending the gate to the tests found real defects the untyped corners had
been hiding: `distroReadBytes` accepted the byte-window cap (both call sites
pass it) but neither documented nor enforced it, so a ranged `readBytes`
asking past the page cap was served instead of refused — upstream refuses a
window the same way it refuses a page. Fixed against the upstream wording and
arithmetic (`lib/workspace-files-wsl.js`), with an absent length now
defaulting to the window cap rather than the whole-file cap, as upstream's
`resolveWindow` defaults it; the refusal is pinned in
`test/workspace-files-wsl.test.mjs`. Two hand-written JSDoc contracts wider
than their code (`gitSpawnRewrite`'s `argv`/`cwd`, `wslErrorCode`'s
`stdout`/`stderr` — both tolerate absence at runtime) and one narrower than
its caller (`uncToPosix`'s path) were corrected to what the functions actually
take. Test doubles are typed as the slice of the seam they script, reaching
the seam's declared type through one documented cast at the injection point —
no `any` and no new `@ts-expect-error` anywhere in the suite.

And the migration's third step opens: `src/agent-protocol.ts` is the first
module whose source is TypeScript. `pnpm run build` (`tsconfig.build.json`)
emits `lib/agent-protocol.js` plus `lib/agent-protocol.d.ts` under the same
export paths, and the artifacts stay committed so a bare checkout remains
loadable and the tarball needs no build step; the new `lint:build` gate
(`test/build-freshness.mjs`) makes `pnpm test` fail the moment a committed
artifact drifts from its source. Generated files are excluded from the
`checkJs` gate — their TypeScript sources are type-checked with
`noEmitOnError` instead, which is strictly stronger. The protocol message
union now has one home: `lib/agent.js` and the script-driven tests import
`AgentMessage` and friends from the protocol module's declarations instead of
restating them.

And the declarations land for every module. A second, declaration-only pass
(`tsconfig.dts.json`, driven by `scripts/build.mjs`) emits `.d.ts` for the
hand-written, JSDoc-typed JavaScript, and every export subpath now carries its
`types` condition — downstream finally sees this plugin's types, verified end
to end (a consumer's wrong call is rejected with the precise signature). The
declaration pass must run against a clean tree: a stale `.d.ts` is resolved as
an input exactly where `./x.js` would be, and re-emitting through it silently
degrades the result — a precise type in `index.d.ts` collapsed to `any` that
way during the migration — so the build deletes the declarations its first
pass does not own before re-emitting, and `lint:build` snapshots the
artifacts, runs the real build, byte-compares and restores the tree.
`lint:style` gained the invariant that keeps the surface from rotting: a
JavaScript export without its `types` sibling fails the gate.

`lib/paths.js` follows as the second migrated module — the path algebra every
other module imports, plus `DistroPath`/`WorldPathOptions`, which consumers
reference through `import("./paths.js").DistroPath`; the TypeScript source
keeps those names, so nothing downstream changes except that they now come
from a checked source. CONTRIBUTING records the per-module checklist this
settled into: write `src/<name>.ts`, add the generated JavaScript to the two
`exclude` lists, build, and let the suite verify the artifact is
behaviourally identical — the `exclude` step lasts only while the tree is
mixed; the finished checklist ends at write, build and test, with no list to
maintain.

Three leaf modules then follow in one pass — `agent-errors` (the two error
classes the executor switches on), `probe-cache` (the verdict policy that
remembers successes and re-probes failures) and `listing` (the picker's pure
helpers, `boundedInsert`'s generic included). Each was verified export-for-
export against its predecessor, and the whitespace-normalized code diff is
tsc's statement reflow and nothing else; every source keeps its module doc
plus a note naming the generated artifact.

The next four carry the decision layer: `fsio-text` (the byte-for-byte
replication of the peer's text mechanics — `FsCodedError` gained a declared
`code` field, and the stream decoder is typed through `node:util`, since
Node's global `TextDecoder` is a value, not a type), `fs-decisions` (the
refusal descriptors, with `Refusal` as an exported interface and `isCoded` as
a real type predicate), and `git-route`/`search-route` (the two spawn
rewrites; their generated artifacts are byte-identical modulo whitespace).
Nine of the thirty-six modules now have TypeScript sources.

Six more follow — `terminal-route`, `preset-choice`, `ports`, `bwrap`,
`agent-confined` and `agent-shared` — and they cross a structural line: a
source may now import a module that is not migrated yet. `rootDirs` merges
`src/` and `lib/` for resolution, so `./agent.js` resolves through the
generated `lib/agent.d.ts` while the emitted specifier stays `./agent.js`;
because that merge also pulls declarations in as program inputs, pass 1 now
emits into a scratch directory the build script copies from, keeping inputs
and outputs disjoint (TS5055 otherwise). `agent-shared`'s generated artifact
is byte-identical even after whitespace normalization; the rest differ only
by tsc's statement reflow. Fifteen of the thirty-six modules are TypeScript.

The mid-size tier follows: `wsl` (the `wsl.exe` interop primitives — its four
option shapes are exported interfaces now), `agent-exec` (the agent-backed
execution handle, whose request/result/runner/handle typedefs the tests and
`search-exec` already imported by name) and `shell-env` (the `DSH_*` fact
contributor, typing the harness registry it contributes through structurally,
as its JSDoc always did). `agent-exec` surfaced one Node typing fact worth
knowing: `Buffer.alloc(0)` infers `Buffer<ArrayBuffer>` while an incoming
`Buffer` is `Buffer<ArrayBufferLike>`, so the accumulators are annotated
`Buffer`. Eighteen of the thirty-six modules are TypeScript now.

Seven small modules follow — `watcher` (the in-distro mtime watch loop and its
protocol, `ChildProcess` and options typed), `sandbox-core`/`sandbox` (the
bwrap probe-and-confine pair; `WslConfined`/`WslSandboxCoreInstance` are
exported interfaces and the two class fields are `declare` so the emitted
JavaScript stays byte-identical), `terminal-activity`, `search-exec`, and the
two entry re-exports `shell`/`fs` (whose artifacts are byte-identical). At
twenty-five of thirty-six, the remaining modules are the large ones: `agent`,
`fs-substrate`, `fsio-agent`, `picker`, `subprocess`, `auto-preset`,
`workspace-files-*`, `file-reference-wsl`, `fs-routing`, and finally `index`.

The route layer follows — `workspace-files-route` (the pure build/parse pairs
for the distro-routed file service), `file-reference-wsl` (the `@`-completion
traversal strategy, with `TraversalDirent`/`FileReferenceTraversal` as
exported interfaces) and `fs-routing` (the root-plane coordinate router).
`fs-routing` is where the compiler re-met the documented upstream seam:
`WslFileSystem.processPathFromHostPath` is async against the `FileSystem`
interface's synchronous contract, so the router's lazy backend is typed as the
concrete class rather than casting the mismatch away — the seam keeps its one
visible `@ts-expect-error` in `index.js`. The port also dropped two dead
imports `fs-routing` had carried since a refactor (`windowsToLinuxMount`,
`linuxJoin`), which the emitted artifact no longer contains. The orphaned
`linuxJoin` doc block above the class — a leftover of that same refactor — is
gone too. Twenty-eight of the thirty-six modules are TypeScript.

`fs-substrate` and `auto-preset` follow — the agent-backed filesystem face
(`ResolvedTarget` exported as an interface, its six instance fields declared
with `declare` so the emitted JavaScript stays byte-identical) and the
preset-adoption plugin (whose harness service slices stay spelled
structurally, and whose `ensureSession` patch carries the `this: unknown`
parameter the JSDoc already documented). Thirty of the thirty-six modules
are TypeScript; the remaining six are `agent`, `fsio-agent`, `picker`,
`subprocess`, `workspace-files-wsl` and `index`.

`picker` follows — the biggest single module migrated so far after the
protocol file itself (494 lines). Its config, the cached distro listing and
the per-distro home map are `declare`d so the emitted JavaScript stays
byte-identical, and the browse capability object stays an inline class field,
which is how the original script wrote it. Thirty-one of the thirty-six
modules are TypeScript.

`subprocess` follows — the composition-level provider behind the GUI's
terminal window, and the last module that overrides a shipped peer class for
the terminal/search routing. Its `spawnTerminal`/`spawn` overrides are checked
against the peer's declared signatures (they pass without a new assertion),
and the two JSDoc casts the script carried (`env`, the stdout collect budget)
are absorbed into the types. Thirty-two of the thirty-six modules are
TypeScript; the last four are `agent`, `fsio-agent`, `workspace-files-wsl`
and `index`.

`agent` follows — the resident in-distro agent's whole lifecycle (756 lines).
Its seven internal methods stay `private`, which surfaced the migration's one
structural seam: a class with private members is nominal, so the declaration
generated for the still-un-migrated `fsio-agent` and the one this source emits
are not interchangeable even though the runtime object is the same class. The
one boundary (`fs-substrate` handing agents to `DistroFs`) crosses it through a
single documented assertion naming the lib-side type; it disappears when
`fsio-agent` migrates. Thirty-three of the thirty-six modules are TypeScript.

`fsio-agent` follows, and with it that seam closes: the lib-side declaration
it used to drag in is gone, so the boundary assertion in `fs-substrate` is
deleted in the same commit — the class is declared once now, and the private
members it keeps are nominal against nothing else. Thirty-four of the
thirty-six modules are TypeScript; `workspace-files-wsl` and `index` remain.

`workspace-files-wsl` follows — the distro-routed GUI file service, with
`WorkspaceFilesWslConfig`/`DistroListing` exported, the row-config read kept
as its one documented double cast (the base class keeps `config` private), and
the `readByteRange` expect-error left exactly where it was: that one is an
open design decision, not a migration artifact. Thirty-five of the thirty-six
modules are TypeScript; `index` is the last one.

`index` closes the migration — the integration layer's two providers, 1400
lines, with both documented upstream seams intact: the private `spawnSpec` a
`wsl.exe` spawn needs, and the `processPathFromHostPath` contract violation,
keep their `@ts-expect-error` carrying the reason. The generated artifact is
proven structurally identical to the hand-written module: an AST comparison
that treats the erased type wrappers (`as`, `@type` casts, parentheses) as
transparent reports only the imports the source no longer needs — a never-used
`fileURLToPath`, the dead `isUnderDistro`, and the type-only `WslAgent` (which
tsc elides; the module still loads through its other edges) — plus tsc's
reflow and one internal rename in `decorateResult`, whose result row now
derives from the handle type instead of a second type parameter. `resolve()`
returns the precise `WslExecSpec` where the JSDoc declared the wider
`ShellExecSpec`. Thirty-six of thirty-six modules are TypeScript.

The transitional scaffolding then retires, nothing left for it to do:
`rootDirs` and the scratch declaration emission existed for a mixed tree
(`src/` sources importing un-migrated `lib/*.js` neighbours), and the
declaration-only second pass (`tsconfig.dts.json`) existed to give the
hand-written JavaScript its `.d.ts`. `pnpm run build` is one `tsc` pass
emitting JavaScript and declarations straight into `lib/`, pruning
declarations no source owns; the `checkJs` gate drops its 35-entry exclude
list and states what is NOT generated — `test/**` and the ambient service
types, with `src/` checked by the build program (`noEmitOnError`); and
`lint:build` enforces the closed corpus (every `lib/*.js` has its
`src/<name>.ts`, every source has both artifacts), so "`lib/` is entirely
generated" is a checked property rather than a convention.

The real-machine probes then re-ran green on the migrated tree — 12 of 12, the
one verification face CI cannot cover (its self-hosted leg is skipped):
filesystem mutation through the throwaway wslfs profile, terminal, mode,
missing-wsl, bwrap, the shell confinement wiring, sandbox-off, picker, agent
protocol, watch, substrate and exec. The run surfaced two defects in the probe
harness itself. `ELECTRON_RUN_AS_NODE` — the flag that boots the harness CLI in
node mode — never crossed the WSL interop boundary: interop hands a Windows
process only the variables `WSLENV` lists, so the inline assignment was dropped
and the app booted as its GUI self, leaving the probe waiting on a process that
would never run; `test/probe/env.sh` lists the flag now, composed with any
`WSLENV` the caller had. And the kill-cleanup check counted every `sleep` in
the distro, which the resident agent's lease watchdog — introduced after the
probes last ran — makes non-zero by construction, alongside in-flight timeout
watchers; the check counts its own command line now, so a kill that really
leaked still fails it. And the suite's live log sits inside the checkout,
where the mirror sync's `tar` read it while it grew — `file changed as we read
it`, exit 1, `set -e` failing the probe before it ran; the sync excludes
`test/probe/.scratch` now, which is run scratch nothing at runtime reads.

One real defect fell out of the type gate's migration notes and closes here:
the agent execution path handed the EXEC frame the volatile wrapper object
where a byte budget belongs. `encodeExecFrame`'s `> 0` test was false on an
object, the frame carried 0, and 0 is the agent's "uncapped" — so the cut at
the caller's per-stream budget that `agent-exec` documents never ran, and a
chatty command cost unbounded distro memory. `src/index.ts` now reads
`config.maxOutputBytes.get()` like every other volatile field, and
`test/provider.test.mjs` pins the resolved number in the frame (the check
fails against the previous artifact). The one-shot path was always correct —
it reads the same field through the upstream executor's own `.get()`.

The second pending seam closes the same way — with an implementation instead
of a note. `WslFileSystem.processPathFromHostPath` was `async` against the
peer interface's synchronous contract, so the consumers that read it without
awaiting (spill-policy's attachment mapping, the session controller's and the
UI's path verification) received a Promise — always truthy, never the
`undefined` they test for — and mapped nothing. It is synchronous now, built
from what is already known: the distro once `distro()` has resolved it (the
pinned config, or the default `wsl.exe` answered by an earlier operation) and
the configured `cwd`, or the resolved home for a relative path. A call that
would have to ask `wsl.exe` — a cold default distro, a relative path before
the home is known — answers `undefined`, the same "no mapping" the ssh
provider gives, so the consumers take their documented refusal path instead of
receiving a bogus value. The value keeps the world spelling the backend keys
on, so their map → resolve → processPath round trip closes exactly as it does
for the host backend. `test/provider.test.mjs` pins the sync value, the round
trip, and both `undefined` cases (the checks fail against the previous
artifact). The `@ts-expect-error` count drops to three: the two remaining
design decisions and the upstream spawn seam.

The last in-code seam note closes by deletion rather than repair. The GUI file
service's `readByteRange` — a method older than the migration, which the type
gate flagged with an expect-error because its host-workspace branch called a
base method that does not exist — turned out to be unreachable: the remote
layer registers exactly the methods a decorated class declares (typert writes
its markers per instance, from the class that carries the decorators), the
base service has no such method, and nothing in the plugin or in the harness
calls it. Ranged reads already go through the wire op they always did —
`readBytes` with `options.range`, which the distro branch serves and the host
branch delegates. The method and its one test line are gone (the range case
stays covered through `readBytes`), and one more expect-error goes with it:
two remain, the exit-4 kind and the upstream spawn seam.

## [0.7.5] - 2026-10-05

One theme: a failed environment probe retries instead of being trusted
forever - the shell placeholder that used to pin bash onto every later
command, and the hardcoded distro name that minted UNC identities.

### Fixed

- **A failed shell probe no longer pins `bash` for the executor's
  lifetime.** `defaultShell` reported the literal `"bash"` when both probes
  failed - a cold distro, a flaky first `wsl.exe` call - and the executor
  cached that placeholder permanently: every later command ran bash on a
  zsh distro, and the shell tool introduced itself as bash. The probes now
  answer `undefined`; the executor caches only a real resolution and falls
  back to bash per call, so the next command retries. `shell-env` follows:
  an unresolved shell simply omits the `DSH_WSL_SHELL` fact instead of
  presenting a guess as the distro's login shell. Alongside, `toWorldPath`
  no longer mints UNC identities under the hardcoded `"Ubuntu"` fallback -
  the pinned distro is a required option now, and every caller passes it.

## [0.7.4] - 2026-10-05

One theme: the 0.2.0 review's engineering debt closes out - the five
open groups land with tests, the bootstrap remedy ships with the
package, and the real-distro probes re-run green on the protocol v4
stack.

### Fixed

- **The bootstrap remedy is shipped with the package.** The refused-write
  and sandbox messages point at `scripts/bootstrap.sh <distro> --install`,
  which the `files` list never packaged - on an npm install the advice was
  a dead end. The script rides in the tarball now (the other two files in
  `scripts/` are CI-only and stay unpackaged). The real-distro probes were
  re-run against the protocol v4 stack: agent 11/11, substrate 8/8, exec
  5/5, watch 6/6.

- **The review's remaining engineering items close out.** A `SETENV` key
  that is not a POSIX identifier is refused with a protocol error instead
  of exporting silently into every later request; an EXEC frame whose argv
  payload fails to decode refuses the request instead of running the
  command with a silent empty word where the host sent text, and a frame
  that ends before its declared argument count exits instead of running
  the op on a partial list; a non-numeric exit code reads as the sentinel
  `-1` (a value no `wait` can produce) instead of `NaN`; an unknown FS op
  maps to `FS_IO_ERROR` - naming the contract breach - instead of posing
  as `FS_NOT_FOUND`; `editText` on a file that never existed reads as
  `FS_NOT_FOUND` (the read path's dialect) while an edit that *lost* its
  file after a read stays `FS_STALE_VERSION`; a symlinked directory as a
  list target answers with the target's children (`find` used to skip its
  starting point and answer empty, exit 0); and the Linux-filename
  backslash identity limit is documented in LIMITATIONS instead of
  waiting as an undocumented wrong answer.

## [0.7.3] - 2026-10-05

One theme: the resident agent stops taking its world on faith - the
handshake now verifies the deployment's content, the agent's lifetime
survives a wedged host only by lease, and the one 9P consumer no row
replacement could reach ships its seam-ready traversal.

### Added

- **The resident agent verifies its own deployment, and outlives a wedged
  host only by lease.** The agent script is read in place from the
  distro-visible path - in the deployed layout a `/mnt/c` mirror - so a
  stale or half-synced runtime copy used to pass the version handshake
  while drifting in behavior. The HELLO line now carries the sha256 of the
  file the distro actually read (protocol v4), and both resident factories
  pin the hash of the copy the package shipped: a mismatch is refused like
  a version mismatch, with the resync command in the message. The agent
  also terminates itself when its host goes silent without ever delivering
  EOF - the wedged-relay case stdin EOF cannot cover: the host forwards a
  client lease (`idleMs` + grace) through the managed `DSH_` namespace, and
  an in-distro watchdog polls an in-flight marker so a long command's
  silence never counts against it (dash has no `read -t`; a marker file is
  the portable form). A boot sweep removes sibling `wsl-agent.*` temp dirs
  no request has touched for an hour - the residue of agents whose host
  died before their exit trap could run.
- **The `@` completion's distro traversal is built and waiting for its seam.**
  The one 9P consumer the takeover series could not reach - the GUI's `@`
  file completion - funnels all workspace traversal through three
  module-internal functions of the upstream `file-reference-local` service,
  so no row replacement can reach them. The plugin now ships the consumer
  side of RFC addendum ① (`lib/file-reference-wsl.js`): a traversal strategy
  that lists a distro workspace through the resident agent with
  `find -printf '%y\t%f'` - keeping readdir's Dirent fidelity, where
  symlinks report neither kind and are skipped instead of resolved through
  like `ls -L` would - replaces the upstream per-segment lstat walk with one
  agent exec, and returns absolutes in the root's own coordinate system,
  which the upstream scan joins children with. Deliberately not wired into
  the composition: with the seam absent, reaching the funnels would mean
  re-implementing the fuzzy ranking engine, the behavior-regression path
  the RFC rules out. The module ships tested; the takeover lands the day
  upstream takes the ~10-line parameter. The RFC addendum now carries the
  concrete interface proposal.

### Fixed

- **The Windows CI legs are green again.** The fs boot test's end-to-end
  legs read `platform is win32` as `the real-distro topology exists`, but
  the CI Windows runners ship wsl.exe with no distro installed - every
  Windows leg since the boot test landed failed there, which kept the
  release gates red through 0.7.0-0.7.2 even after the missing-module
  fix. The guard now asks WSL for its distro list and skips unless the
  test's distro is actually installed.

## [0.7.2] - 2026-10-05

One theme: the root-plane routing lands - and the composition that
silently dropped it and the workspace-files takeover is repaired and
pinned by a test that runs the plugin's real patch file through the
loader's real patch algorithm.

### Added

- **The root-plane filesystem routes by coordinate.** The root `ctx.fs`
  (behind the GUI's change feed and every un-mounted root consumer) is
  replaced by a coordinate-routing variant (`lib/fs-routing.js`): distro UNC
  identities are served by the resident agent - ext4 reads, and real watch
  events for the change feed, which previously never fired on a 9p share -
  while drive paths stay host-native. The root write fence retires with this
  round: the root plane has no write consumers (the model's writes ride the
  preset filesystems, which enforce their own containment). Design note:
  `docs/root-fs-routing.md`.

### Fixed

- **The 0.7.1 composition never mounted what it announced.** The
  `workspace-files` disable, the `fs-sandbox` disable, and both replacement
  rows were written inside a bare `insert:` list — but a patch layer is a
  flat list: an `insert` list is data to append, never nested patches. The
  loader therefore mounted the two disable rows as duplicate-id anonymous
  entries that *shadowed the real upstream rows* (`EntryGroup.update` keys
  rows by id, last occurrence wins): the running app had no root `ctx.fs`
  and no GUI file-tree service at all, while `fs-routing` and
  `workspace-files-wsl` - trapped inside nested `insert:` lists - never
  started. Opening a distro workspace failed accordingly. Both takeovers are
  now top-level entries: disable by id, then append the replacement with a
  bare insert. `test/composition.test.mjs` runs the plugin's actual patch
  file through the loader's actual `applyEntryPatches` over stand-in
  upstream rows, asserting every composed row is a real named entry, ids
  stay unique, the shipped rows are disabled under their own names, and
  both replacements mount - the shape cannot regress silently again.
- The terminal-activity live check marked its shell with a runtime
  `export`, which `/proc/<pid>/environ` never shows (it reflects the
  exec-time block only), so the probe could never count past one and the
  busy assertion failed deterministically. The marker now rides the spawn
  environment - what `wsl.exe` does when it imports `DSH_TERMINAL_ID`
  before `--exec`.

## [0.7.1] - 2026-10-04

One theme: the remaining root-plane 9P consumers move inside the distro -
the GUI file tree and previews, and the workspace-changes git snapshots -
plus the test-infrastructure maturity (a REAL-composition boot test and
the pure text-mechanics refusals under direct unit test) that the
promotion work was built on.

### Added

- **git snapshot commands run the distro's git.** `workspace-changes`
  snapshots a workspace by spawning the host git through
  `ctx.subprocess.spawn` — on a distro workspace that was Windows git
  scanning the full work tree across the 9p share, the most
  metadata-heavy operation there is. Spawns whose working directory names
  a distro and whose argv carries none of the absolute-output discovery
  flags are rewritten into `wsl.exe -d <distro> --cd <linux dir> --exec
  git …` (`lib/git-route.js`). The snapshot is safe to route because it
  already runs in a fully isolated git environment (`GIT_INDEX_FILE` /
  `GIT_OBJECT_DIRECTORY` / `GIT_ALTERNATE_OBJECT_DIRECTORIES` in the
  tool's private scratch — the repository's index, object store, work
  tree, and refs stay unchanged); the route translates those path-shaped
  env values into distro coordinates and forwards them through `WSLENV`.
  Verified against a live distro: the snapshot sequence completes with the
  user's index, object store, and refs untouched.
- **The GUI file tree and previews are served from inside the distro.**
  `workspace-files` - the root-plane consumer behind the GUI's file tree
  and previews - read UNC workspaces through the 9p share. The plugin
  replaces the composition row with a distro-routed variant
  (`lib/workspace-files-wsl.js`): listings, stats, line-paged reads and
  byte windows for a \\wsl.localhost\\<distro> workspace run through the
  resident agent, with the upstream refusals mirrored (not-found,
  outside-workspace, not-directory, not-regular-file, too-large,
  not-text) and `absolutePath` synthesized in the UNC display form so
  the GUI is unchanged. Windows-folder sessions keep the shipped
  host-backed service; the watch stream delegates unchanged.
  (`lib/workspace-files-route.js` holds the pure builders/parsers;
  `test/workspace-files-wsl.test.mjs` covers every wire shape and refusal
  over a fake agent runner.)
- **bootstrap installs and reports git.** The git snapshot routing needs
  git inside the distro; `bootstrap --install` includes it in every
  package manager's list and the report names it alongside ripgrep (the
  snapshot backend for workspace-changes).
- **A REAL-composition boot test.** The plugin's fs row is booted through
  the cordis Loader from a test-only yml composition and asserted against
  a live distro read (`test/fs.boot.test.mjs`), alongside direct unit
  tests for the pure text mechanics' refusal edges
  (`test/fsio-text.test.mjs`).

## [0.7.0] - 2026-10-04

One theme: the 9p share is out of the model's reach. Two changes land together
because they close the same measured gap — the file-search spawn was the one
model-facing I/O path that still crossed the share, in its slow direction
(~2 s per search where the distro's own rg answers in single-digit
milliseconds; `\\wsl.localhost` metadata round trips at ~17 ms per file), and
the share substrate was the configured way back onto that path.

### Added

- **The directory picker lists distro levels from inside the distro.** A level
  under `\\wsl.localhost\<distro>` is served by the resident agent's
  `ls -1ALp` in one round trip — a one-shot `wsl.exe --exec ls` when the
  resident is out, never the host's 9p walk, which paid one metadata round
  trip per entry plus one more per symlink, in the share's slow direction.
  `-L` folds the per-entry symlink stat the host walk used to pay; `-p`'s
  trailing `/` is what the row parser keys on, and a broken link drops out
  exactly as the old per-entry `stat` dropped it. `createDirectory` follows
  the same route (`mkdir` through the agent, one-shot otherwise). The parse
  is the pure `parseLsListing`/`lsListingArgv` pair in `lib/listing.js`
  (`test/listing.test.mjs`); the accepted limitation — a filename containing
  a newline would split into two rows — is documented in LIMITATIONS.md.
- **The file search runs the distro's own rg.** `WslSubprocessRuntime` now
  overrides `spawn` beside `spawnTerminal`: a spawn of the packaged ripgrep
  binary whose working directory names a distro (a `\\wsl.localhost\<distro>`
  UNC — the form every distro workspace search carries) is rewritten into
  `wsl.exe -d <distro> --cd <linux dir> --exec rg …` with every argument
  forwarded verbatim, so the tool reads the distro rg's output format and exit
  codes unchanged. The decision is the peer-free `lib/search-route.js`
  (mirroring `terminal-route.js`), and the rewrite delegates to the shipped
  spawn — the handle still wraps a real host process, so the consumer's output
  budget, spill machinery and teardown all work unchanged. One guard rides
  the rewrite: when the tool named no search path (its pattern rides
  `--regexp=`; a bare `--` is how it spells a path), the rewrite appends
  `-- .` — because `wsl.exe --exec` hands distro-side rg a relay fifo on
  stdin, and rg's readable-stdin heuristic then searches stdin instead of the
  directory. The packaged binary saw a non-readable NUL stdin under the old
  path, which is why the heuristic never fired there. A drive-path
  directory keeps the host binary, which is native there; a distro without rg
  surfaces rg's own "command not found" (exit 127) instead of a silent fall
  back to the share — `npm run bootstrap -- <distro> --install` installs it.
  There is no 9p path left to fall back to, by design. (`test/search-route.test.mjs`.)
- **The search rides the warm resident, not a one-shot spawn.** The rewrite's
  distro command is exec'd by the resident agent — one round trip (~10 ms)
  instead of a `wsl.exe` process startup (~400 ms) per search. The tool's
  handle surface is small (`done` plus `collected`), and `lib/search-exec.js`
  builds exactly that facade: the agent's out state is the lazy fallback cue,
  delegating to the one-shot `wsl.exe --exec` handle inside `done` — never an
  error, never the share. The tool's output budget rides the agent's
  per-stream capture cap; cancellation and `kill()` abort the agent exec and
  settle as the killed outcome the one-shot path reports.
  (`test/search-exec.test.mjs`.)
- **Idle distro terminals are reclaimed.** The controller reclaims an
  unattended terminal after 2 h of observed idleness, but its observation is
  host-side and a distro terminal can never answer it: the shipped
  shell-activity integration is gated to interactive `bash`/`zsh` launched
  directly on a POSIX host, every branch of `inspectActivity` settles on
  `unknown` for a `wsl.exe` terminal, and `unknown` never accumulates idle —
  so distro terminals had to be closed by hand. The terminal is now marked at
  launch (a per-terminal `DSH_TERMINAL_ID` through the existing `WSLENV`
  forwarding) and its `inspectActivity` counts the marked processes through
  the resident agent: exactly one (the shell at its prompt) is idle, more
  than one (a running command or a nested shell) is busy, and the agent
  being out answers `unknown` — reclamation pauses, because a probe that
  cannot answer must not authorize a close. A nested shell keeps the
  terminal busy by design, as does anything a shell's startup files spawn
  with the inherited marker. `terminalIdleReclaim: false` restores
  close-by-hand. (`lib/terminal-activity.js`, `test/terminal-activity.test.mjs`.)

### Breaking changes

- **`substrate: "share"` is refused at construction.** The Windows-side share
  backend was the file tools' opt-out onto the 9p share; the resident agent
  serves every distro read and write, and no file tool crosses the share any
  more. A profile still carrying the value fails to boot with the migration
  (`shareSubstrateRefusal`): delete the `substrate` line or set it to
  `"agent"`. The failure message for an agent that is out
  (`substrateFailure`) no longer offers the share as a way out and names the
  recovery path instead. The share-only plumbing (the symlink retry, the 9p
  publication hooks, and the `agent` and `resolveSymlinks` keys that gated
  them) is removed with this change — `lib/fs-publish.js` with it.

## [0.6.0] - 2026-10-04

One theme: the P2 backlog from the 2026-10-03 review, closed with the same
evidence bar as its P0/P1 — every fix carries a check that fails without it,
and the real-distro probes run green over the changed paths — plus the
import-time regression that backlog carried, caught at the first
sync-and-restart: `watchMaxDepth` was written `z.number().int()`, a member the
pinned schemastery does not publish, which took `wsl-shell` and `wsl-fs` down
in every distro workspace session. The key now uses `z.natural()`, and
`test/syntax.mjs` reads the chained half of the schemastery surface so the
next such member dies in CI instead of in the app.

### Fixed

- **The in-distro watcher no longer fails silently (review M10).** Four defects
  in `lib/watcher.js`, fixed together because they share one loop:
  the stamp file is removed on every way out (EXIT trap; TERM/INT/HUP routed
  through a plain exit so the trap runs); a target that vanishes mid-watch now
  ends the loop with a report through the error channel instead of arming
  forever (`E` protocol line, unit- and probe-tested); the scan's depth is
  boundable through the new `wsl-fs.watchMaxDepth` key (`0`, the default,
  keeps the whole-tree walk); and the loop's stderr is drained continuously
  with its tail kept for error context, so a chatty `sh` can no longer stall
  the watch at the 64 KiB pipe limit.
- **`watchMaxDepth` no longer takes both preset rows down at import (a
  regression the M10 entry above introduced, caught after the first
  sync-and-restart).** The key was written `z.number().int().min(0)`, but the
  pinned schemastery publishes no `int` on any schema instance, and a Config
  schema is a class field — so `lib/index.js` threw
  `TypeError: z.number(...).int is not a function` while it was still being
  imported, the loader left `wsl-shell` and `wsl-fs` fiber-less, and the preset
  audit reported exactly those two rows as `never started`: every session in a
  distro workspace, new or historical, failed at the first message. The key is
  now `z.natural().default(0)` — the pinned spelling of "integer >= 0", the
  idiom `picker` and `auto-preset` already use — and `test/syntax.mjs` now
  reads the chained half of the schemastery surface (a balanced walk that
  survives nested call arguments, string literals and template
  interpolations), so a member the peer does not publish fails the suite
  instead of waiting for the Desktop app. Reproduced and verified in a
  peer-stub harness: the `lib/index.js` import went from the `TypeError` to
  clean with the fix, and the new check fails on the old line.
- **A wedged WSL service can no longer hang a tool call forever (review M11).**
  Every `wsl.exe` resolution call in `lib/wsl.js` now runs under a deadline
  (`DEFAULT_WSL_DEADLINE_MS`, 60 s — generous on purpose for cold boots, `0`
  waits forever), and the deadline kill is named for what it is in the error,
  with the `wsl.exe --shutdown` remedy. Separately, the agent execution path's
  `confine()` now receives the request's abort signal, the same one the
  one-shot path always passed.
- **A timed-out command can no longer leave descendants running (review M12).**
  EXEC requests run as their own session and process group (`setsid`, detected
  at startup with a documented fallback), and the in-distro timeout and KILL
  frames signal the whole group — TERM, then KILL after the grace, descendants
  included. Proven by a new real-script check: a command that backgrounds a
  marked shell and outlives its budget leaves zero survivors.
- **Documentation drift cluster (review M9).** ARCHITECTURE.md's service table
  claimed the share substrate was the default (it is `agent`), pointed at
  `lib/sandbox.js` for `bwrapProfileArgs` (built in `lib/bwrap.js`), and kept
  the long-gone `watch()` refusal in the error-code table; the `substrate`
  schema docstring claimed watches run through the substrate (both substrates
  ride the same `lib/watcher.js` poll loop); PARITY.md now records the rg
  interception as designed-but-never-implemented instead of leaving it
  implied; and the probe checklists (both READMEs, CONTRIBUTING, RELEASING,
  the PR template, CI's comment) list the agent, watch, substrate and exec
  probes that had shipped without being listed anywhere.

### Changed

- **Test structure (review M15).** The sandbox checks run everywhere now:
  the probe-and-confine logic moved to the peer-free `lib/sandbox-core.js`
  (one implementation, still shipped), `lib/sandbox.js` binds it to the peer's
  `SandboxUnavailableError`, and the tests inject a stand-in with the same
  `code` — CI no longer skips them. `FS_SANDBOX_DENIED`'s write-only
  classification carries three unit checks (write denial classified, the same
  signature ignored off the write path, ordinary permission failures keep
  theirs). The probes stopped carrying inline bwrap profiles: `exec.sh` and
  `sandbox.sh` derive their profiles from `lib/bwrap.js` itself, so a profile
  change fails the probe instead of hiding behind a copy. `lib/wsl.js`'s
  spawning half — previously probe-only — gained `test/wsl.test.mjs`.
  `test/probe/agent.sh` is wired as `npm run probe:agent` like its siblings.

## [0.5.0] - 2026-10-04

One theme: telling the truth, in the reader's language. The Plugins page now
renders localized titles and descriptions for every row this bundle owns, the
README runs shallow to deep and carries an Architecture section in both
languages, the tab-title limitation is documented with its upstream proposal,
and the statements `hostSessions` had already falsified are gone.

### Added

- **The plugin page can speak the bundle's language.** The bundle and each of
  its four inserted rows (`subprocess`, `picker`, `shell-env`, `auto-preset`)
  now export localized display metadata — `locale/<lang>.json` with a
  `meta.title` / `meta.description` pair, exposed through `exports` per row —
  which is what the Plugins page reads before falling back to a package.json
  `description`. A Chinese UI now renders Chinese titles and descriptions for
  every row this package owns; previously the rows fell back to raw module
  specifiers (no description at all), and the two official rows it inserts
  keep their upstream English text, which only upstream locale files can fix.
- **docs/UPSTREAM-TERMINAL-TITLE.md — the upstream proposal behind a documented
  limitation, posted as
  [deepseek-ai/deepseek-harness#8769](https://github.com/deepseek-ai/deepseek-harness/discussions/8769).** `subprocess-wsl.hostSessions` routes a Windows-folder session's
  terminal to `powershell.exe`, but the tab still reads `WSL`: the controller
  titles a tab from the composition's single shell profile before the provider
  is consulted, the terminal spawn spec carries no display name, and a plugin
  cannot bridge the gap (a patch layer asserts rather than renames a row's
  module, and disabling the `terminal-controller` row fails web boot — its id
  is what the client's `webTerminals` mount waits behind). The doc records the
  gap, the three closed escape hatches with the web-boot failure that closed
  the second one live, and the smallest upstream change that would close it.
  LIMITATIONS.md gains the matching limitation paragraph with the workarounds
  that do work: double-click rename, and a user-layer `shellCandidates` entry
  whose manual selection is titled after itself.
- **The README carries an Architecture section** (both languages): the two
  mount heights — composition-level `subprocess-wsl` and the preset realm's
  `wsl-shell` / `wsl-fs` — with the per-session terminal routing and the
  command and file execution paths in one diagram and two paragraphs.
  [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) remains the full reference.

### Fixed

- Stale statements that `hostSessions` had already falsified were corrected in
  place: `cordis.patch.yml`'s consequence note and ARCHITECTURE.md's "the
  terminal follows the app configuration" paragraph still described the
  pre-routing behaviour.

## [0.4.0] - 2026-10-03

One theme: the enterprise review's remediation cycle completes. The
security-decision layer gains its own peer-free module and unit tests, the
coverage gate measures every unit file again, the fallback invariant is probed
for real, and the file tools pick up the audit's fixes — a killed write no
longer strands state, large reads stream instead of staging, `/tmp` writes
land where readers read, cross-distro workdirs are refused, the resident's
Windows environment is pinned, and `maskWindowsDrive` offers the interop
mitigation.

### Added

- **The filesystem provider's policy decisions are a peer-free module with
  their own unit tests.** The security-decision layer — which paths are
  refused for naming another distro, which mode denies a mutation outright,
  which write guards refuse which intents, how a substrate failure maps onto
  the surfaced refusal, and whether a mutation routes to the confined
  resident — used to live inline in `lib/index.js`, a file no unit test can
  import. It is now `lib/fs-decisions.js` (pure in, refusal descriptor out,
  byte-identical messages), with `test/fs-decisions.test.mjs` covering every
  branch, and `lib/index.js` delegating at one `FsError` choke point.

### Fixed

- **The fallback invariant is now probed, not just promised.** PARITY.md's
  hard rule — "`agent: false` must behave like the pre-agent release" — cited
  a probe leg that did not exist, and spelled the key as `wsl.agent: 'off'`
  when it is a boolean. `test/probe/agent.sh` now runs the same operations
  through the resident AND through the one-shot `wsl.exe` path and compares
  outcomes: exit code and stdout bytes (including `$`-metacharacters), stderr
  and working directory, and NUL/CRLF binary safety. All three legs pass
  against a real distro; the doc now names the key correctly and describes
  what the probe actually compares.

- **The coverage gate measures every unit file again.** `test:coverage` listed
  six of the sixteen test files — the thresholds (85/85/70) were met by the
  narrowed set while the full suite sat at 82.45% branches, so branch
  regressions anywhere outside the six were invisible to the gate that claimed
  to guard them. The gate now runs the whole unit suite (95.83% lines / 85.95%
  branches / 91.01% functions), which got there the honest way: new tests for
  the seams the audit found dark — the deny-dialect classification,
  aborted-signal mapping, the transport env pin, handshake mismatch, protocol
  garbage, cwd rejections, pre-aborted signals, idle retirement, mid-flight
  over-cap buffers, failed rebuilds, watcher teardown and error paths, the
  cross-distro workdir predicate, staging sweeps, setuid publication, and the
  real-`/tmp` consistency the file tools now have.

- **Reading a large file no longer copies its remainder to a temp file for
  every window.** `fs_read` staged `tail -c +offset` to disk before `head`
  took the requested bytes — so a full read of a 1 GB file performed ~1000
  window round trips AND ~500 GB of aggregate temp-file writes inside the
  distro, and a window that took over 30 seconds died as an opaque
  "distro I/O failure". The remainder now streams through a `tail | head`
  pipe (the request's own bound is the only staging), read failures still
  classify through the same stderr dialect, and windowed reads are verified
  byte-exact including the final partial window.
- **A request the transport cannot deliver now fails its caller instead of
  stranding it.** `writeLines` used to drop a frame silently when the
  `wsl.exe` process was gone (a thin race between exit handling and the next
  request), leaving a pending entry nothing would ever answer — the caller
  waited forever when it had no timeout, and the watchdog had no process
  left to kill. An undeliverable frame now rejects with
  `AgentUnavailableError` ("the agent exited before the request could be
  sent; it never ran"), the rebuild relay fails undeliverable re-sends the
  same way, and `close()` no longer writes `SHUTDOWN` into an ended stdin
  (whose async write-after-end error could crash the process during its own
  shutdown).

- **A confined write to `/tmp` now lands in the distro's real `/tmp`, where
  every reader reads.** The fence grants `/tmp` as a writable root, but the
  confined resident's profile mounted an ephemeral tmpfs over it — so the
  write reported success into a private tmpfs, the read tools (unconfined)
  could not see it, the post-write stat produced a `missing:` version that
  made the next edit fail with `FS_STALE_VERSION`, and the file evaporated
  when the resident retired. The file-writes resident's profile now binds the
  real `/tmp` read-write (`realTmp`, on by default for the confined factory):
  the write lands where the fence said it would, reads and edits agree, and
  user terminals see the file. Commands keep their ephemeral per-run tmpfs —
  the fresh-temp-area property (and its anti-poisoning guarantee) is
  unchanged, so a command still cannot see files the write tools placed in
  `/tmp` — the documented command-vs-tools split, now safe in both
  directions. Verified live: confined write → plain read returns the content;
  a confined `cat` still reports it absent, as documented.

- **A killed write no longer leaves its staging directory in your files.** A
  `KILL`/`SIGTERM` mid-write could not be trapped, so the private 0700
  staging dir (`.<name>.<pid>.<rand>.tmpdir`) sat in the target's own
  directory forever — and listings showed the debris to the model. The EXIT
  trap now removes the in-flight staging along with the agent's temp dir, and
  each write sweeps the target directory's leftovers whose creating agent's
  PID (it rides the name) is no longer running — a live agent's staging is
  left alone, PID reuse included.
- **A write to a typo'd path refuses instead of materializing the chain.**
  The staging `mkdir -p` silently created every missing parent directory and
  reported success, where the peer's Node-fs publication fails `ENOENT` —
  masking model errors as wins. Parents are no longer created: the refusal is
  `FS_NOT_FOUND`, an existing directory stays fine, and a concurrent creator
  of the directory still wins.
- **Setuid, setgid and sticky bits survive an overwrite or edit.** The mode
  was masked to `0o777` at the stat parse and again at the write, so a
  `4755` binary became `755` and a `1777` directory file lost its sticky bit
  — while LIMITATIONS claimed the bits were kept. The full mode now rides
  stat and write end-to-end (`0o7777`), matching the share substrate's
  `chmod --reference` behaviour.

- **A shell command whose workdir names another WSL distro is refused, where
  it used to run in the pinned distro against whatever tree shares the path.**
  `toLinuxPath` strips a `\\wsl.localhost\<name>\…` UNC's distro name, and the
  shell executor never compared it — so a `debian` workspace's commands ran
  inside the pinned `ubuntu`, silently, while the fs side refused the same
  workspace with `FS_OUTSIDE_DISTRO` ("open a session in that distro" — which
  the user had done). The shell now refuses with the fs side's wording, and
  the shell-env facts stay silent for a foreign-distro session instead of
  presenting another distro's home and shell as this session's.

- **The resident agent no longer inherits the Windows environment's WSLENV
  forwarding.** Spawned bare, `wsl.exe` carried this process's whole
  environment with it, and whatever the user's `WSLENV` names — dev machines
  routinely route secrets (`GITHUB_TOKEN/u` is the documented example) — was
  forwarded into the distro, where every model command inherited it. The
  transport's Windows env is now pinned: the essentials `wsl.exe` itself
  needs, the managed `DSH_*` facts, `WSL_UTF8=1`, and a `WSLENV` that names
  only the managed entries with their original flags. Verified live: a secret
  injected on the Windows side with a forwarding flag appears zero times in
  the distro environment. `forwardEnv` remains one-shot-only today — the
  resident path never forwarded it, and the pin keeps that posture instead of
  widening it silently.

### Added

- **`maskWindowsDrive` on `wsl-shell` and `wsl-fs`** — the mitigation knob for
  the interop hole the sandbox has always documented. The confined profile
  mounts an empty tmpfs over `/mnt`, so the Windows drive's files cannot be
  read or exfiltrated by a "sandboxed" command and its executables cannot be
  launched through interop (the path by which such a command reaches your full
  Windows token). Honest limits, stated wherever the key is: binfmt interop
  dispatches on file content, so a command that can write the workspace can
  still write an executable there and run it — enforcement stays `partial`,
  the result's sandbox fact now carries `windowsDrive: "masked" | "visible"`
  so the model can see which posture it runs under, and the only complete
  closure is distro-level (`[interop] enabled=false` in `wsl.conf`). Default
  `false`: the drive stays visible unless you ask for the mask.

## [0.3.0] - 2026-10-03

One theme: the file tools move into the distro. The `substrate: "agent"` I/O
substrate and its kernel-enforced confined writes land together with the
enterprise review that hardened them — the watchdog that killed the shared
agent for a queue it never chose to join, the output captures nothing bounded,
a root listing that sheared the first character off every child's name, and an
overwrite guard that stopped at the host.

### Fixed

- **One file carries one version string, whichever op answered.** `stat` and
  `list` built their versions from different producers: the stat op used the
  distro's `stat` directives (uutils `stat` rounds timestamps to microseconds)
  while the list walk used `find -printf` (nanosecond-exact), so the same file
  yielded two different version strings and a list-derived guard failed
  against its own stat. `fs_stat` now reads through the same `find -printf`
  the list walk uses — one producer, one string — and `find -L`'s habit of
  reporting a dangling link as the link itself is refused the way the `stat`
  it replaced was, so a dangling link still stats to null like the peer's.

- **An overwrite or edit now re-verifies its version distro-side, one syscall
  before the rename.** The module header claimed the mutation guard "survives
  to the write", but the no-replace link guarded only `createIfAbsent`: an
  overwrite or edit checked the version host-side and then published with an
  unconditional `mv -f`, so a concurrent writer (an editor save, `git stash`,
  another session) that landed between the model's stat and the publish was
  silently clobbered with no `FS_STALE_VERSION`. The `write` op now carries
  the version the write was based on (a `replaceIfVersion` guard's version,
  or the stat an edit was read against), and the agent re-verifies it with a
  fresh stat from the SAME producer `fs_stat` uses — refusing with
  `FS_STALE_VERSION` ("file changed since it was read", or "file no longer
  exists") while the concurrent writer's content stays untouched and no
  staging debris is left behind. The window narrows from a host round trip to
  kernel-adjacent — the honest wording, here and in the module headers,
  LIMITATIONS.md and ARCHITECTURE.md, is that only the create case is closed
  outright.

- **The agent command path now enforces the output budget it always
  advertised.** `maxOutputBytes` rode the config schema but nothing else: the
  agent captured a command's whole stdout and stderr and base64ed both into
  one RES line — multi-gigabyte output meant multi-gigabyte dash command
  substitutions in the distro and a multi-gigabyte host line, with the result
  claiming `truncated: false` all the way. The EXEC frame now carries the
  caller's per-stream budget (`wsl-shell`'s `maxOutputBytes`, wired from the
  agent execution path); the agent cuts each stream at it — only the first
  bytes are encoded, so distro AND host memory are bounded — and the RES line
  reports which streams were cut, which the handle surfaces as honest
  per-stream `truncated` flags (a guarded-create synthesis and frames without
  a budget still read `false`). The host also defends itself against a broken
  or hostile agent: the unbounded readline accumulator is replaced with a
  bounded line splitter that kills the transport when one stdout line exceeds
  the protocol cap instead of buffering it whole.

- **A short-budget request queued behind a long one no longer kills the shared
  agent — and an in-flight command is never silently re-run.** Two defects
  shared one root: the host armed each request's watchdog at SUBMISSION and
  let it kill the one `wsl.exe` carrying every pending request, and the
  rebuild relay then replayed all carried frames verbatim. In the default
  configuration the 10 s `DSH_WSL_PORTS` poller (8 s budget, shared agent) did
  exactly this against any command longer than ~21 s: the poll's watchdog
  killed the transport, the command died mid-flight, and the rebuild
  **re-executed it from scratch** — both callers seeing success (measured: a
  killed `sleep 40` ran twice). Three changes close it: the agent answers
  `ACK|<id>` when it dequeues a request and the host arms the watchdog there,
  so queue time never spends a budget (wire protocol v3 — sync the runtime
  copy and restart the app, an old agent fails the handshake loudly instead of
  misbehaving quietly); the rebuild relays only provably read-only FS frames
  (`stat`/`lstat`/`list`/`realpath`/`read`), failing an in-flight EXEC or
  `write` with "its state is unknown — inspect the distro before retrying"
  instead of re-running it; and an abort now addresses the request's CURRENT
  id, so a relayed request's KILL (and map cleanup) can no longer miss. The
  watchdog-vs-queue experiment now ends with the long command executed exactly
  once and the transport alive.
- **A root listing kept every child's name whole.** `listChildren` sliced each
  `find` record at `parent.length + 1`, which against the bare `/` parent
  sheared the first character off every name (`/etc` → `tc`), and a write to a
  listed child then created `/tc`. The exact prefix is stripped instead, and
  the child join owes its own slash, so `listDir` on
  `\\wsl.localhost\<distro>\` names `/etc`, `/home`, `/usr` correctly.

### Added

- **`substrate: "agent"` — the filesystem's in-distro I/O substrate.** `wsl-fs`
  gains a `substrate` key, default `agent`: the file tools are served through
  the resident in-distro agent instead of the 9p share — identities are
  distro-side `realpath`s, symlinks resolve where they live (no retry
  machinery, `/etc/os-release` just works), mode bits are native, and a
  mutation guard survives to the write's no-replace publication — the
  check-then-write window the share documents closes, exactly as on a Linux
  host. `substrate: "share"` is the opt-out that keeps the previous behaviour
  byte for byte. Both substrates fence writes with the same host-side policy
  check, so this changes fidelity and posture, not enforcement. Known
  differences are in LIMITATIONS.md (notably: new files publish at 0600, the
  peer's own POSIX semantics, where the share took the umask 0644), and an
  agent outage fails with `FS_IO_ERROR` naming the substrate rather than
  degrading to share semantics. Layers: FS operation frames on the agent wire
  protocol (v3, `agent/wsl-agent.sh`), fsio-over-agent mechanics
  (`lib/fsio-agent.js`), provider-shaped orchestration (`lib/fs-substrate.js`),
  and the provider branch (`lib/index.js`). The pure text mechanics are
  replicated from upstream pending the fsio export proposed in
  docs/UPSTREAM-FSIO-EXPORT.md. Probed live: `npm run probe:substrate`.
- **Stage two: kernel-enforced confined writes.** On the agent substrate, a
  mutation under a confined policy rides its own long-lived resident — one
  agent per (distro, mode, workspace), spawned inside the bwrap profile that
  binds exactly what the mode grants (`lib/agent-confined.js`, `argvPrefix` on
  the agent wire). The kernel now refuses what the host-side check would have,
  so a check bug cannot become a write outside the workspace; a mount-table
  refusal surfaces as `FS_SANDBOX_DENIED`, the command path's dialect, and a
  distro without usable bwrap refuses confined writes with the bootstrap
  command instead of downgrading. Escalated (`danger-full-access`) writes ride
  the plain resident, and a policy change simply addresses a different key —
  the previous resident retires through its idle timer. Probed live: the
  confined write inside the workspace lands, and the one outside it is refused
  by the kernel (`probe:substrate`).

### Fixed

- **Every mutation on the agent substrate failed: the confined resident's command
  had no program** — `confinedAgent()` built the resident's `argvPrefix` from the
  raw profile arguments, so the transport handed `wsl.exe` a command beginning at
  `--ro-bind` instead of `bwrap --ro-bind`. The resident exited 1 during its
  handshake, and every write, edit and guarded create on `substrate: "agent"`
  failed with `FS_IO_ERROR: the distro file substrate is unavailable: agent exited
  during handshake (code=1 signal=none)` while reads kept working. Both confinement
  sites now assemble the command through the import-free `lib/bwrap.js`, which is
  what `test/agent.test.mjs` asserts; the same bug stayed invisible because
  `test/probe/substrate.sh` inlined a *third*, correct copy of those arguments —
  it now imports the production builder, so the probe fails with the provider.
- **`WslFileSystem` could not build its agent substrate at all: a constructor
  field shadowed the method of the same name** — the constructor's
  `this.agentSubstrate = undefined` (the cache) overwrote the prototype's
  `async agentSubstrate()` (the accessor), so the first file operation that needed
  the agent threw `this.agentSubstrate is not a function`, which is how a GUI
  session failed its turn in the Desktop app. The cache is now
  `this.agentSubstrateInstance`, named after the sibling `this.agentInstance`, and
  `lib/index.js`'s instance fields no longer collide with any class member.
- **A schemastery member the pinned peer does not publish took the `wsl` preset
  down in the Desktop app** — `WslFileSystem.Config` declared
  `substrate: z.enum(["share", "agent"])`, and `@deepseek-ai/schemastery` 3.18.4
  (what every `@deepseek-ai/dsh-*` peer pins as `~3.18.4`) publishes no `enum`. A
  Config schema is a class field, so the call ran while `lib/index.js` was still
  being imported: the loader logs the `TypeError` and leaves that row with no
  fiber, which the preset audit renders as `never started` — naming neither the
  member nor the file, and only for `wsl-shell` and `wsl-fs`, the two rows that
  load `lib/index.js`. The preset therefore failed to activate, so the app
  reported `2 row(s) did not activate` for those two ids. Now
  `z.union(["share", "agent"])`: same `agent` default, and a bad value still
  fails with `expected "share" | "agent" but got "bogus"`. Measured against the
  app's own runtime, both entries import; `test/syntax.mjs` now checks every
  `z.<member>` in `lib/` against the pinned peer's surface, which fails on
  `z.enum` and passes on `z.union`.

## [0.2.0] - 2026-10-03

One theme: the Remote-WSL parity plan (`docs/PARITY.md`) lands, Phases 0–7 —
a resident in-distro agent plus the shell-execution, watch, publication,
ports, terminal-routing and bootstrap work that migrates the seams onto it.
The release closes with the two agent-path breaks that took down every GUI
shell call, both surfacing only through the GUI's wire protocol.

### Fixed

- **`truncated` missing from the agent path's output streams** — the bash tool's
  canonical result copies the field unconditionally (`canonicalBashResult`), so an
  `undefined` failed the wire's lossless-JSON snapshot and EVERY shell tool call
  returned "tool bash returned invalid output: value is not lossless JSON". The
  agent path now always reports `truncated: false` (it never truncates; there are
  no spill files). Regression assertion in `test/agent-exec.test.mjs`.
- **The agent execution path failed every shell call whose request carried an
  absolute UNC workdir** — which is every call a GUI session makes, so the
  harness's own agent session lost its bash tool until the fix. The one-shot
  path converts the spec's workdir inside `argv()` (`toLinuxPath`); the agent
  path carried the workdir as a raw frame field, so the raw UNC reached the
  in-distro `chdir`, the synthesized relay text fired `throwIfWorkdirMissing`,
  and the call died with "could not enter the working directory". The conversion
  now happens at the call site (regression test in `test/shell.test.mjs`).

### Added

- **Phase 5: per-session terminal routing.** `spawnTerminal` now routes on the
  request's directory coordinates (`lib/terminal-route.js`, `subprocess-wsl.hostSessions`,
  default on): a WSL-folder session gets the distro shell, a Windows-folder session gets
  a host `powershell.exe` in its own directory — no more distro terminal at
  `/mnt/<drive>/…` for host sessions. The shell menu stays the single configured profile,
  and every non-`wsl.exe` consumer is untouched. Still limited (LIMITATIONS.md): the
  shell menu is one entry, and directory-less launches land in the distro.
- **Phase 7: developer-loop recipes.** Both READMEs gain a Recipes section: Git
  credential sharing through the Windows Credential Manager, `/mnt/c` 9p
  performance guidance, and the `WSLENV` passthrough policy (prefix-admitted
  `DSH_*`, `/p` translation, `PATH` deliberately excluded).
- **Phase 6: listening-port visibility.** `DSH_WSL_PORTS` joins the managed
  `DSH_*` facts: the ports with a listener inside the distro, comma-separated,
  refreshed every `portsRefreshMs` (default 10s) through the resident agent by
  reading `/proc/net/tcp{,6}` directly — no `ss`, nothing to install. The
  registry's resolve is synchronous by contract, so the snapshot is served
  stale-but-recent; a dev server started moments ago appears on the next
  refresh. Scoped as before: only sessions whose workspace is inside a distro
  see it. Probed live: a real HTTP server appears in the next snapshot.
- **Phase 4: bootstrap.** `npm run bootstrap -- [distro] [--install]` checks the
  distro for bubblewrap (required) plus ripgrep and inotifywait (the optional
  backends later phases prefer), prints the exact copy-paste install command for
  the distro's package family (apt/dnf/pacman/zypper), and with `--install` runs
  it as the distro's root through `wsl.exe -u root` — no sudo prompt inside the
  distro, nothing touches the Windows side. The `SANDBOX_UNAVAILABLE` message now
  names the same command instead of a bare `sudo apt install`. Probed live:
  detect mode on a distro that already has bubblewrap.
- **Phase 3: shell execution through the agent.** `WslShellExecutor` now runs commands
  over the resident agent when it is up (`wsl-shell.agent`, default on): one long-lived
  in-distro process instead of a `wsl.exe` per command, with the timeout enforced
  INSIDE the distro (TERM, then KILL after the grace) instead of against the Windows
  process tree. The confinement argv, the execution-handle shape, the result
  decoration (runner failures, denials, `enforcement: partial`) and the workdir
  failure are all identical to the one-shot path — an out-of-service agent falls back
  to it per call, permanently after the agent's rebuild budget. Probed end-to-end:
  `npm run probe:exec` (confined completion, verbatim shell parsing, in-distro
  timeout, relay-shaped cwd failure, kill). Documented deviation: the agent path has
  no live output streaming — reads after settlement carry the whole stream, and no
  spill files (the protocol line already holds it in memory).
- **Phase 2 (second half, first slice): in-distro publication through the agent.**
  `WslFileSystem` now carries an optional resident agent (`wsl-fs.agent`, default on):
  when available, publication — the replaced file's mode copied onto the staged temp,
  then the atomic rename — is ONE `exec` inside the distro (`lib/fs-publish.js`)
  instead of a `wsl.exe` chmod plus a 9p rename. Any agent failure falls back to the
  legacy two-step path for that call; the flag changes round trips, never what is
  published. Probed: the publication script's mode preservation and creation
  behaviour run in `test/probe/agent.sh` (now 10 checks).
- **Phase 2 (first half): real `watch()`.** `WslFileSystem.watch` now observes from
  inside the distro — a long-lived `wsl.exe` `find -newer` poll loop (`lib/watcher.js`)
  firing the seam's coarse invalidation callback — instead of refusing with
  `FS_IO_ERROR`. Activates on a READY barrier from the loop (a write racing the first
  tick is never invisible), sees creations and deletions (both bump the parent's
  mtime), and cleans up on close. Documented blind spot: files created with an
  mtime older than the stamp (`cp -p`, `tar -x`). Probed end-to-end:
  `npm run probe:watch`. The native-ext4 migration of the remaining fs operations
  stays with Phase 3 of the plan.
- **Phase 1 of the Remote-WSL parity plan (`docs/PARITY.md`): the resident in-distro
  agent.** `agent/wsl-agent.sh` is a dependency-free POSIX shell peer spawned once per
  distro; `lib/agent.js` owns the lifecycle (handshake, lazy start, idle shutdown, one
  rebuild, permanent fallback to the shipped one-shot `wsl.exe` path) and
  `lib/agent-protocol.js` the line protocol (base64 payloads, NUL-safe argv). Not wired
  into the seams yet — the executor and filesystem migrations are the next phases.
  Probed end-to-end against a real distro: `test/probe/agent.sh` (8 checks, including
  binary-safe payloads, an in-distro timeout kill, and a 2 MB single-line response).
  Unit tests cover the codecs and the lifecycle state machine with a fake transport.
- `docs/PARITY.md`: the plan to reach VS Code Remote-WSL-grade experience — a resident
  in-distro agent as the core, with the `fs` and `shell` seams migrated onto it and the
  current 9p/one-shot paths kept as the documented fallback — plus the Phase-0 contract
  audit that shaped it (watch is a coarse invalidation callback; search spawns the
  packaged ripgrep through `ctx.subprocess`, so the interception point is the
  `subprocess-wsl` subclass).

### Changed

- The package description is rewritten in Chinese to state what the plugin does first —
  it makes a WSL distro the session's execution environment — then covers the execution,
  UI, and sandbox aspects in one clause each.
- Chinese text now says “WSL 子系统” instead of “WSL 发行版”, the phrasing Chinese readers
  more commonly use for a WSL distro (`docs/README.zh.md` and the two archived Chinese
  documents; 99 occurrences).

## [0.1.10] - 2026-10-02

Metadata and one documentation addition. No behaviour change.

### Changed

- The package description now covers all four capabilities — commands, the file tools,
  the folder picker, the GUI terminal — and the confinement, instead of naming only two
  of them. It is the line npm shows under the package name in search results.

### Documentation

- The error table in `docs/ARCHITECTURE.md` states exactly what the model sees on a
  filesystem denial: the denial marker and the escalation hint, line for line. It also
  records why that makes `FS_OUTSIDE_DISTRO` worth its own code — a code the tool layer
  does not decorate with those lines.


## [0.1.9] - 2026-10-02

The last test gap from the closure review: the documented opt-out. No runtime change.

### Added

- `npm run probe:sandbox-off` turns the sandbox off on **both** providers and asserts
  what the documentation promises: `sandboxMode` disappears on each of them, a command
  outside any workspace root runs, the shell result claims no sandbox, and a filesystem
  write outside the workspace root is not fenced (`operation=create`). Without it the
  opt-out and a backend that is merely broken would look alike from the outside — which
  is what `probe:missing-wsl` covers. 5 checks.


## [0.1.8] - 2026-10-02

A probe assertion for the one item the closure review had to record as unverifiable.
No runtime change.

### Added

- `npm run probe:sandbox-shell` asserts that a command past its deadline is reported as
  timed out **and leaves no process behind in the distro** (15 checks, up from 13). The
  escalated path is used on purpose: a confined command also dies with its `bwrap`
  parent, so only the unconfined path shows whether the subprocess service's kill
  actually reaches the distro. It does — measured through `ctx.shell` here, and
  directly by killing a `wsl.exe` relay and watching the distro-side `sleep` disappear
  with it (1 process before, 0 after).

### Documentation

- The review's "unverified: orphaned processes after a timeout" item is closed. The
  earlier attempt could not see the process at all, and said so: the agent's own shell
  ran in a separate PID namespace, where `ps` cannot see the distro's processes.


## [0.1.7] - 2026-10-02

One correctness fix and the error-code reference the closure review asked for.

### Fixed

- A command whose working directory could not be entered was reported as a success.
  `wsl.exe --cd <missing>` does not fail: it writes a relay error to stderr, runs the
  command in `/`, and exits 0 — measured directly, and visible in the shell probe's own
  transcript. A build or a write could therefore act on the wrong tree while every
  signal said it worked. `WslShellExecutor` now matches that relay line and fails with
  the directory and the fallback. Both markers are required (the relay prefix and
  `CreateProcessCommon`), so a command printing its own `chdir(...)` message cannot be
  mistaken for it; the matcher also finds the line when it arrives UTF-16 encoded.
  `npm run probe:sandbox-shell` asserts the behaviour end to end, and
  `test/shell.test.mjs` covers the matcher, including a false-positive case.
- The shell probe's own setup ran into this on the first run: it created the workspace
  root while that not-yet-existing root was its workdir, which had "worked" only because
  `mkdir -p` takes an absolute path. The setup now runs from the distro home, and the
  new assertion pins the failure it used to hide.

### Documentation

- `docs/ARCHITECTURE.md` gains an **Error codes** table: what raises each `FS_*` code
  and `SANDBOX_UNAVAILABLE`, what each one means, and what clears it — including that
  `FS_OUTSIDE_DISTRO` cannot be lifted by a wider permission. It also documents the two
  failures that come from `wsl.exe` itself: a missing, stopped or unregistered distro (a
  `WSL_E_*` code on stdout, UTF-16 on some builds, with an empty stderr) and an
  unenterable working directory. Both READMEs' troubleshooting tables now point at it.
- `docs/LIMITATIONS.md` separates the two workdir cases a deleted directory can produce:
  the bind that bubblewrap refuses, and the directory that cannot be entered.


## [0.1.6] - 2026-10-02

Three probes that close coverage gaps a closure review named, the documentation of a
`/tmp` asymmetry, and one clearer error message. No behaviour changed otherwise.

### Added

- `npm run probe:picker` drives the directory picker in a throwaway boot: the root
  level's crumbs, the Windows home, every installed distro, the documented
  `directory-unreadable` refusal for a relative path and for a directory that does not
  exist, and `maxEntries` with its `truncated` flag. Nothing ran `lib/picker.js` before
  this — the unit tests import only `lib/listing.js`.
- `npm run probe:missing-wsl` boots a profile whose `wslPath` cannot start and pins how
  that is reported: the executable is named, `wslPath` is suggested, the failure is not
  dressed up as a sandbox refusal, and no sandbox facts are claimed for a command that
  never ran. The other fail-closed state — `wsl.exe` works but the distro has no
  `bubblewrap` — is asserted in `test/sandbox.test.mjs`, which drives
  `WslSandbox.confine` against a failing probe, because driving that end to end needs a
  distro without `bubblewrap`.
- `npm run probe:mode` runs `test/probe/mode-probe.mjs`, which measures which POSIX-mode
  facts survive the share. The file was cited by `docs/LIMITATIONS.md` and wired into
  no script at all.
- `test/preset-choice.test.mjs` covers the session-preset decision, now that the rule
  is the pure `lib/preset-choice.js`. The frame timing that applies the decision still
  needs the harness, and the test says so.

### Changed

- `runCapture` names the cause when the executable itself cannot start: the message now
  points at `wslPath` and at WSL being installed, the same way it already did for a
  token denied by the Windows sandbox. `npm run probe:missing-wsl` asserts it.

### Documentation

- `docs/LIMITATIONS.md` states the `/tmp` split: a confined command's `/tmp` is a fresh
  tmpfs while the file tools' fence grants the distro's *real* `/tmp`, so both sides can
  write but neither sees the other's files. Hand a file between them through the session
  workspace. `docs/ARCHITECTURE.md` describes the same distinction where it explains the
  fence, including why the Windows temp directory is deliberately not granted to a
  distro session.


## [0.1.5] - 2026-10-02

Three defects from a design-closure review. Two are cases where a documented remedy
could not work, and one where the cause of a failure was invisible.

### Fixed

- A failed sandbox probe was remembered for the process lifetime, so installing
  `bubblewrap` after the app had started changed nothing until a restart — while the
  error told the user to install exactly that. Only a success is cached now; a failure
  is re-probed on the next command, and concurrent first commands share one probe. The
  policy lives in [`lib/probe-cache.js`](lib/probe-cache.js), which is pure, so the
  regression is pinned on every platform including CI
  ([`test/probe-cache.test.mjs`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/test/probe-cache.test.mjs)).
- `restrictToDistro` refused another distro's share with `FS_SANDBOX_DENIED`. The
  file-tool layer turns that code into a denial marker plus an escalation offer
  (`mapError` in `dsh-tool-fs`), and no wider permission can lift this fence: it is a
  configuration choice, not a sandbox decision. It now reports `FS_OUTSIDE_DISTRO`,
  which the tool layer passes through unchanged, and the message says what to do.
- A command that never started because the distro was missing, stopped or
  unregistered reached the model as a bare non-zero exit. `wsl.exe` writes
  `Wsl/Service/WSL_E_DISTRO_NOT_FOUND` to **stdout** — UTF-16LE on some builds — with
  an empty stderr, so every signature in the plugin missed it. `WslShellExecutor` now
  reads that code (NUL-stripped, so either encoding is found), pins `WSL_UTF8` on its
  own spawn so the text is readable, and fails with the distro name and the remedy.
  Deliberately not a sandbox code: a wider permission cannot create a distro.

### Documentation

- Two statements were wrong and are corrected against measurement. `read-only` does
  not leave `/dev/null` as the only writable path: `bwrap --dev /dev` mounts a fresh
  `/dev`, so `/dev/shm` is writable scratch and only `/tmp` stays read-only. And
  `restrictToDistro` does not refuse `/mnt/c`, which is a directory *inside* the
  distro — it refuses another distro's share.
- The shell row's inherited output budgets (`maxOutputBytes`, `maxSpillBytes`,
  `graceMs`) are listed in [`docs/CONFIGURATION.md`](docs/CONFIGURATION.md); the
  fail-closed bullet in [`docs/LIMITATIONS.md`](docs/LIMITATIONS.md) matches the
  re-probing behaviour, and what the file tools do when a distro stops mid-session is
  stated there too.

### Changed

- `test:unit` gained `test/probe-cache.test.mjs` and `test/sandbox.test.mjs`;
  `test:coverage` gained the pure one. The sandbox test skips itself where the
  `dsh-sandbox` peer is absent, which is the CI case, and
  [`CONTRIBUTING.md`](CONTRIBUTING.md) explains when a test belongs in which list.


### Fixed

- A shell request that names its workdir only **relatively** now lands on the
  distro user's home, joined under it, when no `cwd` is configured — instead of
  riding on the parent's `process.cwd()` fallback, a Windows directory no
  `wsl.exe --cd` accepts. The empty-workdir case already defaulted to the home;
  the relative tail was the one shape the marker missed. Absolute workdirs in
  any coordinate system are unchanged.
- A Windows UNC path outside the WSL share (`\\server\share\...`) is now
  treated as the world path it already is, instead of being joined onto the
  default workdir as if it were relative — which named a file that existed
  nowhere. It also no longer triggers a `wsl.exe` home query it can never need:
  `isRelativeWorldPath` now reports every UNC form, WSL or not, as absolute.

## [0.1.4] - 2026-10-02

Documentation only: a shorter README, and the reference documents it links to.

### Changed

- The README is a quick start now, and nothing else: install, use, configure, the
  sandbox in brief, troubleshooting, development, and an index of the documents. It
  went from 232 lines to 124. Everything that was not part of getting the plugin
  running moved to the document it belongs to — the full configuration table to
  [`docs/CONFIGURATION.md`](docs/CONFIGURATION.md), the limitations to
  [`docs/LIMITATIONS.md`](docs/LIMITATIONS.md), the file layout to
  [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) (the two design rationales were
  already there), and the verification list to
  [`CONTRIBUTING.md`](CONTRIBUTING.md). The Chinese README was rewritten to match,
  section for section, and still does.
- `docs/CONFIGURATION.md`, `docs/LIMITATIONS.md` and `docs/ARCHITECTURE.md` ship in
  the tarball, so a package consumer has the configuration reference and the honest
  list of limitations without the repository.

## [0.1.3] - 2026-10-02

Repository and release engineering. No runtime behaviour changed.

### Added

- `npm run lint:style` ([`test/style.mjs`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/test/style.mjs)): a dependency-free gate
  over the rules `.editorconfig` states, plus three packaging checks — every `files`
  entry still matches tracked content, every `exports` target exists, and exactly one
  readme candidate sits at the package root. That last one is the regression guard
  for the 0.1.1 readme, and it is why the gate exists at all.
- `npm run test:coverage`, with thresholds of 85% lines, 85% branches and 70%
  functions, using Node's built-in coverage. No coverage dependency was added. The
  spawning half of `lib/wsl.js` and the four service modules are covered by the
  probes instead, which is why the function threshold is lower than the others.
- `.github/workflows/release.yml`: a `v*` tag is checked against `package.json`
  ([`scripts/check-release-tag.mjs`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/scripts/check-release-tag.mjs)), gated, then
  published with `--provenance` through npm trusted publishing, and the GitHub
  Release is created from the changelog section
  ([`scripts/changelog-section.mjs`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/scripts/changelog-section.mjs)). No npm token is
  stored in the repository.
- The governance files a public repository is expected to carry:
  [`SECURITY.md`](SECURITY.md), [`CONTRIBUTING.md`](CONTRIBUTING.md),
  [`SUPPORT.md`](SUPPORT.md), [`CODE_OF_CONDUCT.md`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/CODE_OF_CONDUCT.md),
  `CODEOWNERS`, a pull-request template, bug-report and contact-link issue templates,
  and a Dependabot configuration for the pinned workflow actions.
- [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) describes the plugin as it is
  today — the providers, how they are mounted, the three path coordinate systems, the
  sandbox, the runtime mirror and the test layers — so the current design no longer
  has to be reconstructed from a changelog and a historical record.
- [`docs/RELEASING.md`](docs/RELEASING.md): the release checklist, including the
  operational facts that cost time to learn.
- [`docs/archive/README.en.md`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/docs/archive/README.en.md): an English index of the
  Chinese archive.
- `.nvmrc` names the Node version the coverage job uses.

### Changed

- The probes no longer carry a user name, a home directory or a distro name.
  [`test/probe/env.sh`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/test/probe/env.sh) derives them from the machine
  (`%USERPROFILE%`, `%LOCALAPPDATA%`, `WSL_DISTRO_NAME`) and
  [`test/probe/env.mjs`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/test/probe/env.mjs) does the same for the Node-side probes,
  which learn their own location from `import.meta.url`. The YAML overlays are now
  templates with `@NAME@` placeholders, and the scripts substitute real values into
  generated copies that `.gitignore` keeps out of the tree. The two profile layers
  use `distro: ''` (WSL's default distro) instead of naming one.
- CI runs the unit suite on Windows as well as Linux. The plugin targets Windows, and
  the Windows legs also prove that the LF guarantee in `.gitattributes` holds on the
  platform whose default is CRLF. The workflow gained least-privilege `permissions`,
  a `concurrency` group, timeouts, and actions pinned by commit SHA.
- `package.json`: `packageManager` is gone, because the package has no dependencies
  and npm is the reference toolchain everywhere else; `author` and `publishConfig`
  are set; `prepublishOnly` runs the gates; and `files` ships `CONTRIBUTING.md`,
  `SECURITY.md` and `SUPPORT.md` so a tarball without the repository still says how
  to contribute, report and get help.
- Both READMEs gained a *Contributing and support* section, and list the new gates.

### Fixed

- Corrected the 0.1.2 entry. It had named the npm CLI's readme rule as the cause of
  the 0.1.1 readme mix-up; that rule does not match `.md` names and is not the code
  path that decides a published package's readme, so the entry now records what was
  observed instead of a mechanism that does not hold. The GitHub Release notes for
  v0.1.2 were corrected the same way.
- Six lines in [`lib/index.js`](lib/index.js) were indented with tabs while the rest
  of the file uses spaces, which the new style gate caught.

## [0.1.2] - 2026-10-02

### Fixed

- The npm package page rendered the Chinese README instead of the English one. 0.1.1
  published `README.md` and `README.zh.md` side by side, and the registry answered
  with `readmeFilename: README.zh.md`. Two candidates are enough to make the outcome
  unreliable, and neither obvious rule explains which one won: it is not the tarball's
  entry order (0.1.1's tarball listed `package/README.md` first), and it is not the
  npm CLI's own selection rule (`@npmcli/package-json/lib/normalize.js` globs
  `{README,README.*}` and accepts `/\.m?a?r?k?d?o?w?n$/i`, which does not match a
  `.md` name at all). The registry is picking by a rule this repository should not
  depend on. The translation now lives at `docs/README.zh.md`, which leaves exactly
  one candidate at the package root and removes the question by construction. The
  English header still links to it and `files` still ships it. 0.1.1 remains on the
  registry with the wrong readme; 0.1.2 supersedes it.

## [0.1.1] - 2026-10-02

Documentation only: the README was reorganised for readers and translated into Chinese. No code changed.

### Added

- A Chinese translation of the README, [docs/README.zh.md](docs/README.zh.md), linked from
  the English header (and back). It is a translation, not the second README that
  was removed earlier: that file's problem was genre — it called itself the current
  description while contradicting the English one — whereas these two say the same
  thing section for section, and the English file remains the only statement of
  current state. The Chinese text also ships in the package (`files`), so the
  tarball is readable in either language; npm still renders `README.md`.

### Changed

- The README is reorganised around a reader's path instead of the design log's:
  "What you get", then Install, Using it, Configure, Sandbox, Troubleshooting —
  with the two architecture essays moved to *Design notes* at the end. It gains
  CI/npm/license badges, a section index, a one-paragraph example session, the
  upgrade command, and a nine-row troubleshooting table. The Configure table was
  re-checked against the schemas: it now labels which values the shipped patch sets
  and which are schema defaults, and no longer omits `timeoutMs`/`maxTimeoutMs`
  or `maxEntries`.
- The Chinese README was rewritten in plain technical Chinese. The first pass was
  dense and literary — comma-spliced clauses, dash-heavy sentences, and calques
  such as 能力事实, 布防 and 围栏 used as a verb — which is what makes a translated
  document hard to read even when it is accurate. It now averages 61 characters per
  sentence, keeps the English term beside the Chinese where the term matters
  (`enforcement`, `escalation`, `interop`), and turns the paragraphs that packed
  three probes or three facts into one sentence into lists. The section names are
  plainer too (能做什么 / 使用 / 常见问题 / 设计说明). Nothing factual changed: the
  two READMEs still match section for section.
- The English README then got the same treatment, once the Chinese rewrite made the
  problem obvious in both languages. A single "what has been verified" sentence ran
  to 125 words; the sandbox section explained itself with asides ("and that is the
  honest part", "stated rather than papered over"); and terms such as *composition*,
  *capability fact*, *isolate realm* and *fence* (as a verb) appeared before they
  were explained. The prose now averages 15 words a sentence with a 42-word maximum,
  the verification list is a list, and each term is glossed where it first appears.

## [0.1.0] - 2026-10-02

First release. A WSL distro can be picked as a workspace, read and written
with the model's own file tools, and run commands in; the GUI terminal opens
inside it; commands are confined by a Linux-side sandbox built in the distro;
and the package installs as a bundle that contributes its own profile layer.

### Added

- **Distro-side sandboxing** (`lib/sandbox.js`, and `sandbox: true` on both
  providers): WSL commands are now confined instead of running unconfined. The
  Windows ACL runner can never reach WSL — its restricted token fails `wsl.exe`
  with `Wsl/E_ACCESSDENIED` — so the confinement is built on the host and
  executed *inside* the distro: `wsl.exe … --exec bwrap --ro-bind / / --dev /dev
  --unshare-pid --proc /proc --die-with-parent [--tmpfs /tmp --bind <workspace>
  <workspace>] -- <shell> -lc <cmd>`. The profile arguments, the denial dialect
  (`read-only file system`) and the runner-failure rules mirror
  `@deepseek-ai/dsh-sandbox-local`'s Linux rung, so a denial reads the same
  whether the command ran on a Linux host or in a distro. `WslShellExecutor` and
  `WslFileSystem` advertise the mode through their `sandboxMode` capability fact,
  which brings back the Permissions selector and the denied→escalate flow
  (`danger-full-access` skips the wrap entirely). Enforcement is reported as
  **`partial`**, not `full`: a distro process can still execute a Windows binary
  through interop, which bubblewrap does not govern — measured, not assumed, by
  the probe below. Without `bubblewrap` in the distro the providers fail closed
  with `SANDBOX_UNAVAILABLE`; `sandbox: false` restores the old posture and
  removes the capability fact with it.
- Sandbox probes. `test/probe/sandbox.sh` (`npm run probe:sandbox`) needs no
  harness: it applies the exact profile arguments and asserts what bubblewrap
  governs — a write outside the workspace refused with EROFS, an ephemeral
  sandbox `/tmp`, a read-only `/mnt/c`, and the interop escape, recorded as
  `INFO` because a Linux sandbox cannot govern a Windows process.
  `test/probe/sandbox-shell.sh` (`npm run probe:sandbox-shell`) boots the
  throwaway profile with the executor mounted and drives the same three modes
  through `ctx.shell`, asserting the result's `denied`/`enforcement` facts.
- `WslSubprocessRuntime` (`ctx.subprocess`, subpath
  `dsh-plugin-wsl-env/subprocess`): the GUI's right-sidebar terminal window now
  opens a shell *inside the distro*, in the Session workspace, instead of
  `cmd.exe` in a UNC directory. It is a `LocalSubprocessRuntime` subclass whose
  only override is `spawnTerminal`, so every ordinary command, the host ripgrep
  search and every other subprocess consumer keeps the shipped implementation.
  The `wsl.exe` launch is rewritten to `wsl.exe -d <distro> --cd <linux dir>`,
  with the request's `DSH_*` facts forwarded through `WSLENV`, and the distro's
  own login shell is left to `wsl.exe` unless the provider pins one.
- Terminal probe (`test/probe/terminal.sh`, `npm run probe:terminal`): boots the
  throwaway Web profile with the provider in place, asks for the same
  `spawnTerminal` request the GUI makes, and asserts the distro, the translated
  initial directory, and the forwarded `DSH_SESSION_ID`.

- `WslShellExecutor` (`ctx.shell`): runs every command inside the distro as
  `wsl.exe -d <distro> --cd <linux dir> --exec <shell> -lc <cmd>`, where the
  shell is the distro user's login shell rather than a hardcoded bash. (§3, §12)
- `WslFileSystem` (`ctx.fs`): maps Linux paths onto the distro's UNC share so the
  host fs stack — including the packaged ripgrep — operates on real distro files,
  with Linux paths as the model-facing `displayPath` and the UNC path as the
  opaque `targetKey`. (§3)
- Symlinked paths resolve by asking the distro for `readlink -f` and retrying
  once, which is what makes `/etc/os-release`, `/bin` and `/lib` readable over a
  share that cannot traverse POSIX symlinks. (§10.4)
- `WslDirectoryPicker` (`ctx.directoryPicker`): lists Windows home and every
  installed distro at the root level, so the shipped GUI dialog becomes the
  single workspace picker for host and distro folders alike. It reports
  `kind: 'browse'` — a third kind would invalidate the three Remote verbs that
  require it. (§8)
- `auto-preset`: binds the `wsl` agent preset when a new session's workspace is
  inside a distro, inside the `ensureSession` frame so the very first mount is
  already correct and the host ACL sandbox never touches a 9p path. (§13, §15)
- `shell-env`: contributes `DSH_WSL_DISTRO`, `DSH_WSL_SHELL` and `DSH_WSL_HOME`
  to the managed `DSH_*` namespace, so the model can read the real environment
  instead of inferring it from a tool name. (§14)
- Behavioural probe harness under `test/probe/`, with two throwaway profiles and
  a negative-control run. (§16.5)
### Changed

- `WslFileSystem` fences its mutations by `ctx.sandboxPolicy`: `writeText` and
  `editText` check the policy before any I/O, re-resolve the target so the checked
  identity is the mutated one, refuse `read-only` and anything outside the
  writable roots with `FS_SANDBOX_DENIED`, and refuse nothing at all under
  `danger-full-access`. The writable roots are the workspace plus the temp area of
  the world that workspace lives in — a distro workspace grants the distro's
  `/tmp`, a Windows-folder workspace keeps upstream's `/tmp` + `os.tmpdir()`.
  `@deepseek-ai/dsh-sandbox` returns as a peer: the plugin imports the shared
  `canonicalPath`/`writableRoots` and the runner-failure/diagnostic classifiers
  rather than restating them.
- The README's "one constraint that shapes everything" section is gone: it said
  the plugin inherits `sandboxMode === undefined`, which is no longer true. The
  replacement states the mechanism (Linux bubblewrap inside the distro), the mode
  table, the `partial` enforcement and its interop cause, the `bubblewrap`
  requirement and the fail-closed behaviour.
- An empty `cwd` now means **the distro user's home** in both WSL providers,
  instead of the host path the shipped default resolves to. `WslFileSystem`'s
  default was `process.cwd()` — a Windows directory no `wsl.exe --cd` accepts —
  and `cordis.patch.yml` papered over it with the author's own `/home/andy`, a
  value that is wrong on every other machine. `WslShellExecutor.resolve()` keeps
  the seam's synchronous contract (`ctx.shell.execute(ctx.shell.resolve(…))` is
  called with no `await` in between) and marks the case with an empty `workdir`;
  `execute()` fills it from the distro's `$HOME`, one cached `wsl.exe` query per
  provider instance. Only relative input consults the base at all, so an
  absolute path never pays for the query, and `DSH_WSL_HOME` now takes the POSIX
  home directly (`linuxHomePath`) instead of converting the world path back. The
  `wslfs` probe follows: its profile no longer pins a `cwd`, and `fs-probe.mjs`
  resolves a relative name and asserts it lands under the home the distro itself
  reports — which is the only place that fallback was reachable at all, since the
  tool layer always passes an absolute Session directory.
- The package is now a DSH **bundle**, so installing it applies the layer instead
  of merely dropping code into a profile. `package.json` declares
  `dsh.bundle.patch` → `./cordis.patch.yml`, which is the declaration
  `dsh plugin --profile <name> add dsh-plugin-wsl-env` reads; `private: true` is
  gone (npm refuses to publish it otherwise), and `repository`/`homepage`/`bugs`
  now point at the GitHub repository. The package is plain JS with no
  dependencies, so a published install needs no `allowBuilds` permission and no
  build step. README's Install section follows: create the profile from the Web
  template, `dsh plugin … add`, then `--dump-config`.
- `cordis.patch.yml` is now only the plugin's own layer. The four machine-local
  rows it used to carry — `agent-default-model`, `ui-settings-account`,
  `ui-chat`, `ui-settings` — moved to
  [examples/profile.cordis.patch.yml](examples/profile.cordis.patch.yml), which
  documents what a reader's own `$DSH_HOME/profiles/<name>/cordis.patch.yml` is
  for and what a by-id row override looks like.
- The terminal is bound at the **composition** level, not in the `wsl` preset.
  `dsh-api-terminal-controller` resolves its execution world with
  `agent.ctx.get("subprocess")`, and an Agent's context is created by the agent
  loop under the root realm (`createScope(loopCtx, …)`, `loopCtx` = the
  root-mounted `ctx.agents`), while a preset's isolate realms belong to
  `dsh-agent-preset-registry`'s own context (`createScope(this.owner, …)`). A
  `subprocess` provider inside `preset-wsl` is therefore invisible to the
  terminal window — the registry's `agentPresets.serviceFor(agent, name)` is the
  sanctioned channel for that gap, and the controller does not use it.
  `cordis.patch.yml` consequently disables the shipped `subprocess` row and
  inserts this provider, and configures `terminal-controller` with
  `shell: { path: wsl.exe, name: WSL }` and `shellCandidates: []`.
- `@deepseek-ai/dsh-subprocess-local` is now a declared peer. A linked plugin's
  bare imports are routed through its `peerDependencies` by the runtime's
  resolution interception, so an undeclared peer is not merely untidy — the
  module fails to import with `failed to import`.
- The README is now **current state only**. The five sections describing designs
  that this one replaced — the per-process `DSH_WSL` switch and the three
  abandoned tool-naming routes — moved to
  [docs/archive/design-history.zh.md](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/docs/archive/design-history.zh.md), which
  keeps their original numbering and records where each conclusion lives now.
  The README renumbered accordingly; its §0.1 explains the split. The one part of
  the old desktop section that is still current (regenerating the generated
  `preset-wsl` block after an app upgrade) stayed, as §13.9.
- Static review: the manifest now says only what the shipped code does.
  - `main` pointed at `lib/index.js` while `exports["."]` resolved to
    `lib/shell.js`. Only the latter exposes a default export, so a tool that
    read `main` instead of `exports` got a module with no plugin in it.
  - `lib/index.js` re-exported path helpers that nothing could reach: the
    `exports` map does not expose `lib/index.js`, and the helpers already have
    their own `./paths` and `./wsl` subpaths.
  - Dropped an unused `ENV_OVERRIDES` import.
### Known limitations

- The sandbox does not govern WSL interop: a confined distro command can still
  execute a Windows binary from `/mnt/c`, and that process runs outside
  bubblewrap under the ordinary Windows token. Enforcement is therefore reported
  as `partial`, and `npm run probe:sandbox` re-measures the escape. Closing it
  would mean denying execution under `/mnt`, which breaks `/mnt/c/…` Sessions.
- `bubblewrap` must be installed in the distro, and both providers **fail
  closed** without it (`SANDBOX_UNAVAILABLE` rather than a silent unconfined
  run). `sandbox: false` is the documented opt-out. A `workspace-write` profile
  also refuses to bind a workspace root that does not exist, so a Session whose
  workspace directory was deleted reports a runner diagnostic instead of being
  recreated.
- The GUI terminal is an interactive shell and is not wrapped in the sandbox,
  exactly like the shipped terminal provider.
- The runtime mirror's destination lies outside every Session workspace, so the
  sync step of `npm run probe` (and of a manual `sync-to-windows.sh`) needs an
  approved `danger-full-access` escalation when an agent runs it.
- The terminal follows the composition, not the Session: a Session whose
  workspace is a Windows folder gets the same distro terminal, started in that
  folder as `/mnt/<drive>/…`.
- Terminal activity reporting stops at `wsl.exe`, so the controller's unattended
  idle reclamation never fires for these terminals; close the tab to release the
  process.

See the archived record's §7 for the full list, including the 9p
performance caveat, unsupported `watch()`, and the missing executable bit on
freshly created files.
### Removed

- `docs/README.zh.md` stopped being a README: the file moved to
  `docs/archive/engineering-record.zh.md` and left the package's `files` list, so
  npm and GitHub now render exactly one README. The reasoning is under Fixed
  below; nothing was deleted, only renamed out of the slot that made it look
  current.
- Three peer declarations this plugin neither imports nor injects:
  `@deepseek-ai/dsh-sandbox`, `@deepseek-ai/dsh-shell` and
  `@deepseek-ai/dsh-tools`. They were required by the abandoned tool-renaming
  designs (design-history §15/§18), which could only stub the sandbox symbols
  locally (design-history §15.5). The remaining set is checkable in one
  command — `grep -rho 'from "@deepseek-ai/[^"]*"' lib/ | sort -u` — plus
  `@deepseek-ai/dsh-subprocess` (the service `static inject` requires) and
  `@deepseek-ai/cordis`, which every DSH plugin declares.
  (`@deepseek-ai/dsh-sandbox` came back in this same release: the distro-side
  sandbox imports `canonicalPath`/`writableRoots` and the runner diagnostics, so
  the declaration is earned again rather than vestigial — and that same check is
  what surfaced it, by listing the package this entry had removed.)
### Fixed

- `lib/listing.js` built breadcrumbs with the platform-default
  `dirname`/`basename` from `node:path` rather than the `win32` flavour its own
  comments describe. On Linux — where the CI runners run, and where this
  checkout itself lives — a UNC path parses as a single opaque POSIX segment,
  so the ancestry chain collapsed to `['.', <whole path>]` and three
  `test/listing.test.mjs` checks failed. The helpers serve Windows paths only;
  they now call `win32.dirname`/`win32.basename` explicitly, and the suite
  passes on Linux again.

Documentation that a reader would have acted on, and that was no longer true:

- The repository briefly carried two READMEs. `docs/README.zh.md` called itself the
  current description of the plugin while its conclusions had been superseded
  three times over — most sharply by the sandbox work below — which is exactly
  the ambiguity a second README creates. It is now
  [docs/archive/engineering-record.zh.md](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/docs/archive/engineering-record.zh.md):
  the same content, renamed out of the README slot and banner-headed as history,
  with README.md the single statement of current state. Nothing was deleted from
  the record; §0.1 names the conclusions that are now historical.
- §2.1 and §3.4 of that record conclude that "any WSL plugin must run on a
  non-sandboxing provider" and that both providers report `sandboxMode:
  undefined` (§9's recorded self-check prints exactly that). The Windows ACL
  constraint in §2.1 holds and is unchanged; the *conclusion* it drew about our
  own confinement does not, because the sandbox now runs inside the distro — see
  the README's *Sandboxing* section.
- §9.4's three-step install ends with writing the plugin's rows into the profile's
  own `cordis.patch.yml` by hand. The package is a bundle now, so that step is
  gone (and the row set it describes has since gained the sandbox config); the
  current install is in README.md.
- §9.6 and §10.5 claimed the `wsl` and `wsltest` profiles were still available,
  and §13.6 said the same about `envweb`. All three are gone.
- The desktop section documented the superseded `build-desktop-patch.mjs`
  regeneration flow instead of `build-preset-wsl.mjs`.
- §15.5 answered "nothing to do after an app upgrade" while the desktop section
  said the generated preset copy has to be regenerated.
- References to `dsh-wsl-research/` now say it is a machine-local directory that
  is not part of the repository.

- `wsl.exe` was handed the command without `--exec`, so the distro's default
  shell expanded it once first: `$x`, `$?`, `$(...)`, `${...}` and backticks were
  silently eaten. (§11)
- The shell was hardcoded to bash, discarding the PATH and rc setup of a user
  whose login shell is zsh, fish or dash. (§12)
- Guarded creation (`createIfAbsent`) failed with `FS_IO_ERROR`, because the host
  backend publishes it with a hard link and the share rejects hard links with
  `ENOTSUP`; the guard is now checked by this backend and publication is a plain
  rename. (§2.2)
- The managed `DSH_*` namespace never reached the distro. WSL imports only the
  names listed in `WSLENV`, and the executor forwarded a fixed allowlist; it now
  forwards the whole prefix, and marks the two Windows-path facts `DSH_HOME` and
  `DSH_PROFILE_DIR` with `/p` so the distro sees `/mnt/c/...`. (§14.7)
- **Every write to an existing file, and therefore every edit, failed** with
  `EIO: GetFileSecurityW EIO (Win32 1)`. `dsh-fs-local` takes a Windows branch
  whenever the destination exists — to inherit the replaced file's DACL — and a
  9p share carries no Windows security descriptor. Publication now uses the POSIX
  path. (§16)
- Overwriting or editing a file silently dropped its POSIX mode, so editing a
  script made it non-executable: the share ignores a host-side `chmod`, and a
  host-side `stat` always reports 0666. The target's real mode is now copied onto
  the staged temp file inside the distro, where a rename preserves it. (§16.3)
