coding-agent-harness 1.0.2 → 1.0.5

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 (219) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/CONTRIBUTING.md +98 -0
  3. package/LICENSE +661 -21
  4. package/LICENSE-EXCEPTION.md +37 -0
  5. package/README.md +244 -87
  6. package/README.zh-CN.md +77 -35
  7. package/SKILL.md +32 -24
  8. package/docs-release/README.md +9 -5
  9. package/docs-release/architecture/overview.md +17 -5
  10. package/docs-release/architecture/overview.zh-CN.md +9 -5
  11. package/docs-release/architecture/system-explainer/01-system-overview.md +217 -0
  12. package/docs-release/architecture/system-explainer/02-module-dependency.md +257 -0
  13. package/docs-release/architecture/system-explainer/03-task-lifecycle.md +304 -0
  14. package/docs-release/architecture/system-explainer/04-check-and-governance.md +239 -0
  15. package/docs-release/architecture/system-explainer/05-data-flow.md +276 -0
  16. package/docs-release/architecture/system-explainer/06-preset-and-migration.md +303 -0
  17. package/docs-release/architecture/system-explainer/README.md +67 -0
  18. package/docs-release/architecture/system-explainer/en-US/01-system-overview.md +226 -0
  19. package/docs-release/architecture/system-explainer/en-US/02-module-dependency.md +263 -0
  20. package/docs-release/architecture/system-explainer/en-US/03-task-lifecycle.md +319 -0
  21. package/docs-release/architecture/system-explainer/en-US/04-check-and-governance.md +250 -0
  22. package/docs-release/architecture/system-explainer/en-US/05-data-flow.md +290 -0
  23. package/docs-release/architecture/system-explainer/en-US/06-preset-and-migration.md +323 -0
  24. package/docs-release/architecture/system-explainer/en-US/README.md +70 -0
  25. package/docs-release/assets/dashboard-overview.png +0 -0
  26. package/docs-release/guides/agent-installation.en-US.md +39 -15
  27. package/docs-release/guides/agent-installation.md +43 -16
  28. package/docs-release/guides/contributing.md +100 -0
  29. package/docs-release/guides/contributing.zh-CN.md +99 -0
  30. package/docs-release/guides/document-audience-and-surfaces.en-US.md +3 -2
  31. package/docs-release/guides/document-audience-and-surfaces.md +3 -2
  32. package/docs-release/guides/full-legacy-migration-subagent-strategy.md +2 -2
  33. package/docs-release/guides/full-legacy-migration-subagent-strategy.zh-CN.md +2 -2
  34. package/docs-release/guides/legacy-migration-agent-prompt.md +0 -11
  35. package/docs-release/guides/legacy-migration-agent-prompt.zh-CN.md +0 -11
  36. package/docs-release/guides/migration-playbook.en-US.md +14 -15
  37. package/docs-release/guides/migration-playbook.md +14 -15
  38. package/docs-release/guides/parent-control-repository-pattern.en-US.md +7 -5
  39. package/docs-release/guides/parent-control-repository-pattern.md +7 -5
  40. package/docs-release/guides/preset-development.md +238 -0
  41. package/docs-release/guides/repository-operating-models.en-US.md +5 -4
  42. package/docs-release/guides/repository-operating-models.md +5 -4
  43. package/docs-release/guides/task-state-machine.en-US.md +224 -0
  44. package/docs-release/guides/task-state-machine.md +231 -0
  45. package/docs-release/intl/en-US.md +1 -1
  46. package/docs-release/intl/zh-CN.md +1 -1
  47. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/INDEX.md +60 -0
  48. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/findings.md +7 -0
  49. package/package.json +10 -4
  50. package/presets/legacy-migration/checks/preset-check.mjs +3 -0
  51. package/presets/legacy-migration/preset.yaml +134 -0
  52. package/presets/legacy-migration/scripts/plan-work-queue.mjs +4 -0
  53. package/presets/legacy-migration/scripts/scaffold-task-contracts.mjs +4 -0
  54. package/presets/legacy-migration/templates/execution_strategy.append.md +18 -0
  55. package/presets/legacy-migration/templates/findings.seed.md +17 -0
  56. package/presets/legacy-migration/templates/review.seed.md +12 -0
  57. package/presets/legacy-migration/templates/task_plan.append.md +9 -0
  58. package/presets/legacy-migration/templates/visual_map.append.md +12 -0
  59. package/presets/legacy-migration/workbench/dashboard-panels.yaml +2 -0
  60. package/presets/legacy-migration/workbench/migration-queue.schema.json +23 -0
  61. package/presets/lesson-sedimentation/preset.yaml +23 -0
  62. package/presets/lesson-sedimentation/templates/prompt.md +23 -0
  63. package/presets/module/preset.yaml +25 -0
  64. package/presets/module/templates/execution_strategy.append.md +8 -0
  65. package/presets/module/templates/task_plan.append.md +17 -0
  66. package/presets/standard-task/preset.yaml +31 -0
  67. package/presets/standard-task/templates/task_plan.append.md +7 -0
  68. package/references/adversarial-review-standard.md +2 -2
  69. package/references/agents-md-pattern.md +2 -2
  70. package/references/delivery-operating-model-standard.md +3 -3
  71. package/references/docs-directory-standard.md +6 -7
  72. package/references/harness-ledger.md +53 -96
  73. package/references/lessons-governance.md +88 -93
  74. package/references/module-parallel-standard.md +14 -14
  75. package/references/planning-loop.md +12 -6
  76. package/references/pull-request-standard.md +118 -0
  77. package/references/repo-governance-standard.md +11 -2
  78. package/references/review-routing-standard.md +7 -1
  79. package/references/ssot-governance.md +67 -59
  80. package/references/taskr-gap-analysis.md +600 -0
  81. package/references/walkthrough-closeout.md +7 -7
  82. package/scripts/check-harness.mjs +40 -301
  83. package/scripts/commands/dashboard-command.mjs +67 -0
  84. package/scripts/commands/migration-command.mjs +126 -0
  85. package/scripts/commands/preset-command.mjs +73 -0
  86. package/scripts/commands/task-command.mjs +328 -0
  87. package/scripts/harness.mjs +59 -260
  88. package/scripts/lib/capability-registry.mjs +82 -28
  89. package/scripts/lib/check-module-parallel.mjs +230 -0
  90. package/scripts/lib/check-profiles.mjs +90 -228
  91. package/scripts/lib/check-task-contracts.mjs +55 -0
  92. package/scripts/lib/core-shared.mjs +65 -2
  93. package/scripts/lib/dashboard-data.mjs +155 -24
  94. package/scripts/lib/dashboard-workbench.mjs +131 -12
  95. package/scripts/lib/dashboard-writer.mjs +20 -4
  96. package/scripts/lib/git-status-summary.mjs +46 -0
  97. package/scripts/lib/governance-index-generator.mjs +174 -0
  98. package/scripts/lib/governance-sync.mjs +611 -0
  99. package/scripts/lib/governance-table-boundary.mjs +175 -0
  100. package/scripts/lib/harness-core.mjs +6 -0
  101. package/scripts/lib/lesson-maintenance.mjs +36 -29
  102. package/scripts/lib/markdown-utils.mjs +33 -0
  103. package/scripts/lib/migration-planner.mjs +4 -6
  104. package/scripts/lib/migration-support.mjs +1 -1
  105. package/scripts/lib/phase-kind.mjs +50 -0
  106. package/scripts/lib/preset-audit-contracts.mjs +37 -0
  107. package/scripts/lib/preset-engine.mjs +494 -0
  108. package/scripts/lib/preset-registry.mjs +776 -0
  109. package/scripts/lib/preset-resource-contracts.mjs +83 -0
  110. package/scripts/lib/review-confirm-git-gate.mjs +248 -0
  111. package/scripts/lib/status-builder.mjs +88 -0
  112. package/scripts/lib/status-dashboard-renderer.mjs +105 -0
  113. package/scripts/lib/subagent-authorization-audit.mjs +196 -0
  114. package/scripts/lib/task-audit-metadata.mjs +385 -0
  115. package/scripts/lib/task-audit-migration.mjs +350 -0
  116. package/scripts/lib/task-completion-consistency.mjs +26 -0
  117. package/scripts/lib/task-index.mjs +93 -0
  118. package/scripts/lib/task-lesson-candidates.mjs +242 -0
  119. package/scripts/lib/task-lesson-sedimentation.mjs +326 -0
  120. package/scripts/lib/task-lifecycle/create-task-helpers.mjs +67 -0
  121. package/scripts/lib/task-lifecycle/phase-sync.mjs +88 -0
  122. package/scripts/lib/task-lifecycle/review-confirm.mjs +112 -0
  123. package/scripts/lib/task-lifecycle/review-gates.mjs +73 -0
  124. package/scripts/lib/task-lifecycle/review-submission.mjs +63 -0
  125. package/scripts/lib/task-lifecycle/scaffold-provenance.mjs +49 -0
  126. package/scripts/lib/task-lifecycle/template-files.mjs +53 -0
  127. package/scripts/lib/task-lifecycle/text-utils.mjs +24 -0
  128. package/scripts/lib/task-lifecycle.mjs +338 -477
  129. package/scripts/lib/task-metadata.mjs +118 -0
  130. package/scripts/lib/task-review-model.mjs +455 -0
  131. package/scripts/lib/task-scanner.mjs +193 -372
  132. package/scripts/lib/task-tombstone-commands.mjs +140 -0
  133. package/scripts/postinstall.mjs +14 -0
  134. package/skills/preset-creator/SKILL.md +179 -0
  135. package/skills/preset-creator/references/complex-task-skeleton/README.md +31 -0
  136. package/skills/preset-creator/references/complex-task-skeleton/artifacts/INDEX.md +12 -0
  137. package/skills/preset-creator/references/complex-task-skeleton/brief.md +43 -0
  138. package/skills/preset-creator/references/complex-task-skeleton/execution_strategy.md +71 -0
  139. package/skills/preset-creator/references/complex-task-skeleton/findings.md +24 -0
  140. package/skills/preset-creator/references/complex-task-skeleton/lesson_candidates.md +70 -0
  141. package/skills/preset-creator/references/complex-task-skeleton/long-running-task-contract.md +76 -0
  142. package/skills/preset-creator/references/complex-task-skeleton/progress.md +33 -0
  143. package/skills/preset-creator/references/complex-task-skeleton/references/INDEX.md +13 -0
  144. package/skills/preset-creator/references/complex-task-skeleton/review.md +107 -0
  145. package/skills/preset-creator/references/complex-task-skeleton/task_plan.md +111 -0
  146. package/skills/preset-creator/references/complex-task-skeleton/visual_map.md +50 -0
  147. package/skills/preset-creator/references/preset-package-skeleton.md +296 -0
  148. package/templates/AGENTS.md.template +24 -18
  149. package/templates/dashboard/assets/app-src/00-state.js +13 -0
  150. package/templates/dashboard/assets/app-src/10-router.js +5 -1
  151. package/templates/dashboard/assets/app-src/20-overview.js +18 -8
  152. package/templates/dashboard/assets/app-src/30-tasks.js +92 -246
  153. package/templates/dashboard/assets/app-src/35-task-detail.js +286 -0
  154. package/templates/dashboard/assets/app-src/45-review.js +241 -22
  155. package/templates/dashboard/assets/app-src/50-migration.js +24 -10
  156. package/templates/dashboard/assets/app-src/55-presets.js +375 -0
  157. package/templates/dashboard/assets/app-src/60-shared.js +3 -1
  158. package/templates/dashboard/assets/app-src/90-bindings.js +302 -29
  159. package/templates/dashboard/assets/app.css +1501 -376
  160. package/templates/dashboard/assets/app.css.manifest.json +10 -0
  161. package/templates/dashboard/assets/app.js +1240 -101
  162. package/templates/dashboard/assets/app.manifest.json +2 -0
  163. package/templates/dashboard/assets/css-src/00-foundation.css +346 -0
  164. package/templates/dashboard/assets/css-src/10-panels-flow.css +236 -0
  165. package/templates/dashboard/assets/css-src/20-briefs-controls.css +398 -0
  166. package/templates/dashboard/assets/css-src/30-task-index.css +739 -0
  167. package/templates/dashboard/assets/css-src/35-review-workspace.css +507 -0
  168. package/templates/dashboard/assets/css-src/40-detail-modules-migration.css +489 -0
  169. package/templates/dashboard/assets/css-src/45-presets.css +516 -0
  170. package/templates/dashboard/assets/css-src/50-responsive-overrides.css +551 -0
  171. package/templates/dashboard/assets/i18n.js +263 -23
  172. package/templates/ledger/Harness-Ledger.md +13 -25
  173. package/templates/lessons/lesson-arch-process-change.md +1 -1
  174. package/templates/lessons/lesson-new-doc.md +1 -1
  175. package/templates/lessons/lesson-ref-change.md +1 -1
  176. package/templates/planning/INDEX.md +87 -0
  177. package/templates/planning/brief.md +1 -1
  178. package/templates/planning/execution_strategy.md +31 -0
  179. package/templates/planning/lesson_candidates.md +18 -6
  180. package/templates/planning/module_session_prompt.md +1 -0
  181. package/templates/planning/optional/artifacts/INDEX.md +3 -3
  182. package/templates/planning/optional/references/INDEX.md +3 -3
  183. package/templates/planning/review.md +41 -0
  184. package/templates/planning/task_plan.md +5 -21
  185. package/templates/planning/visual_map.md +13 -9
  186. package/templates/planning/visual_map.simple.md +52 -0
  187. package/templates/reference/execution-workflow-standard.md +31 -3
  188. package/templates/reference/pull-request-standard.md +80 -0
  189. package/templates/reference/repo-governance-standard.md +7 -6
  190. package/templates/reference/review-routing-standard.md +6 -0
  191. package/templates/reference/walkthrough-standard.md +2 -1
  192. package/templates/verifier/verifier-output.md +1 -1
  193. package/templates-zh-CN/AGENTS.md.template +25 -19
  194. package/templates-zh-CN/ledger/Harness-Ledger.md +17 -40
  195. package/templates-zh-CN/planning/INDEX.md +87 -0
  196. package/templates-zh-CN/planning/brief.md +1 -1
  197. package/templates-zh-CN/planning/execution_strategy.md +30 -0
  198. package/templates-zh-CN/planning/lesson_candidates.md +18 -6
  199. package/templates-zh-CN/planning/module_session_prompt.md +1 -0
  200. package/templates-zh-CN/planning/review.md +41 -1
  201. package/templates-zh-CN/planning/task_plan.md +4 -44
  202. package/templates-zh-CN/planning/visual_map.md +14 -7
  203. package/templates-zh-CN/planning/visual_map.simple.md +48 -0
  204. package/templates-zh-CN/reference/adversarial-review-standard.md +1 -1
  205. package/templates-zh-CN/reference/docs-library-standard.md +1 -1
  206. package/templates-zh-CN/reference/execution-workflow-standard.md +33 -7
  207. package/templates-zh-CN/reference/harness-ledger-standard.md +2 -2
  208. package/templates-zh-CN/reference/pull-request-standard.md +106 -0
  209. package/templates-zh-CN/reference/repo-governance-standard.md +4 -3
  210. package/templates-zh-CN/reference/review-routing-standard.md +8 -1
  211. package/templates-zh-CN/reference/walkthrough-standard.md +3 -2
  212. package/templates-zh-CN/walkthrough/Closeout-SSoT.md +1 -1
  213. package/docs-release/assets/dashboard-overview-en.png +0 -0
  214. package/scripts/smoke-dashboard.mjs +0 -92
  215. package/scripts/test-harness.mjs +0 -1395
  216. package/templates/ssot/Feature-SSoT.md +0 -43
  217. package/templates/ssot/Lessons-SSoT.md +0 -44
  218. package/templates-zh-CN/ssot/Feature-SSoT.md +0 -49
  219. package/templates-zh-CN/ssot/Lessons-SSoT.md +0 -49
