dsh-doublecheck 0.7.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 +7 -4
- package/README.es.md +181 -400
- package/README.hi.md +180 -399
- package/README.md +161 -380
- package/README.pt.md +180 -399
- package/README.zh.md +180 -399
- package/lib/domain/gate.d.ts +2 -2
- package/lib/domain/projection.d.ts +4 -4
- package/lib/domain/report.d.ts +2 -2
- package/lib/domain/stages.d.ts +1 -1
- package/lib/events.d.ts +4 -4
- package/lib/grill/index.d.ts +1 -1
- package/lib/guard/command.d.ts +2 -2
- package/lib/guard/gate.d.ts +3 -3
- package/lib/guard/index.d.ts +5 -5
- package/lib/guard/index.js +4 -2
- package/lib/guard/review.d.ts +2 -2
- package/lib/index.d.ts +10 -10
- package/lib/invariant.d.ts +1 -1
- package/lib/types.d.ts +2 -2
- package/package.json +9 -4
package/README.zh.md
CHANGED
|
@@ -1,76 +1,157 @@
|
|
|
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
|
-
[](https://www.npmjs.com/package/dsh-doublecheck)
|
|
8
|
-
[](LICENSE)
|
|
9
|
-
[](https://github.com/topics/dsh-plugin)
|
|
10
|
-
[](https://github.com/PerryLink/dsh-doublecheck/actions/workflows/ci.yml)
|
|
7
|
+
*需求在第一次改动之前就被拷问清楚;交付是被证明的,而不是被口头宣称的。*
|
|
11
8
|
|
|
12
|
-
|
|
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)
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
[English](README.md) · [简体中文](README.zh.md) · [Español](README.es.md) · [Português](README.pt.md) · [हिन्दी](README.hi.md)
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
</div>
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
- 有纪律的团队由人执行这套流程:需求评审 → 失败测试 → 通过测试 → 自审 → 交付证明。智能体值得拥有同样的循环,而且由 harness 强制,不靠玄学。
|
|
20
|
-
- 交付需要一个决策,而不是一种感觉。交付门禁把循环中的证据收敛成一个**可交付 / 需返工**结论,附带红灯项与返工建议——这就是评测平台贴进 PR 描述的那块面板。
|
|
21
|
+
---
|
|
21
22
|
|
|
22
|
-
##
|
|
23
|
+
## 兼容性
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
| 方面 | 状态 |
|
|
26
|
+
|---|---|
|
|
27
|
+
| Harness | DeepSeek Harness `0.1.0-rc.6` |
|
|
28
|
+
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
29
|
+
| 平台 | 全部(纯宿主;无原生代码,自身无直接网络请求) |
|
|
30
|
+
| 模型 | 任意(守卫本身从不调用模型;评审与批评阶段作为宿主 subagent 运行) |
|
|
31
|
+
|
|
32
|
+
## 你会得到什么
|
|
33
|
+
|
|
34
|
+
`dsh-doublecheck` 安装两个插件行,它们读取并执行同一份持久会话日志:
|
|
35
|
+
|
|
36
|
+
1. **`doublecheck-grill`** —— 需求熔炉:内置的 `grill-requirements` 技能,加上面向模型的 `doublecheck_skills`、`doublecheck_spec`、`doublecheck_report` 工具,以及按维度执行的验证工作流。
|
|
37
|
+
2. **`doublecheck-guard`** —— 纪律守卫:grill 门禁、红/绿证据门禁、对抗式评审、`/doublecheck` 与 `/gate` 命令、`doublecheck.gate` 设置命名空间,以及四阶段交付门禁。
|
|
38
|
+
|
|
39
|
+
两者共同执行**纪律闭环** —— *grill → design → red → green → review → verify*:
|
|
40
|
+
|
|
41
|
+
```text
|
|
25
42
|
grill ──▶ design ──▶ red ──▶ green ──▶ review ──▶ verify
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
└─ 需求熔炉:六个维度、共识门、
|
|
30
|
-
结构化 spec 落入会话与工作区
|
|
43
|
+
│
|
|
44
|
+
└─ 六个需求维度、共识门禁,
|
|
45
|
+
结构化 spec 提交到会话 + 工作区
|
|
31
46
|
```
|
|
32
47
|
|
|
33
|
-
| 阶段 | 含义 |
|
|
34
|
-
|
|
35
|
-
| **grill** |
|
|
36
|
-
| **design** | 通过 `doublecheck_spec`
|
|
37
|
-
| **red** |
|
|
38
|
-
| **green** |
|
|
39
|
-
| **review** |
|
|
40
|
-
| **verify** | `doublecheck_report` +
|
|
41
|
-
|
|
42
|
-
##
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
F -- 是 --> G["结论:需返工"]
|
|
54
|
-
F -- 否 --> H["结论:可交付"]
|
|
55
|
-
G --> I["建议转 plan mode 复查 + 重新 /gate run"]
|
|
56
|
-
H --> J["把报告贴进 PR 描述"]
|
|
48
|
+
| 阶段 | 含义 |
|
|
49
|
+
|---|---|
|
|
50
|
+
| **grill** | 拷问六个需求维度;在达成共识之前拒绝实现。 |
|
|
51
|
+
| **design** | 通过 `doublecheck_spec` 提交已确定的 spec。 |
|
|
52
|
+
| **red** | 在实现改动之前,用一次失败的测试运行来证明差距。 |
|
|
53
|
+
| **green** | 改动之后一次通过的测试运行闭合闭环。 |
|
|
54
|
+
| **review** | 一个分叉的对抗式批评者对照 spec 审计交付。 |
|
|
55
|
+
| **verify** | `doublecheck_report` + 按维度的验证工作流证明交付。 |
|
|
56
|
+
|
|
57
|
+
## 快速开始
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
# 1. install the bundle into your profile
|
|
61
|
+
dsh plugin --profile web add "github:PerryLink/dsh-doublecheck#main"
|
|
62
|
+
|
|
63
|
+
# or from npm (published releases)
|
|
64
|
+
dsh plugin --profile web add dsh-doublecheck
|
|
65
|
+
|
|
66
|
+
# 2. restart and verify the row
|
|
67
|
+
dsh --profile web --dump-config | grep -E -A3 'id: doublecheck-(grill|guard)'
|
|
57
68
|
```
|
|
58
69
|
|
|
70
|
+
两个行(`doublecheck-grill` 和 `doublecheck-guard`)随配置文件自动激活。
|
|
71
|
+
|
|
72
|
+
## 安装与卸载
|
|
73
|
+
|
|
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`(或从配置文件补丁中移除这些行)。
|
|
78
|
+
|
|
79
|
+
如需零配置的严格模式(每个门禁都以 `block` 强度开启、要求门禁覆盖率),在捆绑补丁之上应用随附的覆盖层:`dsh --profile web --patch ./node_modules/dsh-doublecheck/strict.patch.yml`。
|
|
80
|
+
|
|
81
|
+
## 配置
|
|
82
|
+
|
|
83
|
+
所有可调项都是 Schemastery 的 `Config` 字段(可在 cordis.yml 中修改)。按 id 定位的覆盖会替换整行——请重新声明你需要的每一个键。`cordis.patch.yml` 逐键内联说明;Schema 默认值是调优默认值的唯一来源。
|
|
84
|
+
|
|
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` 注册表报告包自有写路径矛盾。 |
|
|
138
|
+
|
|
139
|
+
## 门禁阶段
|
|
140
|
+
|
|
141
|
+
交付门禁把会话的持久证据聚合为可配置的四阶段清单,并确定一个 **可交付 / 需要返工** 的裁决。每个阶段只折叠会话日志(重放即状态),因此一次运行在恢复或分叉后会得到相同的结果。
|
|
142
|
+
|
|
59
143
|
| 阶段 | 检查 | 证据来源 | 模型成本 |
|
|
60
144
|
|---|---|---|---|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
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(本地) |
|
|
65
149
|
|
|
66
|
-
|
|
67
|
-
- **警告与跳过不会翻转决策**:跳过评审时报告如实声明"未经评审",绝不虚构红灯——对"声称" fail-closed,对"证据"永不造假。
|
|
68
|
-
- **Plan mode 与审批衔接**:需返工结论会建议转 plan mode 复查(报告横幅、`/gate status` 面板、以及每会话一次的轮次提醒)。下方纪律门保留各自的 `warn`/`block` 审批链强制;门禁本身是建议性的。
|
|
69
|
-
- **审计安全由构造保证**:报告只记录计数、id 与结论——不包含文件内容与会话文本。评审产生的文本先经过密钥脱敏(云密钥、token、私钥块、密码赋值、长 hex/base64 串)再存储或展示。结算状态落在持久 `doublecheck/gate` 会话事件与工作区 `gate-report.md` 中。
|
|
150
|
+
红灯是失败的检查(缺失 spec、最近运行失败、覆盖率低于下限、未映射的改动、blocker/major 发现)——每一项都附带返工建议。警告与跳过永远不会翻转裁决。门禁将 [dsh-auto-review](https://github.com/PerryLink/dsh-auto-review) 作为弱依赖集成:`review.engine: auto` 在存在时折叠其裁决记录,否则降级到本地评审者;门禁从不合成审批请求。
|
|
70
151
|
|
|
71
|
-
|
|
152
|
+
## 示例报告
|
|
72
153
|
|
|
73
|
-
`/gate run`
|
|
154
|
+
`/gate run` 返回这份 markdown——可直接粘贴到 PR 描述中:
|
|
74
155
|
|
|
75
156
|
````markdown
|
|
76
157
|
# Delivery gate report
|
|
@@ -107,371 +188,71 @@ flowchart TD
|
|
|
107
188
|
- counts, ids, and verdicts only: no file contents or session text are embedded, and recognized secrets are redacted.
|
|
108
189
|
````
|
|
109
190
|
|
|
110
|
-
### 与 dsh-auto-review 的弱依赖
|
|
111
|
-
|
|
112
|
-
门禁与 [dsh-auto-review](https://github.com/PerryLink/dsh-auto-review) 的集成是**"引擎可用则用"**,绝不是硬依赖:
|
|
113
|
-
|
|
114
|
-
- `review.engine: auto`(默认)从会话日志折叠引擎的持久裁决记录(`autoReview/verdict` / `autoReview/rejection`)——即引擎对本会话审批链审查的真实结论。被拒绝或高风险的调用成为红灯项。
|
|
115
|
-
- 没有记录(引擎未安装,或本会话尚无触发它的审批)→ 该阶段降级为本地 fork 评审员,并在警告检查上注明原因:`dsh-auto-review is not installed` / `dsh-auto-review is installed but has no verdict records in this session`。
|
|
116
|
-
- 门禁**从不合成审批请求**:那条链可能到达真人。引擎自己的记录就是证据;`engine: local` 则完全跳过引擎。
|
|
117
|
-
|
|
118
|
-
### 设置面板
|
|
119
|
-
|
|
120
|
-
可插拔检查单本身就是 Schema 校验的配置(守卫行的 `gate.*`),并且在 harness 设置服务挂载时额外注册为 **`doublecheck.gate` 设置命名空间**(`expose: true`、`applies: restart`)——支持设置的 UI 可以直接读取和编辑检查单,无需手改 profile。
|
|
121
|
-
|
|
122
|
-
## 功能
|
|
123
|
-
|
|
124
|
-
- 🔥 **`grill-requirements` 技能** — 内置的 Agent-Skills 格式技能,围绕六个维度(**目标、范围、验收标准、失败模式、优先级、非目标**)盘问任务,使用 DSH 原生 `ask_user_question` UI,在达成共识前拒绝写代码,并记录契约。
|
|
125
|
-
- 🧰 **覆盖全循环的阶段技能** — `red-green-tdd`(先写失败测试、跑红、实现、跑绿)、`delivery-review`(变绿后对照 spec 的对抗式自审)、`delivery-proof`(汇总证据成交付报告,并在声称完成前过交付门禁)与 `grill-requirements` 一起,让六个阶段都有模型指引,而不只是第一阶段。
|
|
126
|
-
- 📜 **`doublecheck_spec` 工具** — 把盘问出的 spec 提交进会话日志并写入工作区 Markdown 副本,让契约在会话结束后仍然存在。空或纯空白维度在提交时被拒绝(v0.6):盘问必须敲定全部六个维度,spec 才算数。
|
|
127
|
-
- 🔄 **任务变更重新盘问** — 已提交的 spec 只覆盖它自己的任务:最新 spec 提交之后出现的新的直接用户请求会重新打开盘问门,而不是默默继承旧契约。
|
|
128
|
-
- 🛡️ **纪律守卫** — 工具策略管线上的软门。模糊任务 + 无 spec + 准备 `edit`/`write` → 依 `intensity` **提醒**、**扣留等人工审批** 或 **拦截**。
|
|
129
|
-
- 🟥🟩 **红绿证据门**(`modules.tdd`)— 会话日志上的硬检查:实现编辑要求自上次通过以来**有失败测试运行留痕**(测试文件永远可编辑——红步就是这么发生的),轮次结束时仍有编辑但无通过运行则注入绿门提醒。自定义守卫工具开箱即用:门同时识别 `file_path` 与 `path` 参数键,未命名任何文件的调用不视为实现编辑。
|
|
130
|
-
- 👁️ **对抗式审查**(`modules.adversary`)— 交付到达 green 后,一个 fork 出来的审查者子代理(DSH 原生子代理 seam,默认 `fork` provider)以对抗姿态对照已提交 spec 审计会话,返回 blocker 优先排序的结构化发现。`remind` 注入批评;`warn`/`block` 额外 steer 一轮让模型回应发现。`adversaryModel` 把审查者路由到独立模型;审查者工具白名单默认为只读。发现落在持久 `doublecheck-review` 消息源上。审查结清后重新武装:最新审查记录之后的实现编辑触发新一轮,取消轮次会中止进行中的审查者。
|
|
131
|
-
- 🚦 **交付质量门禁**(v0.7)— 上述四阶段可配置检查单:需求质询(关键问题逐项确认)、测试证据(运行红绿、失败用例、覆盖率阈值)、实现一致性(本地评审员的 diff ↔ 需求映射)、评审结论(dsh-auto-review 裁决记录 + 诚实的本地降级)。一个**可交付 / 需返工**决策、带返工建议的红灯项、红灯时的 plan mode 复查建议、轮次边界的红灯提醒(短小、每会话一次)、以及可贴 PR 的 Markdown 报告。
|
|
132
|
-
- ⌨️ **`/gate` 会话命令** — `status` 渲染实时检查单进度(确定性阶段即时折叠;评审类阶段显示最近一次运行),`run` 结算完整门禁并返回报告,`config` 渲染生效中的检查单与阈值。
|
|
133
|
-
- 🌐 **全量本地化的模型可见面** — 包注入或回答的每一条模型可见字符串(提醒、拒绝/询问反馈、评审 steering、门禁提醒、开关通知、`/doublecheck` 与 `/gate` 回复、评审任务提示词)都遵循 `language: 'en' | 'zh'`;工作区 spec/report/gate 文档保持稳定的英文标题与审计 id。
|
|
134
|
-
- 📊 **Doublecheck 报告 + 验证工作流**(`doublecheck_report`,v0.4)— 把会话纪律证据(spec、红绿时间线、评审发现、编辑)汇总成带派生结论(`grill → draft → red → green → objections/verified → proven/challenged/unverified`)的交付报告并写入工作区。带 `verify` 时,逐维度检查员经 DSH 工作流 seam 运行(`verifyMode: all` 每个维度并行一个检查员;`single` 一个组合检查员),其结论并入报告——`proven` 要求每个维度都有结论。
|
|
135
|
-
- 🚦 **交付门** — 轮次边界处,已达 green 却无 `doublecheck_report` 留痕的交付在声称完成前收到"期望报告"提醒;一次成功的报告把阶段折叠推进到 `verify`。
|
|
136
|
-
- 🔁 **持久状态** — 每个模型可见工件(spec、提醒、拒绝反馈、评审发现、门禁运行、`/doublecheck on|off` 开关)都落入会话日志;门禁决策只从日志推导(`tool/call` + `tool/result`,含 Code Mode 子分发),因此恢复与 fork 的会话以完全相同的方式执行。`remindOnce` 同样持久:已收到过提醒的会话不会收到第二次,即使重启之后。开关折叠走增量快照,长会话每次工具调用保持 O(新事件)。
|
|
137
|
-
- ⌨️ **`/doublecheck` 会话命令** — `status` 报告生效开关、已配置模块、执行强度、折叠阶段事实与最近门禁结论;`report` 现场折叠交付报告;`on|off` 写入持久 `doublecheck/state` 覆盖并注入开关通知。
|
|
138
|
-
- 📚 **`doublecheck_skills` 工具** — 通过官方技能注册表 seam 列出并加载本包技能。
|
|
139
|
-
- 🔒 **严格覆盖层** — `strict.patch.yml` 在一个补丁层中把所有门开到 `block` 强度并启用覆盖率要求(80%)(随包发布)。
|
|
140
|
-
- 🧩 **独立 invariant 伴生行** — `dsh-doublecheck/invariant` 是真实的 subpath 导出:通过宿主 `invariants` 注册表报告本包写路径矛盾(spec/report/review/gate 形态与结论一致性),无需加载守卫。
|
|
141
|
-
|
|
142
|
-
## 演示
|
|
143
|
-
|
|
144
|
-
一次真实的无头运行,`intensity: block` 且全部门开启,转录自持久会话日志:
|
|
145
|
-
|
|
146
|
-
```sh
|
|
147
|
-
dsh --profile demo headless "把这个项目里最慢的代码直接改快,别问我任何问题,直接改文件。"
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
1. **grill** 拦截第一次编辑——没有 spec 留痕:
|
|
151
|
-
`Error: Blocked by the dsh-doublecheck requirements guard: the task statement is vague and no doublecheck_spec exists for this session.`
|
|
152
|
-
2. 模型提交 spec(`doublecheck_spec`)、写失败测试(测试文件永远可编辑)并运行——日志记录 `[exit code: 1]`,即红步。
|
|
153
|
-
3. 实现编辑放行;后续运行记录 `4 passed`,即绿步。
|
|
154
|
-
4. fork 审查者审计交付;带严重度标签的发现被注入,`warn`/`block` 会 steer 一轮让模型回应。
|
|
155
|
-
5. `doublecheck_report` 把一切折叠成带派生结论的 Markdown 报告——每个逐维度验证检查都通过时为 `proven`,检查员反对时为 `challenged`。
|
|
156
|
-
6. **`/gate run`** 结算四阶段检查单,输出**可交付 / 需返工**决策;红灯结论列出红灯项与返工建议,并建议转 plan mode 复查。
|
|
157
|
-
|
|
158
|
-
## 安装
|
|
159
|
-
|
|
160
|
-
```sh
|
|
161
|
-
dsh plugin --profile <name> add dsh-doublecheck
|
|
162
|
-
dsh --profile <name> --dump-config # 期望出现 "# == dsh-doublecheck" 层
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
两个插件行随 profile 自动激活。tarball 安装同样可用:
|
|
166
|
-
|
|
167
|
-
```sh
|
|
168
|
-
pnpm pack
|
|
169
|
-
dsh plugin --profile <name> add ./dsh-doublecheck-0.7.0.tgz
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
Git 安装不需要 npm:
|
|
173
|
-
|
|
174
|
-
```sh
|
|
175
|
-
dsh plugin --profile <name> add "github:PerryLink/dsh-doublecheck#v0.7.0"
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
零配置严格模式(全门开启、`block` 强度、门禁覆盖率必查),在 bundle 补丁之上叠加随包覆盖层:
|
|
179
|
-
|
|
180
|
-
```sh
|
|
181
|
-
dsh --profile <name> --patch ./node_modules/dsh-doublecheck/strict.patch.yml
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
## 卸载
|
|
185
|
-
|
|
186
|
-
```sh
|
|
187
|
-
dsh plugin --profile <name> remove dsh-doublecheck
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
保留包但停用某一行,在 profile 的 `cordis.patch.yml` 中按 id 覆写 `disabled: true`(`doublecheck-grill` / `doublecheck-guard`)。
|
|
191
|
-
|
|
192
|
-
## 兼容性
|
|
193
|
-
|
|
194
|
-
- 已针对 `0.1.0-rc.6` peers 实测(`@deepseek-ai/cordis ^4.0.1`);最近一次验证 2026-08-14,Windows + Node 22。
|
|
195
|
-
- 持久会话写入(`/doublecheck on|off` → `doublecheck/state`、`/gate run` → `doublecheck/gate`)需要宿主的 `ignorable` 追加接口(rc.6 之后的 harness):在 rc.6 宿主上选项包被忽略且事件保持必读,因此开关停留在内存中、门禁记录只存在于命令结果与工作区文件,直到 harness 升级。
|
|
196
|
-
- `doublecheck.gate` 设置命名空间只在 harness 设置服务挂载时注册;没有该服务的 profile 就没有设置面板。
|
|
197
|
-
- `/gate status` 的 `plan mode:` 一行读取可选的 `ctx.planMode` 服务;没有它的 profile 显示 `unknown`。
|
|
198
|
-
|
|
199
191
|
## 权限与数据
|
|
200
192
|
|
|
201
|
-
-
|
|
202
|
-
- **写入**:会话工作区中的 `doublecheck-spec.md`、`doublecheck-report.md`
|
|
203
|
-
-
|
|
204
|
-
-
|
|
205
|
-
|
|
206
|
-
## 故障排查
|
|
207
|
-
|
|
208
|
-
| 症状 | 原因与修复 |
|
|
209
|
-
|---|---|
|
|
210
|
-
| `--dump-config` 中没有 `# == dsh-doublecheck` 层 | bundle 补丁缺失或某行 `disabled` — 检查 profile 补丁顺序与行 id。 |
|
|
211
|
-
| 门从不反应 | 运行 `/doublecheck status`:会话开关可能关闭,或守卫行的每个 `modules.*` 都是 false。 |
|
|
212
|
-
| "Adversary review did not run: the subagents seam is not mounted" | 该 profile 组合没有子代理 provider — 挂载一个(spine 组合有),或关闭 `modules.adversary`。 |
|
|
213
|
-
| `doublecheck_report` 显示 `verification: null` | 缺少 `workflowEngine` seam 或运行被拒绝/中止 — 报告如实说明而不是猜测。 |
|
|
214
|
-
| 报告显示 `unverified` | 验证已运行但不是每个 spec 维度都有结论 — 带 `verify: true` 重跑;`proven` 要求全部六个。 |
|
|
215
|
-
| `/gate run` 显示 `Review conclusion — WARN: dsh-auto-review is not installed` | 预期内的降级:该 profile 没有引擎行。安装 `dsh-auto-review`,或设 `gate.review.engine: local` 跳过检测。 |
|
|
216
|
-
| `/gate run` 显示 `Implementation consistency — SKIP` | 缺少 `subagents` seam(或运行超时)— 挂载子代理 provider;门禁绝不伪造结论。 |
|
|
217
|
-
| `/gate status` 显示 `plan mode: unknown` | 该 profile 没有 plan-mode 服务;建议仍会出现在报告与轮次提醒中。 |
|
|
218
|
-
| 会话日志中没有门禁记录 | 该 rc.6 宿主不盖章 `ignorable` 标记 — 记录只存在于命令结果与 `gate-report.md`。 |
|
|
219
|
-
|
|
220
|
-
## 配置
|
|
221
|
-
|
|
222
|
-
在 profile 的 `cordis.patch.yml` 中按 **id** 覆写任一行。补丁会替换整行配置——请重述每个键:
|
|
223
|
-
|
|
224
|
-
```yaml
|
|
225
|
-
- id: doublecheck-grill
|
|
226
|
-
config:
|
|
227
|
-
specFile: 'specs/doublecheck-spec.md' # 默认: 'doublecheck-spec.md'
|
|
228
|
-
reportFile: 'specs/doublecheck-report.md' # 默认: 'doublecheck-report.md'
|
|
229
|
-
reportVerify: true # 默认运行 verify 工作流
|
|
230
|
-
verifyProvider: 'fork' # 逐维度检查员的 provider
|
|
231
|
-
reportTestToolNames: ['bash', 'pwsh']
|
|
232
|
-
reportTestCommandPatterns:
|
|
233
|
-
- '(?:^|[;&|]\s*)(?:(?:pnpm|npm|npx|yarn|bun)(?:\s+run)?\s+(?:test|vitest|jest|mocha)(?:\s|$))'
|
|
234
|
-
- '(?:^|[;&|]\s*)(?:(?:pytest|go\s+test|cargo\s+test|make\s+test|ctest)(?:\s|$))'
|
|
235
|
-
- '(?:^|[;&|]\s*)(?:node\s+--test(?:\s|$))'
|
|
236
|
-
- '(?:^|[;&|]\s*)(?:deno\s+test|uv\s+run\s+pytest)(?:\s|$)'
|
|
237
|
-
reportMutationTools: ['edit', 'write']
|
|
238
|
-
reportTestFilePatterns:
|
|
239
|
-
- '(^|[\\/])(tests?|__tests__|specs?)([\\/]|$)'
|
|
240
|
-
- '\\.(test|spec)\\.[A-Za-z0-9]+$'
|
|
241
|
-
|
|
242
|
-
- id: doublecheck-guard
|
|
243
|
-
config:
|
|
244
|
-
intensity: warn
|
|
245
|
-
modules:
|
|
246
|
-
grill: true
|
|
247
|
-
tdd: true # 红绿证据门 (v0.2)
|
|
248
|
-
adversary: true # fork 审查 (v0.3)
|
|
249
|
-
adversaryModel: null # 或如 'deepseek-v4-pro' 用独立审查模型
|
|
250
|
-
adversaryProvider: 'fork' # 审查者所在的子代理 provider
|
|
251
|
-
adversaryMaxFindings: 5 # 注入会话的发现上限
|
|
252
|
-
adversaryTools: ['read', 'glob', 'grep'] # 审查者工具白名单(只读)
|
|
253
|
-
adversaryTimeoutMs: 120000 # 一次审查运行的硬预算
|
|
254
|
-
guardTools: ['edit', 'write']
|
|
255
|
-
vagueTaskMaxChars: 200
|
|
256
|
-
remindOnce: true
|
|
257
|
-
testToolNames: ['bash', 'pwsh']
|
|
258
|
-
testCommandPatterns:
|
|
259
|
-
- '(?:^|[;&|]\s*)(?:(?:pnpm|npm|npx|yarn|bun)(?:\s+run)?\s+(?:test|vitest|jest|mocha)(?:\s|$))'
|
|
260
|
-
- '(?:^|[;&|]\s*)(?:(?:pytest|go\s+test|cargo\s+test|make\s+test|ctest)(?:\s|$))'
|
|
261
|
-
- '(?:^|[;&|]\s*)(?:node\s+--test(?:\s|$))'
|
|
262
|
-
- '(?:^|[;&|]\s*)(?:deno\s+test|uv\s+run\s+pytest)(?:\s|$)'
|
|
263
|
-
testFilePatterns:
|
|
264
|
-
- '(^|[\\/])(tests?|__tests__|specs?)([\\/]|$)'
|
|
265
|
-
- '\\.(test|spec)\\.[A-Za-z0-9]+$'
|
|
266
|
-
gate:
|
|
267
|
-
enabled: true
|
|
268
|
-
planSuggestion: true
|
|
269
|
-
reportFile: 'gate-report.md'
|
|
270
|
-
requirements:
|
|
271
|
-
enabled: true
|
|
272
|
-
checklist:
|
|
273
|
-
- { id: goal, question: 'What outcome must the delivery produce?', specDimension: goal, required: true }
|
|
274
|
-
- { id: scope, question: 'What is in scope, and what is out of scope?', specDimension: scope, required: true }
|
|
275
|
-
- { id: acceptance, question: 'Which observable checks prove the work is done?', specDimension: acceptanceCriteria, required: true }
|
|
276
|
-
- { id: failureModes, question: 'What can go wrong, and what is the correct behavior in each case?', specDimension: failureModes, required: true }
|
|
277
|
-
- { id: priorities, question: 'What is traded when goals conflict; what is optional?', specDimension: priorities, required: true }
|
|
278
|
-
- { id: nonGoals, question: 'What does the user explicitly not want?', specDimension: nonGoals, required: true }
|
|
279
|
-
minConfirmed: 6
|
|
280
|
-
interrogateTool: 'ask_user_question'
|
|
281
|
-
tests:
|
|
282
|
-
enabled: true
|
|
283
|
-
requirePassingRun: true
|
|
284
|
-
allowFailingRuns: 0
|
|
285
|
-
requireCoverage: false
|
|
286
|
-
minCoveragePct: 80
|
|
287
|
-
coveragePattern: 'coverage[^\d]{0,40}(\d+(?:\.\d+)?)\s*%'
|
|
288
|
-
consistency:
|
|
289
|
-
enabled: true
|
|
290
|
-
provider: fork
|
|
291
|
-
model: null
|
|
292
|
-
tools: ['read', 'glob', 'grep']
|
|
293
|
-
timeoutMs: 120000
|
|
294
|
-
maxFindings: 5
|
|
295
|
-
review:
|
|
296
|
-
enabled: true
|
|
297
|
-
engine: auto # auto = 优先 dsh-auto-review 裁决记录,否则本地
|
|
298
|
-
provider: fork
|
|
299
|
-
model: null
|
|
300
|
-
tools: ['read', 'glob', 'grep']
|
|
301
|
-
timeoutMs: 120000
|
|
302
|
-
maxFindings: 5
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
随包的 `strict.patch.yml` 正是这份守卫行配置、`intensity: block`、全模块开启并启用门禁覆盖率要求——作为 bundle 补丁之后的补丁层应用,即可无需手改 profile 获得严格模式。
|
|
306
|
-
|
|
307
|
-
### `intensity`
|
|
308
|
-
|
|
309
|
-
| 值 | 对被门控的 `edit`/`write` 的行为 |
|
|
310
|
-
|---|---|
|
|
311
|
-
| `remind`(默认) | 调用放行;提醒随结果上下文进入下一次模型请求。 |
|
|
312
|
-
| `warn` | 调用经审批 seam 扣留等待一次性人工批准(无审批通道时拒绝)。 |
|
|
313
|
-
| `block` | 调用被拒绝,并反馈引导模型先补齐纪律。 |
|
|
314
|
-
|
|
315
|
-
### 可调参数
|
|
316
|
-
|
|
317
|
-
| 键 | 默认 | 含义 |
|
|
318
|
-
|---|---|---|
|
|
319
|
-
| `modules.grill` | `true` | 关闭则停用盘问门。盘问技能/工具的开关是其行的 `disabled` 标志。 |
|
|
320
|
-
| `modules.tdd` | `true` | 开启红绿证据门(v0.2);自 v0.5 起默认开启。 |
|
|
321
|
-
| `modules.adversary` | `false` | 开启变绿后的 fork 审查(v0.3);使用 `ctx.subagents` seam — seam 缺失时结算为"unavailable"通知。 |
|
|
322
|
-
| `enableByDefault` | `true` | 无 `/doublecheck on|off` 记录的会话的总开关。 |
|
|
323
|
-
| `language` | `'en'` | 注入的提醒/拒绝/评审/门禁文案语言(`en` / `zh`)。 |
|
|
324
|
-
| `guardTools` | `['edit', 'write']` | 两门监控的修改工具名。 |
|
|
325
|
-
| `vagueTaskMaxChars` | `200` | 更长的任务绝不视为模糊。提到文件、路径、URL、下划线关键词或连字符关键词的短任务是具体的。 |
|
|
326
|
-
| `remindOnce` | `true` | 每个门的提醒每会话至多注入一次 — 跨重启持久(从日志折叠)。 |
|
|
327
|
-
| `testToolNames` | `['bash', 'pwsh']` | 可以运行测试的 shell 工具名。 |
|
|
328
|
-
| `testCommandPatterns` | *(pnpm/npm/yarn/bun test、pytest、go/cargo/make test、node --test、deno test、uv run pytest)* | 命令必须匹配才算测试运行的正则。 |
|
|
329
|
-
| `testFilePatterns` | *(test 目录、`*.test.*` / `*.spec.*`)* | 识别测试文件的正则 — 永远可编辑,豁免红门。 |
|
|
330
|
-
| `adversaryModel` | `null` | 审查者模型路由;`null` = 主模型自审。 |
|
|
331
|
-
| `adversaryProvider` | `'fork'` | 审查者所在的子代理 provider 名。 |
|
|
332
|
-
| `adversaryMaxFindings` | `5` | 注入会话的发现上限(1–20)。 |
|
|
333
|
-
| `adversaryTools` | `['read', 'glob', 'grep']` | 审查者工具白名单;保持只读。 |
|
|
334
|
-
| `adversaryTimeoutMs` | `120000` | 一次审查运行的硬预算。 |
|
|
335
|
-
|
|
336
|
-
配置错误会响亮失败:非法正则、空/重复名称列表、越界发现上限都会在加载时抛错而不是默默失效。无法运行的审查者(seam 缺失、provider 失败、超时)在会话中结算为诚实的"unavailable"通知。
|
|
337
|
-
|
|
338
|
-
### 报告参数(grill 行)
|
|
339
|
-
|
|
340
|
-
| 键 | 默认 | 含义 |
|
|
341
|
-
|---|---|---|
|
|
342
|
-
| `reportFile` | `'doublecheck-report.md'` | 接收报告 Markdown 的工作区文件。 |
|
|
343
|
-
| `reportVerify` | `true` | 工具 `verify` 标志的默认值。 |
|
|
344
|
-
| `verifyProvider` | `'fork'` | 逐维度检查员所在的子代理 provider。 |
|
|
345
|
-
| `verifyMode` | `'all'` | `all` = 每个维度并行一个检查员;`single` = 一个组合检查员(一个子代理,更便宜)。 |
|
|
346
|
-
| `reportTestToolNames` / `reportTestCommandPatterns` | *(与守卫行相同默认)* | 报告侧测试运行分类。 |
|
|
347
|
-
| `reportMutationTools` / `reportTestFilePatterns` | *(与守卫行相同默认)* | 报告侧实现编辑分类。 |
|
|
348
|
-
|
|
349
|
-
报告的分类参数与守卫相互独立:门禁执行与报告折叠可以分开调优,不会互相悄悄影响。验证诚实降级:缺少 `workflowEngine` seam 或运行被拒绝时留下 `verification: null`,Markdown 中如实说明。
|
|
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 和裁决;评审文本中被识别的机密在存储或显示之前会被脱敏。
|
|
350
197
|
|
|
351
|
-
|
|
198
|
+
## 安全边界
|
|
352
199
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
| `gate.requirements.enabled` | `true` | 关闭则跳过需求质询阶段。 |
|
|
359
|
-
| `gate.requirements.checklist` | *(六个 spec 维度问题)* | 可插拔关键问题清单:`{ id, question, specDimension, required }`。`specDimension: null` 渲染为"人工确认"警告;可选问题失败是警告而非红灯。 |
|
|
360
|
-
| `gate.requirements.minConfirmed` | `6` | 必须通过的最少必答问题数(1..必答数)。 |
|
|
361
|
-
| `gate.requirements.interrogateTool` | `'ask_user_question'` | 其调用计作质询证据的工具名。 |
|
|
362
|
-
| `gate.tests.enabled` | `true` | 关闭则跳过测试证据阶段。 |
|
|
363
|
-
| `gate.tests.requirePassingRun` | `true` | 最近一次测试运行未通过(或缺失)即红灯。 |
|
|
364
|
-
| `gate.tests.allowFailingRuns` | `0` | 变绿后允许的失败运行数。 |
|
|
365
|
-
| `gate.tests.requireCoverage` | `false` | 开启则要求测试输出中有覆盖率证据。 |
|
|
366
|
-
| `gate.tests.minCoveragePct` | `80` | 最低覆盖率百分比(0–100)。 |
|
|
367
|
-
| `gate.tests.coveragePattern` | `coverage…(\d+…)%` | 带一个捕获组的正则,解析覆盖率百分比(忽略大小写编译)。 |
|
|
368
|
-
| `gate.consistency.enabled` | `true` | 关闭则跳过 diff ↔ 需求映射阶段。 |
|
|
369
|
-
| `gate.consistency.provider` / `.model` / `.tools` / `.timeoutMs` / `.maxFindings` | `fork` / `null` / `read,glob,grep` / `120000` / `5` | 本地一致性评审员的参数(`model: null` = 主模型)。 |
|
|
370
|
-
| `gate.review.enabled` | `true` | 关闭则跳过评审结论阶段。 |
|
|
371
|
-
| `gate.review.engine` | `'auto'` | `auto` = 优先 dsh-auto-review 裁决记录,否则本地评审员;`local` = 恒用本地评审员。 |
|
|
372
|
-
| `gate.review.provider` / `.model` / `.tools` / `.timeoutMs` / `.maxFindings` | *(与一致性相同)* | 本地评审评审员的参数。 |
|
|
200
|
+
- **模型可见 ⟺ 已记录。** 每条注入的提醒、评审和门禁通知都经由标准通道并落入会话日志;持久的 spec/state/gate 事实经由工具结果或 `SessionEventMap` 成员。
|
|
201
|
+
- **失败关闭 / 大声失败。** 守卫和门禁配置在 `apply` 中校验(断言抛错);无法运行的评审者或对抗式接口会退化为诚实的 "unavailable"/跳过通知,而非伪造裁决。
|
|
202
|
+
- **审计安全报告。** 门禁和交付报告只记录计数、id 和裁决——不含文件内容或会话文本——模型生成的发现文本在存储或显示之前会经过机密脱敏器。
|
|
203
|
+
- **自身无网络。** 该插件不发起直接网络请求;批评者和评审者 subagent 经由宿主的 subagent 接口运行。
|
|
204
|
+
- **对 dsh-auto-review 的弱依赖。** 它从不被 import 或硬性要求;门禁折叠其持久裁决记录并降级到本地评审者,且从不合成审批请求。
|
|
373
205
|
|
|
374
|
-
|
|
206
|
+
## 已知限制
|
|
375
207
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|---|---|
|
|
380
|
-
| 内置技能 | `ctx.skills.registerProvider()` — 技能能力 seam,`source: bundled` |
|
|
381
|
-
| 目录/加载工具 | `ctx.tools.register()` — `doublecheck_skills` |
|
|
382
|
-
| Spec 提交 + 工作区文件 | `doublecheck_spec` 工具 + `ctx.fs` 写入(可选) |
|
|
383
|
-
| 需求门 | `tools/pre-execute` 瀑布 — `allow` / `ask`(审批 seam)/ `deny` |
|
|
384
|
-
| 红门 | `tools/pre-execute` 瀑布 — 实现编辑前硬查失败测试证据 |
|
|
385
|
-
| 提醒注入 | `tools/post-execute` 瀑布 — `additionalContexts` → 记为 `user/message` |
|
|
386
|
-
| 绿门 | `agent/turn-stopping` 串行 — 编辑缺通过运行注入完成提醒 |
|
|
387
|
-
| 对抗式审查 | `ctx.subagents.start()` — 带结构化发现 schema 的 fork 审查者,变绿时注入;`warn`/`block` steer 一轮 |
|
|
388
|
-
| 交付报告 | `doublecheck_report` 工具 — 会话日志折叠 + 工作区 Markdown |
|
|
389
|
-
| 验证工作流 | `ctx.workflowEngine.start()` — 每个 spec 维度一个并行检查员,结构化检查 |
|
|
390
|
-
| 门禁确定性阶段 | 纯会话日志折叠 — 关键问题清单对照已提交 spec;测试运行/覆盖率证据 |
|
|
391
|
-
| 门禁评审阶段 | `ctx.subagents.start()` — 一致性映射员 + 本地评审员,结构化发现,只读工具 |
|
|
392
|
-
| 引擎评审 | 持久 `autoReview/verdict` / `autoReview/rejection` 折叠 + `ctx.commands.list()` 存在性探测(弱依赖,无 import) |
|
|
393
|
-
| Plan mode 建议 | 报告/面板文案 + 每会话一次的轮次提醒;`ctx.planMode` 读取状态行(可选) |
|
|
394
|
-
| `/gate` 命令 | `ctx.commands.register()` — `status|run|config`;`run` 写入持久 `doublecheck/gate` 事件 + `gate-report.md` |
|
|
395
|
-
| 设置面板 | 挂载时 `ctx.settings.register('doublecheck.gate', schema, { expose: true, applies: 'restart' })` |
|
|
396
|
-
| 持久状态 | 会话日志折叠:`tool/call` + `tool/result` + `tool/code-dispatch` + 注入的结构化源 + `doublecheck/state` + `doublecheck/gate`;模型可见 ⟺ 有日志 |
|
|
397
|
-
| 会话命令 | `ctx.commands.register()` — `/doublecheck status|report|on|off`;`on|off` 写入持久 `doublecheck/state` 会话事件 |
|
|
398
|
-
| 会话投影 | `sessionProjections` 注册表 — `doublecheck` 视图现携带 `gateVerdict` + `gateRedCount`(stateVersion 2) |
|
|
399
|
-
| 内部事件 | `doublecheck/spec`、`doublecheck/reminder`、`doublecheck/review`、`doublecheck/report`、`doublecheck/gate`(经声明合并定型,`@mode emit`) |
|
|
400
|
-
|
|
401
|
-
无 agent-loop 改动。每个注册都是可逆的 `ctx.effect` / `ctx.on` / 服务 `register()`。
|
|
402
|
-
|
|
403
|
-
## 模型会看到什么
|
|
404
|
-
|
|
405
|
-
- `grill-requirements` 技能加入会话技能目录,经内置 `skill` 工具(或 `doublecheck_skills`)加载。
|
|
406
|
-
- `ask_user_question` 仍是 DSH 原生盘问用户的方式;技能只负责编排(无 provider 的无头运行中降级为文字提问)。
|
|
407
|
-
- 提醒以 `{kind:'plugin'}` 上下文到达,转写 UI 将其展示为注入元数据。
|
|
408
|
-
- 对抗式批评在审查者结清后以同样方式到达,带严重度标签;`warn`/`block` 下循环被 steer 一轮让模型回应。
|
|
409
|
-
- `doublecheck_report` 把汇总报告作为工具结果返回(spec、测试时间线、评审、验证、结论),"证明交付"一次调用即可。
|
|
410
|
-
- 门禁红灯轮次提醒以 `{kind:'doublecheck-gate'}` 上下文到达——一句简短角色陈述加红灯数与 plan mode 建议。
|
|
411
|
-
- `/doublecheck` 与 `/gate` 直接在转写中回答:`status` 显示开关、模块、强度、阶段事实与最近门禁结论;`report` 打印折叠报告;`on|off` 翻转会话开关;`/gate run` 返回可贴 PR 的门禁报告。
|
|
412
|
-
|
|
413
|
-
## 会话命令
|
|
414
|
-
|
|
415
|
-
```
|
|
416
|
-
/doublecheck status|report|on|off
|
|
417
|
-
/gate status|run|config
|
|
418
|
-
```
|
|
419
|
-
|
|
420
|
-
- `/doublecheck status` — 生效开关(持久覆盖优先于配置默认)、已配置模块、执行强度、折叠阶段事实(spec 已提交、红绿颜色、评审留痕、编辑数)与最近门禁结论。
|
|
421
|
-
- `/doublecheck report` — 现场从会话日志折叠交付报告(无验证工作流;该路径归 `doublecheck_report`)。
|
|
422
|
-
- `/doublecheck on|off` — 写入持久 `doublecheck/state` 事件(跨重启、恢复、fork 存活——重放即状态)并注入模型可见的开关通知。
|
|
423
|
-
- `/gate status` — 实时检查单进度:确定性阶段即时折叠,评审类阶段与结论显示最近一次 `doublecheck/gate` 运行,外加 plan mode 状态。
|
|
424
|
-
- `/gate run` — 结算完整四阶段检查单(确定性折叠 + 两个本地评审 fork 并行;引擎裁决记录存在时优先),写入持久 `doublecheck/gate` 事件与 `gate-report.md`,返回报告 Markdown。
|
|
425
|
-
- `/gate config` — 渲染生效中的检查单、阈值与评审员参数。
|
|
426
|
-
|
|
427
|
-
所有命令回复遵循守卫行的 `language` 设置;报告文档保持稳定的英文标题与审计 id。
|
|
428
|
-
|
|
429
|
-
## 路线图
|
|
430
|
-
|
|
431
|
-
纪律循环与交付门禁均已发布:**grill → design → red → green → review → verify**(v0.1 → v0.6)加上**带可交付/需返工决策的四阶段质量门禁**(v0.7)。真实转写回归夹具钉住持久事件形态(`tests/fixtures/`)。未来工作:为 `doublecheck` 投影做 Web UI 设置页与门禁徽章、更丰富的报告排版、从工作区文件跨会话播种 spec。
|
|
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` 会降级到本地评审者——报告会写明原因,而不是捏造裁决。
|
|
432
211
|
|
|
433
212
|
## 开发
|
|
434
213
|
|
|
435
214
|
```sh
|
|
436
|
-
pnpm install
|
|
437
|
-
pnpm run
|
|
438
|
-
pnpm run
|
|
439
|
-
pnpm run test
|
|
440
|
-
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
|
|
441
224
|
```
|
|
442
225
|
|
|
443
|
-
##
|
|
226
|
+
## 主题
|
|
444
227
|
|
|
445
|
-
|
|
228
|
+
`dsh`, `dsh-plugin`, `deepseek-harness`, `engineering-discipline`, `requirements`, `guard`, `skill`, `quality-gate`, `delivery-gate`
|
|
446
229
|
|
|
447
230
|
## 贡献者
|
|
448
231
|
|
|
449
|
-
- [PerryLink](https://github.com/PerryLink)
|
|
450
|
-
|
|
451
|
-
欢迎 issue、PR 与 Discussions——入口见文档顶部。
|
|
232
|
+
- [@PerryLink](https://github.com/PerryLink) —— 创建者与维护者:grill → design → red → green → review → verify 纪律闭环、四阶段交付门禁、五语言文档,以及 CI/发布流水线。
|
|
452
233
|
|
|
453
|
-
## PerryLink DSH
|
|
234
|
+
## PerryLink DSH Plugin Family
|
|
454
235
|
|
|
455
|
-
本项目是 [PerryLink](https://github.com/PerryLink) 维护的 [15 个 DeepSeek Harness 插件](https://github.com/PerryLink)
|
|
236
|
+
本项目是 [PerryLink](https://github.com/PerryLink) 维护的 [15 个 DeepSeek Harness 插件](https://github.com/PerryLink)之一。如果这个对你有所帮助,其余的很可能也会帮到你:
|
|
456
237
|
|
|
457
|
-
|
|
|
238
|
+
| Plugin | One-liner |
|
|
458
239
|
|---|---|
|
|
459
|
-
| [dsh-mcp-panel](https://github.com/PerryLink/dsh-mcp-panel) |
|
|
460
|
-
| **[dsh-doublecheck](https://github.com/PerryLink/dsh-doublecheck)** |
|
|
461
|
-
| [dsh-background-agents](https://github.com/PerryLink/dsh-background-agents) |
|
|
462
|
-
| [dsh-lsp-actions](https://github.com/PerryLink/dsh-lsp-actions) |
|
|
463
|
-
| [dsh-output-styles](https://github.com/PerryLink/dsh-output-styles) |
|
|
464
|
-
| [dsh-checkpoint-rewind](https://github.com/PerryLink/dsh-checkpoint-rewind) |
|
|
465
|
-
| [dsh-permission-rules](https://github.com/PerryLink/dsh-permission-rules) | Claude Code
|
|
466
|
-
| [dsh-auto-review](https://github.com/PerryLink/dsh-auto-review) |
|
|
467
|
-
| [dsh-memento](https://github.com/PerryLink/dsh-memento) |
|
|
468
|
-
| [dsh-skill-pack-security](https://github.com/PerryLink/dsh-skill-pack-security) |
|
|
469
|
-
| [dsh-session-pin](https://github.com/PerryLink/dsh-session-pin) |
|
|
470
|
-
| [dsh-composer-history](https://github.com/PerryLink/dsh-composer-history) |
|
|
471
|
-
| [dsh-github](https://github.com/PerryLink/dsh-github) |
|
|
472
|
-
| [dsh-plugin-guide](https://github.com/PerryLink/dsh-plugin-guide) |
|
|
473
|
-
| [dsh-claude-move](https://github.com/PerryLink/dsh-claude-move) |
|
|
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 |
|
|
474
255
|
|
|
475
256
|
## 许可证
|
|
476
257
|
|
|
477
|
-
[Apache
|
|
258
|
+
[Apache License 2.0](LICENSE) © 2026 dsh-doublecheck contributors
|