@hunter-harness/workflow-harness 0.2.57 → 0.2.58

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 (182) hide show
  1. package/harness/bundles/general/claude-code/.harness-build.json +1 -1
  2. package/harness/bundles/general/claude-code/harness-archive/SKILL.md +1 -1
  3. package/harness/bundles/general/claude-code/harness-codebase-map/SKILL.md +1 -1
  4. package/harness/bundles/general/claude-code/harness-knowledge-ingest/SKILL.md +1 -1
  5. package/harness/bundles/general/claude-code/harness-knowledge-query/SKILL.md +1 -1
  6. package/harness/bundles/general/claude-code/harness-plan/SKILL.md +1 -1
  7. package/harness/bundles/general/claude-code/harness-review/SKILL.md +5 -3
  8. package/harness/bundles/general/claude-code/harness-review/protocols.md +2 -1
  9. package/harness/bundles/general/claude-code/harness-run/SKILL.md +4 -4
  10. package/harness/bundles/general/claude-code/harness-submit/SKILL.md +1 -1
  11. package/harness/bundles/general/claude-code/harness-sync/SKILL.md +1 -1
  12. package/harness/bundles/general/claude-code/harness-test/SKILL.md +5 -3
  13. package/harness/bundles/general/claude-code/harness-test/reference.md +2 -0
  14. package/harness/bundles/general/claude-code/protocols/report-pipeline-protocol.md +2 -0
  15. package/harness/bundles/general/claude-code/scripts/harness_context.py +423 -77
  16. package/harness/bundles/general/claude-code/scripts/harness_events.py +102 -12
  17. package/harness/bundles/general/claude-code/scripts/harness_fixback.py +529 -1
  18. package/harness/bundles/general/claude-code/scripts/harness_gate.py +161 -6
  19. package/harness/bundles/general/claude-code/scripts/harness_ledger.py +81 -8
  20. package/harness/bundles/general/claude-code/scripts/harness_review.py +25 -2
  21. package/harness/bundles/general/claude-code/scripts/harness_test_runner.py +155 -1
  22. package/harness/bundles/general/codebuddy/.harness-build.json +1 -1
  23. package/harness/bundles/general/codebuddy/harness-archive/SKILL.md +1 -1
  24. package/harness/bundles/general/codebuddy/harness-codebase-map/SKILL.md +1 -1
  25. package/harness/bundles/general/codebuddy/harness-knowledge-ingest/SKILL.md +1 -1
  26. package/harness/bundles/general/codebuddy/harness-knowledge-query/SKILL.md +1 -1
  27. package/harness/bundles/general/codebuddy/harness-plan/SKILL.md +1 -1
  28. package/harness/bundles/general/codebuddy/harness-review/SKILL.md +5 -3
  29. package/harness/bundles/general/codebuddy/harness-review/protocols.md +2 -1
  30. package/harness/bundles/general/codebuddy/harness-run/SKILL.md +4 -4
  31. package/harness/bundles/general/codebuddy/harness-submit/SKILL.md +1 -1
  32. package/harness/bundles/general/codebuddy/harness-sync/SKILL.md +1 -1
  33. package/harness/bundles/general/codebuddy/harness-test/SKILL.md +5 -3
  34. package/harness/bundles/general/codebuddy/harness-test/reference.md +2 -0
  35. package/harness/bundles/general/codebuddy/protocols/report-pipeline-protocol.md +2 -0
  36. package/harness/bundles/general/codebuddy/scripts/harness_context.py +423 -77
  37. package/harness/bundles/general/codebuddy/scripts/harness_events.py +102 -12
  38. package/harness/bundles/general/codebuddy/scripts/harness_fixback.py +529 -1
  39. package/harness/bundles/general/codebuddy/scripts/harness_gate.py +161 -6
  40. package/harness/bundles/general/codebuddy/scripts/harness_ledger.py +81 -8
  41. package/harness/bundles/general/codebuddy/scripts/harness_review.py +25 -2
  42. package/harness/bundles/general/codebuddy/scripts/harness_test_runner.py +155 -1
  43. package/harness/bundles/general/codex/.harness-build.json +1 -1
  44. package/harness/bundles/general/codex/harness-archive/SKILL.md +1 -1
  45. package/harness/bundles/general/codex/harness-codebase-map/SKILL.md +1 -1
  46. package/harness/bundles/general/codex/harness-knowledge-ingest/SKILL.md +1 -1
  47. package/harness/bundles/general/codex/harness-knowledge-query/SKILL.md +1 -1
  48. package/harness/bundles/general/codex/harness-plan/SKILL.md +1 -1
  49. package/harness/bundles/general/codex/harness-review/SKILL.md +3 -1
  50. package/harness/bundles/general/codex/harness-review/protocols.md +2 -1
  51. package/harness/bundles/general/codex/harness-run/SKILL.md +4 -4
  52. package/harness/bundles/general/codex/harness-submit/SKILL.md +1 -1
  53. package/harness/bundles/general/codex/harness-sync/SKILL.md +1 -1
  54. package/harness/bundles/general/codex/harness-test/SKILL.md +5 -3
  55. package/harness/bundles/general/codex/harness-test/reference.md +2 -0
  56. package/harness/bundles/general/codex/protocols/report-pipeline-protocol.md +2 -0
  57. package/harness/bundles/general/codex/scripts/harness_context.py +423 -77
  58. package/harness/bundles/general/codex/scripts/harness_events.py +102 -12
  59. package/harness/bundles/general/codex/scripts/harness_fixback.py +529 -1
  60. package/harness/bundles/general/codex/scripts/harness_gate.py +161 -6
  61. package/harness/bundles/general/codex/scripts/harness_ledger.py +81 -8
  62. package/harness/bundles/general/codex/scripts/harness_review.py +25 -2
  63. package/harness/bundles/general/codex/scripts/harness_test_runner.py +155 -1
  64. package/harness/bundles/general/cursor/.harness-build.json +1 -1
  65. package/harness/bundles/general/cursor/harness-archive/SKILL.md +1 -1
  66. package/harness/bundles/general/cursor/harness-codebase-map/SKILL.md +1 -1
  67. package/harness/bundles/general/cursor/harness-knowledge-ingest/SKILL.md +1 -1
  68. package/harness/bundles/general/cursor/harness-knowledge-query/SKILL.md +1 -1
  69. package/harness/bundles/general/cursor/harness-plan/SKILL.md +1 -1
  70. package/harness/bundles/general/cursor/harness-review/SKILL.md +3 -1
  71. package/harness/bundles/general/cursor/harness-review/protocols.md +2 -1
  72. package/harness/bundles/general/cursor/harness-run/SKILL.md +4 -4
  73. package/harness/bundles/general/cursor/harness-submit/SKILL.md +1 -1
  74. package/harness/bundles/general/cursor/harness-sync/SKILL.md +1 -1
  75. package/harness/bundles/general/cursor/harness-test/SKILL.md +5 -3
  76. package/harness/bundles/general/cursor/harness-test/reference.md +2 -0
  77. package/harness/bundles/general/cursor/protocols/report-pipeline-protocol.md +2 -0
  78. package/harness/bundles/general/cursor/scripts/harness_context.py +423 -77
  79. package/harness/bundles/general/cursor/scripts/harness_events.py +102 -12
  80. package/harness/bundles/general/cursor/scripts/harness_fixback.py +529 -1
  81. package/harness/bundles/general/cursor/scripts/harness_gate.py +161 -6
  82. package/harness/bundles/general/cursor/scripts/harness_ledger.py +81 -8
  83. package/harness/bundles/general/cursor/scripts/harness_review.py +25 -2
  84. package/harness/bundles/general/cursor/scripts/harness_test_runner.py +155 -1
  85. package/harness/bundles/java/claude-code/.harness-build.json +1 -1
  86. package/harness/bundles/java/claude-code/harness-apidoc/SKILL.md +1 -1
  87. package/harness/bundles/java/claude-code/harness-archive/SKILL.md +1 -1
  88. package/harness/bundles/java/claude-code/harness-codebase-map/SKILL.md +1 -1
  89. package/harness/bundles/java/claude-code/harness-knowledge-ingest/SKILL.md +1 -1
  90. package/harness/bundles/java/claude-code/harness-knowledge-query/SKILL.md +1 -1
  91. package/harness/bundles/java/claude-code/harness-package/SKILL.md +1 -1
  92. package/harness/bundles/java/claude-code/harness-plan/SKILL.md +1 -1
  93. package/harness/bundles/java/claude-code/harness-review/SKILL.md +5 -3
  94. package/harness/bundles/java/claude-code/harness-review/protocols.md +2 -1
  95. package/harness/bundles/java/claude-code/harness-run/SKILL.md +4 -4
  96. package/harness/bundles/java/claude-code/harness-submit/SKILL.md +1 -1
  97. package/harness/bundles/java/claude-code/harness-sync/SKILL.md +1 -1
  98. package/harness/bundles/java/claude-code/harness-test/SKILL.md +5 -3
  99. package/harness/bundles/java/claude-code/protocols/report-pipeline-protocol.md +2 -0
  100. package/harness/bundles/java/claude-code/scripts/harness_context.py +423 -77
  101. package/harness/bundles/java/claude-code/scripts/harness_events.py +102 -12
  102. package/harness/bundles/java/claude-code/scripts/harness_fixback.py +529 -1
  103. package/harness/bundles/java/claude-code/scripts/harness_gate.py +161 -6
  104. package/harness/bundles/java/claude-code/scripts/harness_ledger.py +81 -8
  105. package/harness/bundles/java/claude-code/scripts/harness_review.py +25 -2
  106. package/harness/bundles/java/claude-code/scripts/harness_test_runner.py +155 -1
  107. package/harness/bundles/java/codebuddy/.harness-build.json +1 -1
  108. package/harness/bundles/java/codebuddy/harness-apidoc/SKILL.md +1 -1
  109. package/harness/bundles/java/codebuddy/harness-archive/SKILL.md +1 -1
  110. package/harness/bundles/java/codebuddy/harness-codebase-map/SKILL.md +1 -1
  111. package/harness/bundles/java/codebuddy/harness-knowledge-ingest/SKILL.md +1 -1
  112. package/harness/bundles/java/codebuddy/harness-knowledge-query/SKILL.md +1 -1
  113. package/harness/bundles/java/codebuddy/harness-package/SKILL.md +1 -1
  114. package/harness/bundles/java/codebuddy/harness-plan/SKILL.md +1 -1
  115. package/harness/bundles/java/codebuddy/harness-review/SKILL.md +5 -3
  116. package/harness/bundles/java/codebuddy/harness-review/protocols.md +2 -1
  117. package/harness/bundles/java/codebuddy/harness-run/SKILL.md +4 -4
  118. package/harness/bundles/java/codebuddy/harness-submit/SKILL.md +1 -1
  119. package/harness/bundles/java/codebuddy/harness-sync/SKILL.md +1 -1
  120. package/harness/bundles/java/codebuddy/harness-test/SKILL.md +5 -3
  121. package/harness/bundles/java/codebuddy/protocols/report-pipeline-protocol.md +2 -0
  122. package/harness/bundles/java/codebuddy/scripts/harness_context.py +423 -77
  123. package/harness/bundles/java/codebuddy/scripts/harness_events.py +102 -12
  124. package/harness/bundles/java/codebuddy/scripts/harness_fixback.py +529 -1
  125. package/harness/bundles/java/codebuddy/scripts/harness_gate.py +161 -6
  126. package/harness/bundles/java/codebuddy/scripts/harness_ledger.py +81 -8
  127. package/harness/bundles/java/codebuddy/scripts/harness_review.py +25 -2
  128. package/harness/bundles/java/codebuddy/scripts/harness_test_runner.py +155 -1
  129. package/harness/bundles/java/codex/.harness-build.json +1 -1
  130. package/harness/bundles/java/codex/harness-apidoc/SKILL.md +1 -1
  131. package/harness/bundles/java/codex/harness-archive/SKILL.md +1 -1
  132. package/harness/bundles/java/codex/harness-codebase-map/SKILL.md +1 -1
  133. package/harness/bundles/java/codex/harness-knowledge-ingest/SKILL.md +1 -1
  134. package/harness/bundles/java/codex/harness-knowledge-query/SKILL.md +1 -1
  135. package/harness/bundles/java/codex/harness-package/SKILL.md +1 -1
  136. package/harness/bundles/java/codex/harness-plan/SKILL.md +1 -1
  137. package/harness/bundles/java/codex/harness-review/SKILL.md +3 -1
  138. package/harness/bundles/java/codex/harness-review/protocols.md +2 -1
  139. package/harness/bundles/java/codex/harness-run/SKILL.md +4 -4
  140. package/harness/bundles/java/codex/harness-submit/SKILL.md +1 -1
  141. package/harness/bundles/java/codex/harness-sync/SKILL.md +1 -1
  142. package/harness/bundles/java/codex/harness-test/SKILL.md +5 -3
  143. package/harness/bundles/java/codex/protocols/report-pipeline-protocol.md +2 -0
  144. package/harness/bundles/java/codex/scripts/harness_context.py +423 -77
  145. package/harness/bundles/java/codex/scripts/harness_events.py +102 -12
  146. package/harness/bundles/java/codex/scripts/harness_fixback.py +529 -1
  147. package/harness/bundles/java/codex/scripts/harness_gate.py +161 -6
  148. package/harness/bundles/java/codex/scripts/harness_ledger.py +81 -8
  149. package/harness/bundles/java/codex/scripts/harness_review.py +25 -2
  150. package/harness/bundles/java/codex/scripts/harness_test_runner.py +155 -1
  151. package/harness/bundles/java/cursor/.harness-build.json +1 -1
  152. package/harness/bundles/java/cursor/harness-apidoc/SKILL.md +1 -1
  153. package/harness/bundles/java/cursor/harness-archive/SKILL.md +1 -1
  154. package/harness/bundles/java/cursor/harness-codebase-map/SKILL.md +1 -1
  155. package/harness/bundles/java/cursor/harness-knowledge-ingest/SKILL.md +1 -1
  156. package/harness/bundles/java/cursor/harness-knowledge-query/SKILL.md +1 -1
  157. package/harness/bundles/java/cursor/harness-package/SKILL.md +1 -1
  158. package/harness/bundles/java/cursor/harness-plan/SKILL.md +1 -1
  159. package/harness/bundles/java/cursor/harness-review/SKILL.md +3 -1
  160. package/harness/bundles/java/cursor/harness-review/protocols.md +2 -1
  161. package/harness/bundles/java/cursor/harness-run/SKILL.md +4 -4
  162. package/harness/bundles/java/cursor/harness-submit/SKILL.md +1 -1
  163. package/harness/bundles/java/cursor/harness-sync/SKILL.md +1 -1
  164. package/harness/bundles/java/cursor/harness-test/SKILL.md +5 -3
  165. package/harness/bundles/java/cursor/protocols/report-pipeline-protocol.md +2 -0
  166. package/harness/bundles/java/cursor/scripts/harness_context.py +423 -77
  167. package/harness/bundles/java/cursor/scripts/harness_events.py +102 -12
  168. package/harness/bundles/java/cursor/scripts/harness_fixback.py +529 -1
  169. package/harness/bundles/java/cursor/scripts/harness_gate.py +161 -6
  170. package/harness/bundles/java/cursor/scripts/harness_ledger.py +81 -8
  171. package/harness/bundles/java/cursor/scripts/harness_review.py +25 -2
  172. package/harness/bundles/java/cursor/scripts/harness_test_runner.py +155 -1
  173. package/harness/manifests/general/claude-code.json +23 -23
  174. package/harness/manifests/general/codebuddy.json +23 -23
  175. package/harness/manifests/general/codex.json +23 -23
  176. package/harness/manifests/general/cursor.json +23 -23
  177. package/harness/manifests/java/claude-code.json +24 -24
  178. package/harness/manifests/java/codebuddy.json +24 -24
  179. package/harness/manifests/java/codex.json +24 -24
  180. package/harness/manifests/java/cursor.json +24 -24
  181. package/hunter-workflow-family.json +5 -5
  182. package/package.json +1 -1
