@hunter-harness/workflow-harness 0.4.0 → 0.4.2

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 (386) hide show
  1. package/harness/bundles/general/claude-code/.harness-build.json +1 -1
  2. package/harness/bundles/general/claude-code/harness-archive/SKILL.md +1 -1
  3. package/harness/bundles/general/claude-code/harness-codebase-map/SKILL.md +1 -1
  4. package/harness/bundles/general/claude-code/harness-execute/SKILL.md +1 -1
  5. package/harness/bundles/general/claude-code/harness-knowledge-ingest/SKILL.md +1 -1
  6. package/harness/bundles/general/claude-code/harness-knowledge-query/SKILL.md +1 -1
  7. package/harness/bundles/general/claude-code/harness-plan/SKILL.md +1 -1
  8. package/harness/bundles/general/claude-code/harness-pull/SKILL.md +1 -1
  9. package/harness/bundles/general/claude-code/harness-push/SKILL.md +1 -1
  10. package/harness/bundles/general/claude-code/harness-review/SKILL.md +1 -1
  11. package/harness/bundles/general/claude-code/harness-run/SKILL.md +1 -1
  12. package/harness/bundles/general/claude-code/harness-submit/SKILL.md +1 -1
  13. package/harness/bundles/general/claude-code/harness-sync/SKILL.md +1 -1
  14. package/harness/bundles/general/claude-code/harness-test/SKILL.md +1 -1
  15. package/harness/bundles/general/claude-code/scripts/harness_archive.py +29 -6
  16. package/harness/bundles/general/claude-code/scripts/harness_deploy.py +1 -1
  17. package/harness/bundles/general/claude-code/scripts/harness_knowledge_candidates.py +398 -0
  18. package/harness/bundles/general/codebuddy/.harness-build.json +1 -1
  19. package/harness/bundles/general/codebuddy/harness-archive/SKILL.md +1 -1
  20. package/harness/bundles/general/codebuddy/harness-codebase-map/SKILL.md +1 -1
  21. package/harness/bundles/general/codebuddy/harness-execute/SKILL.md +1 -1
  22. package/harness/bundles/general/codebuddy/harness-knowledge-ingest/SKILL.md +1 -1
  23. package/harness/bundles/general/codebuddy/harness-knowledge-query/SKILL.md +1 -1
  24. package/harness/bundles/general/codebuddy/harness-plan/SKILL.md +1 -1
  25. package/harness/bundles/general/codebuddy/harness-pull/SKILL.md +1 -1
  26. package/harness/bundles/general/codebuddy/harness-push/SKILL.md +1 -1
  27. package/harness/bundles/general/codebuddy/harness-review/SKILL.md +1 -1
  28. package/harness/bundles/general/codebuddy/harness-run/SKILL.md +1 -1
  29. package/harness/bundles/general/codebuddy/harness-submit/SKILL.md +1 -1
  30. package/harness/bundles/general/codebuddy/harness-sync/SKILL.md +1 -1
  31. package/harness/bundles/general/codebuddy/harness-test/SKILL.md +1 -1
  32. package/harness/bundles/general/codebuddy/scripts/harness_archive.py +29 -6
  33. package/harness/bundles/general/codebuddy/scripts/harness_deploy.py +1 -1
  34. package/harness/bundles/general/codebuddy/scripts/harness_knowledge_candidates.py +398 -0
  35. package/harness/bundles/general/codex/.harness-build.json +1 -1
  36. package/harness/bundles/general/codex/harness-archive/SKILL.md +1 -1
  37. package/harness/bundles/general/codex/harness-codebase-map/SKILL.md +1 -1
  38. package/harness/bundles/general/codex/harness-execute/SKILL.md +1 -1
  39. package/harness/bundles/general/codex/harness-knowledge-ingest/SKILL.md +1 -1
  40. package/harness/bundles/general/codex/harness-knowledge-query/SKILL.md +1 -1
  41. package/harness/bundles/general/codex/harness-plan/SKILL.md +1 -1
  42. package/harness/bundles/general/codex/harness-pull/SKILL.md +1 -1
  43. package/harness/bundles/general/codex/harness-push/SKILL.md +1 -1
  44. package/harness/bundles/general/codex/harness-review/SKILL.md +1 -1
  45. package/harness/bundles/general/codex/harness-run/SKILL.md +1 -1
  46. package/harness/bundles/general/codex/harness-submit/SKILL.md +1 -1
  47. package/harness/bundles/general/codex/harness-sync/SKILL.md +1 -1
  48. package/harness/bundles/general/codex/harness-test/SKILL.md +1 -1
  49. package/harness/bundles/general/codex/scripts/harness_archive.py +29 -6
  50. package/harness/bundles/general/codex/scripts/harness_deploy.py +1 -1
  51. package/harness/bundles/general/codex/scripts/harness_knowledge_candidates.py +398 -0
  52. package/harness/bundles/general/cursor/.harness-build.json +1 -1
  53. package/harness/bundles/general/cursor/harness-archive/SKILL.md +1 -1
  54. package/harness/bundles/general/cursor/harness-codebase-map/SKILL.md +1 -1
  55. package/harness/bundles/general/cursor/harness-execute/SKILL.md +1 -1
  56. package/harness/bundles/general/cursor/harness-knowledge-ingest/SKILL.md +1 -1
  57. package/harness/bundles/general/cursor/harness-knowledge-query/SKILL.md +1 -1
  58. package/harness/bundles/general/cursor/harness-plan/SKILL.md +1 -1
  59. package/harness/bundles/general/cursor/harness-pull/SKILL.md +1 -1
  60. package/harness/bundles/general/cursor/harness-push/SKILL.md +1 -1
  61. package/harness/bundles/general/cursor/harness-review/SKILL.md +1 -1
  62. package/harness/bundles/general/cursor/harness-run/SKILL.md +1 -1
  63. package/harness/bundles/general/cursor/harness-submit/SKILL.md +1 -1
  64. package/harness/bundles/general/cursor/harness-sync/SKILL.md +1 -1
  65. package/harness/bundles/general/cursor/harness-test/SKILL.md +1 -1
  66. package/harness/bundles/general/cursor/scripts/harness_archive.py +29 -6
  67. package/harness/bundles/general/cursor/scripts/harness_deploy.py +1 -1
  68. package/harness/bundles/general/cursor/scripts/harness_knowledge_candidates.py +398 -0
  69. package/harness/bundles/general/pi/.harness-build.json +6 -0
  70. package/harness/bundles/general/pi/CONTEXT.md +98 -0
  71. package/harness/bundles/general/pi/README.md +478 -0
  72. package/harness/bundles/general/pi/contracts/build-profile-v3.schema.json +302 -0
  73. package/harness/bundles/general/pi/contracts/ci-metrics.schema.json +36 -0
  74. package/harness/bundles/general/pi/contracts/doctor-capability.schema.json +43 -0
  75. package/harness/bundles/general/pi/contracts/external-platform-observation.schema.json +62 -0
  76. package/harness/bundles/general/pi/contracts/fixtures/managed-execution.json +341 -0
  77. package/harness/bundles/general/pi/contracts/process-identity.schema.json +132 -0
  78. package/harness/bundles/general/pi/contracts/run-session.schema.json +142 -0
  79. package/harness/bundles/general/pi/contracts/service-retirement-receipt.schema.json +85 -0
  80. package/harness/bundles/general/pi/contracts/service-session.schema.json +147 -0
  81. package/harness/bundles/general/pi/contracts/workflow-policy.json +574 -0
  82. package/harness/bundles/general/pi/harness-archive/SKILL.md +322 -0
  83. package/harness/bundles/general/pi/harness-archive/checklist.md +71 -0
  84. package/harness/bundles/general/pi/harness-archive/reference.md +150 -0
  85. package/harness/bundles/general/pi/harness-archive/scripts/gen-manifest.ps1 +31 -0
  86. package/harness/bundles/general/pi/harness-archive/templates/summary-data-template.json +218 -0
  87. package/harness/bundles/general/pi/harness-codebase-map/SKILL.md +116 -0
  88. package/harness/bundles/general/pi/harness-codebase-map/checklist.md +126 -0
  89. package/harness/bundles/general/pi/harness-codebase-map/reference.md +364 -0
  90. package/harness/bundles/general/pi/harness-codebase-map/templates/ARCHITECTURE.md +57 -0
  91. package/harness/bundles/general/pi/harness-codebase-map/templates/CONCERNS.md +49 -0
  92. package/harness/bundles/general/pi/harness-codebase-map/templates/CONVENTIONS.md +57 -0
  93. package/harness/bundles/general/pi/harness-codebase-map/templates/INTEGRATIONS.md +52 -0
  94. package/harness/bundles/general/pi/harness-codebase-map/templates/STACK.md +55 -0
  95. package/harness/bundles/general/pi/harness-codebase-map/templates/STRUCTURE.md +69 -0
  96. package/harness/bundles/general/pi/harness-codebase-map/templates/TESTING.md +64 -0
  97. package/harness/bundles/general/pi/harness-codebase-map/templates/map-manifest.schema.json +73 -0
  98. package/harness/bundles/general/pi/harness-codebase-map/templates/map-summary.md +64 -0
  99. package/harness/bundles/general/pi/harness-execute/SKILL.md +170 -0
  100. package/harness/bundles/general/pi/harness-knowledge-ingest/SKILL.md +103 -0
  101. package/harness/bundles/general/pi/harness-knowledge-query/SKILL.md +97 -0
  102. package/harness/bundles/general/pi/harness-plan/SKILL.md +157 -0
  103. package/harness/bundles/general/pi/harness-plan/checklist.md +243 -0
  104. package/harness/bundles/general/pi/harness-plan/protocols.md +133 -0
  105. package/harness/bundles/general/pi/harness-plan/reference.md +468 -0
  106. package/harness/bundles/general/pi/harness-pull/SKILL.md +55 -0
  107. package/harness/bundles/general/pi/harness-push/SKILL.md +83 -0
  108. package/harness/bundles/general/pi/harness-review/SKILL.md +166 -0
  109. package/harness/bundles/general/pi/harness-review/checklist.md +124 -0
  110. package/harness/bundles/general/pi/harness-review/protocols.md +69 -0
  111. package/harness/bundles/general/pi/harness-review/reference.md +114 -0
  112. package/harness/bundles/general/pi/harness-run/SKILL.md +188 -0
  113. package/harness/bundles/general/pi/harness-run/checklist.md +279 -0
  114. package/harness/bundles/general/pi/harness-run/protocols.md +141 -0
  115. package/harness/bundles/general/pi/harness-run/reference.md +886 -0
  116. package/harness/bundles/general/pi/harness-submit/SKILL.md +182 -0
  117. package/harness/bundles/general/pi/harness-submit/checklist.md +452 -0
  118. package/harness/bundles/general/pi/harness-submit/reference.md +152 -0
  119. package/harness/bundles/general/pi/harness-sync/SKILL.md +72 -0
  120. package/harness/bundles/general/pi/harness-sync/reference.md +176 -0
  121. package/harness/bundles/general/pi/harness-test/SKILL.md +250 -0
  122. package/harness/bundles/general/pi/harness-test/checklist.md +359 -0
  123. package/harness/bundles/general/pi/harness-test/pitfalls-java.md +14 -0
  124. package/harness/bundles/general/pi/harness-test/pitfalls.md +307 -0
  125. package/harness/bundles/general/pi/harness-test/reference.md +880 -0
  126. package/harness/bundles/general/pi/harness-test/scripts/runtime-helpers.mjs +216 -0
  127. package/harness/bundles/general/pi/protocols/archive-report-protocol.md +196 -0
  128. package/harness/bundles/general/pi/protocols/ci-layering-protocol.md +22 -0
  129. package/harness/bundles/general/pi/protocols/evidence-based-reporting-protocol.md +134 -0
  130. package/harness/bundles/general/pi/protocols/execution-session-protocol.md +52 -0
  131. package/harness/bundles/general/pi/protocols/external-platform-protocol.md +27 -0
  132. package/harness/bundles/general/pi/protocols/ledger-protocol.md +365 -0
  133. package/harness/bundles/general/pi/protocols/memory-closeout-protocol.md +21 -0
  134. package/harness/bundles/general/pi/protocols/model-routing-protocol.md +22 -0
  135. package/harness/bundles/general/pi/protocols/powershell-protocol.md +238 -0
  136. package/harness/bundles/general/pi/protocols/registry-governance-protocol.md +31 -0
  137. package/harness/bundles/general/pi/protocols/report-pipeline-protocol.md +172 -0
  138. package/harness/bundles/general/pi/protocols/sensitive-info-protocol.md +110 -0
  139. package/harness/bundles/general/pi/protocols/state-layout-protocol.md +209 -0
  140. package/harness/bundles/general/pi/protocols/submit-protocol.md +78 -0
  141. package/harness/bundles/general/pi/protocols/verification-graph-protocol.md +32 -0
  142. package/harness/bundles/general/pi/scripts/harness_adoption_metrics.py +391 -0
  143. package/harness/bundles/general/pi/scripts/harness_apidoc.py +53 -0
  144. package/harness/bundles/general/pi/scripts/harness_archive.py +11345 -0
  145. package/harness/bundles/general/pi/scripts/harness_change.py +1626 -0
  146. package/harness/bundles/general/pi/scripts/harness_check_gate.py +113 -0
  147. package/harness/bundles/general/pi/scripts/harness_context.py +1774 -0
  148. package/harness/bundles/general/pi/scripts/harness_deploy.py +968 -0
  149. package/harness/bundles/general/pi/scripts/harness_efficiency.py +443 -0
  150. package/harness/bundles/general/pi/scripts/harness_environment.py +1690 -0
  151. package/harness/bundles/general/pi/scripts/harness_events.py +2234 -0
  152. package/harness/bundles/general/pi/scripts/harness_events_sync.py +1425 -0
  153. package/harness/bundles/general/pi/scripts/harness_execution_contracts.py +596 -0
  154. package/harness/bundles/general/pi/scripts/harness_fixback.py +1975 -0
  155. package/harness/bundles/general/pi/scripts/harness_gate.py +3816 -0
  156. package/harness/bundles/general/pi/scripts/harness_headless.py +37 -0
  157. package/harness/bundles/general/pi/scripts/harness_integration.py +2564 -0
  158. package/harness/bundles/general/pi/scripts/harness_knowledge_candidates.py +796 -0
  159. package/harness/bundles/general/pi/scripts/harness_ledger.py +3556 -0
  160. package/harness/bundles/general/pi/scripts/harness_migration_head.py +220 -0
  161. package/harness/bundles/general/pi/scripts/harness_orchestration.py +344 -0
  162. package/harness/bundles/general/pi/scripts/harness_paths.py +676 -0
  163. package/harness/bundles/general/pi/scripts/harness_phase.py +1726 -0
  164. package/harness/bundles/general/pi/scripts/harness_plan_aggregate.py +249 -0
  165. package/harness/bundles/general/pi/scripts/harness_plan_finalize.py +1016 -0
  166. package/harness/bundles/general/pi/scripts/harness_preflight.py +650 -0
  167. package/harness/bundles/general/pi/scripts/harness_process.py +1065 -0
  168. package/harness/bundles/general/pi/scripts/harness_profile.py +1817 -0
  169. package/harness/bundles/general/pi/scripts/harness_report_model.py +442 -0
  170. package/harness/bundles/general/pi/scripts/harness_retry.py +175 -0
  171. package/harness/bundles/general/pi/scripts/harness_review.py +631 -0
  172. package/harness/bundles/general/pi/scripts/harness_runtime.py +2243 -0
  173. package/harness/bundles/general/pi/scripts/harness_service.py +3355 -0
  174. package/harness/bundles/general/pi/scripts/harness_state.py +365 -0
  175. package/harness/bundles/general/pi/scripts/harness_sync.py +407 -0
  176. package/harness/bundles/general/pi/scripts/harness_test_cleanup.py +175 -0
  177. package/harness/bundles/general/pi/scripts/harness_test_guard.py +1899 -0
  178. package/harness/bundles/general/pi/scripts/harness_test_runner.py +1586 -0
  179. package/harness/bundles/general/pi/scripts/harness_verification.py +593 -0
  180. package/harness/bundles/general/pi/scripts/harness_workflow_policy.py +266 -0
  181. package/harness/bundles/java/claude-code/.harness-build.json +1 -1
  182. package/harness/bundles/java/claude-code/harness-apidoc/SKILL.md +1 -1
  183. package/harness/bundles/java/claude-code/harness-archive/SKILL.md +1 -1
  184. package/harness/bundles/java/claude-code/harness-codebase-map/SKILL.md +1 -1
  185. package/harness/bundles/java/claude-code/harness-execute/SKILL.md +1 -1
  186. package/harness/bundles/java/claude-code/harness-knowledge-ingest/SKILL.md +1 -1
  187. package/harness/bundles/java/claude-code/harness-knowledge-query/SKILL.md +1 -1
  188. package/harness/bundles/java/claude-code/harness-package/SKILL.md +1 -1
  189. package/harness/bundles/java/claude-code/harness-plan/SKILL.md +1 -1
  190. package/harness/bundles/java/claude-code/harness-pull/SKILL.md +1 -1
  191. package/harness/bundles/java/claude-code/harness-push/SKILL.md +1 -1
  192. package/harness/bundles/java/claude-code/harness-review/SKILL.md +1 -1
  193. package/harness/bundles/java/claude-code/harness-run/SKILL.md +1 -1
  194. package/harness/bundles/java/claude-code/harness-submit/SKILL.md +1 -1
  195. package/harness/bundles/java/claude-code/harness-sync/SKILL.md +1 -1
  196. package/harness/bundles/java/claude-code/harness-test/SKILL.md +1 -1
  197. package/harness/bundles/java/claude-code/scripts/harness_archive.py +29 -6
  198. package/harness/bundles/java/claude-code/scripts/harness_deploy.py +1 -1
  199. package/harness/bundles/java/claude-code/scripts/harness_knowledge_candidates.py +398 -0
  200. package/harness/bundles/java/codebuddy/.harness-build.json +1 -1
  201. package/harness/bundles/java/codebuddy/harness-apidoc/SKILL.md +1 -1
  202. package/harness/bundles/java/codebuddy/harness-archive/SKILL.md +1 -1
  203. package/harness/bundles/java/codebuddy/harness-codebase-map/SKILL.md +1 -1
  204. package/harness/bundles/java/codebuddy/harness-execute/SKILL.md +1 -1
  205. package/harness/bundles/java/codebuddy/harness-knowledge-ingest/SKILL.md +1 -1
  206. package/harness/bundles/java/codebuddy/harness-knowledge-query/SKILL.md +1 -1
  207. package/harness/bundles/java/codebuddy/harness-package/SKILL.md +1 -1
  208. package/harness/bundles/java/codebuddy/harness-plan/SKILL.md +1 -1
  209. package/harness/bundles/java/codebuddy/harness-pull/SKILL.md +1 -1
  210. package/harness/bundles/java/codebuddy/harness-push/SKILL.md +1 -1
  211. package/harness/bundles/java/codebuddy/harness-review/SKILL.md +1 -1
  212. package/harness/bundles/java/codebuddy/harness-run/SKILL.md +1 -1
  213. package/harness/bundles/java/codebuddy/harness-submit/SKILL.md +1 -1
  214. package/harness/bundles/java/codebuddy/harness-sync/SKILL.md +1 -1
  215. package/harness/bundles/java/codebuddy/harness-test/SKILL.md +1 -1
  216. package/harness/bundles/java/codebuddy/scripts/harness_archive.py +29 -6
  217. package/harness/bundles/java/codebuddy/scripts/harness_deploy.py +1 -1
  218. package/harness/bundles/java/codebuddy/scripts/harness_knowledge_candidates.py +398 -0
  219. package/harness/bundles/java/codex/.harness-build.json +1 -1
  220. package/harness/bundles/java/codex/harness-apidoc/SKILL.md +1 -1
  221. package/harness/bundles/java/codex/harness-archive/SKILL.md +1 -1
  222. package/harness/bundles/java/codex/harness-codebase-map/SKILL.md +1 -1
  223. package/harness/bundles/java/codex/harness-execute/SKILL.md +1 -1
  224. package/harness/bundles/java/codex/harness-knowledge-ingest/SKILL.md +1 -1
  225. package/harness/bundles/java/codex/harness-knowledge-query/SKILL.md +1 -1
  226. package/harness/bundles/java/codex/harness-package/SKILL.md +1 -1
  227. package/harness/bundles/java/codex/harness-plan/SKILL.md +1 -1
  228. package/harness/bundles/java/codex/harness-pull/SKILL.md +1 -1
  229. package/harness/bundles/java/codex/harness-push/SKILL.md +1 -1
  230. package/harness/bundles/java/codex/harness-review/SKILL.md +1 -1
  231. package/harness/bundles/java/codex/harness-run/SKILL.md +1 -1
  232. package/harness/bundles/java/codex/harness-submit/SKILL.md +1 -1
  233. package/harness/bundles/java/codex/harness-sync/SKILL.md +1 -1
  234. package/harness/bundles/java/codex/harness-test/SKILL.md +1 -1
  235. package/harness/bundles/java/codex/scripts/harness_archive.py +29 -6
  236. package/harness/bundles/java/codex/scripts/harness_deploy.py +1 -1
  237. package/harness/bundles/java/codex/scripts/harness_knowledge_candidates.py +398 -0
  238. package/harness/bundles/java/cursor/.harness-build.json +1 -1
  239. package/harness/bundles/java/cursor/harness-apidoc/SKILL.md +1 -1
  240. package/harness/bundles/java/cursor/harness-archive/SKILL.md +1 -1
  241. package/harness/bundles/java/cursor/harness-codebase-map/SKILL.md +1 -1
  242. package/harness/bundles/java/cursor/harness-execute/SKILL.md +1 -1
  243. package/harness/bundles/java/cursor/harness-knowledge-ingest/SKILL.md +1 -1
  244. package/harness/bundles/java/cursor/harness-knowledge-query/SKILL.md +1 -1
  245. package/harness/bundles/java/cursor/harness-package/SKILL.md +1 -1
  246. package/harness/bundles/java/cursor/harness-plan/SKILL.md +1 -1
  247. package/harness/bundles/java/cursor/harness-pull/SKILL.md +1 -1
  248. package/harness/bundles/java/cursor/harness-push/SKILL.md +1 -1
  249. package/harness/bundles/java/cursor/harness-review/SKILL.md +1 -1
  250. package/harness/bundles/java/cursor/harness-run/SKILL.md +1 -1
  251. package/harness/bundles/java/cursor/harness-submit/SKILL.md +1 -1
  252. package/harness/bundles/java/cursor/harness-sync/SKILL.md +1 -1
  253. package/harness/bundles/java/cursor/harness-test/SKILL.md +1 -1
  254. package/harness/bundles/java/cursor/scripts/harness_archive.py +29 -6
  255. package/harness/bundles/java/cursor/scripts/harness_deploy.py +1 -1
  256. package/harness/bundles/java/cursor/scripts/harness_knowledge_candidates.py +398 -0
  257. package/harness/bundles/java/pi/.harness-build.json +6 -0
  258. package/harness/bundles/java/pi/CONTEXT.md +98 -0
  259. package/harness/bundles/java/pi/README.md +478 -0
  260. package/harness/bundles/java/pi/contracts/build-profile-v3.schema.json +302 -0
  261. package/harness/bundles/java/pi/contracts/ci-metrics.schema.json +36 -0
  262. package/harness/bundles/java/pi/contracts/doctor-capability.schema.json +43 -0
  263. package/harness/bundles/java/pi/contracts/external-platform-observation.schema.json +62 -0
  264. package/harness/bundles/java/pi/contracts/fixtures/managed-execution.json +341 -0
  265. package/harness/bundles/java/pi/contracts/process-identity.schema.json +132 -0
  266. package/harness/bundles/java/pi/contracts/run-session.schema.json +142 -0
  267. package/harness/bundles/java/pi/contracts/service-retirement-receipt.schema.json +85 -0
  268. package/harness/bundles/java/pi/contracts/service-session.schema.json +147 -0
  269. package/harness/bundles/java/pi/contracts/workflow-policy.json +574 -0
  270. package/harness/bundles/java/pi/harness-apidoc/SKILL.md +97 -0
  271. package/harness/bundles/java/pi/harness-apidoc/checklist.md +142 -0
  272. package/harness/bundles/java/pi/harness-apidoc/reference.md +233 -0
  273. package/harness/bundles/java/pi/harness-archive/SKILL.md +322 -0
  274. package/harness/bundles/java/pi/harness-archive/checklist.md +71 -0
  275. package/harness/bundles/java/pi/harness-archive/reference.md +150 -0
  276. package/harness/bundles/java/pi/harness-archive/scripts/gen-manifest.ps1 +31 -0
  277. package/harness/bundles/java/pi/harness-archive/templates/summary-data-template.json +218 -0
  278. package/harness/bundles/java/pi/harness-codebase-map/SKILL.md +116 -0
  279. package/harness/bundles/java/pi/harness-codebase-map/checklist.md +126 -0
  280. package/harness/bundles/java/pi/harness-codebase-map/reference.md +364 -0
  281. package/harness/bundles/java/pi/harness-codebase-map/templates/ARCHITECTURE.md +57 -0
  282. package/harness/bundles/java/pi/harness-codebase-map/templates/CONCERNS.md +49 -0
  283. package/harness/bundles/java/pi/harness-codebase-map/templates/CONVENTIONS.md +57 -0
  284. package/harness/bundles/java/pi/harness-codebase-map/templates/INTEGRATIONS.md +52 -0
  285. package/harness/bundles/java/pi/harness-codebase-map/templates/STACK.md +55 -0
  286. package/harness/bundles/java/pi/harness-codebase-map/templates/STRUCTURE.md +69 -0
  287. package/harness/bundles/java/pi/harness-codebase-map/templates/TESTING.md +64 -0
  288. package/harness/bundles/java/pi/harness-codebase-map/templates/map-manifest.schema.json +73 -0
  289. package/harness/bundles/java/pi/harness-codebase-map/templates/map-summary.md +64 -0
  290. package/harness/bundles/java/pi/harness-execute/SKILL.md +170 -0
  291. package/harness/bundles/java/pi/harness-knowledge-ingest/SKILL.md +103 -0
  292. package/harness/bundles/java/pi/harness-knowledge-query/SKILL.md +97 -0
  293. package/harness/bundles/java/pi/harness-package/SKILL.md +94 -0
  294. package/harness/bundles/java/pi/harness-package/checklist.md +322 -0
  295. package/harness/bundles/java/pi/harness-package/reference.md +210 -0
  296. package/harness/bundles/java/pi/harness-plan/SKILL.md +157 -0
  297. package/harness/bundles/java/pi/harness-plan/checklist.md +243 -0
  298. package/harness/bundles/java/pi/harness-plan/protocols.md +133 -0
  299. package/harness/bundles/java/pi/harness-plan/reference.md +468 -0
  300. package/harness/bundles/java/pi/harness-pull/SKILL.md +55 -0
  301. package/harness/bundles/java/pi/harness-push/SKILL.md +83 -0
  302. package/harness/bundles/java/pi/harness-review/SKILL.md +166 -0
  303. package/harness/bundles/java/pi/harness-review/checklist.md +124 -0
  304. package/harness/bundles/java/pi/harness-review/protocols.md +69 -0
  305. package/harness/bundles/java/pi/harness-review/reference.md +114 -0
  306. package/harness/bundles/java/pi/harness-run/SKILL.md +206 -0
  307. package/harness/bundles/java/pi/harness-run/checklist.md +252 -0
  308. package/harness/bundles/java/pi/harness-run/protocols.md +141 -0
  309. package/harness/bundles/java/pi/harness-run/reference.md +820 -0
  310. package/harness/bundles/java/pi/harness-submit/SKILL.md +189 -0
  311. package/harness/bundles/java/pi/harness-submit/checklist.md +452 -0
  312. package/harness/bundles/java/pi/harness-submit/reference.md +152 -0
  313. package/harness/bundles/java/pi/harness-sync/SKILL.md +72 -0
  314. package/harness/bundles/java/pi/harness-sync/reference.md +176 -0
  315. package/harness/bundles/java/pi/harness-test/SKILL.md +264 -0
  316. package/harness/bundles/java/pi/harness-test/checklist.md +320 -0
  317. package/harness/bundles/java/pi/harness-test/pitfalls-java.md +16 -0
  318. package/harness/bundles/java/pi/harness-test/pitfalls.md +307 -0
  319. package/harness/bundles/java/pi/harness-test/reference.md +792 -0
  320. package/harness/bundles/java/pi/harness-test/scripts/runtime-helpers.mjs +216 -0
  321. package/harness/bundles/java/pi/protocols/archive-report-protocol.md +196 -0
  322. package/harness/bundles/java/pi/protocols/ci-layering-protocol.md +22 -0
  323. package/harness/bundles/java/pi/protocols/evidence-based-reporting-protocol.md +134 -0
  324. package/harness/bundles/java/pi/protocols/execution-session-protocol.md +52 -0
  325. package/harness/bundles/java/pi/protocols/external-platform-protocol.md +27 -0
  326. package/harness/bundles/java/pi/protocols/ledger-protocol.md +365 -0
  327. package/harness/bundles/java/pi/protocols/memory-closeout-protocol.md +21 -0
  328. package/harness/bundles/java/pi/protocols/model-routing-protocol.md +22 -0
  329. package/harness/bundles/java/pi/protocols/powershell-protocol.md +238 -0
  330. package/harness/bundles/java/pi/protocols/registry-governance-protocol.md +31 -0
  331. package/harness/bundles/java/pi/protocols/report-pipeline-protocol.md +172 -0
  332. package/harness/bundles/java/pi/protocols/sensitive-info-protocol.md +110 -0
  333. package/harness/bundles/java/pi/protocols/state-layout-protocol.md +209 -0
  334. package/harness/bundles/java/pi/protocols/submit-protocol.md +78 -0
  335. package/harness/bundles/java/pi/protocols/verification-graph-protocol.md +32 -0
  336. package/harness/bundles/java/pi/scripts/harness_adoption_metrics.py +391 -0
  337. package/harness/bundles/java/pi/scripts/harness_apidoc.py +53 -0
  338. package/harness/bundles/java/pi/scripts/harness_archive.py +11345 -0
  339. package/harness/bundles/java/pi/scripts/harness_change.py +1626 -0
  340. package/harness/bundles/java/pi/scripts/harness_check_gate.py +113 -0
  341. package/harness/bundles/java/pi/scripts/harness_context.py +1774 -0
  342. package/harness/bundles/java/pi/scripts/harness_deploy.py +968 -0
  343. package/harness/bundles/java/pi/scripts/harness_efficiency.py +443 -0
  344. package/harness/bundles/java/pi/scripts/harness_environment.py +1690 -0
  345. package/harness/bundles/java/pi/scripts/harness_events.py +2234 -0
  346. package/harness/bundles/java/pi/scripts/harness_events_sync.py +1425 -0
  347. package/harness/bundles/java/pi/scripts/harness_execution_contracts.py +596 -0
  348. package/harness/bundles/java/pi/scripts/harness_fixback.py +1975 -0
  349. package/harness/bundles/java/pi/scripts/harness_gate.py +3816 -0
  350. package/harness/bundles/java/pi/scripts/harness_headless.py +37 -0
  351. package/harness/bundles/java/pi/scripts/harness_integration.py +2564 -0
  352. package/harness/bundles/java/pi/scripts/harness_knowledge_candidates.py +796 -0
  353. package/harness/bundles/java/pi/scripts/harness_ledger.py +3556 -0
  354. package/harness/bundles/java/pi/scripts/harness_migration_head.py +220 -0
  355. package/harness/bundles/java/pi/scripts/harness_orchestration.py +344 -0
  356. package/harness/bundles/java/pi/scripts/harness_paths.py +676 -0
  357. package/harness/bundles/java/pi/scripts/harness_phase.py +1726 -0
  358. package/harness/bundles/java/pi/scripts/harness_plan_aggregate.py +249 -0
  359. package/harness/bundles/java/pi/scripts/harness_plan_finalize.py +1016 -0
  360. package/harness/bundles/java/pi/scripts/harness_preflight.py +650 -0
  361. package/harness/bundles/java/pi/scripts/harness_process.py +1065 -0
  362. package/harness/bundles/java/pi/scripts/harness_profile.py +1817 -0
  363. package/harness/bundles/java/pi/scripts/harness_report_model.py +442 -0
  364. package/harness/bundles/java/pi/scripts/harness_retry.py +175 -0
  365. package/harness/bundles/java/pi/scripts/harness_review.py +631 -0
  366. package/harness/bundles/java/pi/scripts/harness_runtime.py +2243 -0
  367. package/harness/bundles/java/pi/scripts/harness_service.py +3355 -0
  368. package/harness/bundles/java/pi/scripts/harness_state.py +365 -0
  369. package/harness/bundles/java/pi/scripts/harness_sync.py +407 -0
  370. package/harness/bundles/java/pi/scripts/harness_test_cleanup.py +175 -0
  371. package/harness/bundles/java/pi/scripts/harness_test_guard.py +1899 -0
  372. package/harness/bundles/java/pi/scripts/harness_test_runner.py +1586 -0
  373. package/harness/bundles/java/pi/scripts/harness_verification.py +593 -0
  374. package/harness/bundles/java/pi/scripts/harness_workflow_policy.py +266 -0
  375. package/harness/manifests/general/claude-code.json +17 -17
  376. package/harness/manifests/general/codebuddy.json +17 -17
  377. package/harness/manifests/general/codex.json +17 -17
  378. package/harness/manifests/general/cursor.json +17 -17
  379. package/harness/manifests/general/pi.json +475 -0
  380. package/harness/manifests/java/claude-code.json +19 -19
  381. package/harness/manifests/java/codebuddy.json +19 -19
  382. package/harness/manifests/java/codex.json +19 -19
  383. package/harness/manifests/java/cursor.json +19 -19
  384. package/harness/manifests/java/pi.json +499 -0
  385. package/hunter-workflow-family.json +2 -2
  386. package/package.json +1 -1
