@hunter-harness/workflow-harness 0.2.7 → 0.2.9

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 (230) hide show
  1. package/harness/bundles/general/claude-code/.harness-build.json +1 -1
  2. package/harness/bundles/general/claude-code/contracts/workflow-policy.json +3 -3
  3. package/harness/bundles/general/claude-code/harness-archive/SKILL.md +3 -3
  4. package/harness/bundles/general/claude-code/harness-archive/reference.md +18 -10
  5. package/harness/bundles/general/claude-code/harness-archive/templates/render-summary.mjs +5 -1
  6. package/harness/bundles/general/claude-code/harness-codebase-map/SKILL.md +1 -1
  7. package/harness/bundles/general/claude-code/harness-knowledge-ingest/SKILL.md +1 -1
  8. package/harness/bundles/general/claude-code/harness-knowledge-query/SKILL.md +1 -1
  9. package/harness/bundles/general/claude-code/harness-plan/SKILL.md +1 -1
  10. package/harness/bundles/general/claude-code/harness-plan/checklist.md +6 -0
  11. package/harness/bundles/general/claude-code/harness-review/SKILL.md +1 -1
  12. package/harness/bundles/general/claude-code/harness-run/SKILL.md +1 -1
  13. package/harness/bundles/general/claude-code/harness-run/checklist.md +5 -0
  14. package/harness/bundles/general/claude-code/harness-run/reference.md +31 -1
  15. package/harness/bundles/general/claude-code/harness-submit/SKILL.md +1 -1
  16. package/harness/bundles/general/claude-code/harness-sync/SKILL.md +1 -1
  17. package/harness/bundles/general/claude-code/harness-test/SKILL.md +1 -1
  18. package/harness/bundles/general/claude-code/harness-test/checklist.md +9 -0
  19. package/harness/bundles/general/claude-code/harness-test/pitfalls-java.md +14 -0
  20. package/harness/bundles/general/claude-code/harness-test/reference.md +36 -0
  21. package/harness/bundles/general/claude-code/protocols/archive-report-protocol.md +3 -1
  22. package/harness/bundles/general/claude-code/protocols/ledger-protocol.md +2 -0
  23. package/harness/bundles/general/claude-code/protocols/powershell-protocol.md +16 -0
  24. package/harness/bundles/general/claude-code/protocols/report-pipeline-protocol.md +17 -0
  25. package/harness/bundles/general/claude-code/scripts/harness_archive.py +568 -58
  26. package/harness/bundles/general/claude-code/scripts/harness_change.py +20 -2
  27. package/harness/bundles/general/claude-code/scripts/harness_events.py +96 -19
  28. package/harness/bundles/general/claude-code/scripts/harness_gate.py +178 -25
  29. package/harness/bundles/general/claude-code/scripts/harness_ledger.py +17 -0
  30. package/harness/bundles/general/codebuddy/.harness-build.json +1 -1
  31. package/harness/bundles/general/codebuddy/contracts/workflow-policy.json +3 -3
  32. package/harness/bundles/general/codebuddy/harness-archive/SKILL.md +3 -3
  33. package/harness/bundles/general/codebuddy/harness-archive/reference.md +18 -10
  34. package/harness/bundles/general/codebuddy/harness-archive/templates/render-summary.mjs +5 -1
  35. package/harness/bundles/general/codebuddy/harness-codebase-map/SKILL.md +1 -1
  36. package/harness/bundles/general/codebuddy/harness-knowledge-ingest/SKILL.md +1 -1
  37. package/harness/bundles/general/codebuddy/harness-knowledge-query/SKILL.md +1 -1
  38. package/harness/bundles/general/codebuddy/harness-plan/SKILL.md +1 -1
  39. package/harness/bundles/general/codebuddy/harness-plan/checklist.md +6 -0
  40. package/harness/bundles/general/codebuddy/harness-review/SKILL.md +1 -1
  41. package/harness/bundles/general/codebuddy/harness-run/SKILL.md +1 -1
  42. package/harness/bundles/general/codebuddy/harness-run/checklist.md +5 -0
  43. package/harness/bundles/general/codebuddy/harness-run/reference.md +31 -1
  44. package/harness/bundles/general/codebuddy/harness-submit/SKILL.md +1 -1
  45. package/harness/bundles/general/codebuddy/harness-sync/SKILL.md +1 -1
  46. package/harness/bundles/general/codebuddy/harness-test/SKILL.md +1 -1
  47. package/harness/bundles/general/codebuddy/harness-test/checklist.md +9 -0
  48. package/harness/bundles/general/codebuddy/harness-test/pitfalls-java.md +14 -0
  49. package/harness/bundles/general/codebuddy/harness-test/reference.md +36 -0
  50. package/harness/bundles/general/codebuddy/protocols/archive-report-protocol.md +3 -1
  51. package/harness/bundles/general/codebuddy/protocols/ledger-protocol.md +2 -0
  52. package/harness/bundles/general/codebuddy/protocols/powershell-protocol.md +16 -0
  53. package/harness/bundles/general/codebuddy/protocols/report-pipeline-protocol.md +17 -0
  54. package/harness/bundles/general/codebuddy/scripts/harness_archive.py +568 -58
  55. package/harness/bundles/general/codebuddy/scripts/harness_change.py +20 -2
  56. package/harness/bundles/general/codebuddy/scripts/harness_events.py +96 -19
  57. package/harness/bundles/general/codebuddy/scripts/harness_gate.py +178 -25
  58. package/harness/bundles/general/codebuddy/scripts/harness_ledger.py +17 -0
  59. package/harness/bundles/general/codex/.harness-build.json +1 -1
  60. package/harness/bundles/general/codex/contracts/workflow-policy.json +3 -3
  61. package/harness/bundles/general/codex/harness-archive/SKILL.md +3 -3
  62. package/harness/bundles/general/codex/harness-archive/reference.md +18 -10
  63. package/harness/bundles/general/codex/harness-archive/templates/render-summary.mjs +5 -1
  64. package/harness/bundles/general/codex/harness-codebase-map/SKILL.md +1 -1
  65. package/harness/bundles/general/codex/harness-knowledge-ingest/SKILL.md +1 -1
  66. package/harness/bundles/general/codex/harness-knowledge-query/SKILL.md +1 -1
  67. package/harness/bundles/general/codex/harness-plan/SKILL.md +1 -1
  68. package/harness/bundles/general/codex/harness-plan/checklist.md +6 -0
  69. package/harness/bundles/general/codex/harness-review/SKILL.md +1 -1
  70. package/harness/bundles/general/codex/harness-run/SKILL.md +1 -1
  71. package/harness/bundles/general/codex/harness-run/checklist.md +5 -0
  72. package/harness/bundles/general/codex/harness-run/reference.md +31 -1
  73. package/harness/bundles/general/codex/harness-submit/SKILL.md +1 -1
  74. package/harness/bundles/general/codex/harness-sync/SKILL.md +1 -1
  75. package/harness/bundles/general/codex/harness-test/SKILL.md +1 -1
  76. package/harness/bundles/general/codex/harness-test/checklist.md +9 -0
  77. package/harness/bundles/general/codex/harness-test/pitfalls-java.md +14 -0
  78. package/harness/bundles/general/codex/harness-test/reference.md +36 -0
  79. package/harness/bundles/general/codex/protocols/archive-report-protocol.md +3 -1
  80. package/harness/bundles/general/codex/protocols/ledger-protocol.md +2 -0
  81. package/harness/bundles/general/codex/protocols/powershell-protocol.md +16 -0
  82. package/harness/bundles/general/codex/protocols/report-pipeline-protocol.md +17 -0
  83. package/harness/bundles/general/codex/scripts/harness_archive.py +568 -58
  84. package/harness/bundles/general/codex/scripts/harness_change.py +20 -2
  85. package/harness/bundles/general/codex/scripts/harness_events.py +96 -19
  86. package/harness/bundles/general/codex/scripts/harness_gate.py +178 -25
  87. package/harness/bundles/general/codex/scripts/harness_ledger.py +17 -0
  88. package/harness/bundles/general/cursor/.harness-build.json +1 -1
  89. package/harness/bundles/general/cursor/contracts/workflow-policy.json +3 -3
  90. package/harness/bundles/general/cursor/harness-archive/SKILL.md +3 -3
  91. package/harness/bundles/general/cursor/harness-archive/reference.md +18 -10
  92. package/harness/bundles/general/cursor/harness-archive/templates/render-summary.mjs +5 -1
  93. package/harness/bundles/general/cursor/harness-codebase-map/SKILL.md +1 -1
  94. package/harness/bundles/general/cursor/harness-knowledge-ingest/SKILL.md +1 -1
  95. package/harness/bundles/general/cursor/harness-knowledge-query/SKILL.md +1 -1
  96. package/harness/bundles/general/cursor/harness-plan/SKILL.md +1 -1
  97. package/harness/bundles/general/cursor/harness-plan/checklist.md +6 -0
  98. package/harness/bundles/general/cursor/harness-review/SKILL.md +1 -1
  99. package/harness/bundles/general/cursor/harness-run/SKILL.md +1 -1
  100. package/harness/bundles/general/cursor/harness-run/checklist.md +5 -0
  101. package/harness/bundles/general/cursor/harness-run/reference.md +31 -1
  102. package/harness/bundles/general/cursor/harness-submit/SKILL.md +1 -1
  103. package/harness/bundles/general/cursor/harness-sync/SKILL.md +1 -1
  104. package/harness/bundles/general/cursor/harness-test/SKILL.md +1 -1
  105. package/harness/bundles/general/cursor/harness-test/checklist.md +9 -0
  106. package/harness/bundles/general/cursor/harness-test/pitfalls-java.md +14 -0
  107. package/harness/bundles/general/cursor/harness-test/reference.md +36 -0
  108. package/harness/bundles/general/cursor/protocols/archive-report-protocol.md +3 -1
  109. package/harness/bundles/general/cursor/protocols/ledger-protocol.md +2 -0
  110. package/harness/bundles/general/cursor/protocols/powershell-protocol.md +16 -0
  111. package/harness/bundles/general/cursor/protocols/report-pipeline-protocol.md +17 -0
  112. package/harness/bundles/general/cursor/scripts/harness_archive.py +568 -58
  113. package/harness/bundles/general/cursor/scripts/harness_change.py +20 -2
  114. package/harness/bundles/general/cursor/scripts/harness_events.py +96 -19
  115. package/harness/bundles/general/cursor/scripts/harness_gate.py +178 -25
  116. package/harness/bundles/general/cursor/scripts/harness_ledger.py +17 -0
  117. package/harness/bundles/java/claude-code/.harness-build.json +1 -1
  118. package/harness/bundles/java/claude-code/contracts/workflow-policy.json +3 -3
  119. package/harness/bundles/java/claude-code/harness-apidoc/SKILL.md +1 -1
  120. package/harness/bundles/java/claude-code/harness-archive/SKILL.md +3 -3
  121. package/harness/bundles/java/claude-code/harness-archive/reference.md +18 -10
  122. package/harness/bundles/java/claude-code/harness-archive/templates/render-summary.mjs +5 -1
  123. package/harness/bundles/java/claude-code/harness-codebase-map/SKILL.md +1 -1
  124. package/harness/bundles/java/claude-code/harness-knowledge-ingest/SKILL.md +1 -1
  125. package/harness/bundles/java/claude-code/harness-knowledge-query/SKILL.md +1 -1
  126. package/harness/bundles/java/claude-code/harness-package/SKILL.md +1 -1
  127. package/harness/bundles/java/claude-code/harness-plan/SKILL.md +1 -1
  128. package/harness/bundles/java/claude-code/harness-plan/checklist.md +6 -0
  129. package/harness/bundles/java/claude-code/harness-review/SKILL.md +1 -1
  130. package/harness/bundles/java/claude-code/harness-run/SKILL.md +1 -1
  131. package/harness/bundles/java/claude-code/harness-submit/SKILL.md +1 -1
  132. package/harness/bundles/java/claude-code/harness-sync/SKILL.md +1 -1
  133. package/harness/bundles/java/claude-code/harness-test/SKILL.md +1 -1
  134. package/harness/bundles/java/claude-code/protocols/archive-report-protocol.md +3 -1
  135. package/harness/bundles/java/claude-code/protocols/ledger-protocol.md +2 -0
  136. package/harness/bundles/java/claude-code/protocols/powershell-protocol.md +16 -0
  137. package/harness/bundles/java/claude-code/protocols/report-pipeline-protocol.md +17 -0
  138. package/harness/bundles/java/claude-code/scripts/harness_archive.py +568 -58
  139. package/harness/bundles/java/claude-code/scripts/harness_change.py +20 -2
  140. package/harness/bundles/java/claude-code/scripts/harness_events.py +96 -19
  141. package/harness/bundles/java/claude-code/scripts/harness_gate.py +178 -25
  142. package/harness/bundles/java/claude-code/scripts/harness_ledger.py +17 -0
  143. package/harness/bundles/java/codebuddy/.harness-build.json +1 -1
  144. package/harness/bundles/java/codebuddy/contracts/workflow-policy.json +3 -3
  145. package/harness/bundles/java/codebuddy/harness-apidoc/SKILL.md +1 -1
  146. package/harness/bundles/java/codebuddy/harness-archive/SKILL.md +3 -3
  147. package/harness/bundles/java/codebuddy/harness-archive/reference.md +18 -10
  148. package/harness/bundles/java/codebuddy/harness-archive/templates/render-summary.mjs +5 -1
  149. package/harness/bundles/java/codebuddy/harness-codebase-map/SKILL.md +1 -1
  150. package/harness/bundles/java/codebuddy/harness-knowledge-ingest/SKILL.md +1 -1
  151. package/harness/bundles/java/codebuddy/harness-knowledge-query/SKILL.md +1 -1
  152. package/harness/bundles/java/codebuddy/harness-package/SKILL.md +1 -1
  153. package/harness/bundles/java/codebuddy/harness-plan/SKILL.md +1 -1
  154. package/harness/bundles/java/codebuddy/harness-plan/checklist.md +6 -0
  155. package/harness/bundles/java/codebuddy/harness-review/SKILL.md +1 -1
  156. package/harness/bundles/java/codebuddy/harness-run/SKILL.md +1 -1
  157. package/harness/bundles/java/codebuddy/harness-submit/SKILL.md +1 -1
  158. package/harness/bundles/java/codebuddy/harness-sync/SKILL.md +1 -1
  159. package/harness/bundles/java/codebuddy/harness-test/SKILL.md +1 -1
  160. package/harness/bundles/java/codebuddy/protocols/archive-report-protocol.md +3 -1
  161. package/harness/bundles/java/codebuddy/protocols/ledger-protocol.md +2 -0
  162. package/harness/bundles/java/codebuddy/protocols/powershell-protocol.md +16 -0
  163. package/harness/bundles/java/codebuddy/protocols/report-pipeline-protocol.md +17 -0
  164. package/harness/bundles/java/codebuddy/scripts/harness_archive.py +568 -58
  165. package/harness/bundles/java/codebuddy/scripts/harness_change.py +20 -2
  166. package/harness/bundles/java/codebuddy/scripts/harness_events.py +96 -19
  167. package/harness/bundles/java/codebuddy/scripts/harness_gate.py +178 -25
  168. package/harness/bundles/java/codebuddy/scripts/harness_ledger.py +17 -0
  169. package/harness/bundles/java/codex/.harness-build.json +1 -1
  170. package/harness/bundles/java/codex/contracts/workflow-policy.json +3 -3
  171. package/harness/bundles/java/codex/harness-apidoc/SKILL.md +1 -1
  172. package/harness/bundles/java/codex/harness-archive/SKILL.md +3 -3
  173. package/harness/bundles/java/codex/harness-archive/reference.md +18 -10
  174. package/harness/bundles/java/codex/harness-archive/templates/render-summary.mjs +5 -1
  175. package/harness/bundles/java/codex/harness-codebase-map/SKILL.md +1 -1
  176. package/harness/bundles/java/codex/harness-knowledge-ingest/SKILL.md +1 -1
  177. package/harness/bundles/java/codex/harness-knowledge-query/SKILL.md +1 -1
  178. package/harness/bundles/java/codex/harness-package/SKILL.md +1 -1
  179. package/harness/bundles/java/codex/harness-plan/SKILL.md +1 -1
  180. package/harness/bundles/java/codex/harness-plan/checklist.md +6 -0
  181. package/harness/bundles/java/codex/harness-review/SKILL.md +1 -1
  182. package/harness/bundles/java/codex/harness-run/SKILL.md +1 -1
  183. package/harness/bundles/java/codex/harness-submit/SKILL.md +1 -1
  184. package/harness/bundles/java/codex/harness-sync/SKILL.md +1 -1
  185. package/harness/bundles/java/codex/harness-test/SKILL.md +1 -1
  186. package/harness/bundles/java/codex/protocols/archive-report-protocol.md +3 -1
  187. package/harness/bundles/java/codex/protocols/ledger-protocol.md +2 -0
  188. package/harness/bundles/java/codex/protocols/powershell-protocol.md +16 -0
  189. package/harness/bundles/java/codex/protocols/report-pipeline-protocol.md +17 -0
  190. package/harness/bundles/java/codex/scripts/harness_archive.py +568 -58
  191. package/harness/bundles/java/codex/scripts/harness_change.py +20 -2
  192. package/harness/bundles/java/codex/scripts/harness_events.py +96 -19
  193. package/harness/bundles/java/codex/scripts/harness_gate.py +178 -25
  194. package/harness/bundles/java/codex/scripts/harness_ledger.py +17 -0
  195. package/harness/bundles/java/cursor/.harness-build.json +1 -1
  196. package/harness/bundles/java/cursor/contracts/workflow-policy.json +3 -3
  197. package/harness/bundles/java/cursor/harness-apidoc/SKILL.md +1 -1
  198. package/harness/bundles/java/cursor/harness-archive/SKILL.md +3 -3
  199. package/harness/bundles/java/cursor/harness-archive/reference.md +18 -10
  200. package/harness/bundles/java/cursor/harness-archive/templates/render-summary.mjs +5 -1
  201. package/harness/bundles/java/cursor/harness-codebase-map/SKILL.md +1 -1
  202. package/harness/bundles/java/cursor/harness-knowledge-ingest/SKILL.md +1 -1
  203. package/harness/bundles/java/cursor/harness-knowledge-query/SKILL.md +1 -1
  204. package/harness/bundles/java/cursor/harness-package/SKILL.md +1 -1
  205. package/harness/bundles/java/cursor/harness-plan/SKILL.md +1 -1
  206. package/harness/bundles/java/cursor/harness-plan/checklist.md +6 -0
  207. package/harness/bundles/java/cursor/harness-review/SKILL.md +1 -1
  208. package/harness/bundles/java/cursor/harness-run/SKILL.md +1 -1
  209. package/harness/bundles/java/cursor/harness-submit/SKILL.md +1 -1
  210. package/harness/bundles/java/cursor/harness-sync/SKILL.md +1 -1
  211. package/harness/bundles/java/cursor/harness-test/SKILL.md +1 -1
  212. package/harness/bundles/java/cursor/protocols/archive-report-protocol.md +3 -1
  213. package/harness/bundles/java/cursor/protocols/ledger-protocol.md +2 -0
  214. package/harness/bundles/java/cursor/protocols/powershell-protocol.md +16 -0
  215. package/harness/bundles/java/cursor/protocols/report-pipeline-protocol.md +17 -0
  216. package/harness/bundles/java/cursor/scripts/harness_archive.py +568 -58
  217. package/harness/bundles/java/cursor/scripts/harness_change.py +20 -2
  218. package/harness/bundles/java/cursor/scripts/harness_events.py +96 -19
  219. package/harness/bundles/java/cursor/scripts/harness_gate.py +178 -25
  220. package/harness/bundles/java/cursor/scripts/harness_ledger.py +17 -0
  221. package/harness/manifests/general/claude-code.json +33 -29
  222. package/harness/manifests/general/codebuddy.json +33 -29
  223. package/harness/manifests/general/codex.json +33 -29
  224. package/harness/manifests/general/cursor.json +33 -29
  225. package/harness/manifests/java/claude-code.json +27 -27
  226. package/harness/manifests/java/codebuddy.json +27 -27
  227. package/harness/manifests/java/codex.json +27 -27
  228. package/harness/manifests/java/cursor.json +27 -27
  229. package/hunter-workflow-family.json +2 -2
  230. package/package.json +1 -1