@@ -3,7 +3,7 @@ name: harness-codebase-map
3
3
  description: 分析现有代码库并生成 .harness/codebase/map/
4
4
  下的结构化代码库地图。用于陌生项目理解、重大改造前梳理、harness-sync 提示 map 过期后的人工刷新。
5
5
  ---
6
- <!-- generated by harness_deploy.py; core=b0a4a610e182eab5; overlay=java; agent=codex; do not edit -->
6
+ <!-- generated by harness_deploy.py; core=fc997c9e6485329b; overlay=java; agent=codex; do not edit -->
7
7
  # harness-codebase-map — 代码库地图
8
8
 
9
9
  ## Purpose
@@ -2,7 +2,7 @@
2
2
  name: harness-knowledge-ingest
3
3
  description: 确认归档 ZIP 已上传并由 Hunter Platform 在服务端解包、校验和入库。客户端不再构建或维护本地知识索引。
4
4
  ---
5
- <!-- generated by harness_deploy.py; core=b0a4a610e182eab5; overlay=java; agent=codex; do not edit -->
5
+ <!-- generated by harness_deploy.py; core=fc997c9e6485329b; overlay=java; agent=codex; do not edit -->
6
6
  # harness-knowledge-ingest
7
7
 
8
8
  知识 ingest 完全由 Hunter Platform 负责。归档完成时,客户端生成一个确定性 ZIP;
