@hunter-harness/workflow-harness 0.2.8 → 0.2.10

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 (334) 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 +30 -12
  5. package/harness/bundles/general/claude-code/harness-archive/templates/render-summary.mjs +5 -1
  6. package/harness/bundles/general/claude-code/harness-archive/templates/summary-data-template.json +6 -2
  7. package/harness/bundles/general/claude-code/harness-codebase-map/SKILL.md +1 -1
  8. package/harness/bundles/general/claude-code/harness-knowledge-ingest/SKILL.md +3 -1
  9. package/harness/bundles/general/claude-code/harness-knowledge-ingest/reference.md +7 -0
  10. package/harness/bundles/general/claude-code/harness-knowledge-ingest/scripts/harness_knowledge.py +117 -0
  11. package/harness/bundles/general/claude-code/harness-knowledge-query/SKILL.md +1 -1
  12. package/harness/bundles/general/claude-code/harness-plan/SKILL.md +1 -1
  13. package/harness/bundles/general/claude-code/harness-plan/checklist.md +6 -0
  14. package/harness/bundles/general/claude-code/harness-review/SKILL.md +3 -3
  15. package/harness/bundles/general/claude-code/harness-run/SKILL.md +1 -1
  16. package/harness/bundles/general/claude-code/harness-run/checklist.md +5 -0
  17. package/harness/bundles/general/claude-code/harness-run/reference.md +33 -1
  18. package/harness/bundles/general/claude-code/harness-submit/SKILL.md +15 -10
  19. package/harness/bundles/general/claude-code/harness-submit/checklist.md +40 -76
  20. package/harness/bundles/general/claude-code/harness-sync/SKILL.md +17 -2
  21. package/harness/bundles/general/claude-code/harness-sync/reference.md +2 -2
  22. package/harness/bundles/general/claude-code/harness-test/SKILL.md +1 -1
  23. package/harness/bundles/general/claude-code/harness-test/checklist.md +9 -0
  24. package/harness/bundles/general/claude-code/harness-test/pitfalls-java.md +14 -0
  25. package/harness/bundles/general/claude-code/harness-test/reference.md +38 -0
  26. package/harness/bundles/general/claude-code/protocols/archive-report-protocol.md +26 -4
  27. package/harness/bundles/general/claude-code/protocols/ledger-protocol.md +38 -0
  28. package/harness/bundles/general/claude-code/protocols/powershell-protocol.md +16 -0
  29. package/harness/bundles/general/claude-code/protocols/report-pipeline-protocol.md +17 -0
  30. package/harness/bundles/general/claude-code/protocols/state-layout-protocol.md +15 -0
  31. package/harness/bundles/general/claude-code/scripts/harness_archive.py +1209 -170
  32. package/harness/bundles/general/claude-code/scripts/harness_change.py +18 -0
  33. package/harness/bundles/general/claude-code/scripts/harness_deploy.py +1 -44
  34. package/harness/bundles/general/claude-code/scripts/harness_events.py +174 -25
  35. package/harness/bundles/general/claude-code/scripts/harness_gate.py +203 -29
  36. package/harness/bundles/general/claude-code/scripts/harness_integration.py +878 -0
  37. package/harness/bundles/general/claude-code/scripts/harness_ledger.py +457 -10
  38. package/harness/bundles/general/claude-code/scripts/harness_paths.py +315 -0
  39. package/harness/bundles/general/claude-code/scripts/harness_profile.py +45 -0
  40. package/harness/bundles/general/claude-code/scripts/harness_review.py +326 -0
  41. package/harness/bundles/general/claude-code/scripts/harness_sync.py +407 -0
  42. package/harness/bundles/general/claude-code/scripts/harness_test_guard.py +244 -49
  43. package/harness/bundles/general/codebuddy/.harness-build.json +1 -1
  44. package/harness/bundles/general/codebuddy/contracts/workflow-policy.json +3 -3
  45. package/harness/bundles/general/codebuddy/harness-archive/SKILL.md +3 -3
  46. package/harness/bundles/general/codebuddy/harness-archive/reference.md +30 -12
  47. package/harness/bundles/general/codebuddy/harness-archive/templates/render-summary.mjs +5 -1
  48. package/harness/bundles/general/codebuddy/harness-archive/templates/summary-data-template.json +6 -2
  49. package/harness/bundles/general/codebuddy/harness-codebase-map/SKILL.md +1 -1
  50. package/harness/bundles/general/codebuddy/harness-knowledge-ingest/SKILL.md +3 -1
  51. package/harness/bundles/general/codebuddy/harness-knowledge-ingest/reference.md +7 -0
  52. package/harness/bundles/general/codebuddy/harness-knowledge-ingest/scripts/harness_knowledge.py +117 -0
  53. package/harness/bundles/general/codebuddy/harness-knowledge-query/SKILL.md +1 -1
  54. package/harness/bundles/general/codebuddy/harness-plan/SKILL.md +1 -1
  55. package/harness/bundles/general/codebuddy/harness-plan/checklist.md +6 -0
  56. package/harness/bundles/general/codebuddy/harness-review/SKILL.md +3 -3
  57. package/harness/bundles/general/codebuddy/harness-run/SKILL.md +1 -1
  58. package/harness/bundles/general/codebuddy/harness-run/checklist.md +5 -0
  59. package/harness/bundles/general/codebuddy/harness-run/reference.md +33 -1
  60. package/harness/bundles/general/codebuddy/harness-submit/SKILL.md +15 -10
  61. package/harness/bundles/general/codebuddy/harness-submit/checklist.md +40 -76
  62. package/harness/bundles/general/codebuddy/harness-sync/SKILL.md +17 -2
  63. package/harness/bundles/general/codebuddy/harness-sync/reference.md +2 -2
  64. package/harness/bundles/general/codebuddy/harness-test/SKILL.md +1 -1
  65. package/harness/bundles/general/codebuddy/harness-test/checklist.md +9 -0
  66. package/harness/bundles/general/codebuddy/harness-test/pitfalls-java.md +14 -0
  67. package/harness/bundles/general/codebuddy/harness-test/reference.md +38 -0
  68. package/harness/bundles/general/codebuddy/protocols/archive-report-protocol.md +26 -4
  69. package/harness/bundles/general/codebuddy/protocols/ledger-protocol.md +38 -0
  70. package/harness/bundles/general/codebuddy/protocols/powershell-protocol.md +16 -0
  71. package/harness/bundles/general/codebuddy/protocols/report-pipeline-protocol.md +17 -0
  72. package/harness/bundles/general/codebuddy/protocols/state-layout-protocol.md +15 -0
  73. package/harness/bundles/general/codebuddy/scripts/harness_archive.py +1209 -170
  74. package/harness/bundles/general/codebuddy/scripts/harness_change.py +18 -0
  75. package/harness/bundles/general/codebuddy/scripts/harness_deploy.py +1 -44
  76. package/harness/bundles/general/codebuddy/scripts/harness_events.py +174 -25
  77. package/harness/bundles/general/codebuddy/scripts/harness_gate.py +203 -29
  78. package/harness/bundles/general/codebuddy/scripts/harness_integration.py +878 -0
  79. package/harness/bundles/general/codebuddy/scripts/harness_ledger.py +457 -10
  80. package/harness/bundles/general/codebuddy/scripts/harness_paths.py +315 -0
  81. package/harness/bundles/general/codebuddy/scripts/harness_profile.py +45 -0
  82. package/harness/bundles/general/codebuddy/scripts/harness_review.py +326 -0
  83. package/harness/bundles/general/codebuddy/scripts/harness_sync.py +407 -0
  84. package/harness/bundles/general/codebuddy/scripts/harness_test_guard.py +244 -49
  85. package/harness/bundles/general/codex/.harness-build.json +1 -1
  86. package/harness/bundles/general/codex/contracts/workflow-policy.json +3 -3
  87. package/harness/bundles/general/codex/harness-archive/SKILL.md +3 -3
  88. package/harness/bundles/general/codex/harness-archive/reference.md +30 -12
  89. package/harness/bundles/general/codex/harness-archive/templates/render-summary.mjs +5 -1
  90. package/harness/bundles/general/codex/harness-archive/templates/summary-data-template.json +6 -2
  91. package/harness/bundles/general/codex/harness-codebase-map/SKILL.md +1 -1
  92. package/harness/bundles/general/codex/harness-knowledge-ingest/SKILL.md +3 -1
  93. package/harness/bundles/general/codex/harness-knowledge-ingest/reference.md +7 -0
  94. package/harness/bundles/general/codex/harness-knowledge-ingest/scripts/harness_knowledge.py +117 -0
  95. package/harness/bundles/general/codex/harness-knowledge-query/SKILL.md +1 -1
  96. package/harness/bundles/general/codex/harness-plan/SKILL.md +1 -1
  97. package/harness/bundles/general/codex/harness-plan/checklist.md +6 -0
  98. package/harness/bundles/general/codex/harness-review/SKILL.md +1 -1
  99. package/harness/bundles/general/codex/harness-run/SKILL.md +1 -1
  100. package/harness/bundles/general/codex/harness-run/checklist.md +5 -0
  101. package/harness/bundles/general/codex/harness-run/reference.md +33 -1
  102. package/harness/bundles/general/codex/harness-submit/SKILL.md +15 -10
  103. package/harness/bundles/general/codex/harness-submit/checklist.md +40 -76
  104. package/harness/bundles/general/codex/harness-sync/SKILL.md +17 -2
  105. package/harness/bundles/general/codex/harness-sync/reference.md +2 -2
  106. package/harness/bundles/general/codex/harness-test/SKILL.md +1 -1
  107. package/harness/bundles/general/codex/harness-test/checklist.md +9 -0
  108. package/harness/bundles/general/codex/harness-test/pitfalls-java.md +14 -0
  109. package/harness/bundles/general/codex/harness-test/reference.md +38 -0
  110. package/harness/bundles/general/codex/protocols/archive-report-protocol.md +26 -4
  111. package/harness/bundles/general/codex/protocols/ledger-protocol.md +38 -0
  112. package/harness/bundles/general/codex/protocols/powershell-protocol.md +16 -0
  113. package/harness/bundles/general/codex/protocols/report-pipeline-protocol.md +17 -0
  114. package/harness/bundles/general/codex/protocols/state-layout-protocol.md +15 -0
  115. package/harness/bundles/general/codex/scripts/harness_archive.py +1209 -170
  116. package/harness/bundles/general/codex/scripts/harness_change.py +18 -0
  117. package/harness/bundles/general/codex/scripts/harness_deploy.py +1 -44
  118. package/harness/bundles/general/codex/scripts/harness_events.py +174 -25
  119. package/harness/bundles/general/codex/scripts/harness_gate.py +203 -29
  120. package/harness/bundles/general/codex/scripts/harness_integration.py +878 -0
  121. package/harness/bundles/general/codex/scripts/harness_ledger.py +457 -10
  122. package/harness/bundles/general/codex/scripts/harness_paths.py +315 -0
  123. package/harness/bundles/general/codex/scripts/harness_profile.py +45 -0
  124. package/harness/bundles/general/codex/scripts/harness_review.py +326 -0
  125. package/harness/bundles/general/codex/scripts/harness_sync.py +407 -0
  126. package/harness/bundles/general/codex/scripts/harness_test_guard.py +244 -49
  127. package/harness/bundles/general/cursor/.harness-build.json +1 -1
  128. package/harness/bundles/general/cursor/contracts/workflow-policy.json +3 -3
  129. package/harness/bundles/general/cursor/harness-archive/SKILL.md +3 -3
  130. package/harness/bundles/general/cursor/harness-archive/reference.md +30 -12
  131. package/harness/bundles/general/cursor/harness-archive/templates/render-summary.mjs +5 -1
  132. package/harness/bundles/general/cursor/harness-archive/templates/summary-data-template.json +6 -2
  133. package/harness/bundles/general/cursor/harness-codebase-map/SKILL.md +1 -1
  134. package/harness/bundles/general/cursor/harness-knowledge-ingest/SKILL.md +3 -1
  135. package/harness/bundles/general/cursor/harness-knowledge-ingest/reference.md +7 -0
  136. package/harness/bundles/general/cursor/harness-knowledge-ingest/scripts/harness_knowledge.py +117 -0
  137. package/harness/bundles/general/cursor/harness-knowledge-query/SKILL.md +1 -1
  138. package/harness/bundles/general/cursor/harness-plan/SKILL.md +1 -1
  139. package/harness/bundles/general/cursor/harness-plan/checklist.md +6 -0
  140. package/harness/bundles/general/cursor/harness-review/SKILL.md +1 -1
  141. package/harness/bundles/general/cursor/harness-run/SKILL.md +1 -1
  142. package/harness/bundles/general/cursor/harness-run/checklist.md +5 -0
  143. package/harness/bundles/general/cursor/harness-run/reference.md +33 -1
  144. package/harness/bundles/general/cursor/harness-submit/SKILL.md +15 -10
  145. package/harness/bundles/general/cursor/harness-submit/checklist.md +40 -76
  146. package/harness/bundles/general/cursor/harness-sync/SKILL.md +17 -2
  147. package/harness/bundles/general/cursor/harness-sync/reference.md +2 -2
  148. package/harness/bundles/general/cursor/harness-test/SKILL.md +1 -1
  149. package/harness/bundles/general/cursor/harness-test/checklist.md +9 -0
  150. package/harness/bundles/general/cursor/harness-test/pitfalls-java.md +14 -0
  151. package/harness/bundles/general/cursor/harness-test/reference.md +38 -0
  152. package/harness/bundles/general/cursor/protocols/archive-report-protocol.md +26 -4
  153. package/harness/bundles/general/cursor/protocols/ledger-protocol.md +38 -0
  154. package/harness/bundles/general/cursor/protocols/powershell-protocol.md +16 -0
  155. package/harness/bundles/general/cursor/protocols/report-pipeline-protocol.md +17 -0
  156. package/harness/bundles/general/cursor/protocols/state-layout-protocol.md +15 -0
  157. package/harness/bundles/general/cursor/scripts/harness_archive.py +1209 -170
  158. package/harness/bundles/general/cursor/scripts/harness_change.py +18 -0
  159. package/harness/bundles/general/cursor/scripts/harness_deploy.py +1 -44
  160. package/harness/bundles/general/cursor/scripts/harness_events.py +174 -25
  161. package/harness/bundles/general/cursor/scripts/harness_gate.py +203 -29
  162. package/harness/bundles/general/cursor/scripts/harness_integration.py +878 -0
  163. package/harness/bundles/general/cursor/scripts/harness_ledger.py +457 -10
  164. package/harness/bundles/general/cursor/scripts/harness_paths.py +315 -0
  165. package/harness/bundles/general/cursor/scripts/harness_profile.py +45 -0
  166. package/harness/bundles/general/cursor/scripts/harness_review.py +326 -0
  167. package/harness/bundles/general/cursor/scripts/harness_sync.py +407 -0
  168. package/harness/bundles/general/cursor/scripts/harness_test_guard.py +244 -49
  169. package/harness/bundles/java/claude-code/.harness-build.json +1 -1
  170. package/harness/bundles/java/claude-code/contracts/workflow-policy.json +3 -3
  171. package/harness/bundles/java/claude-code/harness-apidoc/SKILL.md +1 -1
  172. package/harness/bundles/java/claude-code/harness-archive/SKILL.md +3 -3
  173. package/harness/bundles/java/claude-code/harness-archive/reference.md +30 -12
  174. package/harness/bundles/java/claude-code/harness-archive/templates/render-summary.mjs +5 -1
  175. package/harness/bundles/java/claude-code/harness-archive/templates/summary-data-template.json +6 -2
  176. package/harness/bundles/java/claude-code/harness-codebase-map/SKILL.md +1 -1
  177. package/harness/bundles/java/claude-code/harness-knowledge-ingest/SKILL.md +3 -1
  178. package/harness/bundles/java/claude-code/harness-knowledge-ingest/reference.md +7 -0
  179. package/harness/bundles/java/claude-code/harness-knowledge-ingest/scripts/harness_knowledge.py +117 -0
  180. package/harness/bundles/java/claude-code/harness-knowledge-query/SKILL.md +1 -1
  181. package/harness/bundles/java/claude-code/harness-package/SKILL.md +1 -1
  182. package/harness/bundles/java/claude-code/harness-plan/SKILL.md +1 -1
  183. package/harness/bundles/java/claude-code/harness-plan/checklist.md +6 -0
  184. package/harness/bundles/java/claude-code/harness-review/SKILL.md +3 -3
  185. package/harness/bundles/java/claude-code/harness-run/SKILL.md +1 -1
  186. package/harness/bundles/java/claude-code/harness-submit/SKILL.md +15 -10
  187. package/harness/bundles/java/claude-code/harness-submit/checklist.md +40 -76
  188. package/harness/bundles/java/claude-code/harness-sync/SKILL.md +17 -2
  189. package/harness/bundles/java/claude-code/harness-sync/reference.md +2 -2
  190. package/harness/bundles/java/claude-code/harness-test/SKILL.md +1 -1
  191. package/harness/bundles/java/claude-code/protocols/archive-report-protocol.md +26 -4
  192. package/harness/bundles/java/claude-code/protocols/ledger-protocol.md +38 -0
  193. package/harness/bundles/java/claude-code/protocols/powershell-protocol.md +16 -0
  194. package/harness/bundles/java/claude-code/protocols/report-pipeline-protocol.md +17 -0
  195. package/harness/bundles/java/claude-code/protocols/state-layout-protocol.md +15 -0
  196. package/harness/bundles/java/claude-code/scripts/harness_archive.py +1209 -170
  197. package/harness/bundles/java/claude-code/scripts/harness_change.py +18 -0
  198. package/harness/bundles/java/claude-code/scripts/harness_deploy.py +1 -44
  199. package/harness/bundles/java/claude-code/scripts/harness_events.py +174 -25
  200. package/harness/bundles/java/claude-code/scripts/harness_gate.py +203 -29
  201. package/harness/bundles/java/claude-code/scripts/harness_integration.py +878 -0
  202. package/harness/bundles/java/claude-code/scripts/harness_ledger.py +457 -10
  203. package/harness/bundles/java/claude-code/scripts/harness_paths.py +315 -0
  204. package/harness/bundles/java/claude-code/scripts/harness_profile.py +45 -0
  205. package/harness/bundles/java/claude-code/scripts/harness_review.py +326 -0
  206. package/harness/bundles/java/claude-code/scripts/harness_sync.py +407 -0
  207. package/harness/bundles/java/claude-code/scripts/harness_test_guard.py +244 -49
  208. package/harness/bundles/java/codebuddy/.harness-build.json +1 -1
  209. package/harness/bundles/java/codebuddy/contracts/workflow-policy.json +3 -3
  210. package/harness/bundles/java/codebuddy/harness-apidoc/SKILL.md +1 -1
  211. package/harness/bundles/java/codebuddy/harness-archive/SKILL.md +3 -3
  212. package/harness/bundles/java/codebuddy/harness-archive/reference.md +30 -12
  213. package/harness/bundles/java/codebuddy/harness-archive/templates/render-summary.mjs +5 -1
  214. package/harness/bundles/java/codebuddy/harness-archive/templates/summary-data-template.json +6 -2
  215. package/harness/bundles/java/codebuddy/harness-codebase-map/SKILL.md +1 -1
  216. package/harness/bundles/java/codebuddy/harness-knowledge-ingest/SKILL.md +3 -1
  217. package/harness/bundles/java/codebuddy/harness-knowledge-ingest/reference.md +7 -0
  218. package/harness/bundles/java/codebuddy/harness-knowledge-ingest/scripts/harness_knowledge.py +117 -0
  219. package/harness/bundles/java/codebuddy/harness-knowledge-query/SKILL.md +1 -1
  220. package/harness/bundles/java/codebuddy/harness-package/SKILL.md +1 -1
  221. package/harness/bundles/java/codebuddy/harness-plan/SKILL.md +1 -1
  222. package/harness/bundles/java/codebuddy/harness-plan/checklist.md +6 -0
  223. package/harness/bundles/java/codebuddy/harness-review/SKILL.md +3 -3
  224. package/harness/bundles/java/codebuddy/harness-run/SKILL.md +1 -1
  225. package/harness/bundles/java/codebuddy/harness-submit/SKILL.md +15 -10
  226. package/harness/bundles/java/codebuddy/harness-submit/checklist.md +40 -76
  227. package/harness/bundles/java/codebuddy/harness-sync/SKILL.md +17 -2
  228. package/harness/bundles/java/codebuddy/harness-sync/reference.md +2 -2
  229. package/harness/bundles/java/codebuddy/harness-test/SKILL.md +1 -1
  230. package/harness/bundles/java/codebuddy/protocols/archive-report-protocol.md +26 -4
  231. package/harness/bundles/java/codebuddy/protocols/ledger-protocol.md +38 -0
  232. package/harness/bundles/java/codebuddy/protocols/powershell-protocol.md +16 -0
  233. package/harness/bundles/java/codebuddy/protocols/report-pipeline-protocol.md +17 -0
  234. package/harness/bundles/java/codebuddy/protocols/state-layout-protocol.md +15 -0
  235. package/harness/bundles/java/codebuddy/scripts/harness_archive.py +1209 -170
  236. package/harness/bundles/java/codebuddy/scripts/harness_change.py +18 -0
  237. package/harness/bundles/java/codebuddy/scripts/harness_deploy.py +1 -44
  238. package/harness/bundles/java/codebuddy/scripts/harness_events.py +174 -25
  239. package/harness/bundles/java/codebuddy/scripts/harness_gate.py +203 -29
  240. package/harness/bundles/java/codebuddy/scripts/harness_integration.py +878 -0
  241. package/harness/bundles/java/codebuddy/scripts/harness_ledger.py +457 -10
  242. package/harness/bundles/java/codebuddy/scripts/harness_paths.py +315 -0
  243. package/harness/bundles/java/codebuddy/scripts/harness_profile.py +45 -0
  244. package/harness/bundles/java/codebuddy/scripts/harness_review.py +326 -0
  245. package/harness/bundles/java/codebuddy/scripts/harness_sync.py +407 -0
  246. package/harness/bundles/java/codebuddy/scripts/harness_test_guard.py +244 -49
  247. package/harness/bundles/java/codex/.harness-build.json +1 -1
  248. package/harness/bundles/java/codex/contracts/workflow-policy.json +3 -3
  249. package/harness/bundles/java/codex/harness-apidoc/SKILL.md +1 -1
  250. package/harness/bundles/java/codex/harness-archive/SKILL.md +3 -3
  251. package/harness/bundles/java/codex/harness-archive/reference.md +30 -12
  252. package/harness/bundles/java/codex/harness-archive/templates/render-summary.mjs +5 -1
  253. package/harness/bundles/java/codex/harness-archive/templates/summary-data-template.json +6 -2
  254. package/harness/bundles/java/codex/harness-codebase-map/SKILL.md +1 -1
  255. package/harness/bundles/java/codex/harness-knowledge-ingest/SKILL.md +3 -1
  256. package/harness/bundles/java/codex/harness-knowledge-ingest/reference.md +7 -0
  257. package/harness/bundles/java/codex/harness-knowledge-ingest/scripts/harness_knowledge.py +117 -0
  258. package/harness/bundles/java/codex/harness-knowledge-query/SKILL.md +1 -1
  259. package/harness/bundles/java/codex/harness-package/SKILL.md +1 -1
  260. package/harness/bundles/java/codex/harness-plan/SKILL.md +1 -1
  261. package/harness/bundles/java/codex/harness-plan/checklist.md +6 -0
  262. package/harness/bundles/java/codex/harness-review/SKILL.md +1 -1
  263. package/harness/bundles/java/codex/harness-run/SKILL.md +1 -1
  264. package/harness/bundles/java/codex/harness-submit/SKILL.md +15 -10
  265. package/harness/bundles/java/codex/harness-submit/checklist.md +40 -76
  266. package/harness/bundles/java/codex/harness-sync/SKILL.md +17 -2
  267. package/harness/bundles/java/codex/harness-sync/reference.md +2 -2
  268. package/harness/bundles/java/codex/harness-test/SKILL.md +1 -1
  269. package/harness/bundles/java/codex/protocols/archive-report-protocol.md +26 -4
  270. package/harness/bundles/java/codex/protocols/ledger-protocol.md +38 -0
  271. package/harness/bundles/java/codex/protocols/powershell-protocol.md +16 -0
  272. package/harness/bundles/java/codex/protocols/report-pipeline-protocol.md +17 -0
  273. package/harness/bundles/java/codex/protocols/state-layout-protocol.md +15 -0
  274. package/harness/bundles/java/codex/scripts/harness_archive.py +1209 -170
  275. package/harness/bundles/java/codex/scripts/harness_change.py +18 -0
  276. package/harness/bundles/java/codex/scripts/harness_deploy.py +1 -44
  277. package/harness/bundles/java/codex/scripts/harness_events.py +174 -25
  278. package/harness/bundles/java/codex/scripts/harness_gate.py +203 -29
  279. package/harness/bundles/java/codex/scripts/harness_integration.py +878 -0
  280. package/harness/bundles/java/codex/scripts/harness_ledger.py +457 -10
  281. package/harness/bundles/java/codex/scripts/harness_paths.py +315 -0
  282. package/harness/bundles/java/codex/scripts/harness_profile.py +45 -0
  283. package/harness/bundles/java/codex/scripts/harness_review.py +326 -0
  284. package/harness/bundles/java/codex/scripts/harness_sync.py +407 -0
  285. package/harness/bundles/java/codex/scripts/harness_test_guard.py +244 -49
  286. package/harness/bundles/java/cursor/.harness-build.json +1 -1
  287. package/harness/bundles/java/cursor/contracts/workflow-policy.json +3 -3
  288. package/harness/bundles/java/cursor/harness-apidoc/SKILL.md +1 -1
  289. package/harness/bundles/java/cursor/harness-archive/SKILL.md +3 -3
  290. package/harness/bundles/java/cursor/harness-archive/reference.md +30 -12
  291. package/harness/bundles/java/cursor/harness-archive/templates/render-summary.mjs +5 -1
  292. package/harness/bundles/java/cursor/harness-archive/templates/summary-data-template.json +6 -2
  293. package/harness/bundles/java/cursor/harness-codebase-map/SKILL.md +1 -1
  294. package/harness/bundles/java/cursor/harness-knowledge-ingest/SKILL.md +3 -1
  295. package/harness/bundles/java/cursor/harness-knowledge-ingest/reference.md +7 -0
  296. package/harness/bundles/java/cursor/harness-knowledge-ingest/scripts/harness_knowledge.py +117 -0
  297. package/harness/bundles/java/cursor/harness-knowledge-query/SKILL.md +1 -1
  298. package/harness/bundles/java/cursor/harness-package/SKILL.md +1 -1
  299. package/harness/bundles/java/cursor/harness-plan/SKILL.md +1 -1
  300. package/harness/bundles/java/cursor/harness-plan/checklist.md +6 -0
  301. package/harness/bundles/java/cursor/harness-review/SKILL.md +1 -1
  302. package/harness/bundles/java/cursor/harness-run/SKILL.md +1 -1
  303. package/harness/bundles/java/cursor/harness-submit/SKILL.md +15 -10
  304. package/harness/bundles/java/cursor/harness-submit/checklist.md +40 -76
  305. package/harness/bundles/java/cursor/harness-sync/SKILL.md +17 -2
  306. package/harness/bundles/java/cursor/harness-sync/reference.md +2 -2
  307. package/harness/bundles/java/cursor/harness-test/SKILL.md +1 -1
  308. package/harness/bundles/java/cursor/protocols/archive-report-protocol.md +26 -4
  309. package/harness/bundles/java/cursor/protocols/ledger-protocol.md +38 -0
  310. package/harness/bundles/java/cursor/protocols/powershell-protocol.md +16 -0
  311. package/harness/bundles/java/cursor/protocols/report-pipeline-protocol.md +17 -0
  312. package/harness/bundles/java/cursor/protocols/state-layout-protocol.md +15 -0
  313. package/harness/bundles/java/cursor/scripts/harness_archive.py +1209 -170
  314. package/harness/bundles/java/cursor/scripts/harness_change.py +18 -0
  315. package/harness/bundles/java/cursor/scripts/harness_deploy.py +1 -44
  316. package/harness/bundles/java/cursor/scripts/harness_events.py +174 -25
  317. package/harness/bundles/java/cursor/scripts/harness_gate.py +203 -29
  318. package/harness/bundles/java/cursor/scripts/harness_integration.py +878 -0
  319. package/harness/bundles/java/cursor/scripts/harness_ledger.py +457 -10
  320. package/harness/bundles/java/cursor/scripts/harness_paths.py +315 -0
  321. package/harness/bundles/java/cursor/scripts/harness_profile.py +45 -0
  322. package/harness/bundles/java/cursor/scripts/harness_review.py +326 -0
  323. package/harness/bundles/java/cursor/scripts/harness_sync.py +407 -0
  324. package/harness/bundles/java/cursor/scripts/harness_test_guard.py +244 -49
  325. package/harness/manifests/general/claude-code.json +58 -38
  326. package/harness/manifests/general/codebuddy.json +58 -38
  327. package/harness/manifests/general/codex.json +58 -38
  328. package/harness/manifests/general/cursor.json +58 -38
  329. package/harness/manifests/java/claude-code.json +52 -36
  330. package/harness/manifests/java/codebuddy.json +52 -36
  331. package/harness/manifests/java/codex.json +52 -36
  332. package/harness/manifests/java/cursor.json +52 -36
  333. package/hunter-workflow-family.json +2 -2
  334. package/package.json +1 -1
