メインコンテンツへスキップ
S

dsh-v4-anchor

starfie1d1272/dsh-v4-anchor

面向 DeepSeek Harness Standard 的 DeepSeek V4 首轮 RL 锚定插件,promotion 后恢复完整能力与 Skill。

インストール

dsh plugin --profile web add github:starfie1d1272/dsh-v4-anchor

README

dsh-v4-anchor

English

一个刻意保持极简的 DeepSeek Harness 插件,只做一件事:

在 DeepSeek V4 的 Standard 会话首请求中复现已有实验证据支持的 RL-shaped bootstrap;首次真实工具调用后,恢复完整 Standard 能力,并重新暴露 Skill。

它不是新的 Router,也不是 dsh-router-standard 的替代品,更不会追踪上游不断变化的 routing 实验。

它做什么

仅对以下会话生效:

  • DeepSeek Harness 0.1.0-rc.7
  • 官方 standard preset
  • 顶层会话
  • 模型 ID 匹配 DeepSeek V4,例如:
    • deepseek-v4-flash
    • deepseek-v4-pro

首请求:RL-shaped bootstrap

在首次持久化 tool/call 之前:

system:
You are a helpful software engineer assistant.

tools:
bash / pwsh
str_replace_editor

同时:

  • 暂时移除 runtime contexts;
  • 暂时隐藏自动注入的 AGENTS.md
  • 暂时隐藏自动注入的 Skill Catalog。

这样首请求尽量保持接近已有实验中使用的最小 RL-shaped surface。

首次工具调用后:恢复完整 Standard

一旦会话出现第一次持久化 tool/call

  • 恢复原始 Standard system prompt;
  • 恢复 runtime contexts;
  • 恢复完整工具目录;
  • 恢复 Skill Catalog;
  • 恢复 skill loader;
  • 不再隐藏 AGENTS.md

随后仅额外注入一次 promotion transition reminder,提醒模型重新检查刚刚恢复的 Skill / 工具能力,避免继续沿用 bootstrap 阶段形成的能力假设。

为什么做这个插件

这个项目只保留目前证据链中最窄、最容易解释的一层机制,而不继续维护完整 routing 实验。

已有实验证据支持的部分

上游实验中,RL-shaped bootstrap 使用:

You are a helpful software engineer assistant.

配合:

bash + str_replace_editor

曾记录到真实会话:

  • 25 steps
  • 24 次 tool call
  • 生成约 19 KB artifact

而完整、污染更重的 system surface 曾出现:

  • 约 101K reasoning chars
  • 0 次实际行动

上游小样本 API probes 还报告过:

  • RL-shaped surface:100% 出现 tool call;
  • reasoning 约 18–29K chars;
  • 普通 read/write/edit surface:约 25% action;
  • reasoning 约 73–101K chars。

这些结果支持的是:

首请求 surface 可以显著改变 DeepSeek V4 的思考 / 行动轨迹。

它们不能证明这种轨迹一定提高最终工程质量。

Skill Catalog 隐藏 / 恢复

dsh-router-standard PR #29 进一步发现:

  • dsh-agent-instructions
  • dsh-tool-skill

会在首请求前通过 user message 注入 AGENTS.md 与 Skill Catalog。

因此,仅清空 contexts 并不能得到真正干净的 bootstrap 请求。

PR #29 使用 agent/pre-step 暂时过滤:

agent-instructions
skill-catalog

并在第一次持久化 tool/call 后让它们自然恢复。

