@hunter-harness/workflow-harness 0.2.40 → 0.2.42
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/harness-archive/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-archive/checklist.md +3 -0
- package/harness/bundles/general/claude-code/harness-archive/templates/render-summary.mjs +22 -0
- package/harness/bundles/general/claude-code/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-knowledge-ingest/SKILL.md +42 -16
- package/harness/bundles/general/claude-code/harness-knowledge-ingest/reference.md +57 -6
- package/harness/bundles/general/claude-code/harness-knowledge-ingest/scripts/harness_knowledge.py +1097 -174
- package/harness/bundles/general/claude-code/harness-knowledge-query/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-plan/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-plan/reference.md +16 -16
- package/harness/bundles/general/claude-code/harness-review/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-run/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-run/reference.md +1 -1
- package/harness/bundles/general/claude-code/harness-submit/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-sync/SKILL.md +16 -10
- package/harness/bundles/general/claude-code/harness-sync/reference.md +34 -14
- package/harness/bundles/general/claude-code/harness-test/SKILL.md +3 -1
- package/harness/bundles/general/claude-code/protocols/archive-report-protocol.md +10 -0
- package/harness/bundles/general/claude-code/protocols/ledger-protocol.md +12 -0
- package/harness/bundles/general/claude-code/protocols/powershell-protocol.md +21 -0
- package/harness/bundles/general/claude-code/protocols/state-layout-protocol.md +11 -0
- package/harness/bundles/general/claude-code/scripts/harness_archive.py +413 -2
- package/harness/bundles/general/claude-code/scripts/harness_environment.py +556 -39
- package/harness/bundles/general/claude-code/scripts/harness_gate.py +145 -0
- package/harness/bundles/general/claude-code/scripts/harness_ledger.py +581 -55
- package/harness/bundles/general/claude-code/scripts/harness_plan_finalize.py +85 -6
- package/harness/bundles/general/claude-code/scripts/harness_service.py +291 -22
- package/harness/bundles/general/claude-code/scripts/harness_test_runner.py +405 -25
- package/harness/bundles/general/codebuddy/.harness-build.json +1 -1
- package/harness/bundles/general/codebuddy/harness-archive/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-archive/checklist.md +3 -0
- package/harness/bundles/general/codebuddy/harness-archive/templates/render-summary.mjs +22 -0
- package/harness/bundles/general/codebuddy/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-knowledge-ingest/SKILL.md +41 -15
- package/harness/bundles/general/codebuddy/harness-knowledge-ingest/reference.md +57 -6
- package/harness/bundles/general/codebuddy/harness-knowledge-ingest/scripts/harness_knowledge.py +1097 -174
- package/harness/bundles/general/codebuddy/harness-knowledge-query/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-plan/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-plan/reference.md +16 -16
- package/harness/bundles/general/codebuddy/harness-review/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-run/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-run/reference.md +1 -1
- package/harness/bundles/general/codebuddy/harness-submit/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-sync/SKILL.md +16 -10
- package/harness/bundles/general/codebuddy/harness-sync/reference.md +34 -14
- package/harness/bundles/general/codebuddy/harness-test/SKILL.md +3 -1
- package/harness/bundles/general/codebuddy/protocols/archive-report-protocol.md +10 -0
- package/harness/bundles/general/codebuddy/protocols/ledger-protocol.md +12 -0
- package/harness/bundles/general/codebuddy/protocols/powershell-protocol.md +21 -0
- package/harness/bundles/general/codebuddy/protocols/state-layout-protocol.md +11 -0
- package/harness/bundles/general/codebuddy/scripts/harness_archive.py +413 -2
- package/harness/bundles/general/codebuddy/scripts/harness_environment.py +556 -39
- package/harness/bundles/general/codebuddy/scripts/harness_gate.py +145 -0
- package/harness/bundles/general/codebuddy/scripts/harness_ledger.py +581 -55
- package/harness/bundles/general/codebuddy/scripts/harness_plan_finalize.py +85 -6
- package/harness/bundles/general/codebuddy/scripts/harness_service.py +291 -22
- package/harness/bundles/general/codebuddy/scripts/harness_test_runner.py +405 -25
- package/harness/bundles/general/codex/.harness-build.json +1 -1
- package/harness/bundles/general/codex/harness-archive/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-archive/checklist.md +3 -0
- package/harness/bundles/general/codex/harness-archive/templates/render-summary.mjs +22 -0
- package/harness/bundles/general/codex/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-knowledge-ingest/SKILL.md +41 -15
- package/harness/bundles/general/codex/harness-knowledge-ingest/reference.md +57 -6
- package/harness/bundles/general/codex/harness-knowledge-ingest/scripts/harness_knowledge.py +1097 -174
- package/harness/bundles/general/codex/harness-knowledge-query/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-plan/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-plan/reference.md +16 -16
- package/harness/bundles/general/codex/harness-review/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-run/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-run/reference.md +1 -1
- package/harness/bundles/general/codex/harness-submit/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-sync/SKILL.md +16 -10
- package/harness/bundles/general/codex/harness-sync/reference.md +34 -14
- package/harness/bundles/general/codex/harness-test/SKILL.md +3 -1
- package/harness/bundles/general/codex/protocols/archive-report-protocol.md +10 -0
- package/harness/bundles/general/codex/protocols/ledger-protocol.md +12 -0
- package/harness/bundles/general/codex/protocols/powershell-protocol.md +21 -0
- package/harness/bundles/general/codex/protocols/state-layout-protocol.md +11 -0
- package/harness/bundles/general/codex/scripts/harness_archive.py +413 -2
- package/harness/bundles/general/codex/scripts/harness_environment.py +556 -39
- package/harness/bundles/general/codex/scripts/harness_gate.py +145 -0
- package/harness/bundles/general/codex/scripts/harness_ledger.py +581 -55
- package/harness/bundles/general/codex/scripts/harness_plan_finalize.py +85 -6
- package/harness/bundles/general/codex/scripts/harness_service.py +291 -22
- package/harness/bundles/general/codex/scripts/harness_test_runner.py +405 -25
- package/harness/bundles/general/cursor/.harness-build.json +1 -1
- package/harness/bundles/general/cursor/harness-archive/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-archive/checklist.md +3 -0
- package/harness/bundles/general/cursor/harness-archive/templates/render-summary.mjs +22 -0
- package/harness/bundles/general/cursor/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-knowledge-ingest/SKILL.md +41 -15
- package/harness/bundles/general/cursor/harness-knowledge-ingest/reference.md +57 -6
- package/harness/bundles/general/cursor/harness-knowledge-ingest/scripts/harness_knowledge.py +1097 -174
- package/harness/bundles/general/cursor/harness-knowledge-query/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-plan/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-plan/reference.md +16 -16
- package/harness/bundles/general/cursor/harness-review/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-run/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-run/reference.md +1 -1
- package/harness/bundles/general/cursor/harness-submit/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-sync/SKILL.md +16 -10
- package/harness/bundles/general/cursor/harness-sync/reference.md +34 -14
- package/harness/bundles/general/cursor/harness-test/SKILL.md +3 -1
- package/harness/bundles/general/cursor/protocols/archive-report-protocol.md +10 -0
- package/harness/bundles/general/cursor/protocols/ledger-protocol.md +12 -0
- package/harness/bundles/general/cursor/protocols/powershell-protocol.md +21 -0
- package/harness/bundles/general/cursor/protocols/state-layout-protocol.md +11 -0
- package/harness/bundles/general/cursor/scripts/harness_archive.py +413 -2
- package/harness/bundles/general/cursor/scripts/harness_environment.py +556 -39
- package/harness/bundles/general/cursor/scripts/harness_gate.py +145 -0
- package/harness/bundles/general/cursor/scripts/harness_ledger.py +581 -55
- package/harness/bundles/general/cursor/scripts/harness_plan_finalize.py +85 -6
- package/harness/bundles/general/cursor/scripts/harness_service.py +291 -22
- package/harness/bundles/general/cursor/scripts/harness_test_runner.py +405 -25
- package/harness/bundles/java/claude-code/.harness-build.json +1 -1
- package/harness/bundles/java/claude-code/harness-apidoc/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-archive/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-archive/checklist.md +3 -0
- package/harness/bundles/java/claude-code/harness-archive/templates/render-summary.mjs +22 -0
- package/harness/bundles/java/claude-code/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-knowledge-ingest/SKILL.md +42 -16
- package/harness/bundles/java/claude-code/harness-knowledge-ingest/reference.md +57 -6
- package/harness/bundles/java/claude-code/harness-knowledge-ingest/scripts/harness_knowledge.py +1097 -174
- package/harness/bundles/java/claude-code/harness-knowledge-query/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-package/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-plan/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-plan/reference.md +16 -16
- package/harness/bundles/java/claude-code/harness-review/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-run/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-submit/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-sync/SKILL.md +16 -10
- package/harness/bundles/java/claude-code/harness-sync/reference.md +34 -14
- package/harness/bundles/java/claude-code/harness-test/SKILL.md +3 -1
- package/harness/bundles/java/claude-code/protocols/archive-report-protocol.md +10 -0
- package/harness/bundles/java/claude-code/protocols/ledger-protocol.md +12 -0
- package/harness/bundles/java/claude-code/protocols/powershell-protocol.md +21 -0
- package/harness/bundles/java/claude-code/protocols/state-layout-protocol.md +11 -0
- package/harness/bundles/java/claude-code/scripts/harness_archive.py +413 -2
- package/harness/bundles/java/claude-code/scripts/harness_environment.py +556 -39
- package/harness/bundles/java/claude-code/scripts/harness_gate.py +145 -0
- package/harness/bundles/java/claude-code/scripts/harness_ledger.py +581 -55
- package/harness/bundles/java/claude-code/scripts/harness_plan_finalize.py +85 -6
- package/harness/bundles/java/claude-code/scripts/harness_service.py +291 -22
- package/harness/bundles/java/claude-code/scripts/harness_test_runner.py +405 -25
- package/harness/bundles/java/codebuddy/.harness-build.json +1 -1
- package/harness/bundles/java/codebuddy/harness-apidoc/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-archive/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-archive/checklist.md +3 -0
- package/harness/bundles/java/codebuddy/harness-archive/templates/render-summary.mjs +22 -0
- package/harness/bundles/java/codebuddy/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-knowledge-ingest/SKILL.md +41 -15
- package/harness/bundles/java/codebuddy/harness-knowledge-ingest/reference.md +57 -6
- package/harness/bundles/java/codebuddy/harness-knowledge-ingest/scripts/harness_knowledge.py +1097 -174
- package/harness/bundles/java/codebuddy/harness-knowledge-query/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-package/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-plan/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-plan/reference.md +16 -16
- package/harness/bundles/java/codebuddy/harness-review/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-run/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-submit/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-sync/SKILL.md +16 -10
- package/harness/bundles/java/codebuddy/harness-sync/reference.md +34 -14
- package/harness/bundles/java/codebuddy/harness-test/SKILL.md +3 -1
- package/harness/bundles/java/codebuddy/protocols/archive-report-protocol.md +10 -0
- package/harness/bundles/java/codebuddy/protocols/ledger-protocol.md +12 -0
- package/harness/bundles/java/codebuddy/protocols/powershell-protocol.md +21 -0
- package/harness/bundles/java/codebuddy/protocols/state-layout-protocol.md +11 -0
- package/harness/bundles/java/codebuddy/scripts/harness_archive.py +413 -2
- package/harness/bundles/java/codebuddy/scripts/harness_environment.py +556 -39
- package/harness/bundles/java/codebuddy/scripts/harness_gate.py +145 -0
- package/harness/bundles/java/codebuddy/scripts/harness_ledger.py +581 -55
- package/harness/bundles/java/codebuddy/scripts/harness_plan_finalize.py +85 -6
- package/harness/bundles/java/codebuddy/scripts/harness_service.py +291 -22
- package/harness/bundles/java/codebuddy/scripts/harness_test_runner.py +405 -25
- package/harness/bundles/java/codex/.harness-build.json +1 -1
- package/harness/bundles/java/codex/harness-apidoc/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-archive/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-archive/checklist.md +3 -0
- package/harness/bundles/java/codex/harness-archive/templates/render-summary.mjs +22 -0
- package/harness/bundles/java/codex/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-knowledge-ingest/SKILL.md +41 -15
- package/harness/bundles/java/codex/harness-knowledge-ingest/reference.md +57 -6
- package/harness/bundles/java/codex/harness-knowledge-ingest/scripts/harness_knowledge.py +1097 -174
- package/harness/bundles/java/codex/harness-knowledge-query/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-package/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-plan/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-plan/reference.md +16 -16
- package/harness/bundles/java/codex/harness-review/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-run/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-submit/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-sync/SKILL.md +16 -10
- package/harness/bundles/java/codex/harness-sync/reference.md +34 -14
- package/harness/bundles/java/codex/harness-test/SKILL.md +3 -1
- package/harness/bundles/java/codex/protocols/archive-report-protocol.md +10 -0
- package/harness/bundles/java/codex/protocols/ledger-protocol.md +12 -0
- package/harness/bundles/java/codex/protocols/powershell-protocol.md +21 -0
- package/harness/bundles/java/codex/protocols/state-layout-protocol.md +11 -0
- package/harness/bundles/java/codex/scripts/harness_archive.py +413 -2
- package/harness/bundles/java/codex/scripts/harness_environment.py +556 -39
- package/harness/bundles/java/codex/scripts/harness_gate.py +145 -0
- package/harness/bundles/java/codex/scripts/harness_ledger.py +581 -55
- package/harness/bundles/java/codex/scripts/harness_plan_finalize.py +85 -6
- package/harness/bundles/java/codex/scripts/harness_service.py +291 -22
- package/harness/bundles/java/codex/scripts/harness_test_runner.py +405 -25
- package/harness/bundles/java/cursor/.harness-build.json +1 -1
- package/harness/bundles/java/cursor/harness-apidoc/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-archive/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-archive/checklist.md +3 -0
- package/harness/bundles/java/cursor/harness-archive/templates/render-summary.mjs +22 -0
- package/harness/bundles/java/cursor/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-knowledge-ingest/SKILL.md +41 -15
- package/harness/bundles/java/cursor/harness-knowledge-ingest/reference.md +57 -6
- package/harness/bundles/java/cursor/harness-knowledge-ingest/scripts/harness_knowledge.py +1097 -174
- package/harness/bundles/java/cursor/harness-knowledge-query/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-package/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-plan/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-plan/reference.md +16 -16
- package/harness/bundles/java/cursor/harness-review/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-run/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-submit/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-sync/SKILL.md +16 -10
- package/harness/bundles/java/cursor/harness-sync/reference.md +34 -14
- package/harness/bundles/java/cursor/harness-test/SKILL.md +3 -1
- package/harness/bundles/java/cursor/protocols/archive-report-protocol.md +10 -0
- package/harness/bundles/java/cursor/protocols/ledger-protocol.md +12 -0
- package/harness/bundles/java/cursor/protocols/powershell-protocol.md +21 -0
- package/harness/bundles/java/cursor/protocols/state-layout-protocol.md +11 -0
- package/harness/bundles/java/cursor/scripts/harness_archive.py +413 -2
- package/harness/bundles/java/cursor/scripts/harness_environment.py +556 -39
- package/harness/bundles/java/cursor/scripts/harness_gate.py +145 -0
- package/harness/bundles/java/cursor/scripts/harness_ledger.py +581 -55
- package/harness/bundles/java/cursor/scripts/harness_plan_finalize.py +85 -6
- package/harness/bundles/java/cursor/scripts/harness_service.py +291 -22
- package/harness/bundles/java/cursor/scripts/harness_test_runner.py +405 -25
- package/harness/manifests/general/claude-code.json +34 -34
- package/harness/manifests/general/codebuddy.json +34 -34
- package/harness/manifests/general/codex.json +34 -34
- package/harness/manifests/general/cursor.json +34 -34
- package/harness/manifests/java/claude-code.json +35 -35
- package/harness/manifests/java/codebuddy.json +35 -35
- package/harness/manifests/java/codex.json +35 -35
- package/harness/manifests/java/cursor.json +35 -35
- package/hunter-workflow-family.json +10 -10
- package/package.json +1 -1
|
@@ -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=4caa698ed8bc50c8; overlay=none; agent=cursor; 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 的上下文归属。
|
|
@@ -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=4caa698ed8bc50c8; overlay=none; agent=cursor; do not edit -->
|
|
6
6
|
# harness-plan — 需求规划
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
@@ -228,35 +228,35 @@ status: approved
|
|
|
228
228
|
|
|
229
229
|
#### 1.1 <类名.方法名>
|
|
230
230
|
|
|
231
|
-
| ID | 优先级 | 分类 | 场景描述 | 输入 | 预期 | 执行层级 | 预计时长 | 资源预算 | 超时 | 可复用证据 |
|
|
232
|
-
|
|
233
|
-
| UT-001 | P0 | 正常 | ... | ... | ... | affected | ≤10s | 1 worker / ≤512MB | 30s | inputsHash + command |
|
|
234
|
-
| UT-002 | P0 | 异常 | ... | ... | 抛 xxxException | affected | ≤10s | 1 worker / ≤512MB | 30s | inputsHash + command |
|
|
235
|
-
| UT-003 | P1 | 边界 | ... | ... | ... | module | ≤60s | ≤50% CPU / ≤1GB | 120s | ledger identity |
|
|
231
|
+
| ID | 优先级 | 分类 | 场景描述 | 输入 | 预期 | 执行层级 | 预计时长 | 资源预算 | 超时 | 可复用证据 | 可执行测试 ID | 测试文件 | 测试标题 |
|
|
232
|
+
|:--:|:------:|:----:|----------|------|------|----------|----------|----------|------|------------|----------------|----------|----------|
|
|
233
|
+
| UT-001 | P0 | 正常 | ... | ... | ... | affected | ≤10s | 1 worker / ≤512MB | 30s | inputsHash + command | service::happy-path | tests/service.test.ts | returns expected result |
|
|
234
|
+
| UT-002 | P0 | 异常 | ... | ... | 抛 xxxException | affected | ≤10s | 1 worker / ≤512MB | 30s | inputsHash + command | service::invalid-input | tests/service.test.ts | rejects invalid input |
|
|
235
|
+
| UT-003 | P1 | 边界 | ... | ... | ... | module | ≤60s | ≤50% CPU / ≤1GB | 120s | ledger identity | service::boundary | tests/service.test.ts | handles boundary |
|
|
236
236
|
|
|
237
237
|
### 二、接口测试场景
|
|
238
238
|
|
|
239
239
|
#### 2.1 POST /xxx
|
|
240
240
|
|
|
241
|
-
| ID | 优先级 | 分类 | 场景描述 | 关键字段 | HTTP | code | message | 执行层级 | 预计时长 | 资源预算 | 超时 | 可复用证据 |
|
|
242
|
-
|
|
243
|
-
| API-001 | P0 | 正常 | ... | ... | 200 | 0 | 成功 | module | ≤60s | 1 service / ≤1GB | 120s | environmentHash + ledger |
|
|
244
|
-
| API-002 | P1 | 校验 | ... | ... | 200 | xxx | ... | affected | ≤20s | 1 service / ≤1GB | 60s | environmentHash + ledger |
|
|
241
|
+
| ID | 优先级 | 分类 | 场景描述 | 关键字段 | HTTP | code | message | 执行层级 | 预计时长 | 资源预算 | 超时 | 可复用证据 | 可执行测试 ID | 测试文件 | 测试标题 |
|
|
242
|
+
|:--:|:------:|:----:|----------|----------|:----:|:----:|--------|----------|----------|----------|------|------------|----------------|----------|----------|
|
|
243
|
+
| API-001 | P0 | 正常 | ... | ... | 200 | 0 | 成功 | module | ≤60s | 1 service / ≤1GB | 120s | environmentHash + ledger | api::success | tests/api.spec.ts | creates resource |
|
|
244
|
+
| API-002 | P1 | 校验 | ... | ... | 200 | xxx | ... | affected | ≤20s | 1 service / ≤1GB | 60s | environmentHash + ledger | api::validation | tests/api.spec.ts | rejects invalid body |
|
|
245
245
|
|
|
246
246
|
### 三、数据兼容场景
|
|
247
247
|
|
|
248
|
-
| ID | 优先级 | 分类 | 场景描述 | 操作 | 数据特征 | 预期 | 执行层级 | 预计时长 | 资源预算 | 超时 | 可复用证据 |
|
|
249
|
-
|
|
250
|
-
| COM-001 | P1 | 旧数据 | ... | ... | ... | ... | module | ≤60s | isolated DB / ≤1GB | 120s | dbSchemaHash + ledger |
|
|
248
|
+
| ID | 优先级 | 分类 | 场景描述 | 操作 | 数据特征 | 预期 | 执行层级 | 预计时长 | 资源预算 | 超时 | 可复用证据 | 可执行测试 ID | 测试文件 | 测试标题 |
|
|
249
|
+
|:--:|:------:|:----:|----------|:----:|----------|------|----------|----------|----------|------|------------|----------------|----------|----------|
|
|
250
|
+
| COM-001 | P1 | 旧数据 | ... | ... | ... | ... | module | ≤60s | isolated DB / ≤1GB | 120s | dbSchemaHash + ledger | db::legacy-row | tests/db-compat.spec.ts | reads legacy row |
|
|
251
251
|
|
|
252
252
|
### 四、集成场景
|
|
253
253
|
|
|
254
|
-
| ID | 优先级 | 分类 | 场景描述 | 前置条件 | 步骤 | 预期 | 执行层级 | 预计时长 | 资源预算 | 超时 | 可复用证据 |
|
|
255
|
-
|
|
256
|
-
| INT-001 | P0 | 端到端 | ... | ... | N 步操作 | ... | candidate | ≤10m | ≤50% CPU / ≤2GB | 15m | verification identity |
|
|
254
|
+
| ID | 优先级 | 分类 | 场景描述 | 前置条件 | 步骤 | 预期 | 执行层级 | 预计时长 | 资源预算 | 超时 | 可复用证据 | 可执行测试 ID | 测试文件 | 测试标题 |
|
|
255
|
+
|:--:|:------:|:----:|----------|----------|------|------|----------|----------|----------|------|------------|----------------|----------|----------|
|
|
256
|
+
| INT-001 | P0 | 端到端 | ... | ... | N 步操作 | ... | candidate | ≤10m | ≤50% CPU / ≤2GB | 15m | verification identity | e2e::workflow | tests/workflow.e2e.ts | completes workflow |
|
|
257
257
|
```
|
|
258
258
|
|
|
259
|
-
新计划必须显式使用 `ID
|
|
259
|
+
新计划必须显式使用 `ID`、`优先级`、`可执行测试 ID`、`测试文件`、`测试标题` 列;每个 P0/P1 场景都必须填写稳定的三元测试身份,缺任一字段时 plan finalize 返回 `PLAN_SCENARIO_EXECUTABLE_MAPPING_MISSING`。`P0/P1` 都要求结构化 runner receipt + ledger 证据,`P2` 才是 advisory。解析器兼容旧的 `#`、`分类`、`场景描述` 表头,旧表缺优先级时保守按 `P1` 处理。执行层级固定为 `affected`(快速反馈)、`module`(变更模块门禁)、`candidate`(产品候选)。禁止所有场景默认跑全仓库;无法给出预算或超时时必须说明原因,并拆分或隔离高成本场景。只有 command、inputs/toolchain/environment 身份一致,且 declared/selected/collected/executed/passed 闭环完整的成功 ledger 证据可以复用。
|
|
260
260
|
|
|
261
261
|
## 产物保存规则(跨阶段:阶段0.5/4/6/8)
|
|
262
262
|
|
|
@@ -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=4caa698ed8bc50c8; overlay=none; agent=cursor; do not edit -->
|
|
7
7
|
# harness-review — 代码审查
|
|
8
8
|
|
|
9
9
|
## Purpose
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: harness-run
|
|
3
3
|
description: 按变更簇执行 TDD 编码循环(RED→GREEN→REFACTOR→编译验证),逐变更簇实现计划中的任务。使用场景:开始编码、实现功能、写代码、TDD 编码
|
|
4
4
|
---
|
|
5
|
-
<!-- generated by harness_deploy.py; core=
|
|
5
|
+
<!-- generated by harness_deploy.py; core=4caa698ed8bc50c8; overlay=none; agent=cursor; do not edit -->
|
|
6
6
|
# harness-run — 需求编码
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
@@ -533,7 +533,7 @@ python <skills-root>/scripts/harness_ledger.py record --change-dir ".harness/cha
|
|
|
533
533
|
|
|
534
534
|
> 这样 harness-test 的 Phase 1 可读取 ledger 判断是否复用 run 的 unitTest(diffHash commit-invariant + reuse 规则 #2 允许 HEAD 前移 → run 的 checkpoint commit 不破坏复用),submit 也可复用 compile 结果。详见 `../protocols/ledger-protocol.md`。
|
|
535
535
|
>
|
|
536
|
-
> **Ledger v3
|
|
536
|
+
> **Ledger v3**:`record` 自动解析并强制顶层身份(`schemaVersion=3/repositoryId/changeName/baseCommit/currentHead/diffHash/ownershipHash`),缺字段非零退出、不写账本;已有 v1/v2 ledger 在写前透明迁移,`migrationHistory` 回执记录原/目标 schema 与迁移前后 evidence identity。无法迁移时返回 `LEDGER_MIGRATION_REQUIRED` 和确定性 `rerecordCommand`,不得半升级。v2 契约下 `--metrics-json` 必须通过 typed schema(unit=`total/passed/failed`,apiContract=`scenariosTotal/passed/failed`,browserE2E=`total/passed/failed`,dbCompatibility=`applicability(+reason)`)。详见 `../protocols/ledger-protocol.md` 第十节。
|
|
537
537
|
|
|
538
538
|
阶段边界:`harness_gate.py begin/close`;测试跟踪:`harness_test_guard.py begin/close`。close 失败不得用自然语言覆盖。
|
|
539
539
|
|
|
@@ -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=4caa698ed8bc50c8; overlay=none; agent=cursor; do not edit -->
|
|
7
7
|
# harness-submit — 最终提交(含 worktree 合并)
|
|
8
8
|
|
|
9
9
|
## Purpose
|
|
@@ -4,7 +4,7 @@ description: Use when the user asks to synchronize, refresh, or validate Harness
|
|
|
4
4
|
metadata, adapters, knowledge, rules, instruction entrypoints, config origins,
|
|
5
5
|
or CodeGraph status.
|
|
6
6
|
---
|
|
7
|
-
<!-- generated by harness_deploy.py; core=
|
|
7
|
+
<!-- generated by harness_deploy.py; core=4caa698ed8bc50c8; overlay=none; agent=cursor; do not edit -->
|
|
8
8
|
# harness-sync
|
|
9
9
|
|
|
10
10
|
## Purpose
|
|
@@ -13,13 +13,10 @@ description: Use when the user asks to synchronize, refresh, or validate Harness
|
|
|
13
13
|
|
|
14
14
|
## Before running
|
|
15
15
|
|
|
16
|
-
读取 `reference.md
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
工作流要求 `sync@1`、`rules-sync@1`、`rules-review@1`、`knowledge-sync@2`。`BLOCKED_CAPABILITY_MISMATCH` 属环境阻塞,不得降级为手工拼接旧流程。
|
|
16
|
+
读取 `reference.md`。`sync` 自身会在任何重操作之前完成能力握手;不要另起一个
|
|
17
|
+
`capabilities` 进程。工作流要求 `sync@2`、`rules-sync@1`、`rules-review@1`、
|
|
18
|
+
`knowledge-sync@3`、`codegraph-status@2`。`BLOCKED_CAPABILITY_MISMATCH` 属环境阻塞,
|
|
19
|
+
不得降级为手工拼接旧流程。
|
|
23
20
|
|
|
24
21
|
## Run
|
|
25
22
|
|
|
@@ -29,17 +26,26 @@ npx hunter-harness sync --project <项目路径> --profile interactive --progres
|
|
|
29
26
|
|
|
30
27
|
CLI 负责 Python runtime 解析、投影事务、knowledge、rules、map、指令图、配置来源、change 状态及 CodeGraph 证据汇总。禁止直接调用内部 Python 脚本,禁止使用固定 `HEAD~5`,禁止自动全量重建 CodeGraph。
|
|
31
28
|
|
|
32
|
-
|
|
29
|
+
只读诊断使用 `--check`(`--dry-run` 为兼容别名);它不得写报告、receipt 或投影。
|
|
30
|
+
长阶段的 heartbeat 写 stderr;stdout 只保留紧凑摘要。完整报告写入摘要中的
|
|
31
|
+
`reportPath`,并带 `reportSha256`。需要组件级证据时显式加 `--verbose`,不得默认把完整
|
|
32
|
+
JSON 报告回显到对话。
|
|
33
|
+
|
|
34
|
+
摘要中的 `remediations[]` 是稳定修复契约。先用对应 `previewCommand` 预览;低风险修复用
|
|
35
|
+
`--apply safe`,指定修复用 `--fix <id>`。需覆盖受管投影的修复必须同时提供 `--yes`,
|
|
36
|
+
并依赖 refresh 事务留下的 before snapshot;不允许绕过确认或无备份覆盖。指定修复时,
|
|
37
|
+
无关组件只做只读评估,不得顺带写入。
|
|
33
38
|
|
|
34
39
|
## Interpret
|
|
35
40
|
|
|
36
41
|
- `OK`:所有可验证组件通过。
|
|
42
|
+
- `ADVISORY`:索引最新,但有待评审候选等非阻塞健康提示;退出码仍为 0。
|
|
37
43
|
- `WARN`:存在过期、冲突、待评审或 `UNKNOWN` 证据;按 `reportPath` 中的 `nextAction` 处理。
|
|
38
44
|
- `FAIL`:组件执行失败;不得宣称同步完成。
|
|
39
45
|
- `BLOCKED`:runtime、项目状态或能力契约阻塞;先修复阻塞条件。
|
|
40
46
|
- `UNKNOWN`:证据不足,不等于成功,也不触发无界重建。
|
|
41
47
|
|
|
42
|
-
非交互或 CI 使用 `--profile general --progress jsonl --json`,不得等待规则候选确认。交互式运行若报告规则待评审,再按 `reference.md` 的显式入口处理。
|
|
48
|
+
非交互或 CI 使用 `--check --profile general --progress jsonl --json`,不得等待规则候选确认。交互式运行若报告规则待评审,再按 `reference.md` 的显式入口处理。
|
|
43
49
|
|
|
44
50
|
## Safety
|
|
45
51
|
|
|
@@ -6,13 +6,8 @@ description: harness-sync 的能力契约、统一状态模型、报告收据和
|
|
|
6
6
|
|
|
7
7
|
## 1. 能力握手
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
```powershell
|
|
12
|
-
npx hunter-harness capabilities --json
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
工作流 family manifest 声明 `minimumCliVersion` 和 `capabilities`。CLI 在任何高成本阶段之前核对版本与能力;缺失时返回:
|
|
9
|
+
工作流 family manifest 声明 `minimumCliVersion` 和 `capabilities`。`sync` 在任何高成本
|
|
10
|
+
阶段之前自行核对版本与能力;Skill 不要再运行独立的 `capabilities` 子进程。缺失时返回:
|
|
16
11
|
|
|
17
12
|
```json
|
|
18
13
|
{
|
|
@@ -47,22 +42,41 @@ npx hunter-harness sync --project <项目路径> --profile interactive --progres
|
|
|
47
42
|
CI/非交互式:
|
|
48
43
|
|
|
49
44
|
```powershell
|
|
50
|
-
npx hunter-harness sync --project <项目路径> --profile general --progress jsonl --json
|
|
45
|
+
npx hunter-harness sync --check --project <项目路径> --profile general --progress jsonl --json
|
|
51
46
|
```
|
|
52
47
|
|
|
53
|
-
`--dry-run`
|
|
48
|
+
`--check` 是严格只读检查;`--dry-run` 是兼容别名。两者都不生成持久报告、receipt 或
|
|
49
|
+
投影。每个长阶段通过 stderr 输出受限 heartbeat;stdout 默认只输出:
|
|
54
50
|
|
|
55
51
|
```json
|
|
56
52
|
{
|
|
57
53
|
"status": "WARN",
|
|
58
54
|
"runId": "<run-id>",
|
|
59
|
-
"components": {"ok": 7, "
|
|
55
|
+
"components": {"ok": 7, "advisory": 1, "warn": 0, "fail": 0, "blocked": 0, "unknown": 0},
|
|
56
|
+
"versions": {
|
|
57
|
+
"cliVersion": "0.0.0",
|
|
58
|
+
"workflowBundleVersion": "0.0.0",
|
|
59
|
+
"adapterBundleVersions": {}
|
|
60
|
+
},
|
|
61
|
+
"remediations": [],
|
|
60
62
|
"reportPath": ".harness/runtime/sync/<run-id>/reports/sync-report.json",
|
|
61
63
|
"reportSha256": "<sha256>"
|
|
62
64
|
}
|
|
63
65
|
```
|
|
64
66
|
|
|
65
|
-
|
|
67
|
+
只读检查的 `reportPath/reportSha256` 为 `null`。详细报告必须受大小限制,并包含每个组件
|
|
68
|
+
的 `status`、`reasonCode`、`observedAt`、`durationMs`、输入/输出 hash、证据、是否自动
|
|
69
|
+
修复及 `nextAction`;只有显式 `--verbose` 才把组件级详情写到 stdout。
|
|
70
|
+
|
|
71
|
+
### 结构化修复
|
|
72
|
+
|
|
73
|
+
- `remediations[]` 含稳定 `id`、风险、写入范围、备份/回滚说明、预计耗时、是否需确认、
|
|
74
|
+
`previewCommand` 与 `applyCommand`。
|
|
75
|
+
- `--apply safe` 只执行低风险、无需确认的修复。
|
|
76
|
+
- `--fix <id>` 只执行该项;需要覆盖受管 Adapter 时必须加 `--yes`。
|
|
77
|
+
- 指定修复时,其他组件仍参与诊断但保持只读。
|
|
78
|
+
- Adapter 覆盖由 refresh 事务执行,before snapshot 位于最新 committed refresh
|
|
79
|
+
transaction;事务失败会自动回滚。预览永远不得产生写入。
|
|
66
80
|
|
|
67
81
|
## 4. 组件状态
|
|
68
82
|
|
|
@@ -77,15 +91,21 @@ npx hunter-harness sync --project <项目路径> --profile general --progress js
|
|
|
77
91
|
| instruction graph | 入口、include 边、环、主题可达性 | 缺失引用或循环为 `FAIL` |
|
|
78
92
|
| config origins | canonical/projection 路径与 hash | 漂移 `WARN`,不静默覆盖 |
|
|
79
93
|
| changes | 五态分类及归档收据 | `INVALID`/`ORPHAN` 不自动删除 |
|
|
80
|
-
| CodeGraph |
|
|
94
|
+
| CodeGraph | `codegraph status --json` 的 pending、数据库观察时间、watcher 可达性 | 输出 `CURRENT/PENDING/STALE/INDEX_PRESENT_UNVERIFIED/MISSING/UNKNOWN`;日志 mtime 只证明 watcher 活动,不证明索引完成;不自动全量 reindex |
|
|
81
95
|
|
|
82
|
-
全局状态优先级:`BLOCKED` → `FAIL` → `WARN` → `OK`。任一 `UNKNOWN`
|
|
96
|
+
全局状态优先级:`BLOCKED` → `FAIL` → `WARN` → `ADVISORY` → `OK`。任一 `UNKNOWN`
|
|
97
|
+
至少使全局结果为 `WARN`。knowledge freshness 与 health 分开:索引一致但仍有待裁决候选时
|
|
98
|
+
为 `ADVISORY`,不得误报为过期。
|
|
83
99
|
|
|
84
100
|
## 5. Git 与 CodeGraph
|
|
85
101
|
|
|
86
102
|
增量基线来自上次成功 sync receipt 的 `headCommit`。首次运行或 receipt 不可用时,仅收集当前 HEAD 和有界文件统计;禁止固定 `HEAD~5`。
|
|
87
103
|
|
|
88
|
-
CodeGraph
|
|
104
|
+
CodeGraph 状态探测优先读取 `codegraph status --json` 的权威 pending 列表;只有该 API
|
|
105
|
+
不可用时才退回受限文件扫描,并把来源标成 `database-scan` 或 `unverified`。`.agents/`、
|
|
106
|
+
`.cursor/`、`.claude/` 等 Adapter 投影和 Markdown 文档不计入源码 pending。daemon log
|
|
107
|
+
mtime 只写入 `watcherObservedAt`,不能冒充 `indexObservedAt`。只有服务可达、watcher 已
|
|
108
|
+
启用且权威 `pendingFileCount=0` 时为 `CURRENT`。不要在 sync 内执行全量索引。
|
|
89
109
|
|
|
90
110
|
## 6. Instruction graph
|
|
91
111
|
|
|
@@ -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=4caa698ed8bc50c8; overlay=none; agent=cursor; do not edit -->
|
|
6
6
|
# harness-test — 测试执行
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
@@ -70,6 +70,8 @@ python harness/scripts/harness_test_runner.py unittest --profile safe --tests-di
|
|
|
70
70
|
|
|
71
71
|
Runner 强制同项目单实例、低调度优先级、逐命令超时、正常结束和异常结束的进程树清理。`HARNESS_TEST_MAX_WORKERS` 默认且最高为 `2`,只能调低,不能调高;技术栈自身的并发参数也必须收敛到该值。Windows detached-service 模块在执行前先做 nested-breakaway 能力探测,受限沙箱不支持时立即返回 `DETACHED_PROCESS_CAPABILITY_UNAVAILABLE`,不得让每个服务用例逐一超时。出现该错误、`TEST_RUN_ALREADY_ACTIVE`、`PROCESS_TREE_ISOLATION_UNAVAILABLE` 或 `TEST_COMMAND_TIMEOUT` 必须停止,不得绕过 Runner 重跑裸命令。完整约束见 `checklist.md`「0.0-A 资源安全档位」。
|
|
72
72
|
|
|
73
|
+
动态数据库/Redis/令牌字段必须先由 `harness_environment.py prepare` 生成 secret-free receipt,再用 `exec --environment-receipt <file> --required-environment-field <NAME>` 闭包注入;缺失或指纹变化在启动测试前返回 `VERIFICATION_ENVIRONMENT_INCOMPLETE`。复杂 JSON、Docker template 或含引号参数不得跨多层 `-Command` 传递,改用 `exec --argv-file <utf8-json> --runtime-receipt <file>`;参数文件记录 PowerShell edition/version,运行回执只存 argv hash。`harness_service.py ensure` 属于正式持久服务模式,禁止从 bounded runner 内启动;命中时返回 `PERSISTENT_SERVICE_MODE_REQUIRED`。
|
|
74
|
+
|
|
73
75
|
### Phase 0:环境准备(主会话执行,需要交互确认)
|
|
74
76
|
|
|
75
77
|
先 `harness_context.py prepare --phase test --executor <tool> [--change <id>] --json`,再 `harness_context.py begin --phase test --change <id> --executor <tool> --json` 校验最新 run→test receipt 的 artifact/hash/HEAD;然后 **`harness_gate.py begin --phase test --change <id>`**(禁止手工 phase.start / 手写 ledger)。执行各项强制环境检查 + **命令执行模式 preflight (0.1)**;只有首选执行器不可用时,才执行 fallback 执行器探测。
|
|
@@ -109,6 +109,16 @@ powershell.exe -NoProfile -ExecutionPolicy Bypass -File "harness-skills/harness-
|
|
|
109
109
|
- generatedFiles:archive 过程中生成的文件数;
|
|
110
110
|
- totalArchiveFiles:归档目录最终文件总数。
|
|
111
111
|
|
|
112
|
+
## Durable archive
|
|
113
|
+
|
|
114
|
+
同一工作区内从 `changes/` move 到 `archive/` 只属于 local archive。需要抗工作区删除时,finalize 必须配置独立 `--durable-root`:
|
|
115
|
+
|
|
116
|
+
- payload 以整树 digest 写入 `<durable-root>/objects/sha256/<digest>/payload/`,对象不可变且可内容寻址;
|
|
117
|
+
- `<durable-root>/receipts/<archive-id>.json` 记录 digest、来源 identity、保留策略与验证时间;
|
|
118
|
+
- durable 写入采用 staging → hash/readback verify → atomic publish;失败时保留原 change,且不得留下可被误认成功的 local archive;
|
|
119
|
+
- `restore-durable` 先验证 receipt 与对象 digest,只恢复到不存在的目标,完成后再次比对整树 digest;
|
|
120
|
+
- 成功状态区分 `ARCHIVED_DURABLE` 与 `ARCHIVED_LOCAL_ONLY`,后者必须进入 knownRisks。
|
|
121
|
+
|
|
112
122
|
## 页面内容
|
|
113
123
|
|
|
114
124
|
final-summary 必须突出:
|
|
@@ -351,3 +351,15 @@ v2 契约下 `record` 写入前强制解析并校验顶层身份字段,缺失
|
|
|
351
351
|
### 10.4 原子写入
|
|
352
352
|
|
|
353
353
|
`write_ledger` 采用 tmp → fsync → `os.replace`;replace 失败时旧账本字节不变、不留 `.tmp` 残骸。所有写路径(record / 其他命令)统一走原子写。
|
|
354
|
+
|
|
355
|
+
### 10.5 写前透明迁移
|
|
356
|
+
|
|
357
|
+
Reader 继续读取当前 v3 与前一支持窗口 v2(并保守识别无 schema 的 v1)。已有 schemaVersion 2 ledger,或显式携带 identity 参数的 legacy ledger,再次 `record` 时必须先完成身份迁移再修改任何 evidence;无 schema 且未显式请求 identity 的旧调用继续保持兼容行为:
|
|
358
|
+
|
|
359
|
+
- 解析 repository/change/base/current/diff/ownership identity,目标固定为 schemaVersion 3;
|
|
360
|
+
- 对 `validations`、`verificationTargets`、`integration`、`artifacts` 生成迁移前 evidence identity;
|
|
361
|
+
- 迁移只增加 schema/identity 元数据,迁移后 evidence identity 必须完全相同;
|
|
362
|
+
- 把 receipt 原子嵌入 `migrationHistory[]`,记录 original/target schema、before/after identity 与 `receiptId`;
|
|
363
|
+
- 版本超出支持窗口、仓库/ownership/diff 无法确认、或 evidence identity 漂移时不写文件,返回 `LEDGER_MIGRATION_REQUIRED` 与参数数组形式的 `rerecordCommand`。
|
|
364
|
+
|
|
365
|
+
submit/review/test/archive 只能通过 `harness_ledger.py` 读取/写入,禁止各自实现 schema 猜测或手工改 ledger。
|
|
@@ -195,3 +195,24 @@ Windows 默认常为 Windows PowerShell **5.1**。下列特性在 5.1 不可用
|
|
|
195
195
|
|
|
196
196
|
- 非 ASCII 路径(含中文)仓库:git/构建/文件操作一律 PowerShell;Bash 被 hook 拒绝(如 `Denied: non-ASCII path`)后**立即**改用 PowerShell 重发等价命令,禁止原样重试 Bash。
|
|
197
197
|
- Maven `-D` 参数在 PowerShell 中加引号:`"-Dmaven.test.skip=true"`。
|
|
198
|
+
|
|
199
|
+
## 13. PS5/PS7 原生参数合同
|
|
200
|
+
|
|
201
|
+
复杂 JSON、Docker Go template、here-string 内容及多层引号不得作为 native process 的内联参数跨 `Bash → powershell -Command → native executable` 传递。统一写 UTF-8 JSON 参数文件:
|
|
202
|
+
|
|
203
|
+
```json
|
|
204
|
+
{
|
|
205
|
+
"schemaVersion": 1,
|
|
206
|
+
"transport": "utf8-json-argument-file",
|
|
207
|
+
"argv": ["python", "tool.py", "--template", "{{json .State}}"],
|
|
208
|
+
"powershell": {"edition": "Desktop", "version": "5.1"}
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
执行入口:
|
|
213
|
+
|
|
214
|
+
```powershell
|
|
215
|
+
python harness/scripts/harness_test_runner.py exec --argv-file <file> --runtime-receipt <receipt>
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Runner 直接把 `argv[]` 传给 native process(`shell=False`),不重新拼接或解析命令文本。PowerShell Desktop 5.1 与 Core 7 使用同一参数文件必须产生相同 argv。运行回执记录 edition/version、参数数量和 argv SHA-256,不写原始参数,避免凭证或模板内容泄漏。
|
|
@@ -4,6 +4,17 @@ description: harness .harness 状态目录分层协议。用于减少根目录
|
|
|
4
4
|
|
|
5
5
|
# State Layout Protocol
|
|
6
6
|
|
|
7
|
+
## 升级与本地状态保护边界
|
|
8
|
+
|
|
9
|
+
`.harness/archive/`、`.harness/changes/`、`.harness/knowledge/project-local/` 是 protected local roots。CLI init/configure/refresh/rules 操作前必须:
|
|
10
|
+
|
|
11
|
+
1. 综合 project marker、adapter `.harness-build.json`、managed block、恢复事务和非空 `.harness` 判断 `absent / valid / partial / recovery-required`;
|
|
12
|
+
2. 对 protected roots 记录文件数、目录数、字节数、Merkle root,以及 archive 首末 identity;
|
|
13
|
+
3. 事务 journal 声明每个允许修改的路径;任何未声明的 protected-root mutation 立即回滚;
|
|
14
|
+
4. partial 或 recovery-required 状态 fail closed,输出 sentinels、inventory 与恢复指引,禁止当成空项目自动 init。
|
|
15
|
+
|
|
16
|
+
事务提交前后 protected inventory 必须一致;除非当前命令显式以该 protected root 为操作目标。删除 `project.yaml` 但保留 archive,或删除 `.harness` 但保留 adapter marker,均属于 partial state,不是首次安装。
|
|
17
|
+
|
|
7
18
|
## 目标
|
|
8
19
|
|
|
9
20
|
`.harness/changes/<change-name>/` 是变更状态真相源,但根目录不得继续堆放所有文件。新产物按子目录分层;旧路径保留读取兼容。
|