@hunter-harness/workflow-harness 0.2.16 → 0.2.17
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/CONTEXT.md +14 -1
- package/harness/bundles/general/claude-code/README.md +1 -1
- package/harness/bundles/general/claude-code/harness-archive/SKILL.md +7 -4
- package/harness/bundles/general/claude-code/harness-archive/reference.md +1 -1
- package/harness/bundles/general/claude-code/harness-codebase-map/SKILL.md +4 -2
- package/harness/bundles/general/claude-code/harness-knowledge-ingest/SKILL.md +4 -2
- package/harness/bundles/general/claude-code/harness-knowledge-query/SKILL.md +4 -2
- package/harness/bundles/general/claude-code/harness-plan/SKILL.md +8 -4
- package/harness/bundles/general/claude-code/harness-plan/checklist.md +5 -5
- package/harness/bundles/general/claude-code/harness-review/SKILL.md +5 -2
- package/harness/bundles/general/claude-code/harness-run/SKILL.md +7 -3
- package/harness/bundles/general/claude-code/harness-run/checklist.md +4 -4
- package/harness/bundles/general/claude-code/harness-submit/SKILL.md +6 -3
- package/harness/bundles/general/claude-code/harness-submit/checklist.md +5 -5
- package/harness/bundles/general/claude-code/harness-submit/reference.md +3 -3
- package/harness/bundles/general/claude-code/harness-sync/SKILL.md +4 -2
- package/harness/bundles/general/claude-code/harness-sync/reference.md +1 -1
- package/harness/bundles/general/claude-code/harness-test/SKILL.md +7 -4
- package/harness/bundles/general/claude-code/harness-test/checklist.md +8 -5
- package/harness/bundles/general/claude-code/harness-test/pitfalls.md +1 -1
- package/harness/bundles/general/claude-code/harness-test/reference.md +28 -13
- package/harness/bundles/general/claude-code/protocols/submit-protocol.md +1 -1
- package/harness/bundles/general/claude-code/scripts/harness_deploy.py +7 -0
- package/harness/bundles/general/claude-code/scripts/harness_integration.py +26 -2
- package/harness/bundles/general/claude-code/scripts/harness_plan_finalize.py +159 -7
- package/harness/bundles/general/claude-code/scripts/harness_test_cleanup.py +175 -0
- package/harness/bundles/general/codebuddy/.harness-build.json +1 -1
- package/harness/bundles/general/codebuddy/CONTEXT.md +14 -1
- package/harness/bundles/general/codebuddy/README.md +1 -1
- package/harness/bundles/general/codebuddy/harness-archive/SKILL.md +7 -4
- package/harness/bundles/general/codebuddy/harness-archive/reference.md +1 -1
- package/harness/bundles/general/codebuddy/harness-codebase-map/SKILL.md +4 -2
- package/harness/bundles/general/codebuddy/harness-knowledge-ingest/SKILL.md +4 -2
- package/harness/bundles/general/codebuddy/harness-knowledge-query/SKILL.md +4 -2
- package/harness/bundles/general/codebuddy/harness-plan/SKILL.md +8 -4
- package/harness/bundles/general/codebuddy/harness-plan/checklist.md +5 -5
- package/harness/bundles/general/codebuddy/harness-review/SKILL.md +5 -2
- package/harness/bundles/general/codebuddy/harness-run/SKILL.md +7 -3
- package/harness/bundles/general/codebuddy/harness-run/checklist.md +4 -4
- package/harness/bundles/general/codebuddy/harness-submit/SKILL.md +6 -3
- package/harness/bundles/general/codebuddy/harness-submit/checklist.md +5 -5
- package/harness/bundles/general/codebuddy/harness-submit/reference.md +3 -3
- package/harness/bundles/general/codebuddy/harness-sync/SKILL.md +4 -2
- package/harness/bundles/general/codebuddy/harness-sync/reference.md +1 -1
- package/harness/bundles/general/codebuddy/harness-test/SKILL.md +7 -4
- package/harness/bundles/general/codebuddy/harness-test/checklist.md +8 -5
- package/harness/bundles/general/codebuddy/harness-test/pitfalls.md +1 -1
- package/harness/bundles/general/codebuddy/harness-test/reference.md +28 -13
- package/harness/bundles/general/codebuddy/protocols/submit-protocol.md +1 -1
- package/harness/bundles/general/codebuddy/scripts/harness_deploy.py +7 -0
- package/harness/bundles/general/codebuddy/scripts/harness_integration.py +26 -2
- package/harness/bundles/general/codebuddy/scripts/harness_plan_finalize.py +159 -7
- package/harness/bundles/general/codebuddy/scripts/harness_test_cleanup.py +175 -0
- package/harness/bundles/general/codex/.harness-build.json +1 -1
- package/harness/bundles/general/codex/CONTEXT.md +14 -1
- package/harness/bundles/general/codex/README.md +1 -1
- package/harness/bundles/general/codex/harness-archive/SKILL.md +7 -4
- package/harness/bundles/general/codex/harness-archive/reference.md +1 -1
- package/harness/bundles/general/codex/harness-codebase-map/SKILL.md +4 -2
- package/harness/bundles/general/codex/harness-knowledge-ingest/SKILL.md +4 -2
- package/harness/bundles/general/codex/harness-knowledge-query/SKILL.md +4 -2
- package/harness/bundles/general/codex/harness-plan/SKILL.md +8 -4
- package/harness/bundles/general/codex/harness-plan/checklist.md +5 -5
- package/harness/bundles/general/codex/harness-review/SKILL.md +5 -2
- package/harness/bundles/general/codex/harness-run/SKILL.md +7 -3
- package/harness/bundles/general/codex/harness-run/checklist.md +4 -4
- package/harness/bundles/general/codex/harness-submit/SKILL.md +6 -3
- package/harness/bundles/general/codex/harness-submit/checklist.md +5 -5
- package/harness/bundles/general/codex/harness-submit/reference.md +3 -3
- package/harness/bundles/general/codex/harness-sync/SKILL.md +4 -2
- package/harness/bundles/general/codex/harness-sync/reference.md +1 -1
- package/harness/bundles/general/codex/harness-test/SKILL.md +7 -4
- package/harness/bundles/general/codex/harness-test/checklist.md +8 -5
- package/harness/bundles/general/codex/harness-test/pitfalls.md +1 -1
- package/harness/bundles/general/codex/harness-test/reference.md +28 -13
- package/harness/bundles/general/codex/protocols/submit-protocol.md +1 -1
- package/harness/bundles/general/codex/scripts/harness_deploy.py +7 -0
- package/harness/bundles/general/codex/scripts/harness_integration.py +26 -2
- package/harness/bundles/general/codex/scripts/harness_plan_finalize.py +159 -7
- package/harness/bundles/general/codex/scripts/harness_test_cleanup.py +175 -0
- package/harness/bundles/general/cursor/.harness-build.json +1 -1
- package/harness/bundles/general/cursor/CONTEXT.md +14 -1
- package/harness/bundles/general/cursor/README.md +1 -1
- package/harness/bundles/general/cursor/harness-archive/SKILL.md +7 -4
- package/harness/bundles/general/cursor/harness-archive/reference.md +1 -1
- package/harness/bundles/general/cursor/harness-codebase-map/SKILL.md +4 -2
- package/harness/bundles/general/cursor/harness-knowledge-ingest/SKILL.md +4 -2
- package/harness/bundles/general/cursor/harness-knowledge-query/SKILL.md +4 -2
- package/harness/bundles/general/cursor/harness-plan/SKILL.md +8 -4
- package/harness/bundles/general/cursor/harness-plan/checklist.md +5 -5
- package/harness/bundles/general/cursor/harness-review/SKILL.md +5 -2
- package/harness/bundles/general/cursor/harness-run/SKILL.md +7 -3
- package/harness/bundles/general/cursor/harness-run/checklist.md +4 -4
- package/harness/bundles/general/cursor/harness-submit/SKILL.md +6 -3
- package/harness/bundles/general/cursor/harness-submit/checklist.md +5 -5
- package/harness/bundles/general/cursor/harness-submit/reference.md +3 -3
- package/harness/bundles/general/cursor/harness-sync/SKILL.md +4 -2
- package/harness/bundles/general/cursor/harness-sync/reference.md +1 -1
- package/harness/bundles/general/cursor/harness-test/SKILL.md +7 -4
- package/harness/bundles/general/cursor/harness-test/checklist.md +8 -5
- package/harness/bundles/general/cursor/harness-test/pitfalls.md +1 -1
- package/harness/bundles/general/cursor/harness-test/reference.md +28 -13
- package/harness/bundles/general/cursor/protocols/submit-protocol.md +1 -1
- package/harness/bundles/general/cursor/scripts/harness_deploy.py +7 -0
- package/harness/bundles/general/cursor/scripts/harness_integration.py +26 -2
- package/harness/bundles/general/cursor/scripts/harness_plan_finalize.py +159 -7
- package/harness/bundles/general/cursor/scripts/harness_test_cleanup.py +175 -0
- package/harness/bundles/java/claude-code/.harness-build.json +1 -1
- package/harness/bundles/java/claude-code/CONTEXT.md +14 -1
- package/harness/bundles/java/claude-code/README.md +1 -1
- package/harness/bundles/java/claude-code/harness-apidoc/SKILL.md +5 -2
- package/harness/bundles/java/claude-code/harness-archive/SKILL.md +7 -4
- package/harness/bundles/java/claude-code/harness-archive/reference.md +1 -1
- package/harness/bundles/java/claude-code/harness-codebase-map/SKILL.md +4 -2
- package/harness/bundles/java/claude-code/harness-knowledge-ingest/SKILL.md +4 -2
- package/harness/bundles/java/claude-code/harness-knowledge-query/SKILL.md +4 -2
- package/harness/bundles/java/claude-code/harness-package/SKILL.md +5 -2
- package/harness/bundles/java/claude-code/harness-package/checklist.md +4 -4
- package/harness/bundles/java/claude-code/harness-plan/SKILL.md +8 -4
- package/harness/bundles/java/claude-code/harness-plan/checklist.md +5 -5
- package/harness/bundles/java/claude-code/harness-review/SKILL.md +5 -2
- package/harness/bundles/java/claude-code/harness-run/SKILL.md +7 -3
- package/harness/bundles/java/claude-code/harness-run/checklist.md +4 -4
- package/harness/bundles/java/claude-code/harness-submit/SKILL.md +6 -3
- package/harness/bundles/java/claude-code/harness-submit/checklist.md +5 -5
- package/harness/bundles/java/claude-code/harness-submit/reference.md +3 -3
- package/harness/bundles/java/claude-code/harness-sync/SKILL.md +4 -2
- package/harness/bundles/java/claude-code/harness-sync/reference.md +1 -1
- package/harness/bundles/java/claude-code/harness-test/SKILL.md +8 -5
- package/harness/bundles/java/claude-code/harness-test/pitfalls.md +1 -1
- package/harness/bundles/java/claude-code/harness-test/reference.md +1 -1
- package/harness/bundles/java/claude-code/protocols/submit-protocol.md +1 -1
- package/harness/bundles/java/claude-code/scripts/harness_deploy.py +7 -0
- package/harness/bundles/java/claude-code/scripts/harness_integration.py +26 -2
- package/harness/bundles/java/claude-code/scripts/harness_plan_finalize.py +159 -7
- package/harness/bundles/java/claude-code/scripts/harness_test_cleanup.py +175 -0
- package/harness/bundles/java/codebuddy/.harness-build.json +1 -1
- package/harness/bundles/java/codebuddy/CONTEXT.md +14 -1
- package/harness/bundles/java/codebuddy/README.md +1 -1
- package/harness/bundles/java/codebuddy/harness-apidoc/SKILL.md +5 -2
- package/harness/bundles/java/codebuddy/harness-archive/SKILL.md +7 -4
- package/harness/bundles/java/codebuddy/harness-archive/reference.md +1 -1
- package/harness/bundles/java/codebuddy/harness-codebase-map/SKILL.md +4 -2
- package/harness/bundles/java/codebuddy/harness-knowledge-ingest/SKILL.md +4 -2
- package/harness/bundles/java/codebuddy/harness-knowledge-query/SKILL.md +4 -2
- package/harness/bundles/java/codebuddy/harness-package/SKILL.md +5 -2
- package/harness/bundles/java/codebuddy/harness-package/checklist.md +4 -4
- package/harness/bundles/java/codebuddy/harness-plan/SKILL.md +8 -4
- package/harness/bundles/java/codebuddy/harness-plan/checklist.md +5 -5
- package/harness/bundles/java/codebuddy/harness-review/SKILL.md +5 -2
- package/harness/bundles/java/codebuddy/harness-run/SKILL.md +7 -3
- package/harness/bundles/java/codebuddy/harness-run/checklist.md +4 -4
- package/harness/bundles/java/codebuddy/harness-submit/SKILL.md +6 -3
- package/harness/bundles/java/codebuddy/harness-submit/checklist.md +5 -5
- package/harness/bundles/java/codebuddy/harness-submit/reference.md +3 -3
- package/harness/bundles/java/codebuddy/harness-sync/SKILL.md +4 -2
- package/harness/bundles/java/codebuddy/harness-sync/reference.md +1 -1
- package/harness/bundles/java/codebuddy/harness-test/SKILL.md +8 -5
- package/harness/bundles/java/codebuddy/harness-test/pitfalls.md +1 -1
- package/harness/bundles/java/codebuddy/harness-test/reference.md +1 -1
- package/harness/bundles/java/codebuddy/protocols/submit-protocol.md +1 -1
- package/harness/bundles/java/codebuddy/scripts/harness_deploy.py +7 -0
- package/harness/bundles/java/codebuddy/scripts/harness_integration.py +26 -2
- package/harness/bundles/java/codebuddy/scripts/harness_plan_finalize.py +159 -7
- package/harness/bundles/java/codebuddy/scripts/harness_test_cleanup.py +175 -0
- package/harness/bundles/java/codex/.harness-build.json +1 -1
- package/harness/bundles/java/codex/CONTEXT.md +14 -1
- package/harness/bundles/java/codex/README.md +1 -1
- package/harness/bundles/java/codex/harness-apidoc/SKILL.md +5 -2
- package/harness/bundles/java/codex/harness-archive/SKILL.md +7 -4
- package/harness/bundles/java/codex/harness-archive/reference.md +1 -1
- package/harness/bundles/java/codex/harness-codebase-map/SKILL.md +4 -2
- package/harness/bundles/java/codex/harness-knowledge-ingest/SKILL.md +4 -2
- package/harness/bundles/java/codex/harness-knowledge-query/SKILL.md +4 -2
- package/harness/bundles/java/codex/harness-package/SKILL.md +5 -2
- package/harness/bundles/java/codex/harness-package/checklist.md +4 -4
- package/harness/bundles/java/codex/harness-plan/SKILL.md +8 -4
- package/harness/bundles/java/codex/harness-plan/checklist.md +5 -5
- package/harness/bundles/java/codex/harness-review/SKILL.md +5 -2
- package/harness/bundles/java/codex/harness-run/SKILL.md +7 -3
- package/harness/bundles/java/codex/harness-run/checklist.md +4 -4
- package/harness/bundles/java/codex/harness-submit/SKILL.md +6 -3
- package/harness/bundles/java/codex/harness-submit/checklist.md +5 -5
- package/harness/bundles/java/codex/harness-submit/reference.md +3 -3
- package/harness/bundles/java/codex/harness-sync/SKILL.md +4 -2
- package/harness/bundles/java/codex/harness-sync/reference.md +1 -1
- package/harness/bundles/java/codex/harness-test/SKILL.md +8 -5
- package/harness/bundles/java/codex/harness-test/pitfalls.md +1 -1
- package/harness/bundles/java/codex/harness-test/reference.md +1 -1
- package/harness/bundles/java/codex/protocols/submit-protocol.md +1 -1
- package/harness/bundles/java/codex/scripts/harness_deploy.py +7 -0
- package/harness/bundles/java/codex/scripts/harness_integration.py +26 -2
- package/harness/bundles/java/codex/scripts/harness_plan_finalize.py +159 -7
- package/harness/bundles/java/codex/scripts/harness_test_cleanup.py +175 -0
- package/harness/bundles/java/cursor/.harness-build.json +1 -1
- package/harness/bundles/java/cursor/CONTEXT.md +14 -1
- package/harness/bundles/java/cursor/README.md +1 -1
- package/harness/bundles/java/cursor/harness-apidoc/SKILL.md +5 -2
- package/harness/bundles/java/cursor/harness-archive/SKILL.md +7 -4
- package/harness/bundles/java/cursor/harness-archive/reference.md +1 -1
- package/harness/bundles/java/cursor/harness-codebase-map/SKILL.md +4 -2
- package/harness/bundles/java/cursor/harness-knowledge-ingest/SKILL.md +4 -2
- package/harness/bundles/java/cursor/harness-knowledge-query/SKILL.md +4 -2
- package/harness/bundles/java/cursor/harness-package/SKILL.md +5 -2
- package/harness/bundles/java/cursor/harness-package/checklist.md +4 -4
- package/harness/bundles/java/cursor/harness-plan/SKILL.md +8 -4
- package/harness/bundles/java/cursor/harness-plan/checklist.md +5 -5
- package/harness/bundles/java/cursor/harness-review/SKILL.md +5 -2
- package/harness/bundles/java/cursor/harness-run/SKILL.md +7 -3
- package/harness/bundles/java/cursor/harness-run/checklist.md +4 -4
- package/harness/bundles/java/cursor/harness-submit/SKILL.md +6 -3
- package/harness/bundles/java/cursor/harness-submit/checklist.md +5 -5
- package/harness/bundles/java/cursor/harness-submit/reference.md +3 -3
- package/harness/bundles/java/cursor/harness-sync/SKILL.md +4 -2
- package/harness/bundles/java/cursor/harness-sync/reference.md +1 -1
- package/harness/bundles/java/cursor/harness-test/SKILL.md +8 -5
- package/harness/bundles/java/cursor/harness-test/pitfalls.md +1 -1
- package/harness/bundles/java/cursor/harness-test/reference.md +1 -1
- package/harness/bundles/java/cursor/protocols/submit-protocol.md +1 -1
- package/harness/bundles/java/cursor/scripts/harness_deploy.py +7 -0
- package/harness/bundles/java/cursor/scripts/harness_integration.py +26 -2
- package/harness/bundles/java/cursor/scripts/harness_plan_finalize.py +159 -7
- package/harness/bundles/java/cursor/scripts/harness_test_cleanup.py +175 -0
- package/harness/manifests/general/claude-code.json +31 -27
- package/harness/manifests/general/codebuddy.json +31 -27
- package/harness/manifests/general/codex.json +31 -27
- package/harness/manifests/general/cursor.json +31 -27
- package/harness/manifests/java/claude-code.json +33 -29
- package/harness/manifests/java/codebuddy.json +33 -29
- package/harness/manifests/java/codex.json +33 -29
- package/harness/manifests/java/cursor.json +33 -29
- package/hunter-workflow-family.json +2 -2
- package/package.json +1 -1
|
@@ -53,9 +53,22 @@ _Avoid_: 仅凭 diffHash 复用, 无证据跳过
|
|
|
53
53
|
_Avoid_: 每轮测试后必杀服务
|
|
54
54
|
|
|
55
55
|
**交互白名单**:
|
|
56
|
-
每个 skill 显式声明的允许
|
|
56
|
+
每个 skill 显式声明的允许 `blocking user confirmation` 场景清单。白名单外一律取默认值并记 decision 事件。
|
|
57
57
|
_Avoid_: 逐决策点询问
|
|
58
58
|
|
|
59
|
+
**阻断式用户确认(blocking user confirmation)**:
|
|
60
|
+
宿主无关的审批原语。canonical skill 使用此术语表达"展示完整审批包并等待明确答复"的语义,不绑定具体宿主工具。adapter 按下表映射到宿主具体工具:
|
|
61
|
+
|
|
62
|
+
| Adapter | 工具 |
|
|
63
|
+
|---------|------|
|
|
64
|
+
| claude-code | AskUserQuestion |
|
|
65
|
+
| codebuddy | AskUserQuestion |
|
|
66
|
+
| codex | request_user_input 或普通对话 |
|
|
67
|
+
| cursor | 普通对话 |
|
|
68
|
+
|
|
69
|
+
finalizer 只校验 approval receipt/decision 的顺序和内容,不校验交互工具品牌。
|
|
70
|
+
_Avoid_: 硬编码宿主工具名, 跨宿主不可移植
|
|
71
|
+
|
|
59
72
|
**部署合成**:
|
|
60
73
|
`harness_deploy.py build` 把通用核心 + shared 片段 + overlay 合成为自包含 SKILL.md 后部署。Vault 源头 DRY,运行时单文件。
|
|
61
74
|
_Avoid_: 运行时跨文件拼规则, fork 维护
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
| harness-knowledge-query | `[Bash(powershell.exe:*), Read, Write, Edit, Glob, Grep]` | 同上 |
|
|
60
60
|
| harness-knowledge-ingest | `[Bash(powershell.exe:*), Read, Write, Edit, Glob, Grep]` | 同上 |
|
|
61
61
|
|
|
62
|
-
> **
|
|
62
|
+
> **blocking user confirmation 不预批准**:各 skill 需要向用户确认时通过普通权限提示调用 `blocking user confirmation`(adapter 映射到 `AskUserQuestion`/`request_user_input`/普通对话),不在 `allowed-tools` 中预批准(遵循 skill-optimizer 规则)。`harness-codebase-map` 额外预批准 `Agent` 用于派发并行 mapper。
|
|
63
63
|
|
|
64
64
|
> **codegraph 命令**:原 `Bash(codegraph *)` 改为 MCP 工具调用(`mcp__codegraph__codegraph_explore` 等),不再通过 Bash。
|
|
65
65
|
>
|
|
@@ -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=d5b51ad56d4d4535; overlay=none; agent=codebuddy; do not edit -->
|
|
7
7
|
# harness-archive — 变更归档
|
|
8
8
|
|
|
9
9
|
## Purpose
|
|
@@ -52,6 +52,7 @@ description: 归档所有变更产出(计划/测试报告/审查/SQL/API文档
|
|
|
52
52
|
9. **每个 skill 边界只刷新一次状态快照** — 先运行 `python <skills-root>/scripts/harness_state.py capture --project . --change-dir ".harness/changes/<change-name>" --base <baseCommit> --json`;`changedSegments=[]` 时复用已有 profile/rules/map/knowledge/change/code 指纹,不再重复跑全量 `harness-sync`、知识重建或代码库扫描。只有对应 segment 变化或缺失时才定向刷新;快照不能替代源码读取和验证门禁。
|
|
53
53
|
|
|
54
54
|
状态目录分层:新路径优先,旧路径兼容 → [[../protocols/state-layout-protocol.md|state-layout-protocol]]
|
|
55
|
+
> 片段:read-protocol
|
|
55
56
|
|
|
56
57
|
## Workflow
|
|
57
58
|
|
|
@@ -79,7 +80,7 @@ description: 归档所有变更产出(计划/测试报告/审查/SQL/API文档
|
|
|
79
80
|
|
|
80
81
|
### Phase 2:确认归档 ⚠️ 强制阻断
|
|
81
82
|
|
|
82
|
-
|
|
83
|
+
blocking user confirmation 让用户确认归档操作。**用户拒绝 → 终止流程,不执行任何操作。**
|
|
83
84
|
|
|
84
85
|
- **Read `reference.md`** — 确认对话框的内容格式
|
|
85
86
|
|
|
@@ -104,6 +105,7 @@ AskUserQuestion 让用户确认归档操作。**用户拒绝 → 终止流程,
|
|
|
104
105
|
- 命令结果不得靠猜测;普通 Bash 被拒 → 立即改用等价 PowerShell 重试一次
|
|
105
106
|
- 仅 PowerShell 成功且有明确证据(构建/git/测试输出、文件存在、exit 0)时可标 ✅OK;否则 ❌FAIL 或 🟡WARN
|
|
106
107
|
- 禁止把 hook 拒绝、静态验证、无输出、用户跳过说成成功 → 详见 [[../protocols/powershell-protocol.md|powershell-protocol]]、[[../protocols/evidence-based-reporting-protocol.md|evidence-based-reporting-protocol]]
|
|
108
|
+
> 片段:p0-trust
|
|
107
109
|
|
|
108
110
|
## 关键规则(硬门禁速查)
|
|
109
111
|
|
|
@@ -115,7 +117,7 @@ AskUserQuestion 让用户确认归档操作。**用户拒绝 → 终止流程,
|
|
|
115
117
|
|
|
116
118
|
### 二、归档前确认是强制阻断检查点
|
|
117
119
|
|
|
118
|
-
|
|
120
|
+
blocking user confirmation 确认;用户拒绝 → 终止,不执行任何操作。
|
|
119
121
|
|
|
120
122
|
### 三、文件移动只用内置工具或 PowerShell
|
|
121
123
|
|
|
@@ -184,7 +186,7 @@ git 命令通过 `powershell.exe -Command "..."` 执行;archive-meta.md 和 fi
|
|
|
184
186
|
|
|
185
187
|
## 交互白名单
|
|
186
188
|
|
|
187
|
-
**仅允许**归档确认(Phase 2
|
|
189
|
+
**仅允许**归档确认(Phase 2 blocking user confirmation);拒绝 → 终止,不执行任何移动。
|
|
188
190
|
|
|
189
191
|
## 执行日志
|
|
190
192
|
|
|
@@ -199,3 +201,4 @@ python <skills-root>/scripts/harness_events.py append --change-dir ".harness/cha
|
|
|
199
201
|
> **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 边界保持最新。
|
|
200
202
|
|
|
201
203
|
每次阶段结束必须写 `--status OK|WARN|FAIL|BLOCKED`;重试同一阶段时增加 `--attempt <n>`,不得覆盖或伪装成一次执行。跨工具继续执行时写 `--executor-tool <codex|claude-code|codebuddy|cursor>`,并在接棒事件写 `--handoff-from-tool` / `--handoff-reason`;也可由 `HUNTER_HARNESS_TOOL/AGENT/MODEL/RUN_ID` 环境变量统一注入。
|
|
204
|
+
> 片段:logging · phase=`archive`
|
|
@@ -8,7 +8,7 @@ description: harness-archive 的归档流程、manifest、summary-data、final-s
|
|
|
8
8
|
|
|
9
9
|
- **Phase 0 读取上下文**:读 SKILL.md / 本文件 / 共用协议(`../protocols/archive-report-protocol.md`、`../protocols/report-pipeline-protocol.md`、`../protocols/state-layout-protocol.md`、`../protocols/powershell-protocol.md`、`../protocols/sensitive-info-protocol.md`、`../protocols/evidence-based-reporting-protocol.md`)/ 解析 `$ARGUMENTS`。
|
|
10
10
|
- **Phase 1 确认归档对象**:Glob `.harness/changes/*/plans/*-plan.md`(排除 archive),展示概要;多变更让用户选择或终止。
|
|
11
|
-
- **Phase 2 确认归档(强制阻断)**:
|
|
11
|
+
- **Phase 2 确认归档(强制阻断)**:blocking user confirmation 确认,拒绝即终止。
|
|
12
12
|
- **Phase 3 执行归档**:
|
|
13
13
|
1. 运行 `python <skills-root>/scripts/harness_archive.py status --change-dir ... --json` 做前置检查。
|
|
14
14
|
2. `meta/archive-meta.md` 由 finalize 生成(与 summary `finalStatus` 同源);禁止手写。维护者结论写入 events 即可。finalize 在 before-manifest 前执行 cleanup(删除 lock/pid/launcher/credential,截断超大日志)。
|
|
@@ -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=d5b51ad56d4d4535; overlay=none; agent=codebuddy; do not edit -->
|
|
7
7
|
# harness-codebase-map — 代码库地图
|
|
8
8
|
|
|
9
9
|
## Purpose
|
|
@@ -56,6 +56,7 @@ description: 分析现有代码库并生成 .harness/codebase/map/
|
|
|
56
56
|
- 命令结果不得靠猜测;普通 Bash 被拒 → 立即改用等价 PowerShell 重试一次
|
|
57
57
|
- 仅 PowerShell 成功且有明确证据(构建/git/测试输出、文件存在、exit 0)时可标 ✅OK;否则 ❌FAIL 或 🟡WARN
|
|
58
58
|
- 禁止把 hook 拒绝、静态验证、无输出、用户跳过说成成功 → 详见 [[../protocols/powershell-protocol.md|powershell-protocol]]、[[../protocols/evidence-based-reporting-protocol.md|evidence-based-reporting-protocol]]
|
|
59
|
+
> 片段:p0-trust · map 额外:文件存在/行数/hash 为证据
|
|
59
60
|
|
|
60
61
|
## 关键规则
|
|
61
62
|
|
|
@@ -81,7 +82,7 @@ description: 分析现有代码库并生成 .harness/codebase/map/
|
|
|
81
82
|
|
|
82
83
|
## 交互白名单
|
|
83
84
|
|
|
84
|
-
**无**
|
|
85
|
+
**无** blocking user confirmation;参数/默认值 + `decision` 事件
|
|
85
86
|
|
|
86
87
|
## 执行日志
|
|
87
88
|
|
|
@@ -96,3 +97,4 @@ python <skills-root>/scripts/harness_events.py append --change-dir ".harness/cha
|
|
|
96
97
|
> **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 边界保持最新。
|
|
97
98
|
|
|
98
99
|
每次阶段结束必须写 `--status OK|WARN|FAIL|BLOCKED`;重试同一阶段时增加 `--attempt <n>`,不得覆盖或伪装成一次执行。跨工具继续执行时写 `--executor-tool <codex|claude-code|codebuddy|cursor>`,并在接棒事件写 `--handoff-from-tool` / `--handoff-reason`;也可由 `HUNTER_HARNESS_TOOL/AGENT/MODEL/RUN_ID` 环境变量统一注入。
|
|
100
|
+
> 片段:logging · phase=`codebase-map`;默认写 reports,有未归档变更时另写 change events
|
|
@@ -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=d5b51ad56d4d4535; overlay=none; agent=codebuddy; do not edit -->
|
|
7
7
|
# harness-knowledge-ingest
|
|
8
8
|
|
|
9
9
|
从 `.harness/archive/**/reports/final/summary-data.json` 抽取项目知识,生成并维护本地 `.harness/knowledge/` 索引。
|
|
@@ -211,6 +211,7 @@ powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py' sync
|
|
|
211
211
|
- 命令结果不得靠猜测;普通 Bash 被拒 → 立即改用等价 PowerShell 重试一次
|
|
212
212
|
- 仅 PowerShell 成功且有明确证据(构建/git/测试输出、文件存在、exit 0)时可标 ✅OK;否则 ❌FAIL 或 🟡WARN
|
|
213
213
|
- 禁止把 hook 拒绝、静态验证、无输出、用户跳过说成成功 → 详见 [[../protocols/powershell-protocol.md|powershell-protocol]]、[[../protocols/evidence-based-reporting-protocol.md|evidence-based-reporting-protocol]]
|
|
214
|
+
> 片段:p0-trust · ingest/sync 须绑定 `upToDate`/产物路径证据
|
|
214
215
|
|
|
215
216
|
## Output Format
|
|
216
217
|
|
|
@@ -230,7 +231,7 @@ powershell.exe -Command "python '<skill-dir>\scripts\harness_knowledge.py' sync
|
|
|
230
231
|
|
|
231
232
|
## 交互白名单
|
|
232
233
|
|
|
233
|
-
**仅当** `.harness/config/harness.json` 中 `knowledge.manualReview=true` 时,promote/demote 高价值条目需
|
|
234
|
+
**仅当** `.harness/config/harness.json` 中 `knowledge.manualReview=true` 时,promote/demote 高价值条目需 blocking user confirmation;否则按 skill 默认策略 + `decision` 事件。
|
|
234
235
|
|
|
235
236
|
## 执行日志
|
|
236
237
|
|
|
@@ -245,3 +246,4 @@ python <skills-root>/scripts/harness_events.py append --change-dir ".harness/cha
|
|
|
245
246
|
> **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 边界保持最新。
|
|
246
247
|
|
|
247
248
|
每次阶段结束必须写 `--status OK|WARN|FAIL|BLOCKED`;重试同一阶段时增加 `--attempt <n>`,不得覆盖或伪装成一次执行。跨工具继续执行时写 `--executor-tool <codex|claude-code|codebuddy|cursor>`,并在接棒事件写 `--handoff-from-tool` / `--handoff-reason`;也可由 `HUNTER_HARNESS_TOOL/AGENT/MODEL/RUN_ID` 环境变量统一注入。
|
|
249
|
+
> 片段:logging · phase=`knowledge-ingest` · 默认控制台报告;变更上下文写 phase/decision/issue/artifact
|
|
@@ -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=d5b51ad56d4d4535; overlay=none; agent=codebuddy; do not edit -->
|
|
7
7
|
# harness-knowledge-query
|
|
8
8
|
|
|
9
9
|
并行 change 中查询必须传 `--change <change-id>`;成功后以该 change 的 `meta/knowledge-context.json` 为稳定指针。全局 `context-packs/latest.json` 仅向后兼容,不得用于判断多个 active change 的上下文归属。
|
|
@@ -111,6 +111,7 @@ powershell.exe -Command "python '<ingest-skill-dir>\scripts\harness_knowledge.py
|
|
|
111
111
|
- 命令结果不得靠猜测;普通 Bash 被拒 → 立即改用等价 PowerShell 重试一次
|
|
112
112
|
- 仅 PowerShell 成功且有明确证据(构建/git/测试输出、文件存在、exit 0)时可标 ✅OK;否则 ❌FAIL 或 🟡WARN
|
|
113
113
|
- 禁止把 hook 拒绝、静态验证、无输出、用户跳过说成成功 → 详见 [[../protocols/powershell-protocol.md|powershell-protocol]]、[[../protocols/evidence-based-reporting-protocol.md|evidence-based-reporting-protocol]]
|
|
114
|
+
> 片段:p0-trust · query 成功须含 `contextPack`/`planInput.kind` 与 `latest.json` 写入
|
|
114
115
|
|
|
115
116
|
## Output Format
|
|
116
117
|
|
|
@@ -128,7 +129,7 @@ powershell.exe -Command "python '<ingest-skill-dir>\scripts\harness_knowledge.py
|
|
|
128
129
|
|
|
129
130
|
## 交互白名单
|
|
130
131
|
|
|
131
|
-
**无**
|
|
132
|
+
**无** blocking user confirmation;`stale`/`conflicted` 命中记 `issue`,不阻断 query。
|
|
132
133
|
|
|
133
134
|
## 执行日志
|
|
134
135
|
|
|
@@ -143,3 +144,4 @@ python <skills-root>/scripts/harness_events.py append --change-dir ".harness/cha
|
|
|
143
144
|
> **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 边界保持最新。
|
|
144
145
|
|
|
145
146
|
每次阶段结束必须写 `--status OK|WARN|FAIL|BLOCKED`;重试同一阶段时增加 `--attempt <n>`,不得覆盖或伪装成一次执行。跨工具继续执行时写 `--executor-tool <codex|claude-code|codebuddy|cursor>`,并在接棒事件写 `--handoff-from-tool` / `--handoff-reason`;也可由 `HUNTER_HARNESS_TOOL/AGENT/MODEL/RUN_ID` 环境变量统一注入。
|
|
147
|
+
> 片段:logging · phase=`knowledge-query` · 独立运行时控制台报告;变更上下文写 decision/issue/artifact
|
|
@@ -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=d5b51ad56d4d4535; overlay=none; agent=codebuddy; do not edit -->
|
|
6
6
|
# harness-plan — 需求规划
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
@@ -28,6 +28,7 @@ description: 将需求转化为设计文档+实施计划+完整测试场景表
|
|
|
28
28
|
9. **每个 skill 边界只刷新一次状态快照** — 先运行 `python <skills-root>/scripts/harness_state.py capture --project . --change-dir ".harness/changes/<change-name>" --base <baseCommit> --json`;`changedSegments=[]` 时复用已有 profile/rules/map/knowledge/change/code 指纹,不再重复跑全量 `harness-sync`、知识重建或代码库扫描。只有对应 segment 变化或缺失时才定向刷新;快照不能替代源码读取和验证门禁。
|
|
29
29
|
|
|
30
30
|
状态目录分层:新路径优先,旧路径兼容 → [[../protocols/state-layout-protocol.md|state-layout-protocol]]
|
|
31
|
+
> 片段:read-protocol · plan 额外写 `meta/worktree.json`、`meta/change-context.json`
|
|
31
32
|
|
|
32
33
|
## Worktree 门禁
|
|
33
34
|
|
|
@@ -39,11 +40,12 @@ description: 将需求转化为设计文档+实施计划+完整测试场景表
|
|
|
39
40
|
| `requested=true` + path 存在 | 切换 worktree 执行 |
|
|
40
41
|
| `requested=true` + path 不存在 | **必须创建**(run)或 **停止**(test/review/submit) |
|
|
41
42
|
|
|
42
|
-
**严禁** `requested=true` 时静默回主目录。创建失败 → 停止或
|
|
43
|
+
**严禁** `requested=true` 时静默回主目录。创建失败 → 停止或 blocking user confirmation 降级(须 🟡WARN + 用户确认)。
|
|
43
44
|
|
|
44
45
|
**状态与代码分离**:代码/编译/测试在 `worktreeRoot`;`stateDir`(logs/events/ledger/reports)写回 `.harness/changes/<change-name>/`。
|
|
45
46
|
|
|
46
47
|
创建命令与 JSON 模板 → 各 skill `reference.md`(plan 写决策,run 创建/更新)。
|
|
48
|
+
> 片段:worktree-gate · plan 在**设计审批包**写入 `worktree.json`(模板 → `reference.md`)
|
|
47
49
|
|
|
48
50
|
## 原生规划协议
|
|
49
51
|
|
|
@@ -63,7 +65,7 @@ description: 将需求转化为设计文档+实施计划+完整测试场景表
|
|
|
63
65
|
| 1 | `harness-knowledge-query` 单次 query(内部 ensure-current;失败记 `issue`) |
|
|
64
66
|
| 2 | 歧义优先检查 + 复杂度分级;先确认会改变实现方向的语义歧义 |
|
|
65
67
|
| 3 | 按复杂度执行有预算的代码探索;简单修复不得扩散到无关模块 |
|
|
66
|
-
| 4 | **设计审批包**
|
|
68
|
+
| 4 | **设计审批包** blocking user confirmation;确认事件早于 approved 设计文档和 `meta/worktree.json` |
|
|
67
69
|
| 5–6 | plan + implementation-detail + test-scenarios → `plans/` |
|
|
68
70
|
| 7.5 | 仅 `--adversarial` 对抗评审 |
|
|
69
71
|
| 8 | 在临时产物集上运行 `harness_plan_finalize.py finalize`;原子发布、唯一 `phase.end`、render → `checklist.md` |
|
|
@@ -75,13 +77,14 @@ change-name 范围变更 → 提示重命名或记 🟡WARN(→ `reference.md`
|
|
|
75
77
|
- 命令结果不得靠猜测;普通 Bash 被拒 → 立即改用等价 PowerShell 重试一次
|
|
76
78
|
- 仅 PowerShell 成功且有明确证据(构建/git/测试输出、文件存在、exit 0)时可标 ✅OK;否则 ❌FAIL 或 🟡WARN
|
|
77
79
|
- 禁止把 hook 拒绝、静态验证、无输出、用户跳过说成成功 → 详见 [[../protocols/powershell-protocol.md|powershell-protocol]]、[[../protocols/evidence-based-reporting-protocol.md|evidence-based-reporting-protocol]]
|
|
80
|
+
> 片段:p0-trust
|
|
78
81
|
|
|
79
82
|
## 关键规则
|
|
80
83
|
|
|
81
84
|
| 规则 | 要点 |
|
|
82
85
|
|------|------|
|
|
83
86
|
| 产物路径 | 只写 `.harness/changes/<cn>/`;禁止 superpowers 输入 |
|
|
84
|
-
| 设计审批包 | 一次
|
|
87
|
+
| 设计审批包 | 一次 blocking user confirmation 含 worktree(读 `harness.json` `defaultWorktree`) |
|
|
85
88
|
| 阶段 8 | spec/plan/detail/scenarios/worktree.json 先进入 staging;仅 finalizer 校验成功后发布并写唯一 `phase.end`/log,失败不得手工补终态 |
|
|
86
89
|
| Plan 结束 | **禁止**询问执行模式;只提示 `/harness-run` |
|
|
87
90
|
| 知识查询 | 0.5 失败不得假装已读历史 |
|
|
@@ -117,3 +120,4 @@ python <skills-root>/scripts/harness_events.py append --change-dir ".harness/cha
|
|
|
117
120
|
> **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 边界保持最新。
|
|
118
121
|
|
|
119
122
|
每次阶段结束必须写 `--status OK|WARN|FAIL|BLOCKED`;重试同一阶段时增加 `--attempt <n>`,不得覆盖或伪装成一次执行。跨工具继续执行时写 `--executor-tool <codex|claude-code|codebuddy|cursor>`,并在接棒事件写 `--handoff-from-tool` / `--handoff-reason`;也可由 `HUNTER_HARNESS_TOOL/AGENT/MODEL/RUN_ID` 环境变量统一注入。
|
|
123
|
+
> 片段:logging · phase=`plan`
|
|
@@ -6,7 +6,7 @@ description: harness-plan 的阶段检查清单和覆盖检查列表。仅在执
|
|
|
6
6
|
|
|
7
7
|
## 阶段 0:工作区变更检查 ⚠️ 强制检查
|
|
8
8
|
|
|
9
|
-
> 有未提交业务变更(排除 `.harness/`)→ **默认 baseline 隔离**,append `decision` 事件,**不
|
|
9
|
+
> 有未提交业务变更(排除 `.harness/`)→ **默认 baseline 隔离**,append `decision` 事件,**不 blocking user confirmation**,继续规划。PowerShell 失败 → ❌ 停止。
|
|
10
10
|
|
|
11
11
|
**固定命令**:`powershell.exe -Command "git -C '<项目路径>' status --porcelain"`
|
|
12
12
|
|
|
@@ -27,7 +27,7 @@ description: harness-plan 的阶段检查清单和覆盖检查列表。仅在执
|
|
|
27
27
|
|
|
28
28
|
## 设计审批包字段:Worktree
|
|
29
29
|
|
|
30
|
-
> worktree 不再单独询问。阶段 4 **设计审批包** 一次
|
|
30
|
+
> worktree 不再单独询问。阶段 4 **设计审批包** 一次 blocking user confirmation 含 worktree 选项(推荐值读 `harness.json` `defaultWorktree`)。确认后写入 `meta/worktree.json`。
|
|
31
31
|
|
|
32
32
|
- [ ] 审批包确认后写入 worktree.json(`requested` true/false)
|
|
33
33
|
- [ ] 阶段 8 检查 worktree.json 存在
|
|
@@ -63,7 +63,7 @@ description: harness-plan 的阶段检查清单和覆盖检查列表。仅在执
|
|
|
63
63
|
|
|
64
64
|
- [ ] 变更涉及 HTTP/RPC 客户端(Feign/RestTemplate/SDK 封装)时:取客户端注解路径(类级 + 方法级拼接),与服务提供方 controller 的 `@RequestMapping` + 方法级注解**完整拼接路径**逐一比对,在计划/执行记录中列出比对结果。只看方法级注解不算完成。
|
|
65
65
|
|
|
66
|
-
## 阶段 4:设计审批包 ⚠️ 强制阻断(一次
|
|
66
|
+
## 阶段 4:设计审批包 ⚠️ 强制阻断(一次 blocking user confirmation)
|
|
67
67
|
|
|
68
68
|
> 合并原「设计审核 + worktree + 场景表预览 + change-name」。推荐 worktree 读 `harness.json` `defaultWorktree`。
|
|
69
69
|
|
|
@@ -89,7 +89,7 @@ source: harness-plan
|
|
|
89
89
|
---
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
-
展示可审核包后,使用 `
|
|
92
|
+
展示可审核包后,使用 `blocking user confirmation` 询问用户:
|
|
93
93
|
- **确认**:设计方向正确,继续任务拆分
|
|
94
94
|
- **修改**:某个部分需要调整,修改后再审核
|
|
95
95
|
- **取消**:方向不对,回到需求澄清阶段
|
|
@@ -154,7 +154,7 @@ source: harness-plan
|
|
|
154
154
|
阶段 7.5 执行完成后,确认以下事项:
|
|
155
155
|
|
|
156
156
|
```
|
|
157
|
-
□ 已用 **设计审批包** 一次
|
|
157
|
+
□ 已用 **设计审批包** 一次 blocking user confirmation(设计 + 场景表摘要 + worktree + change-name)
|
|
158
158
|
□ **未**单独询问 worktree 或对抗评审(对抗评审仅 `--adversarial`)
|
|
159
159
|
□ 用户同意后,已用 Agent 工具委派 harness-evaluator(haiku, context:fork, plan 模式只读, maxTurns:8)
|
|
160
160
|
□ 已用 context:fork 隔离上下文(evaluator 未参与规划,破除确认偏误)
|
|
@@ -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=
|
|
6
|
+
<!-- generated by harness_deploy.py; core=d5b51ad56d4d4535; overlay=none; agent=codebuddy; do not edit -->
|
|
7
7
|
# harness-review — 代码审查
|
|
8
8
|
|
|
9
9
|
## Purpose
|
|
@@ -42,6 +42,7 @@ description: 6维度代码审查(架构/安全/规范/兼容/测试/性能)
|
|
|
42
42
|
9. **每个 skill 边界只刷新一次状态快照** — 先运行 `python <skills-root>/scripts/harness_state.py capture --project . --change-dir ".harness/changes/<change-name>" --base <baseCommit> --json`;`changedSegments=[]` 时复用已有 profile/rules/map/knowledge/change/code 指纹,不再重复跑全量 `harness-sync`、知识重建或代码库扫描。只有对应 segment 变化或缺失时才定向刷新;快照不能替代源码读取和验证门禁。
|
|
43
43
|
|
|
44
44
|
状态目录分层:新路径优先,旧路径兼容 → [[../protocols/state-layout-protocol.md|state-layout-protocol]]
|
|
45
|
+
> 片段:read-protocol
|
|
45
46
|
|
|
46
47
|
## Workflow
|
|
47
48
|
|
|
@@ -107,6 +108,7 @@ review:
|
|
|
107
108
|
- 命令结果不得靠猜测;普通 Bash 被拒 → 立即改用等价 PowerShell 重试一次
|
|
108
109
|
- 仅 PowerShell 成功且有明确证据(构建/git/测试输出、文件存在、exit 0)时可标 ✅OK;否则 ❌FAIL 或 🟡WARN
|
|
109
110
|
- 禁止把 hook 拒绝、静态验证、无输出、用户跳过说成成功 → 详见 [[../protocols/powershell-protocol.md|powershell-protocol]]、[[../protocols/evidence-based-reporting-protocol.md|evidence-based-reporting-protocol]]
|
|
111
|
+
> 片段:p0-trust
|
|
110
112
|
|
|
111
113
|
## 关键规则(硬门禁速查)
|
|
112
114
|
|
|
@@ -134,7 +136,7 @@ review 读取 `state-snapshot.json`(`harness_state.py` / state-layout-protocol
|
|
|
134
136
|
|
|
135
137
|
## 交互白名单
|
|
136
138
|
|
|
137
|
-
**无**
|
|
139
|
+
**无** blocking user confirmation(审查全自动)。委派失败 → 主会话审查 + `decision` 事件。
|
|
138
140
|
|
|
139
141
|
## 执行日志
|
|
140
142
|
|
|
@@ -149,3 +151,4 @@ python <skills-root>/scripts/harness_events.py append --change-dir ".harness/cha
|
|
|
149
151
|
> **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 边界保持最新。
|
|
150
152
|
|
|
151
153
|
每次阶段结束必须写 `--status OK|WARN|FAIL|BLOCKED`;重试同一阶段时增加 `--attempt <n>`,不得覆盖或伪装成一次执行。跨工具继续执行时写 `--executor-tool <codex|claude-code|codebuddy|cursor>`,并在接棒事件写 `--handoff-from-tool` / `--handoff-reason`;也可由 `HUNTER_HARNESS_TOOL/AGENT/MODEL/RUN_ID` 环境变量统一注入。
|
|
154
|
+
> 片段:logging · phase=`review` · 事件:phase/decision/verification/issue/artifact
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
name: harness-run
|
|
3
3
|
description: 按变更簇执行 TDD 编码循环(RED→GREEN→REFACTOR→编译验证),逐变更簇实现计划中的任务。使用场景:开始编码、实现功能、写代码、TDD 编码
|
|
4
4
|
---
|
|
5
|
-
<!-- generated by harness_deploy.py; core=
|
|
5
|
+
<!-- generated by harness_deploy.py; core=d5b51ad56d4d4535; overlay=none; agent=codebuddy; do not edit -->
|
|
6
6
|
# harness-run — 需求编码
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
9
9
|
|
|
10
|
-
基于 plan + test-scenarios,按**变更簇**执行 TDD(RED→GREEN→REFACTOR→构建验证),写入 verification-ledger。负责 worktree 创建/切换(见
|
|
10
|
+
基于 plan + test-scenarios,按**变更簇**执行 TDD(RED→GREEN→REFACTOR→构建验证),写入 verification-ledger。负责 worktree 创建/切换(见 worktree-gate)。
|
|
11
11
|
|
|
12
12
|
## When to Use
|
|
13
13
|
|
|
@@ -28,11 +28,12 @@ description: 按变更簇执行 TDD 编码循环(RED→GREEN→REFACTOR→编
|
|
|
28
28
|
| `requested=true` + path 存在 | 切换 worktree 执行 |
|
|
29
29
|
| `requested=true` + path 不存在 | **必须创建**(run)或 **停止**(test/review/submit) |
|
|
30
30
|
|
|
31
|
-
**严禁** `requested=true` 时静默回主目录。创建失败 → 停止或
|
|
31
|
+
**严禁** `requested=true` 时静默回主目录。创建失败 → 停止或 blocking user confirmation 降级(须 🟡WARN + 用户确认)。
|
|
32
32
|
|
|
33
33
|
**状态与代码分离**:代码/编译/测试在 `worktreeRoot`;`stateDir`(logs/events/ledger/reports)写回 `.harness/changes/<change-name>/`。
|
|
34
34
|
|
|
35
35
|
创建命令与 JSON 模板 → 各 skill `reference.md`(plan 写决策,run 创建/更新)。
|
|
36
|
+
> 片段:worktree-gate · 创建命令 → `reference.md`
|
|
36
37
|
|
|
37
38
|
## 统一读取协议
|
|
38
39
|
|
|
@@ -47,6 +48,7 @@ description: 按变更簇执行 TDD 编码循环(RED→GREEN→REFACTOR→编
|
|
|
47
48
|
9. **每个 skill 边界只刷新一次状态快照** — 先运行 `python <skills-root>/scripts/harness_state.py capture --project . --change-dir ".harness/changes/<change-name>" --base <baseCommit> --json`;`changedSegments=[]` 时复用已有 profile/rules/map/knowledge/change/code 指纹,不再重复跑全量 `harness-sync`、知识重建或代码库扫描。只有对应 segment 变化或缺失时才定向刷新;快照不能替代源码读取和验证门禁。
|
|
48
49
|
|
|
49
50
|
状态目录分层:新路径优先,旧路径兼容 → [[../protocols/state-layout-protocol.md|state-layout-protocol]]
|
|
51
|
+
> 片段:read-protocol · run 必读文件优先级 → `reference.md` Step 0
|
|
50
52
|
|
|
51
53
|
## 执行模式
|
|
52
54
|
|
|
@@ -70,6 +72,7 @@ description: 按变更簇执行 TDD 编码循环(RED→GREEN→REFACTOR→编
|
|
|
70
72
|
- 命令结果不得靠猜测;普通 Bash 被拒 → 立即改用等价 PowerShell 重试一次
|
|
71
73
|
- 仅 PowerShell 成功且有明确证据(构建/git/测试输出、文件存在、exit 0)时可标 ✅OK;否则 ❌FAIL 或 🟡WARN
|
|
72
74
|
- 禁止把 hook 拒绝、静态验证、无输出、用户跳过说成成功 → 详见 [[../protocols/powershell-protocol.md|powershell-protocol]]、[[../protocols/evidence-based-reporting-protocol.md|evidence-based-reporting-protocol]]
|
|
75
|
+
> 片段:p0-trust
|
|
73
76
|
|
|
74
77
|
## 关键规则(硬门禁速查)
|
|
75
78
|
|
|
@@ -129,3 +132,4 @@ python <skills-root>/scripts/harness_events.py append --change-dir ".harness/cha
|
|
|
129
132
|
> **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 边界保持最新。
|
|
130
133
|
|
|
131
134
|
每次阶段结束必须写 `--status OK|WARN|FAIL|BLOCKED`;重试同一阶段时增加 `--attempt <n>`,不得覆盖或伪装成一次执行。跨工具继续执行时写 `--executor-tool <codex|claude-code|codebuddy|cursor>`,并在接棒事件写 `--handoff-from-tool` / `--handoff-reason`;也可由 `HUNTER_HARNESS_TOOL/AGENT/MODEL/RUN_ID` 环境变量统一注入。
|
|
135
|
+
> 片段:logging · phase=`run`
|
|
@@ -19,7 +19,7 @@ description: harness-run 的执行检查清单。仅在编码执行时读取。
|
|
|
19
19
|
- [ ] worktree 创建命令必须使用 PowerShell:`git worktree add ...`
|
|
20
20
|
- [ ] 创建后验证 `<adapter-worktree-root>/<change-name>/.git` 存在;Codex 必须是 `.codex/worktrees/<change-name>`
|
|
21
21
|
- [ ] 创建成功后更新 `meta/worktree.json` 的 `created=true/createdAt/createdBy`
|
|
22
|
-
- [ ] 创建失败 → 停止,或
|
|
22
|
+
- [ ] 创建失败 → 停止,或 blocking user confirmation 询问是否改为主目录执行
|
|
23
23
|
- [ ] 禁止 `requested=true && worktree 不存在` 时直接主目录执行
|
|
24
24
|
- [ ] 记录 `projectRoot / worktreeRoot / stateDir`
|
|
25
25
|
|
|
@@ -46,7 +46,7 @@ description: harness-run 的执行检查清单。仅在编码执行时读取。
|
|
|
46
46
|
- [ ] 统计任务数量和涉及模块数
|
|
47
47
|
- [ ] 如果处于 `--fixback` 模式,将 RED/YELLOW fixback 条目映射为本轮变更簇,并记录 `fixback: applied`
|
|
48
48
|
- [ ] 默认 Inline Execution;`--subagent` / `--inline` 参数覆盖
|
|
49
|
-
- [ ] **禁止**因任务数/模块数
|
|
49
|
+
- [ ] **禁止**因任务数/模块数 blocking user confirmation 选择执行模式
|
|
50
50
|
|
|
51
51
|
## 步骤 0.5:测试基础设施探测(⚠️ 必须先于任何 TDD 降级结论)
|
|
52
52
|
|
|
@@ -67,7 +67,7 @@ description: harness-run 的执行检查清单。仅在编码执行时读取。
|
|
|
67
67
|
> 如果 run 开始前检测到已有未提交变更,必须执行此步骤。
|
|
68
68
|
|
|
69
69
|
- [ ] 检查 git status 是否有 run 前的预存变更
|
|
70
|
-
- [ ] 如果有预存变更 → 使用
|
|
70
|
+
- [ ] 如果有预存变更 → 使用 blocking user confirmation 询问用户处理方式(保留/暂存/终止)
|
|
71
71
|
- [ ] 用户选择保留 → 创建 `.harness/changes/<change>/pre-existing-files.json`(文件列表 + diff hash + 用户选择)
|
|
72
72
|
- [ ] 用户选择保留 → 创建 `.harness/changes/<change>/pre-existing-diff.patch`(完整 diff 备份)
|
|
73
73
|
- [ ] 在执行日志中记录预存变更检测结果和用户选择
|
|
@@ -223,7 +223,7 @@ description: harness-run 的执行检查清单。仅在编码执行时读取。
|
|
|
223
223
|
- [ ] 确认当前 cwd 在 `<adapter-worktree-root>/<change-name>/` 下,且 branch 使用 adapter 的 prefix
|
|
224
224
|
- [ ] 生成变更摘要:`git diff --stat` + `git diff --stat --cached`
|
|
225
225
|
- [ ] 构建 commit message:`wip(<scope>): <change-name> 编码完成 — N任务/M文件变更`
|
|
226
|
-
- [ ] **⚠️ 强制阻断**:用
|
|
226
|
+
- [ ] **⚠️ 强制阻断**:用 blocking user confirmation 展示变更列表 + commit message,等待用户确认
|
|
227
227
|
- [ ] 用户确认 → 精确暂存业务文件;若存在 test-tracking manifest,先执行 `harness_test_guard.py stage --project . --change-dir ".harness/changes/<change-name>" --json`;禁止 `git add -A` 与目录级 force-add
|
|
228
228
|
- [ ] `git diff --cached --name-only` 包含 manifest 的全部精确测试路径后再 `git commit`(不用 --no-verify、--no-gpg-sign)
|
|
229
229
|
- [ ] 用户拒绝 → 记录 `❌用户拒绝`,继续后续流程
|
|
@@ -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=
|
|
6
|
+
<!-- generated by harness_deploy.py; core=d5b51ad56d4d4535; overlay=none; agent=codebuddy; do not edit -->
|
|
7
7
|
# harness-submit — 最终提交(含 worktree 合并)
|
|
8
8
|
|
|
9
9
|
## Purpose
|
|
@@ -43,6 +43,7 @@ description: 最终提交封装:验证→中文 commit→提交/推送;workt
|
|
|
43
43
|
9. **每个 skill 边界只刷新一次状态快照** — 先运行 `python <skills-root>/scripts/harness_state.py capture --project . --change-dir ".harness/changes/<change-name>" --base <baseCommit> --json`;`changedSegments=[]` 时复用已有 profile/rules/map/knowledge/change/code 指纹,不再重复跑全量 `harness-sync`、知识重建或代码库扫描。只有对应 segment 变化或缺失时才定向刷新;快照不能替代源码读取和验证门禁。
|
|
44
44
|
|
|
45
45
|
状态目录分层:新路径优先,旧路径兼容 → [[../protocols/state-layout-protocol.md|state-layout-protocol]]
|
|
46
|
+
> 片段:read-protocol
|
|
46
47
|
|
|
47
48
|
## 状态目录分层
|
|
48
49
|
|
|
@@ -60,7 +61,7 @@ worktree 合并前必须运行 `harness_change.py integration-lock acquire --run
|
|
|
60
61
|
1. **合并最新代码** — 主目录与 worktree 均**不在业务工作区 stash/pull**;远端同步由合并段 integration transaction 在隔离 integration worktree 内完成(见「worktree 合并流程」);**正常路径禁止 `git stash` / `stash pop`**
|
|
61
62
|
2. **最终验证** — ledger 复用优先;**提交前最终门禁只调 `can-reuse`**(删除与 coverage 冲突的二次全量门禁):`harness_ledger.py can-reuse --verification unitTestFull --scope module --project . --profile-input unitTestFull --command <resolved commands.unitTestFull.command>`。`--command` **按 profile key resolve**:读 `build-profile.json` 的 `commands.unitTestFull.command`(v2),或 `harness_profile.py resolve --project . --key unitTestFull --json` 取 resolved command,**不复制示例模块名**(文档示例只展示 key)。`--profile-input unitTestFull` 从 `verificationInputs.unitTestFull`(v2 由 `commands.unitTestFull.inputs` 派生)展开依赖闭包,**禁止用仅含 staged 文件的 `--files` 快捷方式**冒充全量闭包。`reuse=true` → 不再执行二次全量测试;仅 `reuse=false` 时执行**同一 resolved verification**(profile `unitTestFull` 命令),成功后用同一文件集、command、`scope=module` 经 **`harness_ledger.py record`** 写回 ledger `unitTestFull` 项。增量 `unitTest` 永远不能冒充 `unitTestFull` 门禁。
|
|
62
63
|
3. **.gitignore + 精确暂存** ⚠️ — 检查 `.harness/` 在 `.gitignore`;**禁止 `git add -A`**。若存在 `evidence/test-tracking.json`,先执行 `python <skills-root>/scripts/harness_test_guard.py stage --project . --change-dir ".harness/changes/<change-name>" --json`;失败即硬停止。无 manifest 时不使用 `-f`。manifest 之外的文件按精确业务路径正常暂存,**禁止全局 force-add**。
|
|
63
|
-
4. **提交方式** — 主目录:
|
|
64
|
+
4. **提交方式** — 主目录:blocking user confirmation 三选项(commit+push / 仅本地 / 取消);**worktree:固定仅本地 commit**
|
|
64
65
|
5. **commit-message.txt** ⚠️ — 展示 staged、diff stat、完整中文 message;用户确认
|
|
65
66
|
6. **commit / push** — `git commit -F`;主目录按选项 push(push 前 fetch 检查远端);**worktree:只 commit,记录 local hash**
|
|
66
67
|
7. **收尾** — **`harness_gate.py close --phase submit --status ...`**;主目录:可选 worktree 清理 + 提示 `/harness-archive`;**worktree:接续下方合并流程**
|
|
@@ -89,6 +90,7 @@ M7. **ledger + 收尾** — 经 `harness_ledger.py record` 写入 `mergeFinalHas
|
|
|
89
90
|
- 命令结果不得靠猜测;普通 Bash 被拒 → 立即改用等价 PowerShell 重试一次
|
|
90
91
|
- 仅 PowerShell 成功且有明确证据(构建/git/测试输出、文件存在、exit 0)时可标 ✅OK;否则 ❌FAIL 或 🟡WARN
|
|
91
92
|
- 禁止把 hook 拒绝、静态验证、无输出、用户跳过说成成功 → 详见 [[../protocols/powershell-protocol.md|powershell-protocol]]、[[../protocols/evidence-based-reporting-protocol.md|evidence-based-reporting-protocol]]
|
|
93
|
+
> 片段:p0-trust
|
|
92
94
|
|
|
93
95
|
## 关键规则(硬门禁速查)
|
|
94
96
|
|
|
@@ -134,7 +136,7 @@ git 经 PowerShell;commit/报告不得含明文密钥。遵循 `../protocols/s
|
|
|
134
136
|
|
|
135
137
|
## 交互白名单
|
|
136
138
|
|
|
137
|
-
本 skill **仅允许**以下
|
|
139
|
+
本 skill **仅允许**以下 blocking user confirmation;其余默认值 + `decision` 事件:
|
|
138
140
|
|
|
139
141
|
1. **提交方式 + commit message**(主目录一次确认);worktree 固定仅本地 commit,仅确认 message
|
|
140
142
|
2. **远程有新提交**(push 前):重新验证 / 停止 push
|
|
@@ -152,3 +154,4 @@ python <skills-root>/scripts/harness_events.py append --change-dir ".harness/cha
|
|
|
152
154
|
> **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 边界保持最新。
|
|
153
155
|
|
|
154
156
|
每次阶段结束必须写 `--status OK|WARN|FAIL|BLOCKED`;重试同一阶段时增加 `--attempt <n>`,不得覆盖或伪装成一次执行。跨工具继续执行时写 `--executor-tool <codex|claude-code|codebuddy|cursor>`,并在接棒事件写 `--handoff-from-tool` / `--handoff-reason`;也可由 `HUNTER_HARNESS_TOOL/AGENT/MODEL/RUN_ID` 环境变量统一注入。
|
|
157
|
+
> 片段:logging · phase=`submit`/`merge`
|
|
@@ -12,7 +12,7 @@ description: harness-submit 的8 步工作流详细步骤和执行日志记录
|
|
|
12
12
|
- commit message 必须写入 `.harness/changes/<change>/runtime/commit-message.txt`。
|
|
13
13
|
- 使用 `git commit -F`,禁止先英文 commit 再 amend。
|
|
14
14
|
- commit message 禁止 `Co-Authored-By`、`Generated by`、`AI generated`。
|
|
15
|
-
-
|
|
15
|
+
- blocking user confirmation 参数错误时不得自行绕过,必须改用固定模板重问。
|
|
16
16
|
- staged diff 是唯一提交依据。
|
|
17
17
|
|
|
18
18
|
|
|
@@ -130,7 +130,7 @@ powershell.exe -Command "Select-String -Path '<项目路径>\.gitignore' -Patter
|
|
|
130
130
|
|
|
131
131
|
如果未包含:
|
|
132
132
|
- **必须提醒用户**:`⚠️ .gitignore 未包含 .harness/,会导致 .harness/ 下文件被提交(含日志、报告、可能含敏感信息)`
|
|
133
|
-
- **默认不提交 .harness/ 下文件**:使用
|
|
133
|
+
- **默认不提交 .harness/ 下文件**:使用 blocking user confirmation 询问用户是否:
|
|
134
134
|
1. 添加 .harness/ 到 .gitignore(推荐)
|
|
135
135
|
2. 仅 stage 业务代码文件,不提交 .harness/
|
|
136
136
|
3. 取消提交
|
|
@@ -146,7 +146,7 @@ powershell.exe -Command "git -C '<项目路径>' status --porcelain | Select-Str
|
|
|
146
146
|
|
|
147
147
|
**worktree 模式(requested=true)**:固定为「仅本地 commit」,不展示「commit+push」选项;commit 完成后继续下方「worktree 合并流程」,跳过下方三选项询问。
|
|
148
148
|
|
|
149
|
-
`harness-submit` 不调用 Superpowers 呈现合并选项。只允许使用固定
|
|
149
|
+
`harness-submit` 不调用 Superpowers 呈现合并选项。只允许使用固定 blocking user confirmation 模板:
|
|
150
150
|
|
|
151
151
|
```text
|
|
152
152
|
本次变更已完成验证,请选择提交方式:
|
|
@@ -156,7 +156,7 @@ powershell.exe -Command "git -C '<项目路径>' status --porcelain | Select-Str
|
|
|
156
156
|
3. 取消提交
|
|
157
157
|
```
|
|
158
158
|
|
|
159
|
-
|
|
159
|
+
禁止在此步骤引入"创建 PR""丢弃所有变更""直接合并到主分支"等旧选项,避免 blocking user confirmation 参数错误和流程歧义。
|
|
160
160
|
|
|
161
161
|
## 步骤 5:展示提交摘要 + 确认 ⚠️ 强制阻断
|
|
162
162
|
|
|
@@ -256,7 +256,7 @@ powershell.exe -Command "git -C '<项目路径>' log HEAD..@{u} --oneline"
|
|
|
256
256
|
- **不得直接 pull 后 push**
|
|
257
257
|
- 必须 pull/rebase 后**重新构建/测试**(ledger 复用条件被破坏,须重跑并写回 ledger)
|
|
258
258
|
- 验证通过后再 push
|
|
259
|
-
- 使用
|
|
259
|
+
- 使用 blocking user confirmation 询问用户:
|
|
260
260
|
```
|
|
261
261
|
远程有新提交(N 个),需要 pull/rebase 后重新验证:
|
|
262
262
|
1. 重新验证(pull/rebase + 构建 + 测试)
|
|
@@ -4,7 +4,7 @@ description: harness-submit 的提交格式、固定交互模板和中文 commit
|
|
|
4
4
|
|
|
5
5
|
# harness-submit 参考
|
|
6
6
|
|
|
7
|
-
## 提交方式
|
|
7
|
+
## 提交方式 blocking user confirmation 固定模板
|
|
8
8
|
|
|
9
9
|
问题标题:`请选择提交方式`
|
|
10
10
|
|
|
@@ -14,7 +14,7 @@ description: harness-submit 的提交格式、固定交互模板和中文 commit
|
|
|
14
14
|
2. `仅本地 commit,不 push`
|
|
15
15
|
3. `取消提交`
|
|
16
16
|
|
|
17
|
-
不得临场增加复杂对象或嵌套参数,避免
|
|
17
|
+
不得临场增加复杂对象或嵌套参数,避免 blocking user confirmation 参数错误。
|
|
18
18
|
|
|
19
19
|
> **worktree 模式(meta/worktree.json requested=true)**:固定选项 2「仅本地 commit」,不展示「commit+push」;commit 成功后 skill **自动接续** worktree 合并流程(`/harness-merge` 为别名)。push 只在主分支完成,产出 `mergeFinalHash`。
|
|
20
20
|
|
|
@@ -148,5 +148,5 @@ powershell.exe -NoProfile -Command "git -C '<项目路径>' log HEAD..@{u} --one
|
|
|
148
148
|
|
|
149
149
|
- 步骤 1(合并最新代码):按无 upstream / 远端无新提交判定 N/A,在执行日志记录理由。
|
|
150
150
|
- 步骤 5(commit-message.txt + `git commit -F`)N/A:无可暂存 diff,无新 commit 需生成。执行日志标注 `commit-message.txt / git commit -F: N/A(工作树 clean,无新 commit;N 个 wip 提交已存在,原样推送)`。
|
|
151
|
-
- 步骤 4(提交方式选择):固定三选项仍适用。但当 review 标了 RED 兼容性破坏等需人工确认项时,可在"commit + push"选项的描述中注明"并确认 <RED 项>",**不得新增第四选项**、不得临场拼复杂
|
|
151
|
+
- 步骤 4(提交方式选择):固定三选项仍适用。但当 review 标了 RED 兼容性破坏等需人工确认项时,可在"commit + push"选项的描述中注明"并确认 <RED 项>",**不得新增第四选项**、不得临场拼复杂 blocking user confirmation 参数。
|
|
152
152
|
- push 仍按步骤 6:fetch 检查远端 → `git push -u`(无 upstream 则新建远端分支)→ 记录 pre-pull hash + final pushed hash。
|
|
@@ -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=d5b51ad56d4d4535; overlay=none; agent=codebuddy; do not edit -->
|
|
6
6
|
# harness-sync — 元数据同步
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
@@ -38,7 +38,7 @@ python <skills-root>/scripts/harness_sync.py finalize --project . --run-id <run-
|
|
|
38
38
|
| 3 | `.harness/codebase/map/` 是否过期 → 报告建议 `/harness-codebase-map` |
|
|
39
39
|
| 3.5 | `harness_knowledge.py sync`;可 `sync --update`;失败不得假装可用。**知识闭环主入口**是 `/harness-knowledge-ingest auto`(含 Agent judge),sync 不重复列人工知识待办 |
|
|
40
40
|
| 3.6 | 单次运行 `harness_knowledge.py maintain --project . --drain --json`,有界推进全部 `.harness/knowledge/maintenance-outbox/{pending,failed}`;不得为每个条目重复启动 Python/重建索引(§8.2:archive close 只 enqueue,sync 异步推进 outbox 到 completed/pending-judge) |
|
|
41
|
-
| 4 | CLAUDE.md 完整性/行数 → 超限
|
|
41
|
+
| 4 | CLAUDE.md 完整性/行数 → 超限 blocking user confirmation 瘦身 |
|
|
42
42
|
| 5 | AGENTS.md 与各 Agent 指令入口一致;Claude Code 启用时验证 CLAUDE.md 引用 AGENTS.md,禁止反向循环引用 |
|
|
43
43
|
| 6 | `.harness/` 结构(init 规程 → `reference.md` 第 6 步);已装 skill 新鲜度只经 `hunter-harness refresh --dry-run --json` 的 post-adaptation freshness 判断,禁止 raw build 字节比较 |
|
|
44
44
|
| 7–9 | `项目规则(见 .harness/context-index.json)/`、构建配置、测试目录 — **只提示不自动修复** |
|
|
@@ -50,6 +50,7 @@ python <skills-root>/scripts/harness_sync.py finalize --project . --run-id <run-
|
|
|
50
50
|
- 命令结果不得靠猜测;普通 Bash 被拒 → 立即改用等价 PowerShell 重试一次
|
|
51
51
|
- 仅 PowerShell 成功且有明确证据(构建/git/测试输出、文件存在、exit 0)时可标 ✅OK;否则 ❌FAIL 或 🟡WARN
|
|
52
52
|
- 禁止把 hook 拒绝、静态验证、无输出、用户跳过说成成功 → 详见 [[../protocols/powershell-protocol.md|powershell-protocol]]、[[../protocols/evidence-based-reporting-protocol.md|evidence-based-reporting-protocol]]
|
|
53
|
+
> 片段:p0-trust
|
|
53
54
|
|
|
54
55
|
## 关键规则
|
|
55
56
|
|
|
@@ -80,3 +81,4 @@ python <skills-root>/scripts/harness_events.py append --change-dir ".harness/cha
|
|
|
80
81
|
> **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 边界保持最新。
|
|
81
82
|
|
|
82
83
|
每次阶段结束必须写 `--status OK|WARN|FAIL|BLOCKED`;重试同一阶段时增加 `--attempt <n>`,不得覆盖或伪装成一次执行。跨工具继续执行时写 `--executor-tool <codex|claude-code|codebuddy|cursor>`,并在接棒事件写 `--handoff-from-tool` / `--handoff-reason`;也可由 `HUNTER_HARNESS_TOOL/AGENT/MODEL/RUN_ID` 环境变量统一注入。
|
|
84
|
+
> 片段:logging · phase=`sync`;有未归档变更时写入其 change-dir events
|
|
@@ -58,7 +58,7 @@ powershell.exe -Command "git -C '<项目路径>' diff --stat HEAD~5 2>$null"
|
|
|
58
58
|
|
|
59
59
|
**瘦身策略**:如果超过 200 行,不是简单截断——而是把可独立成篇的细节(如完整编码规范、详细架构图)迁移到 `项目规则(见 .harness/context-index.json)/` 下,CLAUDE.md 保留简洁的索引和关键命令。
|
|
60
60
|
|
|
61
|
-
> ⚠️ CLAUDE.md 需要瘦身时,必须用
|
|
61
|
+
> ⚠️ CLAUDE.md 需要瘦身时,必须用 blocking user confirmation 与用户确认拆分方案后再执行。
|
|
62
62
|
|
|
63
63
|
### 5. AGENTS.md 一致性
|
|
64
64
|
|