@hunter-harness/workflow-harness 0.2.2 → 0.2.4
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.
- package/harness/bundles/general/claude-code/.harness-build.json +1 -1
- package/harness/bundles/general/claude-code/README.md +12 -11
- package/harness/bundles/general/claude-code/harness-archive/SKILL.md +7 -9
- package/harness/bundles/general/claude-code/harness-archive/checklist.md +4 -4
- package/harness/bundles/general/claude-code/harness-archive/reference.md +3 -5
- package/harness/bundles/general/claude-code/harness-codebase-map/SKILL.md +2 -2
- package/harness/bundles/general/claude-code/harness-knowledge-ingest/SKILL.md +2 -2
- package/harness/bundles/general/claude-code/harness-knowledge-query/SKILL.md +10 -16
- package/harness/bundles/general/claude-code/harness-plan/SKILL.md +14 -10
- package/harness/bundles/general/claude-code/harness-plan/checklist.md +28 -13
- package/harness/bundles/general/claude-code/harness-plan/protocols.md +10 -3
- package/harness/bundles/general/claude-code/harness-plan/reference.md +9 -23
- package/harness/bundles/general/claude-code/harness-review/SKILL.md +2 -2
- package/harness/bundles/general/claude-code/harness-run/SKILL.md +2 -2
- package/harness/bundles/general/claude-code/harness-run/protocols.md +3 -2
- package/harness/bundles/general/claude-code/harness-submit/SKILL.md +2 -2
- package/harness/bundles/general/claude-code/harness-submit/checklist.md +2 -2
- package/harness/bundles/general/claude-code/harness-sync/SKILL.md +2 -2
- package/harness/bundles/general/claude-code/harness-test/SKILL.md +2 -2
- package/harness/bundles/general/claude-code/scripts/harness_check_gate.py +25 -17
- package/harness/bundles/general/codebuddy/.harness-build.json +1 -1
- package/harness/bundles/general/codebuddy/README.md +12 -11
- package/harness/bundles/general/codebuddy/harness-archive/SKILL.md +7 -9
- package/harness/bundles/general/codebuddy/harness-archive/checklist.md +4 -4
- package/harness/bundles/general/codebuddy/harness-archive/reference.md +3 -5
- package/harness/bundles/general/codebuddy/harness-codebase-map/SKILL.md +2 -2
- package/harness/bundles/general/codebuddy/harness-knowledge-ingest/SKILL.md +2 -2
- package/harness/bundles/general/codebuddy/harness-knowledge-query/SKILL.md +10 -16
- package/harness/bundles/general/codebuddy/harness-plan/SKILL.md +13 -9
- package/harness/bundles/general/codebuddy/harness-plan/checklist.md +28 -13
- package/harness/bundles/general/codebuddy/harness-plan/protocols.md +10 -3
- package/harness/bundles/general/codebuddy/harness-plan/reference.md +9 -23
- package/harness/bundles/general/codebuddy/harness-review/SKILL.md +2 -2
- package/harness/bundles/general/codebuddy/harness-run/SKILL.md +2 -2
- package/harness/bundles/general/codebuddy/harness-run/protocols.md +3 -2
- package/harness/bundles/general/codebuddy/harness-submit/SKILL.md +2 -2
- package/harness/bundles/general/codebuddy/harness-submit/checklist.md +2 -2
- package/harness/bundles/general/codebuddy/harness-sync/SKILL.md +2 -2
- package/harness/bundles/general/codebuddy/harness-test/SKILL.md +2 -2
- package/harness/bundles/general/codebuddy/scripts/harness_check_gate.py +25 -17
- package/harness/bundles/general/codex/.harness-build.json +1 -1
- package/harness/bundles/general/codex/README.md +12 -11
- package/harness/bundles/general/codex/harness-archive/SKILL.md +7 -9
- package/harness/bundles/general/codex/harness-archive/checklist.md +4 -4
- package/harness/bundles/general/codex/harness-archive/reference.md +3 -5
- package/harness/bundles/general/codex/harness-codebase-map/SKILL.md +2 -2
- package/harness/bundles/general/codex/harness-knowledge-ingest/SKILL.md +2 -2
- package/harness/bundles/general/codex/harness-knowledge-query/SKILL.md +10 -16
- package/harness/bundles/general/codex/harness-plan/SKILL.md +13 -9
- package/harness/bundles/general/codex/harness-plan/checklist.md +28 -13
- package/harness/bundles/general/codex/harness-plan/protocols.md +10 -3
- package/harness/bundles/general/codex/harness-plan/reference.md +9 -23
- package/harness/bundles/general/codex/harness-review/SKILL.md +2 -2
- package/harness/bundles/general/codex/harness-run/SKILL.md +2 -2
- package/harness/bundles/general/codex/harness-run/protocols.md +3 -2
- package/harness/bundles/general/codex/harness-submit/SKILL.md +2 -2
- package/harness/bundles/general/codex/harness-submit/checklist.md +2 -2
- package/harness/bundles/general/codex/harness-sync/SKILL.md +2 -2
- package/harness/bundles/general/codex/harness-test/SKILL.md +2 -2
- package/harness/bundles/general/codex/scripts/harness_check_gate.py +25 -17
- package/harness/bundles/general/cursor/.harness-build.json +1 -1
- package/harness/bundles/general/cursor/README.md +12 -11
- package/harness/bundles/general/cursor/harness-archive/SKILL.md +7 -9
- package/harness/bundles/general/cursor/harness-archive/checklist.md +4 -4
- package/harness/bundles/general/cursor/harness-archive/reference.md +3 -5
- package/harness/bundles/general/cursor/harness-codebase-map/SKILL.md +2 -2
- package/harness/bundles/general/cursor/harness-knowledge-ingest/SKILL.md +2 -2
- package/harness/bundles/general/cursor/harness-knowledge-query/SKILL.md +10 -16
- package/harness/bundles/general/cursor/harness-plan/SKILL.md +13 -9
- package/harness/bundles/general/cursor/harness-plan/checklist.md +28 -13
- package/harness/bundles/general/cursor/harness-plan/protocols.md +10 -3
- package/harness/bundles/general/cursor/harness-plan/reference.md +9 -23
- package/harness/bundles/general/cursor/harness-review/SKILL.md +2 -2
- package/harness/bundles/general/cursor/harness-run/SKILL.md +2 -2
- package/harness/bundles/general/cursor/harness-run/protocols.md +3 -2
- package/harness/bundles/general/cursor/harness-submit/SKILL.md +2 -2
- package/harness/bundles/general/cursor/harness-submit/checklist.md +2 -2
- package/harness/bundles/general/cursor/harness-sync/SKILL.md +2 -2
- package/harness/bundles/general/cursor/harness-test/SKILL.md +2 -2
- package/harness/bundles/general/cursor/scripts/harness_check_gate.py +25 -17
- package/harness/bundles/java/claude-code/.harness-build.json +1 -1
- package/harness/bundles/java/claude-code/README.md +12 -11
- package/harness/bundles/java/claude-code/harness-apidoc/SKILL.md +2 -2
- package/harness/bundles/java/claude-code/harness-archive/SKILL.md +7 -9
- package/harness/bundles/java/claude-code/harness-archive/checklist.md +4 -4
- package/harness/bundles/java/claude-code/harness-archive/reference.md +3 -5
- package/harness/bundles/java/claude-code/harness-codebase-map/SKILL.md +2 -2
- package/harness/bundles/java/claude-code/harness-knowledge-ingest/SKILL.md +2 -2
- package/harness/bundles/java/claude-code/harness-knowledge-query/SKILL.md +10 -16
- package/harness/bundles/java/claude-code/harness-package/SKILL.md +2 -2
- package/harness/bundles/java/claude-code/harness-plan/SKILL.md +14 -10
- package/harness/bundles/java/claude-code/harness-plan/checklist.md +28 -13
- package/harness/bundles/java/claude-code/harness-plan/protocols.md +10 -3
- package/harness/bundles/java/claude-code/harness-plan/reference.md +9 -23
- package/harness/bundles/java/claude-code/harness-review/SKILL.md +2 -2
- package/harness/bundles/java/claude-code/harness-run/SKILL.md +2 -2
- package/harness/bundles/java/claude-code/harness-run/checklist.md +2 -0
- package/harness/bundles/java/claude-code/harness-run/protocols.md +3 -2
- package/harness/bundles/java/claude-code/harness-run/reference.md +6 -0
- package/harness/bundles/java/claude-code/harness-submit/SKILL.md +2 -2
- package/harness/bundles/java/claude-code/harness-submit/checklist.md +2 -2
- package/harness/bundles/java/claude-code/harness-sync/SKILL.md +2 -2
- package/harness/bundles/java/claude-code/harness-test/SKILL.md +2 -2
- package/harness/bundles/java/claude-code/harness-test/checklist.md +3 -1
- package/harness/bundles/java/claude-code/harness-test/reference.md +2 -0
- package/harness/bundles/java/claude-code/scripts/harness_check_gate.py +25 -17
- package/harness/bundles/java/codebuddy/.harness-build.json +1 -1
- package/harness/bundles/java/codebuddy/README.md +12 -11
- package/harness/bundles/java/codebuddy/harness-apidoc/SKILL.md +2 -2
- package/harness/bundles/java/codebuddy/harness-archive/SKILL.md +7 -9
- package/harness/bundles/java/codebuddy/harness-archive/checklist.md +4 -4
- package/harness/bundles/java/codebuddy/harness-archive/reference.md +3 -5
- package/harness/bundles/java/codebuddy/harness-codebase-map/SKILL.md +2 -2
- package/harness/bundles/java/codebuddy/harness-knowledge-ingest/SKILL.md +2 -2
- package/harness/bundles/java/codebuddy/harness-knowledge-query/SKILL.md +10 -16
- package/harness/bundles/java/codebuddy/harness-package/SKILL.md +2 -2
- package/harness/bundles/java/codebuddy/harness-plan/SKILL.md +13 -9
- package/harness/bundles/java/codebuddy/harness-plan/checklist.md +28 -13
- package/harness/bundles/java/codebuddy/harness-plan/protocols.md +10 -3
- package/harness/bundles/java/codebuddy/harness-plan/reference.md +9 -23
- package/harness/bundles/java/codebuddy/harness-review/SKILL.md +2 -2
- package/harness/bundles/java/codebuddy/harness-run/SKILL.md +2 -2
- package/harness/bundles/java/codebuddy/harness-run/checklist.md +2 -0
- package/harness/bundles/java/codebuddy/harness-run/protocols.md +3 -2
- package/harness/bundles/java/codebuddy/harness-run/reference.md +6 -0
- package/harness/bundles/java/codebuddy/harness-submit/SKILL.md +2 -2
- package/harness/bundles/java/codebuddy/harness-submit/checklist.md +2 -2
- package/harness/bundles/java/codebuddy/harness-sync/SKILL.md +2 -2
- package/harness/bundles/java/codebuddy/harness-test/SKILL.md +2 -2
- package/harness/bundles/java/codebuddy/harness-test/checklist.md +3 -1
- package/harness/bundles/java/codebuddy/harness-test/reference.md +2 -0
- package/harness/bundles/java/codebuddy/scripts/harness_check_gate.py +25 -17
- package/harness/bundles/java/codex/.harness-build.json +1 -1
- package/harness/bundles/java/codex/README.md +12 -11
- package/harness/bundles/java/codex/harness-apidoc/SKILL.md +2 -2
- package/harness/bundles/java/codex/harness-archive/SKILL.md +7 -9
- package/harness/bundles/java/codex/harness-archive/checklist.md +4 -4
- package/harness/bundles/java/codex/harness-archive/reference.md +3 -5
- package/harness/bundles/java/codex/harness-codebase-map/SKILL.md +2 -2
- package/harness/bundles/java/codex/harness-knowledge-ingest/SKILL.md +2 -2
- package/harness/bundles/java/codex/harness-knowledge-query/SKILL.md +10 -16
- package/harness/bundles/java/codex/harness-package/SKILL.md +2 -2
- package/harness/bundles/java/codex/harness-plan/SKILL.md +13 -9
- package/harness/bundles/java/codex/harness-plan/checklist.md +28 -13
- package/harness/bundles/java/codex/harness-plan/protocols.md +10 -3
- package/harness/bundles/java/codex/harness-plan/reference.md +9 -23
- package/harness/bundles/java/codex/harness-review/SKILL.md +2 -2
- package/harness/bundles/java/codex/harness-run/SKILL.md +2 -2
- package/harness/bundles/java/codex/harness-run/checklist.md +2 -0
- package/harness/bundles/java/codex/harness-run/protocols.md +3 -2
- package/harness/bundles/java/codex/harness-run/reference.md +6 -0
- package/harness/bundles/java/codex/harness-submit/SKILL.md +2 -2
- package/harness/bundles/java/codex/harness-submit/checklist.md +2 -2
- package/harness/bundles/java/codex/harness-sync/SKILL.md +2 -2
- package/harness/bundles/java/codex/harness-test/SKILL.md +2 -2
- package/harness/bundles/java/codex/harness-test/checklist.md +3 -1
- package/harness/bundles/java/codex/harness-test/reference.md +2 -0
- package/harness/bundles/java/codex/scripts/harness_check_gate.py +25 -17
- package/harness/bundles/java/cursor/.harness-build.json +1 -1
- package/harness/bundles/java/cursor/README.md +12 -11
- package/harness/bundles/java/cursor/harness-apidoc/SKILL.md +2 -2
- package/harness/bundles/java/cursor/harness-archive/SKILL.md +7 -9
- package/harness/bundles/java/cursor/harness-archive/checklist.md +4 -4
- package/harness/bundles/java/cursor/harness-archive/reference.md +3 -5
- package/harness/bundles/java/cursor/harness-codebase-map/SKILL.md +2 -2
- package/harness/bundles/java/cursor/harness-knowledge-ingest/SKILL.md +2 -2
- package/harness/bundles/java/cursor/harness-knowledge-query/SKILL.md +10 -16
- package/harness/bundles/java/cursor/harness-package/SKILL.md +2 -2
- package/harness/bundles/java/cursor/harness-plan/SKILL.md +13 -9
- package/harness/bundles/java/cursor/harness-plan/checklist.md +28 -13
- package/harness/bundles/java/cursor/harness-plan/protocols.md +10 -3
- package/harness/bundles/java/cursor/harness-plan/reference.md +9 -23
- package/harness/bundles/java/cursor/harness-review/SKILL.md +2 -2
- package/harness/bundles/java/cursor/harness-run/SKILL.md +2 -2
- package/harness/bundles/java/cursor/harness-run/checklist.md +2 -0
- package/harness/bundles/java/cursor/harness-run/protocols.md +3 -2
- package/harness/bundles/java/cursor/harness-run/reference.md +6 -0
- package/harness/bundles/java/cursor/harness-submit/SKILL.md +2 -2
- package/harness/bundles/java/cursor/harness-submit/checklist.md +2 -2
- package/harness/bundles/java/cursor/harness-sync/SKILL.md +2 -2
- package/harness/bundles/java/cursor/harness-test/SKILL.md +2 -2
- package/harness/bundles/java/cursor/harness-test/checklist.md +3 -1
- package/harness/bundles/java/cursor/harness-test/reference.md +2 -0
- package/harness/bundles/java/cursor/scripts/harness_check_gate.py +25 -17
- package/harness/manifests/general/claude-code.json +21 -21
- package/harness/manifests/general/codebuddy.json +21 -21
- package/harness/manifests/general/codex.json +21 -21
- package/harness/manifests/general/cursor.json +21 -21
- package/harness/manifests/java/claude-code.json +27 -27
- package/harness/manifests/java/codebuddy.json +27 -27
- package/harness/manifests/java/codex.json +27 -27
- package/harness/manifests/java/cursor.json +27 -27
- package/hunter-workflow-family.json +2 -2
- package/package.json +1 -1
|
@@ -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
|
|
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
|
|
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=
|
|
5
|
+
<!-- generated by harness_deploy.py; core=959b22fdc1e7af33; overlay=java; agent=codebuddy; do not edit -->
|
|
6
6
|
# harness-sync — 元数据同步
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
@@ -54,7 +54,7 @@ description: 检查并更新项目AI元数据(CodeGraph索引、harness-codeba
|
|
|
54
54
|
|
|
55
55
|
## 执行日志
|
|
56
56
|
|
|
57
|
-
`events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py`
|
|
57
|
+
`events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
|
|
58
58
|
|
|
59
59
|
```powershell
|
|
60
60
|
python <skills-root>/scripts/harness_events.py append --change-dir ".harness/changes/<change-name>" --phase <phase> --type phase.start --note "<触发指令>"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: harness-test
|
|
3
3
|
description: 测试执行:读取场景表,执行单元测试+API接口测试+数据兼容验证,输出测试报告。当用户说'跑测试/验证/跑用例/接口测试/单元测试'时使用
|
|
4
4
|
---
|
|
5
|
-
<!-- generated by harness_deploy.py; core=
|
|
5
|
+
<!-- generated by harness_deploy.py; core=959b22fdc1e7af33; overlay=java; agent=codebuddy; do not edit -->
|
|
6
6
|
# harness-test — 测试执行
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
@@ -161,7 +161,7 @@ Phase 1 前先读 `.harness/changes/<change-name>/evidence/verification-ledger.j
|
|
|
161
161
|
|
|
162
162
|
## 执行日志
|
|
163
163
|
|
|
164
|
-
`events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py`
|
|
164
|
+
`events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
|
|
165
165
|
|
|
166
166
|
```powershell
|
|
167
167
|
python <skills-root>/scripts/harness_events.py append --change-dir ".harness/changes/<change-name>" --phase <phase> --type phase.start --note "<触发指令>"
|
|
@@ -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
|
|
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 `
|
|
8
|
+
3. current `git rev-parse HEAD^{tree}` == marker `treeHash`
|
|
9
9
|
|
|
10
|
-
The marker is written by harness-submit M5
|
|
11
|
-
|
|
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
|
|
32
|
+
def _git_output(args: list[str]) -> str | None:
|
|
32
33
|
try:
|
|
33
34
|
r = subprocess.run(
|
|
34
|
-
["git",
|
|
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
|
-
"""
|
|
47
|
-
|
|
48
|
-
|
|
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(), "
|
|
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
|
|
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
|
-
|
|
88
|
-
if not isinstance(
|
|
95
|
+
marker_tree = data.get("treeHash")
|
|
96
|
+
if not isinstance(marker_tree, str):
|
|
89
97
|
return 1
|
|
90
|
-
|
|
91
|
-
if
|
|
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"
|
|
105
|
+
f"for tree {tree[:7]})"
|
|
98
106
|
)
|
|
99
107
|
return 0
|
|
100
108
|
|
|
@@ -135,12 +135,12 @@
|
|
|
135
135
|
|
|
136
136
|
## 执行日志与结构化事件机制
|
|
137
137
|
|
|
138
|
-
每个关联具体变更的 skill
|
|
138
|
+
每个关联具体变更的 skill 只维护一个实时事实源:
|
|
139
139
|
|
|
140
|
-
- `.harness/changes/<change-name>/
|
|
141
|
-
- `.harness/changes/<change-name>/
|
|
140
|
+
- `.harness/changes/<change-name>/events.ndjson`:程序化事件层;人类可读上下文、降级原因和解释性文字写入事件 `note`。
|
|
141
|
+
- `.harness/changes/<change-name>/logs/execution-log.md`:由 `harness_events.py` 在 `phase.end` 自动重建的人类审计投影,禁止 Write/Edit。
|
|
142
142
|
|
|
143
|
-
`execution-log.md`
|
|
143
|
+
渲染后的 `execution-log.md` 阶段格式统一:
|
|
144
144
|
|
|
145
145
|
```markdown
|
|
146
146
|
### [<序号>] harness-<skill> — YYYY-MM-DD HH:MM
|
|
@@ -152,16 +152,17 @@
|
|
|
152
152
|
- **摘要**: <一两句话描述主要产出或问题>
|
|
153
153
|
```
|
|
154
154
|
|
|
155
|
-
- harness-plan
|
|
156
|
-
- 后续每个 skill
|
|
157
|
-
-
|
|
155
|
+
- harness-plan 确定 change-name 后先追加 `phase.start`,脚本自动建立事件文件
|
|
156
|
+
- 后续每个 skill 开始时追加 `phase.start` 事件,结束时追加包含耗时/结果的 `phase.end` 事件
|
|
157
|
+
- **任何代码修改前必须先追加 `phase.start`**(不得等执行完才补记录)
|
|
158
158
|
- **降级时必须记录明确原因**(如"Agent 不可用,降级为主会话只读探索"),不可仅写"完成"
|
|
159
|
-
-
|
|
159
|
+
- **禁止末尾一次性补写**——各阶段实时 append 结构化事件,渲染日志不得直接编辑
|
|
160
160
|
- **Bash 拒绝、PowerShell 重试、降级、跳过、用户确认都必须记录**
|
|
161
161
|
- 日志状态统一使用 `✅OK / 🟡WARN(原因) / ❌FAIL(原因)`
|
|
162
162
|
- harness-archive 归档时从日志汇总:时间线、总用时、Skill 调用统计
|
|
163
163
|
- `harness_archive.py finalize/replay` 优先从 `events.ndjson` 汇总命令、验证、artifact、问题和决策;旧 archive 缺少 events 时才回放 execution-log/ledger/manifest
|
|
164
164
|
- sync 默认不关联具体变更目录,仅在已有变更目录时追加日志和 events
|
|
165
|
+
- archive 是例外:finalize 内部负责且仅负责一次 `phase.start` / `phase.end`,调用者不得重复追加阶段边界
|
|
165
166
|
|
|
166
167
|
## Skill 目录结构
|
|
167
168
|
|
|
@@ -259,10 +260,10 @@ harness-skills/
|
|
|
259
260
|
| 阶段 | 强制检查 |
|
|
260
261
|
|------|---------|
|
|
261
262
|
| **plan 阶段 0** | 检查工作区是否有未提交业务代码变更,已有则询问用户处理方式(继续/暂存/回滚/取消),不得假装"编码前规划" |
|
|
262
|
-
| **plan 阶段 3** | 委派前 `harness_preflight.py check-agents --agent harness-explorer`;`usable=false` 或无效返回 → 主会话只读探索,不 retry |
|
|
263
|
+
| **plan 阶段 3** | 委派前 `python <skills-root>/scripts/harness_preflight.py check-agents --skills-root <skills-root> --agent harness-explorer --json`;`usable=false` 或无效返回 → 主会话只读探索,不 retry |
|
|
263
264
|
| **plan 阶段 4/6** | 原生规划协议必须记录风险/复用/替代方案/推荐方案/关键决策,以及任务拆分摘要 |
|
|
264
265
|
| **plan 阶段 5** | 设计文档自审结果必须展示给用户;测试场景表未覆盖维度必须标记为 ⚠️ 缺口,不得全部 ✅ |
|
|
265
|
-
| **run 步骤 0** |
|
|
266
|
+
| **run 步骤 0** | 任何代码修改前必须先向 `events.ndjson` 追加 `phase.start`;执行日志由阶段结束事件自动渲染 |
|
|
266
267
|
| **run 轻量验证** | `/harness-run` 默认只做开发反馈:TDD RED/GREEN + REFACTOR + 构建命令增量编译(Java 的 `mvn compile -pl <module>` 等)+ 关门检查 + 写 verification-ledger;除非改了公共模块/数据访问层/sql/权限认证/接口层/数据契约 或用户要求 full-run-validation 或不打算继续 `/harness-test`,否则不默认跑全量测试命令(Java 的 `mvn test` 等)。若跑了全量测试必须写入 ledger 供 test/submit 复用 |
|
|
267
268
|
| **run TDD 降级** | 输出必须写"🟡 静态逻辑验证通过,未执行真实单元测试",**禁止写"测试全部通过"**;降级标注写在执行日志和覆盖报告中,**不污染业务代码注释**;记录三项:降级原因、静态验证场景列表、待部署后验证场景列表 |
|
|
268
269
|
| **test ledger 复用** | Phase 1 单元测试前先读 `verification-ledger.json`:若 run 阶段已对同一 diffHash/module/profile 跑过单元测试命令(Java 的 `mvn test` 等)且测试通过(Java 的 `Tests run: N, Failures: 0, Errors: 0` / 前端 N passing),可跳过重跑并标记"✅ 复用 harness-run 单元测试结果";diffHash 不一致 / profile 不一致 / 命令范围更窄 / run 后有行为性修改则不得复用 |
|
|
@@ -276,7 +277,7 @@ harness-skills/
|
|
|
276
277
|
| **submit 步骤 4** | 提交前必须展示四项:实际 staged 文件列表、diff stat、commit message、是否 push |
|
|
277
278
|
| **submit push 前** | `git fetch` 后检查远程是否有新提交;有则**不得直接 pull 后 push**,必须 pull/rebase + 重新 compile/test |
|
|
278
279
|
| **submit hash 记录** | pre-pull local hash + final pushed hash 双标注(主目录);worktree 模式 submit 段只本地 commit,合并段产生 `mergeFinalHash`,archive 以 `mergeFinalHash` 为准(无则回退 final pushed hash) |
|
|
279
|
-
| **archive 阶段 1** |
|
|
280
|
+
| **archive 阶段 1** | 归档前确认 commit 已 push、hash 与 submit/merge 记录一致、test/review 报告状态;阶段边界由 finalize 单进程维护,调用者不额外 append |
|
|
280
281
|
| **archive 文件移动** | 只用 PowerShell 或 Read+Write+验证,**禁止 Bash mv/cp/rm**;移动失败时不删除原目录 |
|
|
281
282
|
| **archive final-summary.html** | 默认运行 `harness_archive.py finalize`:由 events/ledger/log/manifest 生成 `summary-data.json`,再由 `templates/render-summary.mjs` 渲染 `final-summary.html`,内嵌 validate。无测试或无 review 时必须在 JSON 中标记 `NOT_RUN` / `ADVISORY_NOT_RUN`,禁止伪造 100% 通过率。必须真实展示状态演进(✅OK / 🟡WARN / 🔁REUSED / 🔁RETESTED / 📝ADVISORY / 🧹NON_BEHAVIORAL_CLEANUP) |
|
|
282
283
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: harness-apidoc
|
|
3
3
|
description: 从 Java 后端代码生成结构化前端 API 文档(Controller/VO/ErrorCode)。使用场景:接口文档、前端接口文档、API 文档生成
|
|
4
4
|
---
|
|
5
|
-
<!-- generated by harness_deploy.py; core=
|
|
5
|
+
<!-- generated by harness_deploy.py; core=c0ce0eeba998d982; overlay=java; agent=codex; do not edit -->
|
|
6
6
|
# harness-apidoc — 前端接口文档(Java overlay)
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
@@ -57,7 +57,7 @@ description: 从 Java 后端代码生成结构化前端 API 文档(Controller/
|
|
|
57
57
|
|
|
58
58
|
## 执行日志
|
|
59
59
|
|
|
60
|
-
`events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py`
|
|
60
|
+
`events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
|
|
61
61
|
|
|
62
62
|
```powershell
|
|
63
63
|
python <skills-root>/scripts/harness_events.py append --change-dir ".harness/changes/<change-name>" --phase <phase> --type phase.start --note "<触发指令>"
|
|
@@ -3,7 +3,7 @@ name: harness-archive
|
|
|
3
3
|
description: 归档所有变更产出(计划/测试报告/审查/SQL/API文档)到
|
|
4
4
|
.harness/archive/,含归档元数据和可视化最终总结。使用场景:归档、完成归档、收尾、打包产出物
|
|
5
5
|
---
|
|
6
|
-
<!-- generated by harness_deploy.py; core=
|
|
6
|
+
<!-- generated by harness_deploy.py; core=c0ce0eeba998d982; overlay=java; agent=codex; do not edit -->
|
|
7
7
|
# harness-archive — 变更归档
|
|
8
8
|
|
|
9
9
|
## Purpose
|
|
@@ -82,11 +82,9 @@ AskUserQuestion 让用户确认归档操作。**用户拒绝 → 终止流程,
|
|
|
82
82
|
|
|
83
83
|
### Phase 3:执行归档
|
|
84
84
|
|
|
85
|
-
1.
|
|
86
|
-
2.
|
|
87
|
-
3. 运行 `python <skills-root>/scripts/harness_archive.py finalize --change-dir ".harness/changes/<change-name>" --archive-root ".harness/archive" --json`;读 JSON
|
|
88
|
-
4. 模型补写 `meta/archive-meta.md` 的维护者结论 / knownRisks / manualActions(脚本占位字段)。
|
|
89
|
-
5. append `phase.end` 事件。**finalize 失败或 validate 报错时不删除原目录**。
|
|
85
|
+
1. 运行 `python <skills-root>/scripts/harness_archive.py status --change-dir ".harness/changes/<change-name>" --json` 前置检查。
|
|
86
|
+
2. 如需维护者结论,在移动前补全 `meta/archive-meta.md`;不得在 finalize 后修改已校验的归档文件。
|
|
87
|
+
3. 运行 `python <skills-root>/scripts/harness_archive.py finalize --change-dir ".harness/changes/<change-name>" --archive-root ".harness/archive" --json`;读 JSON(事件、移动、collect、render、validate、manifest 比对)。finalize 内部负责且仅负责一次 `phase.start` / `phase.end`,调用者不得重复追加。**finalize 不再同步执行知识维护**(§8.2):它写一个 `pending` maintenance-outbox 项即返回,`knowledgeMaintenance=QUEUED`;写 outbox 失败时 `NOT_QUEUED`(warning,不回滚 archive,总状态 CONDITIONAL)。后续由 `harness-sync` / `harness_knowledge.py maintain` 异步推进 outbox。**finalize 失败或 validate 报错时不删除原目录**。
|
|
90
88
|
|
|
91
89
|
- **Read `reference.md`** — finalize 输出字段、archive-meta 格式、CONDITIONAL_OK 规则
|
|
92
90
|
- **Read `templates/summary-data-template.json`** — summary-data 数据结构
|
|
@@ -153,9 +151,9 @@ API 测试 `USER_SKIPPED` 或 DB 兼容 `BLOCKED_BY_DBA` 时,最终状态必
|
|
|
153
151
|
|
|
154
152
|
未提交但用于验证的测试文件必须归档到 `backups/uncommitted-tests/` 并在 final-summary 中展示。
|
|
155
153
|
|
|
156
|
-
###
|
|
154
|
+
### 十一、归档事件单一所有权
|
|
157
155
|
|
|
158
|
-
|
|
156
|
+
finalize 内部负责且仅负责一次 `phase.start` / `phase.end`,并在移动后继续向归档目录中的同一事件流追加。调用者不得在 finalize 前后重复追加阶段边界,否则会造成重复阶段或在原 changes 路径生成幽灵目录。归档后 events.ndjson 与自动渲染的 execution-log.md 一起位于 archive。
|
|
159
157
|
|
|
160
158
|
### 十二、Shell 安全 / 敏感信息 / 证据化报告
|
|
161
159
|
|
|
@@ -187,7 +185,7 @@ git 命令通过 `powershell.exe -Command "..."` 执行;archive-meta.md 和 fi
|
|
|
187
185
|
|
|
188
186
|
## 执行日志
|
|
189
187
|
|
|
190
|
-
`events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py`
|
|
188
|
+
`events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
|
|
191
189
|
|
|
192
190
|
```powershell
|
|
193
191
|
python <skills-root>/scripts/harness_events.py append --change-dir ".harness/changes/<change-name>" --phase <phase> --type phase.start --note "<触发指令>"
|
|
@@ -16,12 +16,12 @@ description: harness-archive 的归档前检查项和归档后验证项。仅在
|
|
|
16
16
|
|
|
17
17
|
## 归档前检查(Phase 1)
|
|
18
18
|
|
|
19
|
-
> ⚠️
|
|
19
|
+
> ⚠️ **单一所有权**:finalize 内部负责且仅负责一次 `phase.start` / `phase.end`。归档前检查不得自行追加 archive 阶段边界。
|
|
20
20
|
|
|
21
|
-
- [ ]
|
|
21
|
+
- [ ] 未在调用 finalize 前手工追加 archive 阶段边界
|
|
22
22
|
- [ ] 只有一个未归档变更目录(多个时终止或让用户选择)
|
|
23
23
|
- [ ] 变更目录下有 plans/ 子目录(至少有计划文件)
|
|
24
|
-
- [ ] `
|
|
24
|
+
- [ ] `events.ndjson` 存在;执行日志允许由 finalize 从事件流重新渲染(旧 archive 才兼容根目录 `execution-log.md`)
|
|
25
25
|
- [ ] 准备生成 `archive-manifest-before.json`(path/size/sha256)
|
|
26
26
|
- [ ] 准备生成 `summary-data.json`(业务目标、阶段状态、验证、产物、维护者结论)
|
|
27
27
|
- [ ] git status 无未提交的重要变更(归档应对应已提交的代码)
|
|
@@ -40,7 +40,7 @@ description: harness-archive 的归档前检查项和归档后验证项。仅在
|
|
|
40
40
|
- [ ] `.harness/archive/YYYY-MM-DD-<change-name>/` 目录存在(通过 Glob 实际扫描确认)
|
|
41
41
|
- [ ] 所有子目录(plans/, tests/, reviews/, sqls/)已完整移入(通过 Glob 实际扫描确认,不仅看预期路径)
|
|
42
42
|
- [ ] before/after manifest 校验通过(排除 `logs/execution-log.md`——归档追加结束记录预期 sha256 变化;其他 moved 文件 sha256 必须一致,missing/mismatch=0)
|
|
43
|
-
- [ ] archive-meta.md
|
|
43
|
+
- [ ] 如需 archive-meta.md,已在 finalize 前创建且 frontmatter 字段完整;finalize 后未再改动归档文件
|
|
44
44
|
- [ ] summary-data.json 已生成,且为合法 JSON
|
|
45
45
|
- [ ] final-summary.html 已由 `templates/render-summary.mjs` 渲染生成
|
|
46
46
|
- [ ] **final-summary.html 真实性检查**:
|
|
@@ -10,11 +10,9 @@ description: harness-archive 的归档流程、manifest、summary-data、final-s
|
|
|
10
10
|
- **Phase 1 确认归档对象**:Glob `.harness/changes/*/plans/*-plan.md`(排除 archive),展示概要;多变更让用户选择或终止。
|
|
11
11
|
- **Phase 2 确认归档(强制阻断)**:AskUserQuestion 确认,拒绝即终止。
|
|
12
12
|
- **Phase 3 执行归档**:
|
|
13
|
-
1.
|
|
14
|
-
2.
|
|
15
|
-
3. 运行 `python <skills-root>/scripts/harness_archive.py finalize --change-dir ... --archive-root ".harness/archive" --json`;读 JSON 结果。
|
|
16
|
-
4. 模型补写 `meta/archive-meta.md` 的 `maintenanceNotes` / `knownRisks` / `manualActions`(脚本留空占位)。
|
|
17
|
-
5. append `phase.end` 事件。**finalize 报错或 validate 失败时不删除原 changes 目录**。
|
|
13
|
+
1. 运行 `python <skills-root>/scripts/harness_archive.py status --change-dir ... --json` 做前置检查。
|
|
14
|
+
2. 需要维护者结论时,在移动前补全 `meta/archive-meta.md` 的 `maintenanceNotes` / `knownRisks` / `manualActions`;finalize 后不再修改归档内容。
|
|
15
|
+
3. 运行 `python <skills-root>/scripts/harness_archive.py finalize --change-dir ... --archive-root ".harness/archive" --json`;读 JSON 结果。finalize 内部负责且仅负责一次 `phase.start` / `phase.end`,调用者不得重复追加。**finalize 报错或 validate 失败时不删除原 changes 目录**。
|
|
18
16
|
- **Phase 4 验证与提示**:见 `checklist.md` 归档后验证项。
|
|
19
17
|
|
|
20
18
|
## manifest 生成
|
|
@@ -3,7 +3,7 @@ name: harness-codebase-map
|
|
|
3
3
|
description: 分析现有代码库并生成 .harness/codebase/map/
|
|
4
4
|
下的结构化代码库地图。用于陌生项目理解、重大改造前梳理、harness-sync 提示 map 过期后的人工刷新。
|
|
5
5
|
---
|
|
6
|
-
<!-- generated by harness_deploy.py; core=
|
|
6
|
+
<!-- generated by harness_deploy.py; core=c0ce0eeba998d982; overlay=java; agent=codex; do not edit -->
|
|
7
7
|
# harness-codebase-map — 代码库地图
|
|
8
8
|
|
|
9
9
|
## Purpose
|
|
@@ -85,7 +85,7 @@ description: 分析现有代码库并生成 .harness/codebase/map/
|
|
|
85
85
|
|
|
86
86
|
## 执行日志
|
|
87
87
|
|
|
88
|
-
`events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py`
|
|
88
|
+
`events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
|
|
89
89
|
|
|
90
90
|
```powershell
|
|
91
91
|
python <skills-root>/scripts/harness_events.py append --change-dir ".harness/changes/<change-name>" --phase <phase> --type phase.start --note "<触发指令>"
|
|
@@ -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=
|
|
6
|
+
<!-- generated by harness_deploy.py; core=c0ce0eeba998d982; overlay=java; agent=codex; do not edit -->
|
|
7
7
|
# harness-knowledge-ingest
|
|
8
8
|
|
|
9
9
|
从 `.harness/archive/**/reports/final/summary-data.json` 抽取项目知识,生成并维护本地 `.harness/knowledge/` 索引。
|
|
@@ -232,7 +232,7 @@ powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py' sync
|
|
|
232
232
|
|
|
233
233
|
## 执行日志
|
|
234
234
|
|
|
235
|
-
`events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py`
|
|
235
|
+
`events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
|
|
236
236
|
|
|
237
237
|
```powershell
|
|
238
238
|
python <skills-root>/scripts/harness_events.py append --change-dir ".harness/changes/<change-name>" --phase <phase> --type phase.start --note "<触发指令>"
|
|
@@ -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=
|
|
6
|
+
<!-- generated by harness_deploy.py; core=c0ce0eeba998d982; overlay=java; agent=codex; do not edit -->
|
|
7
7
|
# harness-knowledge-query
|
|
8
8
|
|
|
9
9
|
根据用户的新需求或排查问题,从项目本地 `.harness/knowledge` 中检索历史需求、决策、实现、风险和测试证据,并生成 AI 可读的 context pack。
|
|
@@ -25,13 +25,7 @@ description: 根据新需求、设计任务、代码修改请求或问题排查
|
|
|
25
25
|
|
|
26
26
|
当用户提出新功能、改造、排查、设计方案、继续历史任务,且项目存在 `.harness/archive` 或 `.harness/knowledge` 时,AI 应主动运行本 skill,不需要等用户提醒。
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
```powershell
|
|
31
|
-
powershell.exe -Command "python '<ingest-skill-dir>\scripts\harness_knowledge.py' sync --project '<project-root>' --update"
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
然后再查询。
|
|
28
|
+
不在 query 前单独执行 sync。`query` 命令内部执行一次 ensure-current:建立一次当前快照,索引新鲜时无操作,过期或缺失时只构建一次,然后在同一调用内完成查询。
|
|
35
29
|
|
|
36
30
|
## Commands
|
|
37
31
|
|
|
@@ -59,12 +53,10 @@ powershell.exe -Command "python '<ingest-skill-dir>\scripts\harness_knowledge.py
|
|
|
59
53
|
## Workflow
|
|
60
54
|
|
|
61
55
|
1. 确认项目根目录。
|
|
62
|
-
2.
|
|
63
|
-
3.
|
|
64
|
-
4.
|
|
65
|
-
5.
|
|
66
|
-
6. 读取 JSON 输出中的 `contextPack`。
|
|
67
|
-
7. 在 `harness-plan`、设计、代码探索或实现前,把 context pack 当作必读输入。
|
|
56
|
+
2. 用用户原始需求执行一次 `query`;query 命令内部执行一次 ensure-current。
|
|
57
|
+
3. 如已知道相关文件,在同一次查询中追加 `--file` 过滤。
|
|
58
|
+
4. 读取 JSON 输出中的 `contextPack`。
|
|
59
|
+
5. 在 `harness-plan`、设计、代码探索或实现前,把 context pack 当作必读输入。
|
|
68
60
|
|
|
69
61
|
## Output Contract
|
|
70
62
|
|
|
@@ -96,6 +88,8 @@ powershell.exe -Command "python '<ingest-skill-dir>\scripts\harness_knowledge.py
|
|
|
96
88
|
## Forbidden Actions
|
|
97
89
|
|
|
98
90
|
- rebuild_index_without_need
|
|
91
|
+
- pre_sync_before_query
|
|
92
|
+
- query_then_sync_then_query_again
|
|
99
93
|
- treat_candidate_as_current_fact
|
|
100
94
|
- treat_stale_as_current_fact
|
|
101
95
|
- skip_context_pack_before_planning
|
|
@@ -124,7 +118,7 @@ powershell.exe -Command "python '<ingest-skill-dir>\scripts\harness_knowledge.py
|
|
|
124
118
|
- `matchCount` 与按状态分组的命中数(active/candidate/stale/superseded/conflicted)。
|
|
125
119
|
- `contextPack` 路径与 `latest.json` 指针。
|
|
126
120
|
- 命中 stale/superseded/conflicted 时显式提示风险。
|
|
127
|
-
- 下一步建议(context pack 已就绪 → 进入 `/harness-plan
|
|
121
|
+
- 下一步建议(context pack 已就绪 → 进入 `/harness-plan`;ensure-current 失败 → 报告具体 issue,不重复同步或查询)。
|
|
128
122
|
|
|
129
123
|
## 渐进披露
|
|
130
124
|
|
|
@@ -136,7 +130,7 @@ powershell.exe -Command "python '<ingest-skill-dir>\scripts\harness_knowledge.py
|
|
|
136
130
|
|
|
137
131
|
## 执行日志
|
|
138
132
|
|
|
139
|
-
`events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py`
|
|
133
|
+
`events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
|
|
140
134
|
|
|
141
135
|
```powershell
|
|
142
136
|
python <skills-root>/scripts/harness_events.py append --change-dir ".harness/changes/<change-name>" --phase <phase> --type phase.start --note "<触发指令>"
|
|
@@ -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=
|
|
5
|
+
<!-- generated by harness_deploy.py; core=c0ce0eeba998d982; overlay=java; agent=codex; do not edit -->
|
|
6
6
|
# harness-package — 增量模块打包(Java overlay)
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
@@ -58,7 +58,7 @@ description: 增量模块打包:拉取最新→编译验证→mvn package→
|
|
|
58
58
|
|
|
59
59
|
## 执行日志
|
|
60
60
|
|
|
61
|
-
`events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py`
|
|
61
|
+
`events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
|
|
62
62
|
|
|
63
63
|
```powershell
|
|
64
64
|
python <skills-root>/scripts/harness_events.py append --change-dir ".harness/changes/<change-name>" --phase <phase> --type phase.start --note "<触发指令>"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: harness-plan
|
|
3
3
|
description: 将需求转化为设计文档+实施计划+完整测试场景表,必须在编码前完成。使用场景:需求分析、feature plan、技术方案设计、实现方案规划
|
|
4
4
|
---
|
|
5
|
-
<!-- generated by harness_deploy.py; core=
|
|
5
|
+
<!-- generated by harness_deploy.py; core=c0ce0eeba998d982; overlay=java; agent=codex; do not edit -->
|
|
6
6
|
# harness-plan — 需求规划
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
@@ -48,18 +48,19 @@ description: 将需求转化为设计文档+实施计划+完整测试场景表
|
|
|
48
48
|
|
|
49
49
|
## Subagent 委派
|
|
50
50
|
|
|
51
|
-
- **阶段 3
|
|
52
|
-
- **阶段 7.5**:仅 `--adversarial
|
|
51
|
+
- **阶段 3 探索**:先运行 `python <skills-root>/scripts/harness_preflight.py check-agents --skills-root <skills-root> --agent harness-explorer --json`;可用则委派,否则主会话探索;无效返回不 retry
|
|
52
|
+
- **阶段 7.5**:仅 `--adversarial`;先运行 `python <skills-root>/scripts/harness_preflight.py check-agents --skills-root <skills-root> --agent harness-evaluator --json`;可用才委派到 `reports/plan-review/`
|
|
53
53
|
|
|
54
54
|
## Workflow 概要
|
|
55
55
|
|
|
56
56
|
| 阶段 | 动作 |
|
|
57
57
|
|------|------|
|
|
58
58
|
| 0 | git status;脏工作区 → baseline 隔离 + `decision`,不询问 |
|
|
59
|
-
| 0.5 |
|
|
60
|
-
| 1 |
|
|
61
|
-
| 2
|
|
62
|
-
|
|
|
59
|
+
| 0.5 | 先初始化 change-name + `phase.start`,从第一条知识查询起保留事件证据 |
|
|
60
|
+
| 1 | `harness-knowledge-query` 单次 query(内部 ensure-current;失败记 `issue`) |
|
|
61
|
+
| 2 | 歧义优先检查 + 复杂度分级;先确认会改变实现方向的语义歧义 |
|
|
62
|
+
| 3 | 按复杂度执行有预算的代码探索;简单修复不得扩散到无关模块 |
|
|
63
|
+
| 4 | **设计审批包** AskUserQuestion;确认事件早于 approved 设计文档和 `meta/worktree.json` |
|
|
63
64
|
| 5–6 | plan + implementation-detail + test-scenarios → `plans/` |
|
|
64
65
|
| 7.5 | 仅 `--adversarial` 对抗评审 |
|
|
65
66
|
| 8 | 产物完整性必检 → `checklist.md` |
|
|
@@ -81,6 +82,9 @@ change-name 范围变更 → 提示重命名或记 🟡WARN(→ `reference.md`
|
|
|
81
82
|
| 阶段 8 | spec/plan/detail/scenarios/worktree.json/logs/events 缺一不可 → ❌FAIL |
|
|
82
83
|
| Plan 结束 | **禁止**询问执行模式;只提示 `/harness-run` |
|
|
83
84
|
| 知识查询 | 0.5 失败不得假装已读历史 |
|
|
85
|
+
| 歧义优先检查 | 否定、对比、动作对象或范围存在多种合理解释时,最小取证后先给推荐理解并一次一问;确认前不深挖错误方向 |
|
|
86
|
+
| 简单修复探索预算 | 预计不超过 2 个代码文件、且不涉及认证/安全/迁移/并发/API 契约重设时,最多 1 次合并 CodeGraph 查询 + 1 次定向补查、1 个用户澄清问题;无关发现只记非阻断说明 |
|
|
87
|
+
| 精简产物 | 简单修复只保留实现所需的设计、任务、边界和测试;禁止在 spec/plan/detail/scenarios 中重复同一背景和结论 |
|
|
84
88
|
| state snapshot | 读取 `state-snapshot.json`(`harness_state.py` / state-layout-protocol §state-snapshot.json)了解 project/worktree root、HEAD/base、profile/rules/map/knowledge 指纹;失效由脚本刷新,**不得仅凭缓存跳过代码探索或验证门禁**(design §3.6) |
|
|
85
89
|
| 协议 | sensitive-info / evidence-based-reporting / state-layout |
|
|
86
90
|
|
|
@@ -95,11 +99,11 @@ change-name 范围变更 → 提示重命名或记 🟡WARN(→ `reference.md`
|
|
|
95
99
|
## 交互白名单
|
|
96
100
|
|
|
97
101
|
1. **设计审批包**(阶段 4):设计 + 场景表 + worktree + change-name
|
|
98
|
-
2. **decision-grilling**(阶段 3
|
|
102
|
+
2. **decision-grilling**(阶段 2/3 澄清):语义歧义或高风险业务裁决(一次一问)
|
|
99
103
|
|
|
100
104
|
## 执行日志
|
|
101
105
|
|
|
102
|
-
`events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py`
|
|
106
|
+
`events.ndjson` 为唯一事实源(schema_version 2,`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
|
|
103
107
|
|
|
104
108
|
```powershell
|
|
105
109
|
python <skills-root>/scripts/harness_events.py append --change-dir ".harness/changes/<change-name>" --phase <phase> --type phase.start --note "<触发指令>"
|