coding-agent-harness 1.0.8 → 1.1.0

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.
Files changed (232) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/CONTRIBUTING.md +8 -4
  3. package/README.md +12 -2
  4. package/README.zh-CN.md +10 -2
  5. package/SKILL.md +14 -3
  6. package/dist/build-dist.mjs +19 -6
  7. package/dist/check-dist-observation.mjs +57 -29
  8. package/dist/check-harness.mjs +0 -1
  9. package/dist/check-import-graph.mjs +44 -27
  10. package/dist/check-lite-forbidden-surfaces.mjs +121 -0
  11. package/dist/check-no-ts-nocheck.mjs +7 -7
  12. package/dist/check-runtime-emit.mjs +10 -3
  13. package/dist/check-type-boundaries.mjs +51 -9
  14. package/dist/commands/dashboard-command.mjs +52 -14
  15. package/dist/commands/migration-command.mjs +18 -8
  16. package/dist/commands/module-command.mjs +142 -0
  17. package/dist/commands/preset-command.mjs +51 -12
  18. package/dist/commands/registry.mjs +483 -0
  19. package/dist/commands/task-command.mjs +109 -52
  20. package/dist/harness.mjs +6 -304
  21. package/dist/lib/capability-registry.mjs +229 -53
  22. package/dist/lib/check-module-parallel.mjs +1 -6
  23. package/dist/lib/check-profiles.mjs +39 -46
  24. package/dist/lib/check-task-contracts.mjs +6 -4
  25. package/dist/lib/command-registry.mjs +248 -0
  26. package/dist/lib/core-shared.mjs +78 -3
  27. package/dist/lib/dashboard-data.mjs +203 -22
  28. package/dist/lib/dashboard-workbench.mjs +245 -21
  29. package/dist/lib/dashboard-writer.mjs +4 -1
  30. package/dist/lib/git-status-summary.mjs +0 -1
  31. package/dist/lib/governance-index-generator.mjs +7 -5
  32. package/dist/lib/governance-sync.mjs +46 -121
  33. package/dist/lib/governance-table-boundary.mjs +1 -14
  34. package/dist/lib/harness-core.mjs +4 -1
  35. package/dist/lib/harness-paths.mjs +115 -1
  36. package/dist/lib/impact-classifier.mjs +420 -0
  37. package/dist/lib/lesson-maintenance.mjs +1 -2
  38. package/dist/lib/markdown-utils.mjs +50 -1
  39. package/dist/lib/migration-planner.mjs +31 -16
  40. package/dist/lib/migration-support.mjs +5 -4
  41. package/dist/lib/module-registry.mjs +296 -0
  42. package/dist/lib/preset-audit-contracts.mjs +24 -1
  43. package/dist/lib/preset-engine.mjs +67 -29
  44. package/dist/lib/preset-registry.mjs +361 -71
  45. package/dist/lib/preset-runner.mjs +292 -26
  46. package/dist/lib/review-confirm-git-gate.mjs +73 -19
  47. package/dist/lib/status-builder.mjs +23 -8
  48. package/dist/lib/structure-migration.mjs +6 -4
  49. package/dist/lib/subagent-authorization-audit.mjs +8 -2
  50. package/dist/lib/task-archive-eligibility.mjs +65 -0
  51. package/dist/lib/task-audit-metadata.mjs +25 -11
  52. package/dist/lib/task-audit-migration.mjs +21 -14
  53. package/dist/lib/task-discovery-contract.mjs +32 -0
  54. package/dist/lib/task-index.mjs +3 -2
  55. package/dist/lib/task-lesson-candidates.mjs +1 -2
  56. package/dist/lib/task-lesson-sedimentation.mjs +310 -9
  57. package/dist/lib/task-lifecycle/create-task-helpers.mjs +6 -3
  58. package/dist/lib/task-lifecycle/phase-sync.mjs +0 -1
  59. package/dist/lib/task-lifecycle/preset-interop.mjs +16 -0
  60. package/dist/lib/task-lifecycle/review-confirm.mjs +34 -2
  61. package/dist/lib/task-lifecycle/review-gates.mjs +12 -5
  62. package/dist/lib/task-lifecycle/review-submission.mjs +1 -2
  63. package/dist/lib/task-lifecycle/scaffold-provenance.mjs +0 -1
  64. package/dist/lib/task-lifecycle/template-files.mjs +2 -5
  65. package/dist/lib/task-lifecycle.mjs +116 -160
  66. package/dist/lib/task-metadata.mjs +10 -5
  67. package/dist/lib/task-preset-contract-drift.mjs +45 -0
  68. package/dist/lib/task-repository.mjs +192 -0
  69. package/dist/lib/task-review-model.mjs +36 -17
  70. package/dist/lib/task-scanner.mjs +74 -23
  71. package/dist/lib/task-template-materials.mjs +131 -0
  72. package/dist/lib/task-tombstone-commands.mjs +186 -29
  73. package/dist/lib/types/check-profiles.js +1 -0
  74. package/dist/lib/types/impact.js +1 -0
  75. package/dist/lib/types/preset.js +1 -0
  76. package/dist/lib/types/task-lifecycle.js +1 -0
  77. package/dist/lib/types/task-scanner.js +1 -0
  78. package/dist/postinstall.mjs +2 -2
  79. package/dist/run-built-tests.mjs +10 -3
  80. package/docs-release/README.md +1 -0
  81. package/docs-release/architecture/document-contract-kernel/README.md +150 -0
  82. package/docs-release/architecture/document-contract-kernel/products/full-skill-overlay.md +29 -0
  83. package/docs-release/architecture/document-contract-kernel/products/lite-forbidden-surfaces.txt +26 -0
  84. package/docs-release/architecture/document-contract-kernel/products/lite-skill-overlay.md +37 -0
  85. package/docs-release/architecture/overview.md +2 -2
  86. package/docs-release/architecture/overview.zh-CN.md +2 -2
  87. package/docs-release/architecture/system-explainer/01-system-overview.md +11 -7
  88. package/docs-release/architecture/system-explainer/02-module-dependency.md +4 -4
  89. package/docs-release/architecture/system-explainer/03-task-lifecycle.md +17 -12
  90. package/docs-release/architecture/system-explainer/05-data-flow.md +6 -6
  91. package/docs-release/architecture/system-explainer/06-preset-and-migration.md +2 -2
  92. package/docs-release/architecture/system-explainer/README.md +1 -1
  93. package/docs-release/architecture/system-explainer/en-US/01-system-overview.md +12 -8
  94. package/docs-release/architecture/system-explainer/en-US/02-module-dependency.md +5 -5
  95. package/docs-release/architecture/system-explainer/en-US/03-task-lifecycle.md +19 -11
  96. package/docs-release/architecture/system-explainer/en-US/05-data-flow.md +5 -5
  97. package/docs-release/architecture/system-explainer/en-US/06-preset-and-migration.md +2 -2
  98. package/docs-release/architecture/system-explainer/en-US/README.md +1 -1
  99. package/docs-release/guides/agent-installation.en-US.md +4 -6
  100. package/docs-release/guides/agent-installation.md +11 -8
  101. package/docs-release/guides/contributing.md +10 -3
  102. package/docs-release/guides/contributing.zh-CN.md +10 -3
  103. package/docs-release/guides/legacy-migration-agent-prompt.md +1 -1
  104. package/docs-release/guides/legacy-migration-agent-prompt.zh-CN.md +1 -1
  105. package/docs-release/guides/migration-playbook.en-US.md +9 -6
  106. package/docs-release/guides/migration-playbook.md +9 -6
  107. package/docs-release/guides/preset-development.md +68 -2
  108. package/docs-release/guides/task-state-machine.en-US.md +8 -8
  109. package/docs-release/guides/task-state-machine.md +7 -7
  110. package/docs-release/guides/typescript-runtime-migration-closeout.md +17 -13
  111. package/package.json +16 -12
  112. package/postinstall.mjs +37 -0
  113. package/presets/legacy-migration/preset.yaml +5 -5
  114. package/presets/legacy-migration/templates/execution_strategy.append.md +1 -1
  115. package/presets/lesson-sedimentation/preset.yaml +3 -3
  116. package/presets/module/preset.yaml +2 -2
  117. package/presets/module/templates/execution_strategy.append.md +1 -1
  118. package/presets/module/templates/task_plan.append.md +3 -3
  119. package/presets/release-closeout/checks/check-release-package.mjs +6 -1
  120. package/presets/release-closeout/preset.yaml +9 -9
  121. package/presets/release-closeout/scripts/generate-release-package.mjs +387 -25
  122. package/presets/release-closeout/templates/task_plan.append.md +5 -5
  123. package/presets/standard-task/preset.yaml +2 -2
  124. package/references/agents-md-pattern.md +23 -17
  125. package/references/lessons-governance.md +2 -2
  126. package/references/module-parallel-standard.md +3 -6
  127. package/references/ssot-governance.md +2 -2
  128. package/references/taskr-gap-analysis.md +3 -3
  129. package/run-dist.mjs +34 -0
  130. package/skills/preset-creator/SKILL.md +40 -8
  131. package/skills/preset-creator/references/complex-task-skeleton/brief.md +32 -8
  132. package/skills/preset-creator/references/preset-package-skeleton.md +15 -5
  133. package/skills/preset-creator/references/structure-aware-paths.md +112 -0
  134. package/templates/AGENTS.md.template +28 -26
  135. package/templates/architecture/README.md +2 -2
  136. package/templates/architecture/service-catalog.md +2 -2
  137. package/templates/architecture/services/service-template.md +1 -1
  138. package/templates/dashboard/assets/app-src/00-state.js +5 -1
  139. package/templates/dashboard/assets/app-src/10-router.js +7 -0
  140. package/templates/dashboard/assets/app-src/20-overview.js +8 -8
  141. package/templates/dashboard/assets/app-src/30-tasks.js +132 -40
  142. package/templates/dashboard/assets/app-src/32-task-swimlane.js +314 -0
  143. package/templates/dashboard/assets/app-src/35-task-detail.js +35 -5
  144. package/templates/dashboard/assets/app-src/40-modules.js +257 -41
  145. package/templates/dashboard/assets/app-src/45-review.js +127 -1
  146. package/templates/dashboard/assets/app-src/90-bindings.js +185 -2
  147. package/templates/dashboard/assets/app.css +928 -53
  148. package/templates/dashboard/assets/app.css.manifest.json +2 -0
  149. package/templates/dashboard/assets/app.js +1071 -98
  150. package/templates/dashboard/assets/app.manifest.json +1 -0
  151. package/templates/dashboard/assets/css-src/00-foundation.css +12 -6
  152. package/templates/dashboard/assets/css-src/10-panels-flow.css +2 -2
  153. package/templates/dashboard/assets/css-src/30-task-index.css +21 -13
  154. package/templates/dashboard/assets/css-src/31-archive.css +94 -0
  155. package/templates/dashboard/assets/css-src/32-task-swimlane.css +487 -0
  156. package/templates/dashboard/assets/css-src/35-review-workspace.css +78 -0
  157. package/templates/dashboard/assets/css-src/40-detail-modules-migration.css +191 -14
  158. package/templates/dashboard/assets/css-src/50-responsive-overrides.css +23 -0
  159. package/templates/dashboard/assets/i18n.js +166 -2
  160. package/templates/development/README.md +9 -9
  161. package/templates/development/cross-repo-debugging.md +3 -3
  162. package/templates/development/external-context/service-template.md +1 -1
  163. package/templates/development/external-source-packs/README.md +2 -2
  164. package/templates/integrations/README.md +4 -4
  165. package/templates/integrations/api-contract.md +1 -1
  166. package/templates/integrations/event-contract.md +1 -1
  167. package/templates/integrations/third-party/vendor-template.md +1 -1
  168. package/templates/integrations/webhook-contract.md +1 -1
  169. package/templates/ledger/Harness-Ledger.md +1 -1
  170. package/templates/modules/module_brief.md +50 -0
  171. package/templates/modules/module_plan.md +49 -0
  172. package/templates/modules/registry_view.md +9 -0
  173. package/templates/modules/session_prompt_pack.md +55 -0
  174. package/templates/planning/brief.md +32 -8
  175. package/templates/planning/module_brief.md +28 -3
  176. package/templates/planning/module_plan.md +26 -11
  177. package/templates/planning/module_session_prompt.md +11 -2
  178. package/templates/planning/optional/slices/_slice-template/brief.md +28 -0
  179. package/templates/planning/review.md +1 -1
  180. package/templates/planning/visual_map.md +1 -1
  181. package/templates/reference/docs-library-standard.md +7 -7
  182. package/templates/reference/execution-workflow-standard.md +13 -0
  183. package/templates/reference/external-source-intake-standard.md +10 -10
  184. package/templates/reference/repo-governance-standard.md +1 -1
  185. package/templates/reference/review-routing-standard.md +4 -0
  186. package/templates/ssot/Module-Registry.md +4 -38
  187. package/templates/walkthrough/walkthrough-template.md +1 -1
  188. package/templates-zh-CN/AGENTS.md.template +27 -25
  189. package/templates-zh-CN/CLAUDE.md.template +1 -1
  190. package/templates-zh-CN/architecture/README.md +2 -2
  191. package/templates-zh-CN/architecture/service-catalog.md +2 -2
  192. package/templates-zh-CN/architecture/services/service-template.md +1 -1
  193. package/templates-zh-CN/development/README.md +9 -9
  194. package/templates-zh-CN/development/cross-repo-debugging.md +3 -3
  195. package/templates-zh-CN/development/external-context/service-template.md +1 -1
  196. package/templates-zh-CN/development/external-source-packs/README.md +2 -2
  197. package/templates-zh-CN/integrations/README.md +4 -4
  198. package/templates-zh-CN/integrations/api-contract.md +1 -1
  199. package/templates-zh-CN/integrations/event-contract.md +1 -1
  200. package/templates-zh-CN/integrations/third-party/vendor-template.md +1 -1
  201. package/templates-zh-CN/integrations/webhook-contract.md +1 -1
  202. package/templates-zh-CN/ledger/Harness-Ledger.md +1 -1
  203. package/templates-zh-CN/lessons/lesson-arch-process-change.md +1 -1
  204. package/templates-zh-CN/lessons/lesson-new-doc.md +3 -3
  205. package/templates-zh-CN/lessons/lesson-ref-change.md +4 -4
  206. package/templates-zh-CN/modules/module_brief.md +47 -0
  207. package/templates-zh-CN/modules/module_plan.md +48 -0
  208. package/templates-zh-CN/modules/registry_view.md +9 -0
  209. package/templates-zh-CN/modules/session_prompt_pack.md +50 -0
  210. package/templates-zh-CN/planning/INDEX.md +1 -0
  211. package/templates-zh-CN/planning/brief.md +26 -7
  212. package/templates-zh-CN/planning/module_brief.md +24 -2
  213. package/templates-zh-CN/planning/module_plan.md +35 -29
  214. package/templates-zh-CN/planning/module_session_prompt.md +15 -11
  215. package/templates-zh-CN/planning/optional/slices/_slice-template/brief.md +28 -11
  216. package/templates-zh-CN/planning/review.md +1 -1
  217. package/templates-zh-CN/reference/adversarial-review-standard.md +1 -1
  218. package/templates-zh-CN/reference/delivery-operating-model-standard.md +3 -3
  219. package/templates-zh-CN/reference/docs-library-standard.md +27 -27
  220. package/templates-zh-CN/reference/execution-workflow-standard.md +12 -2
  221. package/templates-zh-CN/reference/external-source-intake-standard.md +10 -10
  222. package/templates-zh-CN/reference/harness-ledger-standard.md +3 -3
  223. package/templates-zh-CN/reference/regression-ssot-governance.md +2 -2
  224. package/templates-zh-CN/reference/repo-governance-standard.md +1 -1
  225. package/templates-zh-CN/reference/review-routing-standard.md +3 -0
  226. package/templates-zh-CN/reference/walkthrough-standard.md +2 -2
  227. package/templates-zh-CN/reference/worktree-standard.md +1 -1
  228. package/templates-zh-CN/regression/Cadence-Ledger.md +2 -2
  229. package/templates-zh-CN/ssot/Delivery-SSoT.md +2 -2
  230. package/templates-zh-CN/ssot/Module-Registry.md +5 -44
  231. package/templates-zh-CN/ssot/Regression-SSoT.md +2 -2
  232. package/templates-zh-CN/walkthrough/walkthrough-template.md +4 -4