@@ -2,7 +2,7 @@
2
2
  name: harness-knowledge-query
3
3
  description: 在规划、实现或排查前,通过 hunter-harness CLI 查询远端项目知识库。远端不可用时直接报告不可用,不建立本地索引或离线回退。
4
4
  ---
5
- <!-- generated by harness_deploy.py; core=b0a4a610e182eab5; overlay=java; agent=codex; do not edit -->
5
+ <!-- generated by harness_deploy.py; core=fc997c9e6485329b; overlay=java; agent=codex; do not edit -->
6
6
  # harness-knowledge-query
7
7
 
8
8
  项目知识以 Hunter Platform 的服务端索引为唯一真源。客户端只提交查询并消费结果:
@@ -2,7 +2,7 @@
2
2
  name: harness-package
3
3
  description: 增量模块打包:拉取最新→编译验证→mvn package→汇总 jar/war。仅当用户显式调用 /harness-package 时使用,不得自动触发。
4
4
  ---
5
- <!-- generated by harness_deploy.py; core=b0a4a610e182eab5; overlay=java; agent=codex; do not edit -->
5
+ <!-- generated by harness_deploy.py; core=fc997c9e6485329b; overlay=java; agent=codex; do not edit -->
6
6
  # harness-package — 增量模块打包(Java overlay)
