@hunter-harness/workflow-harness 0.3.1 → 0.4.1
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 +30 -1
- package/harness/bundles/general/claude-code/harness-archive/templates/summary-data-template.json +1 -0
- package/harness/bundles/general/claude-code/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-execute/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-knowledge-ingest/SKILL.md +1 -1
- 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-pull/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-push/SKILL.md +1 -1
- 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-submit/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-sync/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/harness-test/SKILL.md +1 -1
- package/harness/bundles/general/claude-code/scripts/harness_archive.py +146 -8
- package/harness/bundles/general/claude-code/scripts/harness_deploy.py +1 -1
- package/harness/bundles/general/claude-code/scripts/harness_knowledge_candidates.py +538 -4
- 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 +30 -1
- package/harness/bundles/general/codebuddy/harness-archive/templates/summary-data-template.json +1 -0
- package/harness/bundles/general/codebuddy/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-execute/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-knowledge-ingest/SKILL.md +1 -1
- 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-pull/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-push/SKILL.md +1 -1
- 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-submit/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-sync/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/harness-test/SKILL.md +1 -1
- package/harness/bundles/general/codebuddy/scripts/harness_archive.py +146 -8
- package/harness/bundles/general/codebuddy/scripts/harness_deploy.py +1 -1
- package/harness/bundles/general/codebuddy/scripts/harness_knowledge_candidates.py +538 -4
- 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 +30 -1
- package/harness/bundles/general/codex/harness-archive/templates/summary-data-template.json +1 -0
- package/harness/bundles/general/codex/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-execute/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-knowledge-ingest/SKILL.md +1 -1
- 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-pull/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-push/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-submit/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-sync/SKILL.md +1 -1
- package/harness/bundles/general/codex/harness-test/SKILL.md +1 -1
- package/harness/bundles/general/codex/scripts/harness_archive.py +146 -8
- package/harness/bundles/general/codex/scripts/harness_deploy.py +1 -1
- package/harness/bundles/general/codex/scripts/harness_knowledge_candidates.py +538 -4
- 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 +30 -1
- package/harness/bundles/general/cursor/harness-archive/templates/summary-data-template.json +1 -0
- package/harness/bundles/general/cursor/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-execute/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-knowledge-ingest/SKILL.md +1 -1
- 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-pull/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-push/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-submit/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-sync/SKILL.md +1 -1
- package/harness/bundles/general/cursor/harness-test/SKILL.md +1 -1
- package/harness/bundles/general/cursor/scripts/harness_archive.py +146 -8
- package/harness/bundles/general/cursor/scripts/harness_deploy.py +1 -1
- package/harness/bundles/general/cursor/scripts/harness_knowledge_candidates.py +538 -4
- package/harness/bundles/general/pi/.harness-build.json +6 -0
- package/harness/bundles/general/pi/CONTEXT.md +98 -0
- package/harness/bundles/general/pi/README.md +478 -0
- package/harness/bundles/general/pi/contracts/build-profile-v3.schema.json +302 -0
- package/harness/bundles/general/pi/contracts/ci-metrics.schema.json +36 -0
- package/harness/bundles/general/pi/contracts/doctor-capability.schema.json +43 -0
- package/harness/bundles/general/pi/contracts/external-platform-observation.schema.json +62 -0
- package/harness/bundles/general/pi/contracts/fixtures/managed-execution.json +341 -0
- package/harness/bundles/general/pi/contracts/process-identity.schema.json +132 -0
- package/harness/bundles/general/pi/contracts/run-session.schema.json +142 -0
- package/harness/bundles/general/pi/contracts/service-retirement-receipt.schema.json +85 -0
- package/harness/bundles/general/pi/contracts/service-session.schema.json +147 -0
- package/harness/bundles/general/pi/contracts/workflow-policy.json +574 -0
- package/harness/bundles/general/pi/harness-archive/SKILL.md +322 -0
- package/harness/bundles/general/pi/harness-archive/checklist.md +71 -0
- package/harness/bundles/general/pi/harness-archive/reference.md +150 -0
- package/harness/bundles/general/pi/harness-archive/scripts/gen-manifest.ps1 +31 -0
- package/harness/bundles/general/pi/harness-archive/templates/summary-data-template.json +218 -0
- package/harness/bundles/general/pi/harness-codebase-map/SKILL.md +116 -0
- package/harness/bundles/general/pi/harness-codebase-map/checklist.md +126 -0
- package/harness/bundles/general/pi/harness-codebase-map/reference.md +364 -0
- package/harness/bundles/general/pi/harness-codebase-map/templates/ARCHITECTURE.md +57 -0
- package/harness/bundles/general/pi/harness-codebase-map/templates/CONCERNS.md +49 -0
- package/harness/bundles/general/pi/harness-codebase-map/templates/CONVENTIONS.md +57 -0
- package/harness/bundles/general/pi/harness-codebase-map/templates/INTEGRATIONS.md +52 -0
- package/harness/bundles/general/pi/harness-codebase-map/templates/STACK.md +55 -0
- package/harness/bundles/general/pi/harness-codebase-map/templates/STRUCTURE.md +69 -0
- package/harness/bundles/general/pi/harness-codebase-map/templates/TESTING.md +64 -0
- package/harness/bundles/general/pi/harness-codebase-map/templates/map-manifest.schema.json +73 -0
- package/harness/bundles/general/pi/harness-codebase-map/templates/map-summary.md +64 -0
- package/harness/bundles/general/pi/harness-execute/SKILL.md +170 -0
- package/harness/bundles/general/pi/harness-knowledge-ingest/SKILL.md +103 -0
- package/harness/bundles/general/pi/harness-knowledge-query/SKILL.md +97 -0
- package/harness/bundles/general/pi/harness-plan/SKILL.md +158 -0
- package/harness/bundles/general/pi/harness-plan/checklist.md +243 -0
- package/harness/bundles/general/pi/harness-plan/protocols.md +133 -0
- package/harness/bundles/general/pi/harness-plan/reference.md +468 -0
- package/harness/bundles/general/pi/harness-pull/SKILL.md +55 -0
- package/harness/bundles/general/pi/harness-push/SKILL.md +83 -0
- package/harness/bundles/general/pi/harness-review/SKILL.md +175 -0
- package/harness/bundles/general/pi/harness-review/checklist.md +124 -0
- package/harness/bundles/general/pi/harness-review/protocols.md +69 -0
- package/harness/bundles/general/pi/harness-review/reference.md +114 -0
- package/harness/bundles/general/pi/harness-run/SKILL.md +188 -0
- package/harness/bundles/general/pi/harness-run/checklist.md +279 -0
- package/harness/bundles/general/pi/harness-run/protocols.md +141 -0
- package/harness/bundles/general/pi/harness-run/reference.md +886 -0
- package/harness/bundles/general/pi/harness-submit/SKILL.md +182 -0
- package/harness/bundles/general/pi/harness-submit/checklist.md +452 -0
- package/harness/bundles/general/pi/harness-submit/reference.md +152 -0
- package/harness/bundles/general/pi/harness-sync/SKILL.md +72 -0
- package/harness/bundles/general/pi/harness-sync/reference.md +176 -0
- package/harness/bundles/general/pi/harness-test/SKILL.md +250 -0
- package/harness/bundles/general/pi/harness-test/checklist.md +359 -0
- package/harness/bundles/general/pi/harness-test/pitfalls-java.md +14 -0
- package/harness/bundles/general/pi/harness-test/pitfalls.md +307 -0
- package/harness/bundles/general/pi/harness-test/reference.md +880 -0
- package/harness/bundles/general/pi/harness-test/scripts/runtime-helpers.mjs +216 -0
- package/harness/bundles/general/pi/protocols/archive-report-protocol.md +196 -0
- package/harness/bundles/general/pi/protocols/ci-layering-protocol.md +22 -0
- package/harness/bundles/general/pi/protocols/evidence-based-reporting-protocol.md +134 -0
- package/harness/bundles/general/pi/protocols/execution-session-protocol.md +52 -0
- package/harness/bundles/general/pi/protocols/external-platform-protocol.md +27 -0
- package/harness/bundles/general/pi/protocols/ledger-protocol.md +365 -0
- package/harness/bundles/general/pi/protocols/memory-closeout-protocol.md +21 -0
- package/harness/bundles/general/pi/protocols/model-routing-protocol.md +22 -0
- package/harness/bundles/general/pi/protocols/powershell-protocol.md +238 -0
- package/harness/bundles/general/pi/protocols/registry-governance-protocol.md +31 -0
- package/harness/bundles/general/pi/protocols/report-pipeline-protocol.md +172 -0
- package/harness/bundles/general/pi/protocols/sensitive-info-protocol.md +110 -0
- package/harness/bundles/general/pi/protocols/state-layout-protocol.md +209 -0
- package/harness/bundles/general/pi/protocols/submit-protocol.md +78 -0
- package/harness/bundles/general/pi/protocols/verification-graph-protocol.md +32 -0
- package/harness/bundles/general/pi/scripts/harness_adoption_metrics.py +391 -0
- package/harness/bundles/general/pi/scripts/harness_apidoc.py +53 -0
- package/harness/bundles/general/pi/scripts/harness_archive.py +11345 -0
- package/harness/bundles/general/pi/scripts/harness_change.py +1626 -0
- package/harness/bundles/general/pi/scripts/harness_check_gate.py +113 -0
- package/harness/bundles/general/pi/scripts/harness_context.py +1774 -0
- package/harness/bundles/general/pi/scripts/harness_deploy.py +968 -0
- package/harness/bundles/general/pi/scripts/harness_efficiency.py +443 -0
- package/harness/bundles/general/pi/scripts/harness_environment.py +1690 -0
- package/harness/bundles/general/pi/scripts/harness_events.py +2234 -0
- package/harness/bundles/general/pi/scripts/harness_events_sync.py +1425 -0
- package/harness/bundles/general/pi/scripts/harness_execution_contracts.py +596 -0
- package/harness/bundles/general/pi/scripts/harness_fixback.py +1975 -0
- package/harness/bundles/general/pi/scripts/harness_gate.py +3816 -0
- package/harness/bundles/general/pi/scripts/harness_headless.py +37 -0
- package/harness/bundles/general/pi/scripts/harness_integration.py +2564 -0
- package/harness/bundles/general/pi/scripts/harness_knowledge_candidates.py +796 -0
- package/harness/bundles/general/pi/scripts/harness_ledger.py +3556 -0
- package/harness/bundles/general/pi/scripts/harness_migration_head.py +220 -0
- package/harness/bundles/general/pi/scripts/harness_orchestration.py +344 -0
- package/harness/bundles/general/pi/scripts/harness_paths.py +676 -0
- package/harness/bundles/general/pi/scripts/harness_phase.py +1726 -0
- package/harness/bundles/general/pi/scripts/harness_plan_aggregate.py +249 -0
- package/harness/bundles/general/pi/scripts/harness_plan_finalize.py +1016 -0
- package/harness/bundles/general/pi/scripts/harness_preflight.py +650 -0
- package/harness/bundles/general/pi/scripts/harness_process.py +1065 -0
- package/harness/bundles/general/pi/scripts/harness_profile.py +1817 -0
- package/harness/bundles/general/pi/scripts/harness_report_model.py +442 -0
- package/harness/bundles/general/pi/scripts/harness_retry.py +175 -0
- package/harness/bundles/general/pi/scripts/harness_review.py +631 -0
- package/harness/bundles/general/pi/scripts/harness_runtime.py +2243 -0
- package/harness/bundles/general/pi/scripts/harness_service.py +3355 -0
- package/harness/bundles/general/pi/scripts/harness_state.py +365 -0
- package/harness/bundles/general/pi/scripts/harness_sync.py +407 -0
- package/harness/bundles/general/pi/scripts/harness_test_cleanup.py +175 -0
- package/harness/bundles/general/pi/scripts/harness_test_guard.py +1899 -0
- package/harness/bundles/general/pi/scripts/harness_test_runner.py +1586 -0
- package/harness/bundles/general/pi/scripts/harness_verification.py +593 -0
- package/harness/bundles/general/pi/scripts/harness_workflow_policy.py +266 -0
- 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 +30 -1
- package/harness/bundles/java/claude-code/harness-archive/templates/summary-data-template.json +1 -0
- package/harness/bundles/java/claude-code/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-execute/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-knowledge-ingest/SKILL.md +1 -1
- 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-pull/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/harness-push/SKILL.md +1 -1
- 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 +1 -1
- package/harness/bundles/java/claude-code/harness-test/SKILL.md +1 -1
- package/harness/bundles/java/claude-code/scripts/harness_archive.py +146 -8
- package/harness/bundles/java/claude-code/scripts/harness_deploy.py +1 -1
- package/harness/bundles/java/claude-code/scripts/harness_knowledge_candidates.py +538 -4
- 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 +30 -1
- package/harness/bundles/java/codebuddy/harness-archive/templates/summary-data-template.json +1 -0
- package/harness/bundles/java/codebuddy/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-execute/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-knowledge-ingest/SKILL.md +1 -1
- 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-pull/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/harness-push/SKILL.md +1 -1
- 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 +1 -1
- package/harness/bundles/java/codebuddy/harness-test/SKILL.md +1 -1
- package/harness/bundles/java/codebuddy/scripts/harness_archive.py +146 -8
- package/harness/bundles/java/codebuddy/scripts/harness_deploy.py +1 -1
- package/harness/bundles/java/codebuddy/scripts/harness_knowledge_candidates.py +538 -4
- 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 +30 -1
- package/harness/bundles/java/codex/harness-archive/templates/summary-data-template.json +1 -0
- package/harness/bundles/java/codex/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-execute/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-knowledge-ingest/SKILL.md +1 -1
- 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-pull/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-push/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 +1 -1
- package/harness/bundles/java/codex/harness-sync/SKILL.md +1 -1
- package/harness/bundles/java/codex/harness-test/SKILL.md +1 -1
- package/harness/bundles/java/codex/scripts/harness_archive.py +146 -8
- package/harness/bundles/java/codex/scripts/harness_deploy.py +1 -1
- package/harness/bundles/java/codex/scripts/harness_knowledge_candidates.py +538 -4
- 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 +30 -1
- package/harness/bundles/java/cursor/harness-archive/templates/summary-data-template.json +1 -0
- package/harness/bundles/java/cursor/harness-codebase-map/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-execute/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-knowledge-ingest/SKILL.md +1 -1
- 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-pull/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-push/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 +1 -1
- package/harness/bundles/java/cursor/harness-sync/SKILL.md +1 -1
- package/harness/bundles/java/cursor/harness-test/SKILL.md +1 -1
- package/harness/bundles/java/cursor/scripts/harness_archive.py +146 -8
- package/harness/bundles/java/cursor/scripts/harness_deploy.py +1 -1
- package/harness/bundles/java/cursor/scripts/harness_knowledge_candidates.py +538 -4
- package/harness/bundles/java/pi/.harness-build.json +6 -0
- package/harness/bundles/java/pi/CONTEXT.md +98 -0
- package/harness/bundles/java/pi/README.md +478 -0
- package/harness/bundles/java/pi/contracts/build-profile-v3.schema.json +302 -0
- package/harness/bundles/java/pi/contracts/ci-metrics.schema.json +36 -0
- package/harness/bundles/java/pi/contracts/doctor-capability.schema.json +43 -0
- package/harness/bundles/java/pi/contracts/external-platform-observation.schema.json +62 -0
- package/harness/bundles/java/pi/contracts/fixtures/managed-execution.json +341 -0
- package/harness/bundles/java/pi/contracts/process-identity.schema.json +132 -0
- package/harness/bundles/java/pi/contracts/run-session.schema.json +142 -0
- package/harness/bundles/java/pi/contracts/service-retirement-receipt.schema.json +85 -0
- package/harness/bundles/java/pi/contracts/service-session.schema.json +147 -0
- package/harness/bundles/java/pi/contracts/workflow-policy.json +574 -0
- package/harness/bundles/java/pi/harness-apidoc/SKILL.md +97 -0
- package/harness/bundles/java/pi/harness-apidoc/checklist.md +142 -0
- package/harness/bundles/java/pi/harness-apidoc/reference.md +233 -0
- package/harness/bundles/java/pi/harness-archive/SKILL.md +322 -0
- package/harness/bundles/java/pi/harness-archive/checklist.md +71 -0
- package/harness/bundles/java/pi/harness-archive/reference.md +150 -0
- package/harness/bundles/java/pi/harness-archive/scripts/gen-manifest.ps1 +31 -0
- package/harness/bundles/java/pi/harness-archive/templates/summary-data-template.json +218 -0
- package/harness/bundles/java/pi/harness-codebase-map/SKILL.md +116 -0
- package/harness/bundles/java/pi/harness-codebase-map/checklist.md +126 -0
- package/harness/bundles/java/pi/harness-codebase-map/reference.md +364 -0
- package/harness/bundles/java/pi/harness-codebase-map/templates/ARCHITECTURE.md +57 -0
- package/harness/bundles/java/pi/harness-codebase-map/templates/CONCERNS.md +49 -0
- package/harness/bundles/java/pi/harness-codebase-map/templates/CONVENTIONS.md +57 -0
- package/harness/bundles/java/pi/harness-codebase-map/templates/INTEGRATIONS.md +52 -0
- package/harness/bundles/java/pi/harness-codebase-map/templates/STACK.md +55 -0
- package/harness/bundles/java/pi/harness-codebase-map/templates/STRUCTURE.md +69 -0
- package/harness/bundles/java/pi/harness-codebase-map/templates/TESTING.md +64 -0
- package/harness/bundles/java/pi/harness-codebase-map/templates/map-manifest.schema.json +73 -0
- package/harness/bundles/java/pi/harness-codebase-map/templates/map-summary.md +64 -0
- package/harness/bundles/java/pi/harness-execute/SKILL.md +170 -0
- package/harness/bundles/java/pi/harness-knowledge-ingest/SKILL.md +103 -0
- package/harness/bundles/java/pi/harness-knowledge-query/SKILL.md +97 -0
- package/harness/bundles/java/pi/harness-package/SKILL.md +94 -0
- package/harness/bundles/java/pi/harness-package/checklist.md +322 -0
- package/harness/bundles/java/pi/harness-package/reference.md +210 -0
- package/harness/bundles/java/pi/harness-plan/SKILL.md +158 -0
- package/harness/bundles/java/pi/harness-plan/checklist.md +243 -0
- package/harness/bundles/java/pi/harness-plan/protocols.md +133 -0
- package/harness/bundles/java/pi/harness-plan/reference.md +468 -0
- package/harness/bundles/java/pi/harness-pull/SKILL.md +55 -0
- package/harness/bundles/java/pi/harness-push/SKILL.md +83 -0
- package/harness/bundles/java/pi/harness-review/SKILL.md +175 -0
- package/harness/bundles/java/pi/harness-review/checklist.md +124 -0
- package/harness/bundles/java/pi/harness-review/protocols.md +69 -0
- package/harness/bundles/java/pi/harness-review/reference.md +114 -0
- package/harness/bundles/java/pi/harness-run/SKILL.md +206 -0
- package/harness/bundles/java/pi/harness-run/checklist.md +252 -0
- package/harness/bundles/java/pi/harness-run/protocols.md +141 -0
- package/harness/bundles/java/pi/harness-run/reference.md +820 -0
- package/harness/bundles/java/pi/harness-submit/SKILL.md +189 -0
- package/harness/bundles/java/pi/harness-submit/checklist.md +452 -0
- package/harness/bundles/java/pi/harness-submit/reference.md +152 -0
- package/harness/bundles/java/pi/harness-sync/SKILL.md +72 -0
- package/harness/bundles/java/pi/harness-sync/reference.md +176 -0
- package/harness/bundles/java/pi/harness-test/SKILL.md +264 -0
- package/harness/bundles/java/pi/harness-test/checklist.md +320 -0
- package/harness/bundles/java/pi/harness-test/pitfalls-java.md +16 -0
- package/harness/bundles/java/pi/harness-test/pitfalls.md +307 -0
- package/harness/bundles/java/pi/harness-test/reference.md +792 -0
- package/harness/bundles/java/pi/harness-test/scripts/runtime-helpers.mjs +216 -0
- package/harness/bundles/java/pi/protocols/archive-report-protocol.md +196 -0
- package/harness/bundles/java/pi/protocols/ci-layering-protocol.md +22 -0
- package/harness/bundles/java/pi/protocols/evidence-based-reporting-protocol.md +134 -0
- package/harness/bundles/java/pi/protocols/execution-session-protocol.md +52 -0
- package/harness/bundles/java/pi/protocols/external-platform-protocol.md +27 -0
- package/harness/bundles/java/pi/protocols/ledger-protocol.md +365 -0
- package/harness/bundles/java/pi/protocols/memory-closeout-protocol.md +21 -0
- package/harness/bundles/java/pi/protocols/model-routing-protocol.md +22 -0
- package/harness/bundles/java/pi/protocols/powershell-protocol.md +238 -0
- package/harness/bundles/java/pi/protocols/registry-governance-protocol.md +31 -0
- package/harness/bundles/java/pi/protocols/report-pipeline-protocol.md +172 -0
- package/harness/bundles/java/pi/protocols/sensitive-info-protocol.md +110 -0
- package/harness/bundles/java/pi/protocols/state-layout-protocol.md +209 -0
- package/harness/bundles/java/pi/protocols/submit-protocol.md +78 -0
- package/harness/bundles/java/pi/protocols/verification-graph-protocol.md +32 -0
- package/harness/bundles/java/pi/scripts/harness_adoption_metrics.py +391 -0
- package/harness/bundles/java/pi/scripts/harness_apidoc.py +53 -0
- package/harness/bundles/java/pi/scripts/harness_archive.py +11345 -0
- package/harness/bundles/java/pi/scripts/harness_change.py +1626 -0
- package/harness/bundles/java/pi/scripts/harness_check_gate.py +113 -0
- package/harness/bundles/java/pi/scripts/harness_context.py +1774 -0
- package/harness/bundles/java/pi/scripts/harness_deploy.py +968 -0
- package/harness/bundles/java/pi/scripts/harness_efficiency.py +443 -0
- package/harness/bundles/java/pi/scripts/harness_environment.py +1690 -0
- package/harness/bundles/java/pi/scripts/harness_events.py +2234 -0
- package/harness/bundles/java/pi/scripts/harness_events_sync.py +1425 -0
- package/harness/bundles/java/pi/scripts/harness_execution_contracts.py +596 -0
- package/harness/bundles/java/pi/scripts/harness_fixback.py +1975 -0
- package/harness/bundles/java/pi/scripts/harness_gate.py +3816 -0
- package/harness/bundles/java/pi/scripts/harness_headless.py +37 -0
- package/harness/bundles/java/pi/scripts/harness_integration.py +2564 -0
- package/harness/bundles/java/pi/scripts/harness_knowledge_candidates.py +796 -0
- package/harness/bundles/java/pi/scripts/harness_ledger.py +3556 -0
- package/harness/bundles/java/pi/scripts/harness_migration_head.py +220 -0
- package/harness/bundles/java/pi/scripts/harness_orchestration.py +344 -0
- package/harness/bundles/java/pi/scripts/harness_paths.py +676 -0
- package/harness/bundles/java/pi/scripts/harness_phase.py +1726 -0
- package/harness/bundles/java/pi/scripts/harness_plan_aggregate.py +249 -0
- package/harness/bundles/java/pi/scripts/harness_plan_finalize.py +1016 -0
- package/harness/bundles/java/pi/scripts/harness_preflight.py +650 -0
- package/harness/bundles/java/pi/scripts/harness_process.py +1065 -0
- package/harness/bundles/java/pi/scripts/harness_profile.py +1817 -0
- package/harness/bundles/java/pi/scripts/harness_report_model.py +442 -0
- package/harness/bundles/java/pi/scripts/harness_retry.py +175 -0
- package/harness/bundles/java/pi/scripts/harness_review.py +631 -0
- package/harness/bundles/java/pi/scripts/harness_runtime.py +2243 -0
- package/harness/bundles/java/pi/scripts/harness_service.py +3355 -0
- package/harness/bundles/java/pi/scripts/harness_state.py +365 -0
- package/harness/bundles/java/pi/scripts/harness_sync.py +407 -0
- package/harness/bundles/java/pi/scripts/harness_test_cleanup.py +175 -0
- package/harness/bundles/java/pi/scripts/harness_test_guard.py +1899 -0
- package/harness/bundles/java/pi/scripts/harness_test_runner.py +1586 -0
- package/harness/bundles/java/pi/scripts/harness_verification.py +593 -0
- package/harness/bundles/java/pi/scripts/harness_workflow_policy.py +266 -0
- package/harness/manifests/general/claude-code.json +19 -19
- package/harness/manifests/general/codebuddy.json +19 -19
- package/harness/manifests/general/codex.json +19 -19
- package/harness/manifests/general/cursor.json +19 -19
- package/harness/manifests/general/pi.json +475 -0
- package/harness/manifests/java/claude-code.json +21 -21
- package/harness/manifests/java/codebuddy.json +21 -21
- package/harness/manifests/java/codex.json +21 -21
- package/harness/manifests/java/cursor.json +21 -21
- package/harness/manifests/java/pi.json +499 -0
- package/hunter-workflow-family.json +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
harness:
|
|
3
|
+
origin: generated
|
|
4
|
+
generator: harness-codebase-map
|
|
5
|
+
file_kind: generated_reviewable
|
|
6
|
+
push_policy: full-diff-proposal
|
|
7
|
+
update_policy: skip-if-local-dirty
|
|
8
|
+
title: Testing Patterns
|
|
9
|
+
document_type: testing
|
|
10
|
+
profile: <profile-or-unknown>
|
|
11
|
+
mapped_at: <YYYY-MM-DD HH:mm>
|
|
12
|
+
last_mapped_commit: <sha-or-unknown>
|
|
13
|
+
path_scope: <full|fast|focus|paths>
|
|
14
|
+
status: active
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Testing Patterns
|
|
18
|
+
|
|
19
|
+
**Analysis Date:** <YYYY-MM-DD>
|
|
20
|
+
|
|
21
|
+
## Test Framework
|
|
22
|
+
|
|
23
|
+
- Runner: <framework>
|
|
24
|
+
- Config: `<path>`
|
|
25
|
+
|
|
26
|
+
## Test Commands
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
<test command>
|
|
30
|
+
<single test command if known>
|
|
31
|
+
<coverage command if known>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Test File Organization
|
|
35
|
+
|
|
36
|
+
- Location: `<path or pattern>`
|
|
37
|
+
- Naming: <pattern>
|
|
38
|
+
|
|
39
|
+
## Unit Tests
|
|
40
|
+
|
|
41
|
+
- Scope: <observed pattern>
|
|
42
|
+
- Example path: `<path>`
|
|
43
|
+
|
|
44
|
+
## Integration / API Tests
|
|
45
|
+
|
|
46
|
+
- Scope: <observed pattern>
|
|
47
|
+
- Example path: `<path>`
|
|
48
|
+
|
|
49
|
+
## Mocking / Fixtures
|
|
50
|
+
|
|
51
|
+
- <mock strategy>
|
|
52
|
+
- Fixture location: `<path>`
|
|
53
|
+
|
|
54
|
+
## Coverage / Quality Gates
|
|
55
|
+
|
|
56
|
+
- <coverage rule or unknown>
|
|
57
|
+
|
|
58
|
+
## Testing Gaps
|
|
59
|
+
|
|
60
|
+
- <module or path lacking tests>
|
|
61
|
+
|
|
62
|
+
## Notes for AI Agents
|
|
63
|
+
|
|
64
|
+
- <how harness-test should use this map>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "Hunter Harness Codebase Map Manifest",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": [
|
|
6
|
+
"schema_version",
|
|
7
|
+
"generator",
|
|
8
|
+
"generated_at",
|
|
9
|
+
"mode",
|
|
10
|
+
"profile",
|
|
11
|
+
"last_mapped_commit",
|
|
12
|
+
"path_scope",
|
|
13
|
+
"documents",
|
|
14
|
+
"summary",
|
|
15
|
+
"warnings",
|
|
16
|
+
"stale_policy"
|
|
17
|
+
],
|
|
18
|
+
"properties": {
|
|
19
|
+
"schema_version": { "type": "integer", "const": 1 },
|
|
20
|
+
"generator": { "type": "string", "const": "harness-codebase-map" },
|
|
21
|
+
"generated_at": { "type": "string" },
|
|
22
|
+
"mode": { "type": "string" },
|
|
23
|
+
"profile": { "type": "string" },
|
|
24
|
+
"project_root": { "type": "string" },
|
|
25
|
+
"last_mapped_commit": { "type": "string" },
|
|
26
|
+
"path_scope": {
|
|
27
|
+
"type": "object",
|
|
28
|
+
"required": ["type", "paths"],
|
|
29
|
+
"properties": {
|
|
30
|
+
"type": { "type": "string" },
|
|
31
|
+
"paths": { "type": "array", "items": { "type": "string" } }
|
|
32
|
+
},
|
|
33
|
+
"additionalProperties": true
|
|
34
|
+
},
|
|
35
|
+
"documents": {
|
|
36
|
+
"type": "array",
|
|
37
|
+
"items": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"required": ["document_type", "path", "sha256", "line_count", "focus", "status"],
|
|
40
|
+
"properties": {
|
|
41
|
+
"document_type": { "type": "string" },
|
|
42
|
+
"path": { "type": "string" },
|
|
43
|
+
"sha256": { "type": "string" },
|
|
44
|
+
"line_count": { "type": "integer" },
|
|
45
|
+
"focus": { "type": "string" },
|
|
46
|
+
"status": { "type": "string" }
|
|
47
|
+
},
|
|
48
|
+
"additionalProperties": true
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"summary": {
|
|
52
|
+
"type": "object",
|
|
53
|
+
"required": ["path", "sha256", "line_count"],
|
|
54
|
+
"properties": {
|
|
55
|
+
"path": { "type": "string" },
|
|
56
|
+
"sha256": { "type": "string" },
|
|
57
|
+
"line_count": { "type": "integer" }
|
|
58
|
+
},
|
|
59
|
+
"additionalProperties": true
|
|
60
|
+
},
|
|
61
|
+
"warnings": { "type": "array", "items": { "type": "string" } },
|
|
62
|
+
"stale_policy": {
|
|
63
|
+
"type": "object",
|
|
64
|
+
"required": ["max_age_days", "changed_files_threshold"],
|
|
65
|
+
"properties": {
|
|
66
|
+
"max_age_days": { "type": "integer" },
|
|
67
|
+
"changed_files_threshold": { "type": "integer" }
|
|
68
|
+
},
|
|
69
|
+
"additionalProperties": true
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"additionalProperties": true
|
|
73
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
harness:
|
|
3
|
+
origin: generated
|
|
4
|
+
generator: harness-codebase-map
|
|
5
|
+
file_kind: generated_reviewable
|
|
6
|
+
push_policy: full-diff-proposal
|
|
7
|
+
update_policy: skip-if-local-dirty
|
|
8
|
+
title: Codebase Map Summary
|
|
9
|
+
document_type: map-summary
|
|
10
|
+
profile: <profile-or-unknown>
|
|
11
|
+
generated_at: <YYYY-MM-DD HH:mm>
|
|
12
|
+
last_mapped_commit: <sha-or-unknown>
|
|
13
|
+
mode: <full|fast|focus|paths|status|diff>
|
|
14
|
+
status: active
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Codebase Map Summary
|
|
18
|
+
|
|
19
|
+
**Generated At:** <YYYY-MM-DD HH:mm>
|
|
20
|
+
**Mode:** <full|fast|focus|paths|status|diff>
|
|
21
|
+
**Profile:** <profile-or-unknown>
|
|
22
|
+
**Commit:** <sha-or-unknown>
|
|
23
|
+
|
|
24
|
+
## Project Snapshot
|
|
25
|
+
|
|
26
|
+
<项目一句话说明>
|
|
27
|
+
|
|
28
|
+
## Key Stack
|
|
29
|
+
|
|
30
|
+
- Language: <language and version>
|
|
31
|
+
- Framework: <framework>
|
|
32
|
+
- Build: <build tool>
|
|
33
|
+
- Database: <database or none/unknown>
|
|
34
|
+
|
|
35
|
+
## Main Modules
|
|
36
|
+
|
|
37
|
+
- `<path>` — <purpose>
|
|
38
|
+
|
|
39
|
+
## Entry Points
|
|
40
|
+
|
|
41
|
+
- `<path>` — <purpose>
|
|
42
|
+
|
|
43
|
+
## Testing
|
|
44
|
+
|
|
45
|
+
- Command: <test command or unknown>
|
|
46
|
+
- Test location: `<path or unknown>`
|
|
47
|
+
|
|
48
|
+
## Concerns
|
|
49
|
+
|
|
50
|
+
- <risk or concern>
|
|
51
|
+
|
|
52
|
+
## Detailed Documents
|
|
53
|
+
|
|
54
|
+
- `.harness/codebase/map/STACK.md`
|
|
55
|
+
- `.harness/codebase/map/INTEGRATIONS.md`
|
|
56
|
+
- `.harness/codebase/map/ARCHITECTURE.md`
|
|
57
|
+
- `.harness/codebase/map/STRUCTURE.md`
|
|
58
|
+
- `.harness/codebase/map/CONVENTIONS.md`
|
|
59
|
+
- `.harness/codebase/map/TESTING.md`
|
|
60
|
+
- `.harness/codebase/map/CONCERNS.md`
|
|
61
|
+
|
|
62
|
+
## Notes for AI Agents
|
|
63
|
+
|
|
64
|
+
- Read this summary first, then open the detailed document that matches the current task.
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: harness-execute
|
|
3
|
+
description: 执行阶段:按变更簇执行 TDD
|
|
4
|
+
编码循环(RED→GREEN→REFACTOR→编译验证),随后完成单元/接口/数据兼容验证并输出测试报告。仅当用户显式调用
|
|
5
|
+
/harness-execute 时使用;不得因用户提到编码/实现/测试就自动触发,也不得被其他阶段 skill 自动接续。
|
|
6
|
+
---
|
|
7
|
+
<!-- generated by harness_deploy.py; core=ec59ac2389d9dce9; overlay=none; agent=pi; do not edit -->
|
|
8
|
+
# harness-execute — 执行(编码 + 验证)
|
|
9
|
+
|
|
10
|
+
> 2026-08 阶段合并:原 `run`(编码)与 `test`(验证)合并为单一 `execute` 阶段。
|
|
11
|
+
> `/harness-run` 与 `/harness-test` 保留为别名入口,语义与本 skill 相同。
|
|
12
|
+
|
|
13
|
+
## Purpose
|
|
14
|
+
|
|
15
|
+
基于 plan + test-scenarios,按**变更簇**执行 TDD(RED→GREEN→REFACTOR→构建验证),随后在同一阶段内完成单元测试、接口测试与数据兼容验证,写入 verification-ledger 并输出测试报告。负责 worktree 创建/切换。
|
|
16
|
+
|
|
17
|
+
## When to Use
|
|
18
|
+
|
|
19
|
+
仅当用户显式调用 `/harness-execute`(或别名 `/harness-run`、`/harness-test`)时执行;plan 完成后**不自动**进入本阶段。参数:`--subagent` 强制 Subagent-Driven;`--inline` 等同默认;`--fixback` 读最新 review fixback。**默认 Inline,不询问执行模式**。
|
|
20
|
+
|
|
21
|
+
**单阶段原则**:execute 关门后必须停止并交还用户,仅提示 `plannedPhases` 中的真实下一阶段;禁止自动开始其他阶段。
|
|
22
|
+
|
|
23
|
+
## 前置条件
|
|
24
|
+
|
|
25
|
+
- 设计文档(`plans/*-design.md` 优先,回退 `spec/*-design.md`)与 `plans/*-plan.md`(含 frontmatter)存在且已审批
|
|
26
|
+
- `plans/*-test-scenarios.md` 存在(测试真相源)
|
|
27
|
+
- 读 `meta/worktree.json`:`requested=true` 时 worktree 须存在或 execute 负责创建;worktree 已创建则在 worktree 中执行测试,不得静默回到主目录
|
|
28
|
+
|
|
29
|
+
## Worktree 门禁
|
|
30
|
+
|
|
31
|
+
读取 `meta/worktree.json`(兼容旧路径 `worktree.json`):
|
|
32
|
+
|
|
33
|
+
| 条件 | 行为 |
|
|
34
|
+
|------|------|
|
|
35
|
+
| `requested=false` | 主目录执行 |
|
|
36
|
+
| `requested=true` + path 存在 | 切换 worktree 执行 |
|
|
37
|
+
| `requested=true` + path 不存在 | **必须创建**(run)或 **停止**(test/review/submit) |
|
|
38
|
+
|
|
39
|
+
**严禁** `requested=true` 时静默回主目录。创建失败 → 停止或 blocking user confirmation 降级(须 🟡WARN + 用户确认)。
|
|
40
|
+
|
|
41
|
+
**状态与代码分离**:代码/编译/测试在 `worktreeRoot`;`stateDir`(logs/events/ledger/reports)写回 `.harness/changes/<change-name>/`。
|
|
42
|
+
|
|
43
|
+
创建命令与 JSON 模板 → 各 skill `reference.md`(plan 写决策,run 创建/更新)。
|
|
44
|
+
> 片段:worktree-gate · 创建命令 → `harness-run/reference.md`
|
|
45
|
+
|
|
46
|
+
## 统一读取协议
|
|
47
|
+
|
|
48
|
+
0. **脚本在 `<skills-root>/scripts/` 共享,不在每个 skill 子目录下** — 实际形态是 `.codebuddy/skills/scripts/harness_*.py`(`.claude`/`.cursor`/`.codex` 同理),**没有** `.../skills/harness-<phase>/scripts/`。plan、run/test、archive 三份执行日志里都先猜成后者、报 `No such file` 再靠 Search 找回来;照第一种写法直接用
|
|
49
|
+
1. **`.harness/changes/<change-name>/` 是唯一真相源** — 所有输入从该目录读取,产物写入对应子目录
|
|
50
|
+
2. **change-name 优先从 frontmatter 读取** — `plans/*-design.md`、`spec/*-design.md`、`plans/*-plan.md` 的 YAML `change-name`
|
|
51
|
+
3. **frontmatter 缺失时兼容旧格式** — 从路径推断,标记 `🟡 legacy-plan`,不失败
|
|
52
|
+
4. **design** — 设计真相源按序取第一个存在的:`plans/<change>-design.md`(v2 发布产物,哈希绑定)→ `spec/<change>-design.md`(legacy 手写)。两份**同时存在**时以 `plans/` 为准,并记 `🟡 WARN 设计文档双份`——v2 发布的那份才受完整性门禁保护,读手写的那份等于绕过校验
|
|
53
|
+
5. **plan** — 任务真相源:`plans/<change>-plan.md`
|
|
54
|
+
6. **implementation-detail** — 自适应执行参考;legacy 缺失 🟡WARN,不阻断
|
|
55
|
+
7. **test-scenarios** — 测试真相源:`plans/<change>-test-scenarios.md`
|
|
56
|
+
8. **禁止读取 `docs/superpowers/` 作为正式输入** — 旧草稿仅人工线索
|
|
57
|
+
9. **每个 skill 边界只刷新一次状态快照** — 先运行 `python <skills-root>/scripts/harness_state.py capture --project . --change-dir ".harness/changes/<change-name>" --json`。首次 Plan 捕获时,脚本把当时的 Git HEAD 写入不可变 `changeBase`;后续阶段只刷新 `git.head` 与各段指纹,不得用当前 HEAD 覆盖 `changeBase`。只有迁移旧 change 且已能证明真实计划起点时,才在首次补录时传 `--base <baseCommit>`。`changedSegments=[]` 时复用已有 profile/rules/map/change/code 指纹,不再重复跑全量 `harness-sync` 或代码库扫描。`knowledge` 段仅为兼容空段,知识始终按需远端查询;快照不能替代源码读取和验证门禁。
|
|
58
|
+
|
|
59
|
+
状态目录分层:新路径优先,旧路径兼容 → [[../protocols/state-layout-protocol.md|state-layout-protocol]]
|
|
60
|
+
> 片段:read-protocol
|
|
61
|
+
|
|
62
|
+
## Workflow 概要
|
|
63
|
+
|
|
64
|
+
0. 加载上下文:先 `harness_context.py prepare --project . --change <id> --phase execute --executor <tool> --json`(`--project` 必填),再 `harness_context.py begin --project . --change <id> --phase execute --executor <tool> --json` 校验交接,最后运行 **`harness_gate.py begin --phase execute --change <id>`**。旧名 `--phase run` / `--phase test` 仍被接受并归一为 execute。<br>**交接凭证不必手工补**:v2 计划的 `plan finalize` 不写 context 事务,`prepare` 会在检测到 committed 的 `meta/publication-journals/*.json` 时自动补录 `plan → execute` 凭证(凭证带 `bootstrapSource=plan_publication_journal` 留痕)。仍报 `HANDOFF_REQUIRED`/`LEGACY_BOOTSTRAP_REQUIRED` 说明**没有**这份发布证据——回到 plan 阶段确认发布是否真的完成,**不得**自己拼 `classify + configure-plan + close` 造凭证。<br>**Fixback** 不得拼装底层步骤,必须只调用一次 `harness_fixback.py launch-review --project . --change <id> --change-dir <change-dir> --executor <tool> --skills-root <skills-root> --product-identity <当前产品身份> --json`;返回 `FIXBACK_NOTHING_TO_APPLY` 时直接报告并停止。禁止手写 `events.ndjson` / `phase.end`。
|
|
65
|
+
0.5. **测试基础设施探测**与**命令执行模式 preflight** → `harness-test/reference.md`「命令执行模式 preflight」;测试基线已由 gate begin 内部建立,不得再次执行 guard begin
|
|
66
|
+
1. **变更簇 TDD** — `harness-run/protocols.md` `run-tdd-protocol`;批量 RED/GREEN;按需 `change-cluster-review-protocol`
|
|
67
|
+
2. 构建验证 + **仅**通过 `harness_ledger.py record` 写 ledger(禁止 Write/Edit `verification-ledger.json`);profile 缺失或陈旧时先 `harness_preflight.py detect --project . --json`;`record --project . --profile-input <key>` 从同一 target 推导 scope、coverage、规范命令与输入闭包
|
|
68
|
+
3. **验证执行**:单元测试可复用则跳过(`harness_ledger.py can-reuse`);接口测试**强制批量执行器**一次跑完全部场景;数据兼容验证按场景表执行 → `harness-test/reference.md`
|
|
69
|
+
4. **场景覆盖检查**(场景表映射,禁止用用例数冒充场景数)
|
|
70
|
+
5. **关门检查**(10 项)→ 只执行一次 `harness_gate.py close`;`--to-phase` 必须取返回的 `nextPhases` 或 `plannedPhases` 中 execute 的真实后继(fixback 时为 execute 自身)。该命令内部关闭 test guard、写 `phase.end`、释放租约、写 handoff 并补传事件;不得再单独调用 test-guard/context close。失败时按结构化 `recoveryAction` 原样重试,已完成步骤幂等复用。
|
|
71
|
+
|
|
72
|
+
**阶段归属规则**:只用 `ownerPhase=execute` 的任务和场景判定本阶段结果。`ownerPhase=review`/`submit` 的场景按计划留给后续阶段属于正常移交,出现在关门返回值的 `deferred` 里,不阻断 execute。合并前 `ownerPhase=run`/`test` 的旧清单经别名表归一为 execute,在 execute 关门时一并到期。
|
|
73
|
+
|
|
74
|
+
> 关门脚本与本规则一致:`harness_gate.py close --phase execute` 的 C9 场景覆盖要求全部 `ownerPhase=execute` 的必需场景有通过 receipt——包括本属原 run 半段的编码验证与原 test 半段的接口/兼容验证,这正是两阶段合并的语义。
|
|
75
|
+
|
|
76
|
+
**构建/测试执行入口**:所有构建与测试命令(mvn / gradle / npm test / pytest 等)必须经 `harness_test_runner.py exec` 发起,**禁止**用 `powershell.exe -Command` 直接裸跑:
|
|
77
|
+
|
|
78
|
+
```text
|
|
79
|
+
python <skills-root>/scripts/harness_test_runner.py exec --project . --timeout-seconds <预估上限> -- <构建命令及参数>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
资源档位是硬合同(`safe` 默认;`system`/`full` 需用户明确授权或 `--confirm-resource-intensive`);Python `unittest` 必须逐模块隔离模式(`harness_test_runner.py unittest --profile safe --tests-dir <目录>`)。返回 `TEST_RUN_ALREADY_ACTIVE` 说明已有构建在跑:等待或查明持有者,不得绕开锁另起并行构建。完整约束 → `harness-test/checklist.md`「0.0-A 资源安全档位」。
|
|
83
|
+
|
|
84
|
+
**长阶段租约**:`gate begin` 的租约默认 TTL 3600 秒,execute 阶段常常跑得更久。租约过期不会中断执行,**也不再阻断收尾**:`gate close` 发现租约过期而 run-id 仍是本阶段的,会自动用原 run-id 重取并照常关门,只在返回体的 `leaseLapsed` 里记录。不需要定期续租;报 `LEASE_ABSENT`/`LEASE_INVALID` 时先确认 begin 真的跑过,**不要**重跑 `gate begin`。
|
|
85
|
+
|
|
86
|
+
**接口测试执行器优先级**:接口测试执行器(默认首选)> PowerShell batch `.ps1` > Playwright MCP `browser_evaluate`(仅前两者不可用或用户明确选择)> curl + UTF-8 JSON body file(兜底)。执行器在 PowerShell 可用时**禁止**用 Playwright MCP 逐条执行。→ `harness-test/reference.md`「接口测试工具优先级」
|
|
87
|
+
|
|
88
|
+
**陈旧测试安全修复**:只有当前生产代码、已批准计划或可验证历史能唯一确定新契约时,才允许仅修改测试并立即重跑,然后记录:
|
|
89
|
+
|
|
90
|
+
```text
|
|
91
|
+
python <skills-root>/scripts/harness_test_guard.py record --project . --change-dir ".harness/changes/<change-name>" --files "<精确测试文件路径,逗号分隔>" --reason stale-test-repair --json
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
新建或正常更新测试分别使用 `tdd-created` / `test-updated`;存在业务歧义时记录 `BLOCKED_PREEXISTING` 并停止。**禁止临时排除测试**(`.bak`/改名/移出目录/禁用注解/exclude/`skipTests` 充当通过证据)。
|
|
95
|
+
|
|
96
|
+
**Foundation Gate**:若 `meta/implementation-checkpoints.json` 中 `foundation-gate` 为 pending,不得开始 plan 中任务 6+;由 `harness_gate.py` 硬阻断。
|
|
97
|
+
|
|
98
|
+
## P0 执行可信度规则
|
|
99
|
+
|
|
100
|
+
- 命令结果不得靠猜测;普通 Bash 被拒 → 立即改用等价 PowerShell 重试一次
|
|
101
|
+
- 仅 PowerShell 成功且有明确证据(构建/git/测试输出、文件存在、exit 0)时可标 ✅OK;否则 ❌FAIL 或 🟡WARN
|
|
102
|
+
- 禁止把 hook 拒绝、静态验证、无输出、用户跳过说成成功 → 详见 [[../protocols/powershell-protocol.md|powershell-protocol]]、[[../protocols/evidence-based-reporting-protocol.md|evidence-based-reporting-protocol]]
|
|
103
|
+
|
|
104
|
+
## 生成内容语言约定
|
|
105
|
+
|
|
106
|
+
- sync/ingest 等生成的文档、规则、知识条目、架构说明一律**优先使用中文**撰写(标识符、命令、代码、API 字段名保持原文)
|
|
107
|
+
- 面向平台展示的标题/摘要/正文默认中文;仅当用户明确要求或目标系统强制时才用英文
|
|
108
|
+
> 片段:p0-trust
|
|
109
|
+
|
|
110
|
+
## 关键规则(硬门禁速查)
|
|
111
|
+
|
|
112
|
+
> 编码侧细则 → `harness-run/reference.md`、`harness-run/protocols.md`;验证侧细则 → `harness-test/reference.md`、`harness-test/checklist.md`、`harness-test/pitfalls.md`
|
|
113
|
+
|
|
114
|
+
| 域 | 要点 |
|
|
115
|
+
|----|------|
|
|
116
|
+
| **文档输入** | 只读 `.harness/changes/<cn>/`;禁止 `docs/superpowers/` |
|
|
117
|
+
| **变更簇 TDD** | 一簇一次 RED/GREEN;低价值项豁免;新分支必须 RED |
|
|
118
|
+
| **RED/GREEN** | RED 须有效;静态验证 ≠ 测试通过 |
|
|
119
|
+
| **探测/ledger** | 基础设施先探测;每次构建/测试经 `harness_ledger.py record`;禁止手写 ledger JSON |
|
|
120
|
+
| **Gate/Guard** | 跨 Agent/阶段先用 `harness_context.py prepare/begin`;阶段门禁统一用 `harness_gate.py begin/close`;gate 内部负责 guard begin/close(`harness_test_guard.py begin` / `harness_test_guard.py close` 仅由 gate 调用,不构成模型执行步骤),模型只在需要记录测试来源或修复时调用 guard 的 `record/stage/mark` |
|
|
121
|
+
| **关门/状态** | 10 项关门检查;仅 execute-owned P0 静态-only 导致 WARN;review/submit-owned 待办正常移交 |
|
|
122
|
+
| **Worktree** | `requested=true` 时代码只写 worktree |
|
|
123
|
+
| **构建/测试** | 一律经 `harness_test_runner.py exec`;禁止裸跑;`TEST_RUN_ALREADY_ACTIVE` 表示已有构建在跑,等待而非另起 |
|
|
124
|
+
| **租约** | 阶段超 TTL 由 close 自动用原 run-id 重取,无需续租;`LEASE_ABSENT`/`LEASE_INVALID` 才需人工 `harness_change.py claim`,一律不重跑 begin |
|
|
125
|
+
| **报告** | 区分"产品测试"与"工具维护";API 维度 `OK`/`PARTIAL`/`BLOCKED`/`NOT_RUN`/`FAIL` 五态 |
|
|
126
|
+
|
|
127
|
+
## Output Format
|
|
128
|
+
|
|
129
|
+
变更文件表 + 构建/测试证据 + 场景覆盖摘要 + 最终状态(✅OK / 🟡WARN / ❌FAIL)。测试报告保存到 `.harness/changes/<change-name>/reports/test/test-report-YYYYMMDD-HHmm.md`。
|
|
130
|
+
|
|
131
|
+
## 渐进披露
|
|
132
|
+
|
|
133
|
+
- **Read `harness-run/protocols.md`** — run-tdd + change-cluster-review
|
|
134
|
+
- **Read `harness-run/reference.md`** — Step 0–5 细节、TDD/RED/ledger/迁移/安全矩阵
|
|
135
|
+
- **Read `harness-test/checklist.md`** — 验证前各项强制检查、preflight、服务生命周期清单
|
|
136
|
+
- **Read `harness-test/reference.md`** — API 测试执行方法、执行器模板、运行时配置叠加
|
|
137
|
+
- **Read `harness-test/pitfalls.md`** — 测试踩坑规则
|
|
138
|
+
|
|
139
|
+
## 交互白名单
|
|
140
|
+
|
|
141
|
+
1. **预存变更**:保留 / 暂存 / 终止
|
|
142
|
+
2. **数据库迁移**:展示审查清单并确认(**永不自动执行**)
|
|
143
|
+
3. **worktree 创建失败**:是否改主目录
|
|
144
|
+
4. **Service Gate**:仅当 `harness_service.py ensure` 返回 `needs-user-decision` 时询问处理方式
|
|
145
|
+
5. **资源密集型测试确认**:仅当发布/验收确实需要 `system` 或 `full` 档位,且用户尚未明确授权时询问;获得授权后传入 `--confirm-resource-intensive`
|
|
146
|
+
|
|
147
|
+
## 执行日志
|
|
148
|
+
|
|
149
|
+
`events.ndjson` 为唯一事实源(schema_version 3,兼容读取 v1/v2;`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
|
|
150
|
+
|
|
151
|
+
**`phase.start` 由 `harness_gate.py begin` 写,不要再手工追加一次。** 两条同 `run-id` 的
|
|
152
|
+
`phase.start` 会让 `plan finalize` 以 `PHASE_START_DUPLICATE` 卡死,而且手工那次会先触发
|
|
153
|
+
auto-seal、把正在开始的 attempt 封成 `RECOVERED`。要补触发指令说明就带 `--note` 跑 `gate begin`。
|
|
154
|
+
(重复追加现已按 `(phase, run-id)` 判为幂等 no-op,但依赖它不如不写。)
|
|
155
|
+
|
|
156
|
+
```powershell
|
|
157
|
+
# 阶段开始:gate begin 负责,note 在这里给
|
|
158
|
+
python <skills-root>/scripts/harness_gate.py begin --change-dir ".harness/changes/<change-name>" --phase <phase> --note "<触发指令>"
|
|
159
|
+
# 阶段中的其他事件才用 append
|
|
160
|
+
python <skills-root>/scripts/harness_events.py append --change-dir ".harness/changes/<change-name>" --phase <phase> --type <command|issue|verification> --run-id <phase-run-id> --note "<摘要>"
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
> **脚本接线**:`harness_events.py append`;`harness_archive.py finalize`;`harness_preflight.py check`;`harness_ledger.py can-reuse`;`harness_service.py ensure/stop`(须 `--files`/`serviceStart.inputFiles`)。JSON 输出按 D13 护栏解读。
|
|
164
|
+
|
|
165
|
+
> **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 边界保持最新。
|
|
166
|
+
|
|
167
|
+
每个阶段的 `phase.start` 与对应 `phase.end` 必须复用同一 `--run-id` / `--attempt`;阶段结束必须写 `--status OK|WARN|FAIL|BLOCKED`。重试同一阶段时生成新的 run-id 并增加 `--attempt <n>`,不得覆盖或伪装成一次执行。**`attempt` 按 phase 全局递增,不是按 run-id**:一个 run-id 只绑定一个 attempt,重试必须「新 run-id + 下一个 attempt」两者同时换,只换其一会撞 `EVENT_ATTEMPT_CONFLICT` 或 `PHASE_ALREADY_CLOSED`。已发布 plan 的修订通过重跑 `plan evidence-pack` + `plan finalize` 分配新 attempt(`harness_plan_finalize.py republish` 已于 0.3.0 移除)。
|
|
168
|
+
|
|
169
|
+
阶段跑得久(plan/run 常见)时用 `harness_context.py renew --project . --change <cn> --executor <tool>` 续租;租约到期本身不再阻断 `close`(同一 owner 的过期租约不构成冲突,收据里记 `leaseLapsed`),但续租能让 `view` 的状态如实反映在跑。跨工具继续执行时写 `--executor-tool <codex|claude-code|codebuddy|cursor>`,并在接棒事件写 `--handoff-from-tool` / `--handoff-reason`;也可由 `HUNTER_HARNESS_TOOL/AGENT/MODEL/RUN_ID` 环境变量统一注入。
|
|
170
|
+
> 片段:logging · phase=`execute`
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: harness-knowledge-ingest
|
|
3
|
+
description: 确认归档 ZIP 已上传并由 Hunter Platform 在服务端解包、校验和入库。客户端不再构建或维护本地知识索引。
|
|
4
|
+
---
|
|
5
|
+
<!-- generated by harness_deploy.py; core=ec59ac2389d9dce9; overlay=none; agent=pi; do not edit -->
|
|
6
|
+
# harness-knowledge-ingest
|
|
7
|
+
|
|
8
|
+
知识 ingest 完全由 Hunter Platform 负责。归档完成时,客户端生成一个确定性 ZIP;
|
|
9
|
+
服务端收到后保存原包、安全解包、发布核心文件,并根据其中的 Markdown 与摘要重建
|
|
10
|
+
项目语义索引。
|
|
11
|
+
|
|
12
|
+
客户端不得生成 `.harness/knowledge`、SQLite 索引、候选条目、视图、报告或本地裁决。
|
|
13
|
+
本地知识处理脚本已从分发包移除;历史版本数据只由升级兼容逻辑识别,不再执行。
|
|
14
|
+
|
|
15
|
+
## 归档包边界
|
|
16
|
+
|
|
17
|
+
允许上传的核心内容只有:
|
|
18
|
+
|
|
19
|
+
- `reports/final/summary-data.json`
|
|
20
|
+
- `spec/**/*.md`
|
|
21
|
+
- `plans/**/*.md`
|
|
22
|
+
- `archive-meta.md`
|
|
23
|
+
- `change-context.json`
|
|
24
|
+
- 包内 `archive-manifest.json`(由 CLI 生成)
|
|
25
|
+
|
|
26
|
+
日志、测试报告、审查报告、HTML、缓存、备份、凭据和临时文件不得进入归档包。
|
|
27
|
+
|
|
28
|
+
## Normal Workflow
|
|
29
|
+
|
|
30
|
+
1. 先读取最近归档操作记录中的 `archiveRemote`,以及本地状态目录
|
|
31
|
+
`.harness/state/local/archive-packages/<change-key>.remote.json`。若 `archiveStatus=durable` 且
|
|
32
|
+
`knowledgeStatus=ready`,直接报告已完成,禁止重新打包或上传。
|
|
33
|
+
2. 若存在 `.harness/state/local/archive-packages/<change-key>.zip`,只重试该包;
|
|
34
|
+
禁止搜索实现源码、调用 Python 内部函数或手工重新拼包。
|
|
35
|
+
3. 只有旧归档没有 ZIP/回执时,调用公开命令重新生成并上传;`harness-archive`
|
|
36
|
+
的 finalize 正常情况下会生成确定性 ZIP,并调用:
|
|
37
|
+
|
|
38
|
+
```powershell
|
|
39
|
+
powershell.exe -Command "npx hunter-harness archive upload --file '<archive.zip>' --change-key '<change-key>' --yes --non-interactive --json"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
4. 检查响应中的包哈希、服务端保存状态和 `knowledge_status`。
|
|
43
|
+
5. 只有服务端确认原 ZIP 已持久保存且知识状态为 ready,才删除本地待上传 ZIP。
|
|
44
|
+
6. 上传或 ingest 失败时保留 ZIP 与失败收据;修复连接后重试同一个 ZIP,不重新拼散文件。
|
|
45
|
+
|
|
46
|
+
## Ownership Rules
|
|
47
|
+
|
|
48
|
+
- 客户端:选择核心文件、生成稳定 manifest/ZIP、校验包哈希、上传与保留失败重试材料。
|
|
49
|
+
- 服务端:敏感信息扫描、ZIP 安全校验、原包持久化、解包、制品发布、知识 ingest、状态查询和下载恢复。
|
|
50
|
+
- 远端不可用:知识不可用;不得启动本地替代索引。
|
|
51
|
+
- 面向人的知识、提案、规则和说明默认使用中文。
|
|
52
|
+
|
|
53
|
+
## Forbidden Actions
|
|
54
|
+
|
|
55
|
+
- build_or_refresh_local_knowledge
|
|
56
|
+
- write_dot_harness_knowledge
|
|
57
|
+
- upload_logs_reviews_tests_or_temp_files
|
|
58
|
+
- call_legacy_python_ingest
|
|
59
|
+
- treat_upload_acceptance_without_durable_status_as_success
|
|
60
|
+
- delete_pending_zip_after_failed_upload
|
|
61
|
+
|
|
62
|
+
## Verification
|
|
63
|
+
|
|
64
|
+
确认归档命令的 JSON 结果同时包含:服务端 package 哈希、保存状态和知识状态。
|
|
65
|
+
若失败,确认 `.harness/state/local/archive-packages/` 中仍保留可重试 ZIP;若成功,确认
|
|
66
|
+
ZIP 已按收据策略清理,且平台下载接口可以恢复原包。
|
|
67
|
+
|
|
68
|
+
## P0 执行可信度规则
|
|
69
|
+
|
|
70
|
+
- 命令结果不得靠猜测;普通 Bash 被拒 → 立即改用等价 PowerShell 重试一次
|
|
71
|
+
- 仅 PowerShell 成功且有明确证据(构建/git/测试输出、文件存在、exit 0)时可标 ✅OK;否则 ❌FAIL 或 🟡WARN
|
|
72
|
+
- 禁止把 hook 拒绝、静态验证、无输出、用户跳过说成成功 → 详见 [[../protocols/powershell-protocol.md|powershell-protocol]]、[[../protocols/evidence-based-reporting-protocol.md|evidence-based-reporting-protocol]]
|
|
73
|
+
|
|
74
|
+
## 生成内容语言约定
|
|
75
|
+
|
|
76
|
+
- sync/ingest 等生成的文档、规则、知识条目、架构说明一律**优先使用中文**撰写(标识符、命令、代码、API 字段名保持原文)
|
|
77
|
+
- 面向平台展示的标题/摘要/正文默认中文;仅当用户明确要求或目标系统强制时才用英文
|
|
78
|
+
> 片段:p0-trust · 只有服务端持久化与 ingest 收据可证明知识已入库
|
|
79
|
+
|
|
80
|
+
## 执行日志
|
|
81
|
+
|
|
82
|
+
`events.ndjson` 为唯一事实源(schema_version 3,兼容读取 v1/v2;`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
|
|
83
|
+
|
|
84
|
+
**`phase.start` 由 `harness_gate.py begin` 写,不要再手工追加一次。** 两条同 `run-id` 的
|
|
85
|
+
`phase.start` 会让 `plan finalize` 以 `PHASE_START_DUPLICATE` 卡死,而且手工那次会先触发
|
|
86
|
+
auto-seal、把正在开始的 attempt 封成 `RECOVERED`。要补触发指令说明就带 `--note` 跑 `gate begin`。
|
|
87
|
+
(重复追加现已按 `(phase, run-id)` 判为幂等 no-op,但依赖它不如不写。)
|
|
88
|
+
|
|
89
|
+
```powershell
|
|
90
|
+
# 阶段开始:gate begin 负责,note 在这里给
|
|
91
|
+
python <skills-root>/scripts/harness_gate.py begin --change-dir ".harness/changes/<change-name>" --phase <phase> --note "<触发指令>"
|
|
92
|
+
# 阶段中的其他事件才用 append
|
|
93
|
+
python <skills-root>/scripts/harness_events.py append --change-dir ".harness/changes/<change-name>" --phase <phase> --type <command|issue|verification> --run-id <phase-run-id> --note "<摘要>"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
> **脚本接线**:`harness_events.py append`;`harness_archive.py finalize`;`harness_preflight.py check`;`harness_ledger.py can-reuse`;`harness_service.py ensure/stop`(须 `--files`/`serviceStart.inputFiles`)。JSON 输出按 D13 护栏解读。
|
|
97
|
+
|
|
98
|
+
> **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 边界保持最新。
|
|
99
|
+
|
|
100
|
+
每个阶段的 `phase.start` 与对应 `phase.end` 必须复用同一 `--run-id` / `--attempt`;阶段结束必须写 `--status OK|WARN|FAIL|BLOCKED`。重试同一阶段时生成新的 run-id 并增加 `--attempt <n>`,不得覆盖或伪装成一次执行。**`attempt` 按 phase 全局递增,不是按 run-id**:一个 run-id 只绑定一个 attempt,重试必须「新 run-id + 下一个 attempt」两者同时换,只换其一会撞 `EVENT_ATTEMPT_CONFLICT` 或 `PHASE_ALREADY_CLOSED`。已发布 plan 的修订通过重跑 `plan evidence-pack` + `plan finalize` 分配新 attempt(`harness_plan_finalize.py republish` 已于 0.3.0 移除)。
|
|
101
|
+
|
|
102
|
+
阶段跑得久(plan/run 常见)时用 `harness_context.py renew --project . --change <cn> --executor <tool>` 续租;租约到期本身不再阻断 `close`(同一 owner 的过期租约不构成冲突,收据里记 `leaseLapsed`),但续租能让 `view` 的状态如实反映在跑。跨工具继续执行时写 `--executor-tool <codex|claude-code|codebuddy|cursor>`,并在接棒事件写 `--handoff-from-tool` / `--handoff-reason`;也可由 `HUNTER_HARNESS_TOOL/AGENT/MODEL/RUN_ID` 环境变量统一注入。
|
|
103
|
+
> 片段:logging · phase=`knowledge-ingest` · 记录 package hash、服务端状态与失败重试路径
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: harness-knowledge-query
|
|
3
|
+
description: 在规划、实现或排查前,通过 hunter-harness CLI 查询远端项目知识库。远端不可用时直接报告不可用,不建立本地索引或离线回退。
|
|
4
|
+
---
|
|
5
|
+
<!-- generated by harness_deploy.py; core=ec59ac2389d9dce9; overlay=none; agent=pi; do not edit -->
|
|
6
|
+
# harness-knowledge-query
|
|
7
|
+
|
|
8
|
+
项目知识以 Hunter Platform 的服务端索引为唯一真源。客户端只提交查询并消费结果:
|
|
9
|
+
|
|
10
|
+
- 不创建或读取 `.harness/knowledge`;
|
|
11
|
+
- 不运行本地 Python ingest、SQLite、FTS 或 context-pack 脚本;
|
|
12
|
+
- 不在网络或服务不可用时回退到本地归档;
|
|
13
|
+
- 查询失败只记录“本轮无远端知识”,后续工作必须依靠当前代码和用户提供的信息。
|
|
14
|
+
|
|
15
|
+
所有面向人的总结默认使用中文,代码标识符和原始路径保持原样。
|
|
16
|
+
|
|
17
|
+
## Triggers
|
|
18
|
+
|
|
19
|
+
- query knowledge / knowledge query
|
|
20
|
+
- 查询历史需求、决策或实现经验
|
|
21
|
+
- 结合之前做过的内容
|
|
22
|
+
- 规划或排查前读取项目知识
|
|
23
|
+
|
|
24
|
+
## Command
|
|
25
|
+
|
|
26
|
+
在项目根目录执行一次:
|
|
27
|
+
|
|
28
|
+
```powershell
|
|
29
|
+
powershell.exe -Command "npx hunter-harness knowledge query '<用户需求原文>' --limit 10 --json"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
只允许通过 CLI 访问平台,不得直接拼接 HTTP 请求,也不得调用旧的
|
|
33
|
+
本地知识查询脚本(该脚本已从当前分发包移除)。
|
|
34
|
+
|
|
35
|
+
## Workflow
|
|
36
|
+
|
|
37
|
+
1. 原样保留用户的需求或问题作为查询文本;已知范围较大时可将关键模块名一并放入文本。
|
|
38
|
+
2. 执行一次远端查询,不在查询前重建或同步知识。
|
|
39
|
+
3. 读取 JSON 中的命中项、来源路径、变更键和相关度。
|
|
40
|
+
4. 把命中内容作为历史线索;涉及当前行为时仍以当前代码和验证结果为准。
|
|
41
|
+
5. 若命令返回远端不可达、未绑定或未认证,记录明确 issue 后继续,不重试本地方案。
|
|
42
|
+
|
|
43
|
+
## Output Contract
|
|
44
|
+
|
|
45
|
+
必须说明:
|
|
46
|
+
|
|
47
|
+
- 查询文本与 limit;
|
|
48
|
+
- 是否成功访问远端;
|
|
49
|
+
- 命中数量及最相关来源;
|
|
50
|
+
- 远端不可用时,明确写“未使用本地回退”;
|
|
51
|
+
- 下一步是进入规划/实现,还是先核对当前代码。
|
|
52
|
+
|
|
53
|
+
## Forbidden Actions
|
|
54
|
+
|
|
55
|
+
- create_local_knowledge_index
|
|
56
|
+
- query_local_sqlite_or_archive_as_fallback
|
|
57
|
+
- generate_local_context_pack
|
|
58
|
+
- retry_with_legacy_python_knowledge_script
|
|
59
|
+
- treat_remote_history_as_current_code_fact
|
|
60
|
+
- copy_secrets_into_query
|
|
61
|
+
|
|
62
|
+
## P0 执行可信度规则
|
|
63
|
+
|
|
64
|
+
- 命令结果不得靠猜测;普通 Bash 被拒 → 立即改用等价 PowerShell 重试一次
|
|
65
|
+
- 仅 PowerShell 成功且有明确证据(构建/git/测试输出、文件存在、exit 0)时可标 ✅OK;否则 ❌FAIL 或 🟡WARN
|
|
66
|
+
- 禁止把 hook 拒绝、静态验证、无输出、用户跳过说成成功 → 详见 [[../protocols/powershell-protocol.md|powershell-protocol]]、[[../protocols/evidence-based-reporting-protocol.md|evidence-based-reporting-protocol]]
|
|
67
|
+
|
|
68
|
+
## 生成内容语言约定
|
|
69
|
+
|
|
70
|
+
- sync/ingest 等生成的文档、规则、知识条目、架构说明一律**优先使用中文**撰写(标识符、命令、代码、API 字段名保持原文)
|
|
71
|
+
- 面向平台展示的标题/摘要/正文默认中文;仅当用户明确要求或目标系统强制时才用英文
|
|
72
|
+
> 片段:p0-trust · 远端查询成功必须有 CLI JSON 证据;失败不得伪装为已读取历史
|
|
73
|
+
|
|
74
|
+
## 执行日志
|
|
75
|
+
|
|
76
|
+
`events.ndjson` 为唯一事实源(schema_version 3,兼容读取 v1/v2;`note` 承载人类可读摘要);`logs/execution-log.md` 由 `harness_events.py` 渲染,**禁止用 Write/Edit 直接维护**。直接修改的内容会在 `phase.end` 或 finalize 时被完整重建覆盖,属于数据丢失;需要保留的详情必须进入事件 `note`。结构 → [[../protocols/report-pipeline-protocol.md|report-pipeline-protocol]]
|
|
77
|
+
|
|
78
|
+
**`phase.start` 由 `harness_gate.py begin` 写,不要再手工追加一次。** 两条同 `run-id` 的
|
|
79
|
+
`phase.start` 会让 `plan finalize` 以 `PHASE_START_DUPLICATE` 卡死,而且手工那次会先触发
|
|
80
|
+
auto-seal、把正在开始的 attempt 封成 `RECOVERED`。要补触发指令说明就带 `--note` 跑 `gate begin`。
|
|
81
|
+
(重复追加现已按 `(phase, run-id)` 判为幂等 no-op,但依赖它不如不写。)
|
|
82
|
+
|
|
83
|
+
```powershell
|
|
84
|
+
# 阶段开始:gate begin 负责,note 在这里给
|
|
85
|
+
python <skills-root>/scripts/harness_gate.py begin --change-dir ".harness/changes/<change-name>" --phase <phase> --note "<触发指令>"
|
|
86
|
+
# 阶段中的其他事件才用 append
|
|
87
|
+
python <skills-root>/scripts/harness_events.py append --change-dir ".harness/changes/<change-name>" --phase <phase> --type <command|issue|verification> --run-id <phase-run-id> --note "<摘要>"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
> **脚本接线**:`harness_events.py append`;`harness_archive.py finalize`;`harness_preflight.py check`;`harness_ledger.py can-reuse`;`harness_service.py ensure/stop`(须 `--files`/`serviceStart.inputFiles`)。JSON 输出按 D13 护栏解读。
|
|
91
|
+
|
|
92
|
+
> **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 边界保持最新。
|
|
93
|
+
|
|
94
|
+
每个阶段的 `phase.start` 与对应 `phase.end` 必须复用同一 `--run-id` / `--attempt`;阶段结束必须写 `--status OK|WARN|FAIL|BLOCKED`。重试同一阶段时生成新的 run-id 并增加 `--attempt <n>`,不得覆盖或伪装成一次执行。**`attempt` 按 phase 全局递增,不是按 run-id**:一个 run-id 只绑定一个 attempt,重试必须「新 run-id + 下一个 attempt」两者同时换,只换其一会撞 `EVENT_ATTEMPT_CONFLICT` 或 `PHASE_ALREADY_CLOSED`。已发布 plan 的修订通过重跑 `plan evidence-pack` + `plan finalize` 分配新 attempt(`harness_plan_finalize.py republish` 已于 0.3.0 移除)。
|
|
95
|
+
|
|
96
|
+
阶段跑得久(plan/run 常见)时用 `harness_context.py renew --project . --change <cn> --executor <tool>` 续租;租约到期本身不再阻断 `close`(同一 owner 的过期租约不构成冲突,收据里记 `leaseLapsed`),但续租能让 `view` 的状态如实反映在跑。跨工具继续执行时写 `--executor-tool <codex|claude-code|codebuddy|cursor>`,并在接棒事件写 `--handoff-from-tool` / `--handoff-reason`;也可由 `HUNTER_HARNESS_TOOL/AGENT/MODEL/RUN_ID` 环境变量统一注入。
|
|
97
|
+
> 片段:logging · phase=`knowledge-query` · 成功记录命中摘要,失败记录远端错误码且不做本地回退
|