dsh-continual-harness:为 DSH 智能体提供持续精炼与回滚

前言

在 DSH 的插件化使用方式中,agent 经常需要在多次会话之间保留可复用经验。比较关键的问题是:经验如何持续更新、失败时如何回滚,而不是把坏状态继续留在上下文里。

下面介绍 dsh-continual-harness。它是 jasen215 发布的 DeepSeek Harness(DSH)插件,面向 self-improving AI agents,提供持久记忆、周期审查与精炼、跨会话知识共享,以及失败自动回滚。

这是什么

dsh-continual-harness 是一个 DeepSeek Harness(DSH)插件,用于让 DSH 中的 agent 在会话之间持续整理和更新经验。

已核实信息如下:

  • 名称:jasen215/dsh-continual-harness
  • 维护者:jasen215
  • 许可证:MIT
  • README badges 显示:Node 22+TypeScript 6.0+
  • peer dependencies 包含:
  • @deepseek-ai/cordis ^4.0.1
  • @deepseek-ai/dsh-agent >=0.1.0-rc.6
  • 以及其他 peer dependencies

核心功能

dsh-continual-harness 提供以下能力:

  • 状态投影:当内容 digest 变化时,在每一步注入 harness context。
  • 自动审查与精炼:在 turn interval 或 compaction end 时触发。
  • 手动精炼:提供 harness_refine 工具,可由 LLM 直接调用,并支持 rollback。
  • 可选命令:当宿主 commands capability 存在时,可注册 /refine slash command。
  • 记忆生命周期:通过 refinement metadata 支持 archiveunarchivepin
  • 排名注入:对最新有效 direct-user message 做注入,使用 title、content、freshness 和 tie-break 规则。
  • 会话收尾:harness_wrapup 工具给出 keeppromotearchive 建议;promotion 为 copy-only,冲突时返回 deterministic error。
  • 会话审查轨迹:从 session logs 重建 in-session review trajectory。
  • 不变量保护:通过 harness/refinement event validation 和 batched failure reporting 实现。
  • 显式 A/B 基准:通过 harness_benchmark action tool 运行固定冻结案例,并使用 code-owned decisions。

安装与启用

先安装到目标 DSH profile:

dsh plugin --profile <name> add dsh-continual-harness

其中 <name> 是目标 profile 名,需要替换为实际值。

后续更新可使用:

dsh plugin --profile <name> update dsh-continual-harness@latest

典型用法

下面是插件提供的可调用能力。工具名和命令名保持原文写法。

手动精炼与回滚:

harness_refine

该工具用于手动 refinement,并支持 rollback。

可选斜杠命令:

/refine

仅当宿主 commands capability 存在时可用;相关说明提到其依赖 @deepseek-ai/dsh-commands(存在时)。

会话收尾建议:

harness_wrapup

用于获得 keeppromotearchive 建议。

显式 A/B 基准:

harness_benchmark

用于固定冻结案例,以及同轮 reference/candidate A/B runs;决策由 code-owned decisions 负责。

数据与日志

默认共享 ESP experience root:

~/.dsh/harness/

实现日志:

continual-harness.log

该日志为 JSONL 格式,权限为 0600,并且可以轮转。archived entries 会从 injection 和 skill materialization 中隐藏。

适用场景与注意

适合正在使用 DSH、希望给 agent 增加持续经验整理与回滚机制的开发者。

由于插件以当前 dsh 进程权限运行,安装前应检查源码、依赖范围和许可证。该插件许可证为 MIT

也不要根据仓库名称自行拼接安装命令;使用上面的 dsh plugin --profile <name> add dsh-continual-harness 命令。

链接

  • GitHub:https://github.com/jasen215/dsh-continual-harness
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

小夜