7
7
 
8
8
  ## Purpose
@@ -3,7 +3,7 @@ name: harness-plan
3
3
  description: 将需求转化为设计文档+实施计划+完整测试场景表,必须在编码前完成。仅当用户显式调用 /harness-plan 或明确要求进入
4
4
  Harness 规划阶段时使用;不得因用户描述需求就自动触发。
5
5
  ---
6
- <!-- generated by harness_deploy.py; core=b0a4a610e182eab5; overlay=java; agent=codex; do not edit -->
6
+ <!-- generated by harness_deploy.py; core=fc997c9e6485329b; overlay=java; agent=codex; do not edit -->
7
7
  # harness-plan — 需求规划
8
8
 
9
9
  ## Purpose
@@ -4,7 +4,7 @@ description: 6维度代码审查(架构/安全/规范/兼容/测试/性能)
4
4
  .harness/context-index.json)和测试场景表,在隔离上下文运行。仅当用户显式调用 /harness-review 时使用;不得在
5
5
  test 结束后自动接续执行。
6
6
  ---
7
- <!-- generated by harness_deploy.py; core=b0a4a610e182eab5; overlay=java; agent=codex; do not edit -->
7
+ <!-- generated by harness_deploy.py; core=fc997c9e6485329b; overlay=java; agent=codex; do not edit -->
8
8
  # harness-review — 代码审查
