dsh-doublecheck 0.6.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/README.es.md +199 -220
- package/README.hi.md +199 -228
- package/README.md +199 -225
- package/README.pt.md +199 -220
- package/README.zh.md +201 -225
- package/lib/domain/gate.d.ts +263 -0
- package/lib/domain/gate.js +658 -0
- package/lib/domain/projection.d.ts +8 -3
- package/lib/domain/projection.js +12 -0
- package/lib/domain/report.d.ts +2 -2
- package/lib/domain/stages.d.ts +1 -1
- package/lib/events.d.ts +46 -4
- package/lib/grill/index.d.ts +1 -1
- package/lib/guard/command.d.ts +2 -2
- package/lib/guard/command.js +3 -0
- package/lib/guard/gate.d.ts +170 -0
- package/lib/guard/gate.js +518 -0
- package/lib/guard/index.d.ts +15 -3
- package/lib/guard/index.js +81 -4
- package/lib/guard/prose.d.ts +17 -0
- package/lib/guard/prose.js +14 -0
- package/lib/guard/review.d.ts +2 -2
- package/lib/index.d.ts +10 -9
- package/lib/index.js +1 -0
- package/lib/invariant.d.ts +3 -1
- package/lib/invariant.js +15 -0
- package/lib/types.d.ts +8 -1
- package/lib/types.js +2 -0
- package/package.json +52 -6
- package/skills/delivery-proof/SKILL.md +12 -0
- package/strict.patch.yml +37 -0
package/README.zh.md
CHANGED
|
@@ -1,282 +1,258 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
1
3
|
# dsh-doublecheck
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
**DeepSeek Harness 的交付质量门禁:先拷问需求,再测试实现,最后证明交付——并用「可交付 / 需要返工」的裁决来把关交接。**
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
[](https://www.npmjs.com/package/dsh-doublecheck)
|
|
7
|
-
[](LICENSE)
|
|
8
|
-
[](https://github.com/topics/dsh-plugin)
|
|
9
|
-
[](https://github.com/PerryLink/dsh-doublecheck/actions/workflows/ci.yml)
|
|
7
|
+
*需求在第一次改动之前就被拷问清楚;交付是被证明的,而不是被口头宣称的。*
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
[](LICENSE)
|
|
10
|
+
[](https://github.com/topics/dsh-plugin)
|
|
11
|
+
[](#)
|
|
12
|
+
[](https://github.com/PerryLink/dsh-doublecheck/actions)
|
|
13
|
+
[](https://github.com/PerryLink/dsh-doublecheck/releases)
|
|
14
|
+
[](https://www.npmjs.com/package/dsh-doublecheck)
|
|
15
|
+
[](https://www.npmjs.com/package/dsh-doublecheck)
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
[English](README.md) · [简体中文](README.zh.md) · [Español](README.es.md) · [Português](README.pt.md) · [हिन्दी](README.hi.md)
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
</div>
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
- 有纪律的团队是这么带人的:需求评审 → 失败测试 → 通过测试 → 自审 → 交付证明。智能体理应享有同一套循环,而且由 harness 强制执行,而不是靠自觉。
|
|
21
|
+
---
|
|
19
22
|
|
|
20
|
-
##
|
|
23
|
+
## 兼容性
|
|
21
24
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
```
|
|
25
|
+
| 方面 | 状态 |
|
|
26
|
+
|---|---|
|
|
27
|
+
| Harness | DeepSeek Harness `0.1.0-rc.6` |
|
|
28
|
+
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
29
|
+
| 平台 | 全部(纯宿主;无原生代码,自身无直接网络请求) |
|
|
30
|
+
| 模型 | 任意(守卫本身从不调用模型;评审与批评阶段作为宿主 subagent 运行) |
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
|---|---|---|
|
|
32
|
-
| **grill** | 拷问六个需求维度;未达成共识前拒绝实现。 | ✅ v0.1 |
|
|
33
|
-
| **design** | 通过 `doublecheck_spec` 提交 spec。 | ✅ v0.1 |
|
|
34
|
-
| **red** | 日志中存在失败测试运行;实现改动必须有它在案。 | ✅ v0.2 |
|
|
35
|
-
| **green** | 改动之后有通过测试,闭环。 | ✅ v0.2 |
|
|
36
|
-
| **review** | 派生对抗 critic 子代理,把交付与 spec 逐条对质。 | ✅ v0.3 |
|
|
37
|
-
| **verify** | `doublecheck_report` + 逐维度核对 workflow,证明交付。 | ✅ v0.4 |
|
|
38
|
-
|
|
39
|
-
## 功能
|
|
40
|
-
|
|
41
|
-
- 🔥 **`grill-requirements` 技能** —— 按通用 Agent Skills 格式打包的技能,围绕六个维度(**目标、边界、验收标准、失败模式、优先级、非目标**)连环追问,使用 DSH 原生 `ask_user_question` 界面;共识达成前拒绝写代码,并记录契约。
|
|
42
|
-
- 🧰 **覆盖全循环的阶段技能** —— `red-green-tdd`(先写失败测试、跑红、实现、跑绿)、`delivery-review`(green 之后对照 spec 做对抗式自审)、`delivery-proof`(把证据汇总成交付报告后再宣称完成)与 `grill-requirements` 一起发货,六个阶段都有模型指引,而不再只有第一阶段。
|
|
43
|
-
- 📜 **`doublecheck_spec` 工具** —— 把拷问出的 spec 写入会话日志,并在工作区落一份 markdown,让契约不随对话消失。提交时拒绝空或纯空白的维度(v0.6):grill 必须把六个维度全部敲定,spec 才算数。
|
|
44
|
-
- 🔄 **任务变更重新 grill** —— 已提交的 spec 只覆盖它自己的任务:spec 提交之后用户新发的直接请求会让 grill 门对该后续请求重新开启,而不是悄悄沿用旧契约。
|
|
45
|
-
- 🛡️ **纪律 guard** —— 挂在工具策略管线上的软门。模糊任务 + 没有 spec + 直奔 `edit`/`write` → 按 `intensity` 分别**提醒**、**请求人工批准**或**拦截**。
|
|
46
|
-
- 🟥🟩 **红/绿证据门**(`modules.tdd`)—— 会话日志硬校验:实现改动要求日志里**存在失败测试运行**(自上次通过以来;写测试文件永远放行——那正是 red 步骤);回合结束时若有改动却没有通过测试运行,则注入 green 提醒。自定义 guard 工具开箱即用:门会读取 `file_path` 与 `path` 两种参数键,完全未命名任何文件的调用不视为实现改动。
|
|
47
|
-
- 👁️ **对抗评审**(`modules.adversary`)—— 交付到达 green 后,经 DSH 原生 subagent 接缝(默认 `fork` provider)派生一个 critic 子代理,以对抗视角核对会话与已提交 spec,产出结构化 findings,并按 blocker 优先排序返回。`remind` 只注入评审意见;`warn`/`block` 额外 steer 一轮让模型正面回应 findings。`adversaryModel` 可把评审路由到独立模型;critic 工具白名单默认只读。findings 随 `doublecheck-review` 消息源持久结构化落盘。评审会持久化重武装:最新评审记录之后的实现编辑会触发下一轮评审;取消回合会中止在途 critic。
|
|
48
|
-
- 📊 **Doublecheck 报告 + 核对 workflow**(`doublecheck_report`,v0.4)—— 把会话纪律证据(spec、红/绿时间线、评审 findings、编辑数)汇总成交付报告并推导 verdict(`grill → draft → red → green → objections/verified → proven/challenged/unverified`),落盘工作区。开启 `verify` 时,经 DSH workflow 接缝派发逐维度核对员(`verifyMode: all` 每维度并行一个;`single` 合并为一个核对员)并并入报告——`proven` 要求每个维度都有裁决。
|
|
49
|
-
- 🚦 **交付门** —— 回合结束时,已到 green 但没有 `doublecheck_report` 记录的交付会收到「报告待补」提醒;成功报告会把阶段折叠推进到 `verify`。
|
|
50
|
-
- 🔁 **持久化状态** —— 所有模型可见内容(spec、提醒、拒绝反馈、评审 findings、`/doublecheck on|off` 开关)都落会话日志;门禁判定完全由日志(`tool/call` + `tool/result`,含 Code Mode 子派发)推导,恢复/派生会话同样生效。`remindOnce` 同样持久化:已收到提醒的会话重启后不会重复收到。开关折叠基于增量快照,长会话每次工具调用只摊 O(新增事件) 成本。
|
|
51
|
-
- 🌐 **全本地化的模型界面** —— 本包注入或回答的每一个模型可见字符串(提醒、拒绝/询问反馈、评审 steering、切换通知、`/doublecheck` 回复、critic 的任务提示词)都遵循 `language: 'en' | 'zh'`;工作区 spec/report 文档保持其稳定的英文标题。
|
|
52
|
-
- ⌨️ **`/doublecheck` 会话命令** —— `status` 报告生效开关、已配置模块、执行强度与折叠阶段事实(spec、测试颜色、评审、编辑数);`report` 当场折叠交付报告;`on|off` 写入持久 `doublecheck/state` 事件并注入切换通知。
|
|
53
|
-
- 📚 **`doublecheck_skills` 工具** —— 通过官方技能注册表接缝列出与加载本包技能。
|
|
54
|
-
- 🔒 **严格 overlay** —— `strict.patch.yml` 在一个 patch 层中把每道门都以 `block` 强度打开(随包发布)。
|
|
55
|
-
- 🧩 **独立 invariant 伴生行** —— `dsh-doublecheck/invariant` 子路径导出真实可用:无需加载 guard,即可通过宿主 `invariants` 注册表上报本包写入路径的矛盾(spec/report/review 结构)。
|
|
56
|
-
|
|
57
|
-
## 演示
|
|
58
|
-
|
|
59
|
-
`intensity: block`、全部门开启的一次真实 headless 运行,转录取自持久会话日志:
|
|
32
|
+
## 你会得到什么
|
|
60
33
|
|
|
61
|
-
|
|
62
|
-
dsh --profile demo headless "把这个项目里最慢的代码直接改快,别问我任何问题,直接改文件。"
|
|
63
|
-
```
|
|
34
|
+
`dsh-doublecheck` 安装两个插件行,它们读取并执行同一份持久会话日志:
|
|
64
35
|
|
|
65
|
-
1.
|
|
66
|
-
|
|
67
|
-
2. 模型用 `doublecheck_spec` 记录 spec,先写失败测试(测试文件永远可编辑)并运行——日志记录 `[exit code: 1]`,red 步骤完成。
|
|
68
|
-
3. 实现编辑随之放行;随后一次运行记录 `4 passed`,green 步骤完成。
|
|
69
|
-
4. 派生 critic 审计交付,带严重级标记的 findings 被注入;`warn`/`block` 下还会 steer 一轮让模型正面回应。
|
|
70
|
-
5. `doublecheck_report` 把一切折叠进 markdown 报告并推导 verdict——全部核对通过为 `proven`,有核对员反对则为 `challenged`。
|
|
36
|
+
1. **`doublecheck-grill`** —— 需求熔炉:内置的 `grill-requirements` 技能,加上面向模型的 `doublecheck_skills`、`doublecheck_spec`、`doublecheck_report` 工具,以及按维度执行的验证工作流。
|
|
37
|
+
2. **`doublecheck-guard`** —— 纪律守卫:grill 门禁、红/绿证据门禁、对抗式评审、`/doublecheck` 与 `/gate` 命令、`doublecheck.gate` 设置命名空间,以及四阶段交付门禁。
|
|
71
38
|
|
|
72
|
-
|
|
39
|
+
两者共同执行**纪律闭环** —— *grill → design → red → green → review → verify*:
|
|
73
40
|
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
|
|
41
|
+
```text
|
|
42
|
+
grill ──▶ design ──▶ red ──▶ green ──▶ review ──▶ verify
|
|
43
|
+
│
|
|
44
|
+
└─ 六个需求维度、共识门禁,
|
|
45
|
+
结构化 spec 提交到会话 + 工作区
|
|
77
46
|
```
|
|
78
47
|
|
|
79
|
-
|
|
48
|
+
| 阶段 | 含义 |
|
|
49
|
+
|---|---|
|
|
50
|
+
| **grill** | 拷问六个需求维度;在达成共识之前拒绝实现。 |
|
|
51
|
+
| **design** | 通过 `doublecheck_spec` 提交已确定的 spec。 |
|
|
52
|
+
| **red** | 在实现改动之前,用一次失败的测试运行来证明差距。 |
|
|
53
|
+
| **green** | 改动之后一次通过的测试运行闭合闭环。 |
|
|
54
|
+
| **review** | 一个分叉的对抗式批评者对照 spec 审计交付。 |
|
|
55
|
+
| **verify** | `doublecheck_report` + 按维度的验证工作流证明交付。 |
|
|
56
|
+
|
|
57
|
+
## 快速开始
|
|
80
58
|
|
|
81
59
|
```sh
|
|
82
|
-
|
|
83
|
-
dsh plugin --profile
|
|
84
|
-
```
|
|
60
|
+
# 1. install the bundle into your profile
|
|
61
|
+
dsh plugin --profile web add "github:PerryLink/dsh-doublecheck#main"
|
|
85
62
|
|
|
86
|
-
|
|
63
|
+
# or from npm (published releases)
|
|
64
|
+
dsh plugin --profile web add dsh-doublecheck
|
|
87
65
|
|
|
88
|
-
|
|
89
|
-
dsh
|
|
66
|
+
# 2. restart and verify the row
|
|
67
|
+
dsh --profile web --dump-config | grep -E -A3 'id: doublecheck-(grill|guard)'
|
|
90
68
|
```
|
|
91
69
|
|
|
92
|
-
|
|
70
|
+
两个行(`doublecheck-grill` 和 `doublecheck-guard`)随配置文件自动激活。
|
|
93
71
|
|
|
94
|
-
|
|
95
|
-
dsh --profile <name> --patch ./node_modules/dsh-doublecheck/strict.patch.yml
|
|
96
|
-
```
|
|
72
|
+
## 安装与卸载
|
|
97
73
|
|
|
98
|
-
|
|
74
|
+
- **git 渠道**(最新 `main`):`dsh plugin --profile web add "github:PerryLink/dsh-doublecheck#main"` —— `prepare` 脚本只使用生产依赖进行构建。
|
|
75
|
+
- **npm 渠道**(发布版本):`dsh plugin --profile web add dsh-doublecheck`。
|
|
76
|
+
- **tarball 渠道**:在本仓库中执行 `pnpm pack`,然后 `dsh plugin --profile web add ./dsh-doublecheck-<version>.tgz`。
|
|
77
|
+
- **卸载**:`dsh plugin --profile web remove dsh-doublecheck`(或从配置文件补丁中移除这些行)。
|
|
99
78
|
|
|
100
|
-
|
|
101
|
-
dsh plugin --profile <name> remove dsh-doublecheck
|
|
102
|
-
```
|
|
79
|
+
如需零配置的严格模式(每个门禁都以 `block` 强度开启、要求门禁覆盖率),在捆绑补丁之上应用随附的覆盖层:`dsh --profile web --patch ./node_modules/dsh-doublecheck/strict.patch.yml`。
|
|
103
80
|
|
|
104
|
-
|
|
81
|
+
## 配置
|
|
105
82
|
|
|
106
|
-
|
|
83
|
+
所有可调项都是 Schemastery 的 `Config` 字段(可在 cordis.yml 中修改)。按 id 定位的覆盖会替换整行——请重新声明你需要的每一个键。`cordis.patch.yml` 逐键内联说明;Schema 默认值是调优默认值的唯一来源。
|
|
107
84
|
|
|
108
|
-
|
|
109
|
-
|
|
85
|
+
| 键 | 默认值 | 含义 |
|
|
86
|
+
|---|---|---|
|
|
87
|
+
| `specFile` | `'doublecheck-spec.md'` | 已提交 spec markdown 的工作区文件(grill 行)。 |
|
|
88
|
+
| `reportFile` | `'doublecheck-report.md'` | 交付报告的工作区文件(grill 行)。 |
|
|
89
|
+
| `reportVerify` | `true` | 默认运行验证工作流(grill 行)。 |
|
|
90
|
+
| `verifyProvider` | `'fork'` | 各维度检查器运行的 subagent 提供者(grill 行)。 |
|
|
91
|
+
| `verifyMode` | `'all'` | `all` = 每个维度一个并行检查器;`single` = 一个合并检查器(grill 行)。 |
|
|
92
|
+
| `intensity` | `'remind'` | grill、红/绿和评审门禁的执行强度(`remind` / `warn` / `block`)。 |
|
|
93
|
+
| `enableByDefault` | `true` | 没有 `/doublecheck on\|off` 记录的会话的主开关。 |
|
|
94
|
+
| `language` | `'en'` | 注入的提醒/拒绝/评审/门禁文案语言(`en` / `zh`)。 |
|
|
95
|
+
| `guardTools` | `['edit', 'write']` | 两个门禁监视的修改工具名称。 |
|
|
96
|
+
| `vagueTaskMaxChars` | `200` | 超过此长度的任务绝不会被视为模糊。 |
|
|
97
|
+
| `remindOnce` | `true` | 每个提醒每会话最多注入一次(跨重启持久)。 |
|
|
98
|
+
| `testToolNames` | `['bash', 'pwsh']` | 可以运行测试的 shell 工具名称。 |
|
|
99
|
+
| `testCommandPatterns` | *(pnpm/npm/yarn/bun test、pytest、go/cargo/make test、node --test、deno test、uv run pytest)* | 命令必须匹配才能计为一次测试运行的正则。 |
|
|
100
|
+
| `testFilePatterns` | *(测试目录、`*.test.*` / `*.spec.*`)* | 识别测试文件的正则——始终可编辑,免于红门禁。 |
|
|
101
|
+
| `modules.grill` | `true` | 关闭则禁用 grill 门禁。 |
|
|
102
|
+
| `modules.tdd` | `true` | 开启则启用红/绿证据门禁。 |
|
|
103
|
+
| `modules.adversary` | `false` | 开启则在绿色后启用分叉批评者评审。 |
|
|
104
|
+
| `adversaryModel` | `null` | 批评者模型路由;`null` = 主模型自评。 |
|
|
105
|
+
| `adversaryProvider` | `'fork'` | 批评者运行的 subagent 提供者。 |
|
|
106
|
+
| `adversaryMaxFindings` | `5` | 注入会话的发现上限(1–20)。 |
|
|
107
|
+
| `adversaryTools` | `['read', 'glob', 'grep']` | 批评者工具允许列表;请保持只读。 |
|
|
108
|
+
| `adversaryTimeoutMs` | `120000` | 一次批评者运行的硬性时间预算。 |
|
|
109
|
+
| `gate.enabled` | `true` | 门禁面板与回合边界红色通知的主开关。 |
|
|
110
|
+
| `gate.planSuggestion` | `true` | 在红色报告中附加计划模式复查建议。 |
|
|
111
|
+
| `gate.reportFile` | `'gate-report.md'` | 门禁报告的工作区文件。 |
|
|
112
|
+
| `gate.requirements.checklist` | *(六个 spec 维度问题)* | 可插拔的关键问题清单:`{ id, question, specDimension, required }`。 |
|
|
113
|
+
| `gate.requirements.minConfirmed` | `6` | 必须通过的最少必答问题数(1..必答数量)。 |
|
|
114
|
+
| `gate.requirements.interrogateTool` | `'ask_user_question'` | 其调用计为询问证据的工具名称。 |
|
|
115
|
+
| `gate.tests.requirePassingRun` | `true` | 最近一次测试运行未通过(或缺失)即为红灯。 |
|
|
116
|
+
| `gate.tests.allowFailingRuns` | `0` | 最近一次绿色之后允许的失败运行次数,超过则红灯。 |
|
|
117
|
+
| `gate.tests.requireCoverage` | `false` | 开启则要求在测试输出中有覆盖率证据。 |
|
|
118
|
+
| `gate.tests.minCoveragePct` | `80` | 最低覆盖率百分比(0–100)。 |
|
|
119
|
+
| `gate.consistency.*` | `provider: 'fork'`、`model: null`、`tools: ['read','glob','grep']`、`timeoutMs: 120000`、`maxFindings: 5` | 本地一致性评审者的旋钮(`model: null` = 主模型)。 |
|
|
120
|
+
| `gate.review.engine` | `'auto'` | `auto` = 存在时使用 dsh-auto-review 的裁决记录,否则使用本地评审者;`local` = 始终使用本地评审者。 |
|
|
121
|
+
| `gate.review.provider` | `'fork'` | 本地评审评审者的提供者(其 `model`/`tools`/`timeoutMs`/`maxFindings` 与 `gate.consistency.*` 相同)。 |
|
|
122
|
+
|
|
123
|
+
配置错误会在加载时大声失败:无效的正则、空或重复的名称列表、越界阈值、重复的清单 id 都会抛错,而不是悄无声息地什么都不做。`strict.patch.yml` 是全门禁阻断覆盖层,以 `intensity: block` 重新声明守卫行,开启所有模块并要求覆盖率。
|
|
124
|
+
|
|
125
|
+
## 工具与界面
|
|
126
|
+
|
|
127
|
+
| 界面 | 类型 | 说明 |
|
|
128
|
+
|---|---|---|
|
|
129
|
+
| `doublecheck_skills` | 工具 | 通过技能注册表接口列出并加载包内四个内置技能。 |
|
|
130
|
+
| `doublecheck_spec` | 工具 | 将拷问得出的六维 spec 提交到会话日志和工作区 markdown 副本。 |
|
|
131
|
+
| `doublecheck_report` | 工具 | 将纪律证据折叠为交付报告(可选的按维度验证工作流)。 |
|
|
132
|
+
| `/doublecheck status\|report\|on\|off` | 命令 | 开关、模块、强度、阶段事实、折叠报告,以及持久的开/关覆盖。 |
|
|
133
|
+
| `/gate status\|run\|config` | 命令 | 实时清单进度、已确定的可交付/返工报告,以及生效配置。 |
|
|
134
|
+
| `grill-requirements`、`red-green-tdd`、`delivery-review`、`delivery-proof` | 技能 | 覆盖全部六个闭环阶段的内置纪律技能。 |
|
|
135
|
+
| `doublecheck.gate` | 设置命名空间 | 可插拔清单,暴露给支持设置的 UI(`expose: true`、`applies: restart`)。 |
|
|
136
|
+
| `strict.patch.yml` | 覆盖层 | 一个补丁层内以 `block` 强度开启每个门禁并启用覆盖率要求。 |
|
|
137
|
+
| `dsh-doublecheck/invariant` | 伴生行 | 通过宿主 `invariants` 注册表报告包自有写路径矛盾。 |
|
|
110
138
|
|
|
111
|
-
##
|
|
139
|
+
## 门禁阶段
|
|
112
140
|
|
|
113
|
-
|
|
114
|
-
- **写入**:会话工作区内的 `doublecheck-spec.md` 与 `doublecheck-report.md`(路径可配),经 `ctx.fs` seam。
|
|
115
|
-
- **模型调用**:只有可选的对抗式审查(`modules.adversary`,默认关)与 `doublecheck_report` 的校验工作流(默认开)会启动子代理;除此之外不调用模型、不联网。
|
|
116
|
-
- **绝不触碰**:凭据、环境变量、以及会话工作区之外的任何文件。
|
|
141
|
+
交付门禁把会话的持久证据聚合为可配置的四阶段清单,并确定一个 **可交付 / 需要返工** 的裁决。每个阶段只折叠会话日志(重放即状态),因此一次运行在恢复或分叉后会得到相同的结果。
|
|
117
142
|
|
|
118
|
-
|
|
143
|
+
| 阶段 | 检查 | 证据来源 | 模型成本 |
|
|
144
|
+
|---|---|---|---|
|
|
145
|
+
| 需求询问 | 逐项确认的关键问题清单(默认六个 spec 维度问题) | 已提交的 `doublecheck_spec` + `ask_user_question` 调用 | 无 |
|
|
146
|
+
| 测试证据 | 最近运行颜色、绿色后的失败运行、可选覆盖率阈值 | 会话日志中的 shell 测试运行(`[exit code: N]`、覆盖率百分比) | 无 |
|
|
147
|
+
| 实现一致性 | 差异 ↔ 需求映射:每次改动都必须服务于某个 spec 维度 | 本地分叉评审者(结构化发现、只读工具) | 一个 subagent |
|
|
148
|
+
| 评审结论 | 交付裁决;`engine: auto` 在存在时消费 dsh-auto-review 的持久裁决记录,否则使用本地评审者 | `autoReview/verdict` / `autoReview/rejection` 事件,或本地分叉评审者 | 一个 subagent(本地) |
|
|
119
149
|
|
|
120
|
-
|
|
121
|
-
|---|---|
|
|
122
|
-
| `--dump-config` 里没有 `# == dsh-doublecheck` 层 | bundle patch 缺失或某行被 `disabled`——检查 profile 的 patch 顺序与行 id。 |
|
|
123
|
-
| 门卫从不触发 | 执行 `/doublecheck status`:会话开关可能关闭,或 guard 行的 `modules.*` 全为 false。 |
|
|
124
|
-
| "Adversary review did not run: the subagents seam is not mounted" | 该 profile 组合没有子代理提供方——挂载一个(spine 组合自带),或关闭 `modules.adversary`。 |
|
|
125
|
-
| `doublecheck_report` 显示 `verification: null` | `workflowEngine` seam 缺失或运行被拒绝/中止——报告如实说明而非猜测。 |
|
|
126
|
-
| 报告给出 `unverified` | 校验跑了但并非每个 spec 维度都有裁决——用 `verify: true` 重跑;`proven` 要求六个维度齐备。 |
|
|
150
|
+
红灯是失败的检查(缺失 spec、最近运行失败、覆盖率低于下限、未映射的改动、blocker/major 发现)——每一项都附带返工建议。警告与跳过永远不会翻转裁决。门禁将 [dsh-auto-review](https://github.com/PerryLink/dsh-auto-review) 作为弱依赖集成:`review.engine: auto` 在存在时折叠其裁决记录,否则降级到本地评审者;门禁从不合成审批请求。
|
|
127
151
|
|
|
128
|
-
##
|
|
152
|
+
## 示例报告
|
|
129
153
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
```yaml
|
|
133
|
-
- id: doublecheck-grill
|
|
134
|
-
config:
|
|
135
|
-
specFile: 'specs/doublecheck-spec.md' # 默认: 'doublecheck-spec.md'
|
|
136
|
-
reportFile: 'specs/doublecheck-report.md' # 默认: 'doublecheck-report.md'
|
|
137
|
-
reportVerify: true # 默认运行 verify workflow
|
|
138
|
-
verifyProvider: 'fork' # 逐维度核对员的 provider
|
|
139
|
-
reportTestToolNames: ['bash', 'pwsh']
|
|
140
|
-
reportTestCommandPatterns:
|
|
141
|
-
- '(?:^|[;&|]\s*)(?:(?:pnpm|npm|npx|yarn|bun)(?:\s+run)?\s+(?:test|vitest|jest|mocha)(?:\s|$))'
|
|
142
|
-
- '(?:^|[;&|]\s*)(?:(?:pytest|go\s+test|cargo\s+test|make\s+test|ctest)(?:\s|$))'
|
|
143
|
-
- '(?:^|[;&|]\s*)(?:node\s+--test(?:\s|$))'
|
|
144
|
-
- '(?:^|[;&|]\s*)(?:deno\s+test|uv\s+run\s+pytest)(?:\s|$)'
|
|
145
|
-
reportMutationTools: ['edit', 'write']
|
|
146
|
-
reportTestFilePatterns:
|
|
147
|
-
- '(^|[\\/])(tests?|__tests__|specs?)([\\/]|$)'
|
|
148
|
-
- '\\.(test|spec)\\.[A-Za-z0-9]+$'
|
|
149
|
-
|
|
150
|
-
- id: doublecheck-guard
|
|
151
|
-
config:
|
|
152
|
-
intensity: warn
|
|
153
|
-
modules:
|
|
154
|
-
grill: true
|
|
155
|
-
tdd: true # 红/绿证据门(v0.2)
|
|
156
|
-
adversary: true # 派生 critic 评审(v0.3)
|
|
157
|
-
adversaryModel: null # 或如 'deepseek-v4-pro',评审走独立模型
|
|
158
|
-
adversaryProvider: 'fork' # critic 使用的 subagent provider
|
|
159
|
-
adversaryMaxFindings: 5 # 注入会话的 findings 上限
|
|
160
|
-
adversaryTools: ['read', 'glob', 'grep'] # critic 工具白名单(只读)
|
|
161
|
-
adversaryTimeoutMs: 120000 # 单次评审的硬性时间预算
|
|
162
|
-
guardTools: ['edit', 'write']
|
|
163
|
-
vagueTaskMaxChars: 200
|
|
164
|
-
remindOnce: true
|
|
165
|
-
testToolNames: ['bash', 'pwsh']
|
|
166
|
-
testCommandPatterns:
|
|
167
|
-
- '(?:^|[;&|]\s*)(?:(?:pnpm|npm|npx|yarn|bun)(?:\s+run)?\s+(?:test|vitest|jest|mocha)(?:\s|$))'
|
|
168
|
-
- '(?:^|[;&|]\s*)(?:(?:pytest|go\s+test|cargo\s+test|make\s+test|ctest)(?:\s|$))'
|
|
169
|
-
- '(?:^|[;&|]\s*)(?:node\s+--test(?:\s|$))'
|
|
170
|
-
- '(?:^|[;&|]\s*)(?:deno\s+test|uv\s+run\s+pytest)(?:\s|$)'
|
|
171
|
-
testFilePatterns:
|
|
172
|
-
- '(^|[\\/])(tests?|__tests__|specs?)([\\/]|$)'
|
|
173
|
-
- '\\.(test|spec)\\.[A-Za-z0-9]+$'
|
|
174
|
-
```
|
|
154
|
+
`/gate run` 返回这份 markdown——可直接粘贴到 PR 描述中:
|
|
175
155
|
|
|
176
|
-
|
|
156
|
+
````markdown
|
|
157
|
+
# Delivery gate report
|
|
177
158
|
|
|
178
|
-
|
|
159
|
+
> **Verdict: rework required** — 2 red item(s)
|
|
160
|
+
> The gate is red. Re-open the work in plan mode to re-check the open items before delivering.
|
|
179
161
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
162
|
+
## 1. Requirements interrogation — PASS
|
|
163
|
+
- [✔] **What outcome must the delivery produce?** — spec dimension "goal" committed
|
|
164
|
+
- [✔] **What is in scope, and what is out of scope?** — spec dimension "scope" committed
|
|
165
|
+
- [✔] **Which observable checks prove the work is done?** — spec dimension "acceptanceCriteria" committed
|
|
166
|
+
- [✔] **What can go wrong, and what is the correct behavior in each case?** — spec dimension "failureModes" committed
|
|
167
|
+
- [✔] **What is traded when goals conflict; what is optional?** — spec dimension "priorities" committed
|
|
168
|
+
- [✔] **What does the user explicitly not want?** — spec dimension "nonGoals" committed
|
|
185
169
|
|
|
186
|
-
|
|
170
|
+
## 2. Test evidence — FAIL
|
|
171
|
+
- [✔] **passing test run** — latest test run passed
|
|
172
|
+
- [✔] **failing cases after green** — 0 failing run(s) after green (allowed: 0)
|
|
173
|
+
- [✖] **coverage evidence** — 61% coverage below the 80% minimum — rework: raise coverage above the configured minimum
|
|
187
174
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
| `modules.grill` | `true` | 关闭则 grill 门整体停用;grill 技能/工具的开关是各自行的 `disabled`。 |
|
|
191
|
-
| `modules.tdd` | `true` | 开启红/绿证据门(v0.2);v0.5 起默认开启。 |
|
|
192
|
-
| `modules.adversary` | `false` | 到达 green 后启用派生 critic 评审(v0.3);使用 `ctx.subagents` 接缝——接缝缺失时以「unavailable」通知诚实降级。 |
|
|
193
|
-
| `enableByDefault` | `true` | 没有 `/doublecheck on|off` 记录的会话的总开关默认值。 |
|
|
194
|
-
| `language` | `'en'` | 注入的提醒/拒绝/评审文案语言(`en` / `zh`)。 |
|
|
195
|
-
| `guardTools` | `['edit', 'write']` | 两道门监视的变更类工具名。 |
|
|
196
|
-
| `vagueTaskMaxChars` | `200` | 超过此长度的任务一律不算模糊;简短任务提到文件名、路径、URL、下划线关键词或连字符关键词即为具体。 |
|
|
197
|
-
| `remindOnce` | `true` | 每道门每个会话最多注入一次提醒——持久化:从日志折叠,重启/恢复后不会重复。 |
|
|
198
|
-
| `testToolNames` | `['bash', 'pwsh']` | 可运行测试的 shell 工具名。 |
|
|
199
|
-
| `testCommandPatterns` | *(pnpm/npm/yarn/bun test、pytest、go/cargo/make test、node --test、deno test、uv run pytest)* | 命令需匹配的正则才算测试运行。 |
|
|
200
|
-
| `testFilePatterns` | *(测试目录、`*.test.*`/`*.spec.*`)* | 识别测试文件的正则——永远可编辑,豁免 red 门。 |
|
|
201
|
-
| `adversaryModel` | `null` | critic 模型路由;`null` = 主模型自评。 |
|
|
202
|
-
| `adversaryProvider` | `'fork'` | critic 使用的 subagent provider 名。 |
|
|
203
|
-
| `adversaryMaxFindings` | `5` | 注入会话的 findings 上限(1–20)。 |
|
|
204
|
-
| `adversaryTools` | `['read', 'glob', 'grep']` | critic 工具白名单;保持只读。 |
|
|
205
|
-
| `adversaryTimeoutMs` | `120000` | 单次评审的硬性时间预算。 |
|
|
206
|
-
|
|
207
|
-
配置错误响亮失败:非法正则、空/重复名称列表、findings 上限越界都会在加载时抛错,而不是悄悄什么都不做。评审跑不起来(接缝缺失、provider 失败、超时)时,以诚实的「unavailable」通知落入会话。
|
|
208
|
-
|
|
209
|
-
### 报告参数(grill 行)
|
|
210
|
-
|
|
211
|
-
| 键 | 默认 | 含义 |
|
|
212
|
-
|---|---|---|
|
|
213
|
-
| `reportFile` | `'doublecheck-report.md'` | 接收报告 markdown 的工作区文件。 |
|
|
214
|
-
| `reportVerify` | `true` | 工具 `verify` 参数的默认值。 |
|
|
215
|
-
| `verifyProvider` | `'fork'` | 逐维度核对员使用的 subagent provider。 |
|
|
216
|
-
| `verifyMode` | `'all'` | `all` = 每维度并行一个核对员;`single` = 合并为一个核对员(单个子代理,更省)。 |
|
|
217
|
-
| `reportTestToolNames` / `reportTestCommandPatterns` | *(与 guard 行同默认)* | 报告侧测试运行分类。 |
|
|
218
|
-
| `reportMutationTools` / `reportTestFilePatterns` | *(与 guard 行同默认)* | 报告侧实现编辑分类。 |
|
|
175
|
+
## 3. Implementation consistency — WARN
|
|
176
|
+
- [⚠] **[minor] src/telemetry.ts touched without a requirement** — [minor] the edit adds a metric no spec dimension covers
|
|
219
177
|
|
|
220
|
-
|
|
178
|
+
## 4. Review conclusion — PASS
|
|
179
|
+
- [✔] **dsh-auto-review conclusion** — 3 call(s) approved by dsh-auto-review (latest risk: low)
|
|
221
180
|
|
|
222
|
-
##
|
|
181
|
+
## Red items
|
|
182
|
+
1. **tests/coverage** — 61% coverage below the 80% minimum — *rework: raise coverage above the configured minimum*
|
|
183
|
+
2. **consistency/finding-1** — [minor] the edit adds a metric no spec dimension covers — *rework: src/telemetry.ts touched without a requirement*
|
|
223
184
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
| 需求门 | `tools/pre-execute` waterfall —— `allow` / `ask`(审批接缝)/ `deny` |
|
|
230
|
-
| red 门 | `tools/pre-execute` waterfall —— 实现改动前硬校验失败测试证据 |
|
|
231
|
-
| 提醒注入 | `tools/post-execute` waterfall —— `additionalContexts` → 记录为 `user/message` |
|
|
232
|
-
| green 门 | `agent/turn-stopping` serial —— 改动后无通过测试运行时注入完成提醒 |
|
|
233
|
-
| 对抗评审 | `ctx.subagents.start()` —— fork critic + 结构化 findings schema,green 后注入;`warn`/`block` 额外 steer 一轮 |
|
|
234
|
-
| 交付报告 | `doublecheck_report` 工具 —— 会话日志折叠 + 工作区 markdown |
|
|
235
|
-
| 核对 workflow | `ctx.workflowEngine.start()` —— 每个 spec 维度并行一个核对员,结构化 checks |
|
|
236
|
-
| 持久化状态 | 会话日志折叠 `tool/call` + `tool/result` + `tool/code-dispatch` + 注入的结构化消息源;模型可见 ⟺ 已记录 |
|
|
237
|
-
| 会话命令 | `ctx.commands.register()` —— `/doublecheck status|report|on|off`;`on|off` 写入持久 `doublecheck/state` 会话事件 |
|
|
238
|
-
| 包内事件 | `doublecheck/spec`、`doublecheck/reminder`、`doublecheck/review`、`doublecheck/report`(declaration merging 类型化,`@mode emit`) |
|
|
239
|
-
|
|
240
|
-
不改 agent-loop。所有注册都是可逆的 `ctx.effect` / `ctx.on` / 服务 `register()`。
|
|
241
|
-
|
|
242
|
-
## 模型会看到什么
|
|
243
|
-
|
|
244
|
-
- `grill-requirements` 技能进入会话技能目录,可通过内置 `skill` 工具(或 `doublecheck_skills`)加载。
|
|
245
|
-
- `ask_user_question` 仍是 DSH 原生提问方式;技能只负责编排(无 provider 的 headless 环境下自动降级为纯文本提问)。
|
|
246
|
-
- 提醒以 `{kind:'plugin'}` 上下文到达,转录 UI 会将其展示为注入元数据。
|
|
247
|
-
- 对抗评审意见在 critic 结算后以同样方式注入,带严重级标记的 findings;`warn`/`block` 下还会 steer 一轮,让模型正面回应这些 findings。
|
|
248
|
-
- `doublecheck_report` 把汇总报告作为工具结果返回(spec、测试时间线、评审、核对、verdict),"证明交付"一次调用即可完成。
|
|
249
|
-
|
|
250
|
-
## 会话命令
|
|
185
|
+
## Audit
|
|
186
|
+
- review engine: dsh-auto-review
|
|
187
|
+
- generated at: 2026-08-14T12:00:00.000Z
|
|
188
|
+
- counts, ids, and verdicts only: no file contents or session text are embedded, and recognized secrets are redacted.
|
|
189
|
+
````
|
|
251
190
|
|
|
252
|
-
|
|
253
|
-
/doublecheck status|report|on|off
|
|
254
|
-
```
|
|
191
|
+
## 权限与数据
|
|
255
192
|
|
|
256
|
-
- `
|
|
257
|
-
- `report`
|
|
258
|
-
-
|
|
193
|
+
- **读取**:仅进程内读取会话日志(`tool/call` / `tool/result` / `tool/code-dispatch`、注入的 `user/message` 来源,以及外部的 `autoReview/*` 裁决记录);可选的计划模式服务状态。
|
|
194
|
+
- **写入**:会话工作区中的 `doublecheck-spec.md`、`doublecheck-report.md` 和 `gate-report.md`(路径可配置),通过 `ctx.fs` 接口;持久的 `doublecheck/state` 和 `doublecheck/gate` 会话事件。
|
|
195
|
+
- **模型调用**:门禁的一致性阶段和本地评审阶段(每次 `/gate run` 各一个 subagent)、可选的对抗式评审,以及 `doublecheck_report` 验证工作流会启动 subagent 运行;除此之外不调用模型或网络。
|
|
196
|
+
- **绝不触碰**:凭据、环境变量,或会话工作区之外的任何文件。workshop 清单只声明 `filesystem:read` 和 `filesystem:write`。门禁报告只携带计数、id 和裁决;评审文本中被识别的机密在存储或显示之前会被脱敏。
|
|
259
197
|
|
|
260
|
-
|
|
198
|
+
## 安全边界
|
|
261
199
|
|
|
262
|
-
|
|
200
|
+
- **模型可见 ⟺ 已记录。** 每条注入的提醒、评审和门禁通知都经由标准通道并落入会话日志;持久的 spec/state/gate 事实经由工具结果或 `SessionEventMap` 成员。
|
|
201
|
+
- **失败关闭 / 大声失败。** 守卫和门禁配置在 `apply` 中校验(断言抛错);无法运行的评审者或对抗式接口会退化为诚实的 "unavailable"/跳过通知,而非伪造裁决。
|
|
202
|
+
- **审计安全报告。** 门禁和交付报告只记录计数、id 和裁决——不含文件内容或会话文本——模型生成的发现文本在存储或显示之前会经过机密脱敏器。
|
|
203
|
+
- **自身无网络。** 该插件不发起直接网络请求;批评者和评审者 subagent 经由宿主的 subagent 接口运行。
|
|
204
|
+
- **对 dsh-auto-review 的弱依赖。** 它从不被 import 或硬性要求;门禁折叠其持久裁决记录并降级到本地评审者,且从不合成审批请求。
|
|
263
205
|
|
|
264
|
-
|
|
206
|
+
## 已知限制
|
|
207
|
+
|
|
208
|
+
- **rc.6 上的持久写入。** `/doublecheck on\|off` → `doublecheck/state` 与 `/gate run` → `doublecheck/gate` 需要宿主的 `ignorable` 追加接口(rc.6 之后);在 rc.6 宿主上选项包被忽略,事件保持必需读取,因此开关停留在内存中,门禁记录只存在于命令结果 + 工作区文件,直到升级宿主。
|
|
209
|
+
- **可选接口。** `doublecheck.gate` 设置命名空间仅在挂载设置服务时注册;`/gate status` 的计划模式行读取可选的 `ctx.planMode`(没有则显示 `unknown`);对抗式评审需要 `ctx.subagents`;验证需要 `workflowEngine`。
|
|
210
|
+
- **本地降级。** 当 dsh-auto-review 缺失或本会话没有裁决记录时,`gate.review.engine: auto` 会降级到本地评审者——报告会写明原因,而不是捏造裁决。
|
|
265
211
|
|
|
266
212
|
## 开发
|
|
267
213
|
|
|
268
214
|
```sh
|
|
269
|
-
pnpm install
|
|
270
|
-
pnpm run
|
|
271
|
-
pnpm run
|
|
272
|
-
pnpm run test
|
|
273
|
-
pnpm run
|
|
215
|
+
pnpm install # node ^22.19 || >=24
|
|
216
|
+
pnpm run build # tsc --noEmitOnError (lib/ is committed)
|
|
217
|
+
pnpm run prepare # tsc --noEmitOnError (git-install channel)
|
|
218
|
+
pnpm run prepublishOnly # build + full test suite
|
|
219
|
+
pnpm run typecheck # tsc --noEmit + tests tsconfig
|
|
220
|
+
pnpm run lint # eslint src tests
|
|
221
|
+
pnpm test # vitest run
|
|
222
|
+
pnpm run test:coverage # vitest run --coverage
|
|
223
|
+
pnpm run pack:check # build + pack the tarball
|
|
274
224
|
```
|
|
275
225
|
|
|
276
|
-
##
|
|
226
|
+
## 主题
|
|
227
|
+
|
|
228
|
+
`dsh`, `dsh-plugin`, `deepseek-harness`, `engineering-discipline`, `requirements`, `guard`, `skill`, `quality-gate`, `delivery-gate`
|
|
277
229
|
|
|
278
|
-
|
|
230
|
+
## 贡献者
|
|
231
|
+
|
|
232
|
+
- [@PerryLink](https://github.com/PerryLink) —— 创建者与维护者:grill → design → red → green → review → verify 纪律闭环、四阶段交付门禁、五语言文档,以及 CI/发布流水线。
|
|
233
|
+
|
|
234
|
+
## PerryLink DSH Plugin Family
|
|
235
|
+
|
|
236
|
+
本项目是 [PerryLink](https://github.com/PerryLink) 维护的 [15 个 DeepSeek Harness 插件](https://github.com/PerryLink)之一。如果这个对你有所帮助,其余的很可能也会帮到你:
|
|
237
|
+
|
|
238
|
+
| Plugin | One-liner |
|
|
239
|
+
|---|---|
|
|
240
|
+
| [dsh-mcp-panel](https://github.com/PerryLink/dsh-mcp-panel) | Read-only MCP runtime panel: /mcp command + Settings tab with status, tools and errors |
|
|
241
|
+
| **[dsh-doublecheck](https://github.com/PerryLink/dsh-doublecheck)** | Engineering-discipline guard + delivery quality gate: requirements grill, test gates, adversary review, /gate deliverable/rework panel |
|
|
242
|
+
| [dsh-background-agents](https://github.com/PerryLink/dsh-background-agents) | Durable background child agents with a Web UI sidebar, messaging and interrupt |
|
|
243
|
+
| [dsh-lsp-actions](https://github.com/PerryLink/dsh-lsp-actions) | LSP diagnostics, formatting, completion, code actions and rename over language servers |
|
|
244
|
+
| [dsh-output-styles](https://github.com/PerryLink/dsh-output-styles) | Claude Code outputStyles-equivalent runtime style switching |
|
|
245
|
+
| [dsh-checkpoint-rewind](https://github.com/PerryLink/dsh-checkpoint-rewind) | Claude Code /rewind-equivalent: snapshots, session forks, one-shot restore |
|
|
246
|
+
| [dsh-permission-rules](https://github.com/PerryLink/dsh-permission-rules) | Claude Code-style declarative allow/deny/ask permission rules with audit |
|
|
247
|
+
| [dsh-auto-review](https://github.com/PerryLink/dsh-auto-review) | Second-model auto-review on the approval chain, fail-closed by default |
|
|
248
|
+
| [dsh-memento](https://github.com/PerryLink/dsh-memento) | Approval-gated cross-session memory: ctx.memory seam + SQLite + memory tool |
|
|
249
|
+
| [dsh-skill-pack-security](https://github.com/PerryLink/dsh-skill-pack-security) | Security-audit skill pack: secret scan, dependency and supply-chain review |
|
|
250
|
+
| [dsh-session-pin](https://github.com/PerryLink/dsh-session-pin) | Pin sessions in the Web sidebar with durable ordering |
|
|
251
|
+
| [dsh-composer-history](https://github.com/PerryLink/dsh-composer-history) | Terminal-style input history for the web composer: arrows, Ctrl+R search |
|
|
252
|
+
| [dsh-github](https://github.com/PerryLink/dsh-github) | GitHub PR/issues integration for DSH, every write gated by approval |
|
|
253
|
+
| [dsh-plugin-guide](https://github.com/PerryLink/dsh-plugin-guide) | Plugin-development knowledge base as an on-demand agent skill |
|
|
254
|
+
| [dsh-claude-move](https://github.com/PerryLink/dsh-claude-move) | Migrate Claude Code sessions, memory, skills and CLAUDE.md into DSH |
|
|
279
255
|
|
|
280
256
|
## 许可证
|
|
281
257
|
|
|
282
|
-
[Apache
|
|
258
|
+
[Apache License 2.0](LICENSE) © 2026 dsh-doublecheck contributors
|