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
@@ -0,0 +1,106 @@
1
+ # PR 提交标准
2
+
3
+ ## 职责
4
+
5
+ 每个非平凡 PR 都必须让 maintainer 在不阅读完整 agent 对话的情况下完成审查。PR body 是审查交接包:说明改了什么、为什么改、如何验证、影响哪个版本、还剩什么风险。
6
+
7
+ ## 必需结构
8
+
9
+ 如果仓库面向中英文用户,或本次任务讨论是中文,PR 必须中英双语。公开 GitHub 读者优先读英文,所以英文在前,简体中文在后。
10
+
11
+ PR body 必须包含:
12
+
13
+ 1. Summary / 摘要
14
+ 2. What Changed / 改动内容
15
+ 3. Version Impact / 版本影响
16
+ 4. Verification / 验证
17
+ 5. Review Evidence / 审查证据
18
+ 6. Residual Risk / 残余风险
19
+ 7. References / 关联材料
20
+
21
+ ## 内容规则
22
+
23
+ - 必须明确目标版本。如果 `package.json` 从 `1.0.2` 变为 `1.0.3`,就在版本影响里写清楚。
24
+ - 改动内容按用户可见面或模块总结,不要只堆文件路径。
25
+ - 验证必须列真实命令、浏览器检查、CI run 或证据产物。没有跑的检查必须说明原因。
26
+ - 审查证据必须说明自查、subagent 审查、人工审查或代码质量审查状态。release-blocking finding 必须在 merge 前关闭或路由。
27
+ - 残余风险必须区分已接受风险、延期 follow-up、无关本地或私有债务。
28
+ - 关联材料必须链接相关 task doc、SSoT 行、review 文件、commit、issue 或 PR。
29
+
30
+ ## 模板
31
+
32
+ ```markdown
33
+ ## Summary
34
+
35
+ [One or two sentences explaining the intent and outcome.]
36
+
37
+ ## What Changed
38
+
39
+ - [User-facing or module-level change.]
40
+ - [Governance, CLI, dashboard, docs, or template change.]
41
+
42
+ ## Version Impact
43
+
44
+ - Package version: `[old]` -> `[new]`
45
+ - Release notes: [CHANGELOG entry or reason no release note is needed]
46
+
47
+ ## Verification
48
+
49
+ - `[command]`: pass
50
+ - `[browser/runtime/CI evidence]`: pass
51
+ - Not run: [reason]
52
+
53
+ ## Review Evidence
54
+
55
+ - Self-review: [summary]
56
+ - Additional review: [reviewer/subagent/human result]
57
+ - Blocking findings: [none / closed / routed]
58
+
59
+ ## Residual Risk
60
+
61
+ - [none / accepted / deferred / unrelated debt]
62
+
63
+ ## References
64
+
65
+ - Task: [path or issue]
66
+ - Review: [path or PR review]
67
+ - Evidence: [path, commit, screenshot, workflow, or dashboard]
68
+
69
+ ---
70
+
71
+ ## 摘要
72
+
73
+ [用一两句话说明目标和结果。]
74
+
75
+ ## 改动内容
76
+
77
+ - [面向用户或模块级改动。]
78
+ - [治理、CLI、Dashboard、文档或模板改动。]
79
+
80
+ ## 版本影响
81
+
82
+ - 包版本:`[旧版本]` -> `[新版本]`
83
+ - 发布说明:[CHANGELOG 条目或无需发布说明的原因]
84
+
85
+ ## 验证
86
+
87
+ - `[命令]`:通过
88
+ - `[浏览器 / 运行时 / CI 证据]`:通过
89
+ - 未运行:[原因]
90
+
91
+ ## 审查证据
92
+
93
+ - 自查:[摘要]
94
+ - 额外审查:[reviewer / subagent / human 结果]
95
+ - 阻塞发现:[无 / 已关闭 / 已路由]
96
+
97
+ ## 残余风险
98
+
99
+ - [无 / 已接受 / 已延期 / 无关债务]
100
+
101
+ ## 关联材料
102
+
103
+ - 任务:[路径或 issue]
104
+ - 审查:[路径或 PR review]
105
+ - 证据:[路径、commit、截图、workflow 或 dashboard]
106
+ ```
@@ -33,7 +33,7 @@
33
33
  | --- | --- |