@@ -2,13 +2,11 @@
2
2
 
3
3
  ## 核心思路
4
4
 
5
- Harness Ledger `docs/` 骨架的全局更新总账。它不保存业务事实,也不替代
6
- Delivery / Feature / Regression / Lessons 四张 SSoT;它只记录每个非平凡任务是否按 harness SOP
7
- 维护了应该维护的上下文。Closeout SSoT 则记录每个 closed 任务是否有 walkthrough 或受控 skip reason。
5
+ Harness Ledger 是任务生命周期的全局生成索引。它把任务目录、模块任务、review、lesson、closeout residual 的可扫描状态汇总到一张表,方便 Agent 快速定位;人看当前状态优先使用 Dashboard。
8
6
 
9
7
  一句话定义:
10
8
 
11
- > SSoT 保存当前事实;Harness Ledger 记录每轮任务是否维护了这些事实。
9
+ > 任务本地文件保存事实;Harness CLI 从这些事实生成 Harness Ledger
12
10
 
13
11
  ## 文件位置
14
12
 
@@ -16,135 +14,94 @@ Delivery / Feature / Regression / Lessons 四张 SSoT;它只记录每个非平
16
14
  docs/Harness-Ledger.md
17
15
  ```
18
16
 
19
- 放在 `docs/` 根目录,而不是 `docs/01-GOVERNANCE/`。原因是它横跨 planning、
20
- regression、walkthrough、reference、lessons 等多个目录,是全局审计索引。
17
+ 放在 `docs/` 根目录,因为它横跨 planning、review、walkthrough、lessons 和模块索引。
21
18
 
22
19
  ## 职责边界
23
20
 
24
21
  Harness Ledger 记录:
25
22
 
26
- - 本任务是否创建或更新 task plan
27
- - 是否创建或更新 review report(如任务需要对抗性审查)
28
- - 是否更新或验证 Repo Governance / CI-CD guardrails
29
- - 是否回写 Feature SSoT
30
- - 是否更新 Regression SSoT 或 Cadence Ledger
31
- - 是否创建 walkthrough
32
- - 是否执行 Lessons 检查,是否产生 Lessons SSoT 条目
33
- - 如果产生 Lessons SSoT 条目,是否已创建 `docs/01-GOVERNANCE/lessons/` 详情文档
34
- - 本轮触碰了哪些 harness 文档
35
- - 是否有 residual 或 skipped-with-reason
23
+ - task / module scope
24
+ - module key
25
+ - task title
26
+ - lifecycle state
27
+ - queue markers
28
+ - task plan 路径
29
+ - review 状态或路径
30
+ - Lessons Check 状态
31
+ - closeout 状态
32
+ - residual 摘要
33
+ - 生成日期
36
34
 
37
35
  Harness Ledger 不记录:
38
36
 
39
37
  - 每次 `progress.md` 的过程性更新
40
38
  - 每条测试输出
41
39
  - 每个 git diff 细节
42
- - Feature / Regression / Lessons 的业务事实本身
40
+ - Regression / Delivery / Cadence / Closeout 的详细治理事实
41
+ - lesson 详情正文
43
42
  - 可以从 git history 直接恢复的逐行变更
44
43
 
45
- ## 触发规则
44
+ `Feature-SSoT.md` 和 `Private-Feature-SSoT.md` 是旧版任务生命周期投影。当前版本在 `harness governance rebuild --archive --apply` 中归档这些旧表,不再重新生成。
46
45
 
47
- 必须更新 Harness Ledger:
46
+ ## 生成规则
48
47
 
49
- 1. 完成一个非平凡 task / wave / feature
50
- 2. Bootstrap harness 完成
51
- 3. 同步或升级最新版 coding-agent-harness
52
- 4. 新增或修改 AGENTS.md / CLAUDE.md / reference / template
53
- 5. 创建或更新 required review report
54
- 6. coordinator pass 同步模块任务的全局状态、review、closeout 或 regression 结果
55
- 7. 修改 Repo Governance / CI-CD / required checks / branch protection 状态
56
- 8. 修改 Feature SSoT、Regression SSoT、Lessons SSoT 任一文件
57
- 9. 创建 walkthrough
58
- 10. Lessons approved 后合入正式 reference
48
+ 触发任务生命周期变化时,优先使用 CLI:
59
49
 
60
- 不需要更新 Harness Ledger:
61
-
62
- 1. typo
63
- 2. 单次 `progress.md` 过程性更新
64
- 3. 普通测试输出粘贴
65
- 4. 只读分析
66
- 5. routine regression batch 只更新 `Last Verified` 且无 residual /
67
- evidence depth 变化
68
-
69
- ## 状态词
70
-
71
- 字段值必须使用固定词,避免自由文本失控:
72
-
73
- - `required`
74
- - `updated`
75
- - `created`
76
- - `checked-none`
77
- - `checked-candidate`
78
- - `queued-promotion`
79
- - `checked-created`
80
- - `n/a`
81
- - `skipped-with-reason`
82
- - `missing`
83
-
84
- ## ID 规则
85
-
86
- 格式:
87
-
88
- ```text
89
- HL-YYYYMMDD-NNN
50
+ ```bash
51
+ harness new-task --title "<title>"
52
+ harness task-start <task-id>
53
+ harness task-phase <task-id> <phase-id> --state done
54
+ harness task-review <task-id>
55
+ harness task-complete <task-id>
56
+ harness governance rebuild --archive --apply
90
57
  ```
