deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:GMH13552/dsh-longrun-suite
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
本项目意在探索 AI 在长期性科研、项目中的运行。如有交付则尽量保证可靠。尚在活跃开发中,如遇问题欢迎提交 issue,作者会及时查看;觉得好用的话给个星星,谢谢!
一个仓库装齐:长期自主任务管理器(mission-control)+ 长跑主持人预设(Long-Run Captain)+ 严格审查修正的 LLM 验证器 + 自主定时唤醒(timer scheduler)。克隆即用。
DSH 原生的 goal / todo / subagent 适合短任务,但做长期困难任务时会有这些问题:
本套件用 Mission 状态文件 + Claim Pool/Lease + Blackboard 工件通信 + WorkReceipt + 无记忆盲审 + LLM Wiki 记忆 + 失败强制 replan + 定时唤醒 解决以上问题,并且不硬编码任何领域流程:
verificationPlan;method-card,复用优先、禁止无依据猜想、禁止悄悄降级;.memory/,可检索、可 lint;| 组件 | 路径 | 作用 |
|---|---|---|
| dsh-mission-control | packages/dsh-mission-control/ |
mission 状态机 + mission_* 工具 + Claim Pool/Lease + Blackboard artifacts + Blind Review + LLM Wiki 工具 + 元校验器 |
| Long-Run Captain 预设 | preset/long-run-captain/ |
通用完整系统提示版:主持人 persona + 协议技能(联网调研、自适应验证、苏格拉底自查、LLM verifier 用法) |
| Long-Run Captain Router 预设 | preset/long-run-router/ |
同上能力 + router-standard 极简首轮系统,针对 DeepSeek V4 Flash 系列调优 |
| dsh-plugin-llm-verifier | packages/dsh-plugin-llm-verifier/ |
参考 LLM-as-a-Verifier 论文与上游 DSH 插件、经过更严格审查修正的 LLM 验证器:verify_rollout / verify_select / verify_compare / verify_track |
| dsh-timer-scheduler-ui | packages/dsh-timer-scheduler-ui/ |
schedule_reminder 自主定时唤醒 + 顶部会话头定时提醒入口 |
本仓库提供两个 Long-Run Captain 预设,能力相同,只有首轮系统提示形态不同:
| 预设 | 路径 | 系统提示 | 适用模型 |
|---|---|---|---|
| Long-Run Captain | preset/long-run-captain/ |
完整注入 Long-Run Captain persona / 规则 / 技能 | 任意模型,首轮上下文较重 |
| Long-Run Captain Router | preset/long-run-router/ |
仅保留 router-standard 极简首轮(You are a helpful software engineer assistant.),角色信息通过派发 prompt 中的 Role Card 携带 |
针对 DeepSeek V4 Flash 系列调优(deepseek-v4-flash / deepseek-v4-flash-vision-exp),用来保持 We / Let's 集体规划风格 |
简要规则:
dsh-mission-control,且任务流程、mission 状态机、评审/重规划规则完全一致。本仓库是三个独立插件的 monorepo,DSS STORE 上架时必须分别提交明确的子路径:
| 插件 | 子路径 | Entry ID | 版本 |
|---|---|---|---|
| dsh-mission-control | packages/dsh-mission-control |
dsh-mission-control |
0.2.0 |
| llm-as-a-verifier | packages/dsh-plugin-llm-verifier |
llm-verifier |
0.9.0 |
| timer-scheduler-ui | packages/dsh-timer-scheduler-ui |
timer-scheduler-ui |
0.2.2 |
每个子包 package.json 都声明了精确的 DSH 兼容矩阵:
"dsh": {
"compatibility": {
"dshReleases": {
"0.1.0-rc.8": "compatible",
"0.1.1-rc.1": "compatible",
"0.1.1-rc.2": "compatible"
}
}
}
详细说明见 STORE_SUBMISSION.md。
在 Long-Run Captain 或 Long-Run Captain Router 会话里直接说:
启动一个 mission:开发一个命令行工具,递归扫描指定目录下的 Markdown 文件,
按标题生成带层级、文件路径和更新时间的索引 index.md。
termination_policy: success
budget: { maxRounds: 6, maxHours: 4 }
成功标准:
- CLI 能递归扫描目录并生成 index.md
- 索引按标题层级组织,包含文件相对路径和更新时间
- 提供 3 个测试用例并全部通过
- 输出 README 说明安装和使用方式
- 由 reviewer 独立验证索引内容正确
预期流程:
mission_start
→ 早期大量联网调研 + wiki_search 查历史经验
→ mission_add_tasks(每个任务带 acceptance + verificationPlan + capabilities)
→ worker 按能力 mission_claim;长任务 mission_heartbeat 续租;干不完 mission_release
→ 研究方法/工具先写 method-card,已有实现优先复用,防降级/防猜想
→ 长实验用后台任务 + schedule_reminder 定时唤醒
→ worker 之间用 mission_publish_artifact / mission_consume_artifacts 交换
→ 完成先 mission_submit + WorkReceipt,再由独立 reviewer 评审
→ 失败任务 mission_replan + replaces 换方向继续
→ verify_track 监控方向是否跑偏
→ 经验写入 wiki_write,最终前 mission_blind_review + wiki_lint
→ mission_final_audit 逐条核验成功标准
→ mission_complete
open → active → needs_review → accepted / rejectedreplaces=... 后续任务,否则 mission_complete 拒绝完成terminationPolicy=success,映射到成功标准的任务必须 outcome=successmission_check 只检查证据诚实性(缺证据/缺评审/缺 final audit 一律 FAIL)socratic-self-audit 技能攻击自己的结论capabilities,worker 凭能力匹配抢单;长任务用 mission_heartbeat 续租、mission_release 释放,过期自动回收,多次回收自动 blockedmission_publish_artifact / mission_consume_artifacts,worker 之间通过类型化 artifact 交换,不靠聊天mission_blind_review 生成 blind_review.md + calibration_gap,实质交付型 mission 完成前作为硬门wiki_write / wiki_search / wiki_lint,维护 .memory/ 下可检索、可 lint 的跨任务经验任务不再只是“由 Captain 指派”,worker 可以凭能力抢单:
mission_claim
task_id: t-impl
worker: worker-1
capabilities: [python, pytorch, remote-gpu]
lease_seconds: 7200
capabilities,worker 能力不覆盖则拒绝;mission_heartbeat 续租;mission_release 放回队列;leaseBlocked,需要人工看原因;worker 之间不直接聊天,使用类型化工件:
mission_publish_artifact
task_id: t-run
artifact_type: run-metrics.json
path: results/run-metrics.json
summary: 11 个数据集指标
mission_consume_artifacts
artifact_type: run-metrics.json
所有 artifacts 存在 mission 状态中,下游按类型/生产者读取。
跨任务经验维护在 .memory/:
.memory/
├── _schema.md
├── _capabilities.md
├── methods/
├── pitfalls/
├── decisions/
├── missions/
└── workers/
wiki_write:新增/更新页面,带 [[slug]] 链接;wiki_search:按文本/domain 搜索;wiki_lint:检查缺摘要、断链、孤儿页、过期声明、worker 简历缺能力;_capabilities.md:每个 workspace 自定义能力词表/别名,系统不做硬编码;workers/*.md:worker 简历(role / capabilities / skills / history)。method-card 技能用于非平凡实现前记录:mission-protocol 强制“复用优先 + 反猜想”;mission_blind_review 生成:
blind_review.md
avg_rating
n_reviews
decision
top_weaknesses
self_claimed_rating
calibration_gap
Web 界面的 conversation.view 视图环新增一个「任务」标签页,放在「对话」与「轨迹」之间:
mission_ready);浏览器通过 GET /api/mission-state?sessionId=...&cwd=... 读取 Host 投影(每 2 秒刷新)。
动态版插件也可用 Package-private host.call('mission-state', ...) 获取同一投影。
| 阶段 | 必须/建议使用 |
|---|---|
| 规划前 | wiki_search |
| 非平凡实现前 | method-card |
| 学到的经验 | wiki_write |
| 长任务 | mission_heartbeat |
| 不能完成 | mission_release |
| worker 交换数据 | mission_publish_artifact / mission_consume_artifacts |
| 最终审计前 | mission_blind_review + wiki_lint |
默认 mission_start 使用 review_policy: "lite":
low:Captain 快速检查,不建独立 reviewer;standard:按里程碑/批次审核,优先一个 reviewer 审一批,不单独建 final_reviewer;high 或 reportPath:保留独立评审、盲审与 final audit。派发时使用任务级裁剪,而不是重复整份 mission:
mission_context(task_id=..., max_chars=...):只输出该任务的 brief、guidance、files、验收、依赖、相关 artifact 与匹配 wiki 摘要;mission_worker_plan:生成包含 mission brief、任务 guidance/files、验收标准、必需产物和 worker protocol 的精简派发 prompt;mission_metrics:查看 mission JSON、task/artifact/wiki 的字符量,定位 token 大头;mission_start / mission_add_tasks 支持 brief 与 files,复杂任务可以把用户给出的详细说明和文件路径原样传给子代理。DSH 0.1.5 新增了 Agent Teams、可继续子代理、goal / ralph 长任务等运行时能力。本套项目定位为治理与验收层:保留 mission 成功标准、独立评审、盲审、final audit、typed artifact blackboard、wiki memory;官方 ctx.subagents / ctx.agentTeams / ctx.goals 作为可选增强,通过 mission_capabilities 探测后按开关接入,不硬依赖 experimental 包。
long-run-router 转为 legacy / optional:新 session 优先使用官方长任务与子代理能力,router 只保留旧 DSH 兼容。
详细设计见 docs/official-integration.zh.md。
Host / 插件层
├── dsh-mission-control
│ ├── lib/core.js # 纯任务状态机(无 DSH 依赖)
│ ├── lib/index.js # mission_* / wiki_* / artifact 工具注册
│ ├── lib/client.js # Web 任务可视化视图标签页(conversation.view「任务」)
│ ├── bin/mission_check.mjs
│ └── preset/ # Captain 预设与协议技能
├── dsh-timer-scheduler-ui # 定时唤醒 + 提醒自动取消 + 同会话冷恢复(非父会话回退)
└── dsh-plugin-llm-verifier # LLM-as-a-Verifier
Agent / 预设层
├── long-run-captain/ # 完整系统提示版
└── long-run-router/ # router-standard 极简版(DeepSeek V4 Flash 优化)
技能层
├── mission-protocol # 任务拆解、派发、复用优先、反猜想、工具地图
├── task-profile # Input/Decision/Output/Core Challenge/No-Lazy
├── plan-critique # 计划批判 + A/B/C + 模块契约 + 反降级
├── adaptive-verification # 最低验证包
├── method-card # 方法出处卡 / 标准方法对照 / 降级检测
├── wiki-memory # LLM Wiki:ingest/query/lint
├── lessons # 任务内经验 + mission-legacy + mission-cases
└── report-protocol / socratic-self-audit / etc.
运行时数据层
├── .mission/<id>/mission.json # mission/task/attempt/receipt/blindReview/artifacts
├── .memory/ # 跨任务 LLM Wiki + 能力词表 + worker 简历
├── .mission-cases/ # 轻量案例卡
└── timer-reminders.json # 提醒持久化
本项目不是从零发明,而是吸收了多个公开 Agent 系统的“机制层”设计:
| 项目 | 借鉴了什么 | 我们怎么做 |
|---|---|---|
| AutoResearch (EvoMap) | workflow queue、claim pool、lease、receipt、blind review | mission 队列 + mission_claim/heartbeat/release + WorkReceipt + 盲审硬门 |
| ZZBoard | 去中心化工作板、artifact、signed receipt | Blackboard tools + mission_publish/consume_artifacts |
| Clawix | LLM Wiki 记忆、性能词表、角色化 worker | .memory/ + wiki_write/search/lint + _capabilities.md + worker 简历 |
| Flock | Blackboard 原则:不用聊天,用类型化工件通信 | artifact type 发布/消费 |
| unsorry | repo 即队列、claim substrate、expiry/reclaim | 租约过期回收 + 多次回收 blocked |
| CUMCM math-modeling Skill | 结构诊断、A/B/C 候选、最低验证、创新证据 | 通用化为 Input/Decision/Output + A/B/C + 验证包 |
| Karpathy LLM Wiki | ingest/query/lint 的 wiki 记忆范式 | 落地为 wiki-memory |
“参考”不是照搬:我们保留 DSH 通用性,领域内容全部交给 mission/task 数据,不硬编码任何数学/软件/研究流程。
dsh-longrun-suite/
├── README.md # 中文入口
├── README.en.md # English version
├── install.sh # 一键安装
├── packages/
│ ├── dsh-mission-control/
│ ├── dsh-plugin-llm-verifier/
│ └── dsh-timer-scheduler-ui/
└── preset/
├── long-run-captain/
└── long-run-router/
要求:Node 20+、DSH 0.1.0-rc.8+、已配置好 LLM provider。
dsh plugin --profile web add github:GMH13552/dsh-longrun-suite
这会一次安装全部三个插件。之后还需要装预设(两个都装,按需选用):
# A1: 从仓库目录复制
git clone https://github.com/GMH13552/dsh-longrun-suite.git
cp -R dsh-longrun-suite/preset/long-run-captain ~/.dsh/.agent-presets/long-run-captain
cp -R dsh-longrun-suite/preset/long-run-router ~/.dsh/.agent-presets/long-run-router
# A2: 或从 profile 的 node_modules 里复制(版本可能与插件包不同)
cp -R ~/.dsh/profiles/web/node_modules/dsh-longrun-suite/preset/long-run-captain ~/.dsh/.agent-presets/long-run-captain
cp -R ~/.dsh/profiles/web/node_modules/dsh-longrun-suite/preset/long-run-router ~/.dsh/.agent-presets/long-run-router
git clone https://github.com/GMH13552/dsh-longrun-suite.git
cd dsh-longrun-suite
./install.sh # 默认安装到 web profile
# ./install.sh tui # 安装到其他 profile
安装脚本会:
long-run-captain 和 long-run-router 两个预设复制到 $DSH_HOME/.agent-presets/;重启 DSH:
dsh web
新建会话时选择 Long-Run Captain(通用完整系统提示)或 Long-Run Captain Router(DeepSeek V4 Flash 优化极简版)预设。
等价命令:
dsh plugin --profile web add ./packages/dsh-mission-control
dsh plugin --profile web add ./packages/dsh-plugin-llm-verifier
dsh plugin --profile web add ./packages/dsh-timer-scheduler-ui
mkdir -p "$HOME/.dsh/.agent-presets"
cp -R preset/long-run-captain "$HOME/.dsh/.agent-presets/long-run-captain"
cp -R preset/long-run-router "$HOME/.dsh/.agent-presets/long-run-router"
dsh-plugin-llm-verifier默认使用provider: deepseek-official+model: deepseek-v4-flash-vision-exp。如果你的模型路由不同,改 profile 的cordis.patch.yml中llm-verifier行的provider/model,或者改本仓库packages/dsh-plugin-llm-verifier/cordis.patch.yml后重新安装。
dsh-timer-scheduler 独立仓库已与这里的包保持同字节同步(0.2.2);独立验证流程与实测输出见 packages/dsh-timer-scheduler-ui/PROFILE_EVIDENCE.md(一次性 profile:装→组合→启动→GET 200 / POST 404)。packages/dsh-timer-scheduler-ui/lib/ 后务必跑 node packages/dsh-timer-scheduler-ui/scripts/sync-profile.mjs:host loader 可能优先读包根 index.js,只更新 lib/ 会让重启后的 host 跑旧代码(按钮返回 200 但无反应)。POST /api/timer-reminders?action=retry|cancel),停在队列里的提醒不必等 agent;同一会话同一分钟重复排同一条 note 会复用已有条目。schedule_reminder 跨重启冷恢复的是同一个会话:普通会话按其持久化 agentPreset 挂载原组合(工具集不丢),session-backed 子代理子会话经其仍在线的直接父会话走 ctx.subagents.sendMessage。预设被删/父会话离线时提醒停在待人工重试,不会转投给分支之前的父会话;.memory/_capabilities.md,否则标签可能不一致。mission_blind_review 记录外部评审结果并生成 blind_review.md;实际评分需要由独立 reviewer/模型调用产生,工具不会自动打分。wiki_lint 只做文本级检查。method-card / wiki_* 多数是软协议,不强制所有任务;只有实质交付型 mission 的 blind review 是硬门。MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。