@hunter-harness/workflow-harness 0.2.2 → 0.2.3

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 (138) hide show
  1. package/harness/bundles/general/claude-code/.harness-build.json +1 -1
  2. package/harness/bundles/general/claude-code/harness-archive/SKILL.md +1 -1
  3. package/harness/bundles/general/claude-code/harness-codebase-map/SKILL.md +1 -1
  4. package/harness/bundles/general/claude-code/harness-knowledge-ingest/SKILL.md +1 -1
  5. package/harness/bundles/general/claude-code/harness-knowledge-query/SKILL.md +1 -1
  6. package/harness/bundles/general/claude-code/harness-plan/SKILL.md +1 -1
  7. package/harness/bundles/general/claude-code/harness-review/SKILL.md +1 -1
  8. package/harness/bundles/general/claude-code/harness-run/SKILL.md +1 -1
  9. package/harness/bundles/general/claude-code/harness-submit/SKILL.md +1 -1
  10. package/harness/bundles/general/claude-code/harness-submit/checklist.md +2 -2
  11. package/harness/bundles/general/claude-code/harness-sync/SKILL.md +1 -1
  12. package/harness/bundles/general/claude-code/harness-test/SKILL.md +1 -1
  13. package/harness/bundles/general/claude-code/scripts/harness_check_gate.py +25 -17
  14. package/harness/bundles/general/codebuddy/.harness-build.json +1 -1
  15. package/harness/bundles/general/codebuddy/harness-archive/SKILL.md +1 -1
  16. package/harness/bundles/general/codebuddy/harness-codebase-map/SKILL.md +1 -1
  17. package/harness/bundles/general/codebuddy/harness-knowledge-ingest/SKILL.md +1 -1
  18. package/harness/bundles/general/codebuddy/harness-knowledge-query/SKILL.md +1 -1
  19. package/harness/bundles/general/codebuddy/harness-plan/SKILL.md +1 -1
  20. package/harness/bundles/general/codebuddy/harness-review/SKILL.md +1 -1
  21. package/harness/bundles/general/codebuddy/harness-run/SKILL.md +1 -1
  22. package/harness/bundles/general/codebuddy/harness-submit/SKILL.md +1 -1
  23. package/harness/bundles/general/codebuddy/harness-submit/checklist.md +2 -2
  24. package/harness/bundles/general/codebuddy/harness-sync/SKILL.md +1 -1
  25. package/harness/bundles/general/codebuddy/harness-test/SKILL.md +1 -1
  26. package/harness/bundles/general/codebuddy/scripts/harness_check_gate.py +25 -17
  27. package/harness/bundles/general/codex/.harness-build.json +1 -1
  28. package/harness/bundles/general/codex/harness-archive/SKILL.md +1 -1
  29. package/harness/bundles/general/codex/harness-codebase-map/SKILL.md +1 -1
  30. package/harness/bundles/general/codex/harness-knowledge-ingest/SKILL.md +1 -1
  31. package/harness/bundles/general/codex/harness-knowledge-query/SKILL.md +1 -1
  32. package/harness/bundles/general/codex/harness-plan/SKILL.md +1 -1
  33. package/harness/bundles/general/codex/harness-review/SKILL.md +1 -1
  34. package/harness/bundles/general/codex/harness-run/SKILL.md +1 -1
  35. package/harness/bundles/general/codex/harness-submit/SKILL.md +1 -1
  36. package/harness/bundles/general/codex/harness-submit/checklist.md +2 -2
  37. package/harness/bundles/general/codex/harness-sync/SKILL.md +1 -1
  38. package/harness/bundles/general/codex/harness-test/SKILL.md +1 -1
  39. package/harness/bundles/general/codex/scripts/harness_check_gate.py +25 -17
  40. package/harness/bundles/general/cursor/.harness-build.json +1 -1
  41. package/harness/bundles/general/cursor/harness-archive/SKILL.md +1 -1
  42. package/harness/bundles/general/cursor/harness-codebase-map/SKILL.md +1 -1
  43. package/harness/bundles/general/cursor/harness-knowledge-ingest/SKILL.md +1 -1
  44. package/harness/bundles/general/cursor/harness-knowledge-query/SKILL.md +1 -1
  45. package/harness/bundles/general/cursor/harness-plan/SKILL.md +1 -1
  46. package/harness/bundles/general/cursor/harness-review/SKILL.md +1 -1
  47. package/harness/bundles/general/cursor/harness-run/SKILL.md +1 -1
  48. package/harness/bundles/general/cursor/harness-submit/SKILL.md +1 -1
  49. package/harness/bundles/general/cursor/harness-submit/checklist.md +2 -2
  50. package/harness/bundles/general/cursor/harness-sync/SKILL.md +1 -1
  51. package/harness/bundles/general/cursor/harness-test/SKILL.md +1 -1
  52. package/harness/bundles/general/cursor/scripts/harness_check_gate.py +25 -17
  53. package/harness/bundles/java/claude-code/.harness-build.json +1 -1
  54. package/harness/bundles/java/claude-code/harness-apidoc/SKILL.md +1 -1
  55. package/harness/bundles/java/claude-code/harness-archive/SKILL.md +1 -1
  56. package/harness/bundles/java/claude-code/harness-codebase-map/SKILL.md +1 -1
  57. package/harness/bundles/java/claude-code/harness-knowledge-ingest/SKILL.md +1 -1
  58. package/harness/bundles/java/claude-code/harness-knowledge-query/SKILL.md +1 -1
  59. package/harness/bundles/java/claude-code/harness-package/SKILL.md +1 -1
  60. package/harness/bundles/java/claude-code/harness-plan/SKILL.md +1 -1
  61. package/harness/bundles/java/claude-code/harness-review/SKILL.md +1 -1
  62. package/harness/bundles/java/claude-code/harness-run/SKILL.md +1 -1
  63. package/harness/bundles/java/claude-code/harness-run/checklist.md +2 -0
  64. package/harness/bundles/java/claude-code/harness-run/reference.md +6 -0
  65. package/harness/bundles/java/claude-code/harness-submit/SKILL.md +1 -1
  66. package/harness/bundles/java/claude-code/harness-submit/checklist.md +2 -2
  67. package/harness/bundles/java/claude-code/harness-sync/SKILL.md +1 -1
  68. package/harness/bundles/java/claude-code/harness-test/SKILL.md +1 -1
  69. package/harness/bundles/java/claude-code/harness-test/checklist.md +3 -1
  70. package/harness/bundles/java/claude-code/harness-test/reference.md +2 -0
  71. package/harness/bundles/java/claude-code/scripts/harness_check_gate.py +25 -17
  72. package/harness/bundles/java/codebuddy/.harness-build.json +1 -1
  73. package/harness/bundles/java/codebuddy/harness-apidoc/SKILL.md +1 -1
  74. package/harness/bundles/java/codebuddy/harness-archive/SKILL.md +1 -1
  75. package/harness/bundles/java/codebuddy/harness-codebase-map/SKILL.md +1 -1
  76. package/harness/bundles/java/codebuddy/harness-knowledge-ingest/SKILL.md +1 -1
  77. package/harness/bundles/java/codebuddy/harness-knowledge-query/SKILL.md +1 -1
  78. package/harness/bundles/java/codebuddy/harness-package/SKILL.md +1 -1
  79. package/harness/bundles/java/codebuddy/harness-plan/SKILL.md +1 -1
  80. package/harness/bundles/java/codebuddy/harness-review/SKILL.md +1 -1
  81. package/harness/bundles/java/codebuddy/harness-run/SKILL.md +1 -1
  82. package/harness/bundles/java/codebuddy/harness-run/checklist.md +2 -0
  83. package/harness/bundles/java/codebuddy/harness-run/reference.md +6 -0
  84. package/harness/bundles/java/codebuddy/harness-submit/SKILL.md +1 -1
  85. package/harness/bundles/java/codebuddy/harness-submit/checklist.md +2 -2
  86. package/harness/bundles/java/codebuddy/harness-sync/SKILL.md +1 -1
  87. package/harness/bundles/java/codebuddy/harness-test/SKILL.md +1 -1
  88. package/harness/bundles/java/codebuddy/harness-test/checklist.md +3 -1
  89. package/harness/bundles/java/codebuddy/harness-test/reference.md +2 -0
  90. package/harness/bundles/java/codebuddy/scripts/harness_check_gate.py +25 -17
  91. package/harness/bundles/java/codex/.harness-build.json +1 -1
  92. package/harness/bundles/java/codex/harness-apidoc/SKILL.md +1 -1
  93. package/harness/bundles/java/codex/harness-archive/SKILL.md +1 -1
  94. package/harness/bundles/java/codex/harness-codebase-map/SKILL.md +1 -1
  95. package/harness/bundles/java/codex/harness-knowledge-ingest/SKILL.md +1 -1
  96. package/harness/bundles/java/codex/harness-knowledge-query/SKILL.md +1 -1
  97. package/harness/bundles/java/codex/harness-package/SKILL.md +1 -1
  98. package/harness/bundles/java/codex/harness-plan/SKILL.md +1 -1
  99. package/harness/bundles/java/codex/harness-review/SKILL.md +1 -1
  100. package/harness/bundles/java/codex/harness-run/SKILL.md +1 -1
  101. package/harness/bundles/java/codex/harness-run/checklist.md +2 -0
  102. package/harness/bundles/java/codex/harness-run/reference.md +6 -0
  103. package/harness/bundles/java/codex/harness-submit/SKILL.md +1 -1
  104. package/harness/bundles/java/codex/harness-submit/checklist.md +2 -2
  105. package/harness/bundles/java/codex/harness-sync/SKILL.md +1 -1
  106. package/harness/bundles/java/codex/harness-test/SKILL.md +1 -1
  107. package/harness/bundles/java/codex/harness-test/checklist.md +3 -1
  108. package/harness/bundles/java/codex/harness-test/reference.md +2 -0
  109. package/harness/bundles/java/codex/scripts/harness_check_gate.py +25 -17
  110. package/harness/bundles/java/cursor/.harness-build.json +1 -1
  111. package/harness/bundles/java/cursor/harness-apidoc/SKILL.md +1 -1
  112. package/harness/bundles/java/cursor/harness-archive/SKILL.md +1 -1
  113. package/harness/bundles/java/cursor/harness-codebase-map/SKILL.md +1 -1
  114. package/harness/bundles/java/cursor/harness-knowledge-ingest/SKILL.md +1 -1
  115. package/harness/bundles/java/cursor/harness-knowledge-query/SKILL.md +1 -1
  116. package/harness/bundles/java/cursor/harness-package/SKILL.md +1 -1
  117. package/harness/bundles/java/cursor/harness-plan/SKILL.md +1 -1
  118. package/harness/bundles/java/cursor/harness-review/SKILL.md +1 -1
  119. package/harness/bundles/java/cursor/harness-run/SKILL.md +1 -1
  120. package/harness/bundles/java/cursor/harness-run/checklist.md +2 -0
  121. package/harness/bundles/java/cursor/harness-run/reference.md +6 -0
  122. package/harness/bundles/java/cursor/harness-submit/SKILL.md +1 -1
  123. package/harness/bundles/java/cursor/harness-submit/checklist.md +2 -2
  124. package/harness/bundles/java/cursor/harness-sync/SKILL.md +1 -1
  125. package/harness/bundles/java/cursor/harness-test/SKILL.md +1 -1
  126. package/harness/bundles/java/cursor/harness-test/checklist.md +3 -1
  127. package/harness/bundles/java/cursor/harness-test/reference.md +2 -0
  128. package/harness/bundles/java/cursor/scripts/harness_check_gate.py +25 -17
  129. package/harness/manifests/general/claude-code.json +14 -14
  130. package/harness/manifests/general/codebuddy.json +14 -14
  131. package/harness/manifests/general/codex.json +14 -14
  132. package/harness/manifests/general/cursor.json +14 -14
  133. package/harness/manifests/java/claude-code.json +20 -20
  134. package/harness/manifests/java/codebuddy.json +20 -20
  135. package/harness/manifests/java/codex.json +20 -20
  136. package/harness/manifests/java/cursor.json +20 -20
  137. package/hunter-workflow-family.json +2 -2
  138. package/package.json +1 -1