91
58
 
92
- 示例:
59
+ Agent 不应手写或机械更新 Ledger 的任务行。如果发现生成结果不对,应修复 scanner、generator 或任务本地事实,再重新生成。
93
60
 
94
- ```text
95
- HL-20260511-001
96
- ```
61
+ ## 与其他治理表的关系
62
+
63
+ - Delivery SSoT 仍管理交付 block、跨仓顺序、owner 和依赖。
64
+ - Regression SSoT 仍管理回归面、证据深度和 residual。
65
+ - Cadence Ledger 仍管理周期性验证节奏。
66
+ - Closeout SSoT 仍管理 walkthrough、closeout status 和受控 skip reason。
67
+ - Module Registry 仍管理模块边界、owner、worktree 和写入范围。
97
68
 
98
- agent 并行时,每个 agent 只追加或更新自己负责的 row。冲突时保留双方 row,
99
- 不要重排全表。
69
+ 这些表不是任务生命周期小表。本版本只移除 `Feature-SSoT.md` / `Private-Feature-SSoT.md` 这类生命周期投影,不删除尚无等价 scanner/generator 的治理表。
100
70
 
101
71
  ## 归档规则
102
72
 
103
- Active 表保留最近 50 条。更早的 `closed` 或 `superseded` 条目按季度归档:
73
+ 旧生命周期表切换时归档到:
104
74
 