@@ -63,7 +63,7 @@ flowchart LR
63
63
  A -->|"scaffold + validate"| B
64
64
  B -->|"读取"| C
65
65
  C -->|"生成"| D
66
- D -->|"review-confirm"| B
66
+ D -->|"workbench confirmation"| B
67
67
  ```
68
68
 
69
69
  - **Package**:你 `npm install` 的那个东西,包含 CLI、模板、标准文档、Preset 包
@@ -72,7 +72,7 @@ flowchart LR
72
72
  - **Human**:浏览器里看 Dashboard,在 Workbench 里做审查确认
73
73
 
74
74
  注意这个循环的方向:**Package 写入 Target Repo,Runtime 读取 Target Repo,
75
- Human 通过 review-confirm 再写回 Target Repo**。
75
+ Human 通过 Workbench 人工确认再写回 Target Repo**。
76
76
  整个系统是一个以 Markdown 文件为中心的读写循环,没有任何隐藏状态。
77
77
 
78
78
  ---
@@ -87,7 +87,7 @@ flowchart TD
87
87
 
88
88
  PKG --> CLI["harness CLI\ndist/harness.mjs\n唯一命令入口"]
89
89
  PKG --> Lib["核心库\nscripts/lib/\n~30 个模块,6 个功能层"]
90
- PKG --> Templates["任务模板\ntemplates/\n任务骨架文件(task_plan / visual_map 等)"]
90
+ PKG --> Templates["模板\ntemplates/\n任务骨架 + 模块根模板"]
91
91
  PKG --> References["操作标准\nreferences/\n可复制到目标仓库的规范文档"]
92
92
  PKG --> Presets["Preset 包\npresets/\n可复用任务方法(legacy-migration / module 等)"]
93
93
  ```
@@ -115,6 +115,9 @@ flowchart TD
115
115
 
116
116
  每个任务对应 `coding-agent-harness/planning/tasks/<task-id>/` 下的一个目录,
117
117
  里面有 `task_plan.md`、`progress.md`、`visual_map.md`、`review.md` 等文件。
118
+ 模块注册在 `harness.yaml` 的 `modules.items`;模块根目录默认只包含
119
+ `brief.md` 和 `module_plan.md`,模块任务放在
120
+ `coding-agent-harness/planning/modules/<key>/tasks/<task-id>/`。
118
121
 
119
122
  ### Runtime 做什么
120
123
 
@@ -142,6 +145,7 @@ Runtime 是**无状态的**——每次运行都从 Markdown 文件重新读取
142
145
  | **Budget** | 任务复杂度:`simple` / `standard` / `complex`,决定门禁严格程度 | `task_plan.md` |
143
146
  | **Phase** | Visual Map 中的执行阶段,有状态和完成度 | `visual_map.md` |
144
147
  | **Capability** | 可选功能模块,如 `dashboard`、`module-parallel` | `coding-agent-harness/harness.yaml` |
148
+ | **Module** | YAML 注册的并行工作域,带 owner、scope、依赖和任务分组 | `harness.yaml modules.items` + `planning/modules/<key>/` |
145
149
  | **Review Gate** | 阻止任务完成的审查门禁,必须人工确认才能通过 | `INDEX.md` + `review.md` |
146
150
  | **Governance Sync** | 任务状态变更时自动更新全局账本的原子操作 | `coding-agent-harness/governance/generated/Harness-Ledger.md` |
147
151
  | **Preset** | 可复用的任务方法包,如 `legacy-migration`、`module` | `presets/<id>/` |
@@ -183,9 +187,9 @@ Agent 需要在本地文件系统上读写状态。SaaS 会引入网络依赖、
183
187
  破坏 Agent 的自主执行能力。npm 包让任何能运行 Node.js 的环境都能直接使用,
184
188
  无需账号或网络。`package.json` 的 `dependencies` 为空——零运行时依赖。
185
189
 
186
- ### 为什么 review-confirm 必须是人工操作
190
+ ### 为什么人工确认必须只在 Workbench 里操作
187
191
 
188
- `review-confirm` 是整个系统里**唯一不能被 Agent 自动执行**的操作。
192
+ 人工确认是整个系统里**唯一不能由普通 CLI 暴露给 Agent 的操作**。
189
193
 
190
194
  原因:
191
195
 
@@ -193,7 +197,7 @@ Agent 需要在本地文件系统上读写状态。SaaS 会引入网络依赖、
193
197
 
194
198
  这个边界不是一开始就有的。最初 Dashboard workbench 的 review action 没有 Agent/Human 区分。
195
199
  后来通过竞品分析(Taskr competitive intake)识别出"Agent 自动确认 review"是 P0 风险,
196
- 才引入了 Git 提交门禁:`review-confirm` 会把带有 Git `user.name` / `user.email` 的
200
+ 才引入了 Workbench 写入口和 Git 提交门禁:Dashboard workbench 会把带有 Git `user.name` / `user.email` 的
197
201
  人工确认审计字段写入任务 `INDEX.md`,并做两次 Git 原子提交——第一次提交确认字段,
198
202
  第二次提交包含第一个 commit SHA 的最终审计记录。这个 Git commit 是**可审计的人类签名**,
199
203
  证明有真实的人类看过这个任务。
@@ -204,7 +208,7 @@ Agent 需要在本地文件系统上读写状态。SaaS 会引入网络依赖、
204
208
  不写回 Markdown 文件。原因有三:
205
209
 
206
210
  1. **避免事实漂移**:如果派生状态也写回文件,就有了两份事实源,任何一份过期都会造成误报
207
- 2. **防止绕过门禁**:如果 Agent 能直接修改派生字段,就能绕过 review-confirm 的门禁
211
+ 2. **防止绕过门禁**:如果 Agent 能直接修改派生字段,就能绕过人工确认门禁
208
212
  3. **治理规则即代码**:scanner 的推导规则本身就是治理规则的机器可读表达,每次运行重新计算等于每次都重新执行一遍治理检查
209
213
 
210
214
  ---
@@ -22,7 +22,7 @@ flowchart TD
22
22
 
23
23
  Entry -->|"dashboard\ndev"| DashCmd["dist/commands/dashboard-command.mjs\nDashboard 生成 + 动态服务"]
24
24
  Entry -->|"migrate-plan\nmigrate-run\nmigrate-verify"| MigCmd["dist/commands/migration-command.mjs\n迁移三阶段命令"]
25
- Entry -->|"new-task / task-start\ntask-phase / task-review\ntask-complete / review-confirm\ntask-tombstone"| TaskCmd["dist/commands/task-command.mjs\n任务生命周期命令"]
25
+ Entry -->|"new-task / task-start\ntask-phase / task-review\ntask-complete / task-tombstone"| TaskCmd["dist/commands/task-command.mjs\n任务生命周期命令"]
26
26
  Entry -->|"preset catalog\npreset install\npreset uninstall"| PresetCmd["dist/commands/preset-command.mjs\nPreset 管理命令"]
27
27
  Entry -->|"check / status / init\ngovernance / lesson-promote\n..."| Core["dist/lib/harness-core.mjs\n(直接调用)"]
28
28
  ```
@@ -176,7 +176,7 @@ flowchart TD
176
176
  TaskLifecycle["task-lifecycle.mjs\n生命周期命令实现\nnew-task / task-start / task-phase\ntask-review / task-complete"]
177
177
 
178
178
  TaskLifecycle --> ReviewGates["task-lifecycle/review-gates.mjs\n门禁验证逻辑\n(进入 review 前的检查)"]
179
- TaskLifecycle --> ReviewConfirm["task-lifecycle/review-confirm.mjs\n人工确认执行\n(review-confirm 命令)"]
179
+ TaskLifecycle --> ReviewConfirm["task-lifecycle/review-confirm.mjs\n人工确认执行\n(Workbench 内部写入口)"]
180
180
  TaskLifecycle --> TextUtils["task-lifecycle/text-utils.mjs\n文本追加工具\n(向 Markdown 文件追加内容)"]
181
181
  TaskLifecycle --> GovSync["governance-sync.mjs\n状态变更时同步账本"]
182
182
  TaskLifecycle --> MigPreset["task-migration-preset.mjs\n迁移 preset 上下文注入"]
@@ -184,8 +184,8 @@ flowchart TD
184
184
  ReviewConfirm --> GitGate["review-confirm-git-gate.mjs\nGit 原子提交门禁\n(写入人工确认块 + commit)"]
185
185
  ```