@@ -36,25 +36,24 @@ description: harness-submit 的8 步工作流详细步骤和执行日志记录
36
36
 
37
37
  > **分支名自动读取**:不硬编码 `master` 或 `main`,使用 `git rev-parse --abbrev-ref @{u}` 自动读取 upstream 分支。
38
38
 
39
+ **正常路径禁止 `git stash` / `stash pop`**。远端同步不在业务工作区执行;主目录与 worktree 模式统一由合并段的 `harness_integration.py` transaction 在隔离 integration worktree 内 fetch + merge:
40
+
39
41
  ```powershell
40
- # 0. 自动读取 upstream
42
+ # 0. 自动读取 upstream 与目标分支(只读操作)
41
43
  powershell.exe -Command "git -C '<项目路径>' rev-parse --abbrev-ref @{u}"
42
44
 
43
- # 1. 暂存当前变更
44
- powershell.exe -Command "git -C '<项目路径>' stash"
45
-
46
- # 2. 拉取并合并远程
47
- powershell.exe -Command "git -C '<项目路径>' pull --rebase"
45
+ # 1. preflight:获取 integration lock + 写 journal/保护 ref
46
+ python harness/scripts/harness_integration.py preflight --change <change-name> --run-id <run-id> --feature-branch <feature> --target-branch <target> --temp-root <task-temp>
48
47
 
49
- # 3. 恢复暂存的变更
50
- powershell.exe -Command "git -C '<项目路径>' stash pop"
48
+ # 2. prepare:fetch + 从已提交 target 创建临时 integration worktree
49
+ python harness/scripts/harness_integration.py prepare --change <change-name> --run-id <run-id> --feature-branch <feature> --target-branch <target> --temp-root <task-temp>
51
50
  ```