@@ -3,7 +3,7 @@ name: harness-knowledge-ingest
3
3
  description: 从 .harness/archive 归档整理、同步和维护项目知识索引。适用场景:ingest knowledge、sync
4
4
  knowledge、rebuild knowledge index、promote knowledge、确认知识条目、检查知识库是否过期。
5
5
  ---
6
- <!-- generated by harness_deploy.py; core=d437039c3207693b; overlay=java; agent=cursor; do not edit -->
6
+ <!-- generated by harness_deploy.py; core=d89ba652e358a96b; overlay=java; agent=cursor; do not edit -->
7
7
  # harness-knowledge-ingest
8
8
 
9
9
  从 `.harness/archive/**/reports/final/summary-data.json` 抽取项目知识,生成并维护本地 `.harness/knowledge/` 索引。
@@ -3,7 +3,7 @@ name: harness-knowledge-query
3
3
  description: 根据新需求、设计任务、代码修改请求或问题排查,在规划和编码前查询 .harness/knowledge
4
4
  历史上下文。适用场景:query knowledge、查找历史需求、根据归档理解需求、继续之前类似开发、生成需求上下文包。
5
5
  ---
6
- <!-- generated by harness_deploy.py; core=d437039c3207693b; overlay=java; agent=cursor; do not edit -->
6
+ <!-- generated by harness_deploy.py; core=d89ba652e358a96b; overlay=java; agent=cursor; do not edit -->
7
7
  # harness-knowledge-query