186
186
 
187
- `review-confirm` 是整个生命周期层里最特殊的命令——它是唯一需要 Git 原子提交的操作,
188
- 也是唯一不能被 Agent 自动执行的操作(见 [01-system-overview.md](01-system-overview.md) 的设计决策)。
187
+ 人工确认是整个生命周期层里最特殊的写操作——它只通过本地 Workbench 触发,并需要 Git 原子提交
188
+ (见 [01-system-overview.md](01-system-overview.md) 的设计决策)。
189
189
 
190
190
  ---
191
191
 
@@ -30,14 +30,14 @@ flowchart TD
30
30
 
31
31
  NS -->|"harness task-start"| IP
32
32
  IP -->|"harness task-review"| R
33
- R -->|"harness review-confirm\n(人工操作)"| D
33
+ R -->|"Dashboard workbench\n人工确认"| D
34
34
  IP -->|"harness task-phase --blocked"| BL
35
35
  BL -->|"harness task-start"| IP
36
36
  R -->|"打回重做"| IP
37
37
  ```
38
38
 
39
- **关键点**:`review-confirm` 是整个系统里**唯一不能被 Agent 自动执行**的命令。
40
- 它需要真实的人类操作,并会写入带有 Git `user.name` / `user.email` 的可审计确认块。
39
+ **关键点**:人工确认不作为普通 CLI 命令暴露。它只能通过本地 Dashboard workbench 的写接口触发,
40
+ 并会写入带有 Git `user.name` / `user.email` 的可审计确认块。
41
41
 
42
42
  ---
43
43
 
@@ -53,7 +53,7 @@ Budget 是任务的复杂度等级,直接决定审查门禁有多严:
53
53
  | 需要关闭所有 blocking findings | ✗ | ✓ | ✓ |
54
54
  | 需要 Walkthrough 链接 | ✗ | ✓ | ✓ |
55
55
  | 需要 Lesson 决策完成 | ✗ | ✓ | ✓ |
56
- | 需要人工 review-confirm | ✗ | ✓ | ✓ |
56
+ | 需要 Dashboard 人工确认 | ✗ | ✓ | ✓ |
57
57
 
58
58
  `simple` 任务可以直接从 `in_progress` 跳到 `done`,没有任何门禁。
59
59
  `standard` 和 `complex` 的门禁完全相同——区别在于 `complex` 任务通常需要 subagent 授权和对抗审查。
@@ -87,15 +87,17 @@ flowchart TD
87
87
 
88
88
  ---
89
89
 
90
- ## Level 3 — review-confirm 的门禁细节
90
+ ## Level 3 — Dashboard 人工确认的门禁细节
91
91
 
92
- 当人类执行 `harness review-confirm` 时,系统在**执行确认之前**做四项检查:
92
+ 当人类在本地 Dashboard workbench 点击确认时,系统在**执行确认之前**做四项检查:
93
93
 
94
94
  ```mermaid
95
95
  flowchart TD
96
- Trigger["harness review-confirm task-123"]
96
+ Trigger["POST /api/tasks/review-complete\n(local Dashboard workbench)"]
97
97
 
98
- Trigger --> C1{"确认文本与任务 ID 匹配?"}
98
+ Trigger --> A1{"Host / Origin / CSRF\n匹配本地 workbench?"}
99
+ A1 -->|"否"| EA["❌ 拒绝\n不是 workbench 请求"]
100
+ A1 -->|"是"| C1{"确认文本与任务 ID 匹配?"}
99
101
  C1 -->|"否"| E1["❌ 拒绝\n确认文本不对"]
100
102
  C1 -->|"是"| C2{"无阻塞性审查发现?\n(P0/P1/P2 open findings)"}
101
103
  C2 -->|"否"| E2["❌ 拒绝\n还有未关闭的 blocking findings"]
@@ -108,6 +110,9 @@ flowchart TD
108
110
  Commit1 --> Commit2["Git 提交 #2\nchore: record review confirmation audit task-123"]
109
111
  ```
110
112
 
113
+ 普通 CLI 不暴露人工确认命令;Agent 可以提交审查材料,但不能通过 CLI 直接写人工确认。
114
+ Dashboard workbench 仍只绑定 `127.0.0.1`,并要求同源和 CSRF token。
115
+
111
116
  **两次提交策略**:第一次提交 `INDEX.md` 中的确认字段,第二次提交最终审计元数据。
112
117
  这样即使第二次提交失败,第一次提交也已经锁定了确认记录。
113
118
 
@@ -275,7 +280,7 @@ Tombstone 块追加到 `task_plan.md` 末尾(不替换原内容),保留历
275
280
  (Ledger、Closeout Index、其他任务的 `Supersedes` 字段都可能指向被删任务)。
276
281
  Tombstone 标记让 Soft-deleted / Superseded 队列可以只读追溯"为什么这个任务不在活跃队列里"。
277
282
 
278
- ### 为什么 review-confirm 需要两次 Git 提交
283
+ ### 为什么 Dashboard 人工确认需要两次 Git 提交
279
284
 
280
285
  两次提交让 audit commit 的 SHA 成为不可篡改的时间戳。
281
286
  第一次提交确认本身,第二次提交包含第一个 commit SHA 的审计记录。
@@ -292,13 +297,13 @@ Git 自身的锁(`.git/index.lock`)只保护 index 操作,
292
297
  ### 为什么 simple budget 跳过所有门禁
293
298
 
294
299
  simple 任务对应 trivial 级别的改动(文档修正、配置调整),
295
- 强制经过 `task-review → review-confirm → task-complete` 三步会让 overhead 超过任务本身的价值。
300
+ 强制经过 `task-review → Dashboard 人工确认 → task-complete` 三步会让 overhead 超过任务本身的价值。
296
301
  这是有意的快速路径,不是遗漏。
297
302
 
298
303
  ### Lesson 系统的设计意图
299
304
 
300
305
  Lesson 系统把任务执行中发现的可复用经验从"聊天里提到过"变成
301
306
  "可追踪、可审查、可沉淀到标准文档"的治理对象。
302
- Lesson candidate 决策必须在 `review-confirm` 之前完成,
303
- 因为 `review-confirm` 是责任转移点——人工确认后,任务进入 finalization,
307
+ Lesson candidate 决策必须在 Dashboard 人工确认之前完成,
308
+ 因为人工确认是责任转移点——确认后,任务进入 finalization,
304
309
  此时再要求 Agent 补 lesson 决策会造成责任归属混乱。
@@ -152,13 +152,13 @@ flowchart TD
152
152
  flowchart TD
153
153
  Collect["collectMarkdownDocuments()"]
154
154
 
155
- Collect --> Fixed["固定路径(存在时收集)\nHarness-Ledger.md\ncoding-agent-harness/planning/modules/Module-Registry.md\ncoding-agent-harness/governance/regression/Regression-SSoT.md\ncoding-agent-harness/governance/generated/Closeout-Index.md"]
155
+ Collect --> Fixed["固定路径(存在时收集)\nHarness-Ledger.md\nharness.yaml modules.items\ncoding-agent-harness/planning/modules/Module-Registry.md\ncoding-agent-harness/governance/regression/Regression-SSoT.md\ncoding-agent-harness/governance/generated/Closeout-Index.md"]
156
156
 
157
157
  Collect --> Walkthrough["coding-agent-harness/planning/tasks/<task>/ 下所有 .md\n(排除 _archive/ 和 _ 开头文件)"]
158
158
 
159
159
  Collect --> TaskDocs["每个任务目录下:\nbrief / task_plan / execution_strategy\nvisual_map / lesson_candidates\nprogress / review / findings\nreferences/INDEX.md / artifacts/INDEX.md"]
160
160
 
161
- Collect --> ModuleDocs["coding-agent-harness/planning/modules/ 下:\n每个模块的 module_plan.md\n每个模块的 brief.md"]
161
+ Collect --> ModuleDocs["coding-agent-harness/planning/modules/ 下:\n每个模块根 brief.md / module_plan.md\n每个模块 tasks/<task>/ 的任务合同"]
162
162
 
163
163
  Collect --> Lessons["01-GOVERNANCE/lessons/ 下所有 .md"]
164
164
  ```
@@ -191,12 +191,12 @@ flowchart LR
191
191
  DC["harness dev"]
192
192
  DC --> HTTP["本地 HTTP 服务\nlocalhost:PORT"]
193
193
  DC --> Watch["文件监听\n轮询模式,每 1 秒检查一次\n变化后延迟 250ms 重新生成"]
194
- HTTP --> Browser["浏览器实时查看\n支持 review-confirm 等写操作"]
194
+ HTTP --> Browser["浏览器实时查看\n支持人工确认等写操作"]
195
195
  end
196
196
  ```
197
197
 
198
198
  **关键边界**:静态 Dashboard 是只读的,不能触发任何写操作。
199
- 只有 `harness dev`(Workbench 模式)才能执行 `review-confirm`、`task-start` 等写操作。
199
+ 只有 `harness dev`(Workbench 模式)才能执行人工确认等写操作。
200
200
 
201
201
  ### Dashboard HTML 生成方式
202
202
 
@@ -255,8 +255,8 @@ app-src 里的 vanilla JS 组件(`DashboardShell`、`SidebarNav`、`TableView`
255
255
  ### 为什么 `harness dev` 和 `harness dashboard` 是两个命令
256
256
 
257
257
  `harness dashboard` 生成静态只读快照(适合 CI、迁移报告、离线证据)。
258
- `harness dev` 启动本地动态 Workbench server,支持文件 watch、自动刷新、
259
- review-confirm 写操作。两者的边界是:**静态快照可以分享,动态 Workbench 只能本地用**。
258
+ `harness dev` 启动本地动态 Workbench server,支持文件 watch、自动刷新和人工确认写操作。
259
+ 两者的边界是:**静态快照可以分享,动态 Workbench 只能本地用**。
260
260
 
261
261
  ### 为什么文件监听用轮询而不是 fs.watch
262
262
 
@@ -212,7 +212,7 @@ flowchart TD
212
212
  flowchart TD
213
213
  Core["core\n(必选,所有其他能力的基础)"]
214
214
 
215
- Core --> ModParallel["module-parallel\n模块注册表 + 并行工作"]
215
+ Core --> ModParallel["module-parallel\nYAML 模块注册 + 并行工作"]
216
216
  Core --> AdvReview["adversarial-review\n对抗审查报告\n(别名:review-contract)"]
217
217
  Core --> LongRunning["long-running-task\n长时间运行任务合约"]
218
218
  Core --> Dashboard["dashboard\n本地 HTML Dashboard"]
@@ -224,7 +224,7 @@ flowchart TD
224
224
  | 能力 | 何时启用 |
225
225
  | --- | --- |
226
226
  | `core` | 始终,这是必选基础 |
227
- | `module-parallel` | 项目有 2 个以上独立模块需要并行所有权时 |
227
+ | `module-parallel` | 项目有 2 个以上独立模块,需要在 `harness.yaml modules.items` 里维护 owner、scope、依赖和同步规则时 |
228
228
  | `subagent-worker` | 代码变更 subagent 需要在独立 worktree 工作并 commit 交接时 |
229
229
  | `adversarial-review` | 发布、架构、安全、数据或策略风险需要独立审查产物时 |
230
230
  | `long-running-task` | Agent 可能跨多个 loop 运行而无需每步用户确认时 |
@@ -17,7 +17,7 @@
17
17
  - 为什么状态存在 Markdown 文件里,而不是数据库?
18
18
  - 为什么有三种 check profile,而不是一种?
19
19
  - `governance-sync` 和 `governance rebuild` 有什么区别,为什么要分开?
20
- - `review-confirm` 为什么必须是人工操作,不能自动化?
20
+ - 人工确认为什么只能通过本地 Workbench,不能作为普通 CLI 命令暴露?
21
21
 
22
22
  这些问题的答案散落在设计决策、历史演进和操作规范里。
23
23
  这套文档把它们集中起来,让你不需要翻 git log 就能理解系统的"为什么"。
@@ -64,7 +64,7 @@ flowchart LR
64
64
  A -->|"scaffold + validate"| B
65
65
  B -->|"read"| C
66
66
  C -->|"generate"| D
67
- D -->|"review-confirm"| B
67
+ D -->|"workbench confirmation"| B
68
68
  ```
69
69
 
70
70
  - **Package**: What you `npm install` — contains the CLI, templates, standards docs, and Preset packages
@@ -73,7 +73,7 @@ flowchart LR
73
73
  - **Human**: Views the Dashboard in a browser, performs review confirmation in the Workbench
74
74
 
75
75
  Note the direction of this loop: **Package writes to Target Repo, Runtime reads from Target Repo,
76
- Human writes back to Target Repo via review-confirm**.
76
+ Human writes back to Target Repo through Workbench confirmation**.
77
77
  The whole system is a read-write loop centered on Markdown files, with no hidden state.
78
78
 
79
79
  ---
@@ -88,7 +88,7 @@ flowchart TD
88
88
 
89
89
  PKG --> CLI["harness CLI\ndist/harness.mjs\nSingle command entry point"]
90
90
  PKG --> Lib["Core library\nscripts/lib/\n~30 modules, 6 functional layers"]
91
- PKG --> Templates["Task templates\ntemplates/\nTask scaffold files (task_plan / visual_map etc.)"]
91
+ PKG --> Templates["Templates\ntemplates/\nTask scaffolds + module-root templates"]
92
92
  PKG --> References["Operating standards\nreferences/\nSpec docs that can be copied to target repos"]
93
93
  PKG --> Presets["Preset packages\npresets/\nReusable task methods (legacy-migration / module etc.)"]
94
94
  ```
@@ -116,6 +116,9 @@ flowchart TD
116
116
 
117
117
  Each task corresponds to a directory under `coding-agent-harness/planning/tasks/<task-id>/`,
118
118
  containing files like `task_plan.md`, `progress.md`, `visual_map.md`, `review.md`, etc.
119
+ Modules are registered in `harness.yaml` `modules.items`. A module root owns
120
+ only `brief.md` and `module_plan.md` by default, while module tasks live under
121
+ `coding-agent-harness/planning/modules/<key>/tasks/<task-id>/`.
119
122
 
120
123
  ### What the Runtime does
121
124
 
@@ -143,6 +146,7 @@ caching no intermediate state (except file watching in `harness dev`).
143
146
  | **Budget** | Task complexity: `simple` / `standard` / `complex`, determines gate strictness | `task_plan.md` |
144
147
  | **Phase** | An execution phase in the Visual Map, with state and completion | `visual_map.md` |
145
148
  | **Capability** | Optional feature module, e.g. `dashboard`, `module-parallel` | `coding-agent-harness/harness.yaml` |
149
+ | **Module** | YAML-registered parallel work domain with owner, scope, dependencies, and task grouping | `harness.yaml modules.items` + `planning/modules/<key>/` |
146
150
  | **Review Gate** | A review gate that blocks task completion, requires human confirmation to pass | `review.md` |
147
151
  | **Governance Sync** | Atomic operation that auto-updates the global ledger on task state changes | `coding-agent-harness/governance/generated/Harness-Ledger.md` |
148
152
  | **Preset** | A reusable task method package, e.g. `legacy-migration`, `module` | `presets/<id>/` |
@@ -185,10 +189,10 @@ dependency, authentication, and latency, breaking Agents' autonomous execution c
185
189
  An npm package lets any environment that can run Node.js use it directly, with no account
186
190
  or network required. `package.json` `dependencies` is empty — zero runtime dependencies.
187
191
 
188
- ### Why review-confirm must be a manual operation
192
+ ### Why human confirmation must stay in Workbench
189
193
 
190
- `review-confirm` is the **only operation in the entire system that cannot be automatically
191
- executed by an Agent**.
194
+ Human confirmation is the **only operation in the system that is not exposed to Agents
195
+ as a regular CLI command**.
192
196
 
193
197
  The reason:
194
198
 
@@ -197,7 +201,7 @@ The reason:
197
201
  This boundary wasn't there from the start. Initially the Dashboard workbench review action
198
202
  had no Agent/Human distinction. Later, through competitive analysis (Taskr competitive intake),
199
203
  "Agent auto-confirming review" was identified as a P0 risk, which led to introducing the
200
- Git commit gate: `review-confirm` writes human confirmation audit fields with Git
204
+ Workbench write endpoint and Git commit gate: Dashboard workbench writes human confirmation audit fields with Git
201
205
  `user.name` / `user.email` to the task `INDEX.md`, and makes two atomic Git commits:
202
206
  the first commits the confirmation fields, and the second commits the final audit
203
207
  record containing the first commit's SHA.
@@ -211,7 +215,7 @@ recalculated on every run and never written back to Markdown files. Three reason
211
215
  1. **Avoid fact drift**: If derived state were also written to files, there would be two sources
212
216
  of truth, and either one going stale would cause false reports
213
217
  2. **Prevent gate bypass**: If Agents could directly modify derived fields, they could bypass
214
- the review-confirm gate
218
+ the human confirmation gate
215
219
  3. **Governance rules as code**: The scanner's derivation rules are themselves a machine-readable
216
220
  expression of governance rules — recalculating on every run is equivalent to re-executing
217
221
  the governance check every time
@@ -23,7 +23,7 @@ flowchart TD
23
23
 
24
24
  Entry -->|"dashboard\ndev"| DashCmd["dist/commands/dashboard-command.mjs\nDashboard generation + dynamic serving"]
25
25
  Entry -->|"migrate-plan\nmigrate-run\nmigrate-verify"| MigCmd["dist/commands/migration-command.mjs\nMigration three-phase commands"]
26
- Entry -->|"new-task / task-start\ntask-phase / task-review\ntask-complete / review-confirm\ntask-tombstone"| TaskCmd["dist/commands/task-command.mjs\nTask lifecycle commands"]
26
+ Entry -->|"new-task / task-start\ntask-phase / task-review\ntask-complete / task-tombstone"| TaskCmd["dist/commands/task-command.mjs\nTask lifecycle commands"]
27
27
  Entry -->|"preset catalog\npreset install\npreset uninstall"| PresetCmd["dist/commands/preset-command.mjs\nPreset management commands"]
28
28
  Entry -->|"check / status / init\ngovernance / lesson-promote\n..."| Core["dist/lib/harness-core.mjs\n(called directly)"]
29
29
  ```