52
51
 
53
52
  **Shell 安全规则(强制)**:
54
53
  - 任何 git 命令被 hook 拒绝(`Denied` / `PreToolUse:Bash hook error`)→ 停止流程,不得宣称"拉取成功"
55
- - 拉取成功的判断证据:git 输出包含 `Already up to date.` 或 `Fast-forward`、`Updating <hash>..<hash>`,且 exit code 为 0
54
+ - transaction 各步骤状态以 journal 为唯一事实源;FAILED 步骤用 `recover` 续跑,不重复已完成副作用
56
55
 
57
- 如果 stash pop 冲突或 merge 冲突,参考 `reference.md` 的常见问题处理。
56
+ merge 冲突或 `TARGET_MOVED` 时,参考 `reference.md` 的恢复清单;**禁止 `checkout --ours/--theirs`**。
58
57
 
59
58
  ## 步骤 2:最终验证(ledger 复用优先)
60
59
 
@@ -311,122 +310,87 @@ powershell.exe -Command "git -C '<项目路径>' rev-parse HEAD"
311
310
 
312
311
  ---
313
312
 
314
- ## worktree 合并流程(步骤 M0–M8
313
+ ## worktree 合并流程(integration transaction,M0–M7
315
314
 
316
- > worktree 模式 commit 成功后自动执行;用户仅说「合并分支」/`/harness-merge` 且已有本地 commit 时从 M0 重入。合并方式固定 `--no-ff`;冲突 停下 用户手动解 确认后继续;**禁止 `checkout --theirs/--ours`**。
315
+ > worktree 模式 commit 成功后自动执行;用户仅说「合并分支」/`/harness-merge` 且已有本地 commit 时从 M0 重入。合并由 `harness_integration.py` transaction 执行:隔离 integration worktree + journal + 保护 ref + 精确清理。**禁止 `checkout --theirs/--ours`;正常路径禁止仓库级 stash。**
317
316
 
