@hunter-harness/workflow-harness 0.2.9 → 0.2.10
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/reference.md +12 -2
- package/harness/bundles/general/claude-code/harness-archive/templates/summary-data-template.json +6 -2
- package/harness/bundles/general/claude-code/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-knowledge-ingest/SKILL.md +3 -1
- package/harness/bundles/general/claude-code/harness-knowledge-ingest/reference.md +7 -0
- package/harness/bundles/general/claude-code/harness-knowledge-ingest/scripts/harness_knowledge.py +117 -0
- 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-review/SKILL.md +3 -3
- package/harness/bundles/general/claude-code/harness-run/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-run/reference.md +2 -0
- package/harness/bundles/general/claude-code/harness-submit/SKILL.md +15 -10
- package/harness/bundles/general/claude-code/harness-submit/checklist.md +40 -76
- package/harness/bundles/general/claude-code/harness-sync/SKILL.md +17 -2
- package/harness/bundles/general/claude-code/harness-sync/reference.md +2 -2
- package/harness/bundles/general/claude-code/harness-test/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-test/reference.md +2 -0
- package/harness/bundles/general/claude-code/protocols/archive-report-protocol.md +24 -4
- package/harness/bundles/general/claude-code/protocols/ledger-protocol.md +36 -0
- package/harness/bundles/general/claude-code/protocols/state-layout-protocol.md +15 -0
- package/harness/bundles/general/claude-code/scripts/harness_archive.py +803 -274
- package/harness/bundles/general/claude-code/scripts/harness_change.py +18 -0
- package/harness/bundles/general/claude-code/scripts/harness_deploy.py +1 -44
- package/harness/bundles/general/claude-code/scripts/harness_events.py +104 -6
- package/harness/bundles/general/claude-code/scripts/harness_gate.py +25 -4
- package/harness/bundles/general/claude-code/scripts/harness_integration.py +878 -0
- package/harness/bundles/general/claude-code/scripts/harness_ledger.py +440 -10
- package/harness/bundles/general/claude-code/scripts/harness_paths.py +315 -0
- package/harness/bundles/general/claude-code/scripts/harness_profile.py +45 -0
- package/harness/bundles/general/claude-code/scripts/harness_review.py +326 -0
- package/harness/bundles/general/claude-code/scripts/harness_sync.py +407 -0
- package/harness/bundles/general/claude-code/scripts/harness_test_guard.py +244 -49
- 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/reference.md +12 -2
- package/harness/bundles/general/codebuddy/harness-archive/templates/summary-data-template.json +6 -2
- package/harness/bundles/general/codebuddy/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-knowledge-ingest/SKILL.md +3 -1
- package/harness/bundles/general/codebuddy/harness-knowledge-ingest/reference.md +7 -0
- package/harness/bundles/general/codebuddy/harness-knowledge-ingest/scripts/harness_knowledge.py +117 -0
- 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-review/SKILL.md +3 -3
- package/harness/bundles/general/codebuddy/harness-run/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-run/reference.md +2 -0
- package/harness/bundles/general/codebuddy/harness-submit/SKILL.md +15 -10
- package/harness/bundles/general/codebuddy/harness-submit/checklist.md +40 -76
- package/harness/bundles/general/codebuddy/harness-sync/SKILL.md +17 -2
- package/harness/bundles/general/codebuddy/harness-sync/reference.md +2 -2
- package/harness/bundles/general/codebuddy/harness-test/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-test/reference.md +2 -0
- package/harness/bundles/general/codebuddy/protocols/archive-report-protocol.md +24 -4
- package/harness/bundles/general/codebuddy/protocols/ledger-protocol.md +36 -0
- package/harness/bundles/general/codebuddy/protocols/state-layout-protocol.md +15 -0
- package/harness/bundles/general/codebuddy/scripts/harness_archive.py +803 -274
- package/harness/bundles/general/codebuddy/scripts/harness_change.py +18 -0
- package/harness/bundles/general/codebuddy/scripts/harness_deploy.py +1 -44
- package/harness/bundles/general/codebuddy/scripts/harness_events.py +104 -6
- package/harness/bundles/general/codebuddy/scripts/harness_gate.py +25 -4
- package/harness/bundles/general/codebuddy/scripts/harness_integration.py +878 -0
- package/harness/bundles/general/codebuddy/scripts/harness_ledger.py +440 -10
- package/harness/bundles/general/codebuddy/scripts/harness_paths.py +315 -0
- package/harness/bundles/general/codebuddy/scripts/harness_profile.py +45 -0
- package/harness/bundles/general/codebuddy/scripts/harness_review.py +326 -0
- package/harness/bundles/general/codebuddy/scripts/harness_sync.py +407 -0
- package/harness/bundles/general/codebuddy/scripts/harness_test_guard.py +244 -49
- 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/reference.md +12 -2
- package/harness/bundles/general/codex/harness-archive/templates/summary-data-template.json +6 -2
- package/harness/bundles/general/codex/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-knowledge-ingest/SKILL.md +3 -1
- package/harness/bundles/general/codex/harness-knowledge-ingest/reference.md +7 -0
- package/harness/bundles/general/codex/harness-knowledge-ingest/scripts/harness_knowledge.py +117 -0
- 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-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 +2 -0
- package/harness/bundles/general/codex/harness-submit/SKILL.md +15 -10
- package/harness/bundles/general/codex/harness-submit/checklist.md +40 -76
- package/harness/bundles/general/codex/harness-sync/SKILL.md +17 -2
- package/harness/bundles/general/codex/harness-sync/reference.md +2 -2
- package/harness/bundles/general/codex/harness-test/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-test/reference.md +2 -0
- package/harness/bundles/general/codex/protocols/archive-report-protocol.md +24 -4
- package/harness/bundles/general/codex/protocols/ledger-protocol.md +36 -0
- package/harness/bundles/general/codex/protocols/state-layout-protocol.md +15 -0
- package/harness/bundles/general/codex/scripts/harness_archive.py +803 -274
- package/harness/bundles/general/codex/scripts/harness_change.py +18 -0
- package/harness/bundles/general/codex/scripts/harness_deploy.py +1 -44
- package/harness/bundles/general/codex/scripts/harness_events.py +104 -6
- package/harness/bundles/general/codex/scripts/harness_gate.py +25 -4
- package/harness/bundles/general/codex/scripts/harness_integration.py +878 -0
- package/harness/bundles/general/codex/scripts/harness_ledger.py +440 -10
- package/harness/bundles/general/codex/scripts/harness_paths.py +315 -0
- package/harness/bundles/general/codex/scripts/harness_profile.py +45 -0
- package/harness/bundles/general/codex/scripts/harness_review.py +326 -0
- package/harness/bundles/general/codex/scripts/harness_sync.py +407 -0
- package/harness/bundles/general/codex/scripts/harness_test_guard.py +244 -49
- 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/reference.md +12 -2
- package/harness/bundles/general/cursor/harness-archive/templates/summary-data-template.json +6 -2
- package/harness/bundles/general/cursor/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-knowledge-ingest/SKILL.md +3 -1
- package/harness/bundles/general/cursor/harness-knowledge-ingest/reference.md +7 -0
- package/harness/bundles/general/cursor/harness-knowledge-ingest/scripts/harness_knowledge.py +117 -0
- 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-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 +2 -0
- package/harness/bundles/general/cursor/harness-submit/SKILL.md +15 -10
- package/harness/bundles/general/cursor/harness-submit/checklist.md +40 -76
- package/harness/bundles/general/cursor/harness-sync/SKILL.md +17 -2
- package/harness/bundles/general/cursor/harness-sync/reference.md +2 -2
- package/harness/bundles/general/cursor/harness-test/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-test/reference.md +2 -0
- package/harness/bundles/general/cursor/protocols/archive-report-protocol.md +24 -4
- package/harness/bundles/general/cursor/protocols/ledger-protocol.md +36 -0
- package/harness/bundles/general/cursor/protocols/state-layout-protocol.md +15 -0
- package/harness/bundles/general/cursor/scripts/harness_archive.py +803 -274
- package/harness/bundles/general/cursor/scripts/harness_change.py +18 -0
- package/harness/bundles/general/cursor/scripts/harness_deploy.py +1 -44
- package/harness/bundles/general/cursor/scripts/harness_events.py +104 -6
- package/harness/bundles/general/cursor/scripts/harness_gate.py +25 -4
- package/harness/bundles/general/cursor/scripts/harness_integration.py +878 -0
- package/harness/bundles/general/cursor/scripts/harness_ledger.py +440 -10
- package/harness/bundles/general/cursor/scripts/harness_paths.py +315 -0
- package/harness/bundles/general/cursor/scripts/harness_profile.py +45 -0
- package/harness/bundles/general/cursor/scripts/harness_review.py +326 -0
- package/harness/bundles/general/cursor/scripts/harness_sync.py +407 -0
- package/harness/bundles/general/cursor/scripts/harness_test_guard.py +244 -49
- 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/reference.md +12 -2
- package/harness/bundles/java/claude-code/harness-archive/templates/summary-data-template.json +6 -2
- package/harness/bundles/java/claude-code/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-knowledge-ingest/SKILL.md +3 -1
- package/harness/bundles/java/claude-code/harness-knowledge-ingest/reference.md +7 -0
- package/harness/bundles/java/claude-code/harness-knowledge-ingest/scripts/harness_knowledge.py +117 -0
- 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-review/SKILL.md +3 -3
- package/harness/bundles/java/claude-code/harness-run/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-submit/SKILL.md +15 -10
- package/harness/bundles/java/claude-code/harness-submit/checklist.md +40 -76
- package/harness/bundles/java/claude-code/harness-sync/SKILL.md +17 -2
- package/harness/bundles/java/claude-code/harness-sync/reference.md +2 -2
- package/harness/bundles/java/claude-code/harness-test/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/protocols/archive-report-protocol.md +24 -4
- package/harness/bundles/java/claude-code/protocols/ledger-protocol.md +36 -0
- package/harness/bundles/java/claude-code/protocols/state-layout-protocol.md +15 -0
- package/harness/bundles/java/claude-code/scripts/harness_archive.py +803 -274
- package/harness/bundles/java/claude-code/scripts/harness_change.py +18 -0
- package/harness/bundles/java/claude-code/scripts/harness_deploy.py +1 -44
- package/harness/bundles/java/claude-code/scripts/harness_events.py +104 -6
- package/harness/bundles/java/claude-code/scripts/harness_gate.py +25 -4
- package/harness/bundles/java/claude-code/scripts/harness_integration.py +878 -0
- package/harness/bundles/java/claude-code/scripts/harness_ledger.py +440 -10
- package/harness/bundles/java/claude-code/scripts/harness_paths.py +315 -0
- package/harness/bundles/java/claude-code/scripts/harness_profile.py +45 -0
- package/harness/bundles/java/claude-code/scripts/harness_review.py +326 -0
- package/harness/bundles/java/claude-code/scripts/harness_sync.py +407 -0
- package/harness/bundles/java/claude-code/scripts/harness_test_guard.py +244 -49
- 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/reference.md +12 -2
- package/harness/bundles/java/codebuddy/harness-archive/templates/summary-data-template.json +6 -2
- package/harness/bundles/java/codebuddy/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-knowledge-ingest/SKILL.md +3 -1
- package/harness/bundles/java/codebuddy/harness-knowledge-ingest/reference.md +7 -0
- package/harness/bundles/java/codebuddy/harness-knowledge-ingest/scripts/harness_knowledge.py +117 -0
- 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-review/SKILL.md +3 -3
- package/harness/bundles/java/codebuddy/harness-run/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-submit/SKILL.md +15 -10
- package/harness/bundles/java/codebuddy/harness-submit/checklist.md +40 -76
- package/harness/bundles/java/codebuddy/harness-sync/SKILL.md +17 -2
- package/harness/bundles/java/codebuddy/harness-sync/reference.md +2 -2
- package/harness/bundles/java/codebuddy/harness-test/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/protocols/archive-report-protocol.md +24 -4
- package/harness/bundles/java/codebuddy/protocols/ledger-protocol.md +36 -0
- package/harness/bundles/java/codebuddy/protocols/state-layout-protocol.md +15 -0
- package/harness/bundles/java/codebuddy/scripts/harness_archive.py +803 -274
- package/harness/bundles/java/codebuddy/scripts/harness_change.py +18 -0
- package/harness/bundles/java/codebuddy/scripts/harness_deploy.py +1 -44
- package/harness/bundles/java/codebuddy/scripts/harness_events.py +104 -6
- package/harness/bundles/java/codebuddy/scripts/harness_gate.py +25 -4
- package/harness/bundles/java/codebuddy/scripts/harness_integration.py +878 -0
- package/harness/bundles/java/codebuddy/scripts/harness_ledger.py +440 -10
- package/harness/bundles/java/codebuddy/scripts/harness_paths.py +315 -0
- package/harness/bundles/java/codebuddy/scripts/harness_profile.py +45 -0
- package/harness/bundles/java/codebuddy/scripts/harness_review.py +326 -0
- package/harness/bundles/java/codebuddy/scripts/harness_sync.py +407 -0
- package/harness/bundles/java/codebuddy/scripts/harness_test_guard.py +244 -49
- 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/reference.md +12 -2
- package/harness/bundles/java/codex/harness-archive/templates/summary-data-template.json +6 -2
- package/harness/bundles/java/codex/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-knowledge-ingest/SKILL.md +3 -1
- package/harness/bundles/java/codex/harness-knowledge-ingest/reference.md +7 -0
- package/harness/bundles/java/codex/harness-knowledge-ingest/scripts/harness_knowledge.py +117 -0
- 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-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 +15 -10
- package/harness/bundles/java/codex/harness-submit/checklist.md +40 -76
- package/harness/bundles/java/codex/harness-sync/SKILL.md +17 -2
- package/harness/bundles/java/codex/harness-sync/reference.md +2 -2
- package/harness/bundles/java/codex/harness-test/SKILL.md +1 -1
- package/harness/bundles/java/codex/protocols/archive-report-protocol.md +24 -4
- package/harness/bundles/java/codex/protocols/ledger-protocol.md +36 -0
- package/harness/bundles/java/codex/protocols/state-layout-protocol.md +15 -0
- package/harness/bundles/java/codex/scripts/harness_archive.py +803 -274
- package/harness/bundles/java/codex/scripts/harness_change.py +18 -0
- package/harness/bundles/java/codex/scripts/harness_deploy.py +1 -44
- package/harness/bundles/java/codex/scripts/harness_events.py +104 -6
- package/harness/bundles/java/codex/scripts/harness_gate.py +25 -4
- package/harness/bundles/java/codex/scripts/harness_integration.py +878 -0
- package/harness/bundles/java/codex/scripts/harness_ledger.py +440 -10
- package/harness/bundles/java/codex/scripts/harness_paths.py +315 -0
- package/harness/bundles/java/codex/scripts/harness_profile.py +45 -0
- package/harness/bundles/java/codex/scripts/harness_review.py +326 -0
- package/harness/bundles/java/codex/scripts/harness_sync.py +407 -0
- package/harness/bundles/java/codex/scripts/harness_test_guard.py +244 -49
- 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/reference.md +12 -2
- package/harness/bundles/java/cursor/harness-archive/templates/summary-data-template.json +6 -2
- package/harness/bundles/java/cursor/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-knowledge-ingest/SKILL.md +3 -1
- package/harness/bundles/java/cursor/harness-knowledge-ingest/reference.md +7 -0
- package/harness/bundles/java/cursor/harness-knowledge-ingest/scripts/harness_knowledge.py +117 -0
- 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-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 +15 -10
- package/harness/bundles/java/cursor/harness-submit/checklist.md +40 -76
- package/harness/bundles/java/cursor/harness-sync/SKILL.md +17 -2
- package/harness/bundles/java/cursor/harness-sync/reference.md +2 -2
- package/harness/bundles/java/cursor/harness-test/SKILL.md +1 -1
- package/harness/bundles/java/cursor/protocols/archive-report-protocol.md +24 -4
- package/harness/bundles/java/cursor/protocols/ledger-protocol.md +36 -0
- package/harness/bundles/java/cursor/protocols/state-layout-protocol.md +15 -0
- package/harness/bundles/java/cursor/scripts/harness_archive.py +803 -274
- package/harness/bundles/java/cursor/scripts/harness_change.py +18 -0
- package/harness/bundles/java/cursor/scripts/harness_deploy.py +1 -44
- package/harness/bundles/java/cursor/scripts/harness_events.py +104 -6
- package/harness/bundles/java/cursor/scripts/harness_gate.py +25 -4
- package/harness/bundles/java/cursor/scripts/harness_integration.py +878 -0
- package/harness/bundles/java/cursor/scripts/harness_ledger.py +440 -10
- package/harness/bundles/java/cursor/scripts/harness_paths.py +315 -0
- package/harness/bundles/java/cursor/scripts/harness_profile.py +45 -0
- package/harness/bundles/java/cursor/scripts/harness_review.py +326 -0
- package/harness/bundles/java/cursor/scripts/harness_sync.py +407 -0
- package/harness/bundles/java/cursor/scripts/harness_test_guard.py +244 -49
- package/harness/manifests/general/claude-code.json +47 -31
- package/harness/manifests/general/codebuddy.json +47 -31
- package/harness/manifests/general/codex.json +47 -31
- package/harness/manifests/general/cursor.json +47 -31
- package/harness/manifests/java/claude-code.json +47 -31
- package/harness/manifests/java/codebuddy.json +47 -31
- package/harness/manifests/java/codex.json +47 -31
- package/harness/manifests/java/cursor.json +47 -31
- package/hunter-workflow-family.json +2 -2
- package/package.json +1 -1
|
@@ -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=43088896a4556b69; overlay=none; agent=codebuddy; do not edit -->
|
|
6
6
|
# harness-plan — 需求规划
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
@@ -3,7 +3,7 @@ name: harness-review
|
|
|
3
3
|
description: 6维度代码审查(架构/安全/规范/兼容/测试/性能),对照项目规则(见
|
|
4
4
|
.harness/context-index.json)和测试场景表,在隔离上下文运行。使用场景:代码审查、提交前检查、合并评审
|
|
5
5
|
---
|
|
6
|
-
<!-- generated by harness_deploy.py; core=
|
|
6
|
+
<!-- generated by harness_deploy.py; core=43088896a4556b69; overlay=none; agent=codebuddy; do not edit -->
|
|
7
7
|
# harness-review — 代码审查
|
|
8
8
|
|
|
9
9
|
## Purpose
|
|
@@ -54,8 +54,8 @@ description: 6维度代码审查(架构/安全/规范/兼容/测试/性能)
|
|
|
54
54
|
|
|
55
55
|
先运行 `python <skills-root>/scripts/harness_preflight.py check-agents --skills-root <skills-root> --agent harness-reviewer --json`。`usable=false` → **直接主会话审查**,记 `decision` 事件,**不委派**。`reasonCode=CUSTOM_AGENTS_UNSUPPORTED` 是当前工具没有自定义 agent 能力的正常 inline 路径,不显示缺失告警。`usable=true` 时用 Agent spawn `harness-reviewer`(只读, 6 维度)。返回空 / 无报告正文 → **不 retry**,降级主会话审查。
|
|
56
56
|
|
|
57
|
-
3.
|
|
58
|
-
4. **生成修复反馈(原生协议)** — 若报告存在 RED/YELLOW 问题,执行 `protocols.md` 的 `review-fixback-protocol`,将问题转化为结构化 fixback 清单并落盘到 `.harness/changes/<change-name>/reports/review/fixback-YYYYMMDD-HHmm.md`。若无 RED/YELLOW
|
|
57
|
+
3. **持久化报告与事实 sidecar(强制,主会话)** — Agent 返回后主会话 Write 到 `reports/review/review-report-*.md`,并把同一批发现写成临时 JSON 后调用 `python <skills-root>/scripts/harness_review.py write-findings --change-dir <change-dir> --input <findings.json>`。权威计数来自 `reports/review/review-findings.json`,不是 Markdown。任一写入缺失 → 🟡WARN,不得宣称 review 完成。
|
|
58
|
+
4. **生成修复反馈(原生协议)** — 若报告存在 RED/YELLOW 问题,执行 `protocols.md` 的 `review-fixback-protocol`,将问题转化为结构化 fixback 清单并落盘到 `.harness/changes/<change-name>/reports/review/fixback-YYYYMMDD-HHmm.md`;随后把 disposition 临时 JSON 交给 `python <skills-root>/scripts/harness_review.py write-dispositions --change-dir <change-dir> --input <dispositions.json>`,权威状态写入 `reports/review/fixback-dispositions.json`。若无 RED/YELLOW,也必须写空 findings sidecar,并记录 `review-fixback-protocol: skipped(no findings)`。不调用 Superpowers `receiving-code-review`,也不记录外部 skill 降级。
|
|
59
59
|
5. **收尾** — append `phase.end` / `artifact` 事件;控制台输出摘要
|
|
60
60
|
|
|
61
61
|
## Review 定位(重要)
|
|
@@ -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=43088896a4556b69; overlay=none; agent=codebuddy; do not edit -->
|
|
6
6
|
# harness-run — 需求编码
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
@@ -528,6 +528,8 @@ python <skills-root>/scripts/harness_ledger.py record --change-dir ".harness/cha
|
|
|
528
528
|
> `content-changeset-2` 同时读取 tracked diff、标准 untracked 文件和 manifest 的精确测试路径。manifest 缺失时保持普通行为;manifest 存在但路径越界、内容 hash 漂移或结构非法时命令失败,ledger 不可复用。checkpoint commit 不改变各路径的工作树内容,因此提交前后 hash 保持一致。
|
|
529
529
|
|
|
530
530
|
> 这样 harness-test 的 Phase 1 可读取 ledger 判断是否复用 run 的 unitTest(diffHash commit-invariant + reuse 规则 #2 允许 HEAD 前移 → run 的 checkpoint commit 不破坏复用),submit 也可复用 compile 结果。详见 `../protocols/ledger-protocol.md`。
|
|
531
|
+
>
|
|
532
|
+
> **Ledger v3(v2 契约 / split-v1 布局起)**:`record` 自动解析并强制顶层身份(`schemaVersion=3/repositoryId/changeName/baseCommit/currentHead/diffHash/ownershipHash`),缺字段非零退出、不写账本;`--metrics-json` 必须通过 typed schema(unit=`total/passed/failed`,apiContract=`scenariosTotal/passed/failed`,browserE2E=`total/passed/failed`,dbCompatibility=`applicability(+reason)`);新增 `--base-commit/--diff-hash/--applicability/--applicability-reason`。legacy 契约行为不变。详见 `../protocols/ledger-protocol.md` 第十节。
|
|
531
533
|
|
|
532
534
|
阶段边界:`harness_gate.py begin/close`;测试跟踪:`harness_test_guard.py begin/close`。close 失败不得用自然语言覆盖。
|
|
533
535
|
|
|
@@ -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=43088896a4556b69; overlay=none; agent=codebuddy; do not edit -->
|
|
7
7
|
# harness-submit — 最终提交(含 worktree 合并)
|
|
8
8
|
|
|
9
9
|
## Purpose
|
|
@@ -57,7 +57,7 @@ worktree 合并前必须运行 `harness_change.py integration-lock acquire --run
|
|
|
57
57
|
### 提交流程(步骤 0–7)
|
|
58
58
|
|
|
59
59
|
0. **启动准备** — `harness_change.py resolve` 确定变更名;**`harness_gate.py begin --phase submit --change <id>`**;读 ledger,以 `harness_ledger.py diff-hash --repo . --base <baseCommit> --change-dir ".harness/changes/<change-name>" --json` 计算 diffHash + post-test 7 类分类(禁止手写 ledger / 手工 phase.end)
|
|
60
|
-
1. **合并最新代码** —
|
|
60
|
+
1. **合并最新代码** — 主目录与 worktree 均**不在业务工作区 stash/pull**;远端同步由合并段 integration transaction 在隔离 integration worktree 内完成(见「worktree 合并流程」);**正常路径禁止 `git stash` / `stash pop`**
|
|
61
61
|
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
62
|
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
63
|
4. **提交方式** — 主目录:AskUserQuestion 三选项(commit+push / 仅本地 / 取消);**worktree:固定仅本地 commit**
|
|
@@ -69,15 +69,20 @@ worktree 合并前必须运行 `harness_change.py integration-lock acquire --run
|
|
|
69
69
|
|
|
70
70
|
### worktree 合并流程(requested=true,commit 后自动执行)
|
|
71
71
|
|
|
72
|
+
合并由 `harness_integration.py` transaction 执行:隔离 integration worktree + journal + 保护 ref + 精确清理。skill 只负责确认提交信息、调用子命令、展示结构化结果;**禁止手工 `checkout --ours/--theirs`**。
|
|
73
|
+
|
|
72
74
|
M0. append `phase.start`(phase=merge,若从 `/harness-merge` 重入则 note 标注重入)
|
|
73
|
-
M1.
|
|
74
|
-
M2. **fetch
|
|
75
|
-
M3.
|
|
76
|
-
M4.
|
|
77
|
-
M5.
|
|
78
|
-
M6. **
|
|
79
|
-
M7.
|
|
80
|
-
|
|
75
|
+
M1. **preflight** — `harness_integration.py preflight --change <id> --run-id <run> --feature-branch worktree/<id> --target-branch <主分支> --temp-root <task temp>`;获取 integration lock、写 journal 与保护 ref;锁被持有即停止
|
|
76
|
+
M2. **prepare** — fetch 后从已提交 target 创建临时 integration worktree;primary 的 dirty 状态不被触碰
|
|
77
|
+
M3. **merge** — `--no-ff` 合并 feature 分支;merge diff 出现其他 Change 的 contract/runtime 路径 → 结构化拒绝;冲突 → step FAILED,**停下**列出冲突文件,人工解决后以 `recover` 续跑(已完成步骤返回 REUSED,不重复 merge/push)
|
|
78
|
+
M4. **verify** — 在 integration worktree 内执行组合态验证;他人提交引入或 ledger 不可复用时必跑
|
|
79
|
+
M5. **push** — 仅在验证身份与远端基线仍匹配时 push;远端漂移 → `TARGET_MOVED` 结构化失败,不继续
|
|
80
|
+
M6. **cleanup** — `git worktree remove --force` 精确路径 + 临时分支 + (push 成功后)保护 ref;释放 integration lock;失败保留 journal 与诊断证据;更新 `worktree.json`(`created=false` + removedAt)
|
|
81
|
+
M7. **ledger + 收尾** — 经 `harness_ledger.py record` 写入 `mergeFinalHash`(= journal `pushedHead`);**`harness_gate.py close --phase merge`**(禁止手工 phase.end);提示 `/harness-archive`
|
|
82
|
+
|
|
83
|
+
> Ledger v3(v2 契约 / split-v1 布局起):`record` 强制顶层身份(`schemaVersion=3/repositoryId/baseCommit/currentHead/diffHash/ownershipHash`,缺失非零退出、不写账本)与 typed metrics;legacy 契约行为不变。详见 `../protocols/ledger-protocol.md` 第十节。
|
|
84
|
+
|
|
85
|
+
正常路径**禁止创建、应用或删除仓库级 stash**。中断恢复:`harness_integration.py status` 读 journal,`recover` 从首个未完成步骤续跑;protection refs 只在 push 成功后的 cleanup 删除。
|
|
81
86
|
|
|
82
87
|
## P0 执行可信度规则
|
|
83
88
|
|
|
@@ -36,25 +36,24 @@ description: harness-submit 的8 步工作流详细步骤和执行日志记录
|
|
|
36
36
|
|
|
37
37
|
> **分支名自动读取**:不硬编码 `master` 或 `main`,使用 `git rev-parse --abbrev-ref @{u}` 自动读取 upstream 分支。
|
|
38
38
|
|
|
39
|
+
**正常路径禁止 `git stash` / `stash pop`**。远端同步不在业务工作区执行;主目录与 worktree 模式统一由合并段的 `harness_integration.py` transaction 在隔离 integration worktree 内 fetch + merge:
|
|
40
|
+
|
|
39
41
|
```powershell
|
|
40
|
-
# 0. 自动读取 upstream
|
|
42
|
+
# 0. 自动读取 upstream 与目标分支(只读操作)
|
|
41
43
|
powershell.exe -Command "git -C '<项目路径>' rev-parse --abbrev-ref @{u}"
|
|
42
44
|
|
|
43
|
-
# 1.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
# 2. 拉取并合并远程
|
|
47
|
-
powershell.exe -Command "git -C '<项目路径>' pull --rebase"
|
|
45
|
+
# 1. preflight:获取 integration lock + 写 journal/保护 ref
|
|
46
|
+
python harness/scripts/harness_integration.py preflight --change <change-name> --run-id <run-id> --feature-branch <feature> --target-branch <target> --temp-root <task-temp>
|
|
48
47
|
|
|
49
|
-
#
|
|
50
|
-
|
|
48
|
+
# 2. prepare:fetch + 从已提交 target 创建临时 integration worktree
|
|
49
|
+
python harness/scripts/harness_integration.py prepare --change <change-name> --run-id <run-id> --feature-branch <feature> --target-branch <target> --temp-root <task-temp>
|
|
51
50
|
```
|
|
52
51
|
|
|
53
52
|
**Shell 安全规则(强制)**:
|
|
54
53
|
- 任何 git 命令被 hook 拒绝(`Denied` / `PreToolUse:Bash hook error`)→ 停止流程,不得宣称"拉取成功"
|
|
55
|
-
-
|
|
54
|
+
- transaction 各步骤状态以 journal 为唯一事实源;FAILED 步骤用 `recover` 续跑,不重复已完成副作用
|
|
56
55
|
|
|
57
|
-
|
|
56
|
+
merge 冲突或 `TARGET_MOVED` 时,参考 `reference.md` 的恢复清单;**禁止 `checkout --ours/--theirs`**。
|
|
58
57
|
|
|
59
58
|
## 步骤 2:最终验证(ledger 复用优先)
|
|
60
59
|
|
|
@@ -311,122 +310,87 @@ powershell.exe -Command "git -C '<项目路径>' rev-parse HEAD"
|
|
|
311
310
|
|
|
312
311
|
---
|
|
313
312
|
|
|
314
|
-
## worktree
|
|
313
|
+
## worktree 合并流程(integration transaction,M0–M7)
|
|
315
314
|
|
|
316
|
-
> worktree 模式 commit 成功后自动执行;用户仅说「合并分支」/`/harness-merge` 且已有本地 commit 时从 M0
|
|
315
|
+
> worktree 模式 commit 成功后自动执行;用户仅说「合并分支」/`/harness-merge` 且已有本地 commit 时从 M0 重入。合并由 `harness_integration.py` transaction 执行:隔离 integration worktree + journal + 保护 ref + 精确清理。**禁止 `checkout --theirs/--ours`;正常路径禁止仓库级 stash。**
|
|
317
316
|
|
|
318
317
|
### P0 合并稳定性门禁
|
|
319
318
|
|
|
320
319
|
- 主分支名不硬编码,用 `git symbolic-ref --short refs/remotes/origin/HEAD` 读取
|
|
321
320
|
- push 只在主分支;worktree 分支不 push
|
|
322
|
-
- 所有 git 命令通过 `powershell.exe -Command "..."`
|
|
321
|
+
- 所有 git 命令通过 `powershell.exe -Command "..."` 执行(transaction 脚本内部 git 调用除外)
|
|
322
|
+
- transaction 步骤状态以 `.harness/state/integration/<transaction-id>/journal.json` 为唯一事实源
|
|
323
323
|
|
|
324
324
|
### 步骤 M0:启动合并段
|
|
325
325
|
|
|
326
326
|
append `phase.start`(`--phase merge`;`note` 含 worktree 分支、主分支、ledger diffHash、验证策略;重入时 note 标注「重入 merge」)。
|
|
327
327
|
|
|
328
|
-
### 步骤 M1
|
|
329
|
-
|
|
330
|
-
```powershell
|
|
331
|
-
powershell.exe -Command "git -C '<项目路径>' symbolic-ref --short refs/remotes/origin/HEAD"
|
|
332
|
-
powershell.exe -Command "git -C '<项目路径>' stash" # 主目录有未提交变更时
|
|
333
|
-
powershell.exe -Command "git -C '<项目路径>' rev-parse --abbrev-ref HEAD"
|
|
334
|
-
```
|
|
335
|
-
|
|
336
|
-
不在主分支则 `git checkout <主分支>`。
|
|
337
|
-
|
|
338
|
-
### 步骤 M2:fetch + 同步主分支
|
|
328
|
+
### 步骤 M1:preflight
|
|
339
329
|
|
|
340
330
|
```powershell
|
|
341
|
-
|
|
342
|
-
powershell.exe -Command "git -C '<项目路径>' pull --rebase"
|
|
331
|
+
python harness/scripts/harness_integration.py preflight --change <change-name> --run-id <run-id> --feature-branch worktree/<change-name> --target-branch <主分支> --temp-root <task-temp>
|
|
343
332
|
```
|
|
344
333
|
|
|
345
|
-
|
|
334
|
+
获取 integration lock、解析 base/feature head、写 journal 与保护 refs(`refs/harness/integration/<txn>/base|head`)。锁被其他 run 持有 → **停止**,不改动工作区与状态文件。
|
|
346
335
|
|
|
347
|
-
|
|
336
|
+
### 步骤 M2:prepare
|
|
348
337
|
|
|
349
338
|
```powershell
|
|
350
|
-
|
|
351
|
-
powershell.exe -Command "git -C '<项目路径>' add --renormalize ."
|
|
352
|
-
# 2. 若 git status --porcelain 非空 → working copy 存在 CRLF 漂移
|
|
353
|
-
powershell.exe -Command "git -C '<项目路径>' status --porcelain"
|
|
354
|
-
# 3. 有漂移 → 弃 staging + 强制 LF 重检(worktree 合并段 M2 在主仓库 main,应 clean,安全)
|
|
355
|
-
powershell.exe -Command "git -C '<项目路径>' reset -q; git -C '<项目路径>' checkout -- ."
|
|
356
|
-
# 4. 重新 renormalize 确认 clean(git status --porcelain 应空)
|
|
357
|
-
powershell.exe -Command "git -C '<项目路径>' add --renormalize .; git status --porcelain"
|
|
339
|
+
python harness/scripts/harness_integration.py prepare --change <change-name> --run-id <run-id> --feature-branch worktree/<change-name> --target-branch <主分支> --temp-root <task-temp>
|
|
358
340
|
```
|
|
359
341
|
|
|
360
|
-
|
|
342
|
+
fetch 后从**已提交** target 创建临时 integration worktree;primary 的 staged/unstaged/untracked/ignored 与 mtime 均不被触碰。
|
|
361
343
|
|
|
362
|
-
### 步骤 M3
|
|
344
|
+
### 步骤 M3:merge
|
|
363
345
|
|
|
364
346
|
```powershell
|
|
365
|
-
|
|
347
|
+
python harness/scripts/harness_integration.py merge --change <change-name> --run-id <run-id> --feature-branch worktree/<change-name> --target-branch <主分支> --temp-root <task-temp>
|
|
366
348
|
```
|
|
367
349
|
|
|
368
|
-
|
|
350
|
+
- 方式固定 `--no-ff`;merge diff 出现其他 Change 的 contract/runtime 路径 → 结构化 `FOREIGN_CHANGE_PATHS` 拒绝
|
|
351
|
+
- 冲突 → step FAILED:**停下**,`git -C <integration-worktree> diff --name-only --diff-filter=U` 列冲突文件,提示用户手动解决;保护 refs 与 journal 保留
|
|
352
|
+
- 人工解决后以 `recover` 续跑;已完成步骤返回 REUSED,不重复 merge
|
|
369
353
|
|
|
370
|
-
### 步骤 M4
|
|
354
|
+
### 步骤 M4:verify(组合态验证)
|
|
371
355
|
|
|
372
|
-
|
|
356
|
+
在 integration worktree 内执行验证命令;远端引入他人提交或 ledger 不可复用时必跑:
|
|
373
357
|
|
|
374
358
|
```powershell
|
|
375
|
-
|
|
359
|
+
python harness/scripts/harness_integration.py verify --change <change-name> --run-id <run-id> --feature-branch worktree/<change-name> --target-branch <主分支> --temp-root <task-temp> --command "<resolved command>"
|
|
376
360
|
```
|
|
377
361
|
|
|
378
|
-
|
|
379
|
-
- 状态 `🟡WARN(merge 冲突,待手动解决:<文件列表>)`
|
|
380
|
-
- 用户确认解决后重跑 submit(从 M0 重入)
|
|
381
|
-
- **禁止自动 `git checkout --theirs/--ours`**
|
|
382
|
-
|
|
383
|
-
### 步骤 M5:合并后验证(ledger 复用优先)
|
|
384
|
-
|
|
385
|
-
- 步骤 M2 引入他人提交 → **必须重跑** 构建+测试
|
|
386
|
-
- 否则 diffHash 一致且 post-test 非行为性 → 🔁REUSED
|
|
387
|
-
|
|
388
|
-
重跑后写回 ledger 的 `compile`/`unitTest`,更新 `diffHash`/`currentHead`。
|
|
362
|
+
任一命令非零退出 → step FAILED,不进入 push。
|
|
389
363
|
|
|
390
|
-
**写 check-ok marker**(npm run check exit 0
|
|
364
|
+
**写 check-ok marker**(npm run check exit 0 后强制):
|
|
391
365
|
|
|
392
366
|
```powershell
|
|
393
|
-
# npm run check exit 0 后立即写 marker(M5 或 REUSED 后均可)
|
|
394
367
|
powershell.exe -Command "python harness/scripts/harness_check_gate.py --write"
|
|
395
368
|
```
|
|
396
369
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
### 步骤 M6:push 主分支
|
|
370
|
+
### 步骤 M5:push
|
|
400
371
|
|
|
401
372
|
```powershell
|
|
402
|
-
|
|
403
|
-
powershell.exe -Command "git -C '<项目路径>' log HEAD..@{u} --oneline"
|
|
373
|
+
python harness/scripts/harness_integration.py push --change <change-name> --run-id <run-id> --feature-branch worktree/<change-name> --target-branch <主分支> --temp-root <task-temp>
|
|
404
374
|
```
|
|
405
375
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
```powershell
|
|
409
|
-
powershell.exe -Command "git -C '<项目路径>' push"
|
|
410
|
-
```
|
|
411
|
-
|
|
412
|
-
记录 `mergeFinalHash`:`git rev-parse HEAD`。
|
|
413
|
-
|
|
414
|
-
### 步骤 M7:清理 worktree
|
|
376
|
+
远端基线漂移 → `TARGET_MOVED` 结构化失败,不继续。成功后 journal `pushedHead` 即 `mergeFinalHash`。
|
|
415
377
|
|
|
416
|
-
|
|
378
|
+
### 步骤 M6:cleanup
|
|
417
379
|
|
|
418
380
|
```powershell
|
|
419
|
-
|
|
420
|
-
powershell.exe -Command "git -C '<项目路径>' branch -D worktree/<change-name>"
|
|
381
|
+
python harness/scripts/harness_integration.py cleanup --change <change-name> --run-id <run-id> --feature-branch worktree/<change-name> --target-branch <主分支> --temp-root <task-temp>
|
|
421
382
|
```
|
|
422
383
|
|
|
423
|
-
|
|
384
|
+
- `git worktree remove --force` 精确路径 → 验证注销 → 临时分支 `branch -D` → (push 成功后)删除保护 refs → 释放 integration lock
|
|
385
|
+
- 清理只接受 journal 登记的精确 integrationRoot;仓库根、父目录、空路径、逃逸路径与其他 transaction 路径一律拒绝
|
|
386
|
+
- 失败保留 journal 与诊断证据,状态 🟡WARN,不得宣称清理完成
|
|
387
|
+
- 若存在 test-tracking manifest,确认其路径已由合并后的目标分支跟踪(`git ls-files --error-unmatch -- <exact-path>`),缺失即停止
|
|
424
388
|
|
|
425
389
|
更新 `meta/worktree.json`:`created=false` + `removedAt`/`removedBy`/`removalNote`。
|
|
426
390
|
|
|
427
|
-
### 步骤
|
|
391
|
+
### 步骤 M7:更新 ledger + 收尾
|
|
428
392
|
|
|
429
|
-
ledger 顶层写入 `"mergeFinalHash": "<
|
|
393
|
+
ledger 顶层写入 `"mergeFinalHash": "<journal pushedHead>"`;经 `harness_gate.py close --phase merge` 关闭(禁止手工 phase.end)。
|
|
430
394
|
|
|
431
395
|
```markdown
|
|
432
396
|
## 合并完成 — <change-name>
|
|
@@ -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=43088896a4556b69; overlay=none; agent=codebuddy; do not edit -->
|
|
6
6
|
# harness-sync — 元数据同步
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
@@ -15,6 +15,21 @@ description: 检查并更新项目AI元数据(CodeGraph索引、harness-codeba
|
|
|
15
15
|
|
|
16
16
|
## Workflow(薄编排)
|
|
17
17
|
|
|
18
|
+
运行开始先执行受管 runtime 生命周期:
|
|
19
|
+
|
|
20
|
+
```powershell
|
|
21
|
+
python <skills-root>/scripts/harness_sync.py reap --project . --json
|
|
22
|
+
python <skills-root>/scripts/harness_sync.py begin --project . --run-id <run-id> --agent <agent> --purpose harness-sync --json
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
所有 deploy 临时产物只能写入 `begin` 返回的 `workspace`。无论正常完成、命令失败还是异常退出,都必须在 `finally` 中执行:
|
|
26
|
+
|
|
27
|
+
```powershell
|
|
28
|
+
python <skills-root>/scripts/harness_sync.py finalize --project . --run-id <run-id> --json
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
禁止重新使用固定 `sync-deploy-*` 目录;`--keep-temp` 仅供显式诊断。
|
|
32
|
+
|
|
18
33
|
| Phase | 检查 → 动作 |
|
|
19
34
|
|-------|-------------|
|
|
20
35
|
| 0 | 读 SKILL + `reference.md` + protocols |
|
|
@@ -25,7 +40,7 @@ description: 检查并更新项目AI元数据(CodeGraph索引、harness-codeba
|
|
|
25
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) |
|
|
26
41
|
| 4 | CLAUDE.md 完整性/行数 → 超限 AskUserQuestion 瘦身 |
|
|
27
42
|
| 5 | AGENTS.md 与 CLAUDE.md 一致 |
|
|
28
|
-
| 6 | `.harness/` 结构(init 规程 → `reference.md` 第 6
|
|
43
|
+
| 6 | `.harness/` 结构(init 规程 → `reference.md` 第 6 步);已装 skill 新鲜度只经 `hunter-harness refresh --dry-run --json` 的 post-adaptation freshness 判断,禁止 raw build 字节比较 |
|
|
29
44
|
| 7–9 | `项目规则(见 .harness/context-index.json)/`、构建配置、测试目录 — **只提示不自动修复** |
|
|
30
45
|
|
|
31
46
|
状态判断表格、修复动作、输出示例 → `reference.md`
|
|
@@ -75,8 +75,8 @@ powershell.exe -Command "git -C '<项目路径>' diff --stat HEAD~5 2>$null"
|
|
|
75
75
|
| state 目录 | `.harness/state/baseline/` 存在(internal_state) | ✅OK | 无需操作 |
|
|
76
76
|
| codebase map | `.harness/codebase/map/` 状态 | — | 见第 3 步 |
|
|
77
77
|
| 整体缺失 | `project.yaml` 与 `context-index.json` 均不存在 | ❌FAIL(未初始化) | 执行 `hunter-harness init`(见下方风险规程) |
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
|
|
79
|
+
> sync 不读取、不修改也不建议修改项目 `.gitignore` 策略(RET-34/35):三种跟踪策略(整体忽略 / 选择性跟踪 / 完全跟踪)下完整性结论相同,新鲜度由 post-adaptation projection 判定,与 Git 策略无关。
|
|
80
80
|
|
|
81
81
|
> ⚠️ **`hunter-harness init` 风险规程**(`.harness/` 未初始化时触发):
|
|
82
82
|
> 1. **预览**:`node packages/cli/dist/bin.js --non-interactive --dry-run --adapter claude-code --profile general --json`,确认将写入的路径清单与 `project_id`(`null` = 未绑服务器,本地自治理)。
|
|
@@ -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=43088896a4556b69; overlay=none; agent=codebuddy; do not edit -->
|
|
6
6
|
# harness-test — 测试执行
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
@@ -708,6 +708,8 @@ python <skills-root>/scripts/harness_ledger.py record --change-dir <dir> --verif
|
|
|
708
708
|
python <skills-root>/scripts/harness_ledger.py can-reuse --change-dir <dir> --verification unitTestFull --profile-input unitTestFull --project <project>
|
|
709
709
|
```
|
|
710
710
|
|
|
711
|
+
> **Ledger v3(v2 契约 / split-v1 布局起)**:`record` 强制顶层身份(缺失非零退出、不写账本);`--metrics-json` 必须过 typed schema(unit/apiContract/browserE2E/dbCompatibility 各有不同必填键);dbCompatibility 等不适用验证用 `--applicability NOT_APPLICABLE --applicability-reason "<scope 原因>"`(不计通过也不计失败)。legacy 契约行为不变。详见 `../protocols/ledger-protocol.md` 第十节。
|
|
712
|
+
|
|
711
713
|
### 常见报错对照
|
|
712
714
|
|
|
713
715
|
| 报错 | 原因 | 处理 |
|
|
@@ -6,7 +6,7 @@ description: harness-archive 的数据化归档和 final-summary 渲染协议。
|
|
|
6
6
|
|
|
7
7
|
## 原则
|
|
8
8
|
|
|
9
|
-
archive 不应让模型临场生成 500+ 行 HTML。事实收集与校验由 `harness_archive.py finalize` 单命令完成(cleanup → collect → render → validate → archive-meta 内嵌);模型仅通过 events 写入维护结论。`meta/archive-meta.md` 由 finalize 生成,禁止手写。历史 archive 回放用 `harness_archive.py replay`(只读,不写 archive-meta / 不跑 cleanup)。
|
|
9
|
+
archive 不应让模型临场生成 500+ 行 HTML。事实收集与校验由 `harness_archive.py finalize` 单命令完成(cleanup → **freeze(事件 cutoff)** → collect → source consistency → render → renderer consistency → validate → archive-meta 内嵌);模型仅通过 events 写入维护结论。`meta/archive-meta.md` 由 finalize 生成,禁止手写。历史 archive 回放用 `harness_archive.py replay`(只读,不写 archive-meta / 不跑 cleanup)。
|
|
10
10
|
|
|
11
11
|
`knownRisks` 仅收录 severity∈{warning,error,critical} 的 issue 事件;无 severity 的 issue 进入 `maintenanceNotes`。`finalStatusReasons` 解释 CONDITIONAL_OK/WARN/FAIL 原因。finalize 在 before-manifest 前 cleanup:删除 lock/pid/launcher/credential,截断超大日志。
|
|
12
12
|
|
|
@@ -27,11 +27,11 @@ events.ndjson(新流程推荐;历史 archive 可缺失)
|
|
|
27
27
|
|
|
28
28
|
## summary-data.json
|
|
29
29
|
|
|
30
|
-
结构来源为 `harness-archive/templates/summary-data-template.json`(schemaVersion 2.
|
|
30
|
+
结构来源为 `harness-archive/templates/summary-data-template.json`(schemaVersion 2.3)。默认由 `harness_archive.py finalize` 生成;历史回放用 `harness_archive.py replay`。
|
|
31
31
|
|
|
32
32
|
```json
|
|
33
33
|
{
|
|
34
|
-
"schemaVersion": "2.
|
|
34
|
+
"schemaVersion": "2.3",
|
|
35
35
|
"changeName": "...",
|
|
36
36
|
"businessGoal": "本次变更为了做什么",
|
|
37
37
|
"finalCommit": "...",
|
|
@@ -75,7 +75,8 @@ events.ndjson(新流程推荐;历史 archive 可缺失)
|
|
|
75
75
|
"commands": [],
|
|
76
76
|
"verificationChecks": [],
|
|
77
77
|
"artifacts": [],
|
|
78
|
-
"validationIssues": []
|
|
78
|
+
"validationIssues": [],
|
|
79
|
+
"sourceConsistency": {"ok": true, "issues": []}
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
```
|
|
@@ -143,6 +144,25 @@ PowerShell HTML renderer 仅作 legacy fallback。该脚本以 UTF-8 with BOM
|
|
|
143
144
|
|
|
144
145
|
`validate` 是 `harness_archive.py finalize` 的内嵌同进程步骤(不存在独立 `report validate` CLI);validate error 存在时,finalize 恢复原 changes 目录并 exit 非 0,绝不删除原 changes 目录。**缺 final-summary.html 恒为 validate error**(不再有"没有 HTML 但只 warning"的分支)。
|
|
145
146
|
|
|
147
|
+
## 冻结优先 finalize 与两层一致性(schemaVersion 2.3 起)
|
|
148
|
+
|
|
149
|
+
finalize 在 collect 之前**冻结事件事实**:所有 archive-fact 事件落盘并 fsync 后,写入唯一的 `phase.end` 与 `evidence/evidence-cutoff.json`(`eventCount` + `sha256` + `frozenAt`)。cutoff 之后**禁止再向归档 events.ndjson 追加任何事件**;后续报告生成事实(render/validate 结果、manifest 比对)只写入 finalize JSON payload 与 maintenance outbox,不回写事件流。collect 是纯函数:stage/timeline/durations 全部由冻结事件推导,**不存在选择性 patch 步骤**。
|
|
150
|
+
|
|
151
|
+
两层 validator 顺序执行,任何一层失败都恢复原 change 目录并非零退出:
|
|
152
|
+
|
|
153
|
+
1. **source consistency**(`validate_source_consistency`,render 前):summary 事实对照冻结来源——`event_count` 对 cutoff、verification 对 ledger typed metrics projection、review 计数对 sidecars。结果写入 `reportPipeline.sourceConsistency = {ok, issues}`;`ok=false` 时 issue code 含 `event-count-mismatch` / `verification-mismatch`。
|
|
154
|
+
2. **renderer consistency**(`validate_summary`,render 后):HTML 对照 summary-data,数字不得漂移。
|
|
155
|
+
|
|
156
|
+
## versioned repair(不改写原归档)
|
|
157
|
+
|
|
158
|
+
`replay` 保持只读。归档后发现不一致时,用显式修复:
|
|
159
|
+
|
|
160
|
+
```powershell
|
|
161
|
+
python harness/scripts/harness_archive.py repair --archive-dir ".harness/archive/<archive-id>" --json
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
repair 先在 archive 外生成候选 derived version,两层 validator 均通过后,才以不可变新版本写入 `derived/v<N>/{summary-data.json, final-summary.html, repair-record.json}`,并把 `derived/authoritative.json` pointer 指向该版本;**原 summary-data.json、final-summary.html 与 manifest 永不覆盖**。知识层只从 authoritative pointer 指向且 hash 校验通过的版本提取条目。
|
|
165
|
+
|
|
146
166
|
## 归档与知识维护解耦(§8)
|
|
147
167
|
|
|
148
168
|
archive close 的破坏性事务只执行确定性 close:
|
|
@@ -315,3 +315,39 @@ ledger 的 `status` 与 final-summary 展示状态对应:
|
|
|
315
315
|
### 9.5 v1→v2 兼容
|
|
316
316
|
|
|
317
317
|
v1 ledger 可读;entry 缺 v2 字段时 `can-reuse` 返回 `MISSING_V2_FIELDS`(insufficient-evidence),**不静默升级证据**。重新 `record`(自动补 v2 字段)后恢复复用。diffHash 算法升级后旧 ledger 一次性失效,不危险复用。
|
|
318
|
+
|
|
319
|
+
## 十、Ledger v3(contract-gated,2026-07 起)
|
|
320
|
+
|
|
321
|
+
v3 仅在 change contract 为 schemaVersion ≥ 2(或声明 `stateOwnership.runtimeRoot`,即 split-v1 布局)时启用;legacy v1 契约与无契约目录**行为完全不变**(零回归,旧 362 测试套件证明)。
|
|
322
|
+
|
|
323
|
+
### 10.1 强制顶层身份
|
|
324
|
+
|
|
325
|
+
v2 契约下 `record` 写入前强制解析并校验顶层身份字段,缺失且不可解析时**非零退出、不写账本**:
|
|
326
|
+
|
|
327
|
+
| 字段 | 解析顺序 |
|
|
328
|
+
|------|------|
|
|
329
|
+
| `schemaVersion` | 固定 `3` |
|
|
330
|
+
| `repositoryId` | `harness_paths.repository_identity(repo_root)`(远端规范化 + root commit;无远端回退 git common-dir,跨 worktree 稳定,RET-09) |
|
|
331
|
+
| `changeName` | change 目录名 |
|
|
332
|
+
| `baseCommit` | `--base-commit` → 既有 ledger 值 → `git rev-parse --verify HEAD` |
|
|
333
|
+
| `currentHead` | `git rev-parse --verify HEAD`(验证执行时) |
|
|
334
|
+
| `diffHash` | `--diff-hash` → 既有 ledger 值 → 按 ownership 范围重算(§10.3) |
|
|
335
|
+
| `ownershipHash` | 契约 `ownership` 段规范化 JSON 的 sha256 |
|
|
336
|
+
|
|
337
|
+
### 10.2 类型化 metrics 与 applicability
|
|
338
|
+
|
|
339
|
+
- v2 契约下 `--metrics-json` 必须通过 `validate_metrics` 类型校验:`unitTest`/`unitTestFull` 要求 `total/passed/failed`;`apiContract` 要求 `scenariosTotal/passed/failed`;`browserE2E` 要求 `total/passed/failed`;`dbCompatibility` 要求 `applicability ∈ APPLICABLE|NOT_APPLICABLE`,`NOT_APPLICABLE` 必须带 `reason`(UT-005/RET-15、UT-006/RET-16)。未知 verification 类型放行。
|
|
340
|
+
- `--applicability APPLICABLE|NOT_APPLICABLE` + `--applicability-reason` 写入 entry 级 applicability;`NOT_APPLICABLE` 无 reason 直接报错。applicability **既不计入通过也不计入失败**(UT-012/RET-24)。
|
|
341
|
+
- legacy 契约不校验 metrics 形状(旧的 `{"run","failures"}` 松散格式继续可用)。
|
|
342
|
+
|
|
343
|
+
### 10.3 ownership 范围 diffHash(RET-18)
|
|
344
|
+
|
|
345
|
+
`compute_ownership_diff(repo_root, base, change_dir)` 只对本变更 ownership 范围内的路径计算 diffHash:
|
|
346
|
+
|
|
347
|
+
- 排除 `.harness/state/**` 动态运行时证据(计入 `excludedRuntimeCount`)
|
|
348
|
+
- 他变更路径(`.harness/changes/<other>/`、`.harness/state/changes/<other>/`)单列 `foreignPaths`,不混入哈希
|
|
349
|
+
- 输出 `diffHash/files/foreignPaths/excludedRuntimeCount/ownedFileCount/ownershipHash`
|
|
350
|
+
|
|
351
|
+
### 10.4 原子写入
|
|
352
|
+
|
|
353
|
+
`write_ledger` 采用 tmp → fsync → `os.replace`;replace 失败时旧账本字节不变、不留 `.tmp` 残骸。所有写路径(record / 其他命令)统一走原子写。
|
|
@@ -8,6 +8,21 @@ description: harness .harness 状态目录分层协议。用于减少根目录
|
|
|
8
8
|
|
|
9
9
|
`.harness/changes/<change-name>/` 是变更状态真相源,但根目录不得继续堆放所有文件。新产物按子目录分层;旧路径保留读取兼容。
|
|
10
10
|
|
|
11
|
+
## 双根布局(split-v1,2026-07 起)
|
|
12
|
+
|
|
13
|
+
新 Change 将**静态合同**与**动态运行状态**分离到两个唯一所有者:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
.harness/changes/<change-name>/ # contractRoot:静态合同(spec/plans/meta)
|
|
17
|
+
.harness/state/changes/<change-name>/ # stateRoot:动态状态(events/logs/ledger/tracking/reports/runtime)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
- 合同由 `meta/change-context.json` 的 `stateOwnership.contractRoot` / `stateOwnership.runtimeRoot` 声明(schemaVersion 2)。
|
|
21
|
+
- 动态产物(`events.ndjson`、`logs/execution-log.md`、`evidence/verification-ledger.json`、`evidence/test-tracking.json`、reports、runtime)只写 stateRoot。
|
|
22
|
+
- 统一解析入口:`harness_paths.py` —— `resolve_change_layout()` 返回完整双根;`resolve_state_dir_for_contract()` 供 events/ledger/test_guard/gate 内部路由。
|
|
23
|
+
- **legacy-colocated**:未声明 `stateOwnership` 的旧 Change 继续读写共址布局;resolve 只读,**绝不静默搬迁**;显式迁移须 copy → hash verify → atomic pointer switch。
|
|
24
|
+
- 功能分支不得携带共享动态状态副本;checkpoint/archive 的 evidence snapshot 从 stateRoot 生成。
|
|
25
|
+
|
|
11
26
|
## 推荐结构
|
|
12
27
|
|
|
13
28
|
```text
|