@@ -181,7 +181,7 @@ flowchart TD
181
181
  TaskLifecycle["task-lifecycle.mjs\nLifecycle command implementations\nnew-task / task-start / task-phase\ntask-review / task-complete"]
182
182
 
183
183
  TaskLifecycle --> ReviewGates["task-lifecycle/review-gates.mjs\nGate validation logic\n(checks before entering review)"]
184
- TaskLifecycle --> ReviewConfirm["task-lifecycle/review-confirm.mjs\nHuman confirmation execution\n(review-confirm command)"]
184
+ TaskLifecycle --> ReviewConfirm["task-lifecycle/review-confirm.mjs\nHuman confirmation execution\n(Workbench internal write entry)"]
185
185
  TaskLifecycle --> TextUtils["task-lifecycle/text-utils.mjs\nText append utilities\n(appending content to Markdown files)"]
186
186
  TaskLifecycle --> GovSync["governance-sync.mjs\nSync ledger on state changes"]
187
187
  TaskLifecycle --> MigPreset["task-migration-preset.mjs\nMigration Preset context injection"]
@@ -189,9 +189,9 @@ flowchart TD
189
189
  ReviewConfirm --> GitGate["review-confirm-git-gate.mjs\nGit atomic commit gate\n(writes human confirmation block + commit)"]
190
190
  ```
191
191
 
192
- `review-confirm` is the most special command in the entire lifecycle layer it's the only
193
- operation that requires a Git atomic commit, and the only one that cannot be automatically
194
- executed by an Agent (see design decisions in [01-system-overview.md](01-system-overview.md)).
192
+ Human confirmation is the most special write operation in the lifecycle layer: it is triggered
193
+ only through the local Workbench and requires Git atomic commit behavior
194
+ (see design decisions in [01-system-overview.md](01-system-overview.md)).
195
195
 
196
196
  ---
197
197
 
@@ -30,14 +30,14 @@ flowchart TD
30
30
 
31
31
  NS -->|"harness task-start"| IP
32
32
  IP -->|"harness task-review"| R
33
- R -->|"harness review-confirm\n(manual operation)"| D
33
+ R -->|"Dashboard workbench\nhuman confirmation"| D
34
34
  IP -->|"harness task-phase --blocked"| BL
35
35
  BL -->|"harness task-start"| IP
36
36
  R -->|"sent back for rework"| IP
37
37
  ```
38
38
 
39
- **Key point**: `review-confirm` is the **only command in the entire system that cannot be
40
- automatically executed by an Agent**. It requires a real human operation and writes an
39
+ **Key point**: human confirmation is not exposed as a regular CLI command. It can only
40
+ be triggered through the local Dashboard workbench write endpoint, and it writes an
41
41
  auditable confirmation block with Git `user.name` / `user.email`.
42
42
 
43
43
  ---
@@ -54,7 +54,7 @@ Budget is the task's complexity level, and it directly determines how strict the
54
54
  | Requires all blocking findings closed | ✗ | ✓ | ✓ |
55
55
  | Requires Walkthrough link | ✗ | ✓ | ✓ |
56
56
  | Requires Lesson decision complete | ✗ | ✓ | ✓ |
57
- | Requires human review-confirm | ✗ | ✓ | ✓ |
57
+ | Requires Dashboard human confirmation | ✗ | ✓ | ✓ |
58
58
 
59
59
  `simple` tasks can jump directly from `in_progress` to `done` with no gates.
60
60
  `standard` and `complex` have identical gates — the difference is that `complex` tasks
@@ -89,16 +89,18 @@ After entering review state, the Agent needs to write `review.md` and fill in th
89
89
 
90
90
  ---
91
91
 
92
- ## Level 3 — Gate details for review-confirm
92
+ ## Level 3 — Gate details for Dashboard human confirmation
93
93
 
94
- When a human runs `harness review-confirm`, the system performs four checks
94
+ When a human clicks confirm in the local Dashboard workbench, the system performs four checks
95
95
  **before executing the confirmation**:
96
96
 
97
97
  ```mermaid
98
98
  flowchart TD
99
- Trigger["harness review-confirm task-123"]
99
+ Trigger["POST /api/tasks/review-complete\n(local Dashboard workbench)"]
100
100
 
101
- Trigger --> C1{"Confirmation text matches task ID?"}
101
+ Trigger --> A1{"Host / Origin / CSRF\nmatch local workbench?"}
102
+ A1 -->|"no"| EA["❌ Rejected\nNot a workbench request"]
103
+ A1 -->|"yes"| C1{"Confirmation text matches task ID?"}
102
104
  C1 -->|"no"| E1["❌ Rejected\nWrong confirmation text"]
103
105
  C1 -->|"yes"| C2{"No blocking review findings?\n(P0/P1/P2 open findings)"}
104
106
  C2 -->|"no"| E2["❌ Rejected\nStill has unclosed blocking findings"]
@@ -111,6 +113,12 @@ flowchart TD
111
113
  Commit1 --> Commit2["Git commit #2\nchore: record review confirmation audit task-123"]
112
114
  ```
113
115
 
116
+ Agent runtime detection is an accidental-self-approval guard, not cryptographic identity.
117
+ If an agent and a human share the same OS user and the agent can mutate environment
118
+ variables, files, and Git commits, the CLI cannot independently prove who operated it.
119
+ Stronger isolation requires an external human approval service, OS keychain/passkey, or
120
+ separate system-user boundary.
121
+
114
122
  **Two-commit strategy**: The first commit covers confirmation fields in `INDEX.md`; the second
115
123
  commits the final audit metadata. Even if the second commit fails, the first commit has
116
124
  already locked in the confirmation record.
@@ -287,7 +295,7 @@ orphan references (the Ledger, Closeout Index, and other tasks' `Supersedes` fie
287
295
  all point to the deleted task). Tombstone markers let the Soft-deleted / Superseded queue
288
296
  provide read-only traceability for "why isn't this task in the active queue".
289
297
 
290
- ### Why review-confirm requires two Git commits
298
+ ### Why Dashboard human confirmation requires two Git commits
291
299
 
292
300
  Two commits make the audit commit's SHA an immutable timestamp. The first commit covers
293
301
  the confirmation itself; the second commit contains an audit record with the first commit's
@@ -306,7 +314,7 @@ sync operation", not a single git command.
306
314
  ### Why simple budget skips all gates
307
315
 
308
316
  Simple tasks correspond to trivial changes (doc corrections, config adjustments). Forcing
309
- them through `task-review → review-confirm → task-complete` would make the overhead exceed
317
+ them through `task-review → Dashboard human confirmation → task-complete` would make the overhead exceed
310
318
  the value of the task itself. This is an intentional fast path, not an oversight.
311
319
 
312
320
  ### The design intent of the Lesson system
@@ -314,6 +322,6 @@ the value of the task itself. This is an intentional fast path, not an oversight
314
322
  The Lesson system transforms reusable knowledge discovered during task execution from
315
323
  "mentioned in chat" into a governance object that is "trackable, reviewable, and
316
324
  sedimentable into standard docs". Lesson candidate decisions must be completed before
317
- `review-confirm`, because `review-confirm` is the responsibility transfer point — once
325
+ Dashboard human confirmation, because human confirmation is the responsibility transfer point — once
318
326
  human confirmation is done, the task enters finalization, and requiring the Agent to
319
327
  add lesson decisions at that point would create accountability confusion.
@@ -155,13 +155,13 @@ Which files `collectMarkdownDocuments()` collects:
155
155
  flowchart TD
156
156
  Collect["collectMarkdownDocuments()"]
157
157
 
158
- Collect --> Fixed["Fixed paths (collected when they exist)\nHarness-Ledger.md\ncoding-agent-harness/planning/modules/Module-Registry.md\ncoding-agent-harness/governance/regression/Regression-SSoT.md\ncoding-agent-harness/governance/generated/Closeout-Index.md"]
158
+ Collect --> Fixed["Fixed paths (collected when they exist)\nHarness-Ledger.md\nharness.yaml modules.items\ncoding-agent-harness/planning/modules/Module-Registry.md\ncoding-agent-harness/governance/regression/Regression-SSoT.md\ncoding-agent-harness/governance/generated/Closeout-Index.md"]
159
159
 
160
160
  Collect --> Walkthrough["All .md files under coding-agent-harness/planning/tasks/<task>/\n(excluding _archive/ and files starting with _)"]
161
161
 
162
162
  Collect --> TaskDocs["Under each task directory:\nbrief / task_plan / execution_strategy\nvisual_map / lesson_candidates\nprogress / review / findings\nreferences/INDEX.md / artifacts/INDEX.md"]
163
163
 
164
- Collect --> ModuleDocs["Under coding-agent-harness/planning/modules/:\nmodule_plan.md for each module\nbrief.md for each module"]
164
+ Collect --> ModuleDocs["Under coding-agent-harness/planning/modules/:\nroot brief.md / module_plan.md for each module\ntask contracts under tasks/<task>/"]
165
165
 
166
166
  Collect --> Lessons["All .md files under 01-GOVERNANCE/lessons/"]
167
167
  ```
@@ -197,12 +197,12 @@ flowchart LR
197
197
  DC["harness dev"]
198
198
  DC --> HTTP["Local HTTP server\nlocalhost:PORT"]
199
199
  DC --> Watch["File watching\nPolling mode, checks every 1 second\nRegenerates after 250ms delay on change"]
200
- HTTP --> Browser["Live browser view\nSupports review-confirm and other write operations"]
200
+ HTTP --> Browser["Live browser view\nSupports human confirmation and other write operations"]
201
201
  end
202
202
  ```
203
203
 
204
204
  **Key boundary**: The static Dashboard is read-only and cannot trigger any write operations.
205
- Only `harness dev` (Workbench mode) can execute write operations like `review-confirm`
205
+ Only `harness dev` (Workbench mode) can execute write operations like human confirmation
206
206
  and `task-start`.
207
207
 
208
208
  ### Dashboard HTML generation
@@ -266,7 +266,7 @@ a complete security validation chain.
266
266
 
267
267
  `harness dashboard` generates a static read-only snapshot (suitable for CI, migration
268
268
  reports, offline evidence). `harness dev` starts a local dynamic Workbench server with
269
- file watching, auto-refresh, and review-confirm write operations. The boundary is:
269
+ file watching, auto-refresh, and human-confirmation write operations. The boundary is:
270
270
  **static snapshots can be shared; the dynamic Workbench is local-only**.
271
271
 
272
272
  ### Why file watching uses polling instead of fs.watch
@@ -221,7 +221,7 @@ must be satisfied to pass.
221
221
  flowchart TD
222
222
  Core["core\n(required, foundation for all other capabilities)"]
223
223
 
224
- Core --> ModParallel["module-parallel\nModule registry + parallel work"]
224
+ Core --> ModParallel["module-parallel\nYAML module registry + parallel work"]
225
225
  Core --> AdvReview["adversarial-review\nAdversarial review reports\n(alias: review-contract)"]
226
226
  Core --> LongRunning["long-running-task\nLong-running task contracts"]
227
227
  Core --> Dashboard["dashboard\nLocal HTML Dashboard"]
@@ -233,7 +233,7 @@ flowchart TD
233
233
  | Capability | When to enable |
234
234
  | --- | --- |
235
235
  | `core` | Always — this is the required foundation |
236
- | `module-parallel` | When the project has 2+ independent modules needing parallel ownership |
236
+ | `module-parallel` | When the project has 2+ independent modules and needs `harness.yaml modules.items` to maintain owner, scope, dependencies, and sync rules |
237
237
  | `subagent-worker` | When code-change subagents need to work in isolated worktrees and commit handoffs |
238
238
  | `adversarial-review` | When release, architecture, security, data, or policy risks require independent review artifacts |
239
239
  | `long-running-task` | When Agents may run across multiple loops without per-step user confirmation |
@@ -19,7 +19,7 @@ For example:
19
19
  - Why is state stored in Markdown files instead of a database?
20
20
  - Why are there three check profiles instead of one?
21
21
  - What's the difference between `governance-sync` and `governance rebuild`, and why are they separate?
22
- - Why must `review-confirm` be a manual operation why can't it be automated?
22
+ - Why must human confirmation go through the local Workbench instead of a regular CLI command?
23
23
 
24
24
  The answers to these questions are scattered across design decisions, historical evolution,
25
25
  and operating standards. These docs bring them together so you can understand the system's
@@ -8,7 +8,7 @@ This guide is written for coding agents that install or upgrade Harness inside a
8
8
 
9
9
  The main operator for this CLI is usually an agent inside the target project, not the end user. The agent should not ask the user to study command flags, template folders, or capability choices. Those decisions must happen during Diagnose / Decide and be explained in the delivery summary.
10
10
 
11
- Commands in this guide are written with an installed `harness` command. The agent must first check `command -v harness`. If the target environment does not have `harness`, do not silently install globally. Ask the user whether `npm install -g coding-agent-harness` is allowed. Run that global install only after explicit approval. If the user does not approve or does not respond, run the same CLI with `npx --yes coding-agent-harness <command>`. Maintainers debugging from the source checkout can replace the same command with `node dist/harness.mjs`.
11
+ Commands in this guide are written with an installed `harness` command. The agent must first check `command -v harness`. If the target environment does not have `harness`, do not silently install globally. Ask the user whether `npm install -g coding-agent-harness` is allowed. Run that global install only after explicit approval. If the user does not approve or does not respond, run the same CLI with `npx --yes coding-agent-harness <command>`. Maintainers debugging from the source checkout can replace the same command with `node dist/harness.mjs` after `npm install` or `npm run build:runtime` has generated `dist/`.
12
12
 
13
13
  `harness init` does not add this npm package to the target project's dependencies. It only writes Harness docs, templates, and the registry. Delivery summaries must not imply that the target project now has an npm dependency installed. The first `npx` run downloads the package into npm cache; it is not a project dependency or a global command install. When CLI access is needed, keep using `npx --yes coding-agent-harness ...`, a user-approved global `harness`, or `node dist/harness.mjs` from the source checkout.
14
14
 
@@ -205,10 +205,8 @@ harness task-log <task-id-from-new-task-output> \
205
205
  --evidence "command:TARGET:npm-test:passed" \
206
206
  /path/to/project
207
207
 
