[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-107931":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":15,"stars30d":16,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":17,"rankGlobal":8,"rankLanguage":8,"license":8,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":18,"hasPages":18,"topics":20,"createdAt":8,"pushedAt":21,"updatedAt":22,"readmeContent":23,"aiSummary":24,"trendingCount":14,"starSnapshotCount":14,"syncStatus":25,"lastSyncTime":26,"discoverSource":27},107931,"dsh-layerfs","Ephemeral-AI-Lab\u002Fdsh-layerfs","Ephemeral-AI-Lab",null,"JavaScript",58,10,51,6,0,1,7,38.2,false,"main",[],"2026-11-23 14:56:53","2026-11-19 11:20:31","> **Status:** Current general guide, for LayerFS `main` at `fabefdf87a` (after v1.1.0, the #463 layer split and the #426 forced-unmount fix). Windows WSL2 support is part of v1.1.0.\n\n\u003Ch1 align=\"center\">\u003Cimg src=\"brand\u002Flogo.svg\" alt=\"LayerFS × DSH\" width=\"280\">\u003C\u002Fh1>\n\n\u003Cp align=\"center\">\u003Cstrong>Every agent gets its own Branch. You watch them all, live.\u003C\u002Fstrong>\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdeepseek-ai\u002Fdeepseek-harness\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fplugin%20for-DeepSeek%20Harness-7C3AED.svg\" alt=\"Plugin for DeepSeek Harness\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FEphemeral-AI-Lab\u002Flayerfs\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fbuilt%20on-LayerFS-A78BFA.svg\" alt=\"Built on LayerFS\">\u003C\u002Fa>\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fnode-%E2%89%A522.19-339933.svg?logo=node.js&amp;logoColor=white\" alt=\"Node 22.19 or newer\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FEphemeral-AI-Lab\u002Flayerfs\u002Fblob\u002Fmain\u002FLICENSE\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-blue.svg\" alt=\"MIT license\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Flayerfs.ai\u002Fdocs\u002Fintegrations\u002Fdsh\u002F\">\u003Cimg src=\"media\u002Flayerfs-dsh.gif\" alt=\"A recorded dsh run at 2× speed: the Work tab shows an agent's fs terminal and Workspaces, then the History tab grows as a lead and five agents commit, merge and publish\" width=\"860\">\u003C\u002Fa>\n  \u003Cbr>\u003Csub>A recorded run: a lead and five agents build one application on Branches of their own (2× speed). \u003Ca href=\"https:\u002F\u002Flayerfs.ai\u002Fdocs\u002Fintegrations\u002Fdsh\u002F\">Full video on layerfs.ai\u003C\u002Fa>\u003C\u002Fsub>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"#-install\">Install\u003C\u002Fa> ·\n  \u003Ca href=\"#-two-real-runs\">Two real runs\u003C\u002Fa> ·\n  \u003Ca href=\"#-your-first-session\">Your first session\u003C\u002Fa> ·\n  \u003Ca href=\"#-what-it-adds\">What it adds\u003C\u002Fa> ·\n  \u003Ca href=\"#-develop\">Develop\u003C\u002Fa> ·\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FEphemeral-AI-Lab\u002Flayerfs\">LayerFS\u003C\u002Fa>\n\u003C\u002Fp>\n\n\n`dsh-layerfs` is a plugin bundle for [DeepSeek Harness](https:\u002F\u002Fgithub.com\u002Fdeepseek-ai\u002Fdeepseek-harness) (dsh). It changes no dsh code.\n\nWith the bundle, agents in a dsh session work on a LayerFS project from bash, with the `layerfs` command: one LayerFS SDK call per command (or a short Node script on the SDK for many calls). They fork Branches, test them in Sandboxes, and merge and publish, and you watch every agent's Branch grow, live. The conversation gets **Work** and **History** tabs that draw what each agent did, subagents included. The design is in [#346](https:\u002F\u002Fgithub.com\u002FEphemeral-AI-Lab\u002Flayerfs\u002Fissues\u002F346). This repository is the LayerFS UI: it moved here from the layerfs repository's `dsh\u002F` folder at `cea713e767` ([#428](https:\u002F\u002Fgithub.com\u002FEphemeral-AI-Lab\u002Flayerfs\u002Fissues\u002F428)), and builds on a LayerFS checkout named by `LAYERFS_SOURCE` (see [Where LayerFS comes from](#where-layerfs-comes-from)).\n\n## 📦 Install\n\nThe quickest way is to let a coding agent do it. Paste this into one running on the machine where dsh web will run, in a folder holding clones of this repository and of LayerFS side by side:\n\n```text\nSet up LayerFS × DSH for me: the dsh-layerfs plugin bundle in DeepSeek Harness (dsh) web, on\nreal LayerFS.\n\n1. Read README.md in https:\u002F\u002Fgithub.com\u002FEphemeral-AI-Lab\u002Fdsh-layerfs, the \"Install\" section\n   and its \"Install step by step\" steps. It is the guide: follow its steps in order and for\n   this machine's OS (macOS, Linux, or Windows; Windows uses the WSL2 setup below).\n2. Check what it needs first: Node 22.19 or newer, pnpm, Docker (Docker Desktop on macOS),\n   network access, a LayerFS checkout (https:\u002F\u002Fgithub.com\u002FEphemeral-AI-Lab\u002Flayerfs) at the\n   commit in layerfs.json, beside this repository as ..\u002Flayerfs or named by LAYERFS_SOURCE,\n   and a built deepseek-harness checkout (https:\u002F\u002Fgithub.com\u002Fdeepseek-ai\u002Fdeepseek-harness)\n   beside this repository; if there is none, clone it there and run\n   pnpm install && pnpm run build in it. If something is missing that you cannot install,\n   stop and tell me which.\n3. Step 1, Install LayerFS: in the LayerFS checkout, build layerfs-daemon and the SDK's\n   native addon in the rust:1.85.1-bookworm image, gather them into the bundle folder, build\n   the runtime image and note its image ID.\n4. Step 2: in this repository, run pnpm install and pnpm run build, with LAYERFS_SOURCE set\n   to the LayerFS checkout and DSH_SOURCE to the deepseek-harness checkout (absolute paths).\n5. Step 3: make a fresh profile with its own DSH_HOME (not ~\u002F.dsh) and add only dsh-layerfs\n   with dsh's plugin command. Do not add dsh-layerfs-demo.\n6. Step 4: write layerfs-host's settings into the profile's cordis.patch.yml: the image ID,\n   plus the bundle folder on macOS or the daemon path on Linux.\n7. Step 5: start dsh web with that DSH_HOME and give me the printed\n   http:\u002F\u002F127.0.0.1:…\u002F?token=… link.\n8. Step 6: run pnpm test in this repository, and check that GET \u002Flayerfs\u002Fstatus reports no missing\n   settings.\n\nReport what you ran and what each step returned. A long cargo build may be run again until\nit prints Finished, as the guide says; if anything else fails, stop and give me the exact\nerror, and don't retry it on your own.\n```\n\nIt follows the six steps below and asks before anything it cannot do. Expect a few minutes for the first LayerFS build.\n\n\u003Ca id=\"-install-into-a-dsh-profile\">\u003C\u002Fa>\n\u003Cdetails>\n\u003Csummary>\u003Cb>Install step by step: six steps, without an agent\u003C\u002Fb>\u003C\u002Fsummary>\n\nThese steps take a fresh clone of this repository to LayerFS × DSH in dsh web: first LayerFS itself, then the dsh bundle. Only dsh web is supported. dsh desktop serves the same web client but was not tested. The headless profile composes no preset registry, so it offers no preset; the Host and the bash environment still load there.\n\n### You need\n\n| What | For | Notes |\n|---|---|---|\n| Node 22.19 or newer, and pnpm | everything | |\n| A LayerFS checkout at the pinned commit | the SDK, the agent skill, the Linux build | `..\u002Flayerfs` beside this repository, or `LAYERFS_SOURCE=\u003Cpath>`; the commit is in [`layerfs.json`](layerfs.json) |\n| A built deepseek-harness checkout | the client build and dsh itself | `..\u002Fdeepseek-harness` beside this repository, or `DSH_SOURCE=\u003Cpath>` for the build. In it, `pnpm install && pnpm run build` (its README) |\n| Docker | Live | Docker Desktop on macOS. It builds LayerFS and runs its Sandboxes |\n| Network access | step 1 | crates and the base images |\n\nBelow, `$DSH_LAYERFS` is this repository's absolute path, `$LAYERFS_SOURCE` the LayerFS checkout's and `$DSH` the deepseek-harness checkout's.\n\n### 1. Install LayerFS\n\nLive needs three things from the LayerFS checkout: the JavaScript SDK, a Linux build of the daemon and the SDK's native addon, and a runtime image. Nothing is published, so you build them there.\n\n**The SDK** is LayerFS #428's three packages in its `api\u002F` folder (`api\u002Fagent`, `api\u002Fbackend`, `api\u002Fruntime`): `@layerfs\u002Fagent` (what agents' scripts call), `@layerfs\u002Fbackend` (background processes, a Workspace's status, storage) and `@layerfs\u002Fruntime` (what the Host runs on a LayerFS home: the worker, Init, removal, status). They are plain JavaScript with no dependencies. Run `npm install` once in `$LAYERFS_SOURCE\u002Fapi` (it only links the three to each other); the Host links them as `link:..\u002F..\u002F.layerfs\u002Fapi\u002Fagent`, `…\u002Fapi\u002Fbackend` and `…\u002Fapi\u002Fruntime`, and step 2's `pnpm install` first points `.layerfs` at `$LAYERFS_SOURCE`, then makes those links. Only the native addon is built, and a fresh clone has none (`engine\u002Fcrates\u002Flayerfs-node\u002Flayerfs.node`). On macOS and Windows the Host never loads an addon itself: the home's worker runs the Linux build below. On Linux, see step 4.\n\n**The `layerfs` command** agents run (`DSH_LAYERFS_CLI`, the Host's wrapper `packages\u002Fhost\u002Fsrc\u002Fagent\u002Fcli.js`) runs the checkout's `api\u002Fcli\u002F` folder: one `@layerfs\u002Fagent` call per command, JSON on stdout ([api\u002Fdocs\u002Fagent.md](https:\u002F\u002Fgithub.com\u002FEphemeral-AI-Lab\u002Flayerfs\u002Fblob\u002Fmain\u002Fapi\u002Fdocs\u002Fagent.md#the-layerfs-command)). Run `npm --prefix \"$LAYERFS_SOURCE\u002Fapi\u002Fcli\" install` once: it only links `api\u002Fcli\u002Fnode_modules\u002F@layerfs\u002Fagent` to `api\u002Fagent` and downloads nothing. `pnpm install` and `pnpm test` stop with that command when it is missing.\n\n**The Linux build.** Build `layerfs-daemon` and the addon in the Rust 1.85.1 image, from the LayerFS checkout's root so Cargo picks up its [`.cargo\u002Fconfig.toml`](https:\u002F\u002Fgithub.com\u002FEphemeral-AI-Lab\u002Flayerfs\u002Fblob\u002Fmain\u002F.cargo\u002Fconfig.toml) (the ARM64 profile). This is the recipe of LayerFS's [benchmark\u002FAGENTS.md](https:\u002F\u002Fgithub.com\u002FEphemeral-AI-Lab\u002Flayerfs\u002Fblob\u002Fmain\u002Fbenchmark\u002FAGENTS.md#environment), with the crates fetched into a Docker volume instead of the host's `~\u002F.cargo\u002Fregistry`:\n\n```sh\ncd \"$LAYERFS_SOURCE\"\ndocker pull rust:1.85.1-bookworm\ndocker volume create layerfs-cargo && docker volume create layerfs-target\nmkdir -p target\u002Fcluster2-linux\ndocker run --rm -v \"$LAYERFS_SOURCE\":\u002Fwork:ro -v layerfs-cargo:\u002Fusr\u002Flocal\u002Fcargo\u002Fregistry -w \u002Fwork \\\n  rust:1.85.1-bookworm cargo fetch --manifest-path Cargo.toml --locked\ndocker run --rm -v \"$LAYERFS_SOURCE\":\u002Fwork:ro -v layerfs-target:\u002Fwork\u002Ftarget\u002Fcluster2-linux \\\n  -v layerfs-cargo:\u002Fusr\u002Flocal\u002Fcargo\u002Fregistry:ro -e CARGO_TARGET_DIR=\u002Fwork\u002Ftarget\u002Fcluster2-linux -w \u002Fwork \\\n  rust:1.85.1-bookworm cargo build --manifest-path Cargo.toml --offline --locked --release -j 6 \\\n  -p layerfs-node --lib -p layerfs-daemon --bins\n```\n\nThe fetch takes about 30 seconds; on an arm64 Mac with Docker limited to 8 CPUs a cold release build took about 2.5 minutes at `-j 2` and 65 seconds at `-j 6`. Agents keep every command under 2 minutes: put `timeout 110` before `cargo` inside the container (`… rust:1.85.1-bookworm timeout 110 cargo build …`; macOS has no `timeout` command) and run the same command again until it prints `Finished`, since Cargo keeps what it compiled.\n\nThen, still in `$LAYERFS_SOURCE`, gather the build into one folder, the `bundle` (any folder Docker Desktop shares, such as one under your home):\n\n```sh\nBUNDLE=$HOME\u002Flayerfs-linux-build\nmkdir -p \"$BUNDLE\u002Fapi\"\ndocker run --rm -v layerfs-target:\u002Ft:ro -v \"$BUNDLE\":\u002Fout rust:1.85.1-bookworm sh -c \\\n  \"cp \u002Ft\u002Frelease\u002Flayerfs-daemon \u002Fout\u002F && cp \u002Ft\u002Frelease\u002Fliblayerfs_node.so \u002Fout\u002Flayerfs.node && chown $(id -u):$(id -g) \u002Fout\u002Flayerfs-daemon \u002Fout\u002Flayerfs.node\"\ncp -R api\u002Fpackage.json api\u002Fbackend api\u002Fruntime \"$BUNDLE\u002Fapi\u002F\"\ncp -R api\u002Fagent \"$BUNDLE\u002Fapi\u002F\"\n```\n\nThat folder serves Linux (`daemon` and `LAYERFS_NATIVE`). **macOS and Windows need a sealed bundle**: the home's worker runs the bundle's `api\u002Fruntime\u002Fsrc\u002Fworker\u002Fserver.js` and checks every file against its `manifest.json` before it listens, which only the tool below writes.\n\nInstead, LayerFS's [`tools\u002Fworktree.py`](https:\u002F\u002Fgithub.com\u002FEphemeral-AI-Lab\u002Flayerfs\u002Fblob\u002Fmain\u002Ftools\u002Fworktree.py) ([parallel worktrees](https:\u002F\u002Fgithub.com\u002FEphemeral-AI-Lab\u002Flayerfs\u002Fblob\u002Fmain\u002Fdocs\u002Fgeneral\u002Fparallel-worktrees.md)), run in `$LAYERFS_SOURCE`, does the same with per-checkout caches, and seals the folder with a `manifest.json`. It needs the runtime image below to exist first, and was not tried for this guide:\n\n```sh\npython3 tools\u002Fworktree.py register --worktree \"$LAYERFS_SOURCE\" --owner dsh \\\n  --build-image rust:1.85.1-bookworm --runtime-image layerfs-352-runtime:node24 --sandbox-image layerfs-352-runtime:node24\npython3 tools\u002Fworktree.py prepare --resources \u003Cprinted resources.json> --platform linux\npython3 tools\u002Fworktree.py build --resources \u003Cprinted resources.json> --platform linux --profile release --jobs 6\n```\n\n`build` prints the sealed folder, `~\u002F.cache\u002Flayerfs-worktrees\u002F\u003Cid>\u002Fartifacts\u002Fbuild-linux-\u003Chash>`, which serves as `bundle`.\n\n**The runtime image** is the Linux image Sandboxes and the macOS worker run. The worker runs `node` from it, so it must carry Node, plus whatever your agents' commands run in Workspaces. The one in use is built from [`tools\u002Fruntime\u002FDockerfile`](tools\u002Fruntime\u002FDockerfile): Node 24.21 on Debian bookworm (the daemon's own base), with corepack's pnpm and yarn prepared offline, and the base's git, python3, gcc and make.\n\n```sh\ndocker build -t layerfs-352-runtime:node24 \"$DSH_LAYERFS\u002Ftools\u002Fruntime\"\ndocker image inspect --format '{{.Id}}' layerfs-352-runtime:node24     # the image setting\n```\n\nUse the ID your machine prints: the same build can get a different ID in another image store. Images are never pulled for LayerFS (the worker starts with `--pull never`).\n\n### 2. Build the dsh bundle\n\n```sh\ncd \"$DSH_LAYERFS\"\nLAYERFS_SOURCE=\"$LAYERFS_SOURCE\" pnpm install\npnpm run build\n```\n\n`pnpm install` first runs [`tools\u002Flayerfs-source.mjs`](tools\u002Flayerfs-source.mjs), which points the `.layerfs` link at `LAYERFS_SOURCE` (default `..\u002Flayerfs`) and prints whether that checkout is at the pinned commit; see [Where LayerFS comes from](#where-layerfs-comes-from).\n\n`pnpm run build` bundles the client into `packages\u002Fclient\u002Flib\u002F` with the checkout's `tsdown`: `$DSH_SOURCE\u002Fnode_modules\u002F.bin\u002Ftsdown`, else `..\u002Fdeepseek-harness` beside the repository. Prefer an absolute `DSH_SOURCE` path (`DSH_SOURCE=\"$DSH\" pnpm run build`). Relative paths resolve from `packages\u002Fclient\u002F`, matching the original build command; an empty value uses the default checkout. The launcher passes the resolved absolute path to the client config. If the checkout or its tsdown CLI is missing, the build stops with `tsdown: No such file or directory`. Run it again after changing the client.\n\n### 3. Make a profile\n\nChoose a `DSH_HOME` of your own, so your usual `~\u002F.dsh` is not touched, and use its `web` profile. dsh's `plugin` command makes the profile from the shipped `web` template on first use, installs the packages there with pnpm, and adds each one that is a bundle to the profile's `dsh.profile.bundles`:\n\n```sh\nexport DSH_HOME=$HOME\u002Fdsh-layerfs        # any empty folder\npnpm --dir \"$DSH\" dsh plugin --profile web add \"link:$DSH_LAYERFS\u002Fpackages\u002Fdsh-layerfs\"\n```\n\nInstall `dsh-layerfs` only. The demo bundle `dsh-layerfs-demo` is disabled permanently and is not in this repository. The bundle includes the LayerFS scripted model, switched off; see [Scripted runs](#scripted-runs).\n\nThe profile is `$DSH_HOME\u002Fprofiles\u002Fweb\u002F`. Its `package.json` should now read:\n\n```json\n\"dependencies\": {\n  \"dsh-layerfs\": \"link:…\u002Fdsh-layerfs\u002Fpackages\u002Fdsh-layerfs\"\n},\n\"dsh\": { \"profile\": { \"bundles\": [\"@deepseek-ai\u002Fdsh-base\", \"@deepseek-ai\u002Fdsh-web-app\", \"dsh-layerfs\"] } }\n```\n\nMaking the profile by hand is the same: that `package.json`, then `pnpm install` in the profile folder. Keep the `pnpm-workspace.yaml` dsh writes there (`nodeLinker: hoisted`), so the bundle shares dsh's own packages.\n\n### 4. Configure Live\n\nThe Host reads its deployment settings from `layerfs-host` in the profile's `cordis.patch.yml` ([`config.js`](packages\u002Fhost\u002Fsrc\u002Fconfig.js)). dsh writes that file as `[]`; replace the `[]` with the entry list below.\n\n| Setting | Linux | macOS |\n|---|---|---|\n| `image` | required | required |\n| `daemon` | required | defaults to `\u003Cbundle>\u002Flayerfs-daemon` |\n| `bundle` | not used | required |\n| `docker` | `\u002Fvar\u002Frun\u002Fdocker.sock` by default | the same |\n| `volumes` | `\u002Fvar\u002Flib\u002Fdocker\u002Fvolumes` by default (Docker's data-root); the Host's user must write it | not used |\n| `home`, `traceDir` | `\u003COS temp>\u002Fdsh-layerfs\u002F{home,traces}` by default | the same |\n| `containerPrefix` | `layerfs-` by default: Sandboxes `\u003Cprefix>\u003Cproject>-\u003Cn>` | the same, and the worker `\u003Cprefix>worker` |\n| `stateDir` | `\u003Cprofile>\u002Fdsh-layerfs` by default (bindings, agent names, journals) | the same |\n\nAn Init without the required settings is refused with \"LayerFS is not configured: set … for layerfs-host in the profile patch\"; `GET \u002Flayerfs\u002Fstatus` lists what is `missing`.\n\n```yaml\n# $DSH_HOME\u002Fprofiles\u002Fweb\u002Fcordis.patch.yml\n- id: layerfs-host\n  config:\n    image: \"sha256:\u003C64 hex>\"                   # step 1's image ID\n    bundle: \u002FUsers\u002F\u003Cyou>\u002Flayerfs-build          # macOS: step 1's sealed bundle (manifest.json)\n    # daemon: \u002Fpath\u002Fto\u002Flayerfs-daemon           # Linux\n```\n\n**On macOS** the Mac runs no Store call itself. `@layerfs\u002Fruntime` runs one long-lived Linux container per LayerFS home, the worker (`\u003CcontainerPrefix>worker`, `layerfs-worker` by default, labelled `layerfs.role=worker`), and every Store call of the Host and of agents' scripts runs there with the sealed bundle's `layerfs.node`; its endpoint is `\u003Chome>\u002Fworker\u002Fendpoint.json`, and agents get it as `DSH_LAYERFS_WORKER_ENDPOINT`. The Host starts it when it starts; a worker of another build is replaced, so load a new `bundle` only while no dsh run is live. It runs with `--restart unless-stopped`. A call of the Host or an agent that finds it down keeps its own error, and the Host asks the runtime to start it again.\n\n**On Linux** the Host and agents' scripts load `@layerfs\u002Fagent` in their own process, from `api\u002Fagent` in the LayerFS checkout (through `.layerfs`). It loads the addon from `LAYERFS_NATIVE`, or else `engine\u002Fcrates\u002Flayerfs-node\u002Flayerfs.node`: build it on that machine with `npm --prefix \"$LAYERFS_SOURCE\u002Fapi\" run build:native` ([SDK README](https:\u002F\u002Fgithub.com\u002FEphemeral-AI-Lab\u002Flayerfs\u002Fblob\u002Fmain\u002Fapi\u002FREADME.md#builds-and-compatibility); it needs Cargo 1.85.1 on the host), or set `LAYERFS_NATIVE` in dsh web's environment to a Linux build's `layerfs.node`. `daemon` is that build's `layerfs-daemon`. The Store must be on a local Linux filesystem (ext4, xfs or btrfs). Init installs the Store straight into the new project's volume directory under Docker's volumes directory (`volumes`, `\u002Fvar\u002Flib\u002Fdocker\u002Fvolumes` by default), which Docker keeps root-only, so run dsh web as a user that can write it, such as root, and give it a `home` that user owns; otherwise the runtime fails the Init (`Unsupported`) before it makes a volume.\n\n\u003Ca id=\"windows-live\">\u003C\u002Fa>\n\n**On Windows** dsh web and the default profile remain on Windows. `@layerfs\u002Fruntime`\nstarts one long-lived Node worker in a selected WSL2 distribution, owned by the\nHost through its stdin. That distribution needs its own running\nDocker Engine, `\u002Fdev\u002Ffuse`, Node 22.19 or newer, and a **sealed Linux bundle** from\n`tools\u002Fworktree.py build` (run the build inside WSL, using the private resources\ndescribed above). Docker Desktop's Windows named pipe is not used by this adapter.\n\nInstall and build the plugin on Windows with steps 2–3. You can add it to your\nexisting default `web` profile; omit the example's `DSH_HOME` override to do so.\nKeep that profile's existing patch entries and add:\n\n```yaml\n- id: layerfs-host\n  config:\n    image: \"sha256:\u003Cexact image ID from the WSL Docker Engine>\"\n    bundle: \u002Fhome\u002F\u003Clinux-user>\u002Flayerfs-build   # sealed Linux bundle, including manifest.json\n    wslDistribution: Ubuntu\n    # wslUser: root                          # default; must access Docker and its Store volumes\n    # wslNode: \u002Fusr\u002Flocal\u002Fbin\u002Fnode             # default; absolute Linux executable path\n    # wslHome: \u002Fvar\u002Flib\u002Fdsh-layerfs-windows\u002Fmy-profile\n    containerPrefix: layerfs-windows-\n```\n\n`daemon` defaults to `\u003Cbundle>\u002Flayerfs-daemon`. `bundle`, `daemon`, `wslNode`, and\n`wslHome` are Linux paths in that distribution. `home`, `traceDir`, and `stateDir`\nremain Windows paths. The default Linux home is a persistent directory under\n`\u002Fvar\u002Flib\u002Fdsh-layerfs-windows`, derived from the Windows home. Stores live in the\nWSL Docker Engine's named volumes on its local Linux filesystem. Never put the\nStore or Linux discovery home on `\u002Fmnt\u002Fc` or another Windows-backed mount.\n\nThe Windows SDK entry preserves the regular SDK API for Host clients and agents.\nIt forwards native calls to the worker; the product SDK and daemon are unchanged.\nImports translate drive paths with that distribution's `wslpath`; WSL UNC paths\nmust name the selected distribution. Init reads everything through the Linux\nfilesystem view, including `.git` and ignored files. Windows ACLs are not converted\nto POSIX metadata; imported metadata is what WSL exposes.\n\nThe worker validates the sealed bundle's file hashes, listens only on Linux\nloopback, and requires a random secret delivered over its startup pipe. Its\nWindows endpoint file is ACL-restricted to the current Windows user and SYSTEM.\nThe Windows SDK source must match the sealed Linux SDK (allowing Git line-ending\nnormalization). Windows binding-file readers share the writers' short admission\nlock so reads cannot overlap atomic file replacement; failed writes are not retried.\nEach project's native Store stays open while used and closes after a quiet minute.\nProject removal explicitly releases its cached Store before deleting the volume.\nDisposal drains admitted calls without killing mounted commands. Runtime Start\nand confirmed Restart act on this worker; a silent or busy worker is retained.\nChanging WSL deployment settings requires restarting dsh.\n\nThe Host adds its Windows `layerfs.cmd` launcher to dsh's PATH. In a\nLayerFS-bound session, PowerShell and Command Prompt accept the same CLI\ncommands as macOS, for example `layerfs project list_branches`. The launcher\nuses the session's `DSH_LAYERFS_CLI` wrapper and preserves stdin and exit codes.\nShell syntax still follows the selected shell: PowerShell uses `$env:NAME`,\nnot Bash's `$NAME`, and Bash heredocs are not PowerShell commands.\n\nSDK scenarios launch native Node scripts from the Scenarios workspace on\nWindows. CLI scenarios use a native runner for their limited command notation:\nquoted arguments, variables, substitutions, literal heredoc input, JSON field\nselection and tee. Each LayerFS operation invokes the real CLI wrapper; commands\ninside Linux Workspaces run unchanged. This runner is specific to scripted tests,\nnot a Bash shell for arbitrary agent commands. Linux fixture files check out with\nLF even when Windows Git uses `core.autocrlf=true`.\nThe dedicated `layerfs-scenarios` preset disables promotion of timed-out\nforeground commands to background jobs. Windows scripted calls have a 120-second\ndsh deadline; a 110-second watchdog attempts earlier cancellation. Captured CLI\ninput\u002Foutput uses temporary files because restricted Windows tokens deny Node\nnamed pipes. Explicit background steps keep their normal job ownership.\nShipped scenarios use the configured Host image. The runtime Dockerfile includes\nRust 1.85.1, SQLite development headers and Chromium\u002FSelenium for Depot, alongside\nNode and the prepared package managers. Rebuild the image and configure its exact\nimage ID when upgrading from the earlier Node-only image.\nEvery scenario run creates a fresh project and retains earlier projects until\nexplicit cleanup. Adapter or child failures immediately mark the run failed.\n`pnpm run test:scenarios` checks loading, launchers, fixtures and failure reporting;\n`node packages\u002Fhost\u002Ftests\u002Fwindows-cli.mjs` checks the Windows CLI launcher.\n\nFor later Windows upgrades, keep the Windows checkout and WSL sealed bundle at\nthe same `layerfs.json` pin, rebuild the runtime image when its Dockerfile changes,\nand run `check:layerfs`, `test:windows` and `test:scenarios` with a 120-second wall\nlimit before live verification. A Cargo download timeout is a network failure:\ncheck registry access from the configured Sandbox image. This machine's optional\n[proxy deployment](docs\u002Fwindows-live-20261024\u002Fdeployment\u002FREADME.md) records its\nnetwork prerequisites; its addresses are not Windows defaults. WSL, Docker and\nany configured upstream proxy must be available before starting a run.\n\nA request lost before it is sent is `Failed`; a sent request whose reply is lost\nis `Unknown` and is never replayed. Failed Windows Init attempts retain their\nvolume and Linux discovery state, with the original failure and volume recorded\nin `windows-init-failures.jsonl` under `stateDir`. Inspect that evidence before\ndeciding how to recover. The macOS container adapter and Windows WSL adapter\nshare the worker codec, but keep separate deployment and lifecycle code.\n\nThe codec is versioned JSON with explicit binary values, independent of V8\nserialization versions. Upgrade the Host and worker together, with no active\ncalls; old V8 workers are incompatible and must be restarted. A protocol\nfailure is reported explicitly and never replays a call. An uncertain Init reply\nalso retains the macOS home and volume, recorded in `init-failures.jsonl` under\n`stateDir`, so protocol errors cannot trigger deletion of a completed Init.\n\nThis setup uses the repository pnpm workspace and a dsh source checkout. Packaged\ndsh desktop and npm\u002Fplugin-market installation are not qualified\n([#406](https:\u002F\u002Fgithub.com\u002FEphemeral-AI-Lab\u002Flayerfs\u002Fissues\u002F406)). Docker Desktop\nvolume visibility from a WSL Linux host is a separate unsupported topology;\nsee [#380](https:\u002F\u002Fgithub.com\u002FEphemeral-AI-Lab\u002Flayerfs\u002Fissues\u002F380).\n\nFrom the dsh checkout, restart your normal Windows `dsh web` server, keeping its\nusual port (for example `--port 3080`). `GET \u002Flayerfs\u002Fstatus` should report an empty\n`missing` list. The LayerFS runtime page reports both the WSL worker and its Docker\nEngine. This does not require running a second dsh server in WSL.\nThe [verification record](docs\u002Fwindows-live-verification-20261022.md) pins the\ntested source, native bundle, outcomes and platform gaps.\n\n**Running two dsh webs on one machine.** The default `home` and `traceDir` are the same for every profile, so two dsh webs would share projects and the worker. Give each its own pair under the OS temp area, and its own `containerPrefix`, since container names are per Docker engine (a worker of another home is refused, never taken over):\n\n```yaml\n    home: \u002Fprivate\u002Fvar\u002Ffolders\u002F…\u002FT\u002Fdsh-layerfs-\u003Cname>\u002Fhome        # node -p \"require('fs').realpathSync(require('os').tmpdir())\"\n    traceDir: \u002Fprivate\u002Fvar\u002Ffolders\u002F…\u002FT\u002Fdsh-layerfs-\u003Cname>\u002Ftraces\n    containerPrefix: \u003Cname>-\n```\n\nKeep both in the OS temp area. Bash calls in Workspace Write mode run in dsh's sandbox, which lets them write only there, and a LayerFS call writes both (a mount elsewhere fails `PermissionDenied`).\n\n### 5. Start dsh web\n\n```sh\nDSH_HOME=$HOME\u002Fdsh-layerfs pnpm --dir \"$DSH\" dsh web --no-open --port 3090\n```\n\nOpen the printed `http:\u002F\u002F127.0.0.1:3090\u002F?token=…` link. Run the preset's sessions in Workspace Write mode; subagents inherit it. Agents use dsh's own model, which needs dsh's sign-in or keys, as usual. A fresh `DSH_HOME` has neither: sign in from the page's account menu.\n\nWhat you see ([TUTORIAL.md](TUTORIAL.md) walks through a first run with pictures):\n- A fresh `DSH_HOME` has no workspace. **Add workspace** (the sidebar's folder button, or the new session's workspace chip) picks one; the preset and project chips appear once a workspace is chosen. On macOS, dsh web's folder picker is the system's folder panel, which opens in front of the browser, not in the page.\n- **LayerFS × DSH minimalist** is the default preset of a new session. A preset picked in dsh's settings still wins.\n- The New Session row has a **project chip** beside the preset chip. Its menu lists every project (the workspace folder's first) and \"No LayerFS\", with **New empty project** (a random name, such as calm-otter) and **Import project…** below. Import opens the same folder picker and imports the folder as a new project, which becomes the workspace folder's default; importing the same folder again gives `name-1`, `name-2`, …. Both make Live projects. Picking a project switches a blank session to the minimalist preset.\n- A session on a project has two more tabs beside Chat and Trajectory: **Work** (the agents' terminals, Branches and Sandboxes) and **History** (File, History, Storage and Sandboxes: the project's Sandboxes tab, as on the LayerFS page).\n- The sidebar's **LayerFS** page shows one project at a time: its Files, History, Storage and Sandboxes, a New session action, and Refresh and Remove. Its **All projects · Sandboxes** tab is the switcher. Under a health strip (Docker, Store calls, free disk on the host and in Docker, the last sweep of stopped Sandboxes) it has a card per project with a running Sandbox or a problem, each Sandbox with its scratch (what it wrote outside its Workspaces), a list of the idle projects with their Store volume's size, and leftovers: stopped containers and Store volumes no project uses. Every figure comes from `@layerfs\u002Fruntime` (`status`, `sandbox.list`, `volume.list`); the Host runs no Docker command itself.\n\n### 6. Check\n\n```sh\ncd \"$DSH_LAYERFS\" && pnpm test\nnode tools\u002Fcheck-session.mjs 'http:\u002F\u002F127.0.0.1:3090\u002F?token=…' \u003Csession id>\n```\n\n`pnpm test` runs the Host, scripted model, model and playback tests, with LayerFS stubbed; it starts no Docker container or daemon. `check-session.mjs` checks that a finished session's tabs draw what LayerFS reports. The page's URL does not carry the session id: a session is the folder `$DSH_HOME\u002Fsessions\u002F\u003Cworkspace>\u002Fsession-\u003Cuuid>`, whose name is the id.\n\n\u003C\u002Fdetails>\n\n## 🏁 Two real runs\n\nOn 2026-10-20, one dsh main agent and seven worker subagents on `deepseek-flash` took an empty LayerFS project to a published, verified `main`, twice: a small app in under an hour and a hard one in an afternoon. Every change went through the SDK as Branches, Commits, merges and publishes.\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Ctd width=\"50%\" valign=\"top\">\u003Ca href=\"demo\u002Fwayfare\u002FREADME.md\">\u003Cimg src=\"demo\u002Fwayfare\u002Fassets\u002Fhistory-sideways.png\" alt=\"Wayfare's History at the end of the run: main at L12 after 147 Commits\">\u003C\u002Fa>\u003C\u002Ftd>\n    \u003Ctd width=\"50%\" valign=\"top\">\u003Ca href=\"demo\u002Fquarry\u002FREADME.md\">\u003Cimg src=\"demo\u002Fquarry\u002Fassets\u002Fwork-store-stats.png\" alt=\"Quarry's storage at the end of the run: 8.90 GB on disk for 4.93 TB of history\">\u003C\u002Fa>\u003C\u002Ftd>\n  \u003C\u002Ftr>\n  \u003Ctr>\n    \u003Ctd valign=\"top\">\u003Cb>\u003Ca href=\"demo\u002Fwayfare\u002FREADME.md\">Wayfare\u003C\u002Fa>\u003C\u002Fb>: a collaborative trip planner in Node 24, with no third-party dependencies.\u003C\u002Ftd>\n    \u003Ctd valign=\"top\">\u003Cb>\u003Ca href=\"demo\u002Fquarry\u002FREADME.md\">Quarry\u003C\u002Fa>\u003C\u002Fb>: a SQL database in Rust, checked row by row against SQLite, with every build's \u003Ccode>target\u002F\u003C\u002Fcode> committed.\u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n| | Wayfare | Quarry |\n|---|---|---|\n| Time | 56 min, 8 agents | 4 h 16 min, 8 agents |\n| History | 147 Commits, 31 Branches, 13 Layers | 913 Commits, 56 Branches, 9 Layers |\n| Checks | 334\u002F334 tests, A01–A12 pass | 891 tests, 800\u002F800 sqllogictest, Q01–Q12 pass |\n| Store | 1.21 MB on disk for 91.5 MB of snapshots, 27× dedupe | 8.90 GB on disk for 4.93 TB of snapshots, 166× dedupe: less than one copy of `main` (13.5 GB) |\n\nEach record has the task, the spec, the system prompt, the progress ledger, the published build report and every number above. The screenshots are from the end of each run, taken with an earlier version of the tab, before it split into Work and History.\n\n## 🚀 Your first session\n\n[TUTORIAL.md](TUTORIAL.md) walks through a first run step by step, with 19 screenshots: an import, two subagents on Branches of their own, a merge and a publish.\n\n**1. Start a session on a project.** In dsh web, start a new session. Its row has the preset chip, which reads **LayerFS × DSH minimalist**, and beside it the **project chip**. Open the project chip and pick **New empty project**, or **Import project…** to choose a folder and import it as a new project; a card under the chip shows the import's progress. The session's project is fixed at its first bash call that uses it.\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Ctd width=\"50%\" valign=\"top\">\u003Cimg src=\"media\u002Ffirst-project-menu.jpg\" alt=\"The project chip's menu: every project, No LayerFS, New empty project and Import project…\">\u003Cbr>\u003Csub>The project chip's menu.\u003C\u002Fsub>\u003C\u002Ftd>\n    \u003Ctd width=\"50%\" valign=\"top\">\u003Cimg src=\"media\u002Ffirst-importing.jpg\" alt=\"The project chip reads Importing tutorial-site…, with a progress card under it\">\u003Cbr>\u003Csub>An import in progress.\u003C\u002Fsub>\u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n**2. Switch to Workspace Write.** Set the session's mode to **Workspace Write**. Bash calls then run in dsh's sandbox, which lets LayerFS write its home and traces; subagents inherit the mode.\n\n**3. Give it a task.** The preset already knows the SDK and its rules, so ask for work as you would any agent. Work that splits across subagents shows the most. For example:\n\n```text\nBuild a small two-page website in this project: a home page and an about page that link to\neach other, plus a check script (node check.mjs) that fails if either page is missing or a\nlink is broken.\n\nGive each page to its own subagent, each on its own Branch forked from main. Each subagent\nruns node check.mjs in a Workspace before it commits. When both are done, merge their\nBranches into one, fix any Conflict, run the check once more, and publish to main.\n```\n\n**4. Watch the Work tab.** **Work** sits beside Chat and Trajectory. Its chips are `main` and the Branches. On `main` you see the Store's size and the project terminal, which prints every Branch call (fork, merge, publish) with the agent that made it. A Branch's chip shows its `fs` terminal, the Store reads and writes on that Branch, and one pane per Workspace mounted on it, with the commands run there. Calls appear in step with the run, and **Follow** keeps up with the newest.\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Ctd width=\"50%\" valign=\"top\">\u003Cimg src=\"media\u002Fwork-main.webp\" alt=\"The Work tab on main: storage, 7.51 MB on disk for 2.57 GB of history, the Branches list, and the project terminal\">\u003Cbr>\u003Csub>\u003Ccode>main\u003C\u002Fcode>: the Store's size and the project terminal.\u003C\u002Fsub>\u003C\u002Ftd>\n    \u003Ctd width=\"50%\" valign=\"top\">\u003Cimg src=\"media\u002Fwork-branch.webp\" alt=\"The Work tab on a Branch: the fs terminal with one Commit per apply, and two agents' Workspace panes\">\u003Cbr>\u003Csub>A Branch: its \u003Ccode>fs\u003C\u002Fcode> terminal and each agent's Workspace.\u003C\u002Fsub>\u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n**5. Watch History grow.** **History** draws every Branch and Commit, which agent made it, and the Layers on `main`, one per publish. It grows as the agents work; **Play** replays it from the start. **File** shows the files at any point and **Storage** what the Store holds.\n\n\u003Cp align=\"center\">\u003Cimg src=\"media\u002Fhistory.webp\" alt=\"The History tab: main with Layers L6 to L10, and agents' Branches forking, committing and merging around it\" width=\"860\">\u003Cbr>\u003Csub>History: 110 Commits on a dozen Branches, \u003Ccode>main\u003C\u002Fcode> at L10.\u003C\u002Fsub>\u003C\u002Fp>\n\n**6. Come back to it later.** The sidebar's **LayerFS** page shows one project at a time: where `main` is and what was published last, Files beside File, History, Storage and Sandboxes (click a History node to see the files at that point), **New session** to start another session on the project, and, in its ⋯ menu, **Remove project…**, which asks for the project's name first. Its **All projects · Sandboxes** tab is the switcher: the health strip, a card per project that runs a Sandbox, the idle projects, and leftovers.\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Ctd width=\"50%\" valign=\"top\">\u003Cimg src=\"media\u002Ffirst-layerfs-page.jpg\" alt=\"The LayerFS page for tutorial-site: main's files beside its History, two subagent Branches merged and published as L1\">\u003Cbr>\u003Csub>A project: \u003Ccode>main\u003C\u002Fcode>'s files and its History.\u003C\u002Fsub>\u003C\u002Ftd>\n    \u003Ctd width=\"50%\" valign=\"top\">\u003Cimg src=\"media\u002Ffirst-all-projects.jpg\" alt=\"All projects · Sandboxes: Docker, Store calls and free disk, then a card per project\">\u003Cbr>\u003Csub>All projects · Sandboxes.\u003C\u002Fsub>\u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n## ✨ What it adds\n\n| Piece | Package | Where it shows |\n|---|---|---|\n| Host plugin `layerfs-host` | `@dsh-layerfs\u002Fhost` | bash environment, session records, the `\u002Flayerfs` web route |\n| Client plugin `layerfs-client` | `@dsh-layerfs\u002Fclient` | Work and History tabs, project chip, LayerFS page (dsh web) |\n| Agent preset `layerfs-dsh-minimalist` | `dsh-layerfs` (`presets\u002F`) | \"LayerFS × DSH minimalist\" in the preset menu |\n| LayerFS scripted model `layerfs-mock` (on by default) | `@dsh-layerfs\u002Fmock` | \"LayerFS scripted model · …\" models, the LayerFS page's Tests tab, the Run bar |\n| View model | `@dsh-layerfs\u002Fmodel` | used by the client and the Host |\n| Renderer | `@dsh-layerfs\u002Fview` | used by the client |\n\n### Scripted runs\n\nThe LayerFS scripted model plays scripted agent runs through the real dsh agent loop and tools, without a language model, to test and show the LayerFS UI ([dsh-layerfs#1](https:\u002F\u002Fgithub.com\u002FEphemeral-AI-Lab\u002Fdsh-layerfs\u002Fissues\u002F1)). It ships in the bundle switched on, with this checkout's `scenarios\u002F`; turn `@dsh-layerfs\u002Fmock` off on dsh's Plugins page to hide it. Off, nothing of it shows. A run picks its scenario's model on its own Session; dsh would save that pick as the default model for new Sessions, so the plugin keeps scripted models off the default and every other folder keeps your own.\n\n- **Scenarios** live in [`scenarios\u002F`](scenarios\u002F), one folder each with a `scenario.json` (loader and full format: [`packages\u002Fmock\u002Fsrc\u002Fscenario.js`](packages\u002Fmock\u002Fsrc\u002Fscenario.js)). Every step is one tool call of the minimalist preset (bash, subagent, send_message, the job tools) or a reply, written as an agent would type it. A scenario has one form, its first tag: in a `cli` scenario every bash step is plain `layerfs …` lines; in an `sdk` one every bash step is one inline Node script on the SDK. Half the scenarios are each: `cli` for shop, crew, parallel, checkpoints and conflicts; `sdk` for depot, tour, sandbox, agents and merge. A step that runs commands creates its own Sandbox, mounts one Workspace, runs, commits, unmounts and closes the Sandbox.\n- **Placeholders.** `{{scenario}}` (the folder's absolute path, written in double quotes) and `{{image}}` (the scenario's runtime image) are filled when it loads. `{{sandbox}}` and `{{commit:\u003Cref>}}` are filled when the scripted model sends the step, from what that agent has seen: the last Sandbox number, and the Commit id a step with `commits: [\u003Cref>]` printed or a received message carried. A Commit id reaches another agent in a `send_message`.\n- **Checked while it runs.** A bash step's `expect` lists the LayerFS outcome codes its trace lines must show (`workspace.exec:exit:0`, `workspace.commit:Committed|UpToDate`, `workspace.commit:Conflict`), and `exit` its exit status (default 0). Before the agent's next step the scripted model reads the call's trace lines from the Host (its `layerfsTraces` service) and stops the run at the first mismatch. Commands carry no assertions of their own.\n- **Tags** (`cli`\u002F`sdk`; `node`\u002F`rust` where real builds run; one to three of `conflicts`, `merge`, `publish`, `multi-agent`, `background`, `sandbox`) show as chips on the Tests tab, which filters by them; the loader refuses an unknown tag and also counts each scenario's agents, steps and the LayerFS calls its `expect` checks.\n- **Replays** (`shop`, `depot`, `crew`) are recorded runs of real agents (layerfs #334, #337, #340) in this format: recorded writes are applied from `changes\u002F` and recorded commands run again in Workspaces. [`tools\u002Freplay\u002Fconvert.mjs`](tools\u002Freplay\u002Fconvert.mjs) generates each folder from the recording at layerfs `0c7d9c47c1^`; rerun it rather than editing by hand, and see each folder's `CONVERSION.md` for what it kept and dropped. Their fixture is the recorded `seed.json` (it holds a `.git\u002FHEAD`, which cannot live here as a file); the plugin writes it out to `\u003Cprofile>\u002Fdsh-layerfs-mock\u002Fseeds\u002F\u003Cscenario>\u002F` when it loads.\n- **Checking a folder**: `node tools\u002Freplay\u002Fcheck.mjs \u003Cscenario>` loads it and parses every command (`bash -n`, or `node --check` for an SDK script) without running it.\n- **Checking a finished run**: `node tools\u002Fchecks\u002Frun.mjs \u003Cprofile dir> \u003Croot session id>` (the profile is `\u003Cdsh home>\u002Fprofiles\u002Fweb`) loads the scenario the run played, reads the Host's trace lines for the root and its subagents, and checks the run's state and every `expect`. A recorded `final.json` beside the scenario is reported as not checked: the order and final-tree checks ([`tools\u002Fchecks\u002F`](tools\u002Fchecks\u002F)) need a LayerFS client on the project.\n- **The Tests tab** on the LayerFS page lists every scenario with its latest run. Run all queues every scenario and runs up to 2 at once; each row has Run or Stop. A failed run shows why and keeps its project; Clean up removes the scenario projects no run is using.\n- **The Run bar** sits above a run's composer: Stop or Run again, and \"Step n of m · phase\" with a thin bar.\n- **Each run** gets a new Session in the Scenarios workspace (`\u003Cprofile>\u002Fdsh-layerfs-mock\u002FScenarios`) and its own project, `mock-\u003Cscenario>`, removed and Inited again from the scenario's fixture. A run fails on a failed step (a bash exit other than the step's, or trace lines without its `expect`), a Stop, or after 15 minutes; nothing is retried. The latest run per scenario is kept in `\u003Cprofile>\u002Fdsh-layerfs-mock\u002Fruns.json`.\n\nThe Work and History tabs and the LayerFS page are the only LayerFS UI. The standalone HTML pages that used to live in the root `sdk_sim\u002F` (the terminal UI page and its design preview) and their live server are removed; do not build or revive a standalone HTML or TUI page. The simulator (Mocked LayerFS) is removed too. What remains of [`sim\u002F`](sim\u002F) is drawing code: `simulation_engine\u002Fmodel.js` (the views' state shape and `lineDiff`) and `files.js` (the Files tab's helpers), which the client imports, and the avatars (`avatars\u002F`).\n\n## ⚙️ How it works\n\ndsh session (agents, subagents, bash) → `layerfs-host` (bash environment, records) → `layerfs` command or LayerFS JS SDK scripts → Store and Sandboxes.\n\nA bash call in a session bound to a project gets the project, the SDK and a trace file per agent (`DSH_LAYERFS_*`). Each finished SDK call becomes a `plugin:layerfs\u002Fcall` record in the calling agent's own session, and the client plugin reads those records back to draw the tabs. On Linux, the Host and the agents' scripts open the Store in their own process. On Windows, Store calls run in the authenticated WSL worker, whose Docker Engine owns the Sandbox volumes. On macOS the Mac runs no Store call itself: `@layerfs\u002Fruntime` runs one long-lived Linux container, `layerfs-worker`, and every Store call runs there. An agent creates a Sandbox (`layerfs sandbox create`) and names it in every mount; a Sandbox holds up to 16 Workspaces and closes itself two minutes after its last Workspace is unmounted.\n\n## 📖 Reference\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>🔌 Host plugin: bash environment, records, projects, the \u002Flayerfs route\u003C\u002Fb>\u003C\u002Fsummary>\n\n- **Bash environment.** A bash call in a session bound to a project gets:\n  - `DSH_LAYERFS_PROJECT` and the deployment settings;\n  - `DSH_LAYERFS_SDK` and `DSH_LAYERFS_BACKEND` (file URLs of the Host's wrappers of `@layerfs\u002Fagent` and `@layerfs\u002Fbackend`, `packages\u002Fhost\u002Fsrc\u002Fagent\u002Fsdk.js` and `backend.js`), `DSH_LAYERFS_CLI` (the wrapper `agent\u002Fcli.js` of the checkout's `api\u002Fcli\u002Fsrc\u002Flayerfs.js`, which the `layerfs` shim on PATH, `packages\u002Fhost\u002Fsrc\u002Fbin\u002Flayerfs`, runs) and `DSH_LAYERFS_SKILL`;\n  - on macOS and Windows, `DSH_LAYERFS_WORKER_ENDPOINT`;\n  - a trace file per agent (`DSH_LAYERFS_TRACE`) and the bash call id as the trace step.\n\n  LayerFS reads only its own `LAYERFS_*` names, and dsh lets a plugin set only `DSH_*` names in a bash call. Each wrapper therefore loads `packages\u002Fhost\u002Fsrc\u002Fagent\u002Fenv.js` first, which sets every unset `LAYERFS_\u003CNAME>` from `DSH_LAYERFS_\u003CNAME>` in the agent's process, then exposes LayerFS's own entry unchanged (the same exports; the same arguments, output and exit codes for the CLI). A `LAYERFS_\u003CNAME>` already set is kept.\n- **Records.** Each finished SDK call becomes a `plugin:layerfs\u002Fcall` record in the calling agent's own session. The root session gets one `plugin:layerfs\u002Fproject` record.\n- **Journal.** Finished lines are also journaled per root session under the state folder, because trace files live in temporary storage.\n- **Projects.** Each project is attached to at most one workspace folder, or detached; a folder can have several. Init imports a source folder (the workspace folder unless another is chosen) and attaches the new project to the workspace folder. A session uses the folder's only (or last used) project unless it picks another or none. The choice is fixed at the first bash call that uses it.\n- **Agent names.** Subagents are named by the label their parent gave them.\n- **Web route.** `\u002Flayerfs` sits behind dsh's own connection checks:\n\n  | Request | Answer |\n  |---|---|\n  | `GET \u002Flayerfs\u002Fstatus` | configuration |\n  | `GET \u002Flayerfs\u002Fworkspace?folder=` | a folder's projects |\n  | `POST \u002Flayerfs\u002Finit {folder, source?, name?, timeout?}` | check the request and start Init; answers its job at once. `timeout`: the Init's limit in ms (a positive whole number; omitted, LayerFS's 300 s); refused `invalid-timeout` (400) otherwise |\n  | `GET \u002Flayerfs\u002Finit\u002F\u003Cjob>` | the Init's step (`scan`, `volume`, `import`, `done` or `failed`), the source's file and byte counts, then its project or error |\n  | `GET \u002Flayerfs\u002Fsession\u002F\u003Cid>` | project, agents and trace lines of the session's root |\n  | `POST \u002Flayerfs\u002Fsession\u002F\u003Cid>\u002Fproject {project}` | choose a project, or `null` for none |\n  | `GET \u002Flayerfs\u002Fsession\u002F\u003Cid>\u002Fstate` | the project as `runtime.project.get_state` reports it |\n  | `GET \u002Flayerfs\u002Fsession\u002F\u003Cid>\u002Ftree?ref=\u003Csaved id>` | a Commit's or Layer's files |\n  | `GET \u002Flayerfs\u002Fprojects` | every project and the workspace folder it is attached to |\n  | `GET \u002Flayerfs\u002Fproject\u002F\u003Cname>\u002Fstate` | the project as `runtime.project.get_state` reports it, plus who made each node and when Layers and forks happened, from the journals |\n  | `GET \u002Flayerfs\u002Fproject\u002F\u003Cname>\u002Ftree?ref=\u003Csaved id>` | as the session's tree route |\n  | `POST \u002Flayerfs\u002Fproject\u002F\u003Cname>\u002Fattach {folder}` | attach to a workspace folder, or `null` to detach |\n  | `POST \u002Flayerfs\u002Fproject\u002F\u003Cname>\u002Fremove {confirm}` | remove the project; `confirm` must repeat its name |\n\n  Init is the runtime's (`runtime.project.start_init`): it counts the source (every entry, links not followed, as LayerFS reads it), then makes the volume, then runs LayerFS Init (in the WSL worker on Windows, or a container of its own on macOS), which scans, imports and installs the Store into the volume in one process; it starts no Sandbox. The Host reads the runtime's job every 250 ms (`get_init`: step, counts, and LayerFS's own counts while it imports as `imported`), then binds the project to the folder. The page reads the job every 300 ms and fills the bar from those counts over the Host's totals: scan 0–15%, files 15–95% (bytes plus 4 KB per file), then tree, publish and seal.\n\n  Removal (`runtime.project.remove`) deletes the project's Sandbox containers, Docker volume and LayerFS home entry, and the Host drops it from the bindings; sessions on it become unbound. It is refused while any container still uses the volume. Workspace files and transcripts stay. A LayerFS project is its home entry, so a removed name can be initialized again at once.\n\n  The Host reads each project (state and trees) through one shared client (`LayerFS.open`, with `LayerFSBackend` beside it), released after a quiet minute. Reading starts no Sandbox: history comes from the project's Store (in the home's worker on macOS and Windows), and Workspaces only from Sandboxes already running, so a project nobody works on shows its history with no container. The Host keeps each project's last History with its Store version (the eight most recently read): the next read asks the Store whether it changed (`get_history(since)`) and, if not, answers the kept one without listing a Commit; a changed History lists only the Commits it has not seen. The page keeps the History it read too, so the Work and History tabs, and switching between them, draw it at once and replace it only when the Host's `?since=` check says it changed. LayerFS places agents' Workspaces in the project's numbered Sandboxes, `layerfs-\u003Cproject>-\u003Cn>`, 16 to a Sandbox; each Sandbox closes itself two minutes after its last Workspace is unmounted, and the tab then draws it closed.\n\n  The Files pane reads only what is on screen, one SDK call each ([`reads.js`](packages\u002Fhost\u002Fsrc\u002Freads.js)): a folder a page of up to 1,000 names at a time, a file a window of at most 2,000 lines or 48 KiB. A read costs the same in a small project and a huge one. `node_modules`, `.git` and `.next` start collapsed.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>🖥️ Client plugin: Work and History tabs, project chip, LayerFS page\u003C\u002Fb>\u003C\u002Fsummary>\n\n- **The Work and History tabs** (beside Chat and Trajectory) replay the root session's lines while one is shown:\n  - Work: the project terminal with agent tags, the Branches and Sandboxes, and the agents' avatars;\n  - History: File, History, Storage and the project's Sandboxes.\n\n  An unbound session shows Setup: pick one of the folder's projects, or Init.\n\n  **Playback.** The tab plays calls in step with the run, for real and scripted agents alike ([`playback.ts`](packages\u002Fclient\u002Fsrc\u002Fclient\u002Fplayback.ts)):\n  - each call shows 2 s after it ended, so the gaps on screen are the run's own gaps and the tab never falls behind. The 2 s are longer than the Host poll (1.5 s), so a call is usually here before its time;\n  - calls whose time has passed (the tab opened, a rebuild when an agent is named, a late poll) appear at once, drawn once. Nothing plays twice;\n  - a bash call that mounts, runs, commits and unmounts a Workspace within a second shows each step at its time, and the Workspace's pane then fades out over 1.2 s (\"unmounted\"), a trail kept by the view only ([`view.js`](packages\u002Fview\u002Fsrc\u002Fview.js)).\n\n  **Terminals and their command lines.** Every SDK call an agent makes prints one command line in one terminal. The single table for both is [`packages\u002Fmodel\u002Fsrc\u002Fcli.js`](packages\u002Fmodel\u002Fsrc\u002Fcli.js); `node packages\u002Fmodel\u002Ftests\u002Fcli.mjs` fails when an SDK or operator method has no row there.\n\n  | Terminal | Prints | Calls |\n  | --- | --- | --- |\n  | project (one per project) | the project and its Branches | `project.*`, `branch.*`, and a mount that failed (it has no pane); an older trace's `sandbox.create` and `sandbox.close` |\n  | fs (one per Branch) | Store reads and writes on that Branch | `fs.*` |\n  | workspace (one pane per mounted Workspace) | the Workspace's life and the commands run in it | `workspace.mount`, `workspace.exec`, `workspace.commit`, `workspace.unmount`, the backend's `daemon.workspace.status` and `daemon.process.start` and `.cancel` (an older trace's `sandbox.*` and `operator.process.*` forms too) |\n  | none | the client's own calls and reads | `project.list_sandboxes`, `sandbox.list_workspaces`, the backend's other calls, an older trace's operator reads |\n\n  A command line is `\u003Cgroup> \u003Cmethod> \u003Crequired args> [--optional value] [-m \"message\"]`, using the SDK's own group and method names: `branch merge feature try-ui release -m \"join\"`, `fs read \u002Fapp\u002Fpage.tsx --start-line 5`, `workspace commit -m \"add hero\" --force`.\n  - Required arguments are positional, in SDK order. Optional ones are `--kebab-case` flags shown only when they differ from the SDK default; a true boolean is a bare flag (`--force`, `--discard`).\n  - An image is shortened to `sha256:` and 12 hex digits. File content is never printed, and `fs apply` shows its change count.\n  - A line does not repeat what its terminal names. The fs terminal hides the `fs` group and the Branch (`read \u002Fapp\u002Fpage.tsx`); a workspace pane hides the `workspace` group, the Sandbox and the path (`commit -m \"add hero\"`, `unmount --discard`), but keeps the operator's `process cancel`. The project terminal prints every group. `fs diff_files` prints both of its refs.\n  - A command run in a Workspace prints as the shell command itself, and a background start ends with ` &`.\n  - Reads (`list_*`, `diff_*`, `fs read\u002Flist\u002Fstat\u002Fgrep\u002Fglob\u002Fblame\u002Fdiff_files`, `workspace status`) and `workspace mount` are dimmed.\n  - A call with no row prints its own name, dimmed, in the project terminal.\n\n  The composer is hidden while the tab shows; switch to Chat to send a message.\n- **The project chip** sits in the New Session row beside the preset chip, drawn like dsh's own chips. Its menu lists the folder's projects and \"No LayerFS\", with \"Import project…\" pinned below. Like \"Add workspace…\", Import opens the directory picker (Finder in dsh web on a Mac); the chosen folder becomes a new project attached to the workspace folder and is chosen for the session. While it imports, a card under the chip shows the percentage, the step with its counts (\"Importing 12,000 of 30,000 files · 40 MB of 90 MB\") and the elapsed time over a bar. The bar moves without a fraction while the Host counts the source; the Init dialog shows the same.\n- **The LayerFS page** (sidebar) has one tab per project. Each shows:\n  - ellen_joe, with a line on where `main` is and what was published last;\n  - the workspace the project is attached to, which you can change or detach (a session already on the project keeps it);\n  - History and Files side by side, where clicking a History node shows Files at that point;\n  - \"New LayerFS session\" in the attached workspace, on the preset;\n  - \"Remove project…\", which asks for the project's name before removing it.\n\n  Workspaces without a project offer Init.\n- **The Init dialog** (Setup and the page) imports the workspace folder by default. \"Choose folder…\" browses for another source: in the page where dsh offers it, otherwise with the native picker. The project is attached to the workspace folder either way. The name is optional and defaults to the source folder's.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>🎛️ Preset\u003C\u002Fb>\u003C\u002Fsummary>\n\nThe preset has bash with background jobs, subagents (spawn) with their control tools, and compaction. It has no read, write or edit tools. Its persona carries:\n- an SDK cheat-sheet with a stdin script template;\n- the working rules: one Workspace per agent, merge conflicts belong to whoever merged, only the main agent publishes, run again on `Busy`, unmount every Workspace.\n\nRun the preset's sessions in Workspace Write mode; subagents inherit it.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cb>🧪 Known limits\u003C\u002Fb>\u003C\u002Fsummary>\n\n- `demo-workspace` is inside this repository. A turn's \"Edited\" card lists every change made in the repository during the turn, including other work in the checkout.\n\n\u003C\u002Fdetails>\n\n## ⚠️ Limits\n\n- Only dsh web is checked. dsh desktop serves the same web client but was not tested; the headless profile has no preset registry, so the preset is not offered there.\n- A session's project is fixed at its first bash call that uses it.\n- Sessions run in Workspace Write mode. Windows defaults agent traces to\n  `\u003Cworkspace>\u002F.dsh-layerfs-traces`, because its restricted shell can write\n  the workspace and its private temp directory, but not the server’s temp\n  directory. The Host retains each trace path across restarts. An explicit\n  `traceDir` must be writable by the agents. Other platforms keep the default\n  traces in the OS temp area.\n- Everything else follows LayerFS's platform limits: Store calls need Linux and a local ext4, xfs or btrfs filesystem, which on macOS the worker's container provides.\n- Windows Live uses WSL2 and its Linux Docker Engine through the Windows adapter;\n  native Windows Store execution remains unsupported. Sim's local `\u002Fbin\u002Fsh`\n  executor is not ported to Windows. macOS execution was not rerun for this change.\n\n## 🧰 Develop\n\n| Command | Does |\n|---|---|\n| `pnpm test` | Host, scripted model, model, playback and checks tests, with LayerFS stubbed; under 10 seconds |\n| `pnpm run link:layerfs` | points `.layerfs` at `LAYERFS_SOURCE` (default `..\u002Flayerfs`) |\n| `pnpm run check:layerfs` | fails unless `LAYERFS_SOURCE` (default `..\u002Flayerfs`) is a LayerFS checkout at the commit in `layerfs.json` |\n| `pnpm run build` | the client bundle, with deepseek-harness's tsdown (`DSH_SOURCE`) |\n| `node tools\u002Fcheck-session.mjs '\u003Cdsh web URL with ?token=…>' \u003Csession id>` | checks that a session's tab draws what LayerFS reports: Branches, heads, `main`, Sandboxes, which agent made each Commit and Layer, and bash-call groups |\n\n`assets\u002F` holds unlicensed character art and is never committed. `lib\u002F` is build output.\n\n### Where LayerFS comes from\n\nNothing of LayerFS is published yet, so this repository builds on a LayerFS checkout ([#428 §8](https:\u002F\u002Fgithub.com\u002FEphemeral-AI-Lab\u002Flayerfs\u002Fblob\u002Fmain\u002Fcore\u002Fdocs\u002Fissues\u002F428\u002FREADME.md#8-versions-and-distribution)):\n\n- **`LAYERFS_SOURCE`** names it: a path, relative to this repository's root or absolute. Unset, it is `..\u002Flayerfs` beside this repository.\n- **[`layerfs.json`](layerfs.json)** pins it: the default path and the LayerFS commit this repository was moved and tested at.\n- **`.layerfs`** (git-ignored) is a link to it. `pnpm install` and `pnpm test` make the link first ([`tools\u002Flayerfs-source.mjs`](tools\u002Flayerfs-source.mjs)); after changing `LAYERFS_SOURCE`, run `pnpm run link:layerfs` (pnpm skips its install step when nothing else changed). Everything reads LayerFS through the link: the Host's `@layerfs\u002Fagent`, `@layerfs\u002Fbackend` and `@layerfs\u002Fruntime` are `.layerfs\u002Fapi\u002Fagent`, `.layerfs\u002Fapi\u002Fbackend` and `.layerfs\u002Fapi\u002Fruntime`, the agent skill is `.layerfs\u002F.agents\u002Fskills\u002Flayerfs-js-sdk\u002F`, and the model's CLI test loads the agent and backend from there.\n- **The Linux build and the runtime image** (step 1) are built from the same checkout, so the SDK, `layerfs.node` and `layerfs-daemon` match.\n\nThe pin is LayerFS `main` at [`fabefdf87a`](https:\u002F\u002Fgithub.com\u002FEphemeral-AI-Lab\u002Flayerfs\u002Fcommit\u002Ffabefdf87a) (the #481 merge), after [v1.1.0](https:\u002F\u002Fgithub.com\u002FEphemeral-AI-Lab\u002Flayerfs\u002Freleases\u002Ftag\u002Fv1.1.0) and the #463 layer split (LayerFS's Rust moved to `engine\u002F`, the packages to `api\u002Fagent`, `api\u002Fcli`, `api\u002Fbackend` and `api\u002Fruntime`). Check out that commit in `..\u002Flayerfs`, or set `LAYERFS_SOURCE` to a checkout of it.\n\n### What stayed in the layerfs repository\n\nThe demo bundle (disabled permanently, owner 2026-10-21), the demo tools (`demo.mjs`, `check-demo.mjs`, `check-scenario.mjs`), `init-project.mjs`, and the #352 history replay harness (`tools\u002Fhistory\u002F`, `run-scenario`, `restore-store`, `import-run`) stayed in the layerfs repository; it measures LayerFS builds, not the plugin. They are in its history at `cea713e767`, under `dsh\u002F`.\n","dsh-layerfs 是一个为 DeepSeek Harness（DSH）设计的插件，用于在多智能体协作开发中集成 LayerFS 分层文件系统。它通过 `layerfs` 命令为每个 AI 代理提供独立分支（Branch），支持分支创建、沙箱测试、合并与发布，并实时可视化各代理的操作历史与工作空间。项目基于 LayerFS SDK 构建，不修改 DSH 源码，依赖 Node.js ≥22.19，原生支持 WSL2。适用于 AI 编程助手协同构建软件、可追溯的多代理代码演进、以及需分支隔离与操作审计的研发场景。",2,"2026-11-24 04:32:59","CREATED_QUERY"]