Windows process-tree reconciler for the DSH host: samples the host process tree and the job ledger, attributes each process to the job that created it, flags unattributed and orphaned processes with a confidence level, and offers guarded termination of a whole tree. Termination is refused unless the target belongs to the DSH host tree, is re-sampled and re-checked immediately before the kill (creation time included), and contains no protected descendant, so an allowlisted PID cannot widen the kill scope.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-treekeeper
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:xswt442-cmd/dsh-treekeeper
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
A Windows-focused DSH process-tree reconciliation and governance plugin. It puts the current host process tree beside the available task ledger, attributes each process to the job that created it, surfaces unattributed and orphaned processes, and provides guarded tree termination.
Features
- Sample the current DSH host process tree; other children of the launcher are never attributed to it.
- Attribute each process to the job that created it, and detect duplicate command lines, orphaned processes and long-running plugin children.
- Reconcile the job ledger with the root session's subagent descendant tree; the descendant tree of any other session is never read.
- Guarded tree termination (
taskkill /T /F); the conditions are listed in the termination-guard table under "Safety and limits". - Identify the plugin a process belongs to from the
node_modulespath in its command line, and keep finding and termination history. - The DSH host descendants section is collapsed by default, with its count on the heading.
- The panel header shows the host kind, taken from the host process's executable path and command line; the process environment is not part of the decision.
- The desktop application's own Electron processes are listed as one group inside the unattributed section, and each member keeps its command line, pid, memory and age.
- A finding carries one of three confidence tiers:
exact, confirmed by attribution into the host process tree and eligible for a tree kill;indicative, where the process fact is real and the attribution link is softer or missing (a degraded sample, or a survivor left by a previous host);inferred, produced by a heuristic rule alone and never eligible. - The
dsh-mini-utility-docklauncher at the bottom-left opens the global panel, a session header opens it focused on that session, and a sidebar Session row shows the cached facts for that session.
Install
# install from npm and register with the web profile (recommended)
dsh plugin --profile web add dsh-treekeeper
# install the npm package only
npm install dsh-treekeeper
# or install from GitHub
dsh plugin --profile web add github:xswt442-cmd/dsh-treekeeper
npm installinstalls the package only and does not register a DSH profile.- Restart DSH Web after installation.
Session scope
The subagent section has three states:
| State | Meaning |
|---|---|
available |
Shows the root session's complete descendant tree |
root-required |
No root session is available |
unavailable |
The current DSH build does not expose subagents |
The session-header entry takes the row's sessionId as the root session, and the global panel entry takes the currently selected session.
Once the panel has loaded a snapshot, the facts attributable to a specific session enter a client-side cache:
| Cached fact | Attribution source |
|---|---|
| Descendant count, running count, read-issue count | The response's subagentRoot and its descendant rows |
| Running job count | The ledger row's ownerSession |
| Finding count | The ownership.session filled by the ledger join |
The host process list, unattributed processes, and jobs without an owner session cannot be attributed to a session and are not cached.
A sidebar Session row reads that cache: an idle row's leading cell shows a glyph and its hover card shows a one-line summary with "View this session in TreeKeeper". With no cached fact for that session the leading cell stays empty while the hover card's action still works, and neither issues a host read.
Configuration
Configuration is process-local and resets on restart.
| Field | Default | Range | Purpose |
|---|---|---|---|
pollMs |
0 |
0 (sample on request) or 2000–600000 ms |
Background sampling interval |
allowKill |
true |
Boolean | Enables guarded process-tree termination |
extraWhitelistPids |
[] |
Array of PIDs | Additional protected PIDs |
Safety and limits
| Item | Limit |
|---|---|
| Platform | Windows only |
| Non-Windows | Reports unsupported_platform |
| Sampling degradation | If CIM is unavailable, sampling degrades to read-only and attribution and termination are disabled |
| Browser credential | On DSH 0.1.0-rc.7+, the browser API reuses the Connection signed cookie |
| Admission when the host has a Connection | Decided by the Connection's Host/Origin fence plus the signed cookie |
| Admission when the host has no Connection | Decided by this plugin's guard: TCP peer address, Fetch Metadata, Origin, and loopback Host |
| Mutating actions | POST-only |
| Remote reach | On a host configured with trustedHosts and listening on 0.0.0.0, a remote peer holding a valid browser session reaches the API, kill included |
| Admission narrowing | This plugin does not narrow the host's Connection admission, and the kill guards below apply there as well |
| Traversal cancellation | Closing the panel, superseding a refresh, or disconnecting the HTTP request cancels an in-flight subagent descendant traversal |
Kill guards:
| Guard | Rule |
|---|---|
| Arming | The first click arms the button for 6 seconds |
| Confirmation | The second click opens the browser confirmation dialog |
| Snapshot | Requires a complete snapshot no older than 15 seconds |
| Identity check | The PID creation time is compared with the snapshot on entry |
| Recheck before the kill | A fresh sample is taken and the creation time is compared again |
| Attribution | Only processes whose attribution root is the DSH host may be terminated, and unattributed processes are investigation-only |
| Never terminable | Critical system processes, the current host, its launcher chain, and extraWhitelistPids |
| Whitelist | An extra whitelisted PID is an attribution root for investigation, and its descendants are visible but not terminable |
| Protected descendants | If the tree sampled immediately before the kill contains any protected PID, the whole operation is refused |
A protected descendant that appears after that sample cannot be excluded.
- Jobs have no stable PID mapping to OS processes.
- Command-line matches are investigative and never trigger automatic action.
- Findings and termination results are written to
$DSH_HOME/treekeeper/history.jsonl.
Development
Run before committing:
npm test
npm run docs:check
npm pack --dry-run
License
Links
More in this category
yjh051108/dsh-routing-suite★ 7021
One repository, three parts: a runtime injector for DSH plugin packages (inject, hot-reload, unload, promote a dev staging tool to the front, route self-heal, plus a settings-page plugin manager that lists, unloads and drags folders in to internalize), a task-aware reasoning-mode router agent preset (router-standard / router-spec / router-react), and a graded two-level task protocol whose six tools (commit_star, lock_stage, revise_do, edit_plan, mark_task, redteam_verdict) pin task state to disk. The injector implementation ships in-tree, so the install carries its own behaviour rather than a dependency list.
strukto-ai/mirage#dsh★ 3682
Swaps the filesystem and bash providers for a mirage virtual workspace: file tools and shell commands run over mounted resources (RAM, S3, Redis, Slack, Gmail, Notion, Postgres) instead of the host disk, with per-mount read/write/exec modes, per-command sandbox routing (monty, pyodide, quickjs in process; docker, e2b, daytona remote), and installed CLIs (git, gh, slack, linear, ntn, gws, or one you register) as head words in the virtual terminal.
hust-open-atom-club/oh-dsh★ 322
Community distribution: TUI, desktop, and Web UI as one bundle with layered installation.
weijiafu14/pi2dsh★ 213
Pi Host ABI compatibility engine: after one install, unmodified Pi extensions from npm mount as native DSH plugins with `dsh plugin add <pi-package>`. Verified end to end on stock DSH with pi-mcp-adapter (full MCP manager: OAuth, resources, prompts, MCP Apps, elicitation, sampling), @tintinweb/pi-subagents, pi-code, pi-hermes-memory and pi-background-tasks; `pi2dsh inspect` reports a package's compatibility before installing.
Fishquito7/dsh-skill-mcp-panel★ 197
Manages DSH skills and MCP servers from the web settings: skill cards with hot enable/disable, workspace scopes, groups, batch migration and drag-and-drop import, plus stdio/HTTP MCP CRUD with connection tests, secret redaction and the unified dsh-panel CLI.
lire1131/dsh-undo-savepoint★ 181
Undo/redo & rollback system for DSH: every config change is auto-snapshotted; undo/redo/restore to any version from the WebUI or the offline CLI/GUI tools (works even when DSH fails to boot).
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.