208
- harness review-confirm <task-id-from-new-task-output> \
209
- --reviewer "Human Reviewer" \
210
- --confirm <task-id-from-new-task-output> \
211
- /path/to/project
208
+ # Human confirmation is only available from the local Dashboard workbench:
209
+ harness dev /path/to/project
212
210
 
213
211
  harness task-complete <task-id-from-new-task-output> \
214
212
  --message "Verification loop completed" \
@@ -225,7 +223,7 @@ Rules:
225
223
  - Existing task directories are not overwritten. Renaming or continuing old tasks is a coordinator decision.
226
224
  - `task-start`, `task-block`, and `task-complete` only update lifecycle status and logs in `progress.md`.
227
225
  - `task-log` only appends execution records. Evidence uses `type:PATH:summary`, for example `command:TARGET:npm-test:passed`.
228
- - `review-confirm` writes human review confirmation audit fields to the task `INDEX.md` through gated commits. It must reject open P0/P1/P2 findings marked `Open: yes` or `Blocks Release: yes`.
226
+ - Dashboard workbench writes human review confirmation audit fields to the task `INDEX.md` through gated commits. It must reject open P0/P1/P2 findings marked `Open: yes` or `Blocks Release: yes`. The regular CLI does not expose a human confirmation command.
229
227
  - CLI-owned lifecycle and lesson commands auto-commit allowlisted writes in a clean Git root. Dirty state appears in `status` / dashboard warnings and blocks those mechanical commits. Agent-owned manual edits still need proactive commits; deferred commits must record the no-commit reason, owner, and next step.
230
228
  - `status --json` keeps old `task.state` for compatibility and adds `lifecycleState`, `reviewStatus`, `closeoutStatus`, and `stateConflicts`. `done` means implementation finished; it does not mean `closed`.
231
229
  - For human operation, start the local HTML workbench with `harness dev /path/to/project`. It binds to `127.0.0.1`, chooses a port automatically, opens the browser, and refreshes when docs change. In headless or CI contexts, use `harness dev --no-open /path/to/project`.
@@ -15,7 +15,8 @@ English mirror: `docs-release/guides/agent-installation.en-US.md`
15
15
  如果目标环境没有 `harness` 命令,不得静默全局安装;先询问用户是否允许运行
16
16
  `npm install -g coding-agent-harness`。只有用户明确同意后才能修改全局 npm 环境。
17
17
  用户不同意或未回复时,用 `npx --yes coding-agent-harness <command>` 运行同一条 CLI。
18
- 维护者在本源码仓调试时,可以把同一命令替换为 `node dist/harness.mjs`。
18
+ 维护者在本源码仓调试时,可以在 `npm install` 或 `npm run build:runtime`
19
+ 生成 `dist/` 后,把同一命令替换为 `node dist/harness.mjs`。
19
20
 
20
21
  `harness init` 不会把 npm 包写进目标项目依赖;它只写 Harness 文档、模板和 registry。
21
22
  因此 agent 交付时不能暗示目标项目已经安装了 npm dependency。`npx` 第一次运行会把包
@@ -91,7 +92,7 @@ Capability 要保守选择:
91
92
  | `dashboard` | 否 | 用户或 agent 需要本地状态页、静态证据快照,或本机动态 workbench。 |
92
93
  | `adversarial-review` | 否 | 发布、架构、安全、数据或策略风险需要独立 review artifact。 |
93
94
  | `long-running-task` | 否 | Agent 需要连续多轮执行,不能每步都询问用户。 |
94
- | `module-parallel` | 否 | 两个以上独立模块需要 owner、registry 和同步规则。 |
95
+ | `module-parallel` | 否 | 两个以上独立模块需要 YAML 注册、owner、scope、依赖和同步规则。 |
95
96
  | `subagent-worker` | 否 | 会改代码的 subagent 需要独立 worktree 和 commit-backed handoff;依赖 `module-parallel`。 |
96
97
 
97
98
  `init` 的 JSON 输出会包含 `report`。交付 summary 必须包含:
@@ -195,7 +196,7 @@ harness new-task \
195
196
  - 已有项目事实只能 merge、append 或记录 residual;不能用泛化模板替换。
196
197
  - 历史合同缺口在普通模式下进入 `adoption-needed` warning。
197
198
  - `--strict` 必须仍然能因为旧 checker 失败或历史合同缺口而失败。
198
- - 旧全局表和模块索引先归档,再用 `harness governance rebuild --archive --apply` 重新生成;这些表是 Agent 索引,人看状态优先用 Dashboard
199
+ - 旧全局表和模块索引先归档,再用 `harness governance rebuild --archive --apply` 重新生成;这些表是 Agent 索引,人看状态优先用 Dashboard。模块注册表以根 `harness.yaml` 的 `modules.items` 为准,`Module-Registry.md` 是生成视图。
199
200
  - `migrate-verify` 必须通过,才能报告迁移输出可用;dashboard 路径必须是 HTML。
200
201
  - 必须基于验证通过的 `session.json` 创建 `legacy-migration` preset 任务。它记录 migration session、证据包、preset audit 和后续 work queue;不会自动重写历史任务正文。
201
202
  - 详细迁移策略见 `docs-release/guides/migration-playbook.md` 或英文镜像
@@ -224,10 +225,8 @@ harness task-log <new-task 输出的 task-id> \
224
225
  --evidence "command:TARGET:npm-test:passed" \
225
226
  /path/to/project
226
227
 
227
- harness review-confirm <new-task 输出的 task-id> \
228
- --reviewer "Human Reviewer" \
229
- --confirm <new-task 输出的 task-id> \
230
- /path/to/project
228
+ # 人工确认只能在本地 Dashboard workbench 中点击完成:
229
+ harness dev /path/to/project
231
230
 
232
231
  harness task-complete <new-task 输出的 task-id> \
233
232
  --message "验证闭环完成" \
@@ -246,11 +245,15 @@ harness task-complete <new-task 输出的 task-id> \
246
245
  `execution_strategy.md`、`findings.md`、`lesson_candidates.md` 和 `review.md`。
247
246
  - `new-task --budget complex` 创建 standard 文件,并额外创建
248
247
  `references/INDEX.md` 和 `artifacts/INDEX.md`。
248
+ - `module register` 只创建模块根 `brief.md`、`module_plan.md`,并把模块登记到
249
+ `harness.yaml modules.items`;`module scaffold` 只修复这两个模块根文档。
250
+ - `new-task --module <key>` 在 `planning/modules/<key>/tasks/<task-id>/` 下创建任务,
251
+ 任务目录内才包含 `execution_strategy.md`、`visual_map.md` 等执行合同。
249
252
  - 已存在的任务目录不会被覆盖;需要改名或继续旧任务时,由 coordinator 决定。
250
253
  - `task-start`、`task-block`、`task-complete` 只更新 `progress.md` 的生命周期状态和日志。
251
254
  - `task-log` 只追加执行记录;证据使用 `type:PATH:summary`,例如
252
255
  `command:TARGET:npm-test:passed`。
253
- - `review-confirm` 会通过受控提交把人工确认审计字段写入任务 `INDEX.md`;如果存在 `Open: yes` 或 `Blocks Release: yes` 的开放 P0/P1/P2 finding,必须拒绝确认。
256
+ - Dashboard workbench 会通过受控提交把人工确认审计字段写入任务 `INDEX.md`;如果存在 `Open: yes` 或 `Blocks Release: yes` 的开放 P0/P1/P2 finding,必须拒绝确认。普通 CLI 不暴露人工确认命令。
254
257
  - CLI-owned lifecycle 和 lesson 命令会在干净 Git root 中自动提交 allowlisted 写入;dirty 状态会出现在 `status` / dashboard 的警告里,并阻塞这些机械化提交。Agent 手工改动仍要主动提交,不能提交时记录 no-commit reason、owner 和下一步。
255
258
  - `status --json` 保留旧 `task.state` 用于兼容,并新增 `lifecycleState`、`reviewStatus`、`closeoutStatus` 和 `stateConflicts`。`done` 只表示实现完成,不等于 `closed`。
256
259
  - 人工操作入口使用本地 HTML workbench:`harness dev /path/to/project`。它会启动只绑定 `127.0.0.1` 的动态页面、自动选择端口、打开浏览器并随 docs 变更刷新。无 GUI 或 CI 场景使用 `harness dev --no-open /path/to/project`。