9
9
 
10
10
  ## Purpose
@@ -97,6 +97,8 @@ review:
97
97
  2. fixback 落盘到 `.harness/changes/<change-name>/reports/review/fixback-YYYYMMDD-HHmm.md`。
98
98
  3. 无 RED/YELLOW 时记录跳过原因,不制造空修复任务。
99
99
 
100
+ 没有 `.codegraph/` 只意味着“项目尚未建立 CodeGraph 索引,已直接读取源码”,不得将它写成独立评审不可用或委派失败原因。历史英文原因码不得进入摘要;稳定码只写结构化字段并留在技术详情。
101
+
100
102
  ## P0 执行可信度规则
101
103
 
102
104
  - 命令结果不得靠猜测;普通 Bash 被拒 → 立即改用等价 PowerShell 重试一次
@@ -34,6 +34,7 @@ description: harness-review 的原生修复反馈协议。内化 receiving-code-
34
34
  | 风险说明 | 说明为什么值得处理 |
35
35
  | 推荐修复 | 可执行的修复方向,不写空泛建议 |
36
36
  | 验证方式 | 构建、测试、场景编号或人工确认方式 |
37
+ | 修复动作 | `code` / `manual` / `workflow`;只有 `code` 会进入 `/harness-run --fixback` |
37
38
  | submit 影响 | 默认 advisory;仅 strict-review-gate=true 时标记阻塞 |
38
39
 
39
40
  如果没有 RED/YELLOW,必须明确写:
