sdd-agent-platform 0.4.0 → 0.4.2
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/README.md +36 -39
- package/node_modules/@sdd-agent-platform/core/dist/ai-tools.js +72 -71
- package/node_modules/@sdd-agent-platform/core/dist/ai-tools.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/ingestion.js +64 -9
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/ingestion.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-evidence.js +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-evidence.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-result.js +26 -17
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-result.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/init-project.d.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/dist/config/init-project.js +13 -9
- package/node_modules/@sdd-agent-platform/core/dist/config/init-project.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/project-config.d.ts +3 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/project-config.js +7 -3
- package/node_modules/@sdd-agent-platform/core/dist/config/project-config.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.d.ts +4 -4
- package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.js +16 -20
- package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context/build-package.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context/build-package.js +1 -7
- package/node_modules/@sdd-agent-platform/core/dist/context/build-package.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context/evidence-summary.js +26 -8
- package/node_modules/@sdd-agent-platform/core/dist/context/evidence-summary.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context/log-worker.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/context/log-worker.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context-offload/contracts.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/contracts.d.ts +4 -1
- package/node_modules/@sdd-agent-platform/core/dist/contracts.js +3 -0
- package/node_modules/@sdd-agent-platform/core/dist/contracts.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/delegation/model.d.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/dist/delegation/validation.d.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/dist/delegation/validation.js +7 -4
- package/node_modules/@sdd-agent-platform/core/dist/delegation/validation.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/document-chain.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/document-chain.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/project.js +8 -8
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/project.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/registries.js +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/registries.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-evidence.js +7 -7
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-evidence.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-trust.js +0 -24
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-trust.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/runtime-contracts.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/runtime-contracts.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/doctor.js +277 -3
- package/node_modules/@sdd-agent-platform/core/dist/doctor/doctor.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.d.ts +23 -0
- package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.js +61 -0
- package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/evidence-runtime/contracts.d.ts +11 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/agent-execution-records.js +15 -8
- package/node_modules/@sdd-agent-platform/core/dist/execution/agent-execution-records.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/background-executor.js +4 -4
- package/node_modules/@sdd-agent-platform/core/dist/execution/background-executor.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/foreground-subagents.js +3 -3
- package/node_modules/@sdd-agent-platform/core/dist/execution/foreground-subagents.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/host-invocation.js +5 -4
- package/node_modules/@sdd-agent-platform/core/dist/execution/host-invocation.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/resident-worker.js +16 -7
- package/node_modules/@sdd-agent-platform/core/dist/execution/resident-worker.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/stage-team-runtime.d.ts +112 -0
- package/node_modules/@sdd-agent-platform/core/dist/execution/stage-team-runtime.js +145 -0
- package/node_modules/@sdd-agent-platform/core/dist/execution/stage-team-runtime.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/governance/policy.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/governance/policy.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/governance/policy.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/instructions.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/instructions.js +59 -66
- package/node_modules/@sdd-agent-platform/core/dist/instructions.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/decision-gate.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/decision-gate.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.d.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.js +55 -19
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/orchestration/contracts.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.d.ts +12 -2
- package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.js +62 -21
- package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.d.ts +20 -2
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.js +218 -18
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-registry.js +17 -17
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-registry.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-runtime-static.d.ts +10 -0
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-runtime-static.js +32 -2
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-runtime-static.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/capability-sources.d.ts +2 -17
- package/node_modules/@sdd-agent-platform/core/dist/registries/capability-sources.js +222 -10
- package/node_modules/@sdd-agent-platform/core/dist/registries/capability-sources.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.js +9 -9
- package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/eval-learning-context.js +4 -4
- package/node_modules/@sdd-agent-platform/core/dist/registries/eval-learning-context.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/query-status.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/registries/query-status.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/tool-capabilities.js +3 -3
- package/node_modules/@sdd-agent-platform/core/dist/registries/tool-capabilities.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/tool-plugins.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/registries/tool-plugins.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/worker-adapters.js +11 -11
- package/node_modules/@sdd-agent-platform/core/dist/registries/worker-adapters.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/workflow-gates.js +12 -12
- package/node_modules/@sdd-agent-platform/core/dist/registries/workflow-gates.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/risk/contracts.d.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/risk/kernel.js +4 -4
- package/node_modules/@sdd-agent-platform/core/dist/risk/kernel.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/risk/legacy-adapters.js +4 -7
- package/node_modules/@sdd-agent-platform/core/dist/risk/legacy-adapters.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/risk/workflow-gates.d.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/risk/workflow-gates.js +19 -17
- package/node_modules/@sdd-agent-platform/core/dist/risk/workflow-gates.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime-config.js +28 -13
- package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime-config.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime.d.ts +61 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.d.ts +3 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.js +192 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/routing.js +73 -17
- package/node_modules/@sdd-agent-platform/core/dist/router/routing.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-import.d.ts +28 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-import.js +373 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-import.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-inspection.js +11 -4
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-inspection.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-validation.js +31 -3
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-validation.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/stage-route-binding.d.ts +37 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/stage-route-binding.js +235 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/stage-route-binding.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/router.d.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/router.js +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/router.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/artifacts.d.ts +16 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/artifacts.js +168 -18
- package/node_modules/@sdd-agent-platform/core/dist/run-state/artifacts.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/events.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/run-state/events.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.d.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.js +22 -54
- package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/invocation-ledger.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/run-state/invocation-ledger.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/model.d.ts +53 -9
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-index.d.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-index.js +1 -3
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-index.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-state.js +51 -34
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-state.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.d.ts +65 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.js +169 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/timing.d.ts +8 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/timing.js +131 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/timing.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state.d.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state.js +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/build.js +0 -3
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/build.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/findings.js +5 -44
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/findings.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/model.d.ts +1 -17
- package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.d.ts +20 -0
- package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.js +109 -14
- package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/runtime-projection-p0.d.ts +64 -0
- package/node_modules/@sdd-agent-platform/core/dist/runtime-projection-p0.js +200 -0
- package/node_modules/@sdd-agent-platform/core/dist/runtime-projection-p0.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/context.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/context.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.d.ts +6 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.js +276 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/run-binding.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/run-binding.js +15 -4
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/run-binding.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.d.ts +21 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.js +139 -38
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/stage-artifacts.d.ts +55 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-artifacts.js +322 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-artifacts.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration-contracts.d.ts +55 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration-contracts.js +241 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration-contracts.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration.d.ts +888 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration.js +3870 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-runtime/runtime.js +8 -1
- package/node_modules/@sdd-agent-platform/core/dist/stage-runtime/runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/status/project-status.d.ts +105 -1
- package/node_modules/@sdd-agent-platform/core/dist/status/project-status.js +343 -8
- package/node_modules/@sdd-agent-platform/core/dist/status/project-status.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.d.ts +348 -3
- package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.js +1017 -8
- package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/subagents/contracts.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/subagents/runtime.js +7 -7
- package/node_modules/@sdd-agent-platform/core/dist/subagents/runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/test-support/fixtures.js +21 -0
- package/node_modules/@sdd-agent-platform/core/dist/test-support/fixtures.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.js +19 -20
- package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/truth-reconciliation.d.ts +44 -0
- package/node_modules/@sdd-agent-platform/core/dist/truth-reconciliation.js +138 -0
- package/node_modules/@sdd-agent-platform/core/dist/truth-reconciliation.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.d.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.js +44 -37
- package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.d.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.js +19 -49
- package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/review-gate.d.ts +22 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/review-gate.js +53 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/review-gate.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.d.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.js +213 -111
- package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.d.ts +28 -3
- package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.js +546 -125
- package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-cache.d.ts +26 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-cache.js +73 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-cache.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.d.ts +76 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.js +450 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.d.ts +3 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.js +105 -30
- package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification.d.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification.js +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/work-units/contracts.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.d.ts +24 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.js +395 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.d.ts +4 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.js +164 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.d.ts +4 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.js +182 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/types.d.ts +88 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/types.js +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/types.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.js +17 -3
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/dependencies.d.ts +8 -4
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/dependencies.js +25 -11
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/dependencies.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.d.ts +37 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.js +188 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/migration-recovery.d.ts +40 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/migration-recovery.js +110 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/migration-recovery.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/repair-contract.d.ts +12 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/repair-contract.js +63 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/repair-contract.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve-task-run.d.ts +21 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve-task-run.js +95 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve-task-run.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.d.ts +80 -3
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.js +674 -41
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/runtime-projections.d.ts +228 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/runtime-projections.js +452 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/runtime-projections.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state.d.ts +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state.js +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/package.json +3 -3
- package/node_modules/@sdd-agent-platform/core/src/ai-tools.test.ts +49 -1
- package/node_modules/@sdd-agent-platform/core/src/ai-tools.ts +72 -71
- package/node_modules/@sdd-agent-platform/core/src/artifacts/ingestion.test.ts +38 -0
- package/node_modules/@sdd-agent-platform/core/src/artifacts/ingestion.ts +65 -9
- package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-evidence.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-result.test.ts +52 -6
- package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-result.ts +26 -17
- package/node_modules/@sdd-agent-platform/core/src/config/init-project.test.ts +44 -29
- package/node_modules/@sdd-agent-platform/core/src/config/init-project.ts +15 -11
- package/node_modules/@sdd-agent-platform/core/src/config/project-config.ts +10 -4
- package/node_modules/@sdd-agent-platform/core/src/config/starter-documents.ts +17 -20
- package/node_modules/@sdd-agent-platform/core/src/context/build-package.ts +2 -8
- package/node_modules/@sdd-agent-platform/core/src/context/context-build.test.ts +3 -2
- package/node_modules/@sdd-agent-platform/core/src/context/evidence-summary.ts +27 -8
- package/node_modules/@sdd-agent-platform/core/src/context/log-worker.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/context-offload/contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/contracts.ts +4 -1
- package/node_modules/@sdd-agent-platform/core/src/delegation/model.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/src/delegation/validation.ts +8 -5
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/document-chain.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/project.ts +8 -8
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/registries.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/run-evidence.ts +7 -7
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/run-trust.ts +0 -21
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/runtime-contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/doctor/doctor.test.ts +217 -7
- package/node_modules/@sdd-agent-platform/core/src/doctor/doctor.ts +301 -3
- package/node_modules/@sdd-agent-platform/core/src/evidence/lookup.ts +88 -0
- package/node_modules/@sdd-agent-platform/core/src/evidence-runtime/contracts.ts +12 -1
- package/node_modules/@sdd-agent-platform/core/src/execution/agent-execution-records.ts +16 -11
- package/node_modules/@sdd-agent-platform/core/src/execution/background-executor.test.ts +57 -2
- package/node_modules/@sdd-agent-platform/core/src/execution/background-executor.ts +4 -4
- package/node_modules/@sdd-agent-platform/core/src/execution/foreground-subagents.test.ts +11 -2
- package/node_modules/@sdd-agent-platform/core/src/execution/foreground-subagents.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/src/execution/host-invocation.ts +5 -4
- package/node_modules/@sdd-agent-platform/core/src/execution/resident-worker.test.ts +17 -1
- package/node_modules/@sdd-agent-platform/core/src/execution/resident-worker.ts +16 -7
- package/node_modules/@sdd-agent-platform/core/src/execution/stage-team-runtime.test.ts +102 -0
- package/node_modules/@sdd-agent-platform/core/src/execution/stage-team-runtime.ts +271 -0
- package/node_modules/@sdd-agent-platform/core/src/execution/wave-executor.test.ts +14 -0
- package/node_modules/@sdd-agent-platform/core/src/governance/policy.test.ts +10 -0
- package/node_modules/@sdd-agent-platform/core/src/governance/policy.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/instructions.test.ts +34 -13
- package/node_modules/@sdd-agent-platform/core/src/instructions.ts +60 -67
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/decision-gate.test.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/decision-gate.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/ship.test.ts +47 -0
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/ship.ts +58 -19
- package/node_modules/@sdd-agent-platform/core/src/orchestration/contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/orchestration/runtime.ts +74 -22
- package/node_modules/@sdd-agent-platform/core/src/phase8-contracts.test.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/src/phase8-risk-kernel.test.ts +8 -3
- package/node_modules/@sdd-agent-platform/core/src/planning/task-graph.test.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/planning/wave-plan.test.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-capability-catalog.ts +319 -20
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-registry.ts +17 -17
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-runtime-static.ts +42 -2
- package/node_modules/@sdd-agent-platform/core/src/registries/capability-sources.ts +238 -15
- package/node_modules/@sdd-agent-platform/core/src/registries/command-team-runtime.ts +10 -10
- package/node_modules/@sdd-agent-platform/core/src/registries/eval-learning-context.ts +4 -4
- package/node_modules/@sdd-agent-platform/core/src/registries/query-status.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/registries/registries.test.ts +45 -4
- package/node_modules/@sdd-agent-platform/core/src/registries/tool-capabilities.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/src/registries/tool-plugins.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/registries/worker-adapters.ts +11 -11
- package/node_modules/@sdd-agent-platform/core/src/registries/workflow-gates.ts +12 -12
- package/node_modules/@sdd-agent-platform/core/src/risk/contracts.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/risk/kernel.ts +4 -4
- package/node_modules/@sdd-agent-platform/core/src/risk/legacy-adapters.ts +4 -7
- package/node_modules/@sdd-agent-platform/core/src/risk/workflow-gates.ts +20 -18
- package/node_modules/@sdd-agent-platform/core/src/router/agent-runtime-config.ts +32 -13
- package/node_modules/@sdd-agent-platform/core/src/router/agent-runtime.ts +68 -1
- package/node_modules/@sdd-agent-platform/core/src/router/route-projection.ts +212 -1
- package/node_modules/@sdd-agent-platform/core/src/router/route-sdd-task.test.ts +391 -6
- package/node_modules/@sdd-agent-platform/core/src/router/routing.ts +78 -17
- package/node_modules/@sdd-agent-platform/core/src/router/runtime-import.ts +453 -0
- package/node_modules/@sdd-agent-platform/core/src/router/runtime-inspection.ts +11 -4
- package/node_modules/@sdd-agent-platform/core/src/router/runtime-validation.ts +32 -3
- package/node_modules/@sdd-agent-platform/core/src/router/stage-route-binding.ts +279 -0
- package/node_modules/@sdd-agent-platform/core/src/router.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/run-state/artifacts.ts +173 -18
- package/node_modules/@sdd-agent-platform/core/src/run-state/events.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/run-state/inspect-run.ts +24 -59
- package/node_modules/@sdd-agent-platform/core/src/run-state/invocation-ledger.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/run-state/model.ts +59 -9
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-index.ts +1 -5
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-state.test.ts +53 -2
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-state.ts +55 -41
- package/node_modules/@sdd-agent-platform/core/src/run-state/task-evidence.ts +252 -0
- package/node_modules/@sdd-agent-platform/core/src/run-state/timing.ts +146 -0
- package/node_modules/@sdd-agent-platform/core/src/run-state.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/build.ts +0 -3
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/findings.ts +6 -46
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/model.ts +1 -13
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis.test.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/src/runtime-paths.ts +131 -14
- package/node_modules/@sdd-agent-platform/core/src/runtime-projection-p0.test.ts +96 -0
- package/node_modules/@sdd-agent-platform/core/src/runtime-projection-p0.ts +292 -0
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/context.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/document-hashes.ts +306 -0
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/run-binding.ts +15 -4
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.test.ts +261 -0
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.ts +169 -41
- package/node_modules/@sdd-agent-platform/core/src/stage-artifacts.ts +450 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-collaboration-contracts.ts +322 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-collaboration.test.ts +2903 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-collaboration.ts +5831 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-runtime/runtime.test.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/stage-runtime/runtime.ts +9 -1
- package/node_modules/@sdd-agent-platform/core/src/status/project-status.test.ts +239 -16
- package/node_modules/@sdd-agent-platform/core/src/status/project-status.ts +497 -8
- package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.test.ts +560 -4
- package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.ts +1510 -9
- package/node_modules/@sdd-agent-platform/core/src/subagents/contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/subagents/runtime.test.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/src/subagents/runtime.ts +7 -7
- package/node_modules/@sdd-agent-platform/core/src/test-support/fixtures.ts +21 -0
- package/node_modules/@sdd-agent-platform/core/src/test-support/run-state.ts +20 -20
- package/node_modules/@sdd-agent-platform/core/src/truth-reconciliation.test.ts +72 -0
- package/node_modules/@sdd-agent-platform/core/src/truth-reconciliation.ts +177 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/goal-verify.test.ts +13 -87
- package/node_modules/@sdd-agent-platform/core/src/verification/goal-verify.ts +46 -42
- package/node_modules/@sdd-agent-platform/core/src/verification/rendering.ts +18 -52
- package/node_modules/@sdd-agent-platform/core/src/verification/review-gate.test.ts +84 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/review-gate.ts +77 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/single-task-loop.test.ts +138 -64
- package/node_modules/@sdd-agent-platform/core/src/verification/single-task-loop.ts +226 -116
- package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.test.ts +148 -48
- package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.ts +619 -136
- package/node_modules/@sdd-agent-platform/core/src/verification/validation-cache.ts +106 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/validation-wave.test.ts +383 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/validation-wave.ts +556 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.test.ts +131 -8
- package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.ts +117 -30
- package/node_modules/@sdd-agent-platform/core/src/verification.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/work-units/contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/evidence-packet.ts +425 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.test.ts +507 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.ts +182 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.test.ts +174 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.ts +194 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/types.ts +115 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/affected-file-conflicts.ts +19 -4
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/dependencies.test.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/dependencies.ts +33 -11
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/latest-eligible-run.ts +224 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/migration-recovery.ts +158 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/repair-contract.ts +77 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve-task-run.ts +114 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve.test.ts +851 -9
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve.ts +862 -45
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/runtime-projections.ts +712 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state.ts +1 -0
- package/package.json +1 -1
- package/packages/cli/dist/args.js +2 -2
- package/packages/cli/dist/args.js.map +1 -1
- package/packages/cli/dist/commands/ai-tools.js +13 -2
- package/packages/cli/dist/commands/ai-tools.js.map +1 -1
- package/packages/cli/dist/commands/context.js +1 -1
- package/packages/cli/dist/commands/context.js.map +1 -1
- package/packages/cli/dist/commands/execution.js +49 -1
- package/packages/cli/dist/commands/execution.js.map +1 -1
- package/packages/cli/dist/commands/governance.js +1 -1
- package/packages/cli/dist/commands/governance.js.map +1 -1
- package/packages/cli/dist/commands/init.js +6 -1
- package/packages/cli/dist/commands/init.js.map +1 -1
- package/packages/cli/dist/commands/lifecycle.js +15 -2
- package/packages/cli/dist/commands/lifecycle.js.map +1 -1
- package/packages/cli/dist/commands/registry/runtime.js +48 -2
- package/packages/cli/dist/commands/registry/runtime.js.map +1 -1
- package/packages/cli/dist/commands/run.js +52 -2
- package/packages/cli/dist/commands/run.js.map +1 -1
- package/packages/cli/dist/commands/stage-close.d.ts +6 -0
- package/packages/cli/dist/commands/stage-close.js +295 -0
- package/packages/cli/dist/commands/stage-close.js.map +1 -0
- package/packages/cli/dist/commands/status.js +70 -4
- package/packages/cli/dist/commands/status.js.map +1 -1
- package/packages/cli/dist/commands/tasks.js +4 -4
- package/packages/cli/dist/commands/tasks.js.map +1 -1
- package/packages/cli/dist/commands/test.js +272 -5
- package/packages/cli/dist/commands/test.js.map +1 -1
- package/packages/cli/dist/commands/verifies.js +9 -5
- package/packages/cli/dist/commands/verifies.js.map +1 -1
- package/packages/cli/dist/commands/verify.js +257 -20
- package/packages/cli/dist/commands/verify.js.map +1 -1
- package/packages/cli/dist/dispatch.js +4 -9
- package/packages/cli/dist/dispatch.js.map +1 -1
- package/packages/cli/dist/help.js +42 -27
- package/packages/cli/dist/help.js.map +1 -1
- package/packages/cli/dist/renderers/doctor.js +1 -1
- package/packages/cli/dist/renderers/doctor.js.map +1 -1
- package/packages/cli/dist/renderers/execution.js +1 -1
- package/packages/cli/dist/renderers/execution.js.map +1 -1
- package/packages/cli/dist/renderers/json.d.ts +1 -0
- package/packages/cli/dist/renderers/json.js +3 -0
- package/packages/cli/dist/renderers/json.js.map +1 -1
- package/packages/cli/dist/renderers/registry-runtime.d.ts +2 -1
- package/packages/cli/dist/renderers/registry-runtime.js +27 -2
- package/packages/cli/dist/renderers/registry-runtime.js.map +1 -1
- package/packages/cli/dist/renderers/router.js +5 -3
- package/packages/cli/dist/renderers/router.js.map +1 -1
- package/packages/cli/dist/renderers/workflow.d.ts +0 -4
- package/packages/cli/dist/renderers/workflow.js +46 -84
- package/packages/cli/dist/renderers/workflow.js.map +1 -1
- package/packages/cli/dist/skill-import-args.d.ts +10 -0
- package/packages/cli/dist/skill-import-args.js +47 -0
- package/packages/cli/dist/skill-import-args.js.map +1 -0
- package/packages/cli/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/cli/package.json +2 -2
- package/packages/core/dist/ai-tools.js +72 -71
- package/packages/core/dist/ai-tools.js.map +1 -1
- package/packages/core/dist/artifacts/ingestion.js +64 -9
- package/packages/core/dist/artifacts/ingestion.js.map +1 -1
- package/packages/core/dist/artifacts/sdd-evidence.js +0 -1
- package/packages/core/dist/artifacts/sdd-evidence.js.map +1 -1
- package/packages/core/dist/artifacts/sdd-result.js +26 -17
- package/packages/core/dist/artifacts/sdd-result.js.map +1 -1
- package/packages/core/dist/config/init-project.d.ts +3 -0
- package/packages/core/dist/config/init-project.js +13 -9
- package/packages/core/dist/config/init-project.js.map +1 -1
- package/packages/core/dist/config/project-config.d.ts +3 -1
- package/packages/core/dist/config/project-config.js +7 -3
- package/packages/core/dist/config/project-config.js.map +1 -1
- package/packages/core/dist/config/starter-documents.d.ts +4 -4
- package/packages/core/dist/config/starter-documents.js +16 -20
- package/packages/core/dist/config/starter-documents.js.map +1 -1
- package/packages/core/dist/context/build-package.d.ts +1 -1
- package/packages/core/dist/context/build-package.js +1 -7
- package/packages/core/dist/context/build-package.js.map +1 -1
- package/packages/core/dist/context/evidence-summary.js +26 -8
- package/packages/core/dist/context/evidence-summary.js.map +1 -1
- package/packages/core/dist/context/log-worker.js +2 -2
- package/packages/core/dist/context/log-worker.js.map +1 -1
- package/packages/core/dist/context-offload/contracts.d.ts +1 -1
- package/packages/core/dist/contracts.d.ts +4 -1
- package/packages/core/dist/contracts.js +3 -0
- package/packages/core/dist/contracts.js.map +1 -1
- package/packages/core/dist/delegation/model.d.ts +3 -0
- package/packages/core/dist/delegation/validation.d.ts +3 -0
- package/packages/core/dist/delegation/validation.js +7 -4
- package/packages/core/dist/delegation/validation.js.map +1 -1
- package/packages/core/dist/doctor/checks/document-chain.js +1 -1
- package/packages/core/dist/doctor/checks/document-chain.js.map +1 -1
- package/packages/core/dist/doctor/checks/project.js +8 -8
- package/packages/core/dist/doctor/checks/project.js.map +1 -1
- package/packages/core/dist/doctor/checks/registries.js +0 -1
- package/packages/core/dist/doctor/checks/registries.js.map +1 -1
- package/packages/core/dist/doctor/checks/run-evidence.js +7 -7
- package/packages/core/dist/doctor/checks/run-evidence.js.map +1 -1
- package/packages/core/dist/doctor/checks/run-trust.js +0 -24
- package/packages/core/dist/doctor/checks/run-trust.js.map +1 -1
- package/packages/core/dist/doctor/checks/runtime-contracts.js +1 -1
- package/packages/core/dist/doctor/checks/runtime-contracts.js.map +1 -1
- package/packages/core/dist/doctor/doctor.js +277 -3
- package/packages/core/dist/doctor/doctor.js.map +1 -1
- package/packages/core/dist/evidence/lookup.d.ts +23 -0
- package/packages/core/dist/evidence/lookup.js +61 -0
- package/packages/core/dist/evidence/lookup.js.map +1 -0
- package/packages/core/dist/evidence-runtime/contracts.d.ts +11 -1
- package/packages/core/dist/execution/agent-execution-records.js +15 -8
- package/packages/core/dist/execution/agent-execution-records.js.map +1 -1
- package/packages/core/dist/execution/background-executor.js +4 -4
- package/packages/core/dist/execution/background-executor.js.map +1 -1
- package/packages/core/dist/execution/foreground-subagents.js +3 -3
- package/packages/core/dist/execution/foreground-subagents.js.map +1 -1
- package/packages/core/dist/execution/host-invocation.js +5 -4
- package/packages/core/dist/execution/host-invocation.js.map +1 -1
- package/packages/core/dist/execution/resident-worker.js +16 -7
- package/packages/core/dist/execution/resident-worker.js.map +1 -1
- package/packages/core/dist/execution/stage-team-runtime.d.ts +112 -0
- package/packages/core/dist/execution/stage-team-runtime.js +145 -0
- package/packages/core/dist/execution/stage-team-runtime.js.map +1 -0
- package/packages/core/dist/governance/policy.d.ts +1 -1
- package/packages/core/dist/governance/policy.js +1 -1
- package/packages/core/dist/governance/policy.js.map +1 -1
- package/packages/core/dist/instructions.d.ts +1 -1
- package/packages/core/dist/instructions.js +59 -66
- package/packages/core/dist/instructions.js.map +1 -1
- package/packages/core/dist/lifecycle/decision-gate.js +1 -1
- package/packages/core/dist/lifecycle/decision-gate.js.map +1 -1
- package/packages/core/dist/lifecycle/ship.d.ts +3 -0
- package/packages/core/dist/lifecycle/ship.js +55 -19
- package/packages/core/dist/lifecycle/ship.js.map +1 -1
- package/packages/core/dist/orchestration/contracts.d.ts +1 -1
- package/packages/core/dist/orchestration/runtime.d.ts +12 -2
- package/packages/core/dist/orchestration/runtime.js +62 -21
- package/packages/core/dist/orchestration/runtime.js.map +1 -1
- package/packages/core/dist/registries/agent-capability-catalog.d.ts +20 -2
- package/packages/core/dist/registries/agent-capability-catalog.js +218 -18
- package/packages/core/dist/registries/agent-capability-catalog.js.map +1 -1
- package/packages/core/dist/registries/agent-registry.js +17 -17
- package/packages/core/dist/registries/agent-registry.js.map +1 -1
- package/packages/core/dist/registries/agent-runtime-static.d.ts +10 -0
- package/packages/core/dist/registries/agent-runtime-static.js +32 -2
- package/packages/core/dist/registries/agent-runtime-static.js.map +1 -1
- package/packages/core/dist/registries/capability-sources.d.ts +2 -17
- package/packages/core/dist/registries/capability-sources.js +222 -10
- package/packages/core/dist/registries/capability-sources.js.map +1 -1
- package/packages/core/dist/registries/command-team-runtime.d.ts +1 -1
- package/packages/core/dist/registries/command-team-runtime.js +9 -9
- package/packages/core/dist/registries/command-team-runtime.js.map +1 -1
- package/packages/core/dist/registries/eval-learning-context.js +4 -4
- package/packages/core/dist/registries/eval-learning-context.js.map +1 -1
- package/packages/core/dist/registries/query-status.js +2 -2
- package/packages/core/dist/registries/query-status.js.map +1 -1
- package/packages/core/dist/registries/tool-capabilities.js +3 -3
- package/packages/core/dist/registries/tool-capabilities.js.map +1 -1
- package/packages/core/dist/registries/tool-plugins.js +2 -2
- package/packages/core/dist/registries/tool-plugins.js.map +1 -1
- package/packages/core/dist/registries/worker-adapters.js +11 -11
- package/packages/core/dist/registries/worker-adapters.js.map +1 -1
- package/packages/core/dist/registries/workflow-gates.js +12 -12
- package/packages/core/dist/registries/workflow-gates.js.map +1 -1
- package/packages/core/dist/risk/contracts.d.ts +2 -2
- package/packages/core/dist/risk/kernel.js +4 -4
- package/packages/core/dist/risk/kernel.js.map +1 -1
- package/packages/core/dist/risk/legacy-adapters.js +4 -7
- package/packages/core/dist/risk/legacy-adapters.js.map +1 -1
- package/packages/core/dist/risk/workflow-gates.d.ts +2 -2
- package/packages/core/dist/risk/workflow-gates.js +19 -17
- package/packages/core/dist/risk/workflow-gates.js.map +1 -1
- package/packages/core/dist/router/agent-runtime-config.js +28 -13
- package/packages/core/dist/router/agent-runtime-config.js.map +1 -1
- package/packages/core/dist/router/agent-runtime.d.ts +61 -1
- package/packages/core/dist/router/route-projection.d.ts +3 -1
- package/packages/core/dist/router/route-projection.js +192 -1
- package/packages/core/dist/router/route-projection.js.map +1 -1
- package/packages/core/dist/router/routing.js +73 -17
- package/packages/core/dist/router/routing.js.map +1 -1
- package/packages/core/dist/router/runtime-import.d.ts +28 -0
- package/packages/core/dist/router/runtime-import.js +373 -0
- package/packages/core/dist/router/runtime-import.js.map +1 -0
- package/packages/core/dist/router/runtime-inspection.js +11 -4
- package/packages/core/dist/router/runtime-inspection.js.map +1 -1
- package/packages/core/dist/router/runtime-validation.js +31 -3
- package/packages/core/dist/router/runtime-validation.js.map +1 -1
- package/packages/core/dist/router/stage-route-binding.d.ts +37 -0
- package/packages/core/dist/router/stage-route-binding.js +235 -0
- package/packages/core/dist/router/stage-route-binding.js.map +1 -0
- package/packages/core/dist/router.d.ts +2 -0
- package/packages/core/dist/router.js +2 -0
- package/packages/core/dist/router.js.map +1 -1
- package/packages/core/dist/run-state/artifacts.d.ts +16 -0
- package/packages/core/dist/run-state/artifacts.js +168 -18
- package/packages/core/dist/run-state/artifacts.js.map +1 -1
- package/packages/core/dist/run-state/events.js +2 -2
- package/packages/core/dist/run-state/events.js.map +1 -1
- package/packages/core/dist/run-state/inspect-run.d.ts +3 -3
- package/packages/core/dist/run-state/inspect-run.js +22 -54
- package/packages/core/dist/run-state/inspect-run.js.map +1 -1
- package/packages/core/dist/run-state/invocation-ledger.js +2 -2
- package/packages/core/dist/run-state/invocation-ledger.js.map +1 -1
- package/packages/core/dist/run-state/model.d.ts +53 -9
- package/packages/core/dist/run-state/run-index.d.ts +0 -2
- package/packages/core/dist/run-state/run-index.js +1 -3
- package/packages/core/dist/run-state/run-index.js.map +1 -1
- package/packages/core/dist/run-state/run-state.js +51 -34
- package/packages/core/dist/run-state/run-state.js.map +1 -1
- package/packages/core/dist/run-state/task-evidence.d.ts +65 -0
- package/packages/core/dist/run-state/task-evidence.js +169 -0
- package/packages/core/dist/run-state/task-evidence.js.map +1 -0
- package/packages/core/dist/run-state/timing.d.ts +8 -0
- package/packages/core/dist/run-state/timing.js +131 -0
- package/packages/core/dist/run-state/timing.js.map +1 -0
- package/packages/core/dist/run-state.d.ts +2 -0
- package/packages/core/dist/run-state.js +2 -0
- package/packages/core/dist/run-state.js.map +1 -1
- package/packages/core/dist/runtime-analysis/build.js +0 -3
- package/packages/core/dist/runtime-analysis/build.js.map +1 -1
- package/packages/core/dist/runtime-analysis/findings.js +5 -44
- package/packages/core/dist/runtime-analysis/findings.js.map +1 -1
- package/packages/core/dist/runtime-analysis/model.d.ts +1 -17
- package/packages/core/dist/runtime-paths.d.ts +20 -0
- package/packages/core/dist/runtime-paths.js +109 -14
- package/packages/core/dist/runtime-paths.js.map +1 -1
- package/packages/core/dist/runtime-projection-p0.d.ts +64 -0
- package/packages/core/dist/runtime-projection-p0.js +200 -0
- package/packages/core/dist/runtime-projection-p0.js.map +1 -0
- package/packages/core/dist/sdd-docs/context.js +1 -1
- package/packages/core/dist/sdd-docs/context.js.map +1 -1
- package/packages/core/dist/sdd-docs/document-hashes.d.ts +6 -0
- package/packages/core/dist/sdd-docs/document-hashes.js +276 -0
- package/packages/core/dist/sdd-docs/document-hashes.js.map +1 -0
- package/packages/core/dist/sdd-docs/run-binding.d.ts +1 -1
- package/packages/core/dist/sdd-docs/run-binding.js +15 -4
- package/packages/core/dist/sdd-docs/run-binding.js.map +1 -1
- package/packages/core/dist/sdd-docs/task-parser.d.ts +21 -0
- package/packages/core/dist/sdd-docs/task-parser.js +139 -38
- package/packages/core/dist/sdd-docs/task-parser.js.map +1 -1
- package/packages/core/dist/stage-artifacts.d.ts +55 -0
- package/packages/core/dist/stage-artifacts.js +322 -0
- package/packages/core/dist/stage-artifacts.js.map +1 -0
- package/packages/core/dist/stage-collaboration-contracts.d.ts +55 -0
- package/packages/core/dist/stage-collaboration-contracts.js +241 -0
- package/packages/core/dist/stage-collaboration-contracts.js.map +1 -0
- package/packages/core/dist/stage-collaboration.d.ts +888 -0
- package/packages/core/dist/stage-collaboration.js +3870 -0
- package/packages/core/dist/stage-collaboration.js.map +1 -0
- package/packages/core/dist/stage-runtime/runtime.js +8 -1
- package/packages/core/dist/stage-runtime/runtime.js.map +1 -1
- package/packages/core/dist/status/project-status.d.ts +105 -1
- package/packages/core/dist/status/project-status.js +343 -8
- package/packages/core/dist/status/project-status.js.map +1 -1
- package/packages/core/dist/storage/runtime-store.d.ts +348 -3
- package/packages/core/dist/storage/runtime-store.js +1017 -8
- package/packages/core/dist/storage/runtime-store.js.map +1 -1
- package/packages/core/dist/subagents/contracts.d.ts +1 -1
- package/packages/core/dist/subagents/runtime.js +7 -7
- package/packages/core/dist/subagents/runtime.js.map +1 -1
- package/packages/core/dist/test-support/fixtures.js +21 -0
- package/packages/core/dist/test-support/fixtures.js.map +1 -1
- package/packages/core/dist/test-support/run-state.d.ts +1 -1
- package/packages/core/dist/test-support/run-state.js +19 -20
- package/packages/core/dist/test-support/run-state.js.map +1 -1
- package/packages/core/dist/truth-reconciliation.d.ts +44 -0
- package/packages/core/dist/truth-reconciliation.js +138 -0
- package/packages/core/dist/truth-reconciliation.js.map +1 -0
- package/packages/core/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/core/dist/verification/goal-verify.d.ts +0 -1
- package/packages/core/dist/verification/goal-verify.js +44 -37
- package/packages/core/dist/verification/goal-verify.js.map +1 -1
- package/packages/core/dist/verification/rendering.d.ts +0 -2
- package/packages/core/dist/verification/rendering.js +19 -49
- package/packages/core/dist/verification/rendering.js.map +1 -1
- package/packages/core/dist/verification/review-gate.d.ts +22 -0
- package/packages/core/dist/verification/review-gate.js +53 -0
- package/packages/core/dist/verification/review-gate.js.map +1 -0
- package/packages/core/dist/verification/single-task-loop.d.ts +0 -1
- package/packages/core/dist/verification/single-task-loop.js +213 -111
- package/packages/core/dist/verification/single-task-loop.js.map +1 -1
- package/packages/core/dist/verification/test-runtime.d.ts +28 -3
- package/packages/core/dist/verification/test-runtime.js +546 -125
- package/packages/core/dist/verification/test-runtime.js.map +1 -1
- package/packages/core/dist/verification/validation-cache.d.ts +26 -0
- package/packages/core/dist/verification/validation-cache.js +73 -0
- package/packages/core/dist/verification/validation-cache.js.map +1 -0
- package/packages/core/dist/verification/validation-wave.d.ts +76 -0
- package/packages/core/dist/verification/validation-wave.js +450 -0
- package/packages/core/dist/verification/validation-wave.js.map +1 -0
- package/packages/core/dist/verification/verify-contract.d.ts +3 -1
- package/packages/core/dist/verification/verify-contract.js +105 -30
- package/packages/core/dist/verification/verify-contract.js.map +1 -1
- package/packages/core/dist/verification.d.ts +2 -0
- package/packages/core/dist/verification.js +2 -0
- package/packages/core/dist/verification.js.map +1 -1
- package/packages/core/dist/work-units/contracts.d.ts +1 -1
- package/packages/core/dist/workflow-gate/evidence-packet.d.ts +24 -0
- package/packages/core/dist/workflow-gate/evidence-packet.js +395 -0
- package/packages/core/dist/workflow-gate/evidence-packet.js.map +1 -0
- package/packages/core/dist/workflow-gate/hard-checks.d.ts +4 -0
- package/packages/core/dist/workflow-gate/hard-checks.js +164 -0
- package/packages/core/dist/workflow-gate/hard-checks.js.map +1 -0
- package/packages/core/dist/workflow-gate/policy.d.ts +4 -0
- package/packages/core/dist/workflow-gate/policy.js +182 -0
- package/packages/core/dist/workflow-gate/policy.js.map +1 -0
- package/packages/core/dist/workflow-gate/types.d.ts +88 -0
- package/packages/core/dist/workflow-gate/types.js +2 -0
- package/packages/core/dist/workflow-gate/types.js.map +1 -0
- package/packages/core/dist/workflow-state/affected-file-conflicts.d.ts +1 -1
- package/packages/core/dist/workflow-state/affected-file-conflicts.js +17 -3
- package/packages/core/dist/workflow-state/affected-file-conflicts.js.map +1 -1
- package/packages/core/dist/workflow-state/dependencies.d.ts +8 -4
- package/packages/core/dist/workflow-state/dependencies.js +25 -11
- package/packages/core/dist/workflow-state/dependencies.js.map +1 -1
- package/packages/core/dist/workflow-state/latest-eligible-run.d.ts +37 -0
- package/packages/core/dist/workflow-state/latest-eligible-run.js +188 -0
- package/packages/core/dist/workflow-state/latest-eligible-run.js.map +1 -0
- package/packages/core/dist/workflow-state/migration-recovery.d.ts +40 -0
- package/packages/core/dist/workflow-state/migration-recovery.js +110 -0
- package/packages/core/dist/workflow-state/migration-recovery.js.map +1 -0
- package/packages/core/dist/workflow-state/repair-contract.d.ts +12 -0
- package/packages/core/dist/workflow-state/repair-contract.js +63 -0
- package/packages/core/dist/workflow-state/repair-contract.js.map +1 -0
- package/packages/core/dist/workflow-state/resolve-task-run.d.ts +21 -0
- package/packages/core/dist/workflow-state/resolve-task-run.js +95 -0
- package/packages/core/dist/workflow-state/resolve-task-run.js.map +1 -0
- package/packages/core/dist/workflow-state/resolve.d.ts +80 -3
- package/packages/core/dist/workflow-state/resolve.js +674 -41
- package/packages/core/dist/workflow-state/resolve.js.map +1 -1
- package/packages/core/dist/workflow-state/runtime-projections.d.ts +228 -0
- package/packages/core/dist/workflow-state/runtime-projections.js +452 -0
- package/packages/core/dist/workflow-state/runtime-projections.js.map +1 -0
- package/packages/core/dist/workflow-state.d.ts +1 -0
- package/packages/core/dist/workflow-state.js +1 -0
- package/packages/core/dist/workflow-state.js.map +1 -1
- package/packages/core/package.json +3 -3
- package/node_modules/@sdd-agent-platform/core/dist/doctor/render.d.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/dist/doctor/render.js +0 -44
- package/node_modules/@sdd-agent-platform/core/dist/doctor/render.js.map +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.d.ts +0 -17
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.js +0 -221
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.js.map +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.d.ts +0 -91
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.js +0 -395
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.js.map +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/sync-back.d.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/dist/sync-back.js +0 -3
- package/node_modules/@sdd-agent-platform/core/dist/sync-back.js.map +0 -1
- package/node_modules/@sdd-agent-platform/core/src/sync-back/apply.ts +0 -248
- package/node_modules/@sdd-agent-platform/core/src/sync-back/inspect.ts +0 -522
- package/node_modules/@sdd-agent-platform/core/src/sync-back/sync-back.test.ts +0 -446
- package/node_modules/@sdd-agent-platform/core/src/sync-back.ts +0 -2
- package/packages/cli/dist/commands/artifact.d.ts +0 -6
- package/packages/cli/dist/commands/artifact.js +0 -168
- package/packages/cli/dist/commands/artifact.js.map +0 -1
- package/packages/cli/dist/commands/sync-back.d.ts +0 -6
- package/packages/cli/dist/commands/sync-back.js +0 -82
- package/packages/cli/dist/commands/sync-back.js.map +0 -1
- package/packages/cli/dist/renderers/artifacts.d.ts +0 -5
- package/packages/cli/dist/renderers/artifacts.js +0 -43
- package/packages/cli/dist/renderers/artifacts.js.map +0 -1
- package/packages/core/dist/doctor/render.d.ts +0 -2
- package/packages/core/dist/doctor/render.js +0 -44
- package/packages/core/dist/doctor/render.js.map +0 -1
- package/packages/core/dist/sync-back/apply.d.ts +0 -17
- package/packages/core/dist/sync-back/apply.js +0 -221
- package/packages/core/dist/sync-back/apply.js.map +0 -1
- package/packages/core/dist/sync-back/inspect.d.ts +0 -91
- package/packages/core/dist/sync-back/inspect.js +0 -395
- package/packages/core/dist/sync-back/inspect.js.map +0 -1
- package/packages/core/dist/sync-back.d.ts +0 -2
- package/packages/core/dist/sync-back.js +0 -3
- package/packages/core/dist/sync-back.js.map +0 -1
|
@@ -1,32 +1,36 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
2
|
import { spawn } from 'node:child_process';
|
|
3
3
|
import { appendEvent } from '../run-state/events.js';
|
|
4
|
-
import { appendInvocationLedgerEntry } from '../run-state/invocation-ledger.js';
|
|
5
|
-
import { createRun, readRunState, writeRunState } from '../run-state/run-state.js';
|
|
6
|
-
import {
|
|
4
|
+
import { appendArtifactHashLedgerEntry, appendInvocationLedgerEntry } from '../run-state/invocation-ledger.js';
|
|
5
|
+
import { createRun, readAllRunStates, readRunState, writeRunState } from '../run-state/run-state.js';
|
|
6
|
+
import { recordRuntimeOnlyArtifact, recordStageEvidenceArtifact } from '../run-state/artifacts.js';
|
|
7
|
+
import { toBranchStageEvidenceRef } from '../runtime-paths.js';
|
|
7
8
|
import { resolveSddContext } from '../sdd-docs/context.js';
|
|
8
9
|
import { bindRunStateToTask } from '../sdd-docs/run-binding.js';
|
|
9
10
|
import { parseSddBranch } from '../sdd-docs/task-parser.js';
|
|
10
|
-
import {
|
|
11
|
+
import { inspectSddTask } from '../sdd-docs/task-inspection.js';
|
|
12
|
+
import { listRuntimeArtifactPayloads, readRuntimeValidationCacheEntry, recordRuntimeAcceptanceEvidenceMap, recordRuntimeDurableGap, recordRuntimeProjection, recordRuntimeTestRun, recordRuntimeTestStep, recordRuntimeValidationCacheEntry, recordRuntimeValidationCacheUse, recordRuntimeValidationEnvironmentSession, recordRuntimeValidationWaveRun, runtimeScopedId, updateRuntimeDurableGapStatus } from '../storage/runtime-store.js';
|
|
11
13
|
import { ACCEPTANCE_POLICY_RULESET_VERSION, SDD_EVIDENCE_CONTRACT, SDD_EVIDENCE_VERSION, SDD_RESULT_CONTRACT, SDD_RESULT_VERSION, TEST_EVIDENCE_RUN_CONTRACT_VERSION, WORKFLOW_HANDOFF_CONTRACT_VERSION } from '../contracts.js';
|
|
12
|
-
import { inspectVerifyContract
|
|
14
|
+
import { inspectVerifyContract } from './verify-contract.js';
|
|
13
15
|
import { ensureTaskOrchestration, inspectOrchestrationGate } from '../orchestration/runtime.js';
|
|
14
16
|
import { recordStageRunProjection, recordWorkflowHandoffProjection, validateWorkflowHandoff } from '../stage-runtime/runtime.js';
|
|
15
17
|
import { evaluateTaskWorkflowGate, verifyContractBlockedGate } from '../risk.js';
|
|
16
18
|
import { validateSddResultArtifact } from '../artifacts/sdd-result.js';
|
|
17
19
|
import { dependencyBlockingReasonsForTask } from '../workflow-state/dependencies.js';
|
|
20
|
+
import { selectLatestEligibleRunsByTask } from '../workflow-state/latest-eligible-run.js';
|
|
21
|
+
import { latestRuntimeTaskStates } from '../workflow-state/resolve.js';
|
|
22
|
+
import { routeSddTask } from '../router/route-sdd-task.js';
|
|
23
|
+
import { evaluateAndRecordWorkflowGateDecision } from '../workflow-gate/evidence-packet.js';
|
|
24
|
+
import { buildValidationCachePlan } from './validation-cache.js';
|
|
18
25
|
const DEFAULT_TEST_TIMEOUT_MS = 120_000;
|
|
19
26
|
const MAX_CAPTURE_BYTES = 256 * 1024;
|
|
20
27
|
export async function runSddTest(projectRoot, options) {
|
|
21
28
|
const context = await resolveSddContext(projectRoot, { branch: options.branch ?? undefined, branchSource: options.branch ? 'cli_option' : undefined });
|
|
22
|
-
|
|
23
|
-
|
|
29
|
+
const model = await parseSddBranch(projectRoot, context.partition);
|
|
30
|
+
const inspected = inspectSddTask(model, options.taskId);
|
|
31
|
+
const task = inspected.task;
|
|
24
32
|
const verifyContract = await ensureVerifyContractForTest(projectRoot, context.partition);
|
|
25
33
|
const verifyInspection = verifyContract.inspection;
|
|
26
|
-
if (verifyContract.action === 'created' || verifyContract.action === 'refreshed') {
|
|
27
|
-
model = await parseSddBranch(projectRoot, context.partition);
|
|
28
|
-
task = model.tasks.find((candidate) => candidate.id === options.taskId) ?? null;
|
|
29
|
-
}
|
|
30
34
|
const initialState = options.runId ? await readRunState(projectRoot, options.runId) : await createRun(projectRoot);
|
|
31
35
|
const state = await bindRunStateToTask(projectRoot, initialState, context, model, task, options.taskId);
|
|
32
36
|
const testRunId = runtimeScopedId(state.runId, options.taskId, new Date().toISOString(), 'sdd-test');
|
|
@@ -34,17 +38,51 @@ export async function runSddTest(projectRoot, options) {
|
|
|
34
38
|
const commands = commandInputs.map((input) => input.command);
|
|
35
39
|
const gaps = [];
|
|
36
40
|
const startedAt = new Date().toISOString();
|
|
41
|
+
const ownsValidationWave = !options.validationWave;
|
|
42
|
+
const validationWaveRunId = options.validationWave?.waveRunId ?? runtimeScopedId(context.partition, options.taskId, state.runId, testRunId, 'validation-wave');
|
|
43
|
+
const validationEnvironmentSessionId = options.validationWave?.environmentSessionId ?? runtimeScopedId(context.partition, validationWaveRunId, 'validation-env');
|
|
44
|
+
const validationWaveTaskIds = options.validationWave?.taskIds ?? [options.taskId];
|
|
45
|
+
const validationWaveAcceptanceRefs = options.validationWave?.acceptanceRefsByTask?.[options.taskId];
|
|
46
|
+
const validationWaveScopeAcceptanceRefs = [...new Set(Object.values(options.validationWave?.acceptanceRefsByTask ?? { [options.taskId]: task?.acceptanceRefs ?? [] }).flat())].sort();
|
|
47
|
+
if (ownsValidationWave) {
|
|
48
|
+
await recordRuntimeValidationEnvironmentSession(projectRoot, {
|
|
49
|
+
sessionId: validationEnvironmentSessionId,
|
|
50
|
+
partition: context.partition,
|
|
51
|
+
runId: state.runId,
|
|
52
|
+
waveRunId: validationWaveRunId,
|
|
53
|
+
status: 'active',
|
|
54
|
+
reuseKey: `${context.partition}:${options.taskId}`,
|
|
55
|
+
createdAt: startedAt,
|
|
56
|
+
updatedAt: startedAt,
|
|
57
|
+
payload: { contract: 'phase-8.17-validation-wave-runtime-v1', mode: 'single-task' }
|
|
58
|
+
});
|
|
59
|
+
await recordRuntimeValidationWaveRun(projectRoot, {
|
|
60
|
+
waveRunId: validationWaveRunId,
|
|
61
|
+
partition: context.partition,
|
|
62
|
+
runId: state.runId,
|
|
63
|
+
taskIds: validationWaveTaskIds,
|
|
64
|
+
status: 'RUNNING',
|
|
65
|
+
environmentSessionId: validationEnvironmentSessionId,
|
|
66
|
+
startedAt,
|
|
67
|
+
completedAt: startedAt,
|
|
68
|
+
payload: { contract: 'phase-8.17-validation-wave-runtime-v1', mode: 'single-task', taskId: options.taskId }
|
|
69
|
+
});
|
|
70
|
+
}
|
|
37
71
|
await appendEvent(projectRoot, state.runId, {
|
|
38
72
|
event: 'test_runtime_started',
|
|
39
73
|
runId: state.runId,
|
|
40
74
|
summary: `SDD test runtime started for ${options.taskId}`,
|
|
41
75
|
data: { taskId: options.taskId, branch: context.partition, testRunId, commands }
|
|
42
76
|
});
|
|
77
|
+
const states = await readAllRunStates(projectRoot);
|
|
78
|
+
const latestEligibleRunsByTask = selectLatestEligibleRunsByTask({ states, model, partition: context.partition, currentGitBranch: context.currentGitBranch });
|
|
79
|
+
const runtimeByTask = latestRuntimeTaskStates(latestEligibleRunsByTask, states);
|
|
43
80
|
if (!task) {
|
|
44
81
|
gaps.push(`Task ${options.taskId} was not found in specs/${context.partition}/tasks.md.`);
|
|
45
82
|
}
|
|
46
83
|
if (task) {
|
|
47
|
-
gaps.push(...
|
|
84
|
+
gaps.push(...inspected.gaps.filter((gap) => gap.severity === 'blocking').map((gap) => `${gap.field}: ${gap.message}`));
|
|
85
|
+
gaps.push(...dependencyBlockingReasonsForTask(model, options.taskId, { runtimeByTask }));
|
|
48
86
|
}
|
|
49
87
|
if (verifyContract.action === 'blocked') {
|
|
50
88
|
gaps.push(verifyContractBlocker(verifyInspection));
|
|
@@ -91,7 +129,7 @@ export async function runSddTest(projectRoot, options) {
|
|
|
91
129
|
const steps = [];
|
|
92
130
|
if (gaps.length === 0) {
|
|
93
131
|
for (const [index, commandInput] of commandInputs.entries()) {
|
|
94
|
-
const step = await runCommandStep(projectRoot, state.runId, context.partition, options.taskId, testRunId, index + 1, commandInput, acceptanceRefsForCommand(task, commandInput.command), options.timeoutMs ?? DEFAULT_TEST_TIMEOUT_MS);
|
|
132
|
+
const step = await runCommandStep(projectRoot, state.runId, context.partition, options.taskId, testRunId, index + 1, commandInput, acceptanceRefsForCommand(task, commandInput.command, validationWaveAcceptanceRefs), options.timeoutMs ?? DEFAULT_TEST_TIMEOUT_MS, model, task, validationWaveTaskIds, validationWaveScopeAcceptanceRefs);
|
|
95
133
|
steps.push(step);
|
|
96
134
|
await appendEvent(projectRoot, state.runId, {
|
|
97
135
|
event: 'test_step_completed',
|
|
@@ -102,40 +140,29 @@ export async function runSddTest(projectRoot, options) {
|
|
|
102
140
|
}
|
|
103
141
|
}
|
|
104
142
|
const commandStatus = deriveCommandStatus(gaps, steps);
|
|
105
|
-
const acceptanceCoverage = buildAcceptanceCoverage(task, steps, commandStatus);
|
|
143
|
+
const acceptanceCoverage = buildAcceptanceCoverage(task, steps, commandStatus, validationWaveAcceptanceRefs);
|
|
106
144
|
const evidenceCoverage = summarizeEvidenceCoverage(acceptanceCoverage);
|
|
107
145
|
const policyJudgment = derivePolicyJudgment(commandStatus, evidenceCoverage);
|
|
108
|
-
|
|
109
|
-
const
|
|
110
|
-
const
|
|
111
|
-
const
|
|
112
|
-
const
|
|
113
|
-
|
|
146
|
+
await recordAcceptanceEvidenceMaps(projectRoot, validationWaveRunId, testRunId, context.partition, state.runId, options.taskId, acceptanceCoverage);
|
|
147
|
+
const validationStatus = policyJudgment;
|
|
148
|
+
const capabilityRoute = task ? await routeSddTask(projectRoot, { taskId: options.taskId, branch: context.partition, approved: options.approved }) : null;
|
|
149
|
+
const capabilityEvidence = buildCapabilityEvidenceClassification(capabilityRoute?.capabilityDecision ?? null, steps);
|
|
150
|
+
const validationArtifact = task ? await writeValidationArtifact(projectRoot, state.runId, context.partition, task, validationStatus, steps, gaps, capabilityEvidence) : null;
|
|
151
|
+
const evidenceBeforeGate = runtimeEvidenceRefs(validationArtifact?.runRelativePath ?? null, steps);
|
|
152
|
+
await persistTestRunState(projectRoot, state, options.taskId, validationStatus, commands, evidenceBeforeGate, validationArtifact?.runRelativePath ?? null);
|
|
153
|
+
await resolveTestRuntimeDurableGap(projectRoot, context.partition, state.runId, options.taskId, validationStatus, gaps);
|
|
154
|
+
const gateDecision = (await evaluateAndRecordWorkflowGateDecision(projectRoot, {
|
|
114
155
|
branch: context.partition,
|
|
115
156
|
taskId: options.taskId,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
primaryReason: workflowGate.primaryReason,
|
|
124
|
-
commandStatus,
|
|
125
|
-
evidenceCoverage,
|
|
126
|
-
policyJudgment,
|
|
127
|
-
acceptanceCoverage,
|
|
128
|
-
syncBackReady,
|
|
129
|
-
commands,
|
|
130
|
-
steps,
|
|
131
|
-
validationArtifact: validationArtifact?.runRelativePath ?? null,
|
|
132
|
-
gaps
|
|
133
|
-
});
|
|
157
|
+
runId: state.runId,
|
|
158
|
+
decisionKind: 'test'
|
|
159
|
+
})).decision;
|
|
160
|
+
const runtimeJudgment = gateDecision.status;
|
|
161
|
+
const status = finalStatusForTest(validationStatus, runtimeJudgment);
|
|
162
|
+
await recordTestRuntimeDurableGap(projectRoot, context.partition, state.runId, options.taskId, status, validationStatus, runtimeJudgment, gaps, evidenceBeforeGate);
|
|
163
|
+
const unifiedEvidence = buildUnifiedTestEvidenceRun(testRunId, context.partition, state.runId, options.taskId, commandStatus, evidenceCoverage, policyJudgment, status, runtimeJudgment, steps, acceptanceCoverage, capabilityEvidence, gaps, workflowGate.nextAction, gateDecision);
|
|
134
164
|
const completedAt = new Date().toISOString();
|
|
135
|
-
const evidence =
|
|
136
|
-
const syncBackProposal = syncBackReady
|
|
137
|
-
? await writeTestSyncBackProposal(projectRoot, state.runId, options.taskId, evidence, acceptanceCoverage)
|
|
138
|
-
: null;
|
|
165
|
+
const evidence = runtimeEvidenceRefs(validationArtifact?.runRelativePath ?? null, steps);
|
|
139
166
|
await recordRuntimeTestRun(projectRoot, {
|
|
140
167
|
testRunId,
|
|
141
168
|
runId: state.runId,
|
|
@@ -144,7 +171,7 @@ export async function runSddTest(projectRoot, options) {
|
|
|
144
171
|
status,
|
|
145
172
|
startedAt,
|
|
146
173
|
completedAt,
|
|
147
|
-
payload: { verifyContractStatus: verifyInspection.status, verifyContractAction: verifyContract.action, lifecycleGate: workflowGate.lifecycleGate, lifecycleProfile: workflowGate.lifecycleProfile, approvalPolicy: workflowGate.approvalPolicy, requiredStages: workflowGate.requiredStages, primaryReason: workflowGate.primaryReason, commandStatus, evidenceCoverage, policyJudgment, acceptanceCoverage,
|
|
174
|
+
payload: { verifyContractStatus: verifyInspection.status, verifyContractAction: verifyContract.action, lifecycleGate: workflowGate.lifecycleGate, lifecycleProfile: workflowGate.lifecycleProfile, approvalPolicy: workflowGate.approvalPolicy, requiredStages: workflowGate.requiredStages, primaryReason: workflowGate.primaryReason, commandStatus, evidenceCoverage, policyJudgment, validationStatus, workflowGateStatus: gateDecision.status, runtimeJudgment, workflowGateDecision: gateDecision, acceptanceCoverage, capabilityEvidence, commands, commandInputs, evidence, gaps }
|
|
148
175
|
});
|
|
149
176
|
await recordRuntimeProjection(projectRoot, 'test_runtime', `${context.partition}:${options.taskId}:${state.runId}`, {
|
|
150
177
|
contract: 'sdd-test-runtime-v1',
|
|
@@ -152,6 +179,9 @@ export async function runSddTest(projectRoot, options) {
|
|
|
152
179
|
runId: state.runId,
|
|
153
180
|
taskId: options.taskId,
|
|
154
181
|
status,
|
|
182
|
+
validationStatus,
|
|
183
|
+
workflowGateStatus: gateDecision.status,
|
|
184
|
+
runtimeJudgment,
|
|
155
185
|
lifecycleGate: workflowGate.lifecycleGate,
|
|
156
186
|
primaryReason: workflowGate.primaryReason,
|
|
157
187
|
evidence,
|
|
@@ -167,20 +197,50 @@ export async function runSddTest(projectRoot, options) {
|
|
|
167
197
|
gaps,
|
|
168
198
|
riskDecision: orchestration.riskDecision
|
|
169
199
|
});
|
|
170
|
-
await
|
|
200
|
+
await persistTestGateOutcome(projectRoot, state.runId, options.taskId, status, validationStatus, commands, evidence, validationArtifact?.runRelativePath ?? null, gateDecision);
|
|
201
|
+
if (ownsValidationWave) {
|
|
202
|
+
await recordRuntimeValidationWaveRun(projectRoot, {
|
|
203
|
+
waveRunId: validationWaveRunId,
|
|
204
|
+
partition: context.partition,
|
|
205
|
+
runId: state.runId,
|
|
206
|
+
taskIds: validationWaveTaskIds,
|
|
207
|
+
status,
|
|
208
|
+
environmentSessionId: validationEnvironmentSessionId,
|
|
209
|
+
startedAt,
|
|
210
|
+
completedAt,
|
|
211
|
+
payload: { contract: 'phase-8.17-validation-wave-runtime-v1', mode: 'single-task', taskId: options.taskId, testRunId, evidence, gaps, workflowGateDecision: gateDecision }
|
|
212
|
+
});
|
|
213
|
+
await recordRuntimeValidationEnvironmentSession(projectRoot, {
|
|
214
|
+
sessionId: validationEnvironmentSessionId,
|
|
215
|
+
partition: context.partition,
|
|
216
|
+
runId: state.runId,
|
|
217
|
+
waveRunId: validationWaveRunId,
|
|
218
|
+
status: status === 'PASS' ? 'completed' : status === 'FAIL' ? 'failed' : 'blocked',
|
|
219
|
+
reuseKey: `${context.partition}:${options.taskId}`,
|
|
220
|
+
createdAt: startedAt,
|
|
221
|
+
updatedAt: completedAt,
|
|
222
|
+
payload: { contract: 'phase-8.17-validation-wave-runtime-v1', mode: 'single-task', taskId: options.taskId, validationStatus, workflowGateStatus: gateDecision.status, status }
|
|
223
|
+
});
|
|
224
|
+
}
|
|
171
225
|
await appendEvent(projectRoot, state.runId, {
|
|
172
|
-
event: status === 'PASS' ? 'test_runtime_passed' : '
|
|
226
|
+
event: status === 'PASS' ? 'test_runtime_passed' : 'test_runtime_blocked',
|
|
173
227
|
runId: state.runId,
|
|
174
228
|
summary: `SDD test runtime ${status} for ${options.taskId}`,
|
|
175
|
-
data: { taskId: options.taskId, testRunId, status, evidence, gaps }
|
|
229
|
+
data: { taskId: options.taskId, testRunId, status, validationStatus, evidence, gaps, gateDecisionId: gateDecision.decisionId, gateStatus: gateDecision.status }
|
|
176
230
|
});
|
|
177
231
|
return {
|
|
178
232
|
contract: 'sdd-test-runtime-v1',
|
|
179
233
|
runId: state.runId,
|
|
180
234
|
testRunId,
|
|
235
|
+
validationWaveRunId,
|
|
236
|
+
validationEnvironmentSessionId,
|
|
181
237
|
branch: context.partition,
|
|
182
238
|
taskId: options.taskId,
|
|
183
239
|
status,
|
|
240
|
+
validationStatus,
|
|
241
|
+
workflowGateStatus: gateDecision.status,
|
|
242
|
+
runtimeJudgment,
|
|
243
|
+
workflowGateDecision: gateDecision,
|
|
184
244
|
verifyContractStatus: verifyInspection.status,
|
|
185
245
|
verifyContractAction: verifyContract.action,
|
|
186
246
|
lifecycleGate: workflowGate.lifecycleGate,
|
|
@@ -192,15 +252,34 @@ export async function runSddTest(projectRoot, options) {
|
|
|
192
252
|
evidenceCoverage,
|
|
193
253
|
policyJudgment,
|
|
194
254
|
acceptanceCoverage,
|
|
195
|
-
|
|
255
|
+
capabilityEvidence,
|
|
196
256
|
commands,
|
|
197
257
|
steps,
|
|
198
258
|
validationArtifact: validationArtifact?.runRelativePath ?? null,
|
|
199
|
-
indexArtifact:
|
|
259
|
+
indexArtifact: null,
|
|
200
260
|
gaps,
|
|
201
|
-
next: nextForTestResult(status, context.partition, options.taskId,
|
|
261
|
+
next: nextForTestResult(status, runtimeJudgment, context.partition, options.taskId, workflowGate.nextAction, gateDecision)
|
|
202
262
|
};
|
|
203
263
|
}
|
|
264
|
+
async function recordAcceptanceEvidenceMaps(projectRoot, waveRunId, testRunId, partition, runId, taskId, acceptanceCoverage) {
|
|
265
|
+
const createdAt = new Date().toISOString();
|
|
266
|
+
for (const coverage of acceptanceCoverage) {
|
|
267
|
+
await recordRuntimeAcceptanceEvidenceMap(projectRoot, {
|
|
268
|
+
mapId: runtimeScopedId(waveRunId, testRunId, taskId, coverage.acceptanceRef),
|
|
269
|
+
waveRunId,
|
|
270
|
+
testRunId,
|
|
271
|
+
partition,
|
|
272
|
+
runId,
|
|
273
|
+
taskId,
|
|
274
|
+
acceptanceRef: coverage.acceptanceRef,
|
|
275
|
+
status: coverage.status,
|
|
276
|
+
evidenceRefs: coverage.evidenceRefs.map((ref) => ref.ref),
|
|
277
|
+
gaps: coverage.gaps,
|
|
278
|
+
createdAt,
|
|
279
|
+
payload: coverage
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
}
|
|
204
283
|
async function recordTestWorkflowProjection(projectRoot, input) {
|
|
205
284
|
const outputRefs = input.evidence.map((ref) => ({ kind: 'artifact', ref }));
|
|
206
285
|
const completedStage = {
|
|
@@ -233,31 +312,25 @@ async function recordTestWorkflowProjection(projectRoot, input) {
|
|
|
233
312
|
await recordWorkflowHandoffProjection(projectRoot, validation.valid ? handoff : { ...handoff, status: 'blocked', blockingGaps: validation.issues, decidedAt: input.completedAt });
|
|
234
313
|
}
|
|
235
314
|
async function ensureVerifyContractForTest(projectRoot, branch) {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
return { inspection, action: 'blocked' };
|
|
239
|
-
}
|
|
240
|
-
if (inspection.status === 'PASS') {
|
|
241
|
-
return { inspection, action: 'none' };
|
|
242
|
-
}
|
|
243
|
-
const written = await writeVerifyContract(projectRoot, { branch, branchSource: 'cli_option', force: inspection.exists });
|
|
244
|
-
inspection = await inspectVerifyContract(projectRoot, { branch, branchSource: 'cli_option' });
|
|
245
|
-
if (inspection.status !== 'PASS') {
|
|
246
|
-
return { inspection, action: 'blocked' };
|
|
247
|
-
}
|
|
248
|
-
return { inspection, action: written.status === 'created' ? 'created' : 'refreshed' };
|
|
315
|
+
const inspection = await inspectVerifyContract(projectRoot, { branch, branchSource: 'cli_option' });
|
|
316
|
+
return { inspection, action: inspection.status === 'PASS' ? 'none' : 'blocked' };
|
|
249
317
|
}
|
|
250
318
|
function verifyContractBlocker(inspection) {
|
|
251
319
|
const issueSummary = inspection.issues.map((issue) => `${issue.field}: ${issue.message}`).join(' ');
|
|
252
320
|
return `verify.md contract is ${inspection.status}; ${issueSummary || 'inspect verify.md before executing tests.'}`;
|
|
253
321
|
}
|
|
254
322
|
async function hasReviewerCheckpoint(projectRoot, state, taskId) {
|
|
255
|
-
const artifactPaths = new Set(
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
323
|
+
const artifactPaths = new Set(state.artifacts
|
|
324
|
+
.filter((artifact) => artifact.task === taskId && (artifact.agent === 'reviewer' || artifact.kind === 'review'))
|
|
325
|
+
.map((artifact) => artifact.path));
|
|
326
|
+
const branch = state.partition ?? state.gitBranch ?? 'unscoped';
|
|
327
|
+
const payloads = await listRuntimeArtifactPayloads(projectRoot, { runId: state.runId, taskId });
|
|
328
|
+
for (const payload of payloads) {
|
|
329
|
+
const fileName = payload.logicalRef.replace(/\\/g, '/').split('/').filter(Boolean).pop();
|
|
330
|
+
if (fileName && (payload.artifactRole === 'review' || /review/i.test(fileName))) {
|
|
331
|
+
artifactPaths.add(toBranchStageEvidenceRef(branch, 'do', fileName));
|
|
332
|
+
}
|
|
333
|
+
}
|
|
261
334
|
for (const artifactPath of artifactPaths) {
|
|
262
335
|
const report = await validateSddResultArtifact(projectRoot, state.runId, artifactPath, { expectedTask: taskId, expectedAgent: 'reviewer' });
|
|
263
336
|
if (report.valid && report.result?.status === 'PASS') {
|
|
@@ -272,21 +345,52 @@ export function renderSddTestResult(result) {
|
|
|
272
345
|
'',
|
|
273
346
|
resultSentenceForTest(result),
|
|
274
347
|
'',
|
|
348
|
+
'Decision:',
|
|
349
|
+
`- validation_status=${result.validationStatus}`,
|
|
350
|
+
`- workflow_gate_status=${result.workflowGateStatus}`,
|
|
351
|
+
`- workflow_gate_decision=${result.workflowGateDecision.decisionId}`,
|
|
352
|
+
'',
|
|
275
353
|
'Why:',
|
|
276
354
|
`- ${result.primaryReason}`,
|
|
355
|
+
`- capability_evidence=${capabilityEvidenceSummary(result.capabilityEvidence)}`,
|
|
277
356
|
'',
|
|
278
357
|
'Next:',
|
|
279
358
|
`- ${result.next}`
|
|
280
359
|
].join('\n');
|
|
281
360
|
}
|
|
282
|
-
async function runCommandStep(projectRoot, runId, branch, taskId, testRunId, sequence, commandInput, acceptanceRefs, timeoutMs) {
|
|
361
|
+
async function runCommandStep(projectRoot, runId, branch, taskId, testRunId, sequence, commandInput, acceptanceRefs, timeoutMs, model, task, validationScopeTaskIds, validationScopeAcceptanceRefs) {
|
|
362
|
+
const cachePlan = buildValidationCachePlan({ branch, model, task, command: commandInput.command, argv: commandInput.argv, shell: commandInput.shell, validationScopeTaskIds, acceptanceRefs: validationScopeAcceptanceRefs });
|
|
363
|
+
const cached = cachePlan.eligible ? await readRuntimeValidationCacheEntry(projectRoot, { branchSlug: branch, cacheKey: cachePlan.cacheKey }) : null;
|
|
364
|
+
if (cached) {
|
|
365
|
+
return recordCachedCommandStep(projectRoot, runId, branch, taskId, testRunId, sequence, commandInput, acceptanceRefs, cachePlan.cacheKey, cached);
|
|
366
|
+
}
|
|
283
367
|
const started = Date.now();
|
|
368
|
+
const startedAt = new Date(started).toISOString();
|
|
284
369
|
const executed = await executeCommand(projectRoot, commandInput, timeoutMs);
|
|
285
|
-
const
|
|
370
|
+
const ended = Date.now();
|
|
371
|
+
const endedAt = new Date(ended).toISOString();
|
|
372
|
+
const durationMs = ended - started;
|
|
286
373
|
const status = executed.timedOut || executed.error ? 'blocked' : executed.exitCode === 0 ? 'pass' : 'fail';
|
|
287
374
|
const stepId = `${testRunId}-${String(sequence).padStart(3, '0')}`;
|
|
288
|
-
const
|
|
289
|
-
const
|
|
375
|
+
const cacheStatus = cachePlan.eligible ? 'miss' : 'unsafe';
|
|
376
|
+
const shouldPersistOutputArtifact = shouldPersistCommandOutputArtifact(status, executed, cacheStatus, cachePlan.unsafeReasons);
|
|
377
|
+
const outputFileName = shouldPersistOutputArtifact ? `test-${taskId}-${String(sequence).padStart(3, '0')}.log` : null;
|
|
378
|
+
const outputRef = outputFileName ? toBranchStageEvidenceRef(branch, 'test', outputFileName) : null;
|
|
379
|
+
const output = outputFileName ? renderCommandOutput(commandInput, status, executed, durationMs, cacheStatus, cachePlan.cacheKey, null, cachePlan.unsafeReasons) : null;
|
|
380
|
+
if (outputFileName && outputRef && output) {
|
|
381
|
+
await recordRuntimeOnlyArtifact(projectRoot, runId, outputFileName, output, { logicalRef: outputRef, branch, taskId, artifactRole: 'test-command-output' });
|
|
382
|
+
await appendArtifactHashLedgerEntry(projectRoot, {
|
|
383
|
+
runId,
|
|
384
|
+
taskId,
|
|
385
|
+
branch,
|
|
386
|
+
artifactPath: outputRef,
|
|
387
|
+
content: output,
|
|
388
|
+
status: 'recorded'
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
const stdoutDigest = hashDocumentContent(executed.stdout);
|
|
392
|
+
const stderrDigest = hashDocumentContent(executed.stderr);
|
|
393
|
+
const outputSummary = summarizeCommandOutput(executed);
|
|
290
394
|
await appendInvocationLedgerEntry(projectRoot, {
|
|
291
395
|
runId,
|
|
292
396
|
taskId,
|
|
@@ -294,10 +398,11 @@ async function runCommandStep(projectRoot, runId, branch, taskId, testRunId, seq
|
|
|
294
398
|
kind: 'command',
|
|
295
399
|
ref: commandInput.command,
|
|
296
400
|
status,
|
|
297
|
-
artifactPath:
|
|
298
|
-
outputHash: hashDocumentContent(output),
|
|
299
|
-
materialRefs: [
|
|
401
|
+
artifactPath: outputRef,
|
|
402
|
+
outputHash: output ? hashDocumentContent(output) : null,
|
|
403
|
+
materialRefs: outputRef ? [outputRef] : [],
|
|
300
404
|
metadata: {
|
|
405
|
+
stepId,
|
|
301
406
|
source: 'sdd-test',
|
|
302
407
|
exitCode: executed.exitCode,
|
|
303
408
|
durationMs,
|
|
@@ -306,7 +411,12 @@ async function runCommandStep(projectRoot, runId, branch, taskId, testRunId, seq
|
|
|
306
411
|
truncated: executed.truncated,
|
|
307
412
|
acceptanceRefs: acceptanceRefs.join(','),
|
|
308
413
|
shell: commandInput.shell,
|
|
309
|
-
argv: commandInput.argv ? JSON.stringify(commandInput.argv) : null
|
|
414
|
+
argv: commandInput.argv ? JSON.stringify(commandInput.argv) : null,
|
|
415
|
+
stdoutDigest,
|
|
416
|
+
stderrDigest,
|
|
417
|
+
cacheKey: cachePlan.cacheKey,
|
|
418
|
+
cacheStatus,
|
|
419
|
+
cacheUnsafeReasons: cachePlan.unsafeReasons.join(',')
|
|
310
420
|
}
|
|
311
421
|
});
|
|
312
422
|
const step = {
|
|
@@ -319,10 +429,20 @@ async function runCommandStep(projectRoot, runId, branch, taskId, testRunId, seq
|
|
|
319
429
|
exitCode: executed.exitCode,
|
|
320
430
|
signal: executed.signal,
|
|
321
431
|
durationMs,
|
|
322
|
-
outputArtifact:
|
|
432
|
+
outputArtifact: outputRef,
|
|
323
433
|
stdoutBytes: executed.stdoutBytes,
|
|
324
434
|
stderrBytes: executed.stderrBytes,
|
|
325
|
-
truncated: executed.truncated
|
|
435
|
+
truncated: executed.truncated,
|
|
436
|
+
startedAt,
|
|
437
|
+
endedAt,
|
|
438
|
+
cwd: projectRoot,
|
|
439
|
+
stdoutDigest,
|
|
440
|
+
stderrDigest,
|
|
441
|
+
outputSummary,
|
|
442
|
+
cacheStatus,
|
|
443
|
+
cacheKey: cachePlan.cacheKey,
|
|
444
|
+
cacheSourceTestRunId: null,
|
|
445
|
+
cacheUnsafeReasons: cachePlan.unsafeReasons
|
|
326
446
|
};
|
|
327
447
|
await recordRuntimeTestStep(projectRoot, {
|
|
328
448
|
stepId,
|
|
@@ -333,9 +453,95 @@ async function runCommandStep(projectRoot, runId, branch, taskId, testRunId, seq
|
|
|
333
453
|
status,
|
|
334
454
|
exitCode: executed.exitCode,
|
|
335
455
|
durationMs,
|
|
336
|
-
outputArtifact:
|
|
456
|
+
outputArtifact: outputRef,
|
|
457
|
+
payload: step
|
|
458
|
+
});
|
|
459
|
+
if (status === 'pass' && cachePlan.eligible) {
|
|
460
|
+
const now = new Date().toISOString();
|
|
461
|
+
await recordRuntimeValidationCacheEntry(projectRoot, {
|
|
462
|
+
cacheKey: cachePlan.cacheKey,
|
|
463
|
+
branchSlug: branch,
|
|
464
|
+
command: commandInput.command,
|
|
465
|
+
status: 'valid',
|
|
466
|
+
sourceTestRunId: testRunId,
|
|
467
|
+
sourceRunId: runId,
|
|
468
|
+
sourceEvidenceSetId: null,
|
|
469
|
+
outputArtifact: outputRef,
|
|
470
|
+
stdoutDigest,
|
|
471
|
+
stderrDigest,
|
|
472
|
+
createdAt: now,
|
|
473
|
+
lastUsedAt: now,
|
|
474
|
+
payload: { cachePlan, step }
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
return step;
|
|
478
|
+
}
|
|
479
|
+
async function recordCachedCommandStep(projectRoot, runId, branch, taskId, testRunId, sequence, commandInput, acceptanceRefs, cacheKey, cached) {
|
|
480
|
+
const now = new Date().toISOString();
|
|
481
|
+
const stepId = `${testRunId}-${String(sequence).padStart(3, '0')}`;
|
|
482
|
+
const step = {
|
|
483
|
+
stepId,
|
|
484
|
+
command: commandInput.command,
|
|
485
|
+
argv: commandInput.argv,
|
|
486
|
+
shell: commandInput.shell,
|
|
487
|
+
acceptanceRefs,
|
|
488
|
+
status: 'pass',
|
|
489
|
+
exitCode: 0,
|
|
490
|
+
signal: null,
|
|
491
|
+
durationMs: 0,
|
|
492
|
+
outputArtifact: null,
|
|
493
|
+
stdoutBytes: 0,
|
|
494
|
+
stderrBytes: 0,
|
|
495
|
+
truncated: false,
|
|
496
|
+
startedAt: now,
|
|
497
|
+
endedAt: now,
|
|
498
|
+
cwd: projectRoot,
|
|
499
|
+
stdoutDigest: cached.stdoutDigest,
|
|
500
|
+
stderrDigest: cached.stderrDigest,
|
|
501
|
+
outputSummary: `cache_hit source_test_run=${cached.sourceTestRunId} source_artifact=${cached.outputArtifact ?? 'none'}`,
|
|
502
|
+
cacheStatus: 'hit',
|
|
503
|
+
cacheKey,
|
|
504
|
+
cacheSourceTestRunId: cached.sourceTestRunId,
|
|
505
|
+
cacheUnsafeReasons: []
|
|
506
|
+
};
|
|
507
|
+
await appendInvocationLedgerEntry(projectRoot, {
|
|
508
|
+
runId,
|
|
509
|
+
taskId,
|
|
510
|
+
branch,
|
|
511
|
+
kind: 'command',
|
|
512
|
+
ref: commandInput.command,
|
|
513
|
+
status: 'pass',
|
|
514
|
+
artifactPath: null,
|
|
515
|
+
outputHash: null,
|
|
516
|
+
materialRefs: cached.outputArtifact ? [cached.outputArtifact] : [],
|
|
517
|
+
metadata: { source: 'sdd-test-cache', stepId, cacheKey, sourceTestRunId: cached.sourceTestRunId, sourceEvidenceSetId: cached.sourceEvidenceSetId, acceptanceRefs: acceptanceRefs.join(',') }
|
|
518
|
+
});
|
|
519
|
+
await recordRuntimeTestStep(projectRoot, {
|
|
520
|
+
stepId,
|
|
521
|
+
testRunId,
|
|
522
|
+
runId,
|
|
523
|
+
taskId,
|
|
524
|
+
command: commandInput.command,
|
|
525
|
+
status: 'pass',
|
|
526
|
+
exitCode: 0,
|
|
527
|
+
durationMs: 0,
|
|
528
|
+
outputArtifact: null,
|
|
337
529
|
payload: step
|
|
338
530
|
});
|
|
531
|
+
await recordRuntimeValidationCacheUse(projectRoot, {
|
|
532
|
+
useId: runtimeScopedId(cacheKey, testRunId, taskId, stepId),
|
|
533
|
+
cacheKey,
|
|
534
|
+
branchSlug: branch,
|
|
535
|
+
testRunId,
|
|
536
|
+
runId,
|
|
537
|
+
taskId,
|
|
538
|
+
sourceTestRunId: cached.sourceTestRunId,
|
|
539
|
+
sourceEvidenceSetId: cached.sourceEvidenceSetId,
|
|
540
|
+
reusedAt: now,
|
|
541
|
+
mappedTaskIds: [taskId],
|
|
542
|
+
reason: 'same validation cache key within compatible branch contract scope',
|
|
543
|
+
payload: { sourceRunId: cached.sourceRunId, sourceArtifact: cached.outputArtifact }
|
|
544
|
+
});
|
|
339
545
|
return step;
|
|
340
546
|
}
|
|
341
547
|
function executeCommand(projectRoot, commandInput, timeoutMs) {
|
|
@@ -386,28 +592,57 @@ function executeCommand(projectRoot, commandInput, timeoutMs) {
|
|
|
386
592
|
child.on('close', (code, signal) => finish({ exitCode: code, signal, error: null }));
|
|
387
593
|
});
|
|
388
594
|
}
|
|
389
|
-
async function writeValidationArtifact(projectRoot, runId, task, status, steps, gaps) {
|
|
390
|
-
const artifactPath =
|
|
391
|
-
const
|
|
595
|
+
async function writeValidationArtifact(projectRoot, runId, branch, task, status, steps, gaps, _capabilityEvidence) {
|
|
596
|
+
const artifactPath = validationArtifactPath(task);
|
|
597
|
+
const stageEvidenceRef = toBranchStageEvidenceRef(branch, 'test', artifactPath);
|
|
392
598
|
const resultStatus = status === 'PASS' ? 'PASS' : status === 'FAIL' ? 'FAIL' : 'BLOCKED';
|
|
393
|
-
const content = `# Validation ${task.id}\n\n\`\`\`sdd-result\ncontract: ${SDD_RESULT_CONTRACT}\nversion: ${SDD_RESULT_VERSION}\nagent: validator\ntask: ${task.id}\nstatus: ${resultStatus}\nartifacts:\n - ${
|
|
394
|
-
|
|
395
|
-
}
|
|
396
|
-
async function writeTestSyncBackProposal(projectRoot, runId, taskId, artifacts, acceptanceCoverage) {
|
|
397
|
-
const content = `# Sync-back Proposal\n\n## ${taskId}\n\n- status: verified\n- summary: /sdd:test passed with complete command and acceptance evidence.\n- artifacts:\n${artifacts.length > 0 ? artifacts.map((artifact) => ` - ${artifact}`).join('\n') : ' - none'}\n- acceptance_coverage:\n${acceptanceCoverage.length > 0 ? acceptanceCoverage.map((coverage) => ` - [${coverage.status}] ${coverage.acceptanceRef}`).join('\n') : ' - none'}\n- gaps:\n - none\n\n## Boundaries\n\n- Proposal only; tasks.md/spec.md/plan.md were not modified by runtime.\n- /sdd:test executed declared validation commands and mapped evidence to acceptance refs.\n`;
|
|
398
|
-
const written = await writeArtifact(projectRoot, runId, 'sync-back-proposal.md', content);
|
|
399
|
-
return { path: written.runRelativePath, digest: hashDocumentContent(content) };
|
|
599
|
+
const content = `# Test Validation ${task.id}\n\n\`\`\`sdd-result\ncontract: ${SDD_RESULT_CONTRACT}\nversion: ${SDD_RESULT_VERSION}\nagent: validator\ntask: ${task.id}\nstatus: ${resultStatus}\nartifacts:\n - ${stageEvidenceRef}\n\`\`\`\n\n## Test Runtime\n\n- status: ${status}\n- commands:\n${steps.length > 0 ? steps.map((step) => ` - [${step.status}] ${step.command}`).join('\n') : ' - none'}\n- gaps:\n${gaps.length > 0 ? gaps.map((gap) => ` - ${gap}`).join('\n') : ' - none'}\n\n## Acceptance Evidence\n\n${renderEvidenceBlocks(task, status, stageEvidenceRef, steps)}\n`;
|
|
600
|
+
const written = await recordStageEvidenceArtifact(projectRoot, runId, stageEvidenceRef, content, { taskId: task.id, artifactRole: 'test-validation' });
|
|
601
|
+
return { ...written, runRelativePath: stageEvidenceRef };
|
|
400
602
|
}
|
|
401
|
-
|
|
402
|
-
return
|
|
603
|
+
function validationArtifactPath(task) {
|
|
604
|
+
return `test-validation-${task.id}.md`;
|
|
403
605
|
}
|
|
404
|
-
async function persistTestRunState(projectRoot, state, taskId,
|
|
606
|
+
async function persistTestRunState(projectRoot, state, taskId, validationStatus, commands, evidence, validationArtifact) {
|
|
405
607
|
const latest = await readRunState(projectRoot, state.runId);
|
|
406
608
|
const knownArtifacts = new Set(latest.artifacts.map((artifact) => artifact.path));
|
|
407
609
|
const now = new Date().toISOString();
|
|
408
610
|
const nextArtifacts = evidence
|
|
409
611
|
.filter((artifactPath) => !knownArtifacts.has(artifactPath))
|
|
410
|
-
.map((artifactPath) => ({ path: artifactPath, kind: artifactPath
|
|
612
|
+
.map((artifactPath) => ({ path: artifactPath, kind: testArtifactKind(artifactPath), task: taskId, agent: 'test-runtime', createdAt: now }));
|
|
613
|
+
const existingTaskState = latest.tasks[taskId];
|
|
614
|
+
await writeRunState(projectRoot, {
|
|
615
|
+
...latest,
|
|
616
|
+
status: validationStatus === 'PASS' ? 'running' : validationStatus === 'FAIL' ? 'failed' : 'blocked',
|
|
617
|
+
phase: 'test',
|
|
618
|
+
currentTask: taskId,
|
|
619
|
+
tasks: {
|
|
620
|
+
...latest.tasks,
|
|
621
|
+
[taskId]: {
|
|
622
|
+
...baseRuntimeTaskState(existingTaskState),
|
|
623
|
+
status: validationStatus === 'PASS' ? 'validation_passed_pending_gate' : validationStatus === 'FAIL' ? 'validation_failed' : 'validation_blocked',
|
|
624
|
+
implementationStatus: existingTaskState?.implementationStatus ?? 'not_started',
|
|
625
|
+
verificationStatus: verificationStatusFromTest(validationStatus),
|
|
626
|
+
testStatus: validationStatus,
|
|
627
|
+
evidence
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
artifacts: [...latest.artifacts, ...nextArtifacts],
|
|
631
|
+
validation: {
|
|
632
|
+
status: validationStatus === 'PASS' ? 'pass' : validationStatus === 'FAIL' ? 'fail' : 'blocked',
|
|
633
|
+
commands,
|
|
634
|
+
evidence
|
|
635
|
+
}
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
async function persistTestGateOutcome(projectRoot, runId, taskId, status, validationStatus, commands, evidence, validationArtifact, gateDecision) {
|
|
639
|
+
const latest = await readRunState(projectRoot, runId);
|
|
640
|
+
const knownArtifacts = new Set(latest.artifacts.map((artifact) => artifact.path));
|
|
641
|
+
const now = new Date().toISOString();
|
|
642
|
+
const nextArtifacts = evidence
|
|
643
|
+
.filter((artifactPath) => !knownArtifacts.has(artifactPath))
|
|
644
|
+
.map((artifactPath) => ({ path: artifactPath, kind: testArtifactKind(artifactPath), task: taskId, agent: 'test-runtime', createdAt: now }));
|
|
645
|
+
const existingTaskState = latest.tasks[taskId];
|
|
411
646
|
await writeRunState(projectRoot, {
|
|
412
647
|
...latest,
|
|
413
648
|
status: status === 'PASS' ? 'completed' : status === 'FAIL' ? 'failed' : 'blocked',
|
|
@@ -416,28 +651,63 @@ async function persistTestRunState(projectRoot, state, taskId, status, commands,
|
|
|
416
651
|
tasks: {
|
|
417
652
|
...latest.tasks,
|
|
418
653
|
[taskId]: {
|
|
419
|
-
|
|
654
|
+
...baseRuntimeTaskState(existingTaskState),
|
|
655
|
+
status: runtimeTaskStatusAfterGate(status, validationStatus),
|
|
656
|
+
implementationStatus: existingTaskState?.implementationStatus ?? 'not_started',
|
|
657
|
+
verificationStatus: verificationStatusFromTest(validationStatus),
|
|
420
658
|
testStatus: status,
|
|
659
|
+
validationStatus,
|
|
660
|
+
workflowGateStatus: gateDecision.status,
|
|
661
|
+
workflowGateDecisionId: gateDecision.decisionId,
|
|
421
662
|
evidence
|
|
422
663
|
}
|
|
423
664
|
},
|
|
424
665
|
artifacts: [...latest.artifacts, ...nextArtifacts],
|
|
425
666
|
validation: {
|
|
426
|
-
status:
|
|
667
|
+
status: validationStatus === 'PASS' ? 'pass' : validationStatus === 'FAIL' ? 'fail' : 'blocked',
|
|
427
668
|
commands,
|
|
428
669
|
evidence
|
|
429
|
-
}
|
|
430
|
-
syncBack: syncBackProposal
|
|
431
|
-
? {
|
|
432
|
-
mode: 'proposal',
|
|
433
|
-
proposalPath: syncBackProposal.path,
|
|
434
|
-
proposalDigest: syncBackProposal.digest,
|
|
435
|
-
sourceVerifyStatus: status,
|
|
436
|
-
status: 'proposed'
|
|
437
|
-
}
|
|
438
|
-
: latest.syncBack
|
|
670
|
+
}
|
|
439
671
|
});
|
|
440
672
|
}
|
|
673
|
+
function testArtifactKind(artifactPath) {
|
|
674
|
+
const fileName = artifactPath.split('/').pop() ?? artifactPath;
|
|
675
|
+
if (fileName.startsWith('test-validation-')) {
|
|
676
|
+
return 'test-validation';
|
|
677
|
+
}
|
|
678
|
+
return 'test';
|
|
679
|
+
}
|
|
680
|
+
function baseRuntimeTaskState(existing) {
|
|
681
|
+
return {
|
|
682
|
+
status: existing?.status ?? 'not_started',
|
|
683
|
+
implementationStatus: existing?.implementationStatus ?? 'not_started',
|
|
684
|
+
verificationStatus: existing?.verificationStatus ?? 'not_run',
|
|
685
|
+
validationBatch: existing?.validationBatch ?? null,
|
|
686
|
+
validationTiming: existing?.validationTiming ?? 'task_end',
|
|
687
|
+
requiresVerifyBeforeNext: existing?.requiresVerifyBeforeNext ?? true,
|
|
688
|
+
gaps: existing?.gaps,
|
|
689
|
+
artifacts: existing?.artifacts,
|
|
690
|
+
testStatus: existing?.testStatus,
|
|
691
|
+
workflowGateStatus: existing?.workflowGateStatus,
|
|
692
|
+
workflowGateDecisionId: existing?.workflowGateDecisionId,
|
|
693
|
+
evidence: existing?.evidence
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
function verificationStatusFromTest(validationStatus) {
|
|
697
|
+
if (validationStatus === 'PASS') {
|
|
698
|
+
return 'pass';
|
|
699
|
+
}
|
|
700
|
+
return validationStatus === 'FAIL' ? 'failed' : 'blocked';
|
|
701
|
+
}
|
|
702
|
+
function runtimeTaskStatusAfterGate(status, validationStatus) {
|
|
703
|
+
if (status === 'PASS') {
|
|
704
|
+
return 'implemented_verified';
|
|
705
|
+
}
|
|
706
|
+
if (validationStatus === 'PASS') {
|
|
707
|
+
return 'workflow_gate_blocked';
|
|
708
|
+
}
|
|
709
|
+
return validationStatus === 'FAIL' ? 'validation_failed' : 'validation_blocked';
|
|
710
|
+
}
|
|
441
711
|
function deriveCommandStatus(gaps, steps) {
|
|
442
712
|
if (gaps.length > 0 || steps.some((step) => step.status === 'blocked')) {
|
|
443
713
|
return 'BLOCKED';
|
|
@@ -447,8 +717,8 @@ function deriveCommandStatus(gaps, steps) {
|
|
|
447
717
|
}
|
|
448
718
|
return 'PASS';
|
|
449
719
|
}
|
|
450
|
-
function buildAcceptanceCoverage(task, steps, commandStatus) {
|
|
451
|
-
const acceptanceRefs = task ? taskAcceptanceRefs(task) : [];
|
|
720
|
+
function buildAcceptanceCoverage(task, steps, commandStatus, acceptanceRefsOverride) {
|
|
721
|
+
const acceptanceRefs = acceptanceRefsOverride && acceptanceRefsOverride.length > 0 ? [...new Set(acceptanceRefsOverride)] : task ? taskAcceptanceRefs(task) : [];
|
|
452
722
|
return acceptanceRefs.map((acceptanceRef) => {
|
|
453
723
|
const mappedSteps = steps.filter((step) => step.acceptanceRefs.includes(acceptanceRef));
|
|
454
724
|
const hasPassingEvidence = mappedSteps.some((step) => step.status === 'pass');
|
|
@@ -461,11 +731,20 @@ function buildAcceptanceCoverage(task, steps, commandStatus) {
|
|
|
461
731
|
return {
|
|
462
732
|
acceptanceRef,
|
|
463
733
|
status,
|
|
464
|
-
evidenceRefs: mappedSteps.map(
|
|
465
|
-
gaps: status === 'complete' ? [] : [`Acceptance ${acceptanceRef} has no complete non-stale evidence from
|
|
734
|
+
evidenceRefs: mappedSteps.map(commandStepRuntimeRef),
|
|
735
|
+
gaps: status === 'complete' ? [] : [`Acceptance ${acceptanceRef} has no complete non-stale evidence from sdd test task.`]
|
|
466
736
|
};
|
|
467
737
|
});
|
|
468
738
|
}
|
|
739
|
+
function runtimeEvidenceRefs(validationArtifact, steps) {
|
|
740
|
+
return [validationArtifact, ...steps.map((step) => step.outputArtifact)].filter((item) => Boolean(item));
|
|
741
|
+
}
|
|
742
|
+
function commandStepRuntimeRef(step) {
|
|
743
|
+
return { kind: 'command', ref: step.stepId };
|
|
744
|
+
}
|
|
745
|
+
function artifactRuntimeRefs(ref) {
|
|
746
|
+
return ref ? [{ kind: 'artifact', ref }] : [];
|
|
747
|
+
}
|
|
469
748
|
function summarizeEvidenceCoverage(acceptanceCoverage) {
|
|
470
749
|
if (acceptanceCoverage.length === 0) {
|
|
471
750
|
return 'missing';
|
|
@@ -487,7 +766,51 @@ function derivePolicyJudgment(commandStatus, evidenceCoverage) {
|
|
|
487
766
|
}
|
|
488
767
|
return 'PASS';
|
|
489
768
|
}
|
|
490
|
-
function
|
|
769
|
+
async function resolveTestRuntimeDurableGap(projectRoot, branch, runId, taskId, validationStatus, gaps) {
|
|
770
|
+
if (validationStatus !== 'PASS' || gaps.length > 0) {
|
|
771
|
+
return;
|
|
772
|
+
}
|
|
773
|
+
await updateRuntimeDurableGapStatus(projectRoot, {
|
|
774
|
+
gapId: testRuntimeGapId(branch, runId, taskId),
|
|
775
|
+
status: 'resolved',
|
|
776
|
+
source: 'gate_policy',
|
|
777
|
+
payload: { validationStatus, gaps }
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
async function recordTestRuntimeDurableGap(projectRoot, branch, runId, taskId, status, validationStatus, runtimeJudgment, gaps, evidenceRefs) {
|
|
781
|
+
if (status === 'PASS' && gaps.length === 0) {
|
|
782
|
+
return;
|
|
783
|
+
}
|
|
784
|
+
const message = gaps[0] ?? (runtimeJudgment === 'PASS' ? `Validation status is ${validationStatus}.` : `Workflow gate status is ${runtimeJudgment}.`);
|
|
785
|
+
await recordRuntimeDurableGap(projectRoot, {
|
|
786
|
+
gapId: testRuntimeGapId(branch, runId, taskId),
|
|
787
|
+
partition: branch,
|
|
788
|
+
taskId,
|
|
789
|
+
runId,
|
|
790
|
+
stage: 'test',
|
|
791
|
+
gate: 'test',
|
|
792
|
+
source: 'runtime',
|
|
793
|
+
category: runtimeJudgment === 'PASS' ? 'validation' : 'workflow_gate',
|
|
794
|
+
severity: 'blocking',
|
|
795
|
+
status: 'open',
|
|
796
|
+
message,
|
|
797
|
+
recommendation: `Resolve test runtime gaps for ${taskId}, then rerun ${testValidationUnitCommand(branch, taskId)}.`,
|
|
798
|
+
evidenceRefs,
|
|
799
|
+
proposalRefs: [],
|
|
800
|
+
sourceRefs: [],
|
|
801
|
+
payload: { status, validationStatus, runtimeJudgment, gaps }
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
function testRuntimeGapId(branch, _runId, taskId) {
|
|
805
|
+
return runtimeScopedId(branch, taskId, 'test-runtime-gap');
|
|
806
|
+
}
|
|
807
|
+
function finalStatusForTest(validationStatus, runtimeJudgment) {
|
|
808
|
+
if (validationStatus !== 'PASS') {
|
|
809
|
+
return validationStatus;
|
|
810
|
+
}
|
|
811
|
+
return runtimeJudgment === 'PASS' || runtimeJudgment === 'WARN' ? 'PASS' : 'BLOCKED';
|
|
812
|
+
}
|
|
813
|
+
function buildUnifiedTestEvidenceRun(id, branch, runId, taskId, commandStatus, evidenceCoverage, policyJudgment, status, runtimeJudgment, steps, acceptanceCoverage, capabilityEvidence, gaps, gateNextAction, gateDecision) {
|
|
491
814
|
return {
|
|
492
815
|
contract: TEST_EVIDENCE_RUN_CONTRACT_VERSION,
|
|
493
816
|
id,
|
|
@@ -498,31 +821,102 @@ function buildUnifiedTestEvidenceRun(id, branch, runId, taskId, commandStatus, e
|
|
|
498
821
|
commands: steps.map((step) => ({
|
|
499
822
|
command: step.command,
|
|
500
823
|
status: step.status === 'pass' ? 'PASS' : step.status === 'fail' ? 'FAIL' : 'BLOCKED',
|
|
501
|
-
outputRef: { kind: 'artifact', ref: step.outputArtifact },
|
|
502
|
-
evidenceRefs: [
|
|
824
|
+
outputRef: step.outputArtifact ? { kind: 'artifact', ref: step.outputArtifact } : undefined,
|
|
825
|
+
evidenceRefs: [commandStepRuntimeRef(step), ...artifactRuntimeRefs(step.outputArtifact)],
|
|
503
826
|
acceptanceRefs: step.acceptanceRefs,
|
|
504
827
|
startedAt: new Date(Date.now() - step.durationMs).toISOString(),
|
|
505
828
|
completedAt: new Date().toISOString()
|
|
506
829
|
})),
|
|
507
830
|
acceptanceCoverage,
|
|
508
|
-
|
|
831
|
+
capabilityEvidence,
|
|
509
832
|
gaps: [...gaps, ...acceptanceCoverage.flatMap((coverage) => coverage.gaps)],
|
|
510
|
-
next: nextForTestResult(
|
|
833
|
+
next: nextForTestResult(status, runtimeJudgment, branch, taskId, gateNextAction, gateDecision),
|
|
511
834
|
generatedAt: new Date().toISOString()
|
|
512
835
|
};
|
|
513
836
|
}
|
|
514
|
-
function
|
|
837
|
+
function buildCapabilityEvidenceClassification(decision, steps) {
|
|
838
|
+
if (!decision) {
|
|
839
|
+
return [{
|
|
840
|
+
class: 'diagnostic',
|
|
841
|
+
source: 'runtime_diagnostic',
|
|
842
|
+
domainOrSourceId: 'capability-routing',
|
|
843
|
+
evidenceRefs: [],
|
|
844
|
+
acceptanceRefs: [],
|
|
845
|
+
provenanceRefs: [],
|
|
846
|
+
reason: 'Capability routing did not run; no capability output is accepted as test evidence.'
|
|
847
|
+
}];
|
|
848
|
+
}
|
|
849
|
+
const acceptanceRefs = [...new Set(steps.flatMap((step) => step.acceptanceRefs))];
|
|
850
|
+
const professionalEvidence = decision.selectedDomains.map((domain) => ({
|
|
851
|
+
class: 'candidate',
|
|
852
|
+
source: 'professional_capability',
|
|
853
|
+
domainOrSourceId: domain.domain,
|
|
854
|
+
evidenceRefs: [],
|
|
855
|
+
acceptanceRefs,
|
|
856
|
+
provenanceRefs: [{ kind: 'projection', ref: `capability:${domain.capabilityId}` }],
|
|
857
|
+
reason: `${domain.reason}; capability output is advisory candidate evidence until accepted by command evidence and policy refs.`
|
|
858
|
+
}));
|
|
859
|
+
const externalEvidence = decision.rejectedExternalSources.map((source) => ({
|
|
860
|
+
class: capabilityClassForRejectedSource(source.quarantineStatus),
|
|
861
|
+
source: 'external_source',
|
|
862
|
+
domainOrSourceId: source.sourceId,
|
|
863
|
+
evidenceRefs: [],
|
|
864
|
+
acceptanceRefs: [],
|
|
865
|
+
provenanceRefs: [{ kind: 'external', ref: source.sourceId }],
|
|
866
|
+
reason: source.reason
|
|
867
|
+
}));
|
|
868
|
+
return [...professionalEvidence, ...externalEvidence];
|
|
869
|
+
}
|
|
870
|
+
function capabilityClassForRejectedSource(status) {
|
|
871
|
+
if (status === 'denied') {
|
|
872
|
+
return 'blocked';
|
|
873
|
+
}
|
|
874
|
+
if (status === 'required' || status === 'quarantined') {
|
|
875
|
+
return 'quarantined';
|
|
876
|
+
}
|
|
877
|
+
return 'diagnostic';
|
|
878
|
+
}
|
|
879
|
+
function capabilityEvidenceSummary(items) {
|
|
880
|
+
if (items.length === 0) {
|
|
881
|
+
return 'none';
|
|
882
|
+
}
|
|
883
|
+
const counts = new Map();
|
|
884
|
+
for (const item of items) {
|
|
885
|
+
counts.set(item.class, (counts.get(item.class) ?? 0) + 1);
|
|
886
|
+
}
|
|
887
|
+
return [...counts.entries()].map(([kind, count]) => `${kind}:${count}`).join(',');
|
|
888
|
+
}
|
|
889
|
+
function nextForTestResult(status, runtimeJudgment, branch, taskId, gateNextAction, gateDecision) {
|
|
890
|
+
const inspectHint = `Inspect runtime test read model for ${taskId}`;
|
|
515
891
|
if (status === 'PASS') {
|
|
516
|
-
return `sdd
|
|
892
|
+
return `sdd test close --branch ${branch} --target goal-verify --compact-json`;
|
|
893
|
+
}
|
|
894
|
+
if (gateNextAction) {
|
|
895
|
+
return gateNextAction;
|
|
896
|
+
}
|
|
897
|
+
if (runtimeJudgment === 'HUMAN_REQUIRED') {
|
|
898
|
+
return gateDecision ? `Create a decision card for workflow gate ${gateDecision.decisionId}, then rerun ${testValidationUnitCommand(branch, taskId)}.` : `Create a decision card, then rerun ${testValidationUnitCommand(branch, taskId)}.`;
|
|
899
|
+
}
|
|
900
|
+
if (runtimeJudgment === 'WARN') {
|
|
901
|
+
return gateDecision ? `Review workflow gate ${gateDecision.decisionId} warnings, then rerun ${testValidationUnitCommand(branch, taskId)} or proceed only with explicit review.` : `Review workflow gate warnings, then rerun ${testValidationUnitCommand(branch, taskId)}.`;
|
|
902
|
+
}
|
|
903
|
+
if (runtimeJudgment === 'ADVISORY_ONLY') {
|
|
904
|
+
return `Inspect advisor assessments for ${taskId}; advisory output cannot satisfy the test gate.`;
|
|
905
|
+
}
|
|
906
|
+
if (status === 'FAIL') {
|
|
907
|
+
return `${inspectHint}, fix failing validation commands, then rerun ${testValidationUnitCommand(branch, taskId)}.`;
|
|
517
908
|
}
|
|
518
|
-
return
|
|
909
|
+
return gateDecision ? `${inspectHint} and workflow gate ${gateDecision.decisionId}, resolve blockers, then rerun ${testValidationUnitCommand(branch, taskId)}.` : `${inspectHint}, fix command/evidence gaps, then rerun ${testValidationUnitCommand(branch, taskId)}.`;
|
|
910
|
+
}
|
|
911
|
+
function testValidationUnitCommand(branch, taskId) {
|
|
912
|
+
return `sdd test task-${taskId} --branch ${branch}`;
|
|
519
913
|
}
|
|
520
914
|
function resultSentenceForTest(result) {
|
|
521
|
-
if (result.status === 'PASS' && result.lifecycleGate === 'direct') {
|
|
522
|
-
return 'Validation passed and sync-back is ready.';
|
|
523
|
-
}
|
|
524
915
|
if (result.status === 'PASS') {
|
|
525
|
-
return 'Validation passed;
|
|
916
|
+
return 'Validation and workflow gate passed; proceed to goal verification and truthAlignment before release readiness.';
|
|
917
|
+
}
|
|
918
|
+
if (result.validationStatus === 'PASS' && result.workflowGateStatus !== 'PASS') {
|
|
919
|
+
return `Validation passed, but workflow gate returned ${result.workflowGateStatus}.`;
|
|
526
920
|
}
|
|
527
921
|
if (result.commandStatus === 'BLOCKED') {
|
|
528
922
|
return 'Blocked before validation commands ran.';
|
|
@@ -542,7 +936,7 @@ function renderEvidenceBlocks(task, status, sourceArtifact, steps) {
|
|
|
542
936
|
}
|
|
543
937
|
return mappedEvidence.map(({ acceptance, steps: mappedSteps }) => {
|
|
544
938
|
const evidenceStatus = evidenceStatusForMappedSteps(status, mappedSteps);
|
|
545
|
-
return `\`\`\`sdd-evidence\ncontract: ${SDD_EVIDENCE_CONTRACT}\nversion: ${SDD_EVIDENCE_VERSION}\ntask: ${task.id}\nacceptance: ${acceptance}\nstatus: ${evidenceStatus}\nclaim: Explicit validation mapping ${mappedSteps.map((step) => step.command).join(' && ')} produced ${evidenceStatus} for ${acceptance}.\nsource_artifact: ${sourceArtifact}\nevidence_refs:\n${mappedSteps.map(
|
|
939
|
+
return `\`\`\`sdd-evidence\ncontract: ${SDD_EVIDENCE_CONTRACT}\nversion: ${SDD_EVIDENCE_VERSION}\ntask: ${task.id}\nacceptance: ${acceptance}\nstatus: ${evidenceStatus}\nclaim: Explicit validation mapping ${mappedSteps.map((step) => step.command).join(' && ')} produced ${evidenceStatus} for ${acceptance}.\nsource_artifact: ${sourceArtifact}\nevidence_refs:\n${mappedSteps.map(renderStepEvidenceRefs).join('\n')}\nprovenance_refs:\n - artifact:${sourceArtifact}\n${mappedSteps.map((step) => ` - command:${step.command}`).join('\n')}\npolicy_refs:\n - ${ACCEPTANCE_POLICY_RULESET_VERSION}:require-source-evidence\n - ${ACCEPTANCE_POLICY_RULESET_VERSION}:require-provenance\n - ${ACCEPTANCE_POLICY_RULESET_VERSION}:require-policy-rule\n\`\`\``;
|
|
546
940
|
}).join('\n\n');
|
|
547
941
|
}
|
|
548
942
|
function normalizeTestCommandInputs(commandInputs, commands, taskValidation) {
|
|
@@ -564,7 +958,10 @@ function normalizeTestCommandInput(input) {
|
|
|
564
958
|
}
|
|
565
959
|
throw new Error('Command input must include command or argv.');
|
|
566
960
|
}
|
|
567
|
-
function acceptanceRefsForCommand(task, command) {
|
|
961
|
+
function acceptanceRefsForCommand(task, command, acceptanceRefsOverride) {
|
|
962
|
+
if (acceptanceRefsOverride && acceptanceRefsOverride.length > 0) {
|
|
963
|
+
return [...new Set(acceptanceRefsOverride)];
|
|
964
|
+
}
|
|
568
965
|
return [...new Set((task?.validationCommands ?? [])
|
|
569
966
|
.filter((entry) => entry.command === command)
|
|
570
967
|
.flatMap((entry) => entry.acceptanceRefs))];
|
|
@@ -582,8 +979,32 @@ function evidenceStatusForMappedSteps(status, steps) {
|
|
|
582
979
|
}
|
|
583
980
|
return 'PASS';
|
|
584
981
|
}
|
|
585
|
-
function renderCommandOutput(commandInput, status, executed, durationMs) {
|
|
586
|
-
return `# Test Command Output\n\n- command: ${commandInput.command}\n- shell: ${commandInput.shell}\n- argv: ${commandInput.argv ? JSON.stringify(commandInput.argv) : 'none'}\n- status: ${status}\n- exit_code: ${executed.exitCode ?? 'none'}\n- signal: ${executed.signal ?? 'none'}\n- duration_ms: ${durationMs}\n- timed_out: ${executed.timedOut}\n- truncated: ${executed.truncated}\n- error: ${executed.error ?? 'none'}\n\n## stdout\n\n\`\`\`text\n${executed.stdout}\n\`\`\`\n\n## stderr\n\n\`\`\`text\n${executed.stderr}\n\`\`\`\n`;
|
|
982
|
+
function renderCommandOutput(commandInput, status, executed, durationMs, cacheStatus = 'unsafe', cacheKey = null, cacheSourceTestRunId = null, cacheUnsafeReasons = []) {
|
|
983
|
+
return `# Test Command Output\n\n- command: ${commandInput.command}\n- shell: ${commandInput.shell}\n- argv: ${commandInput.argv ? JSON.stringify(commandInput.argv) : 'none'}\n- status: ${status}\n- exit_code: ${executed.exitCode ?? 'none'}\n- signal: ${executed.signal ?? 'none'}\n- duration_ms: ${durationMs}\n- timed_out: ${executed.timedOut}\n- truncated: ${executed.truncated}\n- error: ${executed.error ?? 'none'}\n- cache_status: ${cacheStatus}\n- cache_key: ${cacheKey ?? 'none'}\n- cache_source_test_run: ${cacheSourceTestRunId ?? 'none'}\n- cache_unsafe_reasons: ${cacheUnsafeReasons.join(',') || 'none'}\n\n## stdout\n\n\`\`\`text\n${executed.stdout}\n\`\`\`\n\n## stderr\n\n\`\`\`text\n${executed.stderr}\n\`\`\`\n`;
|
|
984
|
+
}
|
|
985
|
+
function shouldPersistCommandOutputArtifact(status, executed, cacheStatus, cacheUnsafeReasons) {
|
|
986
|
+
return status !== 'pass' || executed.truncated || executed.timedOut || Boolean(executed.error) || cacheStatus === 'unsafe' || cacheUnsafeReasons.length > 0;
|
|
987
|
+
}
|
|
988
|
+
function renderStepEvidenceRefs(step) {
|
|
989
|
+
const refs = [` - command:${step.stepId}`];
|
|
990
|
+
if (step.outputArtifact) {
|
|
991
|
+
refs.push(` - artifact:${step.outputArtifact}`);
|
|
992
|
+
}
|
|
993
|
+
return refs.join('\n');
|
|
994
|
+
}
|
|
995
|
+
function summarizeCommandOutput(executed) {
|
|
996
|
+
const parts = [
|
|
997
|
+
`exit=${executed.exitCode ?? 'none'}`,
|
|
998
|
+
`signal=${executed.signal ?? 'none'}`,
|
|
999
|
+
`stdout_bytes=${executed.stdoutBytes}`,
|
|
1000
|
+
`stderr_bytes=${executed.stderrBytes}`,
|
|
1001
|
+
`truncated=${executed.truncated}`,
|
|
1002
|
+
`timed_out=${executed.timedOut}`
|
|
1003
|
+
];
|
|
1004
|
+
if (executed.error) {
|
|
1005
|
+
parts.push(`error=${executed.error}`);
|
|
1006
|
+
}
|
|
1007
|
+
return parts.join(' ');
|
|
587
1008
|
}
|
|
588
1009
|
function hashDocumentContent(raw) {
|
|
589
1010
|
return createHash('sha256').update(raw.replace(/\r\n/g, '\n'), 'utf8').digest('hex');
|