318
317
  ### P0 合并稳定性门禁
319
318
 
320
319
  - 主分支名不硬编码,用 `git symbolic-ref --short refs/remotes/origin/HEAD` 读取
321
320
  - push 只在主分支;worktree 分支不 push
322
- - 所有 git 命令通过 `powershell.exe -Command "..."` 执行
321
+ - 所有 git 命令通过 `powershell.exe -Command "..."` 执行(transaction 脚本内部 git 调用除外)
322
+ - transaction 步骤状态以 `.harness/state/integration/<transaction-id>/journal.json` 为唯一事实源
323
323
 
324
324
  ### 步骤 M0:启动合并段
325
325
 
326
326
  append `phase.start`(`--phase merge`;`note` 含 worktree 分支、主分支、ledger diffHash、验证策略;重入时 note 标注「重入 merge」)。
327
327
 
328
- ### 步骤 M1:切回主目录主分支
329
-
330
- ```powershell
331
- powershell.exe -Command "git -C '<项目路径>' symbolic-ref --short refs/remotes/origin/HEAD"
332
- powershell.exe -Command "git -C '<项目路径>' stash" # 主目录有未提交变更时
333
- powershell.exe -Command "git -C '<项目路径>' rev-parse --abbrev-ref HEAD"
334
- ```
335
-
336
- 不在主分支则 `git checkout <主分支>`。
337
-
338
- ### 步骤 M2:fetch + 同步主分支
328
+ ### 步骤 M1:preflight
339
329
 
340
330
  ```powershell
341
- powershell.exe -Command "git -C '<项目路径>' fetch origin"
342
- powershell.exe -Command "git -C '<项目路径>' pull --rebase"
331
+ python harness/scripts/harness_integration.py preflight --change <change-name> --run-id <run-id> --feature-branch worktree/<change-name> --target-branch <主分支> --temp-root <task-temp>
343
332
  ```
344
333
 
345
- pull 输出非 `Already up to date.` 引入他人提交M4 必须重跑验证。
334
+ 获取 integration lock、解析 base/feature head、写 journal 与保护 refs(`refs/harness/integration/<txn>/base|head`)。锁被其他 run 持有 **停止**,不改动工作区与状态文件。
346
335
 
347
- **CRLF 预检**(pull 后强制):旧 working copy 的 `.gitattributes eol=lf` 文件可能是 CRLF(.gitattributes 后加未重新检出),曾导致 `core_content_hash` 跨工作树不一致 → sync 产生 dirty → M5 失败重跑。检测并修复:
336
+ ### 步骤 M2:prepare
348
337
 
349
338
  ```powershell
350
- # 1. renormalize 暴露 CRLF 漂移(仅规范化行尾,不改内容语义)
351
- powershell.exe -Command "git -C '<项目路径>' add --renormalize ."
352
- # 2. 若 git status --porcelain 非空 → working copy 存在 CRLF 漂移
353
- powershell.exe -Command "git -C '<项目路径>' status --porcelain"
354
- # 3. 有漂移 → 弃 staging + 强制 LF 重检(worktree 合并段 M2 在主仓库 main,应 clean,安全)
355
- powershell.exe -Command "git -C '<项目路径>' reset -q; git -C '<项目路径>' checkout -- ."
356
- # 4. 重新 renormalize 确认 clean(git status --porcelain 应空)
357
- powershell.exe -Command "git -C '<项目路径>' add --renormalize .; git status --porcelain"
339
+ python harness/scripts/harness_integration.py prepare --change <change-name> --run-id <run-id> --feature-branch worktree/<change-name> --target-branch <主分支> --temp-root <task-temp>
358
340
  ```
359
341
 
360
- > cluster 1 `core_content_hash` 改用 git blob sha 后,CRLF 不再影响 core hash,但 working copy CRLF 仍可能影响 workflow-data 包内容 hash,预检仍有价值。
342
+ fetch 后从**已提交** target 创建临时 integration worktree;primary staged/unstaged/untracked/ignored mtime 均不被触碰。
361
343
 
362
- ### 步骤 M3:合并 worktree 分支
344
+ ### 步骤 M3:merge
363
345
 
