rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
Daphne999/dsh-claimcheck
Verifiable completion for DeepSeek Harness: the plugin runs your real project checks, pins results to the working-tree state, expires stale evidence, and gates turn completion until proof exists. | 插件自己执行验收命令、把结果钉在工作区指纹上、证据随代码变化自动过期,收尾时先取证再宣称完成。
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Daphne999/dsh-claimcheck
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
把"做完了"从一句自称,变成一份可机读、会过期的证据。
DSH(DeepSeek Harness)插件:由插件自己执行项目的验收命令,捕获真实退出码与输出,把结果钉在 当前工作区指纹上,写入带 digest 的证据文件;工作区一变,旧证据自动过期。收尾时如果改了东西却拿不出 新鲜证据,插件会把这一轮"拦一下",提示先取证再宣称完成。
English summary · 证据格式 · 配置 · 设计取舍
给谁:用 agent 干活、又被"它说做完了"坑过的人。 解决什么:让"完成"这个词有凭据——谁执行的、跑的哪份代码、退出码多少、什么时候过期。 它不解决什么:代码好不好、需求对不对(那是评审和人的事)。
三步上手:
# 1. 装(市场里搜 dsh-claimcheck,或从源码 link)
# 2. 让它跑一次
claim_verify({ checks: [{ id: "unit", kind: "command", command: "npm test", title: "单元测试通过" }] })
# 3. 看证据算不算数(改过代码之后再问一次,会告诉你 stale)
claim_status({})
一条命令装不上的话,直接看下面的「安装」四种方式。
现在的 agent 生态里,"已完成"是最便宜的一句话,也是最贵的一次不信任:
| 现状 | 后果 |
|---|---|
| 模型说"测试都过了" | 没有人知道它到底跑没跑、跑的是哪份代码 |
| 改完 A 又改了 B | A 的验证结论被静默沿用,其实已经过期 |
| 多个 agent / 多轮会话并行 | 各自的"通过"互相污染,没有锚点 |
现有做法大多停在软提示(system prompt 里写"记得跑测试")或事后看日志。dsh-claimcheck 的差别是:
命令由插件执行,不由模型转述。模型只能选择跑什么、不能伪造结果;pass 必须有真实退出码支撑。
command 类检查通过 DSH 的 shell seam 真正执行,退出码、信号、超时、输出都来自真实进程。pass 要求每个 required 检查实际通过;缺证据是 incomplete,永远不是 pass。
人工确认类的检查记为 unknown,不会自动折算成通过。claim_status 立刻返回 stale。incomplete 并说明原因。artifactDigest 覆盖除 digest 自身外的全部字段)、
每个检查的输出摘要与字节数,以及明确的 outputTruncated 标记。| 工具 | 作用 | 关键行为 |
|---|---|---|
claim_plan |
声明"什么算完成" | 校验检查样式;拒绝危险命令与越界路径;最多 12 条 |
claim_verify |
真正执行并记录证据 | 无计划时可自动发现项目测试命令;写 runs/<runId>.json、latest.json、index.jsonl |
claim_status |
证据现在还算不算数 | 只读,不执行、不写盘;返回 fresh / 过期原因 |
claim_report |
交接用 Markdown | 从最新证据渲染,含 digest 与工作区指纹 |
// 1) 命令检查:插件执行,要求退出码
{ "id": "unit", "kind": "command", "title": "单元测试通过", "command": "pnpm run test", "timeoutMs": 180000 }
// 2) 文件检查:存在 / 包含文本 / 匹配正则
{ "id": "doc", "kind": "file", "title": "README 更新", "path": "README.md", "contains": "claimcheck" }
// 3) 人工检查:显式需要人,永不自动通过
{ "id": "ux", "kind": "manual", "title": "交互已人工确认", "requirement": "产品负责人签字" }
不给检查时,claim_verify 会按项目形状自动发现:package.json 的 test/typecheck/lint/build
(按锁文件选择 pnpm/yarn/bun/npm)、pytest、cargo test、go test ./...。
每轮结束时,如果这一轮产生了文件变更(write/edit,或写文件、移动、删除、装依赖、带 --write/--fix
的 shell 命令)而当前没有新鲜证据,插件会向该会话注入一条提醒并让这一轮继续(agent.followup)。
warn(默认):提醒 + 留出继续取证的机会;strict:同样的机制,用于"不接受无证据收尾"的场景;off:完全关闭;maxNudgesPerSession,默认 3),且同一状态不会重复提醒;纯问答轮、只读轮不会触发。诚实说明:插件层能做的是显著提高伪造成本 + 让结果可审计,不是密码学意义上的不可伪造。 人可以运行任意命令;插件保证的是"每份证据都指向它实际跑过的那次执行和那棵树"。
插件是零依赖的 Host-only bundle(无运行时 @deepseek-ai/* 导入)。
方式 A · 市场/桌面端安装页:搜索 dsh-claimcheck 安装(仓库带 dsh-plugin topic,会被社区索引自动收录)。
方式 B · Release 离线包(无需 clone,带 sha256)
# 下载并校验
curl -LO https://github.com/Daphne999/dsh-claimcheck/releases/download/v0.1.0/dsh-claimcheck-0.1.0.tgz
curl -LO https://github.com/Daphne999/dsh-claimcheck/releases/download/v0.1.0/dsh-claimcheck-0.1.0.tgz.sha256
sha256sum -c dsh-claimcheck-0.1.0.tgz.sha256
mkdir -p ~/dsh-plugins/dsh-claimcheck && tar -xzf dsh-claimcheck-0.1.0.tgz -C ~/dsh-plugins/dsh-claimcheck
dsh plugin --profile <profile> add link:"$HOME/dsh-plugins/dsh-claimcheck"
方式 C · 从源码链接
git clone https://github.com/Daphne999/dsh-claimcheck.git
dsh plugin --profile <profile> add link:"$PWD/dsh-claimcheck"
方式 D · 写进 profile
// ~/.dsh/profiles/<profile>/package.json
"dependencies": { "dsh-claimcheck": "link:/abs/path/to/dsh-claimcheck" },
"dsh": { "profile": { "bundles": [ /* ... */ "dsh-claimcheck" ] } }
装完重启宿主。安装后在插件列表里能看到「Claimcheck 验收取证」,且会话中多出 claim_* 四个工具。
证据写在会话工作区下的 .dsh/claimcheck/:
.dsh/claimcheck/
├── runs/run-mvwkx7ff-qbwqlf.json # 本次运行的完整证据
├── latest.json # 最新一份(原子写入)
└── index.jsonl # 追加式索引,一行一条
{
"schema": "dsh-claimcheck/evidence@1",
"runId": "run-mvwlo6pv-ufq4z4",
"verdict": "pass", // pass | fail | incomplete
"summary": "all 1 checks passed; required checks have evidence",
"digest": "c33357…2121", // 覆盖除 digest 自身外的全部字段
"workspace": {
"fingerprint": "f35cb7…98c4",
"fingerprintSource": "git", // git | files
"detail": { "head": "…", "branch": "main", "dirtyFiles": 0 }
},
"plan": { "id": "…", "source": "agent|user|discovered", "checks": [/* … */] },
"counts": { "total": 1, "pass": 1, "fail": 0, "unknown": 0, "error": 0 },
"checks": [{
"id": "unit", "kind": "command", "status": "pass",
"command": "node --test", "exitCode": 0, "signal": null, "timedOut": false,
"output": "…", "outputDigest": "…", "outputBytes": 1234, "outputTruncated": false,
"durationMs": 812
}]
}
这个文件不需要装插件也能读:CI、评审脚本、另一个 agent 都能直接消费。
写在 profile 的 patch 行里(cordis.patch.yml):
- id: dsh-claimcheck
config:
mode: warn # warn | strict | off
maxNudgesPerSession: 3
maxOutputBytes: 16384 # 每条检查保存的输出上限
evidenceDir: .dsh/claimcheck
autoDiscover: true
requireGateAfterWrite: true
curl | sh、强推/硬重置、chmod 777 /、带凭据外传的下载命令等,
在 claim_plan/claim_verify 阶段直接拒绝(见 lib/checks.js 的 RED_LINE_PATTERNS)。file 检查拒绝绝对路径与 ..。ctx.shell 跑,与 shell 工具同一套执行策略。生态里已有 dsh-acceptance(任务级人工验收台,明确不执行测试)、 dsh-dod(只提醒不拦截)、dsh-eval-harness (插件回归评测)。claimcheck 的定位是它们缺的那层:自己执行、结果绑定工作区、会过期, 产物是可被上述工具导入的 JSON,而不是又一个看板。
node --test test/*.test.mjs # 39 项单元/集成测试(含真实子进程)
node scripts/smoke.mjs # 端到端演示:发现→过期→闸门→修复→通过→交接
零运行时依赖;纯 ESM,Node ≥ 22。
仓库已带 dsh-plugin topic 与项目简介,因此走社区索引的自动收录通道:
data/review/pending.md),维护者核实后进入 CATALOG 与市场文件;dsh-market、DSH-Plugins-Marketplace 等)消费同一份数据;这一节只写真跑过的,跑法可复现。
| 日期 | 版本 | 怎么验的 | 结果 |
|---|---|---|---|
| 2026-11-11 | v0.1.0 | node --test test/*.test.mjs |
39 项全过(exit 0) |
| 2026-11-06 | 0.1.2 | claimcheck 自己给自己取证,5 条检查 | pass,上下文 5 条全绿(证据 run-mw4c0yni) |
| 2026-11-03 | v0.1.0 | 6 条检查:单测、端到端 smoke、隔离 profile 启动日志、入口可解析、清单声明、README 边界 | pass 6/6(证据 run-mw02aczy) |
证据文件就在会话工作区的 .dsh/claimcheck/runs/*.json,任何工具都能读;上面每一行的 runId 都能拿去对。
没用它的场合说明白:Windows 上 shell 行为与 Linux 不同(路径、变量、换行),本插件在 Windows 上测得多、Linux 只跑过单测; macOS 没测过。跑不通就是跑不通,这一栏不打包"全平台可用"。
dsh-claimcheck is a DeepSeek Harness plugin that makes "done" auditable:
Tools: claim_plan, claim_verify, claim_status, claim_report. Verdicts are pass / fail / incomplete —
a missing check is never a pass. Zero runtime dependencies, Host-only bundle.
git clone https://github.com/<owner>/dsh-claimcheck.git
dsh plugin --profile <profile> add link:"$PWD/dsh-claimcheck" CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。