@@ -0,0 +1,166 @@
1
+ ---
2
+ name: harness-review
3
+ description: 6维度代码审查(架构/安全/规范/兼容/测试/性能),对照项目规则(见
4
+ .harness/context-index.json)和测试场景表,在隔离上下文运行。仅当用户显式调用 /harness-review 时使用;不得在
5
+ test 结束后自动接续执行。
6
+ ---
7
+ <!-- generated by harness_deploy.py; core=c6237736626a939b; overlay=java; agent=pi; do not edit -->
8
+ # harness-review — 代码审查
9
+
10
+ ## Purpose
11
+
12
+ 对 git diff 进行6维度审查,对照项目规则和测试场景表,输出分级报告。**审查结果仅供参考,默认不阻塞后续 submit/archive 流程。**
13
+
14
+ ## When to Use
15
+
16
+ 仅当用户显式调用 `/harness-review` 时执行。test 阶段结束后**不自动**进入本阶段;用户口头提到"审查/review"而未调用本 skill 时,先确认是否走 Harness 审查阶段。
17
+
18
+ **单阶段原则**:review 关门(报告 + fixback 产出)后必须停止并交还用户,仅提示下一步可执行 `/harness-execute --fixback`(有待修项)或 `/harness-submit`;禁止自动接续执行。
19
+
20
+ ## Inputs
21
+
22
+ - `$ARGUMENTS`:变更名(可选,留空时自动扫描 `.harness/changes/*/plans/` 确定)
23
+ - 相关文件:`.harness/changes/*/plans/*-plan.md`、`项目规则(见 .harness/context-index.json)/`、测试场景表
24
+
25
+ ## 前置条件
26
+
27
+ - `.harness/changes/<change-name>/plans/<change-name>-plan.md` 存在(任务真相源)
28
+ - 必须读取 `.harness/changes/<change-name>/meta/worktree.json`:`requested=true` 且 worktree 已创建 → 在 worktree 目录中执行审查;`requested=true` 但 worktree 不存在 → 停止,提示先修复 `harness-run`,不得静默回主目录
29
+ - **review 不阻塞后续流程**:test 报告缺失或未运行不阻止 review(review 是参考性阶段),但应在报告中标注 test 状态供参考
30
+
31
+ ## 统一读取协议
32
+
33
+ 0. **脚本在 `<skills-root>/scripts/` 共享,不在每个 skill 子目录下** — 实际形态是 `.codebuddy/skills/scripts/harness_*.py`(`.claude`/`.cursor`/`.codex` 同理),**没有** `.../skills/harness-<phase>/scripts/`。plan、run/test、archive 三份执行日志里都先猜成后者、报 `No such file` 再靠 Search 找回来;照第一种写法直接用
34
+ 1. **`.harness/changes/<change-name>/` 是唯一真相源** — 所有输入从该目录读取,产物写入对应子目录
35
+ 2. **change-name 优先从 frontmatter 读取** — `plans/*-design.md`、`spec/*-design.md`、`plans/*-plan.md` 的 YAML `change-name`
36
+ 3. **frontmatter 缺失时兼容旧格式** — 从路径推断,标记 `🟡 legacy-plan`,不失败
37
+ 4. **design** — 设计真相源按序取第一个存在的:`plans/<change>-design.md`(v2 发布产物,哈希绑定)→ `spec/<change>-design.md`(legacy 手写)。两份**同时存在**时以 `plans/` 为准,并记 `🟡 WARN 设计文档双份`——v2 发布的那份才受完整性门禁保护,读手写的那份等于绕过校验
38
+ 5. **plan** — 任务真相源:`plans/<change>-plan.md`
39
+ 6. **implementation-detail** — 自适应执行参考;legacy 缺失 🟡WARN,不阻断
40
+ 7. **test-scenarios** — 测试真相源:`plans/<change>-test-scenarios.md`
41
+ 8. **禁止读取 `docs/superpowers/` 作为正式输入** — 旧草稿仅人工线索
42
+ 9. **每个 skill 边界只刷新一次状态快照** — 先运行 `python <skills-root>/scripts/harness_state.py capture --project . --change-dir ".harness/changes/<change-name>" --json`。首次 Plan 捕获时,脚本把当时的 Git HEAD 写入不可变 `changeBase`;后续阶段只刷新 `git.head` 与各段指纹,不得用当前 HEAD 覆盖 `changeBase`。只有迁移旧 change 且已能证明真实计划起点时,才在首次补录时传 `--base <baseCommit>`。`changedSegments=[]` 时复用已有 profile/rules/map/change/code 指纹,不再重复跑全量 `harness-sync` 或代码库扫描。`knowledge` 段仅为兼容空段,知识始终按需远端查询;快照不能替代源码读取和验证门禁。
43
+
44
+ 状态目录分层:新路径优先,旧路径兼容 → [[../protocols/state-layout-protocol.md|state-layout-protocol]]
45
+ > 片段:read-protocol
46
+
47
+ ## Workflow
48
+
49
+ 先用 `harness_context.py prepare --phase review --executor <tool> [--change <id>] --json` 与 `harness_context.py begin --phase review --change <id> --executor <tool> --json` 解析唯一 active change 并校验实际前序 receipt;多个 active change 未显式选择时返回 `ACTIVE_CHANGE_AMBIGUOUS`,禁止再按 Glob/mtime 猜测。阶段门禁使用 `harness_gate.py begin --phase review --change <id> --task <n> --skills-root <skills-root> --executor-tool <tool> --json`;结束时只执行一次 `harness_gate.py close`,正常路径的 `--to-phase` 取 `plannedPhases` 中 review 的后继,Fixback 才返回 run。由 gate 完成阶段事件、租约、上下文交接与远端补传。不得手工追加阶段边界或再次调用 context close;任一 close 失败不得宣称评审完成。
50
+
51
+ 0. **启动准备** — 确定变更名(Glob `.harness/changes/*/plans/*-plan.md`,排除 `.harness/archive/*/`,读 frontmatter 提取 change-name);**append `phase.start` 事件**(不得等审查完成才补)
52
+ 1. **读取 worktree 状态(门禁检查)** — 读 `.harness/changes/<change-name>/meta/worktree.json`:`requested=true` 但 worktree 不存在 → 停止并提示先修复 `harness-run`,不得静默回主目录(否则 git diff 为空);`requested=true` 且 worktree 已创建 → spawned agent 用该 worktree 路径执行 `git diff`(确保审查 worktree 变更而非主目录);`requested=false` → 审查主目录变更
53
+ <!-- @section-id review.delegate -->
54
+ ### 2. 审查执行(独立评审优先)
55
+
56
+ 环境已安装 pi-subagents 扩展(提供 `subagent` 工具)时,默认优先临时委派一次只读审查,**不要求安装固定 `harness-reviewer`,也不运行固定 `harness-reviewer` 预检**。子任务只读取 diff、规则和测试证据;主会话核验并写报告。无法委派、spawn 失败、空返回或无报告正文 → 不 retry,继续主会话审查。每次都记一条 `decision`,用 `REVIEW_DELEGATED` 或相应 `REVIEW_INLINE_*` 原因码说明是否委派及原因;正常 inline 不显示为故障。
57
+ ## Review 定位(重要)
58
+
59
+ **harness-review 是参考性代码审查阶段,不是硬门禁。**
60
+
61
+ | 等级 | 含义 | 后续影响 |
62
+ |:----:|------|----------|
63
+ | RED | 高风险建议,强烈建议处理 | 不阻塞后续流程 |
64
+ | YELLOW | 中低风险建议 | 不阻塞后续流程 |
65
+ | OK | 无问题 | 不阻塞后续流程 |
66
+
67
+ - 审查结果默认只作为参考,不阻塞 `/harness-submit`、`/harness-archive`
68
+ - 除非用户显式要求"review 结果阻塞提交",否则 review 不参与硬门禁
69
+ - Review 报告中**禁止写**:阻塞 submit / 必须修复后才能继续
70
+ - Review 报告中**应写**:建议优先处理 / 建议在 submit 前人工确认 / 建议补充测试 / 仅供参考,不阻塞后续 harness 流程
71
+
72
+ ### 可选 strict-review-gate 配置
73
+
74
+ 如果团队希望 review 结果阻塞提交,可在 `.harness/config/harness-test-config.md` 中设置:
75
+
76
+ ```yaml
77
+ review:
78
+ strict-review-gate: true # 默认 false
79
+ ```
80
+
81
+ 当且仅当 `strict-review-gate: true` 时,review RED 才阻塞 submit。默认行为是 `strict-review-gate: false`。
82
+
83
+ ## Output Format
84
+
85
+ 审查报告保存到 `.harness/changes/<change-name>/reports/review/review-report-YYYYMMDD-HHmm.md`(时间戳区分多次运行),同时在控制台输出摘要。报告格式详见 `reference.md` 的「输出报告完整模板」。
86
+
87
+ ## 渐进披露
88
+
89
+ - **Read `checklist.md`** 仅在执行完整6维度审查时 — 含6维度检查项详细列表 + 输出格式 + 执行日志记录模板
90
+ - **Read `reference.md`** 仅在需要理解审查标准或生成详细报告时 — 含"为什么需要审查"概述 + 严重级别判定标准 + 输出报告完整模板
91
+ - **Read `protocols.md`** 仅在 RED/YELLOW 问题需要转化为修复反馈时 — 含 `review-fixback-protocol` 的结构化 fixback 字段与落盘要求
92
+
93
+ ## 原生修复反馈协议
94
+
95
+ `/harness-review` 不再运行时调用 Superpowers `receiving-code-review`。审查后的修复反馈能力内化为 `protocols.md` 的 `review-fixback-protocol`:
96
+
97
+ 1. RED/YELLOW 问题转成 fixback 条目:严重级别、位置、风险、建议、验证方式、对 submit 的影响。
98
+ 2. fixback 落盘到 `.harness/changes/<change-name>/reports/review/fixback-YYYYMMDD-HHmm.md`。
99
+ 3. 无 RED/YELLOW 时记录跳过原因,不制造空修复任务。
100
+
101
+ 没有 `.codegraph/` 只意味着“项目尚未建立 CodeGraph 索引,已直接读取源码”,不得将它写成独立评审不可用或委派失败原因。历史英文原因码不得进入摘要;稳定码只写结构化字段并留在技术详情。
102
+
103
+ ## P0 执行可信度规则
104
+
105
+ - 命令结果不得靠猜测;普通 Bash 被拒 → 立即改用等价 PowerShell 重试一次
106
+ - 仅 PowerShell 成功且有明确证据(构建/git/测试输出、文件存在、exit 0)时可标 ✅OK;否则 ❌FAIL 或 🟡WARN
107
+ - 禁止把 hook 拒绝、静态验证、无输出、用户跳过说成成功 → 详见 [[../protocols/powershell-protocol.md|powershell-protocol]]、[[../protocols/evidence-based-reporting-protocol.md|evidence-based-reporting-protocol]]
108
+
109
+ ## 生成内容语言约定
110
+
111
+ - sync/ingest 等生成的文档、规则、知识条目、架构说明一律**优先使用中文**撰写(标识符、命令、代码、API 字段名保持原文)
112
+ - 面向平台展示的标题/摘要/正文默认中文;仅当用户明确要求或目标系统强制时才用英文
113
+ > 片段:p0-trust
114
+
115
+ ## 关键规则(硬门禁速查)
116
+
117
+ > 每条规则的详细判定、检查项见 `checklist.md` 对应章节;Shell 执行安全见 `../protocols/powershell-protocol.md`,敏感信息见 `../protocols/sensitive-info-protocol.md`,证据化报告见 `../protocols/evidence-based-reporting-protocol.md`,状态目录见 `../protocols/state-layout-protocol.md`,结构化报告事件见 `../protocols/report-pipeline-protocol.md`。
118
+
119
+ ### 一、只审查 git diff 变更部分
120
+
121
+ 只审查本次 `git diff` 中的变更,不审查已有代码;diff 为空 → 直接返回"无变更可审查"。每个问题给出具体修复建议(文件:行号 + 建议做法)。
122
+
123
+ ### 二、严重级别三态
124
+
125
+ RED=高风险建议(强烈建议处理),YELLOW=中低风险建议,OK=无问题。6维度逐文件审查(架构/安全/规范/兼容/测试/性能)—— 检查项见 `checklist.md`。判定标准见 `reference.md`「严重级别判定标准」。
126
+
127
+ ### 三、review 结果仅供参考(不阻塞后续流程)
128
+
129
+ review 结果默认只作参考,不阻塞 submit/archive;报告措辞遵循 `## Review 定位(重要)` 的“禁止写/应写”清单,不得出现“阻塞 submit / 必须修复后才能继续”。
130
+
131
+ ### 四、Shell 安全 / 敏感信息 / 证据化报告 / CodeGraph 探索
132
+
133
+ git diff/log 命令通过 `powershell.exe -Command "..."` 执行;review-report 中如发现明文 token/密码/密钥,必须列入 RED 问题并在报告中以 `<TOKEN_REDACTED>` 等占位符引用;RED/YELLOW/OK 结论必须基于实际 diff 内容,不得凭印象判断。代码探索必须优先使用 CodeGraph MCP 工具(`mcp__codegraph__codegraph_explore`),不允许通过普通 Bash 调 codegraph 命令(已列入 `disallowed-tools`);采纳任何返回源码前,按 `reference.md` 的 C12 合同校验 executionRoot/rootPath、worktreeId、repositoryId、HEAD 与 index snapshot,`IDENTITY_MISMATCH` 必须读取实际 worktree,不得当作 stale 忽略;MCP 不可用时降级为 Grep/Glob + Read,并在执行日志记录降级原因。遵循 `../protocols/powershell-protocol.md` / `sensitive-info-protocol.md` / `evidence-based-reporting-protocol.md`。
134
+
135
+ ### 五、state snapshot 与源码重验
136
+
137
+ review 读取 `state-snapshot.json`(`harness_state.py` / state-layout-protocol §state-snapshot.json)的 code/diff 段确定审查范围;snapshot 失效或代码段变化时**必须重新读取实际变更源码**,不得仅凭缓存快照跳过源码审查(design §3.6)。
138
+
139
+ ## 交互白名单
140
+
141
+ **无** blocking user confirmation(审查全自动)。委派失败 → 主会话审查 + `decision` 事件。
142
+
143
+ ## 执行日志
144
+
145
+ `events.ndjson` 为唯一事实源(schema_version 3,兼容读取 v1/v2;`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
146
+
147
+ **`phase.start` 由 `harness_gate.py begin` 写,不要再手工追加一次。** 两条同 `run-id` 的
148
+ `phase.start` 会让 `plan finalize` 以 `PHASE_START_DUPLICATE` 卡死,而且手工那次会先触发
149
+ auto-seal、把正在开始的 attempt 封成 `RECOVERED`。要补触发指令说明就带 `--note` 跑 `gate begin`。
150
+ (重复追加现已按 `(phase, run-id)` 判为幂等 no-op,但依赖它不如不写。)
151
+
152
+ ```powershell
153
+ # 阶段开始:gate begin 负责,note 在这里给
154
+ python <skills-root>/scripts/harness_gate.py begin --change-dir ".harness/changes/<change-name>" --phase <phase> --note "<触发指令>"
155
+ # 阶段中的其他事件才用 append
156
+ python <skills-root>/scripts/harness_events.py append --change-dir ".harness/changes/<change-name>" --phase <phase> --type <command|issue|verification> --run-id <phase-run-id> --note "<摘要>"
157
+ ```
158
+
159
+ > **脚本接线**:`harness_events.py append`;`harness_archive.py finalize`;`harness_preflight.py check`;`harness_ledger.py can-reuse`;`harness_service.py ensure/stop`(须 `--files`/`serviceStart.inputFiles`)。JSON 输出按 D13 护栏解读。
160
+
161
+ > **Task 4 §6.1 写入契约**:普通 `append` = 加锁 -> 追加一行 -> fsync -> 解锁,**不 load 历史、不渲染**(O(1),跨进程锁 `events.ndjson.lock`,UUID 用完整 `uuid4().hex` 无需去重扫描)。仅 `--type phase.end` append 在追加成功后渲染一次 `execution-log.md`;显式 `harness_events.py render` 随时从完整 events 重建;`harness_archive.py finalize` 在 collect 前强制 render 一次。高频 command append 期间 log 可能滞后,phase 边界保持最新。
162
+
163
+ 每个阶段的 `phase.start` 与对应 `phase.end` 必须复用同一 `--run-id` / `--attempt`;阶段结束必须写 `--status OK|WARN|FAIL|BLOCKED`。重试同一阶段时生成新的 run-id 并增加 `--attempt <n>`,不得覆盖或伪装成一次执行。**`attempt` 按 phase 全局递增,不是按 run-id**:一个 run-id 只绑定一个 attempt,重试必须「新 run-id + 下一个 attempt」两者同时换,只换其一会撞 `EVENT_ATTEMPT_CONFLICT` 或 `PHASE_ALREADY_CLOSED`。已发布 plan 的修订通过重跑 `plan evidence-pack` + `plan finalize` 分配新 attempt(`harness_plan_finalize.py republish` 已于 0.3.0 移除)。
164
+
165
+ 阶段跑得久(plan/run 常见)时用 `harness_context.py renew --project . --change <cn> --executor <tool>` 续租;租约到期本身不再阻断 `close`(同一 owner 的过期租约不构成冲突,收据里记 `leaseLapsed`),但续租能让 `view` 的状态如实反映在跑。跨工具继续执行时写 `--executor-tool <codex|claude-code|codebuddy|cursor>`,并在接棒事件写 `--handoff-from-tool` / `--handoff-reason`;也可由 `HUNTER_HARNESS_TOOL/AGENT/MODEL/RUN_ID` 环境变量统一注入。
166
+ > 片段:logging · phase=`review` · 事件:phase/decision/verification/issue/artifact
@@ -0,0 +1,124 @@
1
+ ---
2
+ description: harness-review 的6维度审查检查项详细列表。仅在执行完整代码审查时读取。
3
+ ---
4
+
5
+ # harness-review 检查清单
6
+
7
+ ## 启动准备:确定变更名
8
+
9
+ 用 Glob 搜索 `.harness/changes/*/plans/*-plan.md`(**排除 `.harness/archive/*/`**),读取 frontmatter 提取 `change-name`。默认最多一个未归档变更;如有多个,优先取最近修改的,或询问用户。后续所有路径基于此变更名。
10
+
11
+ **读取 worktree 状态**:读 `.harness/changes/<change-name>/meta/worktree.json`。`requested=true` 且 worktree 已创建 → 后续 `git diff` 的 `<项目路径>` 用 worktree 路径(`.worktrees/<change-name>`);`requested=true` 但 worktree 不存在 → 停止,提示先修复 `harness-run`,不得静默回主目录。
12
+
13
+ ## 审查流程
14
+
15
+ ### 1. 获取变更范围
16
+
17
+ ```powershell
18
+ powershell.exe -Command "git -C '<项目路径>' diff --stat"
19
+ powershell.exe -Command "git -C '<项目路径>' diff"
20
+ ```
21
+
22
+ ### 2. 六维度逐文件审查
23
+
24
+ #### 维度 1:架构
25
+
26
+ | 检查项 | 为什么重要 |
27
+ |--------|------------|
28
+ | 接口层中有业务逻辑 | 破坏分层,后续修改影响面不可控 |
29
+ | 业务层间循环依赖 | 启动失败或运行时 StackOverflow |
30
+ | 接口层跨模块调用业务层 | 破坏模块边界,耦合扩散 |
31
+ | 业务层抛异常、接口层 try-catch | 异常处理应在全局异常处理器统一 |
32
+ | 写操作无事务边界 | 数据不一致(部分写入成功、部分失败) |
33
+
34
+ #### 维度 2:安全
35
+
36
+ | 检查项 | 为什么重要 |
37
+ |--------|------------|
38
+ | 硬编码密码/Token/密钥 | 代码泄露 = 凭据泄露 |
39
+ | 字符串拼接 SQL | SQL 注入风险 |
40
+ | 用户输入直接返回前端 | XSS 风险 |
41
+ | 对生产库执行写操作 | 数据丢失/破坏 |
42
+ | 日志打印敏感信息 | 日志泄露 Token/身份证号 |
43
+ | 新增接口无权限校验 | 未授权访问 |
44
+
45
+ #### 维度 3:编码规范
46
+
47
+ | 检查项 | 严重度 |
48
+ |--------|:------:|
49
+ | 数据类暴露不必要可变 setter(应改只读访问器) | YELLOW |
50
+ | 控制台输出替代日志框架 | YELLOW |
51
+ | 集合方法返回 null 而非空集合 | YELLOW |
52
+ | 魔法值未定义常量 | YELLOW |
53
+ | 公共 API 无文档注释 | YELLOW |
54
+
55
+ #### 维度 4:兼容性
56
+
57
+ | 检查项 | 为什么重要 |
58
+ |--------|------------|
59
+ | 删除/修改已发布接口的字段 | 旧前端/调用方立即报错 |
60
+ | 删除/重命名数据库已有字段 | 数据丢失 |
61
+ | 删除/修改已有枚举值 | 存量数据无法解析 |
62
+ | 新增字段不为 nullable | 旧数据无法查询/写入 |
63
+
64
+ #### 维度 5:测试
65
+
66
+ 对照场景表检查覆盖。重点看新增业务方法是否有对应单元测试,异常场景是否有覆盖。
67
+
68
+ #### 维度 6:性能
69
+
70
+ | 检查项 | 信号 |
71
+ |--------|------|
72
+ | N+1 查询 | 循环体内调用数据访问层查询 |
73
+ | 缺少索引 | 新增 WHERE 条件无对应索引 |
74
+ | 大事务 | 事务内含远程调用或文件 IO |
75
+ | 逐条 insert | 循环内单条 insert 而非批量 |
76
+
77
+ ### 3. 对照 项目规则(见 .harness/context-index.json)/ 检查
78
+
79
+ 逐个规则文件检查变更是否违规。违规项标注对应规则文件名和行号。
80
+
81
+ ### 4. 对照场景表检查
82
+
83
+ 如果场景表存在,逐条确认代码是否覆盖。未覆盖的标记为「测试缺口」。
84
+
85
+ ## 输出格式
86
+
87
+ 审查报告保存到 `.harness/changes/<change-name>/reports/review/review-report-YYYYMMDD-HHmm.md`(时间戳格式:日期+时分),同时在控制台输出摘要。完整报告模板见 `reference.md`「输出报告完整模板」,本文不再重复。
88
+
89
+ ## 原生修复反馈检查
90
+
91
+ ### fixback 生成确认(按需)
92
+
93
+ 如果用户需要修复任务清单,确认以下事项:
94
+
95
+ ```
96
+ □ 已读取 harness-review/protocols.md
97
+ □ 已执行 review-fixback-protocol(不调用外部 receiving-code-review)
98
+ □ RED/YELLOW 问题已转化为结构化修复任务清单
99
+ □ 修复任务清单含严重级别、位置、风险、修复建议、验证方式、submit 影响
100
+ □ fixback 已落盘到 .harness/changes/<change-name>/reports/review/fixback-YYYYMMDD-HHmm.md
101
+ ```
102
+
103
+ > 如果没有 RED/YELLOW 问题,记录 `review-fixback-protocol: skipped(no findings)`,不要生成空 fixback。`harness-review` 不检查 Superpowers 是否安装,也不记录外部 skill 降级。
104
+
105
+ ### 代码探索效率检查
106
+
107
+ ```
108
+ □ 审查代码时优先使用 codegraph_explore(一次获取多个符号源码)
109
+ □ 未逐个 Read 文件(违反 项目 codegraph 规则 规则)
110
+ ```
111
+
112
+ ## 关键原则
113
+
114
+ - 只审查 `git diff` 中的变更部分,不审查已有代码
115
+ - 对照 `项目规则(见 .harness/context-index.json)/` 是审查的基准线
116
+ - 区分严重级别:RED=高风险建议(强烈建议处理),YELLOW=中低风险建议
117
+ - 每个问题给出具体修复建议(文件:行号 + 建议做法)
118
+ - 如果 diff 为空,直接返回"无变更可审查"
119
+ - **review 结果仅供参考,不阻塞后续 submit/archive**
120
+
121
+ ## 事件记录
122
+
123
+ - [ ] append `phase.start` 事件(步骤 0 启动准备之前;`note` 含触发指令)
124
+ - [ ] append `phase.end` 事件(`note` 含耗时、结果、落盘 path、RED/YELLOW 统计摘要)
@@ -0,0 +1,69 @@
1
+ ---
2
+ description: harness-review 的原生修复反馈协议。内化 receiving-code-review 能力,但不运行时依赖外部 skill。
3
+ ---
4
+
5
+ # harness-review 原生修复反馈协议
6
+
7
+ 本文件定义 `/harness-review` 的 `review-fixback-protocol`。它把 RED/YELLOW 审查建议转成结构化修复反馈,不调用 Superpowers `receiving-code-review`。
8
+
9
+ ## review-fixback-protocol
10
+
11
+ 用于 review 报告生成之后。目标是让 RED/YELLOW 问题可以被后续 run 或人工修复直接消费,同时保持 harness-review 的 advisory 定位。
12
+
13
+ ### 输入
14
+
15
+ - `reports/review/review-report-YYYYMMDD-HHmm.md`
16
+ - 当前 diff 的 RED/YELLOW 问题清单
17
+ - `plans/<change-name>-test-scenarios.md`
18
+ - `evidence/verification-ledger.json` 与 `evidence/run-task-status.md`(如存在)
19
+
20
+ ### 输出规则
21
+
22
+ 如果存在 RED/YELLOW 问题,必须单独生成结构化 fixback 并写入:
23
+
24
+ ```text
25
+ .harness/changes/<change-name>/reports/review/fixback-YYYYMMDD-HHmm.md
26
+ ```
27
+
28
+ 每条 fixback 必须包含:
29
+
30
+ | 字段 | 要求 |
31
+ |------|------|
32
+ | 等级 | RED / YELLOW |
33
+ | 影响位置 | 文件路径 + 行号或最小可定位区域 |
34
+ | 风险说明 | 说明为什么值得处理 |
35
+ | 推荐修复 | 可执行的修复方向,不写空泛建议 |
36
+ | 验证方式 | 构建、测试、场景编号或人工确认方式 |
37
+ | 修复动作 | `code` / `manual` / `workflow`;只有 `code` 会进入 `/harness-execute --fixback` |
38
+ | submit 影响 | 默认 advisory;仅 strict-review-gate=true 时标记阻塞 |
39
+
40
+ 如果没有 RED/YELLOW,必须明确写:
41
+
42
+ ```markdown
43
+ 无需 fixback:本次 review 未发现 RED/YELLOW 问题。
44
+ ```
45
+
46
+ ### 定位边界
47
+
48
+ - harness-review 默认仅供参考,不阻塞 submit/archive。
49
+ - `review-fixback-protocol` 只生成修复反馈,不自动修改代码。人工验收与流程建议不得伪装成代码问题,也不得创建空 Fixback 批次。
50
+ - 不得把 YELLOW 写成必须阻塞 submit。
51
+ - 只有配置 `strict-review-gate: true` 时,RED 才可标记为阻塞 submit。
52
+
53
+ ### 模板
54
+
55
+ ```markdown
56
+ # Review Fixback — <change-name>
57
+
58
+ ## 摘要
59
+
60
+ - RED: N
61
+ - YELLOW: M
62
+ - strict-review-gate: true/false
63
+
64
+ ## 修复反馈
65
+
66
+ | # | 等级 | 影响位置 | 风险说明 | 推荐修复 | 验证方式 | submit 影响 |
67
+ |:--:|:----:|----------|----------|----------|----------|-------------|
68
+ | 1 | RED | `path/to/file:123` | ... | ... | `test-scenarios.md` API-001 + 构建命令 | advisory / blocking |
69
+ ```
@@ -0,0 +1,114 @@
1
+ ---
2
+ description: harness-review 的审查标准说明和输出报告完整模板。仅在需要理解审查标准或生成详细报告时读取。
3
+ ---
4
+
5
+ # harness-review 参考 — 审查标准
6
+
7
+ ## 为什么需要审查
8
+
9
+ 即使有 TDD 和场景覆盖,仍然可能遗漏一些只在"阅读代码"时才能发现的问题:
10
+ - 违反架构约束(TDD 关注行为,不关注结构)
11
+ - 安全漏洞(测试通常不会故意测试安全攻击)
12
+ - 编码规范偏离(IDE 自动格式化可能产生不一致的风格)
13
+ - 性能隐患(N+1 查询在单元测试中不起眼,但在生产环境是灾难)
14
+
15
+ > 维度检查项的详细列表和重要性说明见 `checklist.md`,本文件保留"为什么需要审查"概述、严重级别判定标准和输出报告模板。
16
+
17
+ ## 严重级别判定标准
18
+
19
+ RED/YELLOW/OK 三态的判定原则——结论必须基于实际 diff 内容,不得凭印象;每条建议给出文件:行号 + 修复做法。
20
+
21
+ | 级别 | 判定原则 | 典型场景 |
22
+ |:----:|------|------|
23
+ | RED | 高风险,强烈建议处理——生产环境会直接造成损失或数据破坏 | 硬编码密码/Token/密钥;SQL 字符串拼接(注入);新增接口无权限校验;删除/修改已发布接口字段或数据库字段;写操作无事务边界;业务层间循环依赖;接口层跨模块调用;对生产库执行写操作 |
24
+ | YELLOW | 中低风险,建议处理——影响可维护性或存在隐患,但不会立即造成损失 | 数据类暴露不必要可变 setter(应改只读访问器);控制台输出替代日志框架;集合返回 null 而非空集合;魔法值未定义常量;公共 API 无文档注释;N+1 查询;缺少索引;大事务;逐条 insert;新增非空字段;新增业务方法无对应单元测试 |
25
+ | OK | 该维度在本次 diff 中无问题 | —— |
26
+
27
+ **判定要点**:
28
+ - 敏感信息(明文 token/密码/密钥)一律 RED,并在报告中以 `<TOKEN_REDACTED>` 等占位符引用
29
+ - 占位符与脱敏做法遵循 `../protocols/sensitive-info-protocol.md`;结论须基于实际 diff 证据,见 `../protocols/evidence-based-reporting-protocol.md`
30
+ - 安全维度的问题默认 RED(除非确属误报)
31
+ - 兼容性维度:删除/修改已发布契约为 RED,新增字段提醒为 YELLOW
32
+ - 测试维度:核心业务方法无任何测试覆盖为 YELLOW(建议补充),不判 RED(review 不阻塞)
33
+ - 当界限模糊时,倾向 YELLOW 并在建议中说明判断依据,让用户决定
34
+
35
+ ## 输出报告完整模板
36
+
37
+ ```markdown
38
+ ## 代码审查报告 — <功能名>
39
+
40
+ ### 变更摘要
41
+ - 变更文件: N 个 | +xxx / -xxx
42
+
43
+ ### 审查结果
44
+
45
+ | 维度 | RED 高风险 | YELLOW 中低风险 | OK 通过 |
46
+ |------|:------:|:------:|:------:|
47
+ | 架构 | 0 | 1 | 4 |
48
+ | 安全 | 0 | 0 | 5 |
49
+ | 编码规范 | 0 | 2 | 4 |
50
+ | 兼容性 | 0 | 0 | 4 |
51
+ | 测试 | 0 | 1 | 3 |
52
+ | 性能 | 0 | 0 | 3 |
53
+
54
+ ### RED 高风险建议(强烈建议处理)
55
+ | # | 文件:行 | 维度 | 问题 | 建议 | 参考优先级 |
56
+ |:--:|---------|------|------|------|:--------:|
57
+ | (列出所有高风险问题) |
58
+
59
+ ### YELLOW 中低风险建议(建议处理)
60
+ | # | 文件:行 | 维度 | 问题 | 建议 | 参考优先级 |
61
+ |:--:|---------|------|------|------|:--------:|
62
+ | 1 | xxx:396 | 架构 | ... | ... | 建议优先处理 |
63
+ | 2 | xxx:25 | 规范 | 数据类暴露可变 setter | 改为只读访问器 | 建议在 submit 前人工确认 |
64
+
65
+ ### 规则对照
66
+ | 规则文件 | 结果 |
67
+ |----------|:----:|
68
+ | architecture.md | OK / FAIL |
69
+ | 项目编码规范(按技术栈,示例:Java 项目的 `java-coding-standards.md`,前端项目按项目实际规则文件) | OK / FAIL |
70
+ | 项目框架规范(按技术栈,示例:Java 项目的 `spring-boot-patterns.md`,其他技术栈按项目实际) | OK / FAIL |
71
+ | testing-conventions.md | OK / FAIL |
72
+ | database-safety.md | OK / FAIL |
73
+
74
+ ### 总结
75
+ RED 高风险建议: N | YELLOW 中低风险建议: M | 仅供参考,不阻塞后续 harness 流程
76
+ ```
77
+
78
+ ## Fixback 输出关系
79
+
80
+ 当审查报告包含 RED 或 YELLOW 问题时,执行 `protocols.md` 的 `review-fixback-protocol`,另行生成:
81
+
82
+ ```text
83
+ .harness/changes/<change-name>/reports/review/fixback-YYYYMMDD-HHmm.md
84
+ ```
85
+
86
+ fixback 是给后续修复循环使用的结构化清单,不替代 review-report;无 RED/YELLOW 时记录跳过原因,不生成空文件。
87
+
88
+ ## CodeGraph Identity 合同(C12)
89
+
90
+ 发出 `codegraph_explore` 前,必须从实际 `executionRoot` 构造并随查询记录以下
91
+ expected identity:`rootPath`、`worktreeId`(主 checkout 为 `null`)、`repositoryId`、`head`。
92
+ 采纳返回源码前,必须校验响应中的:
93
+
94
+ - `rootPath` 必须是当前 `executionRoot`(规范化后比较);不可只比较 repositoryId
95
+ - `worktreeId` 必须与当前 worktree 相同;主 checkout 必须为 `null`
96
+ - `repositoryId` 必须与 `harness_paths.repository_identity(project_root)` 一致
97
+ - `head`(兼容 `indexedHead`)必须与当前 HEAD 一致
98
+ - `indexSnapshotAt`(兼容 `indexedAt`)必须存在
99
+
100
+ identity 不匹配时必须返回 `IDENTITY_MISMATCH`,包含 expected/actual 的完整
101
+ identity,且**不得采纳任何 CodeGraph 源码**;降级为 Grep/Glob + Read 实际
102
+ worktree。该状态不同于 index stale,不能以 stale warning 代替。
103
+ identity 匹配时正常使用 codegraph 结果。
104
+
105
+ 校验函数:
106
+ `harness_review.validate_codegraph_identity(response, expected_repository_id, expected_head, expected_root, expected_worktree_id)`。
107
+
108
+ Review 通过脚本入口执行该校验,例如:
109
+
110
+ ```text
111
+ python harness_review.py validate-codegraph-identity --input <codegraph-response.json> \
112
+ --execution-root <actual-worktree-root> --repository-id <repository-id> \
113
+ --head <HEAD> [--worktree-id <worktree-id>]
114
+ ```