8
8
 
9
9
  根据用户的新需求或排查问题,从项目本地 `.harness/knowledge` 中检索历史需求、决策、实现、风险和测试证据,并生成 AI 可读的 context pack。
@@ -2,7 +2,7 @@
2
2
  name: harness-package
3
3
  description: 增量模块打包:拉取最新→编译验证→mvn package→汇总 jar/war。使用场景:打包、package、发版准备
4
4
  ---
5
- <!-- generated by harness_deploy.py; core=d437039c3207693b; overlay=java; agent=cursor; do not edit -->
5
+ <!-- generated by harness_deploy.py; core=d89ba652e358a96b; overlay=java; agent=cursor; do not edit -->
6
6
  # harness-package — 增量模块打包(Java overlay)
7
7
 
8
8
  ## Purpose
@@ -2,7 +2,7 @@
2
2
  name: harness-plan
3
3
  description: 将需求转化为设计文档+实施计划+完整测试场景表,必须在编码前完成。使用场景:需求分析、feature plan、技术方案设计、实现方案规划
4
4
  ---
5
- <!-- generated by harness_deploy.py; core=d437039c3207693b; overlay=java; agent=cursor; do not edit -->
5
+ <!-- generated by harness_deploy.py; core=d89ba652e358a96b; overlay=java; agent=cursor; do not edit -->
6
6
  # harness-plan — 需求规划
7
7
 
8
8
  ## Purpose
@@ -3,7 +3,7 @@ name: harness-review
3
3
  description: 6维度代码审查(架构/安全/规范/兼容/测试/性能),对照项目规则(见
4
4
  .harness/context-index.json)和测试场景表,在隔离上下文运行。使用场景:代码审查、提交前检查、合并评审
5
5
  ---
6
- <!-- generated by harness_deploy.py; core=d437039c3207693b; overlay=java; agent=cursor; do not edit -->
6
+ <!-- generated by harness_deploy.py; core=d89ba652e358a96b; overlay=java; agent=cursor; do not edit -->
7
7
  # harness-review — 代码审查
8
8
 
9
9
  ## Purpose
@@ -2,7 +2,7 @@
2
2
  name: harness-run
3
3
  description: 按变更簇执行 TDD 编码循环(RED→GREEN→REFACTOR→编译验证),逐变更簇实现计划中的任务。使用场景:开始编码、实现功能、写代码、TDD 编码
4
4
  ---
5
- <!-- generated by harness_deploy.py; core=d437039c3207693b; overlay=java; agent=cursor; do not edit -->
5
+ <!-- generated by harness_deploy.py; core=d89ba652e358a96b; overlay=java; agent=cursor; do not edit -->
6
6
  # harness-run — 需求编码
7
7
 
8
8
  ## Purpose
@@ -30,6 +30,8 @@
30
30
  - [ ] **读取任务状态**:`.harness/changes/<change>/run-task-status.md`(如存在)— 恢复上次运行状态
31
31
  - [ ] 确认 `项目规则(见 .harness/context-index.json)/` 规则已加载
32
32
  - [ ] 检查构建配置完整性(worktree 中确认 `.mvn/maven.config`、`settings.xml` 等存在)
33
+ - [ ] 读取 `.mvn/maven.config`,确认命令没有重复或覆盖项目已有的 `-s` / `-o` / 仓库设置
34
+ - [ ] 离线依赖缺失时仅在项目规则允许联网的前提下执行至多一次非离线 `-nsu` 恢复;禁止离线/联网循环重试
33
35
  - [ ] 依赖模块预安装(worktree 中检查上游模块是否已 `mvn install`)
34
36
  - [ ] 代码探索优先用 `codegraph_explore`,仅在返回不完整时补充 Read
35
37
  - [ ] append `phase.start`(`note` 含测试基础设施 CHECKING 直至探测完成)
@@ -97,6 +97,12 @@ powershell.exe -NoProfile -Command "Test-Path '.claude/worktrees/<change-name>/.
97
97
  13. **依赖模块预安装**:如果在 worktree 中执行,检查上游依赖模块是否已 `mvn install` 到本地仓库。缺失时先执行 `powershell.exe -Command "mvn install -pl <upstream-modules> -am -DskipTests -nsu"`
98
98
  14. **代码探索优先用 codegraph_explore**:一次调用可获取多个相关符号的源码,替代逐个 Read 文件。违反 `项目 codegraph 规则` 规则逐个 Read 会浪费 3-5 分钟。仅在 codegraph 返回结果不完整时补充 Read
99
99
 
100
+ ### Maven 项目配置与重试预算
101
+
102
+ - 运行 Maven 前先读取项目已有的 `.mvn/maven.config`;其中的 `-s`、`-o`、镜像和仓库设置视为项目契约,不在命令行重复追加或覆盖。
103
+ - 若项目配置已启用离线模式,依赖缺失只允许一次有明确原因的恢复尝试:仅在项目规则允许联网时临时执行非离线的 `-nsu` 命令;随后继续遵循项目配置,不得在离线/联网命令之间循环试错。
104
+ - 同一失败命令不得无分析地重复执行。先按“配置/依赖缺失、编译、测试、业务断言”分类,再决定修复或停止;每个变更簇仍遵守一次 RED、一次 GREEN 的 Maven 预算。
105
+
100
106
  ### 步骤 0.1:执行模式(默认 Inline)
101
107
 
102
108
  默认 **Inline Execution**;仅 `--subagent` 强制 Subagent-Driven。**不询问**任务数/模块数(P1-5)。
@@ -3,7 +3,7 @@ name: harness-submit
3
3
  description: 最终提交封装:验证→中文 commit→提交/推送;worktree 模式含 --no-ff
4
4
  合并回主分支。使用场景:提交代码、commit、push、合并分支、merge to main、完成开发
5
5
  ---
6
- <!-- generated by harness_deploy.py; core=d437039c3207693b; overlay=java; agent=cursor; do not edit -->
6
+ <!-- generated by harness_deploy.py; core=d89ba652e358a96b; overlay=java; agent=cursor; do not edit -->
7
7
  # harness-submit — 最终提交(含 worktree 合并)
8
8
 
9
9
  ## Purpose
@@ -380,14 +380,14 @@ powershell.exe -Command "git -C '<项目路径>' diff --name-only --diff-filter=
380
380
 
381
381
  重跑后写回 ledger 的 `compile`/`unitTest`,更新 `diffHash`/`currentHead`。
382
382
 
383
- **写 check-ok marker**(npm run check exit 0 后强制):让 pre-push hook 跳过重复 check(省 ~350s)。三重校验(marker ts<10min + command + HEAD),任一不满足照跑。
383
+ **写 check-ok marker**(npm run check exit 0 后强制):让 pre-push hook 跳过重复 check。三重校验(marker ts<10min + command + commit tree),任一不满足照跑。marker 写入时记录 `git write-tree`,因此验证后创建 commit 不会仅因 HEAD 前移而使缓存失效。
384
384
 
385
385
  ```powershell
386
386
  # npm run check exit 0 后立即写 marker(M5 或 REUSED 后均可)
387
387
  powershell.exe -Command "python harness/scripts/harness_check_gate.py --write"
388
388
  ```
389
389
 
390
- > marker 写入 `.harness/check-ok.marker`(gitignored,本地)。push 时 pre-push hook marker:HEAD 自写 marker 后未变 + ts<10min + command 匹配 → 跳过 npm run check;否则照跑(安全默认)。
390
+ > marker 写入 `.harness/check-ok.marker`(gitignored,本地)。push 时 pre-push hook 比较 `HEAD^{tree}` marker `treeHash`,再校验 ts<10min + command;commit tree 未变化即可跳过,任何内容变化都照跑(安全默认)。
391
391
 
392
392
  ### 步骤 M6:push 主分支
393
393
 
@@ -2,7 +2,7 @@
2
2
  name: harness-sync
3
3
  description: 检查并更新项目AI元数据(CodeGraph索引、harness-codebase-map分析、CLAUDE.md、AGENTS.md、.harness/完整性),确保Claude对代码库的理解与最新代码一致。当用户说'同步/更新索引/刷新元数据/检查一致性'时使用
4
4
  ---
5
- <!-- generated by harness_deploy.py; core=d437039c3207693b; overlay=java; agent=cursor; do not edit -->
5
+ <!-- generated by harness_deploy.py; core=d89ba652e358a96b; overlay=java; agent=cursor; do not edit -->
6
6
  # harness-sync — 元数据同步
7
7
 
8
8
  ## Purpose
@@ -2,7 +2,7 @@
2
2
  name: harness-test
3
3
  description: 测试执行:读取场景表,执行单元测试+API接口测试+数据兼容验证,输出测试报告。当用户说'跑测试/验证/跑用例/接口测试/单元测试'时使用
4
4
  ---
5
- <!-- generated by harness_deploy.py; core=d437039c3207693b; overlay=java; agent=cursor; do not edit -->
5
+ <!-- generated by harness_deploy.py; core=d89ba652e358a96b; overlay=java; agent=cursor; do not edit -->
6
6
  # harness-test — 测试执行
7
7
 
8
8
  ## Purpose
@@ -37,6 +37,8 @@ description: harness-test 的 Phase 0 环境准备 + Playwright 探测 + 关门
37
37
  - [ ] 检查 PowerShell 基础命令:`powershell.exe -NoProfile -Command "$PSVersionTable.PSVersion"` 返回 exitCode=0
38
38
  - [ ] 检查 Node 绝对路径:`powershell.exe -NoProfile -Command "& 'C:\nvm4w\nodejs\node.exe' --version"` 返回 exitCode=0
39
39
  - [ ] 检查 Maven 可用性:`powershell.exe -NoProfile -Command "mvn -version"` 返回 exitCode=0
40
+ - [ ] 读取 `.mvn/maven.config`,Maven 命令不重复或覆盖已有 `-s` / `-o` / 仓库设置
41
+ - [ ] 离线依赖缺失时仅在项目规则允许联网时执行至多一次非离线 `-nsu` 恢复;失败后停止,禁止切换参数反复重试
40
42
  - [ ] 检查安全分类器:上述任一命令是否返回"安全分类器暂时不可用" / Auto mode 拦截 → **不应出现**
41
43
  - [ ] 将通过的 `nodeAbsolutePath` / `powershellVersion` / `mvnVersion` 写入 `.harness/changes/<change-name>/runtime/preflight.json`
42
44
  - [ ] **任一情况触发硬停**:原文输出"❌ 命令执行模式不可用:PowerShell/Node runner 无法稳定执行...",**不得继续编译/启动服务/生成 runner,不得长时间等待,不得盲目降级到 Playwright MCP**
@@ -314,4 +316,4 @@ powershell.exe -Command "Copy-Item '<main-dir>/<module>/src/main/resources/appli
314
316
  - 请求执行器必须在报告中明确记录(四种执行器,含降级原因)
315
317
  - 请求耗时统计必须包含在报告中
316
318
  - 服务由 AI 启动的情况,测试结束默认 Stop-Process;**即使测试失败也要进入 finally 清理**
317
- - final-summary 的 apiTest 状态必须用 OK/PARTIAL/BLOCKED/NOT_RUN/FAIL(不得把 PARTIAL 写成 NOT_RUN)
319
+ - final-summary 的 apiTest 状态必须用 OK/PARTIAL/BLOCKED/NOT_RUN/FAIL(不得把 PARTIAL 写成 NOT_RUN)
@@ -6,6 +6,8 @@ description: harness-test 的 API 测试执行细节、批量 runner、token 缓
6
6
 
7
7
  ## 命令执行模式 preflight(0.0y)
8
8
 
9
+ 执行 Maven 前必须读取 `.mvn/maven.config`。项目已声明的 `-s`、`-o`、镜像和仓库设置不得被测试命令重复追加或覆盖。离线依赖缺失时,只有在项目规则允许联网的情况下,才可临时执行至多一次非离线 `-nsu` 恢复;失败后停止并报告缺失依赖,不得在多套 Maven 参数间反复试跑。
10
+
9
11
  `/harness-test` 高度依赖 PowerShell 与 Node。在编译/启动服务/生成 runner **之前**
10
12
  必须执行 4 项执行模式检查:
11
13
 
@@ -1,14 +1,15 @@
1
1
  #!/usr/bin/env python3