364
346
  ```powershell
365
- powershell.exe -Command "git -C '<项目路径>' merge --no-ff worktree/<change-name>"
347
+ python harness/scripts/harness_integration.py merge --change <change-name> --run-id <run-id> --feature-branch worktree/<change-name> --target-branch <主分支> --temp-root <task-temp>
366
348
  ```
367
349
 
368
- 合并消息默认 `Merge branch 'worktree/<change-name>'`,用户可改文案,**方式固定 --no-ff**。
350
+ - 方式固定 `--no-ff`;merge diff 出现其他 Change 的 contract/runtime 路径 → 结构化 `FOREIGN_CHANGE_PATHS` 拒绝
351
+ - 冲突 → step FAILED:**停下**,`git -C <integration-worktree> diff --name-only --diff-filter=U` 列冲突文件,提示用户手动解决;保护 refs 与 journal 保留
352
+ - 人工解决后以 `recover` 续跑;已完成步骤返回 REUSED,不重复 merge
369
353
 
370
- ### 步骤 M4:冲突处理
354
+ ### 步骤 M4:verify(组合态验证)
371
355
 
372
- 若输出 `CONFLICT`:
356
+ integration worktree 内执行验证命令;远端引入他人提交或 ledger 不可复用时必跑:
373
357
 
374
358
  ```powershell
375
- powershell.exe -Command "git -C '<项目路径>' diff --name-only --diff-filter=U"
359
+ python harness/scripts/harness_integration.py verify --change <change-name> --run-id <run-id> --feature-branch worktree/<change-name> --target-branch <主分支> --temp-root <task-temp> --command "<resolved command>"
376
360
  ```
377
361
 
378
- - 列出冲突文件,**停下**,提示用户手动解决(编辑 `git add` → `git commit`)
379
- - 状态 `🟡WARN(merge 冲突,待手动解决:<文件列表>)`
380
- - 用户确认解决后重跑 submit(从 M0 重入)
381
- - **禁止自动 `git checkout --theirs/--ours`**
382
-
383
- ### 步骤 M5:合并后验证(ledger 复用优先)
384
-
385
- - 步骤 M2 引入他人提交 → **必须重跑** 构建+测试
386
- - 否则 diffHash 一致且 post-test 非行为性 → 🔁REUSED
387
-
388
- 重跑后写回 ledger 的 `compile`/`unitTest`,更新 `diffHash`/`currentHead`。
362
+ 任一命令非零退出step FAILED,不进入 push。
389
363
 
390
- **写 check-ok marker**(npm run check exit 0 后强制):让 pre-push hook 跳过重复 check。三重校验(marker ts<10min + command + commit tree),任一不满足照跑。marker 写入时记录 `git write-tree`,因此验证后创建 commit 不会仅因 HEAD 前移而使缓存失效。
364
+ **写 check-ok marker**(npm run check exit 0 后强制):
391
365
 
392
366
  ```powershell
393
- # npm run check exit 0 后立即写 marker(M5 或 REUSED 后均可)
394
367
  powershell.exe -Command "python harness/scripts/harness_check_gate.py --write"
395
368
  ```
396
369
 
397
- > marker 写入 `.harness/check-ok.marker`(gitignored,本地)。push 时 pre-push hook 比较 `HEAD^{tree}` 与 marker 的 `treeHash`,再校验 ts<10min + command;commit tree 未变化即可跳过,任何内容变化都照跑(安全默认)。
398
-
399
- ### 步骤 M6:push 主分支
370
+ ### 步骤 M5:push
400
371
 
401
372
  ```powershell
402
- powershell.exe -Command "git -C '<项目路径>' fetch"
403
- powershell.exe -Command "git -C '<项目路径>' log HEAD..@{u} --oneline"
373
+ python harness/scripts/harness_integration.py push --change <change-name> --run-id <run-id> --feature-branch worktree/<change-name> --target-branch <主分支> --temp-root <task-temp>
404
374
  ```
405
375
 
406
- 远端有新提交 M2;无则:
407
-
408
- ```powershell
409
- powershell.exe -Command "git -C '<项目路径>' push"
410
- ```
411
-
412
- 记录 `mergeFinalHash`:`git rev-parse HEAD`。
413
-
414
- ### 步骤 M7:清理 worktree
376
+ 远端基线漂移`TARGET_MOVED` 结构化失败,不继续。成功后 journal `pushedHead` 即 `mergeFinalHash`。
415
377
 
416
- 若存在 test-tracking manifest,删除 worktree 前必须逐一确认 manifest 路径已包含在 worktree commit 中,且合并后的主分支可用 `git ls-files --error-unmatch -- <exact-path>` 找到;任一路径缺失即停止清理并报告,防止 ignored test 随 worktree 被永久删除。
378
+ ### 步骤 M6:cleanup
417
379
 
418
380
  ```powershell
419
- powershell.exe -Command "git -C '<项目路径>' worktree remove '<worktree-path>' --force"
420
- powershell.exe -Command "git -C '<项目路径>' branch -D worktree/<change-name>"
381
+ python harness/scripts/harness_integration.py cleanup --change <change-name> --run-id <run-id> --feature-branch worktree/<change-name> --target-branch <主分支> --temp-root <task-temp>
421
382
  ```
422
383
 
423
- > Windows 兜底见 `reference.md`「Worktree 清理兜底(Windows)」。
384
+ - `git worktree remove --force` 精确路径 → 验证注销 → 临时分支 `branch -D` → (push 成功后)删除保护 refs → 释放 integration lock
385
+ - 清理只接受 journal 登记的精确 integrationRoot;仓库根、父目录、空路径、逃逸路径与其他 transaction 路径一律拒绝
386
+ - 失败保留 journal 与诊断证据,状态 🟡WARN,不得宣称清理完成
387
+ - 若存在 test-tracking manifest,确认其路径已由合并后的目标分支跟踪(`git ls-files --error-unmatch -- <exact-path>`),缺失即停止
424
388
 
425
389
  更新 `meta/worktree.json`:`created=false` + `removedAt`/`removedBy`/`removalNote`。
426
390
 
427
- ### 步骤 M8:更新 ledger + 收尾
391
+ ### 步骤 M7:更新 ledger + 收尾
428
392
 
429
- ledger 顶层写入 `"mergeFinalHash": "<hash>"`;append `phase.end`(merge 段)。
393
+ ledger 顶层写入 `"mergeFinalHash": "<journal pushedHead>"`;经 `harness_gate.py close --phase merge` 关闭(禁止手工 phase.end)。
430
394
 