真实 session 中已经观察到:

  • request #1 保持 bash + str_replace_editor
  • promotion 后 request #2 恢复完整目录;
  • skill loader 与 Skill Catalog 同时回来[
  • 模型实际加载了 gh-address-commentsgh-publishgithub 等 Skill。

promotion reminder:实验性

后续真实 session 又发现:

“Skill Catalog 已恢复”并不保证模型一定会重新做 Skill matching。

模型可能继续沿用 bootstrap 阶段形成的执行轨迹。

因此本插件在 promotion 后第一个请求中加入一次性提醒:

Capability promotion has occurred...

要求模型重新检查当前任务与新恢复的 Skill / tools。

这一部分属于合理但尚未独立 benchmark 的实验性修复

因此目前应这样理解:

  • bootstrap anchor:有直接实验支持;
  • bootstrap 阶段隐藏 Skill / AGENTS,promotion 后恢复:有真实 session 支持;
  • one-shot promotion cue:有真实问题观察,但 cue 本身尚未独立验证。

它不做什么

这个插件刻意不包含:

  • task classifier
  • spec / react / weak router
  • PTC / Code mode
  • We-Team Protocol
  • persistent near-field guidance
  • mode-boost
  • subagent wrapper
  • UI
  • 热重载
  • dsh-super-injector
  • 自定义 preset
  • benchmark runner

它也不会修改:

  • DSH 官方 Standard 的 steady-state 行为;
  • 非 DeepSeek V4 模型;
  • subagent 子会话;
  • 其他 preset。

安装

推荐直接从 npm 安装:

dsh plugin --profile web add dsh-v4-anchor

也可以安装固定的 GitHub release:

dsh plugin --profile web add github:Starfie1d1272/dsh-v4-anchor#v0.1.0

然后重启:

dsh web

这是纯 JavaScript bundle,不需要 TypeScript build,也不需要安装时执行 prepare

如何确认已安装

可以先查看 profile 的最终组合:

dsh --profile web --dump-config

应能看到 dsh-v4-anchor 对应的 bundle layer。

首请求

在符合条件的新 Standard 会话中,模型看到的 bootstrap surface 应为:

system:
You are a helpful software engineer assistant.

tools:
bash / pwsh
str_replace_editor

promotion 后

第一次持久化工具调用以后,应恢复:

  • 原始 Standard prompt;
  • 原始 runtime contexts;
  • 原始完整工具目录;
  • Skill Catalog;
  • skill loader;
  • AGENTS.md 注入。

str_replace_editor 只用于 bootstrap,promotion 后会从额外暴露的工具中移除。

兼容性

当前明确目标:

项目状态
DeepSeek Harness 0.1.0-rc.7支持
官方 standard preset支持
DeepSeek V4 Flash目标模型
DeepSeek V4 Pro目标模型
非 V4 模型no-op(前提:在首请求前已完成模型选择)
其他 presetno-op
subagentno-op

v0.1.0 边界: 请在首请求前完成模型选择。DSH rc.7 没有向普通插件公开 Web 的 session-local picker 状态,因此本版本不承诺在 bootstrap 尚未 promotion 时动态切换模型仍能严格保持同样的过滤/no-op 语义。

本插件直接复用 DSH 安装中自带的:

@deepseek-ai/dsh-tool-str-replace-editor

不会额外安装第二份 DSH runtime package。

测试

测试不会调用任何 LLM / API,不消耗 DeepSeek Token。

npm run check

当前覆盖:

  • V4 Standard bootstrap prompt;
  • 两工具 bootstrap surface;
  • runtime context stripping;
  • Skill Catalog / AGENTS bootstrap filtering;
  • promotion 后恢复;
  • promotion cue 只出现一次;
  • 非 DeepSeek V4 no-op[
  • subagent no-op。

还可以检查打包内容:

npm run pack:check

项目定位

这个仓库更适合作为一个时效性行为补丁,而不是长期 Router 框架。

如果后续 DeepSeek V4 或 DSH 官方本身修复了对应行为问题,本插件可以:

  • 缩小适用范围;
  • 对新版模型直接 no-op;
  • 或直接停止维护 / 归档。

这不是缺点,而是项目刻意保持的小范围定位。

与上游项目的关系

本项目不会替代或要求上游停止实验。

主要参考:

  • yjh051108/dsh-router-standard
  • xiaobright/dsh-anchored-standard
  • DeepSeek Harness 官方 minimal preset
  • yjh051108/dsh-router-standard PR #29

dsh-router-standard 仍然尝适合继续探索:

  • task routing
  • persona
  • near-field guidance
  • depth control
  • Pro / Flash 差异
  • 其他实验性 steering

dsh-v4-anchor 只提取其中一个已有实验证据支持的窄机制,方便直接安装和使用。

详细来源与许可证说明见:

THIRD_PARTY_NOTICES.md

License

MIT

本项目不是 DeepSeek 官方项目。

関連プラグイン