Registers a janitor_scan tool that returns a deterministic, reviewable cleanup plan for session debris (plan docs, scratch scripts) with per-file verdicts and evidence; scan-only, never deletes.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-janitor
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:zhengqiuyang/dsh-janitor
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
dsh-janitor
Artifact lifecycle — scans session debris, returns a reviewable cleanup plan; the janitor is never an agent
dsh plugin --profile default add dsh-janitor
If this helps you, please give it a star — it helps others find it.
Part of the DSH trust layer — ten deterministic checks, no LLM in the trust path.
Deterministic artifact lifecycle for DeepSeek Harness (dsh).
Agent sessions leave debris: plan docs from finished tasks, scratch scripts,
one-off fixtures. People fear agent-driven cleanup precisely because cleanup
driven by an agent is unaccountable. This plugin registers a janitor_scan
tool that runs the agent-janitor
engine over the workspace and returns a reviewable cleanup plan — every
candidate file with a deterministic verdict (protected / keep / recent /
needs-review / safe-to-remove) and the evidence behind it.
The janitor is never an agent. The scan and verdicts are pure deterministic rules (reference analysis, git metadata, age thresholds); v0.1 never deletes anything — applying a reviewed plan stays with the upstream CLI or with you, on purpose.
Family: read-guard (what agents read) · pr-gate (what they write) · attest (what they did) · mcp-test (what they can call) · janitor (what they leave behind).
Why now (checked 2026-10-12)
Nothing in the dsh ecosystem does deterministic workspace hygiene. The
@goodandready/dsh-time-machine plugin does checkpoints and rollback
(snapshot safety), which is complementary: it answers "can I undo?", this
answers "what is safe to remove?". Deterministic scan → reviewable plan →
apply as a three-step, non-agent pipeline is unowned.
Verdicts (fixed order, first match wins)
| verdict | meaning |
|---|---|
protected |
exact file or directory prefix in the protected list |
keep |
referenced by any code file |
recent |
younger than minAgeDays (git commit time preferred) |
needs-review |
referenced by docs/other, or otherwise ambiguous |
safe-to-remove |
plan doc with task merged & zero refs, or zero refs + old enough |
Install
dsh plugin --profile default add dsh-janitor
From npm — no build step, no allowBuilds authorization; git installs are equally prebuilt (lib/ ships in the repo).
Configure
- id: dsh-janitor
name: dsh-janitor
config:
minAgeDays: 14
protectedPaths: ["plans", "docs/decisions"] # exact file or directory prefix
Compatibility
- DSH: verified against the 0.2.x line (source snapshot 0.2.1-alpha.2); installs on any profile via
dsh plugin add(prebuiltlib/, no build approval). - Node: >= 20 (CI matrix: Node 20/22/24 on Ubuntu and Windows).
- Disposable-profile evidence (2026-10-19):
dsh plugin --profile <fresh> add github:zhengqiuyang/dsh-janitor→ installed in 30s; boot shows[dsh-janitor] active: …;dsh plugin --profile <fresh> remove dsh-janitor→ dependencies cleared, bundles restored.
Develop
npm install
npm test # syncs the vendored agent-janitor engine, builds, runs fixture tests
The scan/verdict engine is vendored from the sibling agent-janitor
checkout (npm run sync; CI runs sync --check).
Roadmap
janitor_applywith an explicit per-path confirmation protocol (still deterministic — no agent judgment in the loop)- Session-debris presets (
.dsh-*ledgers, scratch plugins dirs) - Plan archive integration with the upstream CLI's
apply
Kill criteria
If dsh ships first-party workspace hygiene, or time-machine-style plugins add deterministic removal planning, this freezes at its last working version with a postmortem here. The engine stays owned by agent-janitor either way.
Links
More in this category
yjh051108/dsh-routing-suite★ 7027
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★ 3950
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.
first-fluke/oh-my-agent#dsh★ 1494
Runs project OMA checks before and after tool execution and when a turn tries to finish. Installs its OMA CLI dependency and initializes unconfigured projects on first use. Requires Node.js 22+; initial setup needs network access and project write access.
MichengAI/dsh-skills-manager★ 631
Manages local DeepSeek Harness skills in Settings and shows shared Agent skills as read-only.
hust-open-atom-club/oh-dsh★ 326
Community distribution: TUI, desktop, and Web UI as one bundle with layered installation.
Fishquito7/dsh-skill-mcp-panel★ 291
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.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.