taoshi1999/dsh-workspace-hygiene ↗★ 3
dsh-workspace-hygiene
A DeepSeek Harness plugin that actively assesses artifact value and keeps agent workspaces organized, auditable, and recoverable.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:taoshi1999/dsh-workspace-hygiene说明文档
阅读完整 README ↗Configuration
The inserted row enables bounded idle scans and catalog synchronization with
safe mutation defaults. It does not set managedRoots, so the default scope is
the whole workspace subject to the protected-path rules; autonomousMode and
autoArchive remain off. For a shared repository, override the complete row in
your profile's cordis.patch.yml and set a narrow managedRoots list:
- id: workspace-hygiene
name: dsh-workspace-hygiene
config:
enabled: true
catalogEnabled: true
catalogRoot: workspace-artifacts
# Keep inspection narrow. These are workspace-relative.
managedRoots:
- .dsh/ephemeral
- .dsh/tmp
- tmp
- scratch
- outputs/.staging
minAgeHours: 24
maxScanFiles: 5000
maxArchiveFiles: 20
maxArchiveBytes: 104857600
autoScan: true
autoArchive: false
autonomousMode: false
notifyAgent: false
# Relative means inside the workspace root (not the state directory).
stateDir: .dsh-hygiene
# Prefer an external location for long-lived quarantine data.
archiveRoot: ~/.dsh/workspace-hygiene-archive
This replaces the bundle's existing workspace-hygiene row by id. Use
- insert: only when adding a new, differently named row; inserting the same
id would create a duplicate loader entry.
Important safety knobs:
managedRootsnarrows the scan. An omitted list scans the workspace subject to the protected-path rules; for a shared repository, set it explicitly to a small list such as.dsh/ephemeral,.dsh/tmp,tmp, andscratch.- An explicitly listed managed root may live under a normally protected hidden/configuration directory (for example
.dsh/ephemeral); repository metadata, dependency trees, and.env*names remain non-overridable. minAgeHoursprevents a file that was just produced by the current turn from being selected.maxArchiveFilesandmaxArchiveBytesbound one apply operation.- Built-in credential/key/certificate protections cannot be removed by replacing
protectedNamesorprotectedExtensions; those options only add project- specific rules. .hygieneignorecontains simple path/glob exclusions; a trailing/covers a directory and its descendants. Negation patterns are intentionally unsupported. The file must be a regular file inside the workspace and is capped at 256 KiB; symlinks and oversized files fail closed. Reports expose only a bounded prefix of the pattern list.- Keep
allowPathOverridefalse unless an operator deliberately wants model calls to select a different workspace; enabling it removes the session-root boundary and should be paired with an isolated profile. allowHiddenCandidatesonly relaxes the hidden-name guard; hard-protected metadata, dependency,.env*, and built-in protected names remain protected.- Relative
archiveRootvalues stay inside the workspace; use an absolute path or~when an external archive is intentional. It must not be the workspace itself, an ancestor that contains the workspace, or a directory nested inside a managed root; these layouts would overlap the source tree and are rejected. Quarantine records include source, destination, size, hash, timestamp, and status. Catalog entries only contain metadata and handling recommendations; source files are never copied intoworkspace-artifacts/. autonomousModeis the full-autonomy switch and is off by default. When enabled, idle maintenance may execute eligible archive/delete decisions without a per-run confirmation. Autonomous physical organization additionally requiresvaluePolicy.organization.moveFiles: true. Hard protections, managed roots, age/file/byte budgets, and fingerprint checks still apply. Use it only in an isolated profile after observing manual plans.autoScancontrols periodic catalog refresh and does not by itself move or delete source files.autoArchiveis a legacy idle-maintenance switch for automatically quarantining selected archive/delete recommendations. It is off by default, does not enableautonomousMode, and does not perform physical source organization.catalogEnabledcontrols persistence of the metadata catalog;catalogRootselects its workspace-relative root (defaultworkspace-artifacts). If the top-level value is omitted,valuePolicy.organization.rootcan select the root (the organizationrootis the catalog namespace, not a source-file destination).retainDirectory,archiveDirectory,reviewDirectory, anddeleteDirectoryname catalog groups, not mandatory physical destinations for source files. The catalog root must not overlap the state or archive roots.valuePolicy.organization.moveFilescontrols whether accepted organization suggestions become physical moves/renames during autonomous idle maintenance; it is off by default. A reviewed, explicitapply --organizerequest may still perform a move after confirmation even when this flag is false.fileRootcan set a workspace-relative physical organization root. Protected paths and symlink boundaries still win.