@@ -45,7 +46,7 @@ description: harness-review 的原生修复反馈协议。内化 receiving-code-
45
46
  ### 定位边界
46
47
 
47
48
  - harness-review 默认仅供参考,不阻塞 submit/archive。
48
- - `review-fixback-protocol` 只生成修复反馈,不自动修改代码。
49
+ - `review-fixback-protocol` 只生成修复反馈,不自动修改代码。人工验收与流程建议不得伪装成代码问题,也不得创建空 Fixback 批次。
49
50
  - 不得把 YELLOW 写成必须阻塞 submit。
50
51
  - 只有配置 `strict-review-gate: true` 时,RED 才可标记为阻塞 submit。
51
52
 
@@ -3,7 +3,7 @@ name: harness-run
3
3
  description: 按变更簇执行 TDD 编码循环(RED→GREEN→REFACTOR→编译验证),逐变更簇实现计划中的任务。仅当用户显式调用
4
4
  /harness-run 时使用;不得因用户提到编码/实现就自动触发,也不得被其他阶段 skill 自动接续。
5
5
  ---
6
- <!-- generated by harness_deploy.py; core=b0a4a610e182eab5; overlay=java; agent=codex; do not edit -->
6
+ <!-- generated by harness_deploy.py; core=fc997c9e6485329b; overlay=java; agent=codex; do not edit -->
7
7
  # harness-run — 需求编码
8
8
 
9
9
  ## Purpose
