@hunter-harness/workflow-harness 0.2.5 → 0.2.6

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 (202) 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 +5 -2
  3. package/harness/bundles/general/claude-code/harness-archive/reference.md +1 -1
  4. package/harness/bundles/general/claude-code/harness-archive/templates/render-summary.mjs +78 -155
  5. package/harness/bundles/general/claude-code/harness-codebase-map/SKILL.md +4 -2
  6. package/harness/bundles/general/claude-code/harness-knowledge-ingest/SKILL.md +5 -3
  7. package/harness/bundles/general/claude-code/harness-knowledge-ingest/scripts/harness_knowledge.py +83 -6
  8. package/harness/bundles/general/claude-code/harness-knowledge-query/SKILL.md +4 -2
  9. package/harness/bundles/general/claude-code/harness-plan/SKILL.md +6 -3
  10. package/harness/bundles/general/claude-code/harness-review/SKILL.md +6 -3
  11. package/harness/bundles/general/claude-code/harness-run/SKILL.md +5 -2
  12. package/harness/bundles/general/claude-code/harness-run/reference.md +1 -1
  13. package/harness/bundles/general/claude-code/harness-submit/SKILL.md +5 -2
  14. package/harness/bundles/general/claude-code/harness-sync/SKILL.md +5 -3
  15. package/harness/bundles/general/claude-code/harness-test/SKILL.md +5 -2
  16. package/harness/bundles/general/claude-code/harness-test/reference.md +1 -1
  17. package/harness/bundles/general/claude-code/protocols/ledger-protocol.md +1 -1
  18. package/harness/bundles/general/claude-code/protocols/report-pipeline-protocol.md +11 -4
  19. package/harness/bundles/general/claude-code/scripts/harness_archive.py +190 -32
  20. package/harness/bundles/general/claude-code/scripts/harness_events.py +134 -40
  21. package/harness/bundles/general/claude-code/scripts/harness_preflight.py +46 -3
  22. package/harness/bundles/general/claude-code/scripts/harness_profile.py +2 -2
  23. package/harness/bundles/general/claude-code/scripts/harness_state.py +148 -0
  24. package/harness/bundles/general/codebuddy/.harness-build.json +1 -1
  25. package/harness/bundles/general/codebuddy/harness-archive/SKILL.md +5 -2
  26. package/harness/bundles/general/codebuddy/harness-archive/reference.md +1 -1
  27. package/harness/bundles/general/codebuddy/harness-archive/templates/render-summary.mjs +78 -155
  28. package/harness/bundles/general/codebuddy/harness-codebase-map/SKILL.md +4 -2
  29. package/harness/bundles/general/codebuddy/harness-knowledge-ingest/SKILL.md +5 -3
  30. package/harness/bundles/general/codebuddy/harness-knowledge-ingest/scripts/harness_knowledge.py +83 -6
  31. package/harness/bundles/general/codebuddy/harness-knowledge-query/SKILL.md +4 -2
  32. package/harness/bundles/general/codebuddy/harness-plan/SKILL.md +6 -3
  33. package/harness/bundles/general/codebuddy/harness-review/SKILL.md +6 -3
  34. package/harness/bundles/general/codebuddy/harness-run/SKILL.md +5 -2
  35. package/harness/bundles/general/codebuddy/harness-run/reference.md +1 -1
  36. package/harness/bundles/general/codebuddy/harness-submit/SKILL.md +5 -2
  37. package/harness/bundles/general/codebuddy/harness-sync/SKILL.md +5 -3
  38. package/harness/bundles/general/codebuddy/harness-test/SKILL.md +5 -2
  39. package/harness/bundles/general/codebuddy/harness-test/reference.md +1 -1
  40. package/harness/bundles/general/codebuddy/protocols/ledger-protocol.md +1 -1
  41. package/harness/bundles/general/codebuddy/protocols/report-pipeline-protocol.md +11 -4
  42. package/harness/bundles/general/codebuddy/scripts/harness_archive.py +190 -32
  43. package/harness/bundles/general/codebuddy/scripts/harness_events.py +134 -40
  44. package/harness/bundles/general/codebuddy/scripts/harness_preflight.py +46 -3
  45. package/harness/bundles/general/codebuddy/scripts/harness_profile.py +2 -2
  46. package/harness/bundles/general/codebuddy/scripts/harness_state.py +148 -0
  47. package/harness/bundles/general/codex/.harness-build.json +1 -1
  48. package/harness/bundles/general/codex/harness-archive/SKILL.md +5 -2
  49. package/harness/bundles/general/codex/harness-archive/reference.md +1 -1
  50. package/harness/bundles/general/codex/harness-archive/templates/render-summary.mjs +78 -155
  51. package/harness/bundles/general/codex/harness-codebase-map/SKILL.md +4 -2
  52. package/harness/bundles/general/codex/harness-knowledge-ingest/SKILL.md +5 -3
  53. package/harness/bundles/general/codex/harness-knowledge-ingest/scripts/harness_knowledge.py +83 -6
  54. package/harness/bundles/general/codex/harness-knowledge-query/SKILL.md +4 -2
  55. package/harness/bundles/general/codex/harness-plan/SKILL.md +6 -3
  56. package/harness/bundles/general/codex/harness-review/SKILL.md +5 -2
  57. package/harness/bundles/general/codex/harness-run/SKILL.md +5 -2
  58. package/harness/bundles/general/codex/harness-run/reference.md +1 -1
  59. package/harness/bundles/general/codex/harness-submit/SKILL.md +5 -2
  60. package/harness/bundles/general/codex/harness-sync/SKILL.md +5 -3
  61. package/harness/bundles/general/codex/harness-test/SKILL.md +5 -2
  62. package/harness/bundles/general/codex/harness-test/reference.md +1 -1
  63. package/harness/bundles/general/codex/protocols/ledger-protocol.md +1 -1
  64. package/harness/bundles/general/codex/protocols/report-pipeline-protocol.md +11 -4
  65. package/harness/bundles/general/codex/scripts/harness_archive.py +190 -32
  66. package/harness/bundles/general/codex/scripts/harness_events.py +134 -40
  67. package/harness/bundles/general/codex/scripts/harness_preflight.py +46 -3
  68. package/harness/bundles/general/codex/scripts/harness_profile.py +2 -2
  69. package/harness/bundles/general/codex/scripts/harness_state.py +148 -0
  70. package/harness/bundles/general/cursor/.harness-build.json +1 -1
  71. package/harness/bundles/general/cursor/harness-archive/SKILL.md +5 -2
  72. package/harness/bundles/general/cursor/harness-archive/reference.md +1 -1
  73. package/harness/bundles/general/cursor/harness-archive/templates/render-summary.mjs +78 -155
  74. package/harness/bundles/general/cursor/harness-codebase-map/SKILL.md +4 -2
  75. package/harness/bundles/general/cursor/harness-knowledge-ingest/SKILL.md +5 -3
  76. package/harness/bundles/general/cursor/harness-knowledge-ingest/scripts/harness_knowledge.py +83 -6
  77. package/harness/bundles/general/cursor/harness-knowledge-query/SKILL.md +4 -2
  78. package/harness/bundles/general/cursor/harness-plan/SKILL.md +6 -3
  79. package/harness/bundles/general/cursor/harness-review/SKILL.md +5 -2
  80. package/harness/bundles/general/cursor/harness-run/SKILL.md +5 -2
  81. package/harness/bundles/general/cursor/harness-run/reference.md +1 -1
  82. package/harness/bundles/general/cursor/harness-submit/SKILL.md +5 -2
  83. package/harness/bundles/general/cursor/harness-sync/SKILL.md +5 -3
  84. package/harness/bundles/general/cursor/harness-test/SKILL.md +5 -2
  85. package/harness/bundles/general/cursor/harness-test/reference.md +1 -1
  86. package/harness/bundles/general/cursor/protocols/ledger-protocol.md +1 -1
  87. package/harness/bundles/general/cursor/protocols/report-pipeline-protocol.md +11 -4
  88. package/harness/bundles/general/cursor/scripts/harness_archive.py +190 -32
  89. package/harness/bundles/general/cursor/scripts/harness_events.py +134 -40
  90. package/harness/bundles/general/cursor/scripts/harness_preflight.py +46 -3
  91. package/harness/bundles/general/cursor/scripts/harness_profile.py +2 -2
  92. package/harness/bundles/general/cursor/scripts/harness_state.py +148 -0
  93. package/harness/bundles/java/claude-code/.harness-build.json +1 -1
  94. package/harness/bundles/java/claude-code/harness-apidoc/SKILL.md +5 -2
  95. package/harness/bundles/java/claude-code/harness-archive/SKILL.md +5 -2
  96. package/harness/bundles/java/claude-code/harness-archive/reference.md +1 -1
  97. package/harness/bundles/java/claude-code/harness-archive/templates/render-summary.mjs +78 -155
  98. package/harness/bundles/java/claude-code/harness-codebase-map/SKILL.md +4 -2
  99. package/harness/bundles/java/claude-code/harness-knowledge-ingest/SKILL.md +5 -3
  100. package/harness/bundles/java/claude-code/harness-knowledge-ingest/scripts/harness_knowledge.py +83 -6
  101. package/harness/bundles/java/claude-code/harness-knowledge-query/SKILL.md +4 -2
  102. package/harness/bundles/java/claude-code/harness-package/SKILL.md +5 -2
  103. package/harness/bundles/java/claude-code/harness-plan/SKILL.md +6 -3
  104. package/harness/bundles/java/claude-code/harness-review/SKILL.md +6 -3
  105. package/harness/bundles/java/claude-code/harness-run/SKILL.md +5 -2
  106. package/harness/bundles/java/claude-code/harness-run/reference.md +1 -1
  107. package/harness/bundles/java/claude-code/harness-submit/SKILL.md +5 -2
  108. package/harness/bundles/java/claude-code/harness-sync/SKILL.md +5 -3
  109. package/harness/bundles/java/claude-code/harness-test/SKILL.md +5 -2
  110. package/harness/bundles/java/claude-code/harness-test/reference.md +1 -1
  111. package/harness/bundles/java/claude-code/protocols/ledger-protocol.md +1 -1
  112. package/harness/bundles/java/claude-code/protocols/report-pipeline-protocol.md +11 -4
  113. package/harness/bundles/java/claude-code/scripts/harness_archive.py +190 -32
  114. package/harness/bundles/java/claude-code/scripts/harness_events.py +134 -40
  115. package/harness/bundles/java/claude-code/scripts/harness_preflight.py +46 -3
  116. package/harness/bundles/java/claude-code/scripts/harness_profile.py +2 -2
  117. package/harness/bundles/java/claude-code/scripts/harness_state.py +148 -0
  118. package/harness/bundles/java/codebuddy/.harness-build.json +1 -1
  119. package/harness/bundles/java/codebuddy/harness-apidoc/SKILL.md +5 -2
  120. package/harness/bundles/java/codebuddy/harness-archive/SKILL.md +5 -2
  121. package/harness/bundles/java/codebuddy/harness-archive/reference.md +1 -1
  122. package/harness/bundles/java/codebuddy/harness-archive/templates/render-summary.mjs +78 -155
  123. package/harness/bundles/java/codebuddy/harness-codebase-map/SKILL.md +4 -2
  124. package/harness/bundles/java/codebuddy/harness-knowledge-ingest/SKILL.md +5 -3
  125. package/harness/bundles/java/codebuddy/harness-knowledge-ingest/scripts/harness_knowledge.py +83 -6
  126. package/harness/bundles/java/codebuddy/harness-knowledge-query/SKILL.md +4 -2
  127. package/harness/bundles/java/codebuddy/harness-package/SKILL.md +5 -2
  128. package/harness/bundles/java/codebuddy/harness-plan/SKILL.md +6 -3
  129. package/harness/bundles/java/codebuddy/harness-review/SKILL.md +6 -3
  130. package/harness/bundles/java/codebuddy/harness-run/SKILL.md +5 -2
  131. package/harness/bundles/java/codebuddy/harness-run/reference.md +1 -1
  132. package/harness/bundles/java/codebuddy/harness-submit/SKILL.md +5 -2
  133. package/harness/bundles/java/codebuddy/harness-sync/SKILL.md +5 -3
  134. package/harness/bundles/java/codebuddy/harness-test/SKILL.md +5 -2
  135. package/harness/bundles/java/codebuddy/harness-test/reference.md +1 -1
  136. package/harness/bundles/java/codebuddy/protocols/ledger-protocol.md +1 -1
  137. package/harness/bundles/java/codebuddy/protocols/report-pipeline-protocol.md +11 -4
  138. package/harness/bundles/java/codebuddy/scripts/harness_archive.py +190 -32
  139. package/harness/bundles/java/codebuddy/scripts/harness_events.py +134 -40
  140. package/harness/bundles/java/codebuddy/scripts/harness_preflight.py +46 -3
  141. package/harness/bundles/java/codebuddy/scripts/harness_profile.py +2 -2
  142. package/harness/bundles/java/codebuddy/scripts/harness_state.py +148 -0
  143. package/harness/bundles/java/codex/.harness-build.json +1 -1
  144. package/harness/bundles/java/codex/harness-apidoc/SKILL.md +5 -2
  145. package/harness/bundles/java/codex/harness-archive/SKILL.md +5 -2
  146. package/harness/bundles/java/codex/harness-archive/reference.md +1 -1
  147. package/harness/bundles/java/codex/harness-archive/templates/render-summary.mjs +78 -155
  148. package/harness/bundles/java/codex/harness-codebase-map/SKILL.md +4 -2
  149. package/harness/bundles/java/codex/harness-knowledge-ingest/SKILL.md +5 -3
  150. package/harness/bundles/java/codex/harness-knowledge-ingest/scripts/harness_knowledge.py +83 -6
  151. package/harness/bundles/java/codex/harness-knowledge-query/SKILL.md +4 -2
  152. package/harness/bundles/java/codex/harness-package/SKILL.md +5 -2
  153. package/harness/bundles/java/codex/harness-plan/SKILL.md +6 -3
  154. package/harness/bundles/java/codex/harness-review/SKILL.md +5 -2
  155. package/harness/bundles/java/codex/harness-run/SKILL.md +5 -2
  156. package/harness/bundles/java/codex/harness-run/reference.md +1 -1
  157. package/harness/bundles/java/codex/harness-submit/SKILL.md +5 -2
  158. package/harness/bundles/java/codex/harness-sync/SKILL.md +5 -3
  159. package/harness/bundles/java/codex/harness-test/SKILL.md +5 -2
  160. package/harness/bundles/java/codex/harness-test/reference.md +1 -1
  161. package/harness/bundles/java/codex/protocols/ledger-protocol.md +1 -1
  162. package/harness/bundles/java/codex/protocols/report-pipeline-protocol.md +11 -4
  163. package/harness/bundles/java/codex/scripts/harness_archive.py +190 -32
  164. package/harness/bundles/java/codex/scripts/harness_events.py +134 -40
  165. package/harness/bundles/java/codex/scripts/harness_preflight.py +46 -3
  166. package/harness/bundles/java/codex/scripts/harness_profile.py +2 -2
  167. package/harness/bundles/java/codex/scripts/harness_state.py +148 -0
  168. package/harness/bundles/java/cursor/.harness-build.json +1 -1
  169. package/harness/bundles/java/cursor/harness-apidoc/SKILL.md +5 -2
  170. package/harness/bundles/java/cursor/harness-archive/SKILL.md +5 -2
  171. package/harness/bundles/java/cursor/harness-archive/reference.md +1 -1
  172. package/harness/bundles/java/cursor/harness-archive/templates/render-summary.mjs +78 -155
  173. package/harness/bundles/java/cursor/harness-codebase-map/SKILL.md +4 -2
  174. package/harness/bundles/java/cursor/harness-knowledge-ingest/SKILL.md +5 -3
  175. package/harness/bundles/java/cursor/harness-knowledge-ingest/scripts/harness_knowledge.py +83 -6
  176. package/harness/bundles/java/cursor/harness-knowledge-query/SKILL.md +4 -2
  177. package/harness/bundles/java/cursor/harness-package/SKILL.md +5 -2
  178. package/harness/bundles/java/cursor/harness-plan/SKILL.md +6 -3
  179. package/harness/bundles/java/cursor/harness-review/SKILL.md +5 -2
  180. package/harness/bundles/java/cursor/harness-run/SKILL.md +5 -2
  181. package/harness/bundles/java/cursor/harness-run/reference.md +1 -1
  182. package/harness/bundles/java/cursor/harness-submit/SKILL.md +5 -2
  183. package/harness/bundles/java/cursor/harness-sync/SKILL.md +5 -3
  184. package/harness/bundles/java/cursor/harness-test/SKILL.md +5 -2
  185. package/harness/bundles/java/cursor/harness-test/reference.md +1 -1
  186. package/harness/bundles/java/cursor/protocols/ledger-protocol.md +1 -1
  187. package/harness/bundles/java/cursor/protocols/report-pipeline-protocol.md +11 -4
  188. package/harness/bundles/java/cursor/scripts/harness_archive.py +190 -32
  189. package/harness/bundles/java/cursor/scripts/harness_events.py +134 -40
  190. package/harness/bundles/java/cursor/scripts/harness_preflight.py +46 -3
  191. package/harness/bundles/java/cursor/scripts/harness_profile.py +2 -2
  192. package/harness/bundles/java/cursor/scripts/harness_state.py +148 -0
  193. package/harness/manifests/general/claude-code.json +24 -24
  194. package/harness/manifests/general/codebuddy.json +24 -24
  195. package/harness/manifests/general/codex.json +24 -24
  196. package/harness/manifests/general/cursor.json +24 -24
  197. package/harness/manifests/java/claude-code.json +26 -26
  198. package/harness/manifests/java/codebuddy.json +26 -26
  199. package/harness/manifests/java/codex.json +26 -26
  200. package/harness/manifests/java/cursor.json +26 -26
  201. package/hunter-workflow-family.json +1 -1
  202. package/package.json +1 -1
@@ -20,7 +20,7 @@ disallowed-tools:
20
20
  - Bash(awk *)
21
21
  - Bash(curl *)
22
22
  ---
23
- <!-- generated by harness_deploy.py; core=5cadfa54663ecdbf; overlay=none; agent=claude-code; do not edit -->
23
+ <!-- generated by harness_deploy.py; core=e29fb748896b6f88; overlay=none; agent=claude-code; do not edit -->
24
24
  # harness-plan — 需求规划
25
25
 
26
26
  ## Purpose
@@ -41,6 +41,7 @@ disallowed-tools:
41
41
  6. **implementation-detail** — 自适应执行参考;legacy 缺失 🟡WARN,不阻断
42
42
  7. **test-scenarios** — 测试真相源:`plans/<change>-test-scenarios.md`
43
43
  8. **禁止读取 `docs/superpowers/` 作为正式输入** — 旧草稿仅人工线索
44
+ 9. **每个 skill 边界只刷新一次状态快照** — 先运行 `python <skills-root>/scripts/harness_state.py capture --project . --change-dir ".harness/changes/<change-name>" --base <baseCommit> --json`;`changedSegments=[]` 时复用已有 profile/rules/map/knowledge/change/code 指纹,不再重复跑全量 `harness-sync`、知识重建或代码库扫描。只有对应 segment 变化或缺失时才定向刷新;快照不能替代源码读取和验证门禁。
44
45
 