34
34
  | 是否必须 PR | yes / no / local-only |
35
35
  | PR 标题格式 | 通常与 commit 规范一致 |
36
- | PR 描述要求 | 改动、原因、验证、residual、关联 task / SSoT / review |
36
+ | PR 描述要求 | 遵守 `docs/11-REFERENCE/pull-request-standard.md`;写清改动、原因、版本影响、验证、residual、关联 task / SSoT / review |
37
37
  | 必需审查者 | reviewer、外部 agent、人类 owner 或代码 owner |
38
38
  | 必需审查类型 | self-review、subagent review、human review、security review |
39
39
  | merge method | merge commit、squash、rebase、fast-forward |
@@ -73,7 +73,7 @@
73
73
  | branch 命名 | 分支模式 |
74
74
  | owner 规则 | 谁创建、谁清理、谁集成 |
75
75
  | subagent worker 规则 | 每个可写 worker 使用独立 worktree / branch,并 handoff commit SHA |
76
- | 主动提交规则 | 已验证的、有意义的切片默认主动提交;暂不提交必须写明原因 |
76
+ | 主动提交规则 | 已验证的、有意义的切片默认主动提交;暂不提交必须写明 no-commit reason、owner 和下一步 |
77
77
  | merge 顺序 | coordinator 或 release owner 决定 |
78
78
  | 清理规则 | merge 后删除,保留需写原因 |
79
79
 
@@ -82,5 +82,6 @@
82
82
  - 非平凡任务的 PR 或 walkthrough 必须说明 required checks 的执行结果。
83
83
  - branch protection 未 verified 时,不能声称仓库已受保护;只能写 `designed`、`implemented` 或 `blocked-with-owner`。
84
84
  - worker 结果只能通过 commit / branch 集成,不能混入 coordinator 未提交改动。
85
- - coordinator 自己执行时也要主动提交已验证切片;未提交状态必须有 owner、原因和下一步。
85
+ - coordinator 自己执行时也要主动提交已验证切片;未提交状态必须有 no-commit reason、owner 和下一步。
86
+ - 不得把无关 dirty 改动混入任务提交;CLI-owned Harness 写入应优先用本地 Harness 命令,让加锁、allowlist 和自动提交保护共享治理文件。
86
87
  - repo governance 变化必须同步 CI/CD 标准、worktree 标准和 Harness Ledger。
@@ -28,14 +28,21 @@
28
28
 
29
29
  ## 可写执行者与只读审查者的区别
30
30
 
31
+ 任务开始时,先读取当前任务 `execution_strategy.md` 的 Subagent Authorization 和 Subagent Delegation Decision,并向用户说明当前授权状态和分工判断。用户不需要知道或主动要求 subagent;coordinator 必须从用户目标主动评估。
32
+
31
33
  审查路由默认把 subagent 当只读 reviewer。只要 subagent 被要求直接改代码、测试、产品文档或 harness 文档,它就不再是 reviewer,而是 worker。
34
+ Reviewer subagent 在单个任务内默认允许,可重复用于只读审查。
32
35
 
33
- Worker 必须走 `worktree-standard.md`:
36
+ Worker 必须走 `worktree-standard.md`,并先在 `execution_strategy.md` 记录一次用户授权:
34
37
 
35
38
  - coordinator 先分配独立 worktree / branch、任务目录和 write scope。
36
39
  - worker 在自己的 worktree 内实现、验证并提交。
37
40
  - worker handoff 写明 branch、commit SHA、checks、residual。
38
41
  - coordinator 负责 merge、冲突处理、最终 gates 和 integration evidence。