431
395
  ```markdown
432
396
  ## 合并完成 — <change-name>
@@ -19,7 +19,7 @@ disallowed-tools:
19
19
  - Bash(awk *)
20
20
  - Bash(curl *)
21
21
  ---
22
- <!-- generated by harness_deploy.py; core=0d4dcc4204125f4d; overlay=none; agent=claude-code; do not edit -->
22
+ <!-- generated by harness_deploy.py; core=43088896a4556b69; overlay=none; agent=claude-code; do not edit -->
23
23
  # harness-sync — 元数据同步
24
24
 
25
25
  ## Purpose
@@ -32,6 +32,21 @@ disallowed-tools:
32
32
 
33
33
  ## Workflow(薄编排)
34
34
 
35
+ 运行开始先执行受管 runtime 生命周期:
36
+
37
+ ```powershell
38
+ python <skills-root>/scripts/harness_sync.py reap --project . --json
39
+ python <skills-root>/scripts/harness_sync.py begin --project . --run-id <run-id> --agent <agent> --purpose harness-sync --json
40
+ ```
41
+
42
+ 所有 deploy 临时产物只能写入 `begin` 返回的 `workspace`。无论正常完成、命令失败还是异常退出,都必须在 `finally` 中执行:
43
+
44
+ ```powershell
45
+ python <skills-root>/scripts/harness_sync.py finalize --project . --run-id <run-id> --json
46
+ ```
47
+
48
+ 禁止重新使用固定 `sync-deploy-*` 目录;`--keep-temp` 仅供显式诊断。
49
+
35
50
  | Phase | 检查 → 动作 |
36
51
  |-------|-------------|
37
52
  | 0 | 读 SKILL + `reference.md` + protocols |
@@ -42,7 +57,7 @@ disallowed-tools:
42
57
  | 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
58
  | 4 | CLAUDE.md 完整性/行数 → 超限 AskUserQuestion 瘦身 |
44
59
  | 5 | AGENTS.md 与 CLAUDE.md 一致 |
45
- | 6 | `.harness/` 结构(init 规程 → `reference.md` 第 6 步);可选 `harness_deploy.py diff` 检查已装 skill 是否过期 |
60
+ | 6 | `.harness/` 结构(init 规程 → `reference.md` 第 6 步);已装 skill 新鲜度只经 `hunter-harness refresh --dry-run --json` post-adaptation freshness 判断,禁止 raw build 字节比较 |
46
61
  | 7–9 | `项目规则(见 .harness/context-index.json)/`、构建配置、测试目录 — **只提示不自动修复** |
47
62
 
48
63
  状态判断表格、修复动作、输出示例 → `reference.md`
@@ -75,8 +75,8 @@ powershell.exe -Command "git -C '<项目路径>' diff --stat HEAD~5 2>$null"
75
75
  | state 目录 | `.harness/state/baseline/` 存在(internal_state) | ✅OK | 无需操作 |
76
76
  | codebase map | `.harness/codebase/map/` 状态 | — | 见第 3 步 |
77
77
  | 整体缺失 | `project.yaml` 与 `context-index.json` 均不存在 | ❌FAIL(未初始化) | 执行 `hunter-harness init`(见下方风险规程) |
78
- | .gitignore 选择性跟踪 | 未整条忽略 `.harness/`:user_editable(project.yaml/knowledge/)、generated_reviewable(codebase/map)多需跟踪;internal_state(state/)、generated_cache(cache/、generated/、reports/)不跟踪 | ✅OK | 无需操作 |
79
- | .gitignore 整体忽略 | `.gitignore` 含整条 `.harness/` | 🟡WARN(过度忽略) | 提示按 file-policy 拆分跟踪策略,而非整体忽略 |
78
+
79
+ > sync 不读取、不修改也不建议修改项目 `.gitignore` 策略(RET-34/35):三种跟踪策略(整体忽略 / 选择性跟踪 / 完全跟踪)下完整性结论相同,新鲜度由 post-adaptation projection 判定,与 Git 策略无关。
80
80
 
81
81
  > ⚠️ **`hunter-harness init` 风险规程**(`.harness/` 未初始化时触发):
82
82
  > 1. **预览**:`node packages/cli/dist/bin.js --non-interactive --dry-run --adapter claude-code --profile general --json`,确认将写入的路径清单与 `project_id`(`null` = 未绑服务器,本地自治理)。
@@ -22,7 +22,7 @@ disallowed-tools:
22
22
  - Bash(node *)
23
23
  - Bash(codegraph *)
24
24
  ---
25
- <!-- generated by harness_deploy.py; core=0d4dcc4204125f4d; overlay=none; agent=claude-code; do not edit -->
25
+ <!-- generated by harness_deploy.py; core=43088896a4556b69; 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,35 @@ 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
+ > **Ledger v3(v2 契约 / split-v1 布局起)**:`record` 强制顶层身份(缺失非零退出、不写账本);`--metrics-json` 必须过 typed schema(unit/apiContract/browserE2E/dbCompatibility 各有不同必填键);dbCompatibility 等不适用验证用 `--applicability NOT_APPLICABLE --applicability-reason "<scope 原因>"`(不计通过也不计失败)。legacy 契约行为不变。详见 `../protocols/ledger-protocol.md` 第十节。
712
+
713
+ ### 常见报错对照
714
+
715
+ | 报错 | 原因 | 处理 |
716
+ |------|------|------|
717
+ | `unsupported status: PASS` | ledger status 无 PASS | 改用 `ok` / `fail` / `not_run` |
718
+ | `TASK_NUMBER_REQUIRED` | 该 change 启用了 checkpoint(如 foundation-gate pending) | 补 `--task N` |
719
+ | skills-root / BUNDLE_IDENTITY_* | `begin` 未传或传了 `.../scripts` 子目录(`close` 不接受该参数) | 仅对 `begin` 显式传 adapter 根:`.cursor/skills` / `.claude/skills`(含 `.harness-build.json`) |
720
+ | `--profile-input` 指向文件路径 | 参数语义是 verification key | 传 `compile` / `unitTestFull` 等 key,不是 JSON 路径 |
721
+ | `record requires --files or a non-empty --profile-input file set` | 缺少输入文件集 | 补 `--files` 或 `--profile-input <key> --project <project>` |
722
+ | `--profile-input requires --project` | can-reuse/record 展开 profile 需要项目根 | 补 `--project <project>` |
723
+ | `record` 缺 `--duration-ms` / `--evidence` | 参数为必填 | 按模板补齐 |
724
+
687
725
  ## 结果分级规则
688
726
 
689
727
  > 结果状态分级与证据要求遵循 `../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 → **freeze(事件 cutoff)** → collect → source consistency → render → renderer consistency → 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
 
@@ -25,11 +27,11 @@ events.ndjson(新流程推荐;历史 archive 可缺失)
25
27
 
26
28
  ## summary-data.json
27
29
 
28
- 结构来源为 `harness-archive/templates/summary-data-template.json`(schemaVersion 2.2)。默认由 `harness_archive.py finalize` 生成;历史回放用 `harness_archive.py replay`。
30
+ 结构来源为 `harness-archive/templates/summary-data-template.json`(schemaVersion 2.3)。默认由 `harness_archive.py finalize` 生成;历史回放用 `harness_archive.py replay`。
29
31
 
30
32
  ```json
31
33
  {
32
- "schemaVersion": "2.2",
34
+ "schemaVersion": "2.3",
33
35
  "changeName": "...",
34
36
  "businessGoal": "本次变更为了做什么",
35
37
  "finalCommit": "...",
@@ -73,7 +75,8 @@ events.ndjson(新流程推荐;历史 archive 可缺失)
73
75
  "commands": [],
74
76
  "verificationChecks": [],
75
77
  "artifacts": [],
76
- "validationIssues": []
78
+ "validationIssues": [],
79
+ "sourceConsistency": {"ok": true, "issues": []}
77
80
  }
78
81
  }
79
82
  ```
@@ -141,6 +144,25 @@ PowerShell HTML renderer 仅作 legacy fallback。该脚本以 UTF-8 with BOM
141
144
 
142
145
  `validate` 是 `harness_archive.py finalize` 的内嵌同进程步骤(不存在独立 `report validate` CLI);validate error 存在时,finalize 恢复原 changes 目录并 exit 非 0,绝不删除原 changes 目录。**缺 final-summary.html 恒为 validate error**(不再有"没有 HTML 但只 warning"的分支)。
143
146
 