105
75
  ```text
106
- docs/01-GOVERNANCE/_archive/Harness-Ledger-archive-YYYY-QN.md
76
+ docs/09-PLANNING/_archive/<timestamp>/
107
77
  ```
108
78
 
109
- 归档不改变 `HL-*` ID,也不删除 walkthrough、task plan 或四张 SSoT 中的引用。
79
+ 归档不改变历史证据,也不要求迁移 Agent 删除旧快照。确认 Dashboard、`task-list`、`task-index` 和新 Ledger 都能表达当前任务后,项目 owner 再决定是否清理归档。
110
80
 
111
81
  ## Closeout 顺序
112
82
 
113
83
  每个非平凡任务收口时按以下顺序:
114
84
 
115
- 1. 更新 `progress.md`
116
- 2. 跑必要验证和 regression gate
117
- 3. 回写 Feature SSoT;模块并行 worker 只回写 module_plan 和 Coordinator Handoff,coordinator pass 再同步 Module Registry / Harness Ledger
118
- 4. 完成 `review.md` 并处理 material findings(如适用)
119
- 5. 回写 Repo Governance / CI-CD 状态(如适用)
120
- 6. 回写 Regression SSoT / Cadence Ledger(如适用)
121
- 7. walkthrough
122
- 8. 更新 Closeout SSoT
123
- 9. 执行 Lessons 检查;新任务先更新 `lesson_candidates.md`,如人工确认沉淀,再由维护命令写详情文档并更新 Lessons SSoT
124
- 10. 更新 Harness Ledger
125
-
126
- 最后更新 Harness Ledger,是为了让它记录本轮所有上下文维护的最终状态。
127
- 如果 Harness Ledger row 进入 `closed` / `closed-with-residual` / `closed-local-only`,
128
- 必须同步在 `docs/10-WALKTHROUGH/Closeout-SSoT.md` 登记 walkthrough 或受控 skip reason。
129
- 同时必须登记 Lessons Check:`checked-candidate: LC-...`、`queued-promotion: LC-...`、
130
- `checked-created: L-YYYY-MM-DD-NNN`,或旧任务兼容的 `checked-none: <reason>`。
85
+ 1. 更新 `progress.md` 或等价任务本地事实。
86
+ 2. 跑必要验证和 regression gate
87
+ 3. 完成 `review.md` 并处理 material findings(如适用)。
88
+ 4. 回写 Repo Governance / CI-CD 状态(如适用)。
89
+ 5. 回写 Regression SSoT / Cadence Ledger / Delivery SSoT 等本轮实际触达的非生命周期治理表(如适用)。
90
+ 6. walkthrough。
91
+ 7. 更新 Closeout SSoT。
92
+ 8. 执行 Lessons 检查;新任务先更新 `lesson_candidates.md`,如人工确认沉淀,再由维护命令写详情文档。
93
+ 9. 运行 Harness CLI 生成或刷新 Harness Ledger。
131
94
 
132
- ## Harness Update 记录
133
-
134
- 更新已有 harness 时,Ledger row 只记录本次 delta merge:
95
+ 最后刷新 Harness Ledger,是为了让它记录本轮任务本地事实和治理表维护结果的最终状态。
135
96
 
136
- - 读到了哪个最新版 Skill / reference / template
137
- - 新增或修补了哪些 harness 骨架文件
138
- - 哪些既有 SSoT / walkthrough / task history 被保留未覆盖
139
- - 是否产生 residual,例如某个标准暂不适合当前项目
97
+ ## Harness Update 记录
140
98
 
141
- 不要把模板全文、旧文档全文或逐行 diff 复制进 Ledger。细节由 git history
142
- walkthrough 保存,Ledger 只回答"这次升级维护了哪些上下文入口"。
99
+ 更新已有 harness 时,Ledger row 只记录本次 task lifecycle delta。具体标准、模板、reference 的合并细节由 task plan、progress、walkthrough 和 git history 保存。
143
100
 
144
101
  ## 常见反模式
145
102
 
146
- - Harness Ledger 写成逐行 diff 日志
147
- - 把 Feature / Regression / Lessons 的业务事实复制进 Ledger
103
+ - 手写 Ledger 任务行而不是修复任务事实或生成器
104
+ - 把 Regression / Delivery 的详细治理事实复制进 Ledger
148
105
  - 每次测试或每次 progress 变动都追加 row
149
106
  - 用自由文本状态导致无法快速扫描