42
+ - 同一任务、同一范围、同一 worktree/branch 内可复用该授权;范围变化时重新请求授权。
43
+ - 如果 worker subagent 对任务有明显帮助但尚未授权,coordinator 必须用白话主动向用户申请一次授权;可以直接说 worker subagent,但不要等用户知道或提醒使用 subagent。
44
+ - 如果独立切片已经明显但精确文件路径还不清楚,先确认文件路径,然后在 implementation 前立刻申请独立执行助手授权。
45
+ - 一旦 `Would a worker subagent materially help?` 的决策是 `ask-user`,必须暂停 implementation,直到 `User Authorization Decision` 记录 `authorized`、`denied` 或 `not-needed`。
39
46
 
40
47
  禁止把多个 worker 的未提交改动混在 coordinator 当前 checkout,再由 coordinator 一次性提交。
41
48
 
@@ -69,8 +69,9 @@ Closeout SSoT 中:
69
69
  任一答案为“有”时:
70
70
 
71
71
  - 先在任务目录 `lesson_candidates.md` 写候选。
72
- - 人工审查后,如需沉淀,再由维护命令写 lesson 详情文档并追加 Lessons SSoT。
73
- - Lessons SSoT 的详情文档列必须指向该详情文档。
72
+ - 候选进入 `needs-promotion` 时,同步写任务本地 `lessons/LC-*.md` 详情文件,并在 `Detail Artifact` 链接。
73
+ - 人工审查后,如需沉淀,再由维护命令写 promoted lesson 详情文档。
74
+ - `checked-created:<L-ID>` 必须能追溯到该详情文档。
74
75
 
75
76
  三个答案都为“没有”时,Closeout SSoT 和 Harness Ledger 仍要记录:
76
77
 
@@ -39,4 +39,4 @@
39
39
  3. `证据` 必须列出实际检查、冒烟、review、运行时验证或发布证据。
40
40
  4. `残余路由` 必须写 `none`,或指向负责人、任务、Regression SSoT、Harness Ledger、issue 或接受风险记录。
41
41
  5. `Lessons 检查` 只能写 `checked-candidate: LC-...`、`queued-promotion: LC-...`、`checked-created: L-YYYY-MM-DD-NNN`,或旧任务兼容的 `checked-none: [原因]`。
