dsh-evolution
English | 中文
Hermes-inspired agent self-evolution for DeepSeek Harness, rebuilt around DSH's plugin seams instead of being a straight port.
本项目吸收 Hermes Agent 的 自进化经验(持久记忆、技能沉淀、后台 review、curator、usage telemetry、 写入门控),并按照 DeepSeek Harness 的 Cordis 插件架构、session events、 storage-domain 和 agent presets 重新实现。
[!IMPORTANT] Community-published packages under
@lmzhenare maintained by the dsh-evolution community. They are not official DeepSeek releases and are not endorsed by DeepSeek.
Contents
- What this plugin does
- Quick start
- Why it is not just a port
- Installation
- Usage scenarios
- How each piece works
- Repository layout
- Compatibility
- Configuration
- Development and tests
- Safety model
- Attribution
What this plugin does
dsh-evolution gives a DeepSeek Harness agent the ability to improve itself
across sessions, with a strict control boundary:
The model may write only:
memory durable facts, preferences, and corrections
skills reusable procedures and their support files
Everything else is control plane:
policy, prompts, routing, approval, state, audit, snapshots
| Capability | What it does |
|---|---|
| Durable memory | Bounded MEMORY.md / USER.md memory with dedup, ambiguity protection, budgets, and threat filtering |
| Skill sedimentation | Create/edit/patch/archive skills, support files, protection markers, and snapshot restore |
| Background review | Signal-gated, evidence-required plan generated by a one-shot subagent |
| Skill curator | Deterministic active → stale → archived lifecycle plus optional LLM nomination |
| Staged approval | Background writes can be staged, reviewed, approved, or rejected with audit history |
| Threat guard | Prompt-injection, exfiltration, secret, and obfuscation patterns checked before writes |
| Usage telemetry | Per-skill use/view/patch sidecar compatible with Hermes-style lifecycle decisions |
| Observability | Session projections, replay/A-B scoring, feedback quality scores, and a learning graph |
| Capability governance | Validates Creator-mode capability packages and stages them for manual activation — code is never auto-executed |
Quick start
Community npm packages are published under
@lmzhenonly. For a published install usepnpm dsh plugin --profile web add @lmzhen/dsh-evolution-hostor@lmzhen/dsh-evolution-preset.
# inside a DeepSeek Harness checkout
node packages/evolution/scripts/install-layered.mjs \
--profile web \
--mode oneclick
After install, restart the DSH profile. The agent now has durable memory,
skill_manage, background review, curator, approval, and threat checks.
[!WARNING] Plugins run third-party code with your local permissions. Review this repository before installing, and prefer a profile without production credentials for a first test.
Why it is not just a port
Hermes keeps its evolution logic in Python modules that read and write the filesystem directly. This project uses DSH-native extension points instead:
| Hermes concept | dsh-evolution implementation |
|---|---|
| Memory files | ctx.memory registry + memory-files provider |
| Skill files | ctx.evolutionIo seam + SkillLibrary + native ctx.skills catalog |
| Usage sidecar | ctx.skillUsage serialized read-modify-write queue |
| Background review thread | turn/end signal gate + ctx.subagents one-shot child |
| Approval files | ctx.evolutionApproval over pluggable ctx.evolutionState |
| Policy checks | tools/pre-execute + monotonic tools.guard |
| Python daemon curator | evolution-curator service with run reports and min-idle gating |
| Prompt strings | Versioned PROMPT_BUNDLE with sha256 verification |
Media decisions are provider seams, so memory/skills/state can move from local files to storage-domain KV or another backend without changing policy code.
Installation
1. One-click compatibility install
Install into a DSH profile as a single bundle:
node packages/evolution/scripts/install-layered.mjs \
--profile web \
--mode oneclick
This installs @deepseek-ai/dsh-evolution-preset: host services and model
tools in one layer. Good for trying the plugin quickly.
2. Layered install (recommended)
node packages/evolution/scripts/install-layered.mjs \
--profile web \
--mode layered
What this installs:
profile bundle
@deepseek-ai/dsh-evolution-host shared infrastructure, no model tools
agent preset
~/.dsh/.agent-presets/evolution standard tools + memory + skill_manage
Then select the Evolution preset for sessions that should expose self-evolution tools. Other presets still get review, curator, approval, and observability without exposing model-facing evolution tools.
3. Host-only install
node packages/evolution/scripts/install-layered.mjs \
--profile web \
--mode host
Use this when a deployment wants background automation and audit but wants no
agent session to see memory or skill_manage.
4. Production-style install
When the bundle package is published:
dsh plugin --profile web add @deepseek-ai/dsh-evolution-host
Then copy packages/evolution/evolution-agent/ to
$DSH_HOME/.agent-presets/evolution/.
5. Uninstall
node packages/evolution/scripts/install-layered.mjs \
--profile web \
--mode layered \
--uninstall
Removes rows and copied packages but preserves memory, skills, state, reports, and approval history.
See packages/INSTALL.md for full details and profile override examples.
Usage scenarios
| Scenario | Recommended setup |
|---|---|
| One agent, full self-evolution | one-click preset |
| Many sessions, shared evolution infrastructure | host bundle + Evolution preset on selected sessions |
| Automation only, no model tools | host-only bundle |
| Standard coding preset | host bundle; model tools remain hidden |
| Anchored Standard preset | host bundle; unlock memory/skill_manage with dev_tool_search |
| Minimal preset | host bundle; services mount but the complete persona suppresses evolution prompt text |
| Creator mode | host bundle + evolution-capability governance; code activation stays manual |
How each piece works
Memory
- The model calls the
memorytool withadd,replace,remove, or one atomicoperationsbatch. - Entries are bounded by character budgets and are injected as a runtime snapshot while stable guidance stays in a system-prompt section.
- Ambiguous matches and external file drift are refused instead of silently corrupting memory.
Skills
skill_managesupportscreate,edit,update,patch,delete,write_file,remove_file, andlist.deleteis archival to.archive/, never a hard delete.- Every curator run snapshots the tree first and can restore it.
evolution-skill-catalogpublishes the managed tree through the nativectx.skillsregistry and invalidates immediately after writes.
Background review
turn/end
-> deterministic signal gate
-> one-shot subagent produces a structured plan
-> plan validator checks evidence and forbidden fields
-> trusted executor applies accepted operations
-> session event + projection record the outcome
The review subagent is allowed skill, skill_search, and skill_load by
default so it also works under Anchored Standard presets.
Curator
usage telemetry
-> deterministic 30/90-day transitions
-> optional advisory LLM nominations
-> snapshot + archive
-> JSON run report
Governance
tools/pre-execute threat scan
tools.guard immutable policy denials
evolution-approval stage -> approve/reject -> audit history
evolution-capability validate + stage Creator packages; never execute them
Repository layout
packages/
├── evolution-host/ host-plane infrastructure bundle
├── evolution-agent/ Evolution agent preset
├── evolution-preset/ one-click compatibility bundle
├── evolution-capability/ staged Creator-mode governance
├── evolution-io/ + io-node/ IO seam and atomic node provider
├── memory/ + memory-files/ + tool-memory/
├── skill-usage/ + tool-skill-manage/ + evolution-skill-catalog/
├── evolution-policy/ immutable policy + tools.guard
├── evolution-plan-validator/
├── evolution-state-storage/ + -domain/ + -json/ + evolution-state/
├── evolution-approval/
├── evolution-threat/
├── evolution-review/
├── evolution-curator/
├── evolution-commands/
├── evolution-activity/ + feedback/ + replay/ + learning-graph/
├── test-support/ row contracts and anchored fixtures
└── scripts/ layered installer
Compatibility
- Developed against DeepSeek Harness
0.1.0-rc.5. - Compatible with
standard,minimal,code, and Creator presets at the service level. - Explicitly tested against the real Anchored Standard bootstrap plugin:
evolution tools stay hidden during bootstrap, remain hidden after promotion,
and appear only after
dev_tool_searchunlocks them. - Review subagents default to
skill,skill_search, andskill_loadfor Anchored Standard compatibility.
Configuration
A profile can override every stable row id. Examples:
# disable background review
- id: evolution-review
disabled: true
# enable staged approval for foreground writes
- id: evolution-approval
config:
enabled: true
stageForeground: true
# force portable JSON state
- id: evolution-state
config:
provider: json
# extend review tooling
- id: evolution-review
config:
reviewToolAllow: [skill, skill_search, skill_load, read]
Row ids are a public contract. Tests pin them and ensure the host, agent, and compatibility layers stay synchronized.
Development and tests
Inside the DeepSeek Harness monorepo:
tsc -b tsconfig.host.json --force
vitest run packages/evolution
Current gate status:
tsc 0 errors
vitest 45 files / 90 tests passing
Test families include state concurrency, memory drift and budget boundaries, skill archival fallback, approval atomicity, Anchored Standard compatibility, installer/uninstaller behavior, and profile override composition.
Safety model
- The model may only mutate memory and skills.
- Policy, prompts, routing, approval, and state are not model-writable.
- Capability packages are validated and staged but never executed by this plugin.
- Skill deletion is archival, curator runs snapshot first, and approved writes replay through their exact registered runner.
- Missing dependencies degrade gracefully (for example JSON state fallback when no storage-domain facility exists).
Attribution
Inspired by Hermes Agent (Nous Research, MIT). See NOTICE.
Anchored Standard compatibility fixtures are vendored from
xiaobright/dsh-anchored-standard
under MIT; see packages/test-support/anchored-standard/LICENSE.
License
MIT
No comments yet. Be the first to write one.