150
- - 任务完成但 Ledger 标记 `missing` 没有 residual 说明
107
+ - Feature 生命周期表归档后又重新创建
@@ -2,92 +2,92 @@
2
2
 
3
3
  ## 核心思路
4
4
 
5
- Agent Walkthrough 收口时自动识别可沉淀的经验,先将详细内容落到
6
- `docs/01-GOVERNANCE/lessons/` 目录,再写入 Lessons SSoT。人审批后决定是否合入正式 reference。
5
+ Lessons 不再使用一张手工维护的全局表。原因很简单:lesson candidate 是任务收口时的审查材料,promotion 是后续治理动作;把两者都塞进共享表,会让多个 agent 争抢同一个文件,也会让表和任务本地事实漂移。
7
6
 
8
- **硬规则:Lessons SSoT 表行不能单独存在。** 每一条 pending lesson 必须有一篇
9
- `docs/01-GOVERNANCE/lessons/L-YYYY-MM-DD-NNN-<slug>.md` 详情文档,表里的
10
- `Detail Doc` 列必须指向这篇文档。如果只是填表而没有详情文档,这次 closeout
11
- 不算完成。
7
+ 新的事实来源只有三层:
12
8
 
13
- 这是 harness 的第三条 SSoT 轨道:
9
+ | 层级 | 文件 | 职责 |
10
+ | --- | --- | --- |
11
+ | 任务本地队列 | `docs/09-PLANNING/**/lesson_candidates.md` | 记录候选、拒绝、无候选、排队 promotion 和人工判定 |
12
+ | 任务本地详情 | `docs/09-PLANNING/**/lessons/LC-*.md` | 在源任务上下文还新鲜时写完整 lesson 正文,供后续沉淀任务读取 |
13
+ | Promoted lesson 详情 | `docs/01-GOVERNANCE/lessons/L-YYYY-MM-DD-NNN-<slug>.md` | 记录已接受、可复用、需要后续治理合入的经验 |
14
14
 
15
- | SSoT | 管什么 | 位置 |
16
- |------|--------|------|
17
- | Feature SSoT | 实施排期 | `docs/09-PLANNING/` |
18
- | Regression SSoT | 回归控制 | `docs/05-TEST-QA/` |
19
- | **Lessons SSoT** | **经验沉淀** | **`docs/01-GOVERNANCE/`** |
20
-
21
- Lessons SSoT 管“规范是否应该演进”。本轮任务是否做过 Lessons 检查、是否创建了
22
- Lessons 条目,由 `docs/Harness-Ledger.md` 记录,避免把 SOP 合规状态塞进
23
- Lessons SSoT。
15
+ `docs/Harness-Ledger.md` 和 `docs/10-WALKTHROUGH/Closeout-SSoT.md` 只记录 closeout 结果:
16
+ `checked-candidate:<LC-ID>`、`queued-promotion:<LC-ID>`、`checked-created:<L-ID>` 或历史兼容的 `checked-none:<reason>`。
24
17
 
25
18
  ## 目录结构
26
19
 
27
- ```
20
+ ```text
28
21
  docs/01-GOVERNANCE/
29
- ├── Lessons-SSoT.md 沉淀建议表(SSoT)
30
- ├── lessons/ ← 具体沉淀内容存放
31
- │ ├── L-2026-05-07-001-xxx.md ← 单条沉淀建议的详细内容
22
+ ├── lessons/ promoted lesson 详情文档
23
+ ├── L-2026-05-07-001-xxx.md
32
24
  │ └── ...
