Junkrat9527 / dsh-double

已收录

dsh-double: self-management & self-evolution for DeepSeek Harness — snapshot, config pre-check, blue-green evolve with auto-rollback, standby supervisor. 让 dsh 自己管理自己/自我进化/故障自愈。

main其他 查看源代码

安装

npx -y @deepseek-ai/dsh plugin --profile web add github:Junkrat9527/dsh-double

此安装命令根据 GitHub 仓库地址生成,是未经验证的安装起点。

README

维护者编写的文档快照。

在 GitHub 查看 ↗
提交版本 9bfe0c7同步于 2026年8月18日

dsh-double

dsh manages dsh. A self-management & self-evolution plugin for DeepSeek Harness — blue-green self upgrades, health probing, last-known-good snapshots, and a wake-on-demand standby "spare brain" that fixes the main instance when it gets stuck.

status: experimental license: MIT

What it does

A typical agent that modifies itself dies on restart, then needs an outside agent to come rescue it. dsh-double closes that loop so the agent can evolve itself safely:

  1. Self-evolution (blue-green) — a change set is applied to a standby copy first, statically pre-checked (dump-config, YAML/JSON syntax, bundle resolvability, NO_ADAPTER guard, duplicate loader-entry detection) and trial-booted. Only when both pass is the change applied to the main dsh, which then restarts and must confirm healthy before the standby is stopped. If the main fails to boot, it auto-rolls back to the pre-evolution snapshot.
  2. Health probing — main instance health is verified by TCP + HTTP + process checks (dsh writes no pid file), with the evidence chain shown in status.
  3. Snapshots / last-known-good — a baseline snapshot is taken before any evolution and restorable on demand.
  4. Wake-on-demand standby — when the main is stuck and mechanical recovery failed, the dormant standby (a disk-only copy, zero processes, zero ports) is woken as a temporary dsh instance on a separate port as a "spare brain" to diagnose and repair the main. It is never left running in normal operation.

The heavy lifting lives in the battle-tested, zero-dependency CLI bin/dsh-double.py and a small out-of-process bin/dshd-supervisor — boot-time failures happen before any plugin runs, so life-support must stay outside the dsh process. This plugin exposes that machinery to the ecosystem.

Features

  • In-harness tools (double_*) — the agent inside dsh can run its own evolution cycle end-to-end: double_status, double_check, double_snapshot, double_evolve, double_rollback, double_wake, double_stop.
  • HTTP APIGET /double/status, GET /double/check, POST /double/snapshot, POST /double/evolve, POST /double/rollback, POST /double/wake, POST /double/stop.
  • Settings dashboard — a status panel in dsh 设置 showing main health, last-known-good, snapshots and standby state, with one-click actions.

Install

Requires the dsh-double CLI + supervisor on the host (shipped in this repo under bin/): install bin/dsh-double.py and bin/dshd-supervisor to ~/.local/bin/ (make them executable).

dsh plugin add dsh-double

Or link it from source:

git clone https://github.com/Junkrat9527/dsh-double.git ~/dsh-double
cd ~/dsh-double && npm install && npm link
dsh plugin add dsh-double

Then restart dsh and check 设置 → 自我管理(dsh-double) or call GET /double/status.

Usage

Ask the agent, or call the API/tools directly:

"先跑 double_check 预检我的配置,然后 double_evolve 应用我准备好的变更目录,
成功后 double_status 确认主实例健康、备用身已休眠。"

Or via HTTP:

curl http://127.0.0.1:3080/double/status
curl -X POST http://127.0.0.1:3080/double/evolve -H 'content-type: application/json' \
  -d '{"change_dir": "/path/to/change-set"}'

Architecture

~/.dsh/double/
├── snapshots/        # baseline snapshots (health-baseline copies)
├── standby/          # dormant standby copy (config layer + symlinked node_modules)
├── evolutions/       # evolution event log (pass/fail, rollback?)
├── supervisor.log    # life-support events
└── last-known-good   # pointer to the last healthy snapshot
  • L0 life-support shell (dshd-supervisor, out-of-process): probes main health, auto-restarts, rolls back to last-known-good, wakes the standby — works even when dsh itself cannot boot.
  • L1 self-management (dsh-double.py + this plugin): snapshot / check / evolve / rollback / wake / stop; the in-harness agent drives it via tools.

License

MIT — Copyright (c) 2026 Junkrat9527

项目文件与信号

以下项目是目录快照中检测到的公开仓库信号。

测试已检测
安全策略已检测
贡献指南已检测

仓库信息

开发语言
JavaScript
许可证
MIT
最后更新
2026年8月18日 10:44

谨慎安装

请检查源代码、权限、生命周期脚本、依赖与网络访问;不受信任的插件应先在隔离环境中测试。