coding-agent-harness 1.0.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 (139) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/LICENSE +21 -0
  3. package/README.md +141 -0
  4. package/SKILL.md +423 -0
  5. package/docs-release/README.md +30 -0
  6. package/docs-release/architecture/overview.md +52 -0
  7. package/docs-release/guides/agent-installation.md +139 -0
  8. package/examples/minimal-project/.harness-capabilities.json +8 -0
  9. package/examples/minimal-project/AGENTS.md +4 -0
  10. package/examples/minimal-project/CLAUDE.md +3 -0
  11. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/execution_strategy.md +10 -0
  12. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/progress.md +11 -0
  13. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/review.md +27 -0
  14. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/task_plan.md +14 -0
  15. package/examples/minimal-project/docs/09-PLANNING/TASKS/demo-task/visual_roadmap.md +11 -0
  16. package/examples/minimal-project/docs/Harness-Ledger.md +6 -0
  17. package/package.json +34 -0
  18. package/references/adversarial-review-standard.md +173 -0
  19. package/references/agents-md-pattern.md +140 -0
  20. package/references/cadence-ledger.md +55 -0
  21. package/references/ci-cd-standard.md +90 -0
  22. package/references/delivery-operating-model-standard.md +145 -0
  23. package/references/docs-directory-standard.md +125 -0
  24. package/references/harness-ledger.md +148 -0
  25. package/references/lessons-governance.md +157 -0
  26. package/references/long-running-task-standard.md +209 -0
  27. package/references/module-parallel-standard.md +292 -0
  28. package/references/planning-loop.md +192 -0
  29. package/references/project-onboarding-audit.md +167 -0
  30. package/references/regression-system.md +89 -0
  31. package/references/repo-governance-standard.md +131 -0
  32. package/references/review-routing-standard.md +103 -0
  33. package/references/ssot-governance.md +111 -0
  34. package/references/walkthrough-closeout.md +135 -0
  35. package/references/worktree-parallel.md +184 -0
  36. package/scripts/check-harness.mjs +728 -0
  37. package/scripts/harness.mjs +201 -0
  38. package/scripts/lib/dashboard-writer.mjs +95 -0
  39. package/scripts/lib/harness-core.mjs +1318 -0
  40. package/scripts/smoke-dashboard.mjs +70 -0
  41. package/scripts/test-harness.mjs +482 -0
  42. package/templates/AGENTS.md.template +82 -0
  43. package/templates/CLAUDE.md.template +12 -0
  44. package/templates/dashboard/assets/app.css +399 -0
  45. package/templates/dashboard/assets/app.js +435 -0
  46. package/templates/dashboard/assets/i18n.js +47 -0
  47. package/templates/dashboard/assets/markdown-reader.js +116 -0
  48. package/templates/dashboard/assets/mermaid-renderer.js +59 -0
  49. package/templates/dashboard/index.html +18 -0
  50. package/templates/ledger/Harness-Ledger.md +39 -0
  51. package/templates/lessons/lesson-arch-process-change.md +47 -0
  52. package/templates/lessons/lesson-new-doc.md +50 -0
  53. package/templates/lessons/lesson-ref-change.md +45 -0
  54. package/templates/planning/execution_strategy.md +40 -0
  55. package/templates/planning/findings.md +24 -0
  56. package/templates/planning/long-running-task-contract.md +69 -0
  57. package/templates/planning/module_plan.md +36 -0
  58. package/templates/planning/module_session_prompt.md +39 -0
  59. package/templates/planning/optional/artifacts/INDEX.md +12 -0
  60. package/templates/planning/optional/references/INDEX.md +13 -0
  61. package/templates/planning/optional/slices/_slice-template/brief.md +27 -0
  62. package/templates/planning/optional/slices/_slice-template/evidence.md +9 -0
  63. package/templates/planning/optional/slices/_slice-template/review.md +31 -0
  64. package/templates/planning/progress.md +33 -0
  65. package/templates/planning/review.md +48 -0
  66. package/templates/planning/task_plan.md +86 -0
  67. package/templates/planning/visual_roadmap.md +28 -0
  68. package/templates/reference/adversarial-review-standard.md +28 -0
  69. package/templates/reference/ci-cd-standard.md +28 -0
  70. package/templates/reference/delivery-operating-model-standard.md +28 -0
  71. package/templates/reference/docs-library-standard.md +28 -0
  72. package/templates/reference/engineering-standard.md +29 -0
  73. package/templates/reference/execution-workflow-standard.md +29 -0
  74. package/templates/reference/harness-ledger-standard.md +26 -0
  75. package/templates/reference/long-running-task-standard.md +28 -0
  76. package/templates/reference/regression-ssot-governance.md +28 -0
  77. package/templates/reference/repo-governance-standard.md +29 -0
  78. package/templates/reference/review-routing-standard.md +29 -0
  79. package/templates/reference/testing-standard.md +28 -0
  80. package/templates/reference/walkthrough-standard.md +28 -0
  81. package/templates/reference/worktree-standard.md +28 -0
  82. package/templates/regression/Cadence-Ledger.md +41 -0
  83. package/templates/ssot/Delivery-SSoT.md +43 -0
  84. package/templates/ssot/Feature-SSoT.md +43 -0
  85. package/templates/ssot/Lessons-SSoT.md +44 -0
  86. package/templates/ssot/Module-Registry.md +43 -0
  87. package/templates/ssot/Regression-SSoT.md +51 -0
  88. package/templates/verifier/verifier-output.md +43 -0
  89. package/templates/walkthrough/Closeout-SSoT.md +43 -0
  90. package/templates/walkthrough/walkthrough-template.md +63 -0
  91. package/templates-zh-CN/AGENTS.md.template +92 -0
  92. package/templates-zh-CN/CLAUDE.md.template +12 -0
  93. package/templates-zh-CN/dashboard/assets/app.css +399 -0
  94. package/templates-zh-CN/dashboard/assets/app.js +435 -0
  95. package/templates-zh-CN/dashboard/assets/i18n.js +47 -0
  96. package/templates-zh-CN/dashboard/assets/markdown-reader.js +116 -0
  97. package/templates-zh-CN/dashboard/assets/mermaid-renderer.js +59 -0
  98. package/templates-zh-CN/dashboard/index.html +18 -0
  99. package/templates-zh-CN/ledger/Harness-Ledger.md +50 -0
  100. package/templates-zh-CN/lessons/lesson-arch-process-change.md +47 -0
  101. package/templates-zh-CN/lessons/lesson-new-doc.md +49 -0
  102. package/templates-zh-CN/lessons/lesson-ref-change.md +59 -0
  103. package/templates-zh-CN/planning/execution_strategy.md +37 -0
  104. package/templates-zh-CN/planning/findings.md +24 -0
  105. package/templates-zh-CN/planning/long-running-task-contract.md +118 -0
  106. package/templates-zh-CN/planning/module_plan.md +43 -0
  107. package/templates-zh-CN/planning/module_session_prompt.md +70 -0
  108. package/templates-zh-CN/planning/optional/artifacts/INDEX.md +13 -0
  109. package/templates-zh-CN/planning/optional/references/INDEX.md +13 -0
  110. package/templates-zh-CN/planning/optional/slices/_slice-template/brief.md +35 -0
  111. package/templates-zh-CN/planning/optional/slices/_slice-template/evidence.md +12 -0
  112. package/templates-zh-CN/planning/optional/slices/_slice-template/review.md +37 -0
  113. package/templates-zh-CN/planning/progress.md +29 -0
  114. package/templates-zh-CN/planning/review.md +69 -0
  115. package/templates-zh-CN/planning/task_plan.md +116 -0
  116. package/templates-zh-CN/planning/visual_roadmap.md +24 -0
  117. package/templates-zh-CN/reference/adversarial-review-standard.md +89 -0
  118. package/templates-zh-CN/reference/ci-cd-standard.md +72 -0
  119. package/templates-zh-CN/reference/delivery-operating-model-standard.md +79 -0
  120. package/templates-zh-CN/reference/docs-library-standard.md +59 -0
  121. package/templates-zh-CN/reference/engineering-standard.md +80 -0
  122. package/templates-zh-CN/reference/execution-workflow-standard.md +81 -0
  123. package/templates-zh-CN/reference/harness-ledger-standard.md +91 -0
  124. package/templates-zh-CN/reference/long-running-task-standard.md +156 -0
  125. package/templates-zh-CN/reference/regression-ssot-governance.md +82 -0
  126. package/templates-zh-CN/reference/repo-governance-standard.md +84 -0
  127. package/templates-zh-CN/reference/review-routing-standard.md +82 -0
  128. package/templates-zh-CN/reference/testing-standard.md +72 -0
  129. package/templates-zh-CN/reference/walkthrough-standard.md +83 -0
  130. package/templates-zh-CN/reference/worktree-standard.md +116 -0
  131. package/templates-zh-CN/regression/Cadence-Ledger.md +48 -0
  132. package/templates-zh-CN/ssot/Delivery-SSoT.md +60 -0
  133. package/templates-zh-CN/ssot/Feature-SSoT.md +49 -0
  134. package/templates-zh-CN/ssot/Lessons-SSoT.md +49 -0
  135. package/templates-zh-CN/ssot/Module-Registry.md +48 -0
  136. package/templates-zh-CN/ssot/Regression-SSoT.md +51 -0
  137. package/templates-zh-CN/verifier/verifier-output.md +38 -0
  138. package/templates-zh-CN/walkthrough/Closeout-SSoT.md +42 -0
  139. package/templates-zh-CN/walkthrough/walkthrough-template.md +62 -0