@@ -2,5 +2,5 @@
2
2
  "schemaVersion": 1,
3
3
  "overlay": "none",
4
4
  "agent": "claude-code",
5
- "coreHash": "89e664933ed69572"
5
+ "coreHash": "76b89dae06dadb8a"
6
6
  }
@@ -2,21 +2,21 @@
2
2
  "schemaVersion": 1,
3
3
  "riskTiers": {
4
4
  "fast": {
5
- "description": "Low-risk docs/comments/non-behavioral config; no API/DB/security/concurrency.",
5
+ "description": "Low-risk docs/comments/non-behavioral config; no API/DB/security/concurrency. Policy notes: checkpointRules apply only when meta/implementation-checkpoints.json defines the entry for this change; missing file/entry = disabled (gate must not require --task).",
6
6
  "defaultPhases": ["plan", "run", "submit", "archive"],
7
7
  "requiredValidations": ["unitTest"],
8
8
  "conditionalStages": ["review", "package", "apidoc"],
9
9
  "upgradeTriggers": ["api-change", "security", "migration", "concurrency", "breaking-contract"]
10
10
  },
11
11
  "standard": {
12
- "description": "Ordinary production code and non-breaking API/features.",
12
+ "description": "Ordinary production code and non-breaking API/features. Policy notes: requiredValidations may close DEGRADED when ledger status=NOT_RUN and evidence starts with 'DEGRADED: <reason>' (close code CLOSED_DEGRADED, phase status <= WARN); do not fake OK with unrelated tests.",
13
13
  "defaultPhases": ["plan", "run", "test", "submit", "archive"],
14
14
  "requiredValidations": ["compile", "unitTest", "unitTestFull"],
15
15
  "conditionalStages": ["review", "package", "apidoc"],
16
16
  "upgradeTriggers": ["auth", "security", "delete", "migration", "concurrency", "artifact-protocol", "shared-state", "breaking-api"]
17
17
  },
18
18
  "full": {
19
- "description": "Auth/security/delete/migration/concurrency/service protocol/shared state/breaking contracts.",
19
+ "description": "Auth/security/delete/migration/concurrency/service protocol/shared state/breaking contracts. Policy notes: (1) DEGRADED close — ledger status=NOT_RUN and evidence 'DEGRADED: <reason>' → CLOSED_DEGRADED with phase <= WARN; never fake OK with unrelated tests. (2) checkpointRules — only when plan created meta/implementation-checkpoints.json entry; missing file/entry = not enabled, gate must not require --task.",
20
20
  "defaultPhases": ["plan", "run", "test", "review", "submit", "archive"],
21
21
  "requiredValidations": ["compile", "unitTest", "unitTestFull", "apiTest"],
22
22
  "conditionalStages": ["package", "apidoc"],
@@ -20,7 +20,7 @@ disallowed-tools:
20
20
  - Bash(awk *)
21
21
  - Bash(curl *)
22
22
  ---
23
- <!-- generated by harness_deploy.py; core=89e664933ed69572; overlay=none; agent=claude-code; do not edit -->
23
+ <!-- generated by harness_deploy.py; core=76b89dae06dadb8a; overlay=none; agent=claude-code; do not edit -->
24
24
  # harness-archive — 变更归档
25
25
 
26
26
  ## Purpose
@@ -103,8 +103,8 @@ AskUserQuestion 让用户确认归档操作。**用户拒绝 → 终止流程,
103
103
  ### Phase 3:执行归档
104
104
 
105
105
  1. 运行 `python <skills-root>/scripts/harness_archive.py status --change-dir ".harness/changes/<change-name>" --json` 前置检查。
106
- 2. 如需维护者结论,在移动前补全 `meta/archive-meta.md`;不得在 finalize 后修改已校验的归档文件。
107
- 3. 运行 `python <skills-root>/scripts/harness_archive.py finalize --change-dir ".harness/changes/<change-name>" --archive-root ".harness/archive" --json`;读 JSON(事件、移动、collect、render、validate、manifest 比对)。finalize 内部负责且仅负责一次 `phase.start` / `phase.end`,调用者不得重复追加。**finalize 不再同步执行知识维护**(§8.2):它写一个 `pending` maintenance-outbox 项即返回,`knowledgeMaintenance=QUEUED`;写 outbox 失败时 `NOT_QUEUED`(warning,不回滚 archive,总状态 CONDITIONAL)。后续由 `harness-sync` / `harness_knowledge.py maintain` 异步推进 outbox。**finalize 失败或 validate 报错时不删除原目录**。
106
+ 2. `meta/archive-meta.md` **由 `harness_archive.py finalize` 自动生成**(与 summary-data `finalStatus` 同源);**禁止 agent 手写**该文件,手写视为数据丢失。维护者结论写入 events(decision/issue)即可,finalize 会汇总到 summary / archive-meta。
107
+ 3. 运行 `python <skills-root>/scripts/harness_archive.py finalize --change-dir ".harness/changes/<change-name>" --archive-root ".harness/archive" --json`;读 JSON(cleanup、事件、移动、collect、render、validate、manifest 比对、archive-meta)。finalize 内部负责且仅负责一次 `phase.start` / `phase.end`,调用者不得重复追加。**finalize 不再同步执行知识维护**(§8.2):它写一个 `pending` maintenance-outbox 项即返回,`knowledgeMaintenance=QUEUED`;写 outbox 失败时 `NOT_QUEUED`(warning,不回滚 archive,总状态 CONDITIONAL)。后续由 `harness-sync` / `harness_knowledge.py maintain` 异步推进 outbox。**finalize 失败或 validate 报错时不删除原目录**。
108
108
 
109
109
  - **Read `reference.md`** — finalize 输出字段、archive-meta 格式、CONDITIONAL_OK 规则
110
110
  - **Read `templates/summary-data-template.json`** — summary-data 数据结构
@@ -11,7 +11,7 @@ description: harness-archive 的归档流程、manifest、summary-data、final-s
11
11
  - **Phase 2 确认归档(强制阻断)**:AskUserQuestion 确认,拒绝即终止。
12
12
  - **Phase 3 执行归档**:
13
13
  1. 运行 `python <skills-root>/scripts/harness_archive.py status --change-dir ... --json` 做前置检查。
14
- 2. 需要维护者结论时,在移动前补全 `meta/archive-meta.md` `maintenanceNotes` / `knownRisks` / `manualActions`;finalize 后不再修改归档内容。
14
+ 2. `meta/archive-meta.md` finalize 生成(与 summary `finalStatus` 同源);禁止手写。维护者结论写入 events 即可。finalize 在 before-manifest 前执行 cleanup(删除 lock/pid/launcher/credential,截断超大日志)。
15
15
  3. 运行 `python <skills-root>/scripts/harness_archive.py finalize --change-dir ... --archive-root ".harness/archive" --json`;读 JSON 结果。finalize 内部负责且仅负责一次 `phase.start` / `phase.end`,调用者不得重复追加。**finalize 报错或 validate 失败时不删除原 changes 目录**。
16
16
  - **Phase 4 验证与提示**:见 `checklist.md` 归档后验证项。
17
17
 
@@ -70,18 +70,26 @@ powershell.exe -NoProfile -Command "& '<node-path>' 'harness-skills/harness-arch
70
70
 
71
71
  ## archive-meta.md 模板
72
72
 
73
+ 由 `harness_archive.py finalize` 生成(手写视为数据丢失)。frontmatter 与 summary-data 同源:
74
+
73
75
  ```markdown
74
- # Archive Meta — <change-name>
75
-
76
- - archivedAt: YYYY-MM-DD HH:mm
77
- - finalCommit: <hash>
78
- - sourceDir: .harness/changes/<change-name>
79
- - archiveDir: .harness/archive/YYYY-MM-DD-<change-name>
80
- - movedFiles: <from manifest>
81
- - generatedFiles: archive-meta.md, summary-data.json, final-summary.html, manifests
82
- - totalArchiveFiles: <from after manifest>
76
+ ---
77
+ archive-id: YYYY-MM-DD-<change-name>
78
+ change-name: <change-name>
79
+ archived-at: YYYY-MM-DD HH:mm
80
+ final-commit: <hash>
81
+ base-commit: <hash>
82
+ final-status: <OK|WARN|CONDITIONAL_OK|FAIL> # 与 summary-data.finalStatus 同源
83
+ source: harness-archive
84
+ ---
85
+ # 归档元数据 — <change-name>
86
+ ## 阶段状态
87
+ ## 变更文件
88
+ ## 已知风险
83
89
  ```
84
90
 
91
+ cleanup 步骤(before-manifest 前):删除 `events.ndjson.lock`、`runtime/*.pid`、launcher、credential/token/secret 文件名;截断 `logs/**/*.log` 超过 64KB 的尾部保留。
92
+
85
93
  ## 目录结构与最终状态规则
86
94
 
87
95
  - 默认渲染器:`templates/render-summary.mjs`,输入 `reports/final/summary-data.json`,输出 `reports/final/final-summary.html`。
@@ -56,6 +56,10 @@ const actions = list(data.manualActions);
56
56
  const files = list(data.changedFiles);
57
57
  const commands = list(record(data.reportPipeline).commands);
58
58
  const timeline = list(data.timeline);
59
+ const statusReasons = list(data.finalStatusReasons);
60
+ const reasonHtml = statusReasons.length
61
+ ? `<small>${statusReasons.map((item) => esc(item)).join(" · ")}</small>`
62
+ : "";
59
63
 
60
64
  const stageHtml = stages.map(([name, status]) => `<div class="row"><span>${esc(name)}</span>${pill(status)}</div>`).join("") || '<p class="empty">没有阶段状态记录</p>';
61
65
  const verificationHtml = [
@@ -81,7 +85,7 @@ const html = `<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><met
81
85
  *{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:14px/1.5 Inter,"Segoe UI","Microsoft YaHei",sans-serif}main{width:min(1140px,calc(100% - 28px));margin:22px auto 44px}.hero,.card,.metric,details{background:var(--card);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow)}.hero{padding:23px 25px;border-top:3px solid var(--blue)}.eyebrow{color:var(--blue);font-weight:750;letter-spacing:.08em}h1{font-size:27px;line-height:1.2;margin:5px 0 7px;overflow-wrap:anywhere}.goal,.empty,small{color:var(--muted)}.status{display:flex;align-items:center;gap:10px;margin-top:16px}.metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:11px;margin:11px 0}.metric{padding:14px 15px}.metric strong{display:block;font-size:19px;margin:4px 0}.grid{display:grid;grid-template-columns:1.12fr .88fr;gap:11px}.card{padding:17px;margin-bottom:11px}h2{font-size:16px;margin:0 0 10px}.row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid var(--line)}.row:last-child{border:0}.row small{display:block;margin-top:2px}.pill{display:inline-flex;border-radius:999px;padding:3px 9px;font-size:11px;font-weight:750;white-space:nowrap}.pill.success{color:var(--good);background:color-mix(in srgb,var(--good) 13%,transparent)}.pill.warning{color:var(--warn);background:color-mix(in srgb,var(--warn) 14%,transparent)}.pill.danger{color:var(--bad);background:color-mix(in srgb,var(--bad) 13%,transparent)}.pill.neutral{color:var(--blue);background:color-mix(in srgb,var(--blue) 12%,transparent)}.duration{margin:11px 0}.duration>div{display:flex;justify-content:space-between;color:var(--muted);font-size:12px}.duration>div span:first-child{color:var(--text);font-weight:650}.duration i{display:block;height:7px;background:var(--soft);border-radius:99px;overflow:hidden;margin-top:6px}.duration b{display:block;height:100%;background:linear-gradient(90deg,var(--blue),#7c70ff)}.risk{display:grid;grid-template-columns:1fr 1fr;gap:10px}.risk>div{background:var(--soft);border-radius:10px;padding:11px}.risk h3{font-size:13px;margin:0 0 5px}.risk ul{padding-left:18px;margin:0;color:var(--muted)}details{margin:9px 0}summary{cursor:pointer;padding:13px 15px;font-weight:650}details>div{padding:0 15px 15px;overflow:auto}table{width:100%;border-collapse:collapse}th,td{text-align:left;padding:8px 9px;border-bottom:1px solid var(--line);vertical-align:top}th{color:var(--muted);font-size:11px;letter-spacing:.04em}code{font-family:"Cascadia Code",Consolas,monospace;color:var(--blue);overflow-wrap:anywhere}.plus{color:var(--good)}.minus{color:var(--bad)}dl{display:grid;grid-template-columns:145px 1fr;gap:7px 11px}dt{color:var(--muted)}dd{margin:0;overflow-wrap:anywhere}
82
86
  @media(max-width:800px){.metrics{grid-template-columns:1fr 1fr}.grid,.risk{grid-template-columns:1fr}}@media(max-width:480px){main{width:calc(100% - 18px);margin-top:9px}.metrics{grid-template-columns:1fr}.hero{padding:19px}h1{font-size:23px}dl{grid-template-columns:1fr}}
83
87
  </style></head><body><main>
84
- <section class="hero"><div class="eyebrow">HARNESS EXECUTION REPORT</div><h1>${esc(data.changeName || "未命名变更")}</h1><p class="goal">${esc(data.businessGoal || "未记录业务目标")}</p><div class="status">${pill(data.finalStatus)}<span>基于事件、验证账本与 Git 证据生成</span></div></section>
88
+ <section class="hero"><div class="eyebrow">HARNESS EXECUTION REPORT</div><h1>${esc(data.changeName || "未命名变更")}</h1><p class="goal">${esc(data.businessGoal || "未记录业务目标")}</p><div class="status">${pill(data.finalStatus)}<span>基于事件、验证账本与 Git 证据生成${data.riskTier ? ` · riskTier=${esc(data.riskTier)}` : ""}</span></div>${reasonHtml ? `<div class="status">${reasonHtml}</div>` : ""}</section>
85
89
  <section class="metrics"><article class="metric"><small>任务提交</small><strong><code title="${esc(data.finalCommit)}">${esc(shortHash(data.finalCommit))}</code></strong><small>${esc(data.finalCommitBranch || "未记录分支")}</small></article><article class="metric"><small>代码范围</small><strong>${number(diff.filesChanged)} 个文件</strong><small><span class="plus">+${number(diff.insertions)}</span> · <span class="minus">-${number(diff.deletions)}</span></small></article><article class="metric"><small>总耗时</small><strong>${esc(durations.totalLabel || duration(durations.totalMinutes))}</strong><small>${durationStages.length} 个阶段</small></article><article class="metric"><small>归档完整性</small><strong>${esc(record(data.archiveManifest).checksumStatus || "UNKNOWN")}</strong><small>${number(record(data.archiveManifest).totalArchiveFiles)} 个归档文件</small></article></section>
86
90
  <section class="grid"><div><article class="card"><h2>验证结论</h2>${verificationHtml}</article><article class="card"><h2>阶段耗时</h2>${durationHtml}</article></div><div><article class="card"><h2>阶段状态</h2>${stageHtml}</article><article class="card"><h2>风险与后续</h2><div class="risk"><div><h3>已知风险</h3><ul>${riskHtml}</ul></div><div><h3>人工动作</h3><ul>${actionHtml}</ul></div></div></article></div></section>
87
91
  <details><summary>变更文件(${files.length})</summary><div><table><thead><tr><th>文件</th><th>新增</th><th>删除</th></tr></thead><tbody>${fileRows}</tbody></table></div></details>
@@ -20,7 +20,7 @@ disallowed-tools:
20
20
  - Bash(awk *)
21
21
  - Bash(curl *)
22
22
  ---
23
- <!-- generated by harness_deploy.py; core=89e664933ed69572; overlay=none; agent=claude-code; do not edit -->
23
+ <!-- generated by harness_deploy.py; core=76b89dae06dadb8a; overlay=none; agent=claude-code; do not edit -->
24
24
  # harness-codebase-map — 代码库地图
25
25
 
26
26
  ## Purpose
@@ -20,7 +20,7 @@ disallowed-tools:
20
20
  - Bash(awk *)
21
21
  - Bash(curl *)
22
22
  ---
23
- <!-- generated by harness_deploy.py; core=89e664933ed69572; overlay=none; agent=claude-code; do not edit -->
23
+ <!-- generated by harness_deploy.py; core=76b89dae06dadb8a; overlay=none; agent=claude-code; do not edit -->
24
24
  # harness-knowledge-ingest
25
25
 
26
26
  从 `.harness/archive/**/reports/final/summary-data.json` 抽取项目知识,生成并维护本地 `.harness/knowledge/` 索引。
@@ -20,7 +20,7 @@ disallowed-tools:
20
20
  - Bash(awk *)
21
21
  - Bash(curl *)
22
22
  ---
23
- <!-- generated by harness_deploy.py; core=89e664933ed69572; overlay=none; agent=claude-code; do not edit -->
23
+ <!-- generated by harness_deploy.py; core=76b89dae06dadb8a; overlay=none; agent=claude-code; do not edit -->
24
24
  # harness-knowledge-query
25
25
 
26
26
  并行 change 中查询必须传 `--change <change-id>`;成功后以该 change 的 `meta/knowledge-context.json` 为稳定指针。全局 `context-packs/latest.json` 仅向后兼容,不得用于判断多个 active change 的上下文归属。
@@ -20,7 +20,7 @@ disallowed-tools:
20
20
  - Bash(awk *)
21
21
  - Bash(curl *)
22
22
  ---
23
- <!-- generated by harness_deploy.py; core=89e664933ed69572; overlay=none; agent=claude-code; do not edit -->
23
+ <!-- generated by harness_deploy.py; core=76b89dae06dadb8a; overlay=none; agent=claude-code; do not edit -->
24
24
  # harness-plan — 需求规划
25
25
 
26
26
  ## Purpose
@@ -57,6 +57,12 @@ description: harness-plan 的阶段检查清单和覆盖检查列表。仅在执
57
57
  > - CodeGraph 如通过 MCP 调用,必须优先用 MCP 工具,不允许通过普通 Bash 调 codegraph 命令
58
58
  > - 禁止把子代理未经工具验证的文本结论当作"详尽报告"或代码证据采纳
59
59
 
60
+ ## 影响面检查(远程客户端路径)
61
+
62
+ 变更涉及 HTTP/RPC 客户端时,在设计/任务拆分前完成路径静态比对:
63
+
64
+ - [ ] 变更涉及 HTTP/RPC 客户端(Feign/RestTemplate/SDK 封装)时:取客户端注解路径(类级 + 方法级拼接),与服务提供方 controller 的 `@RequestMapping` + 方法级注解**完整拼接路径**逐一比对,在计划/执行记录中列出比对结果。只看方法级注解不算完成。
65
+
60
66
  ## 阶段 4:设计审批包 ⚠️ 强制阻断(一次 AskUserQuestion)
61
67
 
62
68
  > 合并原「设计审核 + worktree + 场景表预览 + change-name」。推荐 worktree 读 `harness.json` `defaultWorktree`。
@@ -21,7 +21,7 @@ disallowed-tools:
21
21
  - Bash(curl *)
22
22
  - Bash(codegraph *)
23
23
  ---
24
- <!-- generated by harness_deploy.py; core=89e664933ed69572; overlay=none; agent=claude-code; do not edit -->
24
+ <!-- generated by harness_deploy.py; core=76b89dae06dadb8a; overlay=none; agent=claude-code; do not edit -->
25
25
  # harness-review — 代码审查
26
26
 
27
27
  ## Purpose
@@ -21,7 +21,7 @@ disallowed-tools:
21
21
  - Bash(curl *)
22
22
  - Bash(codegraph *)
23
23
  ---
24
- <!-- generated by harness_deploy.py; core=89e664933ed69572; overlay=none; agent=claude-code; do not edit -->
24
+ <!-- generated by harness_deploy.py; core=76b89dae06dadb8a; overlay=none; agent=claude-code; do not edit -->
25
25
  # harness-run — 需求编码
26
26
 
27
27
  ## Purpose
@@ -120,6 +120,11 @@ description: harness-run 的执行检查清单。仅在编码执行时读取。
120
120
  - [ ] 纯 Mock 数据访问层测试 → 标记为 🟡静态验证,交给 harness-test 真实 DB 验证
121
121
  - [ ] 如果必须自动化 → 使用真实数据访问层(非 mock)或可检查查询条件的测试方式
122
122
 
123
+ ### 编码前检查(远程客户端 / stub 同源错误)
124
+
125
+ - [ ] 变更涉及 HTTP/RPC 客户端(Feign/RestTemplate/SDK 封装)时:取客户端注解路径(类级 + 方法级拼接),与服务提供方 controller 的 `@RequestMapping` + 方法级注解**完整拼接路径**逐一比对,在计划/执行记录中列出比对结果。只看方法级注解不算完成。
126
+ - [ ] 修 stub/null 返回时,顺带核对同文件相邻声明(注解、常量、同类方法路径)是否同源错误,一并列出核对结果
127
+
123
128
  ### GREEN(最简实现 — 按变更簇批量实现)
124
129
 
125
130
  - [ ] 写最少代码让变更簇测试全部通过
@@ -522,7 +522,7 @@ powershell.exe -Command "<测试命令> <模块定位参数>"
522
522
 
523
523
  ```powershell
524
524
  python <skills-root>/scripts/harness_ledger.py diff-hash --repo . --base <baseCommit> --change-dir ".harness/changes/<change-name>" --json
525
- python <skills-root>/scripts/harness_ledger.py record --change-dir ".harness/changes/<change-name>" --verification compile --status PASS --command "<cmd>" --exit-code 0 --json
525
+ python <skills-root>/scripts/harness_ledger.py record --change-dir ".harness/changes/<change-name>" --verification compile --status ok --command "<cmd>" --exit-code 0 --json
526
526
  ```
527
527
 
528
528
  > `content-changeset-2` 同时读取 tracked diff、标准 untracked 文件和 manifest 的精确测试路径。manifest 缺失时保持普通行为;manifest 存在但路径越界、内容 hash 漂移或结构非法时命令失败,ledger 不可复用。checkpoint commit 不改变各路径的工作树内容,因此提交前后 hash 保持一致。
@@ -789,6 +789,36 @@ powershell.exe -Command "git -C '<project-path>' diff --check"
789
789
  在 harness-test 通过前,不建议也不应进入 `/harness-submit`。
790
790
  ```
791
791
 
792
+ ## CLI 速查(gate / ledger)
793
+
794
+ > 可直接复制;替换 `<skills-root>` / `<cn>` / `<dir>` / `<project>`。`--task` **仅在该 change 启用 checkpoint 时必需**(checkpoints 文件缺失或不含 pending foundation-gate 时不要传)。
795
+ > `ledger record` 必需:`--duration-ms`、`--evidence`,以及 `--files`(逗号分隔源文件)或 `--profile-input <verificationKey> --project <project>`(从 build-profile 展开)。`status` 枚举: `ok|fail|not_run`(没有 PASS)。
796
+ > `--skills-root` 仅用于 `begin`(及 `lint-skills`):必须是 adapter 根(如 `.cursor/skills`),不是 `scripts/` 子目录。**`close` 不需要 `--skills-root`**(该子命令不接受此参数)。
797
+
798
+ ```powershell
799
+ # gate begin/close(--task 仅在该 change 启用 checkpoint 时必需;close 不需要 --skills-root)
800
+ python <skills-root>/scripts/harness_gate.py begin --change <cn> --phase run --skills-root <skills-root> [--task N]
801
+ python <skills-root>/scripts/harness_gate.py close --change <cn> --phase run --status OK [--task N]
802
+
803
+ # ledger 记录(status: ok|fail|not_run —— 没有 PASS)
804
+ python <skills-root>/scripts/harness_ledger.py record --change-dir <dir> --verification unitTestFull --status ok --command "<完整命令>" --exit-code 0 --duration-ms 120000 --evidence "Tests run: 155, Failures: 0, Errors: 0, Skipped: 0" --coverage full --files "packages/core/src/index.ts"
805
+
806
+ # 复用检查(--profile-input 取 verification key,不是文件路径;配合 --project)
807
+ python <skills-root>/scripts/harness_ledger.py can-reuse --change-dir <dir> --verification unitTestFull --profile-input unitTestFull --project <project>
808
+ ```
809
+
810
+ ### 常见报错对照
811
+
812
+ | 报错 | 原因 | 处理 |
813
+ |------|------|------|
814
+ | `unsupported status: PASS` | ledger status 无 PASS | 改用 `ok` / `fail` / `not_run` |
815
+ | `TASK_NUMBER_REQUIRED` | 该 change 启用了 checkpoint(如 foundation-gate pending) | 补 `--task N` |
816
+ | skills-root / BUNDLE_IDENTITY_* | `begin` 未传或传了 `.../scripts` 子目录(`close` 不接受该参数) | 仅对 `begin` 显式传 adapter 根:`.cursor/skills` / `.claude/skills`(含 `.harness-build.json`) |
817
+ | `--profile-input` 指向文件路径 | 参数语义是 verification key | 传 `compile` / `unitTestFull` 等 key,不是 JSON 路径 |
818
+ | `record requires --files or a non-empty --profile-input file set` | 缺少输入文件集 | 补 `--files` 或 `--profile-input <key> --project <project>` |
819
+ | `--profile-input requires --project` | can-reuse/record 展开 profile 需要项目根 | 补 `--project <project>` |
820
+ | `record` 缺 `--duration-ms` / `--evidence` | 参数为必填 | 按模板补齐 |
821
+
792
822
  ## 关键原则
793
823
 
794
824
  - 增量构建优先:`powershell.exe -Command "<构建命令> <模块定位参数>"`(Java 示例:`mvn compile -pl <module> -o -q`,不用 clean,用离线模式加速)
@@ -20,7 +20,7 @@ disallowed-tools:
20
20
  - Bash(awk *)
21
21
  - Bash(curl *)
22
22
  ---
23
- <!-- generated by harness_deploy.py; core=89e664933ed69572; overlay=none; agent=claude-code; do not edit -->
23
+ <!-- generated by harness_deploy.py; core=76b89dae06dadb8a; overlay=none; agent=claude-code; do not edit -->
24
24
  # harness-submit — 最终提交(含 worktree 合并)
25
25
 
26
26
  ## Purpose
@@ -19,7 +19,7 @@ disallowed-tools:
19
19
  - Bash(awk *)
20
20
  - Bash(curl *)
21
21
  ---
22
- <!-- generated by harness_deploy.py; core=89e664933ed69572; overlay=none; agent=claude-code; do not edit -->
22
+ <!-- generated by harness_deploy.py; core=76b89dae06dadb8a; overlay=none; agent=claude-code; do not edit -->
23
23
  # harness-sync — 元数据同步
24
24
 
25
25
  ## Purpose
@@ -22,7 +22,7 @@ disallowed-tools:
22
22
  - Bash(node *)
23
23
  - Bash(codegraph *)
24
24
  ---
25
- <!-- generated by harness_deploy.py; core=89e664933ed69572; overlay=none; agent=claude-code; do not edit -->
25
+ <!-- generated by harness_deploy.py; core=76b89dae06dadb8a; overlay=none; agent=claude-code; do not edit -->
26
26
  # harness-test — 测试执行
27
27
 
28
28
  ## Purpose
@@ -293,6 +293,15 @@ powershell.exe -NoProfile -Command "try { (Invoke-WebRequest -Uri 'http://127.0.
293
293
  - [ ] durationMs > 10000 → 🟡SLOW,说明原因
294
294
  - [ ] durationMs > 30000 → ❌TIMEOUT_RISK,说明原因
295
295
 
296
+ ### 覆盖标注诚实性(✅ 实测 vs 🟡 推断)
297
+
298
+ 场景状态标注规则:
299
+
300
+ - [ ] ✅ 仅当断言实际执行**且**场景声明的前置条件/数据真实构造
301
+ - [ ] 🟡(推断):未构造场景条件、以相邻场景或同接口行为推断时使用,必须注明推断依据
302
+ - [ ] 用同一请求重复调用来"覆盖"不同异常场景 → 一律 🟡
303
+ - [ ] 报告汇总行的通过数只统计 ✅(不含 🟡 推断)
304
+
296
305
  ## 关门检查(⚠️ 结束前强制执行)
297
306
 
298
307
  - [ ] `powershell.exe -NoProfile -Command "git status --porcelain"`
@@ -0,0 +1,14 @@
1
+ ---
2
+ description: Java/Feign 相关测试踩坑(harness-test)。API 实测前通读;发现客户端路径缺陷时回写 plan 外修复记录。
3
+ ---
4
+
5
+ # Java 测试踩坑补充(Feign / 远程客户端)
6
+
7
+ > 与 `pitfalls.md`(通用)及 `overlays/java/pitfalls-java.md`(overlay 速查表)互补;本文件收录路径拼接类缺陷的症状与流程要求。
8
+
9
+ ## Feign/客户端路径前缀缺失
10
+
11
+ **症状**:服务正常、接口 200,但客户端拿到 404 / 空数据 / fallback 生效。
12
+ **根因模式**:`@FeignClient` 方法上只写了 `@GetMapping("/type")`,漏掉服务端类级前缀(如 `/system/dict-data`)。
13
+ **定位**:对照服务端 controller 完整映射(类级 `@RequestMapping` + 方法级注解),或看服务端访问日志中的实际 404 路径。
14
+ **流程要求**:此类缺陷若在 test 阶段被 API 实测发现,属于"计划外修复"——必须记 decision 事件(含根因与修复文件),并检查同客户端文件的其余方法是否同源错误。
@@ -582,6 +582,15 @@ TEST_<change-name>_<timestamp>_<short-random>
582
582
 
583
583
  如果场景表有「数据兼容场景」:查询已有数据,验证新字段返回 null 或默认值,不报错。
584
584
 
585
+ ## 覆盖标注诚实性规则
586
+
587
+ 场景状态标注规则:
588
+
589
+ - ✅ 仅当断言实际执行**且**场景声明的前置条件/数据真实构造。
590
+ - 🟡(推断):未构造场景条件、以相邻场景或同接口行为推断时使用,必须注明推断依据。
591
+ - 用同一请求重复调用来"覆盖"不同异常场景 → 一律 🟡。
592
+ - 报告汇总行的通过数只统计 ✅。
593
+
585
594
  ## 输出格式(测试报告模板)
586
595
 
587
596
  测试完成后,将报告保存到 `.harness/changes/<change-name>/reports/test/test-report-YYYYMMDD-HHmm.md`(时间戳格式:日期+时分),同时在控制台输出摘要。
@@ -684,6 +693,33 @@ TEST_<change-name>_<timestamp>_<short-random>
684
693
  - 如果 ❌FAIL:修复失败项后重新运行 /harness-test
685
694
  ```
686
695
 
696
+ ## CLI 速查(gate / ledger)
697
+
698
+ > test 阶段常用子集。`--task` **仅在该 change 启用 checkpoint 时必需**。ledger status 枚举: ok|fail|not_run(没有 PASS)。`record` 还需 `--duration-ms`、`--evidence`,以及 `--files` 或 `--profile-input`+`--project`。
699
+ > `--skills-root` 仅用于 `begin`(及 `lint-skills`):必须是 adapter 根(如 `.cursor/skills`),不是 `scripts/` 子目录。**`close` 不需要 `--skills-root`**(该子命令不接受此参数)。
700
+
701
+ ```powershell
702
+ # gate begin/close(phase=test;--task 仅 checkpoint 启用时必需;close 不需要 --skills-root)
703
+ python <skills-root>/scripts/harness_gate.py begin --change <cn> --phase test --skills-root <skills-root> [--task N]
704
+ python <skills-root>/scripts/harness_gate.py close --change <cn> --phase test --status OK [--task N]
705
+
706
+ # ledger 记录 / 复用(--profile-input = verification key,不是文件路径)
707
+ python <skills-root>/scripts/harness_ledger.py record --change-dir <dir> --verification unitTestFull --status ok --command "<完整命令>" --exit-code 0 --duration-ms 120000 --evidence "Tests run: N, Failures: 0" --coverage full --files "packages/core/src/index.ts"
708
+ python <skills-root>/scripts/harness_ledger.py can-reuse --change-dir <dir> --verification unitTestFull --profile-input unitTestFull --project <project>
709
+ ```
710
+
711
+ ### 常见报错对照
712
+
713
+ | 报错 | 原因 | 处理 |
714
+ |------|------|------|
715
+ | `unsupported status: PASS` | ledger status 无 PASS | 改用 `ok` / `fail` / `not_run` |
716
+ | `TASK_NUMBER_REQUIRED` | 该 change 启用了 checkpoint(如 foundation-gate pending) | 补 `--task N` |
717
+ | skills-root / BUNDLE_IDENTITY_* | `begin` 未传或传了 `.../scripts` 子目录(`close` 不接受该参数) | 仅对 `begin` 显式传 adapter 根:`.cursor/skills` / `.claude/skills`(含 `.harness-build.json`) |
718
+ | `--profile-input` 指向文件路径 | 参数语义是 verification key | 传 `compile` / `unitTestFull` 等 key,不是 JSON 路径 |
719
+ | `record requires --files or a non-empty --profile-input file set` | 缺少输入文件集 | 补 `--files` 或 `--profile-input <key> --project <project>` |
720
+ | `--profile-input requires --project` | can-reuse/record 展开 profile 需要项目根 | 补 `--project <project>` |
721
+ | `record` 缺 `--duration-ms` / `--evidence` | 参数为必填 | 按模板补齐 |
722
+
687
723
  ## 结果分级规则
688
724
 
689
725
  > 结果状态分级与证据要求遵循 `../protocols/evidence-based-reporting-protocol.md`。
@@ -6,7 +6,9 @@ description: harness-archive 的数据化归档和 final-summary 渲染协议。
6
6
 
7
7
  ## 原则
8
8
 
9
- archive 不应让模型临场生成 500+ 行 HTML。事实收集与校验由 `harness_archive.py finalize` 单命令完成(collect → render → validate 内嵌);模型仅补写 `maintenanceNotes` / `knownRisks` / `manualActions`。历史 archive 回放用 `harness_archive.py replay`。
9
+ archive 不应让模型临场生成 500+ 行 HTML。事实收集与校验由 `harness_archive.py finalize` 单命令完成(cleanup → collect → render → validate archive-meta 内嵌);模型仅通过 events 写入维护结论。`meta/archive-meta.md` 由 finalize 生成,禁止手写。历史 archive 回放用 `harness_archive.py replay`(只读,不写 archive-meta / 不跑 cleanup)。
10
+
11
+ `knownRisks` 仅收录 severity∈{warning,error,critical} 的 issue 事件;无 severity 的 issue 进入 `maintenanceNotes`。`finalStatusReasons` 解释 CONDITIONAL_OK/WARN/FAIL 原因。finalize 在 before-manifest 前 cleanup:删除 lock/pid/launcher/credential,截断超大日志。
10
12
 
11
13
  详见 `report-pipeline-protocol.md`。本协议保留 archive final report 的维度要求,report pipeline 负责把这些维度程序化生成和校验。
12
14
 
@@ -67,6 +67,7 @@ verification-ledger 把每次验证(compile / unit test / api test / package
67
67
  "errors": 0,
68
68
  "skipped": 0,
69
69
  "evidence": "<测试通过证据(Java=Tests run: 14, Failures: 0, Errors: 0, Skipped: 0;前端/Python 按各自工具成功标志)>",
70
+ "metrics": {"run": 14, "failures": 0, "errors": 0, "skipped": 0},
70
71
  "startedAt": "2026-06-22T10:02:00+08:00",
71
72
  "finishedAt": "2026-06-22T10:05:00+08:00",
72
73
  "durationMs": 180000
@@ -284,6 +285,7 @@ ledger 的 `status` 与 final-summary 展示状态对应:
284
285
  | `algorithmVersion` | 固定 `harness-ledger-2`;缺失即 v1 entry |
285
286
  | `coverage` | 覆盖层级 `incremental`/`module`/`module-am`/`full`,由 verification+scope 派生或 `--coverage` 显式指定 |
286
287
  | `toolchainHash`/`profileHash`/`environmentHash` | 可选;`record --toolchain-hash` 等写入,`can-reuse --toolchain-hash` 等比对(UT-017) |
288
+ | `metrics` | 可选;`record --metrics-json '{"run":155,"failures":0,...}'` 写入结构化计数(不参与 inputsHash)。archive 读取顺序:`metrics` → evidence dict → evidence 文本正则 → `runtime/api-test-results.json` |
287
289
 
288
290
  ### 9.2 coverage lattice
289
291
 
@@ -179,3 +179,19 @@ powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".harness/changes/<chang
179
179
  ```
180
180
 
181
181
  原因:Claude Code 的 Bash 工具外壳会先处理双引号内容,`$log`、`$_` 这类变量可能被外层 shell 吃掉,导致命令变形。简单命令可以 inline;复杂命令必须 `-File`。
182
+
183
+
184
+ ## 12. PowerShell 5.1 兼容清单
185
+
186
+ Windows 默认常为 Windows PowerShell **5.1**。下列特性在 5.1 不可用,禁止写进可复制命令模板:
187
+
188
+ | 特性 | 最低版本 | PowerShell 5.1 替代 |
189
+ |------|---------|--------------------|
190
+ | `Invoke-WebRequest -SkipHttpErrorCheck` | 7.0 | `try/catch` 包裹或 `$ErrorActionPreference` 处理非 2xx |
191
+ | `Join-String` | 6.2 | `-join` 运算符 |
192
+ | `ForEach-Object -Parallel` | 7.0 | 顺序执行 |
193
+
194
+ ### 非 ASCII 路径与 Bash 拒绝后的切换
195
+
196
+ - 非 ASCII 路径(含中文)仓库:git/构建/文件操作一律 PowerShell;Bash 被 hook 拒绝(如 `Denied: non-ASCII path`)后**立即**改用 PowerShell 重发等价命令,禁止原样重试 Bash。
197
+ - Maven `-D` 参数在 PowerShell 中加引号:`"-Dmaven.test.skip=true"`。
@@ -78,6 +78,23 @@ python <skills-root>/scripts/harness_events.py append --change-dir ".harness/cha
78
78
  | `issue` | code, severity, message | 问题和校验发现 |
79
79
  | `decision` | decision, reason | 人工确认、跳过、复用等决策 |
80
80
 
81
+ ## 事件语义与必填字段
82
+
83
+ 写入 `events.ndjson` 时按用途选 type;渲染侧会对缺失字段做 note 兜底,但写入侧仍应填齐语义字段。
84
+
85
+ | type | 用途 | 必填 | 常见误用 |
86
+ |------|------|------|----------|
87
+ | `issue` | 需要跟进/影响结论的异常 | severity, message | 把信息性结论记成 issue(应使用 decision) |
88
+ | `decision` | 决策/结论/知识引用 | note 或 decision+reason | - |
89
+ | `verification` | 验证执行结果 | name, status | 漏 name 导致 "(unnamed)" |
90
+ | `artifact` | 产物落盘 | path | 只传 note |
91
+ | `command` | 命令执行 | command, exit_code | - |
92
+
93
+ 兼容提示(不失败、exit 0):
94
+
95
+ - `--type issue` 未传 `--severity` → 默认 `info` 并在 stderr 提示
96
+ - `--type verification` 未传 `--name` 或 `--status` → stderr 提示,照常写入
97
+
81
98
  ## summary-data.json
82
99
 
83
100
  summary-data 必须保留原 archive final report 维度,并增加事件层摘要: