dsh-memory-archiver: DSH plugin for writing files in memory directory without approval

`dsh-memory-archiver` is a DSH plugin maintained by `imaused` to address limitations in current sandbox configurations. The DSH file sandbox offers only three tiers—read-only, workspace-write, and danger-full-access—and does not support additional writable roots. Additionally, approval policies are restricted to ask and never, lacking an allow-always option. Consequently, the requirement to "archive memory without approval while approving everything else" cannot be implemented via configuration. The plugin provides four tools—`memory_archive`, `memory_index`, `memory_patch`, and `memory_supersede`—that use `node:fs` to write files directly. This bypasses the file sandbox and avoids triggering approvals. It hard-validates writable scopes within `allowedRoots`, strictly rejecting out-of-bounds access (including `..`, junctions, and symlink escapes), writes only `.md` files, and lacks delete capabilities. The default root is `~/.dsh/memory`, which can be extended via the `DSH_MEMORY_ROOTS` environment variable or the `allowedRoots` in `cordis.patch.yml`. Before overwriting or correcting in-place, automatic backups are created to `<memory_dir>/.backup/`. Two retention policy keys are provided: `backupRetentionDays` (default 30) and `backupMaxBytes` (default 0, unlimited). Installation is performed by building from source or pointing to a directory: run `npm pack` and then `dsh plugin --profile <profile> add file:<tgz absolute path>`. After installation, restart DSH and start a new session. The plugin runs within the DSH main process and is not constrained by the file sandbox; users should verify the source code and license (MIT, as stated in the README) before installing. The accompanying plugin `dsh-kb-lite` is responsible for retrieving these memory roots with citations. The `status: superseded` tag written by `memory_supersede` will downgrade relevance during retrieval.

Read More