33
- └── _archive/ ← 已处理的历史条目归档
34
- └── Lessons-SSoT-archive-YYYY-QN.md
25
+ └── _archive/ ← 已合入或废弃的历史详情归档
26
+
27
+ docs/09-PLANNING/TASKS/<task-id>/
28
+ ├── lesson_candidates.md ← 候选索引和人工路由状态
29
+ └── lessons/
30
+ └── LC-YYYYMMDD-NNN.md ← task-local detail artifact
35
31
  ```
36
32
 
37
33
  ## 触发时机
38
34
 
39
- 在 Walkthrough 收口流程中,写完 Walkthrough 并更新 Feature/Regression SSoT 之后,Agent 执行经验沉淀检查:
35
+ 在 Walkthrough 收口流程中,写完 Walkthrough 并更新 Feature / Regression / Closeout / Ledger 之后,Agent 执行经验沉淀检查:
40
36
 
41
37
  1. 这次开发中有没有发现现有 reference 不够用或有误的地方?
42
- 2. 有没有值得固化为规范的新模式/新做法?
38
+ 2. 有没有值得固化为规范的新模式或新做法?
43
39
  3. 有没有踩坑经验值得记录,避免下次重复?
44
40
  4. 有没有架构层面的洞察,值得更新架构文档?
45
41
 
46
- 如果任何一条答案是"有",先写入任务目录的 `lesson_candidates.md`,由人工 review 决定是否进入治理 promotion。
42
+ 如果任何一条答案是“有”,先写入任务目录的 `lesson_candidates.md`。当候选进入
43
+ `needs-promotion` 时,Agent 必须同步写出任务本地 `lessons/LC-*.md` 详情文件,并在
44
+ `Detail Artifact` 列链接它;后续沉淀任务读取这个详情文件,不从表格 brief 复写正文。
45
+
47
46
  人工决定后只允许以下任务级状态:
48
47
 
49
48
  - `no-candidate-accepted`:接受本轮没有可复用 lesson。
50
49
  - `needs-promotion`:至少一个候选已排队进入治理沉淀。
51
- - `promoted`:维护命令已经写入 Lessons SSoT 和详情文档。
50
+ - `promoted`:维护命令已经创建 promoted lesson 详情文档,并回写源 candidate。
52
51
  - `rejected`:候选已带理由拒绝。
53
52
 
54
- `needs-promotion` 不阻塞任务 closeout,但必须在 Closeout SSoT / Harness Ledger 中记录
55
- `queued-promotion: LC-YYYYMMDD-NNN`,并由后续维护命令处理。`promoted` 或人工直接创建时记录
56
- `checked-created: L-YYYY-MM-DD-NNN`。如果没有候选,记录 `checked-candidate: LC-...` 或
57
- `checked-none: <reason>`,其中 `checked-none` 只用于旧任务兼容或没有 candidate 文件的历史收口。
53
+ `needs-promotion` 不阻塞任务 closeout,但必须在 Closeout SSoT / Harness Ledger 中记录 `queued-promotion: LC-YYYYMMDD-NNN`,并由后续维护任务处理。模块级候选还必须填写 `Module Key`,避免沉淀任务丢失模块边界。`promoted` 或人工直接创建详情文档时记录 `checked-created: L-YYYY-MM-DD-NNN`。如果没有候选,记录 `checked-candidate: LC-...` 或 `checked-none: <reason>`;`checked-none` 只用于旧任务兼容或没有 candidate 文件的历史收口。
58
54
 
59
- promotion 执行“双写”:
55
+ ## Promotion 执行
60
56
 
61
- 1. 选择 `templates/lessons/` 下的对应模板,先创建详情文档。
62
- 2. 详情文档必须写清背景、现状问题、建议改动、影响范围和冲突声明。
63
- 3. 再在 Lessons SSoT 追加表行,`Detail Doc` 指向这篇详情文档。
64
- 4. 在 Closeout SSoT / Harness Ledger 中记录 `checked-created` 或 `queued-promotion`,并引用 lesson/candidate ID。
57
+ promotion 只写 promoted 详情文档和源 candidate,不写共享 Lessons 表:
65
58
 
66
- 如果四个问题的答案全是"没有",也不能静默跳过。新任务必须在 `lesson_candidates.md` 中使用
67
- `no-candidate-accepted` 并填写 No-Candidate Reason;旧任务可在 Closeout SSoT 和 Harness Ledger 中记录
68
- `checked-none: <一句话原因>`。
59
+ 1. 读取源任务 `lesson_candidates.md` 中的 `Detail Artifact` 指向的任务本地详情文件。
60
+ 2. 选择 `templates/lessons/` 下的对应模板,或由 `lesson-promote --apply` 创建 promoted 详情文档。
61
+ 3. promoted 详情文档写清背景、现状问题、建议改动、影响范围和冲突声明。
62
+ 4. 回写源任务 `lesson_candidates.md`:对应候选标记为 `promoted`,并记录 `promoted:<L-ID>`。
63
+ 5. 在 Closeout SSoT / Harness Ledger 中记录 `checked-created:<L-ID>` 或 `queued-promotion:<LC-ID>`。
64
+
65
+ `lesson-promote --apply` 是 CLI-owned 机械写入:目标仓库必须是干净 Git root,
66
+ 命令会加 governance lock,只允许提交新 lesson detail 和源任务 `lesson_candidates.md`。
67
+ 如果存在 unrelated dirty diff,命令必须拒绝,让 coordinator 先提交、归属或记录 no-commit reason。
68
+
69
+ 如果四个问题的答案全是“没有”,也不能静默跳过。新任务必须在 `lesson_candidates.md` 中使用 `no-candidate-accepted` 并填写 No-Candidate Reason;旧任务可在 Closeout SSoT 和 Harness Ledger 中记录 `checked-none: <一句话原因>`。
69
70
 
70
71
  ## Closeout 判定
71
72
 
72
73
  收口时只允许以下合格状态:
73
74
 
74
- - `checked-created: L-YYYY-MM-DD-NNN`:发现可沉淀经验,已创建详情文档并更新 Lessons SSoT。
75
+ - `checked-created: L-YYYY-MM-DD-NNN`:发现可沉淀经验,已创建 promoted lesson 详情文档。
75
76
  - `queued-promotion: LC-YYYYMMDD-NNN`:人工确认候选值得沉淀,但交给维护命令后续提升。
76
77
  - `checked-candidate: LC-YYYYMMDD-NNN`:人工已审查 candidate 文件,结论为无候选或全部拒绝。
77
78
  - `checked-none: <reason>`:旧任务兼容状态,已完整检查且没有 candidate 文件。
78
79
 
79
80
  以下状态不合格:
80
81
 
81
- - 只写 Lessons SSoT 表行,没有详情文档。
82
- - 只写详情文档,没有 Lessons SSoT 表行。
83
- - 在 walkthrough 或 progress 中说“无 lessons”,但 Closeout SSoT / Harness Ledger 没有记录。
82
+ - 只在 walkthrough 或 progress 中说“无 lessons”,但 Closeout SSoT / Harness Ledger 没有记录。
84
83
  - 新任务跳过 `lesson_candidates.md`,只用 `checked-none` 代替 candidate 判定。
85
84
  - 用 `n/a` 代替检查结果,除非任务是纯只读分析且没有 closed ledger row。
85
+ - `checked-created:<L-ID>` 指向的 `docs/01-GOVERNANCE/lessons/*.md` 不存在。
86
86
 
87
87
  ## 沉淀类型
88
88
 
89
89
  | Type | 说明 |
90
- |------|------|
90
+ | --- | --- |
91
91
  | `ref-change` | 修改现有 reference 文档 |
92
92
  | `new-doc` | 新增文档/规范 |
93
93
  | `arch-change` | 架构层面的改动建议 |
@@ -95,80 +95,75 @@ promotion 执行“双写”:
95
95
 
96
96
  ## 冲突处理规则
97
97
 
98
- ### 规则 1:写之前必须读 SSoT
98
+ ### 规则 1:写之前必须查重
99
+
100
+ Agent 在产出任何 promoted lesson 之前,必须查看:
101
+
102
+ - 任务本地 `lesson_candidates.md`
103
+ - 任务本地 `lessons/LC-*.md`
104
+ - `docs/01-GOVERNANCE/lessons/*.md`
105
+ - 目标 reference / template / checker
99
106
 
100
- Agent 在产出任何沉淀建议之前,**必须完整读一遍 Lessons SSoT**,了解:
101
- - 当前有哪些 pending 条目
102
- - 是否有人已经对同一个 target 提出了改动
103
- - 当前各条目的状态
107
+ 目的是确认是否已有同一 target、同一问题或冲突建议。
104
108
 
105
109
  ### 规则 2:副本始终基于正式版本
106
110
 
107
- 无论 SSoT 上有多少个 pending 的改动指向同一个 target,新的副本**始终基于当前正式 reference 的最新版本**,不基于任何未合入的 pending 副本。
111
+ 无论已有多少个待处理 lesson 指向同一个 target,新的副本始终基于当前正式 reference 的最新版本,不基于任何未合入的 pending 副本。
108
112
 
109
- **原因**:人可能选择不采纳之前的 pending 改动。如果基于别人未合入的副本去改,一旦那个被 reject,改动就建立在错误基础上。
113
+ 原因:人可能选择不采纳之前的 pending 改动。如果基于别人未合入的副本去改,一旦那个被 reject,改动就建立在错误基础上。
110
114
 
111
115
  ### 规则 3:以解决冲突的方式编写
112
116
 
113
- 如果发现有 pending 条目指向同一 target,Agent 必须:
114
- 1. 读取那个 pending 条目的内容(了解对方想改什么)
115
- 2. 在自己的副本中,以"解决冲突"的方式编写——即:假设对方的改动最终也会被采纳,自己的改动应该与之兼容
116
- 3. 在"冲突声明"中明确说明:我看到了 L-XXX 的改动,我的副本已考虑兼容
117
- 4. 但**不是在对方副本之上修改**,而是独立基于正式版本编写
117
+ 如果发现已有 lesson 指向同一 target,Agent 必须:
118
118
 
119
- ### 规则 4:人做最终聚合
119
+ 1. 读取那个 lesson 的内容,了解对方想改什么。
120
+ 2. 在自己的详情文档中,以解决冲突的方式编写。
121
+ 3. 在“冲突声明”中明确说明看到了哪个 lesson,自己的建议如何兼容或取代它。
122
+ 4. 独立基于正式版本编写,不直接修改对方详情文档。
120
123
 
121
- 当多个 pending 条目指向同一 target 时,人在审批时可以:
122
- - 逐个 approve,按顺序合入
123
- - 一次性看所有 pending 改动,做聚合后合入
124
- - reject 部分,approve 部分
125
- - 要求 Agent 基于审批结果重新生成一个合并版本
124
+ ### 规则 4:人做最终聚合
126
125
 
127
- ### 规则 5:SSoT 表标记冲突
126
+ 当多个 lesson 指向同一 target 时,人在审批时可以:
128
127
 
129
- 当新条目与已有 pending 条目指向同一 target 时,两个条目的 Conflict 列都要标记对方的 ID。人一眼就能看到"这两个要一起审"。
128
+ - 逐个 approve,按顺序合入。
129
+ - 一次性看所有 pending 改动,做聚合后合入。
130
+ - reject 部分,approve 部分。
131
+ - 要求 Agent 基于审批结果重新生成一个合并版本。
130
132
 
131
133
  ## 状态流转
132
134
 
133
- ```
134
- 🟡 pending → 🟢 approved → ✅ merged
135
- (人决定不合入) rejected
136
- 🔀 superseded (被后续条目取代)
135
+ ```text
136
+ lesson_candidates.md:
137
+ pending-review -> needs-promotion -> promoted
138
+ -> rejected
139
+ -> no-candidate-accepted
140
+
141
+ lesson detail docs:
142
+ pending governance integration -> approved -> merged
143
+ -> rejected
144
+ -> superseded
137
145
  ```
138
146
 
139
147
  ## 归档机制
140
148
 
141
- ### 触发条件
142
- - Active Lessons 表超过 **20 条**时,将所有 `✅ merged` 和 `❌ rejected` 的条目移入归档
143
- - 人也可以手动触发归档
144
-
145
- ### 归档格式
146
- ```
147
- docs/01-GOVERNANCE/_archive/Lessons-SSoT-archive-YYYY-QN.md
148
- ```
149
-
150
- ### 归档后
151
- - Active 表只保留 `🟡 pending` / `🟢 approved` / `🔀 superseded` 的条目
152
- - 归档文件保留完整历史,可追溯
149
+ `docs/01-GOVERNANCE/lessons/` 中已合入或废弃的详情文档过多时,可以把 `merged`、`rejected`、`superseded` 的文档移入 `docs/01-GOVERNANCE/_archive/`。不要归档仍被 Closeout SSoT 或 Harness Ledger 当前行引用的文档,除非同步更新引用。
153
150
 
154
151
  ## 人的审批工作流
155
152
 
156
- 1. 打开 `Lessons-SSoT.md`,看 Active 表里有没有 🟡 pending 的条目
157
- 2. Summary 列,大部分情况一句话就能判断
158
- 3. 需要细看就点进 Detail Doc 路径,看完整副本和改动理由
159
- 4. 有冲突的条目一起审(看 Conflict 列)
160
- 5. 批准后改状态为 🟢 approved
161
- 6. Agent 下次看到 approved 状态就执行合入,完成后改为 merged
153
+ 1. 打开 dashboard 的 Lessons 队列,或搜索任务本地 `lesson_candidates.md` 中的 `needs-promotion`。
154
+ 2. 查看候选行的 `Detail Artifact`,确认任务本地详情正文足够完整。
155
+ 3. 需要提升时创建后续 sedimentation task,或批准 `lesson-promote --apply`。
156
+ 4. 查看生成的 `docs/01-GOVERNANCE/lessons/*.md`。
157
+ 5. 有冲突的 lesson 一起审。
158
+ 6. 批准后由维护任务更新目标 reference / template / checker。
162
159
 
163
160
  ## 合入执行
164
161
 
165
- 当 Agent 发现 Lessons SSoT 中有 `🟢 approved` 状态的条目时:
166
- - `ref-change`:用 lessons/ 中的副本替换正式 reference
167
- - `new-doc`:将 lessons/ 中的内容移动到建议路径
168
- - `arch-change`:按建议更新架构文档
169
- - `process-change`:按建议更新流程文档
162
+ 当 Agent 获得明确的人审批准后:
170
163
 
171
- 合入完成后,状态改为 `✅ merged`。
164
+ - `ref-change`:按 lesson 详情更新正式 reference。
165
+ - `new-doc`:将 lesson 建议落到正式建议路径。
166
+ - `arch-change`:按建议更新架构文档。
167
+ - `process-change`:按建议更新流程文档或 CLI/checker。
172
168
 
173
- 合入任务收口时,还必须在 `docs/Harness-Ledger.md` 的当前任务 row 中记录
174
- `Lessons=updated` 或 `Lessons=checked-created`。
169
+ 合入任务收口时,必须在 `docs/Harness-Ledger.md` 的当前任务 row 中记录 `checked-created:<L-ID>`、`queued-promotion:<LC-ID>` 或 `checked-candidate:<LC-ID>`。
@@ -13,7 +13,7 @@
13
13
  - 各功能域的源文件几乎不重叠
14
14
  - 开发者计划多会话 / 多 worktree 并行推进
15
15
 
16
- 不满足时继续使用 Feature SSoT + 线性 Phase 模型。
16
+ 不满足时继续使用普通任务队列 + CLI 生成 Harness Ledger,不强行拆模块。
17
17
 
18
18
  ## 核心概念
19
19
 
@@ -241,23 +241,22 @@ HARNESS_REQUIRE_GLOBAL_MODULE_SYNC=1 node scripts/check-harness.mjs <repo-path>
241
241
  - 建议频率:每周一次,或每次基础设施 task 完成后
242
242
  - 目的:避免 divergence 过大导致 merge 困难
243
243
 
244
- ## Feature SSoT 的分工
244
+ ## 与生成 Ledger 的分工
245
245
 
246
246
  启用模块并行后:
247
247
 
248
248
  - **Module Registry + module_plan.md** 追踪模块内步骤进度
249
- - **Feature SSoT** 只追踪:
250
- - 不属于任何模块的独立功能
251
- - 发布级汇总(哪个 release 包含了哪些模块步骤)
249
+ - **Harness Ledger** 从任务本地事实生成全局生命周期索引
250
+ - **Delivery SSoT** 只在需要跨模块、跨仓或多人交付编排时追踪 release / block 依赖
252
251
 
253
- **禁止**:同一个工作项同时出现在 module_plan 和 Feature SSoT 中。
252
+ **禁止**:同一个工作项同时作为模块步骤和另一张手写任务生命周期表维护。
254
253
 
255
- 切换时必须收缩 Feature SSoT:
254
+ 切换时必须归档 legacy 生命周期表:
256
255
 
257
- - Feature SSoT Active 表只保留非模块、未完成、仍需操作的 feature。
258
- - Phase 历史和 completed 明细移到 `docs/09-PLANNING/_archive/<feature-ssot-name>-phase-<range>.md`。
259
- - Feature SSoT 主文件保留 freeze notice、当前 active 指针、completed summaryarchive index。
260
- - 不允许把历史大表留在 Feature SSoT 主文件底部作为"文件内归档";这会让 Active SSoT 继续膨胀。
256
+ - `Feature-SSoT.md` / `Private-Feature-SSoT.md` 移到 `docs/09-PLANNING/_archive/`。
257
+ - Phase 历史和 completed 明细作为历史证据保留,不再作为 active 表继续维护。
258
+ - 使用 `harness governance rebuild --archive --apply` task / module 文件重建 Harness Ledgermodule plan 和 visual map 索引。
259
+ - 不允许把历史大表留在 active 生命周期入口底部作为"文件内归档";这会让 Agent 继续读取旧状态。
261
260
 
262
261
  ## 归档与过期检测
263
262
 
@@ -277,16 +276,17 @@ HARNESS_REQUIRE_GLOBAL_MODULE_SYNC=1 node scripts/check-harness.mjs <repo-path>
277
276
 
278
277
  对已有线性 Phase 历史的项目:
279
278
 
280
- 1. 冻结 Feature SSoT 当前状态,标注"后续工作按模块推进"
281
- 2. 将 Feature SSoT 的历史 completed 明细移入 `docs/09-PLANNING/_archive/`,主文件只保留 active 指针、summary 和 archive index
279
+ 1. 冻结 legacy 生命周期表当前状态,标注"后续工作按模块推进"
280
+ 2. 将 `Feature-SSoT.md` / `Private-Feature-SSoT.md` 历史明细移入 `docs/09-PLANNING/_archive/`
282
281
  3. 将历史 `docs/09-PLANNING/TASKS/` 移入 `docs/09-PLANNING/_archive/`
283
282
  4. 将历史 walkthrough 移入 `docs/10-WALKTHROUGH/_archive/`
284
283
  5. 从最后一个 Phase 的未完成项中识别模块
285
284
  6. 创建 Module Registry 和各模块的 module_plan.md
286
285
  7. 创建 Module Session Prompt Pack 或每模块 `session_prompt.md`
287
286
  8. 定义切换日期,此后不再创建新 Phase
287
+ 9. 运行 `harness governance rebuild --archive --apply` 生成新的 Harness Ledger 和模块索引
288
288
 
289
289
  不做的事:
290
290
  - 不回溯重写历史 Ledger 条目
291
- - 不删除现有 Feature SSoT
291
+ - 不直接删除 legacy 生命周期表证据;先归档,是否清理归档由 owner 决定
292
292
  - 不强制已完成的 Phase 工作重新归类
@@ -55,7 +55,7 @@ slices/<slice-id>/review.md
55
55
  8. **复杂任务必须记录 `execution_strategy.md`** — 是否使用 subagent、reviewer、worktree、handoff 都写入独立文件。
56
56
  9. **非平凡任务必须记录 `visual_map.md`** — 这是任务图表集合,不只是 roadmap;HTML dashboard 从独立文件的 phase table 计算完成度、阻塞和证据状态。
57
57
  10. **路径必须带来源前缀** — 使用 `PUBLIC:`, `PRIVATE:`, `TARGET:`, `EXTERNAL:`, `URL:`,避免脆弱相对路径。
58
- 11. **已验证切片必须主动提交** — 每个有意义的工作切片通过对应检查后,agent 默认主动 commit;只有用户明确要求暂不提交、检查失败、或 dirty diff 归属未清时才延期,并把原因写入 progress / handoff。
58
+ 11. **已验证切片必须主动提交** — 每个有意义的工作切片通过对应检查后,agent 默认主动 commit;只有用户明确要求暂不提交、检查失败、或 dirty diff 归属未清时才延期,并把 no-commit reason、owner 和下一步写入 progress / handoff。
59
59
 
60
60
  ## task_plan.md 模板
61
61
 
@@ -76,10 +76,15 @@ slices/<slice-id>/review.md
76
76
  | --- | --- | --- | --- | --- |
77
77
 
78
78
  ## Execution & Visualization Files
79
- | Contract File | Required | Purpose |
80
- | --- | --- | --- |
81
- | `execution_strategy.md` | yes | Execution mode, subagent use, conflict control, evidence depth, handoff rules |
82
- | `visual_map.md` | yes | Mermaid maps, phase table, architecture/sequence/data-flow/state diagrams when useful, completion, evidence status, blocking risk |
79
+ Do not manually copy task templates. Create task folders through `harness new-task`
80
+ so the selected budget creates the correct files and `harness check` can enforce
81
+ the same contract.
82
+
83
+ | Budget | Required Files |
84
+ | --- | --- |
85
+ | simple | `brief.md`, `task_plan.md`, `visual_map.md`, `progress.md` |
86
+ | standard | simple files plus `execution_strategy.md`, `findings.md`, `lesson_candidates.md`, `review.md` |
87
+ | complex | standard files plus `references/INDEX.md`, `artifacts/INDEX.md` |
83
88
 
84
89
  ## 步骤
85
90
  1. [步骤1]
@@ -207,7 +212,7 @@ standard / complex:
207
212
  对 standard / complex 是硬门禁:当前状态不是 `review` 时必须拒绝。`simple`
208
213
  可以直接从 `in_progress` 完成。
209
214
 
210
- 每次状态变更时,必须同时更新 progress.md Feature SSoT。
215
+ 每次状态变更时,必须更新 task-local facts,例如 `progress.md`、`review.md` `lesson_candidates.md`。任务生命周期总表由 lifecycle CLI 或 `harness governance rebuild` 生成,不手工维护 Feature lifecycle 表。
211
216
 
212
217
  任务完成时,必须在 `docs/Harness-Ledger.md` 中记录本轮 task plan、SSoT、
213
218
  walkthrough、Lessons 检查等上下文回写结果。
@@ -216,6 +221,7 @@ walkthrough、Lessons 检查等上下文回写结果。
216
221
 
217
222
  非平凡任务不是等用户提醒才提交。每个已验证、有意义、范围清晰的切片都应形成 commit。
218
223
  提交前只 stage 本任务范围内文件;无关 dirty 文件、私有文件和生成产物必须保留原样或按项目规则处理。
224
+ 不能提交时必须写清 no-commit reason、owner 和下一步;归属不清的 dirty diff 不能被混入本任务提交。
219
225
 
220
226
  任务相关 commit 应在 message footer 中引用任务 ID:
221
227