@@ -0,0 +1,81 @@
1
+ # 执行工作流标准
2
+
3
+ ## 职责
4
+
5
+ 本标准规定非平凡任务从开始、执行到收口的固定路径。它把 task plan、Delivery SSoT、worktree、review、testing、Regression SSoT、walkthrough 和 Harness Ledger 串成一条可检查的交付链。
6
+
7
+ ## 开始任务前
8
+
9
+ 1. 读取 AGENTS.md 和与本任务相关的 reference 标准。
10
+ 2. 读取功能 SSoT 或 Delivery SSoT,确认任务状态、owner 和依赖。
11
+ 3. 读取 `task_plan.md`,确认目标、范围、证据、stop condition 和允许修改的路径。
12
+ 4. 读取 `delivery-operating-model-standard.md`,判断本轮是 solo、team、split-repo、program、waterfall 还是 kanban 交付形态。
13
+ 5. 多人、多 agent、多仓、共享文件或阶段交付任务必须更新 `docs/09-PLANNING/Delivery-SSoT.md`。
14
+ 6. 判断是否属于长程任务;如属于,按 `long-running-task-standard.md` 补齐合同。
15
+ 7. 判断是否需要对抗性审查;如需要,按 `adversarial-review-standard.md` 创建或更新 `review.md`。
16
+ 8. planned task 默认需要 closeout review;先读取 `review-routing-standard.md`。
17
+ 9. 触及 PR、branch protection、required checks、CI/CD 或 release 时,读取 `repo-governance-standard.md` 和 `ci-cd-standard.md`。
18
+ 10. 按运行模型确认是否需要 worktree、feature branch、contract branch 或 release branch。
19
+ 11. 如需调用可写 subagent worker,先分配独立 worktree / branch、任务目录、write scope 和必跑 checks。
20
+
21
+ ## 执行过程中
22
+
23
+ 1. 每完成一个阶段,更新 `progress.md`。
24
+ 2. 调查事实、约束和异常写入 `findings.md`,不要只留在聊天记录。
25
+ 3. 长程任务每轮执行 evidence loop 和 review loop。
26
+ 4. reviewer 或 subagent 审查结果写入任务目录的 `review.md`。
27
+ 5. 可写 worker 必须在自己的 worktree 内实现、验证、提交,并 handoff branch、commit SHA、checks、residual。
28
+ 6. 遇到共享文件冲突,由 coordinator 或人工决定串行顺序。
29
+ 7. 遇到目标失效、权限阻塞、高风险决策或 stop condition 不适用,立即暂停并记录。
30
+ 8. 有意义地提交中间成果;commit message 应说明变更类型和范围。
31
+
32
+ ## 完成任务后
33
+
34
+ 1. 按 `testing-standard.md` 和 Regression SSoT 运行对应检查。
35
+ 2. 确认 repo governance、CI/CD required checks 已执行、更新或 residualized。
36
+ 3. 更新功能 SSoT;多人、多仓、多模块任务同时更新 Delivery SSoT 或 Module Registry。
37
+ 4. 更新 Regression SSoT 和 Cadence Ledger(如适用)。
38
+ 5. 确认 `review.md` 没有 open P0/P1 finding;material P2 已修复或写为 `accepted-risk` 并路由。
39
+ 6. planned task 必须完成 closeout review,或写明 `skipped-with-reason`。
40
+ 7. 写 walkthrough,引用 task plan、review、证据、residual、Regression SSoT 和 commit。
41
+ 8. 执行 Lessons 检查:有可复用经验则写 lesson 详情并更新 Lessons SSoT;没有也记录 `checked-none: <reason>`。
42
+ 9. 最后更新 Harness Ledger,因为它记录本轮上下文维护的最终状态。
43
+ 10. 完成 commit / PR / release note,并确认本任务工作区没有未解释的遗留改动。
44
+ 11. 如使用 worker,coordinator 集成 worker commit 后运行最终 gates,并记录 integration evidence。
45
+ 12. 如使用 worktree,按 `worktree-standard.md` 清理或记录保留原因。
46
+
47
+ ## 提交规范
48
+
49
+ 推荐格式:
50
+
51
+ ```text
52
+ <type>(<scope>): <description>
53
+ ```
54
+
55
+ 常用类型:
56
+
57
+ - `feat`:新功能。
58
+ - `fix`:缺陷修复。
59
+ - `refactor`:重构。
60
+ - `test`:测试相关。
61
+ - `docs`:文档。
62
+ - `chore`:构建、工具、配置或维护。
63
+
64
+ ## PR 与合并规范
65
+
66
+ PR 描述必须包含:
67
+
68
+ - 改了什么,为什么改。
69
+ - 关联 task plan、SSoT、review 或 issue。
70
+ - 实际运行的检查和证据。
71
+ - residual、owner 和不阻塞理由。
72
+ - required checks、reviewer、merge method 是否满足 `repo-governance-standard.md`。
73
+
74
+ ## 禁止事项
75
+
76
+ - 非平凡任务跳过 task plan 直接实现。
77
+ - 把 task plan、progress、review 等过程文件放在项目根目录。
78
+ - 需要对抗性审查时只在聊天里讨论,不写 `review.md`。
79
+ - 让多个可写 worker 在 coordinator 当前 checkout 混合未提交改动。
80
+ - 把 `designed` 或 `implemented` 的 CI/CD、branch protection 说成 `verified`。
81
+ - merge 后不跑回归、不写 walkthrough、不更新 Harness Ledger。
@@ -0,0 +1,91 @@
1
+ # 工程总账标准
2
+
3
+ ## 职责
4
+
5
+ Harness Ledger 是 `docs/` 骨架的全局上下文维护总账,固定位置为:
6
+
7
+ ```text
8
+ docs/Harness-Ledger.md
9
+ ```
10
+
11
+ 它记录每个非平凡任务是否完成了 task plan、progress、review、功能 SSoT、Delivery SSoT、Regression SSoT、Lessons SSoT、walkthrough、Closeout SSoT、reference/template 和 CI/CD 治理回写。它不复制业务事实,只记录上下文维护是否合规。
12
+
13
+ ## 必须更新的场景
14
+
15
+ - 完成一个非平凡 task、wave、feature 或 release。
16
+ - bootstrap、同步或升级 coding-agent-harness。
17
+ - 新增或修改 AGENTS.md、CLAUDE.md、reference、template、checker 或 dashboard。
18
+ - coordinator pass 汇总模块任务、worker handoff、review、closeout 或 regression 结果。
19
+ - 创建或更新 required review。
20
+ - 修改功能 SSoT、Delivery SSoT、Regression SSoT、Lessons SSoT、Closeout SSoT 任一文件。
21
+ - 创建 walkthrough 或接受受控跳过。
22
+ - Lessons approved 后合入正式 reference。
23
+
24
+ ## 通常不需要更新的场景
25
+
26
+ - 单个错别字或排版小修。
27
+ - 单次 `progress.md` 过程性追加。
28
+ - 普通测试输出粘贴,且不改变 gate 状态。
29
+ - 只读分析,没有产生 repo 内上下文变化。
30
+ - routine regression batch 只更新“上次验证”,且没有 residual 或 evidence depth 变化。
31
+
32
+ ## 写入规则
33
+
34
+ 1. 每行对应一个任务级或治理级上下文维护事件。
35
+ 2. 不复制 Feature、Regression、Lessons 的业务细节;只链接源文件。
36
+ 3. 不记录逐行 diff;逐行变化由 git history 负责。
37
+ 4. 状态值使用固定词,避免自由文本失控。
38
+ 5. 任务收口时最后更新 Harness Ledger。
39
+ 6. `closed` 行必须有 Lessons 检查结果。
40
+ 7. `checked-created` 必须引用 lesson ID 和详情文档。
41
+ 8. 如果 closeout、review 或 regression 被跳过,必须写 `skipped-with-reason`。
42
+
43
+ ## 固定状态词
44
+
45
+ - `required`
46
+ - `updated`
47
+ - `created`
48
+ - `checked-none`
49
+ - `checked-created`
50
+ - `n/a`
51
+ - `skipped-with-reason`
52
+ - `missing`
53
+ - `pending-coordinator-pass`
54
+
55
+ ## 收口检查
56
+
57
+ 任务完成前确认:
58
+
59
+ - [ ] `task_plan.md`、`progress.md` 已更新到当前事实。
60
+ - [ ] 启用模块并行时,worker 已更新 `module_plan.md` 并完成 handoff。
61
+ - [ ] coordinator pass 已同步 `Module-Registry.md`、Delivery SSoT 和 Harness Ledger,或记录 `pending-coordinator-pass`。
62
+ - [ ] `review.md` 已创建/更新,或标记 `n/a` / `skipped-with-reason`。
63
+ - [ ] closeout reviewer 已执行,或跳过原因受控。
64
+ - [ ] repo governance、CI/CD required checks 已验证、更新或 residualized。
65
+ - [ ] 功能 SSoT 或 Delivery SSoT 已更新,或标记 `n/a`。
66
+ - [ ] Regression SSoT / Cadence Ledger 已更新,或标记 `n/a`。
67
+ - [ ] walkthrough 已创建,或 Closeout SSoT 写明受控跳过原因。
68
+ - [ ] walkthrough 包含 Lessons 反思。
69
+ - [ ] Lessons 检查结果为 `checked-none: <reason>` 或 `checked-created: L-YYYY-MM-DD-NNN`。
70
+ - [ ] Harness Ledger 行已收口,或 residual 已写明 owner 和后续路径。
71
+
72
+ ## 框架更新检查清单
73
+
74
+ 更新已有 harness 时确认:
75
+
76
+ - [ ] 已读取最新版 coding-agent-harness Skill、reference、template 和 checker。
77
+ - [ ] 已列出 delta plan。
78
+ - [ ] 只补齐新增标准和缺失结构,没有覆盖历史 walkthrough、task progress、SSoT 事实。
79
+ - [ ] 新增 reference / template 已写入入口索引。
80
+ - [ ] checker 或 dashboard 的新增要求已有验证。
81
+ - [ ] Harness Ledger 记录本次 delta merge、证据和 residual。
82
+
83
+ ## 归档
84
+
85
+ 活跃表保留最近 50 条。更早的 `closed` 或 `superseded` 条目按季度归档:
86
+
87
+ ```text
88
+ docs/01-GOVERNANCE/_archive/Harness-Ledger-archive-YYYY-QN.md
89
+ ```
90
+
91
+ 归档后,活跃表必须留下归档位置说明。
@@ -0,0 +1,156 @@
1
+ # 长程任务标准
2
+
3
+ ## 目的
4
+
5
+ 本标准定义长程自主执行任务的任务合同、review loop、证据要求、暂停条件和停止条件。它回答的是:什么样的任务定义,才能支持 agent 在较少人工干预下连续推进,同时不丢失边界、证据和收口判断。
6
+
7
+ 本标准负责“任务怎么设计”;`execution-workflow-standard.md` 负责“任务开始后怎么跑”。
8
+
9
+ ## 适用场景
10
+
11
+ 使用本标准:
12
+
13
+ - 多轮复杂修复、重构、迁移、交付收口。
14
+ - 预计持续 2 小时以上。
15
+ - 需要 reviewer agent、subagent、外部 agent 或人工审查。
16
+ - 需要多轮 evidence loop 或 live smoke。
17
+ - 用户授权 agent 连续执行,直到满足 stop condition 再汇报。
18
+
19
+ 通常不需要:
20
+
21
+ - 单文件小修。
22
+ - 一次性命令。
23
+ - 纯只读分析。
24
+ - 没有客观验收口径的轻量讨论。
25
+
26
+ ## 任务合同字段
27
+
28
+ ### 目标
29
+
30
+ - 只定义本轮要收掉的主问题。
31
+ - 避免“整体优化”“尽量改好”“看情况处理”这类不可验收目标。
32
+
33
+ ### 范围
34
+
35
+ - 写明允许修改的目录、模块、接口、文档和配置。
36
+ - 写明 out of scope。
37
+ - 标出共享文件、跨仓契约和冲突风险。
38
+ - 当前工作树有他人改动时,必须说明如何避开或协同。
39
+
40
+ ### 主要调用者和入口
41
+
42
+ 明确本轮覆盖哪些 primary caller / entry:
43
+
44
+ - CLI / local agent
45
+ - UI / human user
46
+ - API / service
47
+ - automation / scheduler
48
+ - integration / adapter
49
+ - CI/CD / release workflow
50
+
51
+ ### 执行权限
52
+
53
+ 写清:
54
+
55
+ - 是否允许连续执行,不用每轮确认。
56
+ - 是否允许自动进入下一轮 review / fix / test。
57
+ - 是否允许启动 reviewer、subagent 或外部 agent。
58
+ - 哪些动作必须暂停等人确认,例如生产数据、权限、安全、费用、发布。
59
+
60
+ ### 审查循环
61
+
62
+ 每轮闭环至少包含:
63
+
64
+ 1. 实现当前切片。
65
+ 2. 本地运行或启动对应目标。
66
+ 3. 执行测试、冒烟检查或人工检查。
67
+ 4. 用 `Confidence Challenge` 做自审。
68
+ 5. 触发 reviewer / subagent review(如适用,并更新 `review.md`)。
69
+ 6. 修复重要发现。
70
+ 7. 重新收集证据。
71
+ 8. 重跑 `Confidence Challenge`,直到没有 open 重要发现。
72
+
73
+ 如使用 reviewer 或 subagent,必须写清:
74
+
75
+ - 只读审查还是可改代码。
76
+ - 负责的文件、模块或问题域。
77
+ - 输出格式和落点。
78
+ - no-finding 的判断口径。
79
+ - 是否必须回答 100% 信心挑战。
80
+
81
+ 可写 subagent worker 必须走 worker 合同:
82
+
83
+ - 独立 worktree / branch。
84
+ - 明确 task directory 和 write scope。
85
+ - 自己运行 required checks。
86
+ - 提交自己的改动。
87
+ - handoff 包含 branch、commit SHA、checks、residual。
88
+ - coordinator 合并 worker commit 后运行最终 gates。
89
+
90
+ ### 证据
91
+
92
+ 列出本轮要求的证据:
93
+
94
+ - lint / typecheck / build
95
+ - unit / integration / e2e tests
96
+ - 本地冒烟
97
+ - 浏览器或 UI 检查
98
+ - 线上环境冒烟
99
+ - 日志、截图、trace
100
+ - 审查者发现
101
+ - `review.md` 中的重要发现状态与残余路由
102
+ - PR 检查或 workflow 运行记录
103
+ - walkthrough 和 Harness Ledger 更新
104
+
105
+ ### 停止条件
106
+
107
+ stop condition 必须可判断:
108
+
109
+ - 关键路径通过。
110
+ - 目标 tests / regression gates 通过。
111
+ - runtime、console、request errors 清零,或有明确 residual。
112
+ - reviewer 无 open material findings。
113
+ - `review.md` 已完成,且无 open P0/P1 finding。
114
+ - residual 已记录 owner、后续路径和不阻塞理由。
115
+
116
+ ### 交付物
117
+
118
+ - code
119
+ - tests / regression evidence
120
+ - docs updates
121
+ - `progress.md` / `findings.md`
122
+ - `review.md`(如适用)
123
+ - worker branch / commit SHA / integration evidence(如使用 worker)
124
+ - walkthrough
125
+ - Harness Ledger
126
+ - PR / commit / release note
127
+ - residual summary
128
+
129
+ ## 暂停条件
130
+
131
+ 即使已授权连续执行,出现以下情况也必须暂停并汇报:
132
+
133
+ - 目标、范围或 stop condition 失效。
134
+ - 需要高风险产品、架构、安全、数据或发布决策。
135
+ - 与未知未提交改动冲突。
136
+ - 权限、配额、外部依赖、环境阻塞。
137
+ - reviewer finding 改变了任务方向。
138
+ - required evidence 无法获得,且没有可接受替代证据。
139
+
140
+ ## 反模式
141
+
142
+ - “你先看看,能改多少改多少。”
143
+ - “整体优化一下。”
144
+ - “差不多就行。”
145
+ - “不用测。”
146
+ - “你自己把握什么时候完成。”
147
+
148
+ 长程任务的原则是:开放执行,封闭验收;多轮证据,不靠感觉。
149
+
150
+ ## 项目落地要求
151
+
152
+ - 开始任务前必须判断是否属于长程任务。
153
+ - 任务模板应包含 long-running task contract 和 `review.md` 模板。
154
+ - reviewer 报告按 `adversarial-review-standard.md` 写。
155
+ - 回归和测试标准必须提供可复查证据。
156
+ - Harness Ledger 必须记录长程任务是否完成必要上下文回写。
@@ -0,0 +1,82 @@
1
+ # 回归单一事实源治理标准
2
+
3
+ ## 职责
4
+
5
+ Regression SSoT 是项目回归控制塔,管理所有 regression surface 的 gate、证据深度、最后验证时间、失败状态和 residual。它管正确性,不管功能排期;功能进度由功能 SSoT 或 Delivery SSoT 管。
6
+
7
+ 默认位置:
8
+
9
+ ```text
10
+ docs/05-TEST-QA/Regression-SSoT.md
11
+ ```
12
+
13
+ ## 维护时机
14
+
15
+ 必须更新 Regression SSoT:
16
+
17
+ - 新增、修改或废弃 regression gate。
18
+ - gate 的 evidence depth 提升或降低。
19
+ - gate 状态变化,例如 pass、fail、blocked、paused。
20
+ - 新增、解决或接受 residual。
21
+ - shared regression batch 执行后产生状态、证据或 residual 变化。
22
+ - release、重大 merge、架构改动、关键 UI/API surface 改动后。
23
+
24
+ 如果 routine batch 只更新“上次验证”,且没有 residual 或 evidence depth 变化,不强制写 Harness Ledger;但 Regression SSoT 本身仍应保持当前。
25
+
26
+ ## 负责人
27
+
28
+ - 执行回归的 agent 更新 gate 状态和 last verified。
29
+ - 发现 residual 的 agent 添加 residual item。
30
+ - 修复 residual 的 agent 标记解决,并链接证据。
31
+ - coordinator 负责 shared batch 的完整性和最终汇总。
32
+
33
+ ## 回归门禁字段
34
+
35
+ | 字段 | 说明 |
36
+ | --- | --- |
37
+ | Gate ID | 唯一 ID,例如 `RG-001`。 |
38
+ | Surface | 被保护的功能面、接口、页面、流程或平台。 |
39
+ | Primary entrypoint | 主要入口,例如 URL、命令、API、job、用户路径。 |
40
+ | Evidence depth | 证据层级,例如 unit、integration、local_smoke、browser、live。 |
41
+ | Current status | 当前状态,例如 pass、fail、blocked、paused。 |
42
+ | Last verified | 最近一次有效验证日期。 |
43
+ | Required trigger | 哪些改动会触发此 gate。 |
44
+ | Evidence | 命令、日志、截图、trace、CI run 或 walkthrough 链接。 |
45
+ | Residual | 未解决风险、owner 和后续路径。 |
46
+
47
+ ## 新增回归门禁
48
+
49
+ 1. 在活跃 gate 表中添加新行。
50
+ 2. 分配递增 ID。
51
+ 3. 写明 surface、primary entrypoint、initial evidence depth 和 trigger。
52
+ 4. 同步更新 Cadence Ledger 的触发规则。
53
+ 5. 在当前任务的 walkthrough 和 Harness Ledger 记录 `Regression=updated`。
54
+
55
+ ## 提升证据深度
56
+
57
+ 1. 实现更高层级的测试或检查,例如从本地冒烟提升到浏览器检查或线上验证。
58
+ 2. 验证通过后更新 evidence depth。
59
+ 3. 在 walkthrough 中说明为什么证据深度提升。
60
+ 4. 如果替代旧检查,说明旧检查是否保留、降级或废弃。
61
+
62
+ ## 废弃回归门禁
63
+
64
+ 1. 将 gate 移入 `docs/05-TEST-QA/_archive/Regression-SSoT-archive-YYYY-QN.md`。
65
+ 2. 写明废弃原因、替代 gate 和最后状态。
66
+ 3. 同步更新 Cadence Ledger。
67
+ 4. 在 walkthrough 和 Harness Ledger 记录本次治理变化。
68
+
69
+ ## 共享批次执行规范
70
+
71
+ - 每轮 shared batch 必须覆盖所有 active gate,除非明确写明跳过原因。
72
+ - 执行结果记录到 Cadence Ledger 的批次日志。
73
+ - 失败 gate 必须创建 residual。
74
+ - 下一轮 batch 的 checkpoint 条件必须明确。
75
+ - batch 不能只写“已跑”,必须有 evidence。
76
+
77
+ ## 与其他文件的关系
78
+
79
+ - 功能 SSoT 管进度,Regression SSoT 管正确性。
80
+ - Cadence Ledger 管什么时候跑,Regression SSoT 管 gate 当前事实。
81
+ - walkthrough 记录本轮验证结论,Regression SSoT 保留当前回归控制面。
82
+ - Harness Ledger 记录本轮是否完成回归上下文回写。
@@ -0,0 +1,84 @@
1
+ # 仓库治理标准
2
+
3
+ ## 职责
4
+
5
+ 本标准定义仓库平台、分支模型、PR 策略、required checks、branch protection、worktree 并发和 merge 规则。它用于避免 agent 在没有仓库治理边界的情况下直接提交、跳过审查或把未验证状态当成已验证。
6
+
7
+ ## 仓库画像
8
+
9
+ | 项 | 项目约定 |
10
+ | --- | --- |
11
+ | 平台 | GitHub / GitLab / local-only / 其他 |
12
+ | Remote | `owner/repo` 或 URL |
13
+ | 默认分支 | `main` / `master` / 其他 |
14
+ | 仓库类型 | single app / monorepo / multi-repo / library / service |
15
+ | agent 是否有管理权限 | yes / no / unknown |
16
+ | 受保护分支 | 默认分支、release branch 或其他 |
17
+
18
+ ## 分支模型
19
+
20
+ | 分支类型 | 命名规则 | 用途 | merge 规则 |
21
+ | --- | --- | --- | --- |
22
+ | feature branch | 例如 `feat/<name>` 或 `codex/<name>` | 常规功能和修复 | PR 或项目约定流程 |
23
+ | fix branch | 例如 `fix/<name>` | 缺陷修复 | 跑 required checks 后合入 |
24
+ | release branch | 例如 `release/<version>` | 发布稳定线 | release owner 管理 |
25
+ | hotfix branch | 例如 `hotfix/<name>` | 生产紧急修复 | 必须记录验证和回滚路径 |
26
+ | worker branch | coordinator 指定 | subagent worker 独立交付 | 通过 commit / branch handoff 集成 |
27
+
28
+ 直接推送策略必须写清:哪些分支禁止 direct push,哪些例外需要 owner 批准。
29
+
30
+ ## PR 策略
31
+
32
+ | 项 | 项目约定 |
33
+ | --- | --- |
34
+ | 是否必须 PR | yes / no / local-only |
35
+ | PR 标题格式 | 通常与 commit 规范一致 |
36
+ | PR 描述要求 | 改动、原因、验证、residual、关联 task / SSoT / review |
37
+ | 必需审查者 | reviewer、外部 agent、人类 owner 或代码 owner |
38
+ | 必需审查类型 | self-review、subagent review、human review、security review |
39
+ | merge method | merge commit、squash、rebase、fast-forward |
40
+ | merge order owner | coordinator、maintainer、release owner |
41
+
42
+ ## 必需检查
43
+
44
+ | 检查 | 命令或 workflow | 是否必需 | 证据 | residual 规则 |
45
+ | --- | --- | --- | --- | --- |
46
+ | lint | 项目命令或 CI job | yes/no | 日志或 workflow run | 失败需修复或 owner 接受 |
47
+ | typecheck | 项目命令或 CI job | yes/no | 日志或 workflow run | 不适用需说明 |
48
+ | build | 项目命令或 CI job | yes/no | 日志或 workflow run | 发布前必须明确 |
49
+ | test | 项目命令或 CI job | yes/no | 测试结果 | flaky 需记录 |
50
+ | smoke | 本地、browser 或 live smoke | yes/no | 截图、日志、trace | residual 路由到 Regression SSoT |
51
+
52
+ ## 分支保护
53
+
54
+ | 项 | 项目约定 |
55
+ | --- | --- |
56
+ | 状态 | `designed` / `implemented` / `verified` / `blocked-with-owner` |
57
+ | 必需状态检查 | required status checks 列表 |
58
+ | 必需 PR 审查数量 | 数量和角色 |
59
+ | Dismiss stale reviews | yes / no |
60
+ | Require branches up to date | yes / no |
61
+ | Block force push | yes / no |
62
+ | Block deletion | yes / no |
63
+ | Bypass actors | 明确角色,不写个人密钥 |
64
+ | 验证命令 | `gh`、平台 UI 证据或 API 查询 |
65
+ | Manual setup residual | 不能自动配置时的 owner 和原因 |
66
+
67
+ ## 工作树并发治理
68
+
69
+ | 项 | 项目约定 |
70
+ | --- | --- |
71
+ | 最大活跃 worktree 数 | 项目上限 |
72
+ | worktree 命名 | 目录模式 |
73
+ | branch 命名 | 分支模式 |
74
+ | owner 规则 | 谁创建、谁清理、谁集成 |
75
+ | subagent worker 规则 | 每个可写 worker 使用独立 worktree / branch,并 handoff commit SHA |
76
+ | merge 顺序 | coordinator 或 release owner 决定 |
77
+ | 清理规则 | merge 后删除,保留需写原因 |
78
+
79
+ ## 收口要求
80
+
81
+ - 非平凡任务的 PR 或 walkthrough 必须说明 required checks 的执行结果。
82
+ - branch protection 未 verified 时,不能声称仓库已受保护;只能写 `designed`、`implemented` 或 `blocked-with-owner`。
83
+ - worker 结果只能通过 commit / branch 集成,不能混入 coordinator 未提交改动。
84
+ - repo governance 变化必须同步 CI/CD 标准、worktree 标准和 Harness Ledger。
@@ -0,0 +1,82 @@
1
+ # 审查路由标准
2
+
3
+ ## 职责
4
+
5
+ 本标准定义 planned task、wave、feature 或 release 在收口前如何触发 self-review、subagent review、外部 agent review 或人工审查。`adversarial-review-standard.md` 规定 `review.md` 怎么写;本文件规定谁来写、什么时候必须写、什么时候可以跳过。
6
+
7
+ ## 默认规则
8
+
9
+ 每个 planned task / wave / feature 收口前默认执行 closeout review:
10
+
11
+ 1. 主 agent 完成 self-review。
12
+ 2. 主 agent 调用 reviewer 或只读 subagent 做外部视角审查。
13
+ 3. reviewer 按 `adversarial-review-standard.md` 写入或补全 `review.md`。
14
+ 4. 主 agent 修复或路由 material findings。
15
+ 5. 重跑对应证据。
16
+ 6. 再次执行 `Confidence Challenge`,直到没有 open material findings。
17
+
18
+ 当前环境无法调用 subagent 时,必须在 `review.md`、`progress.md` 或 walkthrough 写 `skipped-with-reason`,说明替代审查方式。
19
+
20
+ ## 审查者层级
21
+
22
+ | 层级 | 审查者 | 适用场景 | 要求 |
23
+ | --- | --- | --- | --- |
24
+ | L0 | Self-review | 微小变更、只读分析、小文档修正 | 记录在 `progress.md` 或 `review.md`。 |
25
+ | L1 | Subagent reviewer | 默认非平凡任务 | 必须写 `review.md`。 |
26
+ | L2 | External agent reviewer | 用户或项目要求,例如 Claude Code、Gemini、Codex 另一实例 | 必须写 `review.md`,并记录 `Reviewer Identity`。 |
27
+ | L3 | Human reviewer | 高风险产品、架构、安全、数据、发布判断 | agent 完成内部审查后,明确请求人工判断。 |
28
+
29
+ ## 可写执行者与只读审查者的区别
30
+
31
+ 审查路由默认把 subagent 当只读 reviewer。只要 subagent 被要求直接改代码、测试、产品文档或 harness 文档,它就不再是 reviewer,而是 worker。
32
+
33
+ Worker 必须走 `worktree-standard.md`:
34
+
35
+ - coordinator 先分配独立 worktree / branch、任务目录和 write scope。
36
+ - worker 在自己的 worktree 内实现、验证并提交。
37
+ - worker handoff 写明 branch、commit SHA、checks、residual。
38
+ - coordinator 负责 merge、冲突处理、最终 gates 和 integration evidence。
39
+
40
+ 禁止把多个 worker 的未提交改动混在 coordinator 当前 checkout,再由 coordinator 一次性提交。
41
+
42
+ ## 项目级外部审查策略
43
+
44
+ 如果项目长期使用 Claude Code、Gemini、Codex 另一实例或人工 reviewer,必须在本文件记录:
45
+
46
+ - 默认 reviewer。
47
+ - 触发条件。
48
+ - reviewer 是否只读。
49
+ - reviewer 输出写入位置。
50
+ - 主 agent 如何处理分歧。
51
+ - 哪些 finding 必须暂停并询问用户。
52
+ - 哪些检查必须由 reviewer 亲自看过,不能只听主 agent 摘要。
53
+
54
+ ## 校准流程
55
+
56
+ 引入新外部 reviewer 时,先做一次 calibration:
57
+
58
+ 1. 主 agent 写出任务目标、scope、证据、当前策略和 residual。
59
+ 2. 外部 reviewer 用 `Confidence Challenge` 挑战策略。
60
+ 3. 双方对 severity、accepted-risk、stop condition 和 required checks 口径达成一致。
61
+ 4. 将共识写入项目级 `review-routing-standard.md`。
62
+
63
+ ## 可跳过审查的条件
64
+
65
+ 只有以下情况可以跳过 L1 以上审查:
66
+
67
+ - 纯只读分析,没有修改仓库。
68
+ - 明确的小 typo 或格式修正。
69
+ - 用户明确要求不做外部审查。
70
+ - 当前环境确实没有可用 reviewer,且已记录替代 self-review 和 residual。
71
+
72
+ 跳过必须写 `skipped-with-reason`,不能留空。
73
+
74
+ ## 收口检查
75
+
76
+ - [ ] `review.md` 存在,或有明确 `skipped-with-reason`。
77
+ - [ ] L1 以上审查已执行,或环境限制已记录。
78
+ - [ ] `Reviewer Identity`、`Evidence Checked`、`Confidence Challenge`、`Final Confidence Basis` 已填写。
79
+ - [ ] open P0/P1 findings 为 0。
80
+ - [ ] material P2 已修复或 `accepted-risk` 并路由。
81
+ - [ ] 如使用 worker,已记录 branch、commit SHA、checks、residual 和 integration evidence。
82
+ - [ ] walkthrough、Closeout SSoT、Harness Ledger 引用了审查报告或跳过原因。
@@ -0,0 +1,72 @@
1
+ # 测试标准
2
+
3
+ ## 职责
4
+
5
+ 本标准定义完成任务前最低验证要求。测试不是为了证明“改过了”,而是为了证明本轮目标、关键路径、回归面和 residual 判断有证据支撑。
6
+
7
+ ## 测试体系画像
8
+
9
+ | 项 | 项目约定 |
10
+ | --- | --- |
11
+ | 单元测试 | 框架、命令、目录 |
12
+ | 集成测试 | 框架、命令、外部依赖处理 |
13
+ | 端到端测试 | Playwright / Cypress / 其他 |
14
+ | 浏览器检查 | 本地 URL、截图、console、network、交互路径 |
15
+ | live smoke | 环境、账号、权限、日志和回滚边界 |
16
+ | 测试数据 | fixture、factory、seed、脱敏数据 |
17
+ | 覆盖率目标 | 核心模块、工具函数、adapter、UI 关键路径 |
18
+
19
+ ## 目录和命名
20
+
21
+ - 测试目录遵循项目现有结构,不为单次任务新建割裂风格。
22
+ - 测试文件使用项目约定,例如 `*.test.ts`、`*.spec.ts`、`test_*.py`。
23
+ - 测试用例名描述行为和条件,例如“当用户未登录时拒绝访问私有接口”。
24
+ - fixture、mock、snapshot 要有清晰边界;不要把内部实现细节固定成脆弱快照。
25
+
26
+ ## 分层验证
27
+
28
+ | 层级 | 用途 | 适用场景 |
29
+ | --- | --- | --- |
30
+ | unit | 验证纯逻辑、边界条件、错误处理 | 工具函数、核心算法、纯业务规则 |
31
+ | integration | 验证模块协作、数据库、外部 client 封装 | 服务层、adapter、schema 变更 |
32
+ | e2e | 验证用户路径或跨层流程 | UI、API、关键业务流 |
33
+ | 本地冒烟 | 验证本地运行入口 | CLI、服务启动、页面打开 |
34
+ | 浏览器检查 | 验证真实浏览器渲染、交互、console、network | 前端、可视化、登录流程 |
35
+ | 线上冒烟 | 验证真实环境和部署链路 | 发布、反向代理、第三方集成 |
36
+
37
+ ## 回归触发
38
+
39
+ 以下情况必须查看 Regression SSoT 和 Cadence Ledger:
40
+
41
+ - merge 到主干前。
42
+ - 修改关键 surface、共享组件、schema、路由、权限、数据迁移。
43
+ - 修复线上或用户可见缺陷。
44
+ - release、hotfix、CI/CD、部署配置变更。
45
+ - reviewer finding 要求重跑证据。
46
+
47
+ ## 证据要求
48
+
49
+ 验证结果必须写明:
50
+
51
+ - 命令或检查名称。
52
+ - 运行位置和时间。
53
+ - 通过 / 失败 / skipped。
54
+ - 失败时的错误摘要。
55
+ - 证据路径:日志、截图、trace、CI run、Regression SSoT、walkthrough 或 PR。
56
+ - skipped 时的 residual、owner 和不阻塞理由。
57
+
58
+ ## 测试编写原则
59
+
60
+ 1. 每个测试验证一个清晰行为。
61
+ 2. 测试之间互相独立,不依赖执行顺序。
62
+ 3. 外部依赖通过 fixture、mock server、test container 或明确的 live smoke 处理。
63
+ 4. mock 外部边界,不 mock 被测内部实现。
64
+ 5. 错误信息要能帮助定位问题。
65
+ 6. 复杂回归优先沉淀成可重复命令,而不是一次性手工步骤。
66
+
67
+ ## 收口要求
68
+
69
+ - 非平凡代码改动至少提供一种自动化测试或明确说明为什么只能 smoke。
70
+ - 前端可视化或交互改动需要 browser inspection,除非有明确不适用原因。
71
+ - 发布和部署改动需要 CI/CD 证据、live smoke 或受控 residual。
72
+ - 测试失败不能直接收口;必须修复、写为 `accepted-risk` 并路由,或暂停并交给 owner。