42
- 6. `checked-created` 必须同时存在 Lessons SSoT 行和 lesson 详情文档;`queued-promotion` 必须能追溯到任务目录 `lesson_candidates.md`。
42
+ 6. `checked-created` 必须存在 promoted lesson 详情文档;`queued-promotion` 必须能追溯到任务目录 `lesson_candidates.md`。
@@ -1,92 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import fs from "node:fs";
4
- import os from "node:os";
5
- import path from "node:path";
6
- import { spawnSync } from "node:child_process";
7
-
8
- const repoRoot = path.resolve(path.dirname(new URL(import.meta.url).pathname), "..");
9
- const node = process.execPath;
10
- const cli = path.join(repoRoot, "scripts/harness.mjs");
11
- const tmpRoot = fs.mkdtempSync(path.join(os.tmpdir(), "harness-dashboard-smoke-"));
12
-
13
- function run(args) {
14
- const result = spawnSync(node, [cli, ...args], { cwd: repoRoot, encoding: "utf8" });
15
- if (result.status !== 0) {
16
- throw new Error(`${args.join(" ")} failed\nSTDOUT:\n${result.stdout}\nSTDERR:\n${result.stderr}`);
17
- }
18
- return result;
19
- }
20
-
21
- function assert(condition, message) {
22
- if (!condition) throw new Error(message);
23
- }
24
-
25
- function smokeTarget(target, name) {
26
- const outDir = path.join(tmpRoot, name);
27
- const outFile = path.join(tmpRoot, `${name}.html`);
28
- run(["dashboard", "--out-dir", outDir, target]);
29
- run(["dashboard", "--out", outFile, target]);
30
- for (const required of [
31
- "index.html",
32
- "assets/app.css",
33
- "assets/app.js",
34
- "assets/dashboard-data.js",
35
- "data/status.json",
36
- "data/tables.json",
37
- "data/documents.json",
38
- "data/graph.json",
39
- "data/adoption.json",
40
- ]) {
41
- assert(fs.existsSync(path.join(outDir, required)), `${name} missing ${required}`);
42
- }
43
- const index = fs.readFileSync(path.join(outDir, "index.html"), "utf8");
44
- assert(index.includes("dashboard-data.js"), `${name} index missing data bootstrap`);
45
- const payload = fs.readFileSync(path.join(outDir, "assets/dashboard-data.js"), "utf8");
46
- assert(payload.includes("__HARNESS_DASHBOARD__"), `${name} missing embedded bundle`);
47
- const singleFile = fs.readFileSync(outFile, "utf8");
48
- assert(singleFile.includes("window.__HARNESS_DASHBOARD__"), `${name} single-file dashboard missing inline bundle`);
49
- assert(singleFile.includes("<style>"), `${name} single-file dashboard missing inline CSS`);
50
- assert(!singleFile.includes("/Users/lizeyu"), `${name} single-file dashboard leaked local user path`);
51
- assert(!singleFile.includes("file://"), `${name} single-file dashboard leaked file URL`);
52
- const documents = fs.readFileSync(path.join(outDir, "data/documents.json"), "utf8");
53
- assert(!documents.includes(repoRoot), `${name} leaked repo absolute path`);
54
- for (const generated of ["data/status.json", "data/tables.json", "data/documents.json", "data/graph.json", "data/adoption.json", "assets/dashboard-data.js"]) {
55
- const content = fs.readFileSync(path.join(outDir, generated), "utf8");
56
- assert(!content.includes("/Users/lizeyu"), `${name} ${generated} leaked local user path`);
57
- assert(!content.includes("file://"), `${name} ${generated} leaked file URL`);
58
- }
59
- const docs = JSON.parse(fs.readFileSync(path.join(outDir, "data/documents.json"), "utf8"));
60
- const tables = JSON.parse(fs.readFileSync(path.join(outDir, "data/tables.json"), "utf8"));
61
- const status = JSON.parse(fs.readFileSync(path.join(outDir, "data/status.json"), "utf8"));
62
- assert(typeof status.summary?.fullCutoverEligible === "boolean", `${name} missing fullCutoverEligible`);
63
- assert(Number.isFinite(Number(status.summary?.legacyVisualOnlyCount)), `${name} missing legacyVisualOnlyCount`);
64
- assert(Number.isFinite(Number(status.summary?.unknownClassificationCount)), `${name} missing unknownClassificationCount`);
65
- assert(Number.isFinite(Number(status.summary?.weakBriefCount)), `${name} missing weakBriefCount`);
66
- assert(Number.isFinite(Number(status.summary?.missingCanonicalVisualMapCount)), `${name} missing missingCanonicalVisualMapCount`);
67
- assert(!JSON.stringify(docs.documents.map((doc) => doc.path)).includes("_task-template"), `${name} documents included task template paths`);
68
- assert(!JSON.stringify(tables.tables.map((table) => table.source)).includes("_task-template"), `${name} tables included task template sources`);
69
- return outDir;
70
- }
71
-
72
- smokeTarget("examples/minimal-project", "example");
73
-
74
- const mingjingDocs = "/Users/lizeyu/Projects/mingjing-app/docs";
75
- if (fs.existsSync(mingjingDocs)) {
76
- const mingjingRepo = path.dirname(mingjingDocs);
77
- const before = spawnSync("git", ["-C", mingjingRepo, "status", "--short", "--", "docs"], { encoding: "utf8" }).stdout;
78
- smokeTarget(mingjingDocs, "mingjing");
79
- const after = spawnSync("git", ["-C", mingjingRepo, "status", "--short", "--", "docs"], { encoding: "utf8" }).stdout;
80
- assert(before === after, "Mingjing docs changed during dashboard smoke");
81
- }
82
-
83
- const extraTargets = (process.env.HARNESS_DASHBOARD_SMOKE_TARGETS || "")
84
- .split(",")
85
- .map((target) => target.trim())
86
- .filter(Boolean);
87
- for (const [index, target] of extraTargets.entries()) {
88
- assert(fs.existsSync(target), `extra dashboard smoke target does not exist: ${target}`);
89
- smokeTarget(target, `extra-${index + 1}`);
90
- }
91
-
92
- console.log(`Dashboard smoke passed: ${tmpRoot}`);