147
+ ## 冻结优先 finalize 与两层一致性(schemaVersion 2.3 起)
148
+
149
+ finalize 在 collect 之前**冻结事件事实**:所有 archive-fact 事件落盘并 fsync 后,写入唯一的 `phase.end` 与 `evidence/evidence-cutoff.json`(`eventCount` + `sha256` + `frozenAt`)。cutoff 之后**禁止再向归档 events.ndjson 追加任何事件**;后续报告生成事实(render/validate 结果、manifest 比对)只写入 finalize JSON payload 与 maintenance outbox,不回写事件流。collect 是纯函数:stage/timeline/durations 全部由冻结事件推导,**不存在选择性 patch 步骤**。
150
+
151
+ 两层 validator 顺序执行,任何一层失败都恢复原 change 目录并非零退出:
152
+
153
+ 1. **source consistency**(`validate_source_consistency`,render 前):summary 事实对照冻结来源——`event_count` 对 cutoff、verification 对 ledger typed metrics projection、review 计数对 sidecars。结果写入 `reportPipeline.sourceConsistency = {ok, issues}`;`ok=false` 时 issue code 含 `event-count-mismatch` / `verification-mismatch`。
154
+ 2. **renderer consistency**(`validate_summary`,render 后):HTML 对照 summary-data,数字不得漂移。
155
+
156
+ ## versioned repair(不改写原归档)
157
+
158
+ `replay` 保持只读。归档后发现不一致时,用显式修复:
159
+
160
+ ```powershell
161
+ python harness/scripts/harness_archive.py repair --archive-dir ".harness/archive/<archive-id>" --json
162
+ ```
163
+
164
+ repair 先在 archive 外生成候选 derived version,两层 validator 均通过后,才以不可变新版本写入 `derived/v<N>/{summary-data.json, final-summary.html, repair-record.json}`,并把 `derived/authoritative.json` pointer 指向该版本;**原 summary-data.json、final-summary.html 与 manifest 永不覆盖**。知识层只从 authoritative pointer 指向且 hash 校验通过的版本提取条目。
165
+
144
166
  ## 归档与知识维护解耦(§8)
145
167
 
146
168
  archive close 的破坏性事务只执行确定性 close:
@@ -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
 
@@ -313,3 +315,39 @@ ledger 的 `status` 与 final-summary 展示状态对应:
313
315
  ### 9.5 v1→v2 兼容
314
316
 
315
317
  v1 ledger 可读;entry 缺 v2 字段时 `can-reuse` 返回 `MISSING_V2_FIELDS`(insufficient-evidence),**不静默升级证据**。重新 `record`(自动补 v2 字段)后恢复复用。diffHash 算法升级后旧 ledger 一次性失效,不危险复用。
318
+
319
+ ## 十、Ledger v3(contract-gated,2026-07 起)
320
+
321
+ v3 仅在 change contract 为 schemaVersion ≥ 2(或声明 `stateOwnership.runtimeRoot`,即 split-v1 布局)时启用;legacy v1 契约与无契约目录**行为完全不变**(零回归,旧 362 测试套件证明)。
322
+
323
+ ### 10.1 强制顶层身份
324
+
325
+ v2 契约下 `record` 写入前强制解析并校验顶层身份字段,缺失且不可解析时**非零退出、不写账本**:
326
+
327
+ | 字段 | 解析顺序 |
328
+ |------|------|
329
+ | `schemaVersion` | 固定 `3` |
330
+ | `repositoryId` | `harness_paths.repository_identity(repo_root)`(远端规范化 + root commit;无远端回退 git common-dir,跨 worktree 稳定,RET-09) |
331
+ | `changeName` | change 目录名 |
332
+ | `baseCommit` | `--base-commit` → 既有 ledger 值 → `git rev-parse --verify HEAD` |
333
+ | `currentHead` | `git rev-parse --verify HEAD`(验证执行时) |
334
+ | `diffHash` | `--diff-hash` → 既有 ledger 值 → 按 ownership 范围重算(§10.3) |
335
+ | `ownershipHash` | 契约 `ownership` 段规范化 JSON 的 sha256 |
336
+
337
+ ### 10.2 类型化 metrics 与 applicability
338
+
339
+ - v2 契约下 `--metrics-json` 必须通过 `validate_metrics` 类型校验:`unitTest`/`unitTestFull` 要求 `total/passed/failed`;`apiContract` 要求 `scenariosTotal/passed/failed`;`browserE2E` 要求 `total/passed/failed`;`dbCompatibility` 要求 `applicability ∈ APPLICABLE|NOT_APPLICABLE`,`NOT_APPLICABLE` 必须带 `reason`(UT-005/RET-15、UT-006/RET-16)。未知 verification 类型放行。
340
+ - `--applicability APPLICABLE|NOT_APPLICABLE` + `--applicability-reason` 写入 entry 级 applicability;`NOT_APPLICABLE` 无 reason 直接报错。applicability **既不计入通过也不计入失败**(UT-012/RET-24)。
341
+ - legacy 契约不校验 metrics 形状(旧的 `{"run","failures"}` 松散格式继续可用)。
342
+
343
+ ### 10.3 ownership 范围 diffHash(RET-18)
344
+
345
+ `compute_ownership_diff(repo_root, base, change_dir)` 只对本变更 ownership 范围内的路径计算 diffHash:
346
+
347
+ - 排除 `.harness/state/**` 动态运行时证据(计入 `excludedRuntimeCount`)
348
+ - 他变更路径(`.harness/changes/<other>/`、`.harness/state/changes/<other>/`)单列 `foreignPaths`,不混入哈希
349
+ - 输出 `diffHash/files/foreignPaths/excludedRuntimeCount/ownedFileCount/ownershipHash`
350
+
351
+ ### 10.4 原子写入
352
+
353
+ `write_ledger` 采用 tmp → fsync → `os.replace`;replace 失败时旧账本字节不变、不留 `.tmp` 残骸。所有写路径(record / 其他命令)统一走原子写。
@@ -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 维度,并增加事件层摘要:
@@ -8,6 +8,21 @@ description: harness .harness 状态目录分层协议。用于减少根目录
8
8
 
9
9
  `.harness/changes/<change-name>/` 是变更状态真相源,但根目录不得继续堆放所有文件。新产物按子目录分层;旧路径保留读取兼容。
10
10
 
11
+ ## 双根布局(split-v1,2026-07 起)
12
+
13
+ 新 Change 将**静态合同**与**动态运行状态**分离到两个唯一所有者:
14
+
15
+ ```text
16
+ .harness/changes/<change-name>/ # contractRoot:静态合同(spec/plans/meta)
17
+ .harness/state/changes/<change-name>/ # stateRoot:动态状态(events/logs/ledger/tracking/reports/runtime)
18
+ ```
19
+
20
+ - 合同由 `meta/change-context.json` 的 `stateOwnership.contractRoot` / `stateOwnership.runtimeRoot` 声明(schemaVersion 2)。
21
+ - 动态产物(`events.ndjson`、`logs/execution-log.md`、`evidence/verification-ledger.json`、`evidence/test-tracking.json`、reports、runtime)只写 stateRoot。
22
+ - 统一解析入口:`harness_paths.py` —— `resolve_change_layout()` 返回完整双根;`resolve_state_dir_for_contract()` 供 events/ledger/test_guard/gate 内部路由。
23
+ - **legacy-colocated**:未声明 `stateOwnership` 的旧 Change 继续读写共址布局;resolve 只读,**绝不静默搬迁**;显式迁移须 copy → hash verify → atomic pointer switch。
24
+ - 功能分支不得携带共享动态状态副本;checkpoint/archive 的 evidence snapshot 从 stateRoot 生成。
25
+
11
26
  ## 推荐结构
12
27
 
13
28
  ```text