2
2
  """Pre-push gate: skip `npm run check` when a recent check-ok marker matches
3
- the current HEAD.
3
+ the tree of the commit being pushed.
4
4
 
5
5
  Triple check (all must pass to skip, else exit 1 → hook runs npm run check):
6
6
  1. marker exists and its `ts` is within MAX_AGE_S (10 min) of now
7
7
  2. marker `command` == EXPECTED_CMD ("npm run check")
8
- 3. current `git rev-parse HEAD` == marker `commitHash`
8
+ 3. current `git rev-parse HEAD^{tree}` == marker `treeHash`
9
9
 
10
- The marker is written by harness-submit M5 right after a green `npm run check`.
11
- Any mismatch (no marker, stale, different command, HEAD moved since the check)
10
+ The marker is written by harness-submit M5 after a green `npm run check` and
11
+ records `git write-tree`. This remains valid after commit because the new HEAD
12
+ has the same tree. Any mismatch (no marker, stale, command or tree changed)
12
13
  forces a full re-run — the safe default. This is a local convenience only;
13
14
  non-harness pushes have no marker and always run the check.
14
15
 
@@ -28,10 +29,10 @@ MAX_AGE_S = 600 # 10 minutes
28
29
  EXPECTED_CMD = "npm run check"
29
30
 
30
31
 
31
- def _current_head() -> str | None:
32
+ def _git_output(args: list[str]) -> str | None:
32
33
  try:
33
34
  r = subprocess.run(
34
- ["git", "rev-parse", "HEAD"],
35
+ ["git", *args],
35
36
  cwd=str(ROOT),
36
37
  capture_output=True,
37
38
  text=True,
@@ -42,20 +43,27 @@ def _current_head() -> str | None:
42
43
  return r.stdout.strip() if r.returncode == 0 else None
43
44
 
44
45
 
46
+ def _current_index_tree() -> str | None:
47
+ return _git_output(["write-tree"])
48
+
49
+
50
+ def _current_head_tree() -> str | None:
51
+ return _git_output(["rev-parse", "HEAD^{tree}"])
52
+
53
+
45
54
  def write_marker() -> int:
46
- """Write a check-ok marker for the current HEAD (called by harness-submit M5
47
- after a green npm run check). Pre-push gate reads it to skip a re-run."""
48
- head = _current_head()
49
- if head is None:
55
+ """Record the verified index tree so the marker survives the next commit."""
56
+ tree = _current_index_tree()
57
+ if tree is None:
50
58
  return 1
51
59
  MARKER.parent.mkdir(parents=True, exist_ok=True)
52
- payload = {"ts": time.time(), "commitHash": head, "command": EXPECTED_CMD}
60
+ payload = {"ts": time.time(), "treeHash": tree, "command": EXPECTED_CMD}
53
61
  MARKER.write_text(
54
62
  json.dumps(payload, ensure_ascii=False) + "\n",
55
63
  encoding="utf-8",
56
64
  newline="\n",
57
65
  )
58
- print(f"check-ok marker written for HEAD {head[:7]}")
66
+ print(f"check-ok marker written for tree {tree[:7]}")
59
67
  return 0
60
68
 
61
69
 
@@ -84,17 +92,17 @@ def main(argv: list[str] | None = None) -> int:
84
92
  return 1
85
93
  if data.get("command") != EXPECTED_CMD:
86
94
  return 1
87
- marker_commit = data.get("commitHash")
88
- if not isinstance(marker_commit, str):
95
+ marker_tree = data.get("treeHash")
96
+ if not isinstance(marker_tree, str):
89
97
  return 1
90
- head = _current_head()
91
- if head is None or head != marker_commit:
98
+ tree = _current_head_tree()
99
+ if tree is None or tree != marker_tree:
92
100
  return 1
93
101
  # All three checks passed: a green npm run check ran on this exact HEAD
94
102
  # within the last 10 minutes. Safe to skip.
95
103
  print(
96
104
  f"pre-push: skipping npm run check (verified {int(time.time() - ts)}s ago "
97
- f"at HEAD {head[:7]})"
105
+ f"for tree {tree[:7]})"
98
106
  )
99
107
  return 0
100
108
 
@@ -2,12 +2,12 @@
2
2
  "schema_version": 2,
3
3
  "profile": "general",
4
4
  "adapter": "claude-code",
5
- "bundle_version": "0.2.2",
5
+ "bundle_version": "0.2.3",
6
6
  "generator": "harness_deploy.py",
7
7
  "files": [
8
8
  {
9
9
  "path": ".harness-build.json",
10
- "sha256": "d26aab76c6bd8862dd0442852f4f2d7f760a3550e66d64f8d1bd8a6db22b4933"
10
+ "sha256": "a1916226d49e9b084ec812d46ec013fd9074f3cae1c6769f451858af70adcb76"
11
11
  },
12
12
  {
13
13
  "path": "agents/harness-evaluator.md",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  {
41
41
  "path": "harness-archive/SKILL.md",
42
- "sha256": "9882482269bcce00e95c53a255d66fa9ba814c7f5fcbf234df0112a5c3d65f55"
42
+ "sha256": "9e66ec59892721c699e0b1a272f33e190335663aa56b575fcdb4e1b19950767c"
43
43
  },
44
44
  {
45
45
  "path": "harness-archive/templates/render-summary.mjs",
@@ -59,7 +59,7 @@
59
59
  },
60
60
  {
61
61
  "path": "harness-codebase-map/SKILL.md",
62
- "sha256": "b360737e805607b6549be4299ba02f0fec18bd52fb7756381b175ad07bae94d3"
62
+ "sha256": "f2ac131e9af468d206a90e27c956b0fe28581ebaaec0ce3edf49a265c706bd75"
63
63
  },
64
64
  {
65
65
  "path": "harness-codebase-map/templates/ARCHITECTURE.md",
@@ -123,11 +123,11 @@
123
123
  },
124
124
  {
125
125
  "path": "harness-knowledge-ingest/SKILL.md",
126
- "sha256": "3516ab306d156bacb02af117632ecb25b22cbf9d1aba5e413be30140ad366c19"
126
+ "sha256": "c2c0a60c2f8f15e4f2cc6b541e94797fa1008f95ca641605c21dc79d7d439631"
127
127
  },
128
128
  {
129
129
  "path": "harness-knowledge-query/SKILL.md",
130
- "sha256": "62c0dfc675f50af6e542b9bd9db45bc84cb50b3192ed7cf245ccc9d8d7204aee"
130
+ "sha256": "13bd2dae6c766bdec26e6d29691b1fbfa56655640e1da863f72b76a8a43d1dd0"
131
131
  },
132
132
  {
133
133
  "path": "harness-plan/checklist.md",
@@ -143,7 +143,7 @@
143
143
  },
144
144
  {
145
145
  "path": "harness-plan/SKILL.md",
146
- "sha256": "a0b0957f46ef803c4e53eafea9a8b662c95a9752cf4a9acf87854673853049e6"
146
+ "sha256": "0da491b7d5185f3514ede9f6a9965cdaab3ee1964778c863110190ac035b4f0b"
147
147
  },
148
148
  {
149
149
  "path": "harness-review/checklist.md",
@@ -159,7 +159,7 @@
159
159
  },
160
160
  {
161
161
  "path": "harness-review/SKILL.md",
162
- "sha256": "043c45183a4ca2df379e018ef0d960f7966318daf62bead04ff9e9808458d278"
162
+ "sha256": "6fb30f914f3cf8ddff8b3f5edf69bc36eb38a79aac8be20723c138da79cc11e2"
163
163
  },
164
164
  {
165
165
  "path": "harness-run/checklist.md",
@@ -175,11 +175,11 @@
175
175
  },
176
176
  {
177
177
  "path": "harness-run/SKILL.md",
178
- "sha256": "178303783680bec6a71e7eb246fd31f0ef3457d14c7051497600b47aa1c3c5b0"
178
+ "sha256": "72a81ec1ffab9235b2583d8257b0cab4e1e781fd8473b12fc06bc4df4d04973f"
179
179
  },
180
180
  {
181
181
  "path": "harness-submit/checklist.md",
182
- "sha256": "abe6e77386cc702b2edafdec69609f1064cbc0794d42a3b49949400019e73f76"
182
+ "sha256": "fed0521d7bbcb66a71534030fdb99a31d8e5ca4e950e7b56438084c8722af996"
183
183
  },
184
184
  {
185
185
  "path": "harness-submit/reference.md",
@@ -187,7 +187,7 @@
187
187
  },
188
188
  {
189
189
  "path": "harness-submit/SKILL.md",
190
- "sha256": "3aaf462e279591911844c5bde4cd98c4615f7b7e8ae2ca2a15c0e6eff67f5433"
190
+ "sha256": "653b810f9c30a5ea85cd416df6601e697d394808d148ae810462ce89a4d665af"
191
191
  },
192
192
  {
193
193
  "path": "harness-sync/reference.md",
@@ -195,7 +195,7 @@
195
195
  },
196
196
  {
197
197
  "path": "harness-sync/SKILL.md",
198
- "sha256": "e5b8234b4b934ebb199e500fe1ac2ce825f03ba7c113ca3b20c566e0d24834e5"
198
+ "sha256": "9adb8e04b4f6d2b9afebe8c9d781d7f79d3c236595bed0adf3ad344635852ae8"
199
199
  },
200
200
  {
201
201
  "path": "harness-test/checklist.md",
@@ -215,7 +215,7 @@
215
215
  },
216
216
  {
217
217
  "path": "harness-test/SKILL.md",
218
- "sha256": "89133639c6814f4aeddb27b339509e7e878988b1b119971f46788d778a37d891"
218
+ "sha256": "cbbfe86e197b7e535e6ea47825e96c9b278c0b437d1f458f1f28e79d1d7aeae7"
219
219
  },
220
220
  {
221
221
  "path": "protocols/archive-report-protocol.md",
@@ -259,7 +259,7 @@
259
259
  },
260
260
  {
261
261
  "path": "scripts/harness_check_gate.py",
262
- "sha256": "184a546ab76e7b9d21bd8e27802fee1f6304c392c65bca041ff7914b7fa7722a"
262
+ "sha256": "9cae8f7fc2ff4519b0c27566b9d5aaa81bd8921153ec1f9534cb5d08af3a21b3"
263
263
  },
264
264
  {
265
265
  "path": "scripts/harness_deploy.py",
@@ -2,12 +2,12 @@
2
2
  "schema_version": 2,
3
3
  "profile": "general",
4
4
  "adapter": "codebuddy",
5
- "bundle_version": "0.2.2",
5
+ "bundle_version": "0.2.3",
6
6
  "generator": "harness_deploy.py",
7
7
  "files": [
8
8
  {
9
9
  "path": ".harness-build.json",
10
- "sha256": "489eb89e6756eb5c49cd4786427bafc5e46b45f0b25c923cd414a3d920dcb999"
10
+ "sha256": "7eb0b859d0d22a15f4729ffa7bbfb5c4417f59ad216ad662915e1588fcdb15ad"
11
11
  },
12
12
  {
13
13
  "path": "agents/harness-evaluator.md",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  {
41
41
  "path": "harness-archive/SKILL.md",
42
- "sha256": "3acbc17ecd20e65c1c8cf0ea76b30255603db89453e2c99e7be8a7bc474f15da"
42
+ "sha256": "c6af13a6065cd2059b1e1d88392b9c9405f8b6401feca129de9e922d7a6078d7"
43
43
  },
44
44
  {
45
45
  "path": "harness-archive/templates/render-summary.mjs",
@@ -59,7 +59,7 @@
59
59
  },
60
60
  {
61
61
  "path": "harness-codebase-map/SKILL.md",
62
- "sha256": "839c447b8228bb13389b4cf6fb3eb6c408ae57e9d45fbf778828e1db94c45fdd"
62
+ "sha256": "df375387d945c5d18aaba1c6018bb684f966d9a758e8cbf716ed050f2342459c"
63
63
  },
64
64
  {
65
65
  "path": "harness-codebase-map/templates/ARCHITECTURE.md",
@@ -123,11 +123,11 @@
123
123
  },
124
124
  {
125
125
  "path": "harness-knowledge-ingest/SKILL.md",
126
- "sha256": "de0fcfb29801d17ec768b69d5ebbef9b24bce08d089d8b39cd8e83c6dfb2c68a"
126
+ "sha256": "6df316bfecad55bf25ab8cfa22408e258fee2ea7ed3d1b2d910549051dc019e3"
127
127
  },
128
128
  {
129
129
  "path": "harness-knowledge-query/SKILL.md",
130
- "sha256": "9b0d71008bd4d84ae92c031f2fc1d97011af97beb67714d571303082bd80ef14"
130
+ "sha256": "6cff193da81056671e57fa88fd5aea81818fb69e921f2e03bba2296c7c808d60"
131
131
  },
132
132
  {
133
133
  "path": "harness-plan/checklist.md",
@@ -143,7 +143,7 @@
143
143
  },
144
144
  {
145
145
  "path": "harness-plan/SKILL.md",
146
- "sha256": "c37a29c2ce4e9069701417c9e1fa0fba1d96faa2eb629f2eea55bbd244b17f19"
146
+ "sha256": "8285c7d1a1f652d2b95fb250fedb71240f49398ab52f29fa3ef0c82066429ed6"
147
147
  },
148
148
  {
149
149
  "path": "harness-review/checklist.md",
@@ -159,7 +159,7 @@
159
159
  },
160
160
  {
161
161
  "path": "harness-review/SKILL.md",
162
- "sha256": "969bd854b55d1ad3c2f0b96642c10f89eadcae5d67dc1c3044df753da76b7ffa"
162
+ "sha256": "c122f453e7b16c014d8c57750ab0a3e8dbe9d211f697c778b302866a579841e8"
163
163
  },
164
164
  {
165
165
  "path": "harness-run/checklist.md",
@@ -175,11 +175,11 @@
175
175
  },
176
176
  {
177
177
  "path": "harness-run/SKILL.md",
178
- "sha256": "7484e94ef50a741e255a51f3c175e44c4306b2b58420f1acd4155d0b2693267d"
178
+ "sha256": "23bf2d8eb5c5c36daa8608584458931531141398143846cac91ea2ca3e9a8b1e"
179
179
  },
180
180
  {
181
181
  "path": "harness-submit/checklist.md",
182
- "sha256": "abe6e77386cc702b2edafdec69609f1064cbc0794d42a3b49949400019e73f76"
182
+ "sha256": "fed0521d7bbcb66a71534030fdb99a31d8e5ca4e950e7b56438084c8722af996"
183
183
  },
184
184
  {
185
185
  "path": "harness-submit/reference.md",
@@ -187,7 +187,7 @@
187
187
  },
188
188
  {
189
189
  "path": "harness-submit/SKILL.md",
190
- "sha256": "53ace6eb09ca96ff8657ae49f370eb6cb1f2d7fb6dc494862b1365808751fb8f"
190
+ "sha256": "3e1822b3cde8f75163da743849209ddab05707f27c4634daa6ce9fb9d8d06dbd"
191
191
  },
192
192
  {
193
193
  "path": "harness-sync/reference.md",
@@ -195,7 +195,7 @@
195
195
  },
196
196
  {
197
197
  "path": "harness-sync/SKILL.md",
198
- "sha256": "3eaa5f0a9dfa458f29eb3a34f0954c90c996c084590f1f732595c8a5facca31c"
198
+ "sha256": "47e6ffbb80460468a13e1c1d4fd1877adc65f54134612593c907b87f46016c47"
199
199
  },
200
200
  {
201
201
  "path": "harness-test/checklist.md",
@@ -215,7 +215,7 @@
215
215
  },
216
216
  {
217
217
  "path": "harness-test/SKILL.md",
218
- "sha256": "da73648e160fa626409f6719f33c15aebb83aae1aa19c4caed8e25921d61add3"
218
+ "sha256": "5dfece7f804c00f2e0b2baeb407fcb5ffd94707dd4fd5d061b825ddebd278bfe"
219
219
  },
220
220
  {
221
221
  "path": "protocols/archive-report-protocol.md",
@@ -259,7 +259,7 @@
259
259
  },
260
260
  {
261
261
  "path": "scripts/harness_check_gate.py",
262
- "sha256": "184a546ab76e7b9d21bd8e27802fee1f6304c392c65bca041ff7914b7fa7722a"
262
+ "sha256": "9cae8f7fc2ff4519b0c27566b9d5aaa81bd8921153ec1f9534cb5d08af3a21b3"
263
263
  },
264
264
  {
265
265
  "path": "scripts/harness_deploy.py",
@@ -2,12 +2,12 @@
2
2
  "schema_version": 2,
3
3
  "profile": "general",
4
4
  "adapter": "codex",
5
- "bundle_version": "0.2.2",
5
+ "bundle_version": "0.2.3",
6
6
  "generator": "harness_deploy.py",
7
7
  "files": [
8
8
  {
9
9
  "path": ".harness-build.json",
10
- "sha256": "3894db0527d3da2546df64c3c70bdda95597bd8e1caa6a6ccfd683d6218820f2"
10
+ "sha256": "ce551d13290f3c03675b1007cc35dc04e38930f875d68770b28b3934dc705cad"
11
11
  },
12
12
  {
13
13
  "path": "CONTEXT.md",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  {
29
29
  "path": "harness-archive/SKILL.md",
30
- "sha256": "f874ef8ec0bb454e0d655c216ed17834bc3d46da51b496607676fe4bc9db3ba3"
30
+ "sha256": "ab97f828df9eb3df8b0bfe2070758246d9b9c04563afde36c06c444389b21d75"
31
31
  },
32
32
  {
33
33
  "path": "harness-archive/templates/render-summary.mjs",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  {
49
49
  "path": "harness-codebase-map/SKILL.md",
50
- "sha256": "3f4961054c6bb59fb803775bb5df8d2d1443d1a49c6212a5a5f258abf571279e"
50
+ "sha256": "779021b0a18a0293e5720d1233398987edc6aab72279b2fe04ae831d514dc07b"
51
51
  },
52
52
  {
53
53
  "path": "harness-codebase-map/templates/ARCHITECTURE.md",
@@ -111,11 +111,11 @@
111
111
  },
112
112
  {
113
113
  "path": "harness-knowledge-ingest/SKILL.md",
114
- "sha256": "9b991640d5eb4089d9988ce3f416d459a510eb3619ce01b34139c752ef593858"
114
+ "sha256": "254da35251535d0b254d089b25f25991ce808bdce42c164ea178e5202b5da4a2"
115
115
  },
116
116
  {
117
117
  "path": "harness-knowledge-query/SKILL.md",
118
- "sha256": "e3dfaa1c135aa60b3d6d7ea8c658d852814bdc36f41927f1da388ea6bc346571"
118
+ "sha256": "cbb9e9d7b6c302db96256432a304aab54b30ce3f12469e7d3f74db63e850cea9"
119
119
  },
120
120
  {
121
121
  "path": "harness-plan/checklist.md",
@@ -131,7 +131,7 @@
131
131
  },
132
132
  {
133
133
  "path": "harness-plan/SKILL.md",
134
- "sha256": "50220ac65f5fdceabe8d35ed7d7977c6fc53d9c25e585a91c79fc2c70bde48a3"
134
+ "sha256": "55d9d017b4c9ce62545f2a0aa101ac21eb1eb6b9fa5f951a76ba58b877b8d146"
135
135
  },
136
136
  {
137
137
  "path": "harness-review/checklist.md",
@@ -147,7 +147,7 @@
147
147
  },
148
148
  {
149
149
  "path": "harness-review/SKILL.md",
150
- "sha256": "3759af76bb1274467d5ca115079e4b9a97e327069caf2f8a678f749d73bda732"
150
+ "sha256": "f1cf9989d43b18c88b45ccca80bdcef25da06cda00c036f7a8d73111eb633fd0"
151
151
  },
152
152
  {
153
153
  "path": "harness-run/checklist.md",
@@ -163,11 +163,11 @@
163
163
  },
164
164
  {
165
165
  "path": "harness-run/SKILL.md",
166
- "sha256": "2c0fba6642074e1655b7510bee5dd7f2fcf9c0e024b1de711998b3e459cd6085"
166
+ "sha256": "ff23163c329513e59e4d5ca92b5d7a471e4de81e4b80453624c04f19373943d9"
167
167
  },
168
168
  {
169
169
  "path": "harness-submit/checklist.md",
170
- "sha256": "abe6e77386cc702b2edafdec69609f1064cbc0794d42a3b49949400019e73f76"
170
+ "sha256": "fed0521d7bbcb66a71534030fdb99a31d8e5ca4e950e7b56438084c8722af996"
171
171
  },
172
172
  {
173
173
  "path": "harness-submit/reference.md",
@@ -175,7 +175,7 @@
175
175
  },
176
176
  {
177
177
  "path": "harness-submit/SKILL.md",
178
- "sha256": "1e80d69bb891e373280fc2b642925386a180dcfb5bde278622b9c8b70e859374"
178
+ "sha256": "3be5f01baea189596ddf2a08b7412b8c8bfc389dcc6ca20041b05ca51bfb66f7"
179
179
  },
180
180
  {
181
181
  "path": "harness-sync/reference.md",
@@ -183,7 +183,7 @@
183
183
  },
184
184
  {
185
185
  "path": "harness-sync/SKILL.md",
186
- "sha256": "f3df9ed9fddd23cbaa65f4c76feff2a94e2a62703d3a474f17512aa15d92168b"
186
+ "sha256": "0d1c332778370a0799d6c79388e1b7768a41da4f906cbff3a08ace9f69d371ca"
187
187
  },
188
188
  {
189
189
  "path": "harness-test/checklist.md",
@@ -203,7 +203,7 @@
203
203
  },
204
204
  {
205
205
  "path": "harness-test/SKILL.md",
206
- "sha256": "5c2fb377b4819621d0a2ba842d046418c5c968edffe0aa5f6a81a586ffd69108"
206
+ "sha256": "bd0f054b844c22336071da9bda75b239bd662925d36d8dd541985474c1bfe8dc"
207
207
  },
208
208
  {
209
209
  "path": "protocols/archive-report-protocol.md",
@@ -247,7 +247,7 @@
247
247
  },
248
248
  {
249
249
  "path": "scripts/harness_check_gate.py",
250
- "sha256": "184a546ab76e7b9d21bd8e27802fee1f6304c392c65bca041ff7914b7fa7722a"
250
+ "sha256": "9cae8f7fc2ff4519b0c27566b9d5aaa81bd8921153ec1f9534cb5d08af3a21b3"
251
251
  },
252
252
  {
253
253
  "path": "scripts/harness_deploy.py",