45
46
  状态目录分层:新路径优先,旧路径兼容 → [[../protocols/state-layout-protocol.md|state-layout-protocol]]
46
47
 
@@ -66,7 +67,7 @@ disallowed-tools:
66
67
 
67
68
  ## Subagent 委派
68
69
 
69
- - **阶段 3 探索**:先运行 `python <skills-root>/scripts/harness_preflight.py check-agents --skills-root <skills-root> --agent harness-explorer --json`;可用则委派,否则主会话探索;无效返回不 retry
70
+ - **阶段 3 探索**:先运行 `python <skills-root>/scripts/harness_preflight.py check-agents --skills-root <skills-root> --agent harness-explorer --json`;可用则委派,否则主会话探索且不 retry。`reasonCode=CUSTOM_AGENTS_UNSUPPORTED` 表示当前工具本身没有自定义 agent 能力,是正常的 inline 路径,控制台不得显示“harness-explorer subagent 不可用”类告警。
70
71
  - **阶段 7.5**:仅 `--adversarial`;先运行 `python <skills-root>/scripts/harness_preflight.py check-agents --skills-root <skills-root> --agent harness-evaluator --json`;可用才委派到 `reports/plan-review/`
71
72
 
72
73
  ## Workflow 概要
@@ -121,7 +122,7 @@ change-name 范围变更 → 提示重命名或记 🟡WARN(→ `reference.md`
121
122
 
122
123
  ## 执行日志
123
124
 
124
- `events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
125
+ `events.ndjson` 为唯一事实源(schema_version 3,兼容读取 v1/v2;`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
125
126
 
126
127
  ```powershell
127
128
  python <skills-root>/scripts/harness_events.py append --change-dir ".harness/changes/<change-name>" --phase <phase> --type phase.start --note "<触发指令>"
@@ -130,3 +131,5 @@ python <skills-root>/scripts/harness_events.py append --change-dir ".harness/cha
130
131
  > **脚本接线**:`harness_events.py append`;`harness_archive.py finalize`;`harness_preflight.py check`;`harness_ledger.py can-reuse`;`harness_service.py ensure/stop`(须 `--files`/`serviceStart.inputFiles`)。JSON 输出按 D13 护栏解读。
131
132
 
132
133
  > **Task 4 §6.1 写入契约**:普通 `append` = 加锁 -> 追加一行 -> fsync -> 解锁,**不 load 历史、不渲染**(O(1),跨进程锁 `events.ndjson.lock`,UUID 用完整 `uuid4().hex` 无需去重扫描)。仅 `--type phase.end` append 在追加成功后渲染一次 `execution-log.md`;显式 `harness_events.py render` 随时从完整 events 重建;`harness_archive.py finalize` 在 collect 前强制 render 一次。高频 command append 期间 log 可能滞后,phase 边界保持最新。
134
+
135
+ 每次阶段结束必须写 `--status OK|WARN|FAIL|BLOCKED`;重试同一阶段时增加 `--attempt <n>`,不得覆盖或伪装成一次执行。跨工具继续执行时写 `--executor-tool <codex|claude-code|codebuddy|cursor>`,并在接棒事件写 `--handoff-from-tool` / `--handoff-reason`;也可由 `HUNTER_HARNESS_TOOL/AGENT/MODEL/RUN_ID` 环境变量统一注入。
@@ -21,7 +21,7 @@ disallowed-tools:
21
21
  - Bash(curl *)
22
22
  - Bash(codegraph *)
23
23
  ---
24
- <!-- generated by harness_deploy.py; core=5cadfa54663ecdbf; overlay=none; agent=claude-code; do not edit -->
24
+ <!-- generated by harness_deploy.py; core=e29fb748896b6f88; overlay=none; agent=claude-code; do not edit -->
25
25
  # harness-review — 代码审查
26
26
 
27
27
  ## Purpose
@@ -57,6 +57,7 @@ disallowed-tools:
57
57
  6. **implementation-detail** — 自适应执行参考;legacy 缺失 🟡WARN,不阻断
58
58
  7. **test-scenarios** — 测试真相源:`plans/<change>-test-scenarios.md`
59
59
  8. **禁止读取 `docs/superpowers/` 作为正式输入** — 旧草稿仅人工线索
60
+ 9. **每个 skill 边界只刷新一次状态快照** — 先运行 `python <skills-root>/scripts/harness_state.py capture --project . --change-dir ".harness/changes/<change-name>" --base <baseCommit> --json`;`changedSegments=[]` 时复用已有 profile/rules/map/knowledge/change/code 指纹,不再重复跑全量 `harness-sync`、知识重建或代码库扫描。只有对应 segment 变化或缺失时才定向刷新;快照不能替代源码读取和验证门禁。
60
61
 
61
62
  状态目录分层:新路径优先,旧路径兼容 → [[../protocols/state-layout-protocol.md|state-layout-protocol]]
62
63
 
@@ -67,7 +68,7 @@ disallowed-tools:
67
68
  <!-- @section-id review.delegate -->
68
69
  ### 2. 委派 harness-reviewer
69
70
 
70
- 先运行 `python <skills-root>/scripts/harness_preflight.py check-agents --skills-root <skills-root> --agent harness-reviewer --json`。`usable=false` → **直接主会话审查**,记 `decision` 事件,**不委派**。`usable=true` 时用 Agent spawn `harness-reviewer`(只读, 6 维度)。返回空 / 无报告正文 → **不 retry**,降级主会话审查。
71
+ 先运行 `python <skills-root>/scripts/harness_preflight.py check-agents --skills-root <skills-root> --agent harness-reviewer --json`。`usable=false` → **直接主会话审查**,记 `decision` 事件,**不委派**。`reasonCode=CUSTOM_AGENTS_UNSUPPORTED` 是当前工具没有自定义 agent 能力的正常 inline 路径,不显示缺失告警。`usable=true` 时用 Agent spawn `harness-reviewer`(只读, 6 维度)。返回空 / 无报告正文 → **不 retry**,降级主会话审查。
71
72
 
72
73
  3. **持久化报告(强制,主会话)** — Agent 返回后主会话 Write 到 `reports/review/review-report-*.md`。未 Write → 🟡WARN,不得宣称 review 完成。
73
74
  4. **生成修复反馈(原生协议)** — 若报告存在 RED/YELLOW 问题,执行 `protocols.md` 的 `review-fixback-protocol`,将问题转化为结构化 fixback 清单并落盘到 `.harness/changes/<change-name>/reports/review/fixback-YYYYMMDD-HHmm.md`。若无 RED/YELLOW,记录 `review-fixback-protocol: skipped(no findings)`。不调用 Superpowers `receiving-code-review`,也不记录外部 skill 降级。
@@ -153,7 +154,7 @@ review 读取 `state-snapshot.json`(`harness_state.py` / state-layout-protocol
153
154
 
154
155
  ## 执行日志
155
156
 
156
- `events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
157
+ `events.ndjson` 为唯一事实源(schema_version 3,兼容读取 v1/v2;`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
157
158
 
158
159
  ```powershell
159
160
  python <skills-root>/scripts/harness_events.py append --change-dir ".harness/changes/<change-name>" --phase <phase> --type phase.start --note "<触发指令>"
@@ -162,3 +163,5 @@ python <skills-root>/scripts/harness_events.py append --change-dir ".harness/cha
162
163
  > **脚本接线**:`harness_events.py append`;`harness_archive.py finalize`;`harness_preflight.py check`;`harness_ledger.py can-reuse`;`harness_service.py ensure/stop`(须 `--files`/`serviceStart.inputFiles`)。JSON 输出按 D13 护栏解读。
163
164
 
164
165
  > **Task 4 §6.1 写入契约**:普通 `append` = 加锁 -> 追加一行 -> fsync -> 解锁,**不 load 历史、不渲染**(O(1),跨进程锁 `events.ndjson.lock`,UUID 用完整 `uuid4().hex` 无需去重扫描)。仅 `--type phase.end` append 在追加成功后渲染一次 `execution-log.md`;显式 `harness_events.py render` 随时从完整 events 重建;`harness_archive.py finalize` 在 collect 前强制 render 一次。高频 command append 期间 log 可能滞后,phase 边界保持最新。
166
+
167
+ 每次阶段结束必须写 `--status OK|WARN|FAIL|BLOCKED`;重试同一阶段时增加 `--attempt <n>`,不得覆盖或伪装成一次执行。跨工具继续执行时写 `--executor-tool <codex|claude-code|codebuddy|cursor>`,并在接棒事件写 `--handoff-from-tool` / `--handoff-reason`;也可由 `HUNTER_HARNESS_TOOL/AGENT/MODEL/RUN_ID` 环境变量统一注入。
@@ -21,7 +21,7 @@ disallowed-tools:
21
21
  - Bash(curl *)
22
22
  - Bash(codegraph *)
23
23
  ---
24
- <!-- generated by harness_deploy.py; core=5cadfa54663ecdbf; overlay=none; agent=claude-code; do not edit -->
24
+ <!-- generated by harness_deploy.py; core=e29fb748896b6f88; overlay=none; agent=claude-code; do not edit -->
25
25
  # harness-run — 需求编码
26
26
 
27
27
  ## Purpose
@@ -63,6 +63,7 @@ disallowed-tools:
63
63
  6. **implementation-detail** — 自适应执行参考;legacy 缺失 🟡WARN,不阻断
64
64
  7. **test-scenarios** — 测试真相源:`plans/<change>-test-scenarios.md`
65
65
  8. **禁止读取 `docs/superpowers/` 作为正式输入** — 旧草稿仅人工线索
66
+ 9. **每个 skill 边界只刷新一次状态快照** — 先运行 `python <skills-root>/scripts/harness_state.py capture --project . --change-dir ".harness/changes/<change-name>" --base <baseCommit> --json`;`changedSegments=[]` 时复用已有 profile/rules/map/knowledge/change/code 指纹,不再重复跑全量 `harness-sync`、知识重建或代码库扫描。只有对应 segment 变化或缺失时才定向刷新;快照不能替代源码读取和验证门禁。
66
67
 
67
68
  状态目录分层:新路径优先,旧路径兼容 → [[../protocols/state-layout-protocol.md|state-layout-protocol]]
68
69
 
@@ -133,7 +134,7 @@ python <skills-root>/scripts/harness_test_guard.py record --project . --change-d
133
134
 
134
135
  ## 执行日志
135
136
 
136
- `events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
137
+ `events.ndjson` 为唯一事实源(schema_version 3,兼容读取 v1/v2;`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
137
138
 
138
139
  ```powershell
139
140
  python <skills-root>/scripts/harness_events.py append --change-dir ".harness/changes/<change-name>" --phase <phase> --type phase.start --note "<触发指令>"
@@ -142,3 +143,5 @@ python <skills-root>/scripts/harness_events.py append --change-dir ".harness/cha
142
143
  > **脚本接线**:`harness_events.py append`;`harness_archive.py finalize`;`harness_preflight.py check`;`harness_ledger.py can-reuse`;`harness_service.py ensure/stop`(须 `--files`/`serviceStart.inputFiles`)。JSON 输出按 D13 护栏解读。
143
144
 
144
145
  > **Task 4 §6.1 写入契约**:普通 `append` = 加锁 -> 追加一行 -> fsync -> 解锁,**不 load 历史、不渲染**(O(1),跨进程锁 `events.ndjson.lock`,UUID 用完整 `uuid4().hex` 无需去重扫描)。仅 `--type phase.end` append 在追加成功后渲染一次 `execution-log.md`;显式 `harness_events.py render` 随时从完整 events 重建;`harness_archive.py finalize` 在 collect 前强制 render 一次。高频 command append 期间 log 可能滞后,phase 边界保持最新。
146
+
147
+ 每次阶段结束必须写 `--status OK|WARN|FAIL|BLOCKED`;重试同一阶段时增加 `--attempt <n>`,不得覆盖或伪装成一次执行。跨工具继续执行时写 `--executor-tool <codex|claude-code|codebuddy|cursor>`,并在接棒事件写 `--handoff-from-tool` / `--handoff-reason`;也可由 `HUNTER_HARNESS_TOOL/AGENT/MODEL/RUN_ID` 环境变量统一注入。
@@ -799,7 +799,7 @@ powershell.exe -Command "git -C '<project-path>' diff --check"
799
799
 
800
800
  ## 执行日志记录
801
801
 
802
- `/harness-run` 只向 `events.ndjson` 追加事件(schema_version 2);`logs/execution-log.md` 由 `harness_events.py append` 自动渲染。步骤 0 之前 append `phase.start`;各阶段写入 `command` / `verification` / `decision` / `issue`,人类可读摘要放 `note`。事件类型与脚本用法见 [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]] 与 SKILL.md `## 执行日志`。
802
+ `/harness-run` 只向 `events.ndjson` 追加事件(schema_version 3,兼容读取 v1/v2);`logs/execution-log.md` 由 `harness_events.py append` 自动渲染。步骤 0 之前 append `phase.start`;各阶段写入 `command` / `verification` / `decision` / `issue`,人类可读摘要放 `note`。事件类型与脚本用法见 [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]] 与 SKILL.md `## 执行日志`。
803
803
 
804
804
  关键 `note` / `decision` 须覆盖:测试基础设施探测(CHECKING→结论)、预存变更、run-tdd-protocol RED 类型、变更簇 RED/GREEN、批量构建 exit code、关门检查 10 项、计划状态持久化路径。
805
805
 
@@ -20,7 +20,7 @@ disallowed-tools:
20
20
  - Bash(awk *)
21
21
  - Bash(curl *)
22
22
  ---
23
- <!-- generated by harness_deploy.py; core=5cadfa54663ecdbf; overlay=none; agent=claude-code; do not edit -->
23
+ <!-- generated by harness_deploy.py; core=e29fb748896b6f88; overlay=none; agent=claude-code; do not edit -->
24
24
  # harness-submit — 最终提交(含 worktree 合并)
25
25
 
26
26
  ## Purpose
@@ -57,6 +57,7 @@ disallowed-tools:
57
57
  6. **implementation-detail** — 自适应执行参考;legacy 缺失 🟡WARN,不阻断
58
58
  7. **test-scenarios** — 测试真相源:`plans/<change>-test-scenarios.md`
59
59
  8. **禁止读取 `docs/superpowers/` 作为正式输入** — 旧草稿仅人工线索
60
+ 9. **每个 skill 边界只刷新一次状态快照** — 先运行 `python <skills-root>/scripts/harness_state.py capture --project . --change-dir ".harness/changes/<change-name>" --base <baseCommit> --json`;`changedSegments=[]` 时复用已有 profile/rules/map/knowledge/change/code 指纹,不再重复跑全量 `harness-sync`、知识重建或代码库扫描。只有对应 segment 变化或缺失时才定向刷新;快照不能替代源码读取和验证门禁。
60
61
 
61
62
  状态目录分层:新路径优先,旧路径兼容 → [[../protocols/state-layout-protocol.md|state-layout-protocol]]
62
63
 
@@ -150,7 +151,7 @@ git 经 PowerShell;commit/报告不得含明文密钥。遵循 `../protocols/s
150
151
 
151
152
  ## 执行日志
152
153
 
153
- `events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
154
+ `events.ndjson` 为唯一事实源(schema_version 3,兼容读取 v1/v2;`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
154
155
 
155
156
  ```powershell
156
157
  python <skills-root>/scripts/harness_events.py append --change-dir ".harness/changes/<change-name>" --phase <phase> --type phase.start --note "<触发指令>"
@@ -159,3 +160,5 @@ python <skills-root>/scripts/harness_events.py append --change-dir ".harness/cha
159
160
  > **脚本接线**:`harness_events.py append`;`harness_archive.py finalize`;`harness_preflight.py check`;`harness_ledger.py can-reuse`;`harness_service.py ensure/stop`(须 `--files`/`serviceStart.inputFiles`)。JSON 输出按 D13 护栏解读。
160
161
 
161
162
  > **Task 4 §6.1 写入契约**:普通 `append` = 加锁 -> 追加一行 -> fsync -> 解锁,**不 load 历史、不渲染**(O(1),跨进程锁 `events.ndjson.lock`,UUID 用完整 `uuid4().hex` 无需去重扫描)。仅 `--type phase.end` append 在追加成功后渲染一次 `execution-log.md`;显式 `harness_events.py render` 随时从完整 events 重建;`harness_archive.py finalize` 在 collect 前强制 render 一次。高频 command append 期间 log 可能滞后,phase 边界保持最新。
163
+
164
+ 每次阶段结束必须写 `--status OK|WARN|FAIL|BLOCKED`;重试同一阶段时增加 `--attempt <n>`,不得覆盖或伪装成一次执行。跨工具继续执行时写 `--executor-tool <codex|claude-code|codebuddy|cursor>`,并在接棒事件写 `--handoff-from-tool` / `--handoff-reason`;也可由 `HUNTER_HARNESS_TOOL/AGENT/MODEL/RUN_ID` 环境变量统一注入。
@@ -19,7 +19,7 @@ disallowed-tools:
19
19
  - Bash(awk *)
20
20
  - Bash(curl *)
21
21
  ---
22
- <!-- generated by harness_deploy.py; core=5cadfa54663ecdbf; overlay=none; agent=claude-code; do not edit -->
22
+ <!-- generated by harness_deploy.py; core=e29fb748896b6f88; overlay=none; agent=claude-code; do not edit -->
23
23
  # harness-sync — 元数据同步
24
24
 
25
25
  ## Purpose
@@ -39,7 +39,7 @@ disallowed-tools:
39
39
  | 2 | CodeGraph 索引是否需重建 |
40
40
  | 3 | `.harness/codebase/map/` 是否过期 → 报告建议 `/harness-codebase-map` |
41
41
  | 3.5 | `harness_knowledge.py sync`;可 `sync --update`;失败不得假装可用。**知识闭环主入口**是 `/harness-knowledge-ingest auto`(含 Agent judge),sync 不重复列人工知识待办 |
42
- | 3.6 | 扫描 `.harness/knowledge/maintenance-outbox/{pending,failed}`;对每项运行 `harness_knowledge.py maintain --project . --archive-id <id> --json`(§8.2:archive close 只 enqueue,sync 异步推进 outbox 到 completed/completed_rules_pending_judge) |
42
+ | 3.6 | 单次运行 `harness_knowledge.py maintain --project . --drain --json`,有界推进全部 `.harness/knowledge/maintenance-outbox/{pending,failed}`;不得为每个条目重复启动 Python/重建索引(§8.2:archive close 只 enqueue,sync 异步推进 outbox 到 completed/pending-judge) |
43
43
  | 4 | CLAUDE.md 完整性/行数 → 超限 AskUserQuestion 瘦身 |
44
44
  | 5 | AGENTS.md 与 CLAUDE.md 一致 |
45
45
  | 6 | `.harness/` 结构(init 规程 → `reference.md` 第 6 步);可选 `harness_deploy.py diff` 检查已装 skill 是否过期 |
@@ -71,7 +71,7 @@ disallowed-tools:
71
71
 
72
72
  ## 执行日志
73
73
 
74
- `events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
74
+ `events.ndjson` 为唯一事实源(schema_version 3,兼容读取 v1/v2;`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
75
75
 
76
76
  ```powershell
77
77
  python <skills-root>/scripts/harness_events.py append --change-dir ".harness/changes/<change-name>" --phase <phase> --type phase.start --note "<触发指令>"
@@ -80,3 +80,5 @@ python <skills-root>/scripts/harness_events.py append --change-dir ".harness/cha
80
80
  > **脚本接线**:`harness_events.py append`;`harness_archive.py finalize`;`harness_preflight.py check`;`harness_ledger.py can-reuse`;`harness_service.py ensure/stop`(须 `--files`/`serviceStart.inputFiles`)。JSON 输出按 D13 护栏解读。
81
81
 
82
82
  > **Task 4 §6.1 写入契约**:普通 `append` = 加锁 -> 追加一行 -> fsync -> 解锁,**不 load 历史、不渲染**(O(1),跨进程锁 `events.ndjson.lock`,UUID 用完整 `uuid4().hex` 无需去重扫描)。仅 `--type phase.end` append 在追加成功后渲染一次 `execution-log.md`;显式 `harness_events.py render` 随时从完整 events 重建;`harness_archive.py finalize` 在 collect 前强制 render 一次。高频 command append 期间 log 可能滞后,phase 边界保持最新。
83
+
84
+ 每次阶段结束必须写 `--status OK|WARN|FAIL|BLOCKED`;重试同一阶段时增加 `--attempt <n>`,不得覆盖或伪装成一次执行。跨工具继续执行时写 `--executor-tool <codex|claude-code|codebuddy|cursor>`,并在接棒事件写 `--handoff-from-tool` / `--handoff-reason`;也可由 `HUNTER_HARNESS_TOOL/AGENT/MODEL/RUN_ID` 环境变量统一注入。
@@ -22,7 +22,7 @@ disallowed-tools:
22
22
  - Bash(node *)
23
23
  - Bash(codegraph *)
24
24
  ---
25
- <!-- generated by harness_deploy.py; core=5cadfa54663ecdbf; overlay=none; agent=claude-code; do not edit -->
25
+ <!-- generated by harness_deploy.py; core=e29fb748896b6f88; overlay=none; agent=claude-code; do not edit -->
26
26
  # harness-test — 测试执行
27
27
 
28
28
  ## Purpose
@@ -56,6 +56,7 @@ disallowed-tools:
56
56
  6. **implementation-detail** — 自适应执行参考;legacy 缺失 🟡WARN,不阻断
57
57
  7. **test-scenarios** — 测试真相源:`plans/<change>-test-scenarios.md`
58
58
  8. **禁止读取 `docs/superpowers/` 作为正式输入** — 旧草稿仅人工线索
59
+ 9. **每个 skill 边界只刷新一次状态快照** — 先运行 `python <skills-root>/scripts/harness_state.py capture --project . --change-dir ".harness/changes/<change-name>" --base <baseCommit> --json`;`changedSegments=[]` 时复用已有 profile/rules/map/knowledge/change/code 指纹,不再重复跑全量 `harness-sync`、知识重建或代码库扫描。只有对应 segment 变化或缺失时才定向刷新;快照不能替代源码读取和验证门禁。
59
60
 
60
61
  状态目录分层:新路径优先,旧路径兼容 → [[../protocols/state-layout-protocol.md|state-layout-protocol]]
61
62
 
@@ -181,7 +182,7 @@ python <skills-root>/scripts/harness_test_guard.py record --project . --change-d
181
182
 
182
183
  ## 执行日志
183
184
 
184
- `events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
185
+ `events.ndjson` 为唯一事实源(schema_version 3,兼容读取 v1/v2;`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
185
186
 
186
187
  ```powershell
187
188
  python <skills-root>/scripts/harness_events.py append --change-dir ".harness/changes/<change-name>" --phase <phase> --type phase.start --note "<触发指令>"
@@ -190,3 +191,5 @@ python <skills-root>/scripts/harness_events.py append --change-dir ".harness/cha
190
191
  > **脚本接线**:`harness_events.py append`;`harness_archive.py finalize`;`harness_preflight.py check`;`harness_ledger.py can-reuse`;`harness_service.py ensure/stop`(须 `--files`/`serviceStart.inputFiles`)。JSON 输出按 D13 护栏解读。
191
192
 
192
193
  > **Task 4 §6.1 写入契约**:普通 `append` = 加锁 -> 追加一行 -> fsync -> 解锁,**不 load 历史、不渲染**(O(1),跨进程锁 `events.ndjson.lock`,UUID 用完整 `uuid4().hex` 无需去重扫描)。仅 `--type phase.end` append 在追加成功后渲染一次 `execution-log.md`;显式 `harness_events.py render` 随时从完整 events 重建;`harness_archive.py finalize` 在 collect 前强制 render 一次。高频 command append 期间 log 可能滞后,phase 边界保持最新。
194
+
195
+ 每次阶段结束必须写 `--status OK|WARN|FAIL|BLOCKED`;重试同一阶段时增加 `--attempt <n>`,不得覆盖或伪装成一次执行。跨工具继续执行时写 `--executor-tool <codex|claude-code|codebuddy|cursor>`,并在接棒事件写 `--handoff-from-tool` / `--handoff-reason`;也可由 `HUNTER_HARNESS_TOOL/AGENT/MODEL/RUN_ID` 环境变量统一注入。
@@ -786,6 +786,6 @@ python <skills-root>/scripts/harness_ledger.py diff-hash --repo . --base <baseCo
786
786
 
787
787
  ## 执行日志记录
788
788
 
789
- `/harness-test` 只向 `events.ndjson` 追加事件(schema_version 2);`logs/execution-log.md` 由 `harness_events.py append` 自动渲染。Phase 0 之前 append `phase.start`;各阶段写入 `command` / `verification` / `decision` / `issue` / `artifact`,人类可读摘要放 `note`。事件类型与脚本用法见 [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]] 与 SKILL.md `## 执行日志`。
789
+ `/harness-test` 只向 `events.ndjson` 追加事件(schema_version 3,兼容读取 v1/v2);`logs/execution-log.md` 由 `harness_events.py append` 自动渲染。Phase 0 之前 append `phase.start`;各阶段写入 `command` / `verification` / `decision` / `issue` / `artifact`,人类可读摘要放 `note`。事件类型与脚本用法见 [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]] 与 SKILL.md `## 执行日志`。
790
790
 
791
791
  关键 `note` / 事件须覆盖:0.1 命令执行模式、fallback 执行器、serviceState、凭证策略、单元测试复用、批量执行器、verification-ledger 写入、关门检查、API 状态(不得把 PARTIAL 写成 NOT_RUN)。
@@ -86,7 +86,7 @@ verification-ledger 把每次验证(compile / unit test / api test / package
86
86
  },
87
87
  "package": {
88
88
  "status": "OK",
89
- "command": "<打包命令(按技术栈:Java=mvn package -pl <module> -am -DskipTests;前端=npm run build;Python=python -m build)>",
89
+ "command": "<打包命令(按技术栈:Java=mvn clean package -pl <module> -am -DskipTests;前端=npm run build;Python=python -m build)>",
90
90
  "baseCommit": "<final pushed hash>",
91
91
  "deployArtifact": "<构建产物路径(Java=<module>/target/<artifact>.jar;前端=<module>/dist/;Python=<module>/dist/)>",
92
92
  "sha256": "<artifact sha256>",
@@ -43,11 +43,11 @@ python <skills-root>/scripts/harness_events.py append --change-dir ".harness/cha
43
43
 
44
44
  `append` 写入契约(Task 4 §6.1):普通 append = 加锁 -> 追加一行 -> fsync -> 解锁,**不 load 历史、不渲染**(O(1),跨进程锁 `events.ndjson.lock`,UUID 用完整 `uuid4().hex`);仅 `--type phase.end` append 成功后渲染一次 `logs/execution-log.md`;显式 `harness_events.py render` 随时从完整 events 重建;`harness_archive.py finalize` 在 collect 前强制 render 一次。人类可读摘要(触发指令、降级原因、阶段结论)写入事件的 `note` 字段;阶段开始/结束、命令、验证、artifact、问题、决策各写对应 `type` 事件。旧 archive 缺少 events 可回放兼容;新变更不得以 execution-log 已存在为理由跳过 events。
45
45
 
46
- 基础事件结构(schema_version 2):
46
+ 基础事件结构(schema_version 3;兼容读取 v1/v2):
47
47
 
48
48
  ```json
49
49
  {
50
- "schema_version": 2,
50
+ "schema_version": 3,
51
51
  "id": "evt-...",
52
52
  "timestamp": "2026-07-02T00:00:00.000Z",
53
53
  "phase": "run",
@@ -55,6 +55,13 @@ python <skills-root>/scripts/harness_events.py append --change-dir ".harness/cha
55
55
  "command": "npm test",
56
56
  "exit_code": 0,
57
57
  "duration_ms": 42100,
58
+ "run_id": "run-...",
59
+ "attempt": 1,
60
+ "executor_tool": "codex",
61
+ "executor_agent": "main",
62
+ "executor_model": "gpt-5",
63
+ "handoff_from_tool": "claude-code",
64
+ "handoff_reason": "continue implementation",
58
65
  "note": "可选:触发指令、降级原因、阶段摘要"
59
66
  }
60
67
  ```
@@ -64,7 +71,7 @@ python <skills-root>/scripts/harness_events.py append --change-dir ".harness/cha
64
71
  | type | 必填/常用字段 | 用途 |
65
72
  |---|---|---|
66
73
  | `phase.start` | phase, timestamp | 阶段开始 |
67
- | `phase.end` | phase, timestamp | 阶段结束,计算耗时 |
74
+ | `phase.end` | phase, timestamp, status | 阶段结束并记录 `OK/WARN/FAIL/BLOCKED`;计算当前 attempt 耗时 |
68
75
  | `command` | command, exit_code, duration_ms | 命令事实 |
69
76
  | `verification` | name, status, command | 验证事实 |
70
77
  | `artifact` | path, kind | 报告、包、manifest 等产物 |
@@ -79,7 +86,7 @@ summary-data 必须保留原 archive final report 维度,并增加事件层摘
79
86
  {
80
87
  "schemaVersion": "2.2",
81
88
  "reportPipeline": {
82
- "schema_version": 2,
89
+ "schema_version": 1,
83
90
  "generated_at": "2026-07-02T00:00:00.000Z",
84
91
  "event_count": 0,
85
92
  "sources": ["events.ndjson", "evidence/verification-ledger.json"],