@@ -59,14 +59,14 @@ description: 按变更簇执行 TDD 编码循环(RED→GREEN→REFACTOR→编
59
59
 
60
60
  ## Workflow 概要
61
61
 
62
- 0. 加载上下文:先 `harness_context.py prepare --phase run --executor <tool> [--change <id>] --json`,再 **`harness_context.py begin --phase run --change <id> --executor <tool> --json`** 校验交接。`--fixback` 时紧接着运行 `harness_fixback.py resume --change-dir "<executionRoot>"`,只消费返回的 `batchId/runId/attempt/nextStep/changedFiles/requiredVerifications`;重复调用必须复用同一批次和轮次,不重新通读实现或另建脚本。最后运行 **`harness_gate.py begin --phase run --change <id>`**;上下文未完成时 gate 会在创建租约前拒绝。禁止手写 `events.ndjson` / `phase.end`。已连接平台时 begin 会 best-effort 补传事件,失败只告警。
62
+ 0. 加载上下文:普通 Run 先 `harness_context.py prepare --phase run --executor <tool> [--change <id>] --json`,再 **`harness_context.py begin --phase run --change <id> --executor <tool> --json`** 校验交接,最后运行 **`harness_gate.py begin --phase run --change <id>`**。`--fixback` 不得拼装这些底层步骤,必须只调用一次 `harness_fixback.py launch-review --project . --change <id> --change-dir <change-dir> --executor <tool> --skills-root <skills-root> --product-identity <当前产品身份> --json`:该命令会先筛选结构化评审项,再原子选择 Fixback 分支、确认上下文、取得 Run 门禁并创建已填充批次。返回 `FIXBACK_NOTHING_TO_APPLY` 时直接报告“本轮评审没有需要执行的代码修复”并停止;返回阻塞码时按 `recoveryAction` 停止,不搜索实现、不试探其他参数、不创建空批次。禁止手写 `events.ndjson` / `phase.end`。已连接平台时 begin 会 best-effort 补传事件,失败只告警。
63
63
  0.5. **测试基础设施探测**(先写 `CHECKING`,四项证据齐备后再结论)→ `reference.md` Step 0.5;测试基线已由上一步 gate begin 内部建立,不得再次执行 guard begin
64
64
  1. **变更簇 TDD** — `protocols.md` `run-tdd-protocol`;批量 RED/GREEN;按需 `change-cluster-review-protocol`(高风险 + reviewer 预检可用)
65
- 2. 构建验证 + **仅**通过 `harness_ledger.py record` 写 ledger(禁止 Write/Edit `verification-ledger.json`);`diff-hash --change-dir` 纳入 ignored tests → `reference.md` Step 2c
65
+ 2. 构建验证 + **仅**通过 `harness_ledger.py record` 写 ledger(禁止 Write/Edit `verification-ledger.json`);若本阶段创建/删除了清单、锁文件、源码根或改变技术栈,最后一次产品编辑后、写账本与关门前必须执行 `harness_preflight.py detect --project . --json` 刷新 build profile。`record --project . --profile-input <key>` 会对缺失/陈旧 profile 自动检测并从同一 target 推导 scope、coverage、规范命令和输入闭包;不得再手填另一套身份。`diff-hash --change-dir` 纳入 ignored tests → `reference.md` Step 2c
66
66
  3. **场景覆盖检查**(场景表映射,禁止用用例数冒充场景数)
67
67
  4. **关门检查**(10 项)→ 只执行一次 `harness_gate.py close`;`--to-phase` 必须取返回的 `nextPhases` 或 `plannedPhases` 中 run 的真实后继,禁止写死 test。该命令内部关闭 test guard、写 `phase.end`、释放租约、写 handoff 并补传事件;不得再单独调用 test-guard/context close。失败时按结构化 `recoveryAction` 原样重试,已完成步骤幂等复用。
68
68
 
69
- **Fixback**:必须通过 `harness_fixback.py resume/add-issue/resolve-issue/close` 驱动,不得把修复说明当成新的普通 Run。只读取返回的受影响问题和文件;验证仅失效与 `changedFiles` 相交的目标,其他 Test/Review 证据继续复用。RED 优先;未选用则用中文记录“本轮未采纳该改进建议”。
69
+ **Fixback**:入口只用 `launch-review`,后续问题处理通过 `resolve-issue/close` 驱动,不得把修复说明当成新的普通 Run。只读取返回的受影响问题和文件;验证仅失效与 `changedFiles` 相交的目标,其他 Test/Review 证据继续复用。RED 优先;`manual`、`workflow` 或未选用的建议不进入代码批次,使用中文记录处理结论。
70
70
 
71
71
  **执行器边界**:优先使用项目 build profile 和已有测试入口。禁止为了绕过 ESM、路径或参数问题临时生成 `.js`、`require` 脚本;需要文件式 runner 时使用项目已有入口,确需新增时遵循项目模块类型(例如 ESM 使用 `.mjs`)。runner 包装说明写入 `runnerCommand` 元数据,不得拼进账本的规范 `command`。
72
72
 
@@ -3,7 +3,7 @@ name: harness-submit
3
3
  description: 最终提交封装:验证→中文 commit→提交/推送;worktree 模式含 --no-ff 合并回主分支。仅当用户显式调用
4
4
  /harness-submit(或 /harness-merge 重入合并段)时使用;用户口头说'提交/commit/push'时必须先确认,不得自动触发。
5
5
  ---
6
- <!-- generated by harness_deploy.py; core=b0a4a610e182eab5; overlay=java; agent=codex; do not edit -->
6
+ <!-- generated by harness_deploy.py; core=fc997c9e6485329b; overlay=java; agent=codex; do not edit -->
7
7
  # harness-submit — 最终提交(含 worktree 合并)
8
8
 
9
9
  ## Purpose
@@ -4,7 +4,7 @@ description: Use when the user asks to synchronize, refresh, or validate Harness
4
4
  metadata, adapters, remote knowledge ownership, instruction entrypoints,
5
5
  config origins, or CodeGraph status.
6
6
  ---
7
- <!-- generated by harness_deploy.py; core=b0a4a610e182eab5; overlay=java; agent=codex; do not edit -->
7
+ <!-- generated by harness_deploy.py; core=fc997c9e6485329b; overlay=java; agent=codex; do not edit -->
8
8
  # harness-sync
9
9
 
10
10
  ## Purpose
@@ -3,7 +3,7 @@ name: harness-test
3
3
  description: 测试执行:读取场景表,执行单元测试+API接口测试+数据兼容验证,输出测试报告。仅当用户显式调用 /harness-test
4
4
  时使用;不得在 run 结束后自动接续执行。
5
5
  ---
6
- <!-- generated by harness_deploy.py; core=b0a4a610e182eab5; overlay=java; agent=codex; do not edit -->
6
+ <!-- generated by harness_deploy.py; core=fc997c9e6485329b; overlay=java; agent=codex; do not edit -->
7
7
  # harness-test — 测试执行
8
8
 
9
9
  ## Purpose
@@ -109,7 +109,7 @@ Runner 强制同项目单实例、低调度优先级、逐命令超时、正常
109
109
 
110
110
  ### Phase 1-2:测试执行(默认主会话执行)
111
111
 
112
- **Phase 1 前先检查 verification-ledger**:通过 state layout 解析后的路径调用 `harness_ledger.py can-reuse --project . --profile-input <key> --command <profile 解析出的规范命令>`;可复用时不得重跑。不得手工读取实现源码来猜账本参数。
112
+ **Phase 1 前先检查 verification-ledger**:先执行 `harness_preflight.py check --project . --json`;profile 缺失或因清单、锁文件、源码根、技术栈变化而陈旧时立即执行一次 `detect --project . --json`。随后通过 state layout 解析后的路径调用 `harness_ledger.py can-reuse --project . --profile-input <key> --command <profile 解析出的规范命令>`;可复用时不得重跑。不得手工读取实现源码来猜账本参数。按返回的 `executionNeed` 使用中文:`first-run`=“尚未执行,需要首次运行”,`rerun`=“证据已失效,需要重新运行”,`evidence-incomplete`=“已有记录不完整,需要重新验证”,`reuse`=“现有证据可复用”;禁止把首次执行统一描述成“强制重跑”。
113
113
 
114
114
  **默认在主会话执行**(不委派 subagent):
115
115
  - 单元测试:可复用则跳过重跑;否则按技术栈执行测试命令
@@ -163,7 +163,9 @@ Runner 强制同项目单实例、低调度优先级、逐命令超时、正常
163
163
 
164
164
  ### 四、单元测试复用 + 写入 ledger
165
165
 
166
- Phase 1 前用 `harness_ledger.py diff-hash` 和 `can-reuse` 重算真实指纹。验证目标必须使用 profile key 的单一入口:`--project . --profile-input unitTest|unitTestFull --command <规范命令>`;声明 `--profile-input` 后不得同时传入另一套 `--files`。`npx vitest run` 与 `vitest run` 等包装差异由账本规范化,`safe runner` 等说明只能写 `--runner-command` 元数据。可复用则跳过;否则执行同一 profile 命令并只登记一条结果。增量测试记 `unitTest`,模块全量记 `unitTestFull`,API/浏览器分别记录。详见 `checklist.md` 与 ledger protocol。
166
+ Phase 1 前用 `harness_ledger.py diff-hash` 和 `can-reuse` 重算真实指纹。验证目标必须使用 profile key 的单一入口:`--project . --profile-input unitTest|unitTestFull --command <规范命令>`;声明 `--profile-input` 后不得同时传入另一套 `--files`。`record` 与 `can-reuse` 必须消费同一 profile target,由 CLI 推导 scope、coverage、规范命令与输入闭包。`npx vitest run` 与 `vitest run` 等包装差异由账本规范化,`safe runner` 等说明只能写 `--runner-command` 元数据。可复用则跳过;否则执行同一 profile 命令并只登记一条结果。增量测试记 `unitTest`,模块全量记 `unitTestFull`,API/浏览器分别记录。详见 `checklist.md` 与 ledger protocol。
167
+
168
+ 报告必须分开呈现“产品测试”与“工具维护”。`ownership.productPaths` 决定产品结论;`.cursor/.agents/.claude/.codebuddy` 的 Harness 投影、context-index 与安装状态变化只进入“工具维护”,不得单独把产品结果降为 WARN。已知升级使用明确文案“Harness 已从 <旧版本> 更新到 <新版本>”,不得写“无关漂移”。场景统计分别列出:已执行、待手工验收、已豁免、说明性、NOT_APPLICABLE;“未验证”必须只等于仍要求执行但尚未完成的场景数。
167
169
 
168
170
  ### 五、命令与请求超时治理
169
171
 
@@ -74,6 +74,8 @@ python <skills-root>/scripts/harness_events.py append --change-dir ".harness/cha
74
74
  |---|---|---|
75
75
  | `phase.start` | phase, timestamp | 阶段开始 |
76
76
  | `phase.end` | phase, timestamp, status | 阶段结束并记录 `OK/WARN/FAIL/BLOCKED`;计算当前 attempt 耗时 |
77
+ | `phase.prepare.start` | phase, timestamp, attempt, trigger | 开始检查再次执行阶段的前置条件;不计入产品阶段 attempt |
78
+ | `phase.prepare.end` | phase, timestamp, attempt, status | 记录准备已启动或受阻及单独耗时;`BLOCKED` 不改变旧产品轮次 |
77
79
  | `command` | command, exit_code, duration_ms | 命令事实 |
78
80
  | `verification` | name, status, command | 验证事实 |
79
81
  | `artifact` | path, kind | 报告、包、manifest 等产物 |