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
|
@@ -0,0 +1,556 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { resolveSddContext } from '../sdd-docs/context.js';
|
|
3
|
+
import { isBackendBuildValidationCommand, isFrontendOnlyTask, parseSddBranch, type SddTask } from '../sdd-docs/task-parser.js';
|
|
4
|
+
import { listRuntimeAcceptanceEvidenceMaps, recordRuntimeValidationEnvironmentSession, recordRuntimeValidationWaveRun, runtimeScopedId, type RuntimeAcceptanceEvidenceMapRecord, type RuntimeValidationWaveStatus } from '../storage/runtime-store.js';
|
|
5
|
+
import { inspectVerifyContract, type VerifyContractInspection } from './verify-contract.js';
|
|
6
|
+
import { runSddTest, type RunSddTestOptions, type SddTestResult, type SddTestStatus } from './test-runtime.js';
|
|
7
|
+
import { evaluateAndRecordWorkflowGateDecision } from '../workflow-gate/evidence-packet.js';
|
|
8
|
+
import type { WorkflowGateDecision, WorkflowGateScope } from '../workflow-gate/types.js';
|
|
9
|
+
|
|
10
|
+
export const VALIDATION_WAVE_RUNTIME_CONTRACT_VERSION = 'phase-8.17-validation-wave-runtime-v1';
|
|
11
|
+
|
|
12
|
+
export interface ValidationWaveTaskPlan {
|
|
13
|
+
taskId: string;
|
|
14
|
+
wave: number | null;
|
|
15
|
+
commandCount: number;
|
|
16
|
+
acceptanceRefs: string[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type ValidationWaveSelectionBoundary = 'batch' | 'wave' | 'tasks' | 'all';
|
|
20
|
+
|
|
21
|
+
interface VerifyBatchPlan {
|
|
22
|
+
id: string;
|
|
23
|
+
timing: string | null;
|
|
24
|
+
tasks: string[];
|
|
25
|
+
checks: string[];
|
|
26
|
+
forbiddenValidation: string[];
|
|
27
|
+
requiredArtifacts: string[];
|
|
28
|
+
acceptanceMapping: Map<string, string[]>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface VerifyValidationUnit {
|
|
32
|
+
validationUnitId: string;
|
|
33
|
+
timing: string | null;
|
|
34
|
+
taskIds: string[];
|
|
35
|
+
checks: string[];
|
|
36
|
+
forbiddenValidation: string[];
|
|
37
|
+
requiredArtifacts: string[];
|
|
38
|
+
acceptanceMapping: Record<string, string[]>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface VerifyValidationUnitList {
|
|
42
|
+
contract: 'sdd-verify-validation-units-v1';
|
|
43
|
+
branch: string;
|
|
44
|
+
verifyContract: VerifyContractInspection;
|
|
45
|
+
units: VerifyValidationUnit[];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface ValidationWavePlan {
|
|
49
|
+
contract: typeof VALIDATION_WAVE_RUNTIME_CONTRACT_VERSION;
|
|
50
|
+
branch: string;
|
|
51
|
+
wave: number | null;
|
|
52
|
+
batchId: string | null;
|
|
53
|
+
selectionBoundary: ValidationWaveSelectionBoundary;
|
|
54
|
+
taskIds: string[];
|
|
55
|
+
tasks: ValidationWaveTaskPlan[];
|
|
56
|
+
verifyBatches: Array<{ id: string; timing: string | null; tasks: string[]; checks: string[]; forbiddenValidation: string[]; requiredArtifacts: string[]; acceptanceMapping: Record<string, string[]> }>;
|
|
57
|
+
verifyContract: VerifyContractInspection;
|
|
58
|
+
status: 'READY' | 'BLOCKED';
|
|
59
|
+
blockers: string[];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface RunValidationWaveOptions {
|
|
63
|
+
branch?: string | null;
|
|
64
|
+
wave?: number | null;
|
|
65
|
+
batchId?: string | null;
|
|
66
|
+
taskIds?: string[];
|
|
67
|
+
commandInputsByTask?: Record<string, RunSddTestOptions['commandInputs']>;
|
|
68
|
+
timeoutMs?: number;
|
|
69
|
+
approved?: boolean;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface ValidationWaveRunResult {
|
|
73
|
+
contract: typeof VALIDATION_WAVE_RUNTIME_CONTRACT_VERSION;
|
|
74
|
+
waveRunId: string;
|
|
75
|
+
environmentSessionId: string;
|
|
76
|
+
branch: string;
|
|
77
|
+
status: RuntimeValidationWaveStatus;
|
|
78
|
+
plan: ValidationWavePlan;
|
|
79
|
+
taskResults: SddTestResult[];
|
|
80
|
+
acceptanceEvidence: RuntimeAcceptanceEvidenceMapRecord[];
|
|
81
|
+
gaps: string[];
|
|
82
|
+
workflowGateDecision: WorkflowGateDecision | null;
|
|
83
|
+
next: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export async function listVerifyValidationUnits(projectRoot: string, options: { branch?: string | null } = {}): Promise<VerifyValidationUnitList> {
|
|
87
|
+
const context = await resolveSddContext(projectRoot, { branch: options.branch ?? undefined, branchSource: options.branch ? 'cli_option' : undefined });
|
|
88
|
+
const verifyContract = await inspectVerifyContract(projectRoot, { branch: context.partition, branchSource: 'cli_option' });
|
|
89
|
+
const verifyBatches = await readVerifyBatchPlans(verifyContract);
|
|
90
|
+
return {
|
|
91
|
+
contract: 'sdd-verify-validation-units-v1',
|
|
92
|
+
branch: context.partition,
|
|
93
|
+
verifyContract,
|
|
94
|
+
units: Array.from(verifyBatches.values()).map(verifyValidationUnitFromBatch)
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
export async function planValidationWave(projectRoot: string, options: RunValidationWaveOptions = {}): Promise<ValidationWavePlan> {
|
|
100
|
+
const context = await resolveSddContext(projectRoot, { branch: options.branch ?? undefined, branchSource: options.branch ? 'cli_option' : undefined });
|
|
101
|
+
const model = await parseSddBranch(projectRoot, context.partition);
|
|
102
|
+
const verifyContract = await inspectVerifyContract(projectRoot, { branch: context.partition, branchSource: 'cli_option' });
|
|
103
|
+
const verifyBatches = await readVerifyBatchPlans(verifyContract);
|
|
104
|
+
const selectedTasks = selectValidationTasks(model.tasks, options, verifyBatches);
|
|
105
|
+
const selectionBoundary = validationSelectionBoundary(options);
|
|
106
|
+
const selectedBatchId = selectedValidationBatchId(options, selectedTasks);
|
|
107
|
+
const selectedVerifyBatches = selectedBatchesForTasks(selectedTasks, selectedBatchId, verifyBatches);
|
|
108
|
+
const selectedTaskIds = new Set(selectedTasks.map((task) => task.id));
|
|
109
|
+
const explicitTaskBlockers = explicitTaskCoverageBlockersForOptions(model.tasks, options, selectedTaskIds, verifyBatches);
|
|
110
|
+
const taskGapBlockers = model.gaps
|
|
111
|
+
.filter((gap) => gap.severity === 'blocking' && gap.taskId !== null && selectedTaskIds.has(gap.taskId))
|
|
112
|
+
.map((gap) => `${gap.field}: ${gap.message}`);
|
|
113
|
+
const blockers = [
|
|
114
|
+
...(verifyContract.status === 'PASS' ? [] : [`verify.md contract is ${verifyContract.status}; run /sdd:tasks or sdd verifies write before /sdd:test.`]),
|
|
115
|
+
...(options.batchId && !verifyBatches.has(options.batchId) ? [`verify.md does not declare verification_batch ${options.batchId}.`] : []),
|
|
116
|
+
...(selectedTasks.length === 0 ? ['No tasks matched the validation wave selection.'] : []),
|
|
117
|
+
...explicitTaskBlockers,
|
|
118
|
+
...taskGapBlockers,
|
|
119
|
+
...selectedTasks.filter((task) => task.validation.length === 0).map((task) => `Task ${task.id} has no validation commands.`),
|
|
120
|
+
...verifyBatchContractBlockers(selectedTasks, selectedVerifyBatches)
|
|
121
|
+
];
|
|
122
|
+
return {
|
|
123
|
+
contract: VALIDATION_WAVE_RUNTIME_CONTRACT_VERSION,
|
|
124
|
+
branch: context.partition,
|
|
125
|
+
wave: options.wave ?? null,
|
|
126
|
+
batchId: selectedBatchId,
|
|
127
|
+
selectionBoundary,
|
|
128
|
+
taskIds: selectedTasks.map((task) => task.id),
|
|
129
|
+
tasks: selectedTasks.map((task) => ({ taskId: task.id, wave: task.wave, commandCount: task.validation.length, acceptanceRefs: acceptanceRefsForTask(task, selectedVerifyBatches) })),
|
|
130
|
+
verifyBatches: selectedVerifyBatches.map(serializeVerifyBatchPlan),
|
|
131
|
+
verifyContract,
|
|
132
|
+
status: blockers.length > 0 ? 'BLOCKED' : 'READY',
|
|
133
|
+
blockers
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export async function runValidationWave(projectRoot: string, options: RunValidationWaveOptions = {}): Promise<ValidationWaveRunResult> {
|
|
138
|
+
const plan = await planValidationWave(projectRoot, options);
|
|
139
|
+
const startedAt = new Date().toISOString();
|
|
140
|
+
const waveRunId = runtimeScopedId(plan.branch, plan.batchId ?? plan.taskIds.join(','), String(options.wave ?? 'all'), startedAt, 'validation-wave');
|
|
141
|
+
const environmentSessionId = runtimeScopedId(plan.branch, waveRunId, 'validation-env');
|
|
142
|
+
await recordRuntimeValidationEnvironmentSession(projectRoot, {
|
|
143
|
+
sessionId: environmentSessionId,
|
|
144
|
+
partition: plan.branch,
|
|
145
|
+
runId: null,
|
|
146
|
+
waveRunId,
|
|
147
|
+
status: plan.status === 'READY' ? 'active' : 'blocked',
|
|
148
|
+
reuseKey: validationEnvironmentReuseKey(plan),
|
|
149
|
+
createdAt: startedAt,
|
|
150
|
+
updatedAt: startedAt,
|
|
151
|
+
payload: { contract: VALIDATION_WAVE_RUNTIME_CONTRACT_VERSION, taskIds: plan.taskIds, wave: plan.wave, batchId: plan.batchId }
|
|
152
|
+
});
|
|
153
|
+
await recordRuntimeValidationWaveRun(projectRoot, {
|
|
154
|
+
waveRunId,
|
|
155
|
+
partition: plan.branch,
|
|
156
|
+
runId: null,
|
|
157
|
+
taskIds: plan.taskIds,
|
|
158
|
+
status: plan.status === 'READY' ? 'RUNNING' : 'BLOCKED',
|
|
159
|
+
environmentSessionId,
|
|
160
|
+
startedAt,
|
|
161
|
+
completedAt: startedAt,
|
|
162
|
+
payload: { contract: VALIDATION_WAVE_RUNTIME_CONTRACT_VERSION, plan }
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
const taskResults: SddTestResult[] = [];
|
|
166
|
+
const acceptanceRefsByTask = acceptanceRefsByTaskFromBatches(plan.verifyBatches);
|
|
167
|
+
if (plan.status === 'READY') {
|
|
168
|
+
for (const taskId of plan.taskIds) {
|
|
169
|
+
taskResults.push(await runSddTest(projectRoot, {
|
|
170
|
+
taskId,
|
|
171
|
+
branch: plan.branch,
|
|
172
|
+
commandInputs: options.commandInputsByTask?.[taskId],
|
|
173
|
+
timeoutMs: options.timeoutMs,
|
|
174
|
+
approved: options.approved,
|
|
175
|
+
validationWave: { waveRunId, environmentSessionId, taskIds: plan.taskIds, acceptanceRefsByTask }
|
|
176
|
+
}));
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const completedAt = new Date().toISOString();
|
|
181
|
+
const validationStatus = plan.status === 'BLOCKED' ? 'BLOCKED' : deriveWaveStatus(taskResults.map((result) => result.status));
|
|
182
|
+
const gaps = [...plan.blockers, ...taskResults.flatMap((result) => result.gaps)];
|
|
183
|
+
const workflowGateDecision = validationStatus === 'PASS'
|
|
184
|
+
? (await evaluateAndRecordWorkflowGateDecision(projectRoot, {
|
|
185
|
+
branch: plan.branch,
|
|
186
|
+
taskId: taskResults[0]?.taskId ?? plan.taskIds[0] ?? null,
|
|
187
|
+
runId: taskResults[0]?.runId ?? null,
|
|
188
|
+
decisionKind: 'validation_wave',
|
|
189
|
+
waveRunId,
|
|
190
|
+
taskIds: plan.taskIds,
|
|
191
|
+
runIds: taskResults.map((result) => result.runId),
|
|
192
|
+
evidenceRefs: taskResults.flatMap((result) => [result.validationArtifact].filter((ref): ref is string => Boolean(ref)))
|
|
193
|
+
})).decision
|
|
194
|
+
: null;
|
|
195
|
+
const status = finalWaveStatus(validationStatus, workflowGateDecision);
|
|
196
|
+
await recordRuntimeValidationWaveRun(projectRoot, {
|
|
197
|
+
waveRunId,
|
|
198
|
+
partition: plan.branch,
|
|
199
|
+
runId: taskResults[0]?.runId ?? null,
|
|
200
|
+
taskIds: plan.taskIds,
|
|
201
|
+
status,
|
|
202
|
+
environmentSessionId,
|
|
203
|
+
startedAt,
|
|
204
|
+
completedAt,
|
|
205
|
+
payload: { contract: VALIDATION_WAVE_RUNTIME_CONTRACT_VERSION, plan, validationStatus, workflowGateDecision, workflowScope: workflowScopeFromGateDecision(workflowGateDecision), taskResults: taskResults.map((result) => ({ taskId: result.taskId, runId: result.runId, testRunId: result.testRunId, status: result.status, workflowGateStatus: result.workflowGateStatus })), gaps }
|
|
206
|
+
});
|
|
207
|
+
await recordRuntimeValidationEnvironmentSession(projectRoot, {
|
|
208
|
+
sessionId: environmentSessionId,
|
|
209
|
+
partition: plan.branch,
|
|
210
|
+
runId: taskResults[0]?.runId ?? null,
|
|
211
|
+
waveRunId,
|
|
212
|
+
status: status === 'PASS' ? 'completed' : status === 'FAIL' ? 'failed' : 'blocked',
|
|
213
|
+
reuseKey: validationEnvironmentReuseKey(plan),
|
|
214
|
+
createdAt: startedAt,
|
|
215
|
+
updatedAt: completedAt,
|
|
216
|
+
payload: { contract: VALIDATION_WAVE_RUNTIME_CONTRACT_VERSION, taskIds: plan.taskIds, wave: plan.wave, batchId: plan.batchId, validationStatus, workflowGateStatus: workflowGateDecision?.status ?? 'none', status }
|
|
217
|
+
});
|
|
218
|
+
const acceptanceEvidence = await listRuntimeAcceptanceEvidenceMaps(projectRoot, { partition: plan.branch, waveRunId });
|
|
219
|
+
return {
|
|
220
|
+
contract: VALIDATION_WAVE_RUNTIME_CONTRACT_VERSION,
|
|
221
|
+
waveRunId,
|
|
222
|
+
environmentSessionId,
|
|
223
|
+
branch: plan.branch,
|
|
224
|
+
status,
|
|
225
|
+
plan,
|
|
226
|
+
taskResults,
|
|
227
|
+
acceptanceEvidence,
|
|
228
|
+
gaps,
|
|
229
|
+
workflowGateDecision,
|
|
230
|
+
next: nextForValidationWave(status, plan.branch, plan.selectionBoundary, plan.batchId, plan.wave, plan.taskIds, workflowGateDecision)
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export function renderValidationWaveResult(result: ValidationWaveRunResult): string {
|
|
235
|
+
return [
|
|
236
|
+
`SDD validation ${result.plan.batchId ? `batch ${result.plan.batchId}` : `wave ${result.plan.wave ?? 'all'}`}`,
|
|
237
|
+
'',
|
|
238
|
+
`status=${result.status}`,
|
|
239
|
+
`branch=${result.branch}`,
|
|
240
|
+
`wave_run=${result.waveRunId}`,
|
|
241
|
+
`environment_session=${result.environmentSessionId}`,
|
|
242
|
+
`batch=${result.plan.batchId ?? 'none'}`,
|
|
243
|
+
`tasks=${result.plan.taskIds.join(',') || 'none'}`,
|
|
244
|
+
`acceptance_maps=${result.acceptanceEvidence.length}`,
|
|
245
|
+
`workflow_gate=${result.workflowGateDecision ? `${result.workflowGateDecision.status}:${result.workflowGateDecision.decisionId}` : 'none'}`,
|
|
246
|
+
'',
|
|
247
|
+
'Gaps:',
|
|
248
|
+
result.gaps.length > 0 ? result.gaps.map((gap) => `- ${gap}`).join('\n') : '- none',
|
|
249
|
+
'',
|
|
250
|
+
'Next:',
|
|
251
|
+
`- ${result.next}`
|
|
252
|
+
].join('\n');
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function selectValidationTasks(tasks: SddTask[], options: RunValidationWaveOptions, verifyBatches: Map<string, VerifyBatchPlan>): SddTask[] {
|
|
256
|
+
const explicit = new Set(options.taskIds ?? []);
|
|
257
|
+
if (explicit.size > 0) {
|
|
258
|
+
return tasks.filter((task) => explicit.has(task.id) && verifyBatchIncludesTask(verifyBatches, task.id));
|
|
259
|
+
}
|
|
260
|
+
if (options.batchId) {
|
|
261
|
+
const batchTasks = new Set(verifyBatches.get(options.batchId)?.tasks ?? []);
|
|
262
|
+
return tasks.filter((task) => batchTasks.has(task.id));
|
|
263
|
+
}
|
|
264
|
+
if (options.wave !== undefined && options.wave !== null) {
|
|
265
|
+
const verifyTaskIds = new Set(Array.from(verifyBatches.values()).flatMap((batch) => batch.tasks));
|
|
266
|
+
return tasks.filter((task) => task.wave === options.wave && verifyTaskIds.has(task.id));
|
|
267
|
+
}
|
|
268
|
+
const batchIds = new Set(verifyBatches.keys());
|
|
269
|
+
if (batchIds.size > 0) {
|
|
270
|
+
return tasks.filter((task) => task.validationBatch && batchIds.has(task.validationBatch));
|
|
271
|
+
}
|
|
272
|
+
return [];
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
function validationSelectionBoundary(options: RunValidationWaveOptions): ValidationWaveSelectionBoundary {
|
|
276
|
+
if (options.batchId) {
|
|
277
|
+
return 'batch';
|
|
278
|
+
}
|
|
279
|
+
if (options.wave !== undefined && options.wave !== null) {
|
|
280
|
+
return 'wave';
|
|
281
|
+
}
|
|
282
|
+
if ((options.taskIds ?? []).length > 0) {
|
|
283
|
+
return 'tasks';
|
|
284
|
+
}
|
|
285
|
+
return 'all';
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
function explicitTaskCoverageBlockersForOptions(tasks: SddTask[], options: RunValidationWaveOptions, selectedTaskIds: Set<string>, verifyBatches: Map<string, VerifyBatchPlan>): string[] {
|
|
289
|
+
const requestedTaskIds = [...new Set(options.taskIds ?? [])];
|
|
290
|
+
if (requestedTaskIds.length === 0) {
|
|
291
|
+
return [];
|
|
292
|
+
}
|
|
293
|
+
const taskById = new Map(tasks.map((task) => [task.id, task]));
|
|
294
|
+
return requestedTaskIds.flatMap((taskId) => {
|
|
295
|
+
if (selectedTaskIds.has(taskId)) {
|
|
296
|
+
return [];
|
|
297
|
+
}
|
|
298
|
+
if (!taskById.has(taskId)) {
|
|
299
|
+
return [`Task ${taskId} was requested but was not found in tasks.md.`];
|
|
300
|
+
}
|
|
301
|
+
if (!verifyBatchIncludesTask(verifyBatches, taskId)) {
|
|
302
|
+
return [`Task ${taskId} was requested but is not covered by verify.md verification batches.`];
|
|
303
|
+
}
|
|
304
|
+
return [`Task ${taskId} was requested but was not selected for validation.`];
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
function selectedValidationBatchId(options: RunValidationWaveOptions, tasks: SddTask[]): string | null {
|
|
309
|
+
if (options.batchId) {
|
|
310
|
+
return options.batchId;
|
|
311
|
+
}
|
|
312
|
+
const batchIds = [...new Set(tasks.map((task) => task.validationBatch).filter((value): value is string => Boolean(value)))];
|
|
313
|
+
return batchIds.length === 1 ? batchIds[0] : null;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
async function readVerifyBatchPlans(inspection: VerifyContractInspection): Promise<Map<string, VerifyBatchPlan>> {
|
|
317
|
+
if (!inspection.exists) {
|
|
318
|
+
return new Map();
|
|
319
|
+
}
|
|
320
|
+
const raw = await readFile(inspection.verifyPath, 'utf8');
|
|
321
|
+
const batches = new Map<string, VerifyBatchPlan>();
|
|
322
|
+
let currentBatch: VerifyBatchPlan | null = null;
|
|
323
|
+
let activeList: 'tasks' | 'checks' | 'forbiddenValidation' | 'requiredArtifacts' | null = null;
|
|
324
|
+
let inAcceptanceMapping = false;
|
|
325
|
+
let currentAcceptanceTask: string | null = null;
|
|
326
|
+
|
|
327
|
+
for (const line of raw.split(/\r?\n/)) {
|
|
328
|
+
const batchMatch = line.match(/^ - id: "?([^"\n]+)"?$/);
|
|
329
|
+
if (batchMatch) {
|
|
330
|
+
currentBatch = { id: batchMatch[1], timing: null, tasks: [], checks: [], forbiddenValidation: [], requiredArtifacts: [], acceptanceMapping: new Map() };
|
|
331
|
+
batches.set(currentBatch.id, currentBatch);
|
|
332
|
+
activeList = null;
|
|
333
|
+
inAcceptanceMapping = false;
|
|
334
|
+
currentAcceptanceTask = null;
|
|
335
|
+
continue;
|
|
336
|
+
}
|
|
337
|
+
if (!currentBatch) {
|
|
338
|
+
continue;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
const timingMatch = line.match(/^ timing: "?([^"\n]+)"?$/);
|
|
342
|
+
if (timingMatch) {
|
|
343
|
+
currentBatch.timing = timingMatch[1];
|
|
344
|
+
continue;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
if (line === ' tasks:') {
|
|
348
|
+
activeList = 'tasks';
|
|
349
|
+
inAcceptanceMapping = false;
|
|
350
|
+
currentAcceptanceTask = null;
|
|
351
|
+
continue;
|
|
352
|
+
}
|
|
353
|
+
if (line === ' checks:') {
|
|
354
|
+
activeList = 'checks';
|
|
355
|
+
inAcceptanceMapping = false;
|
|
356
|
+
currentAcceptanceTask = null;
|
|
357
|
+
continue;
|
|
358
|
+
}
|
|
359
|
+
if (line === ' forbidden_validation:') {
|
|
360
|
+
activeList = 'forbiddenValidation';
|
|
361
|
+
inAcceptanceMapping = false;
|
|
362
|
+
currentAcceptanceTask = null;
|
|
363
|
+
continue;
|
|
364
|
+
}
|
|
365
|
+
if (line === ' required_artifacts:') {
|
|
366
|
+
activeList = 'requiredArtifacts';
|
|
367
|
+
inAcceptanceMapping = false;
|
|
368
|
+
currentAcceptanceTask = null;
|
|
369
|
+
continue;
|
|
370
|
+
}
|
|
371
|
+
if (line === ' acceptance_mapping:') {
|
|
372
|
+
activeList = null;
|
|
373
|
+
inAcceptanceMapping = true;
|
|
374
|
+
currentAcceptanceTask = null;
|
|
375
|
+
continue;
|
|
376
|
+
}
|
|
377
|
+
if (/^ [a-z_]+:/.test(line)) {
|
|
378
|
+
activeList = null;
|
|
379
|
+
inAcceptanceMapping = false;
|
|
380
|
+
currentAcceptanceTask = null;
|
|
381
|
+
continue;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
if (activeList !== null) {
|
|
385
|
+
const listMatch = line.match(/^ - (.+)$/);
|
|
386
|
+
if (listMatch) {
|
|
387
|
+
currentBatch[activeList].push(cleanYamlScalar(listMatch[1]));
|
|
388
|
+
continue;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
if (inAcceptanceMapping) {
|
|
393
|
+
const taskMatch = line.match(/^ ([^:]+):\s*$/);
|
|
394
|
+
if (taskMatch) {
|
|
395
|
+
currentAcceptanceTask = cleanYamlScalar(taskMatch[1]);
|
|
396
|
+
currentBatch.acceptanceMapping.set(currentAcceptanceTask, []);
|
|
397
|
+
continue;
|
|
398
|
+
}
|
|
399
|
+
if (currentAcceptanceTask !== null) {
|
|
400
|
+
const refMatch = line.match(/^ - (.+)$/);
|
|
401
|
+
if (refMatch) {
|
|
402
|
+
currentBatch.acceptanceMapping.get(currentAcceptanceTask)?.push(cleanYamlScalar(refMatch[1]));
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
return batches;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
function verifyBatchContractBlockers(tasks: SddTask[], batches: VerifyBatchPlan[]): string[] {
|
|
411
|
+
const taskById = new Map(tasks.map((task) => [task.id, task]));
|
|
412
|
+
const blockers: string[] = [];
|
|
413
|
+
const forbiddenBackendBuild = batches.some((batch) => batch.forbiddenValidation.some(isBackendBuildValidationCommand));
|
|
414
|
+
for (const batch of batches) {
|
|
415
|
+
for (const taskId of batch.tasks) {
|
|
416
|
+
const task = taskById.get(taskId);
|
|
417
|
+
if (!task) {
|
|
418
|
+
continue;
|
|
419
|
+
}
|
|
420
|
+
const mappedAcceptance = batch.acceptanceMapping.get(taskId) ?? [];
|
|
421
|
+
for (const ref of mappedAcceptance) {
|
|
422
|
+
if (!task.acceptanceRefs.includes(ref) && !task.acceptance.includes(ref)) {
|
|
423
|
+
blockers.push(`verify.md batch ${batch.id} maps ${taskId} to unknown acceptance ${ref}.`);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
for (const artifact of batch.requiredArtifacts) {
|
|
427
|
+
if (task.requiredArtifacts.length > 0 && !task.requiredArtifacts.includes(artifact)) {
|
|
428
|
+
blockers.push(`verify.md batch ${batch.id} requires artifact ${artifact} that task ${taskId} does not declare.`);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
if (batch.forbiddenValidation.some(isBackendBuildValidationCommand) && task.validation.some(isBackendBuildValidationCommand)) {
|
|
432
|
+
blockers.push(`Task ${task.id} declares backend build validation forbidden by verify.md batch ${batch.id}.`);
|
|
433
|
+
}
|
|
434
|
+
if ((task.changeSurface === 'frontend_only' || isFrontendOnlyTask(task)) && task.validation.some(isBackendBuildValidationCommand) && forbiddenBackendBuild) {
|
|
435
|
+
blockers.push(`Task ${task.id} is frontend_only but declares backend build validation forbidden by its verification batch.`);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
return blockers;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
function acceptanceRefsForTask(task: SddTask, batches: VerifyBatchPlan[]): string[] {
|
|
443
|
+
const mappedRefs = batches.flatMap((batch) => batch.acceptanceMapping.get(task.id) ?? []);
|
|
444
|
+
const refs = mappedRefs.length > 0 ? mappedRefs : task.acceptanceRefs.length > 0 ? task.acceptanceRefs : task.acceptance;
|
|
445
|
+
return [...new Set(refs)];
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
function acceptanceRefsByTaskFromBatches(batches: ValidationWavePlan['verifyBatches']): Record<string, string[]> {
|
|
449
|
+
const refsByTask = new Map<string, string[]>();
|
|
450
|
+
for (const batch of batches) {
|
|
451
|
+
for (const [taskId, refs] of Object.entries(batch.acceptanceMapping)) {
|
|
452
|
+
refsByTask.set(taskId, [...new Set([...(refsByTask.get(taskId) ?? []), ...refs])]);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
return Object.fromEntries(refsByTask);
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
function selectedBatchesForTasks(tasks: SddTask[], selectedBatchId: string | null, verifyBatches: Map<string, VerifyBatchPlan>): VerifyBatchPlan[] {
|
|
459
|
+
if (selectedBatchId) {
|
|
460
|
+
return [verifyBatches.get(selectedBatchId)].filter((batch): batch is VerifyBatchPlan => Boolean(batch));
|
|
461
|
+
}
|
|
462
|
+
const selectedTaskIds = new Set(tasks.map((task) => task.id));
|
|
463
|
+
return Array.from(verifyBatches.values()).filter((batch) => batch.tasks.some((taskId) => selectedTaskIds.has(taskId)));
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
function verifyBatchIncludesTask(verifyBatches: Map<string, VerifyBatchPlan>, taskId: string): boolean {
|
|
467
|
+
return Array.from(verifyBatches.values()).some((batch) => batch.tasks.includes(taskId));
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
function serializeVerifyBatchPlan(batch: VerifyBatchPlan): ValidationWavePlan['verifyBatches'][number] {
|
|
471
|
+
return {
|
|
472
|
+
id: batch.id,
|
|
473
|
+
timing: batch.timing,
|
|
474
|
+
tasks: batch.tasks,
|
|
475
|
+
checks: batch.checks,
|
|
476
|
+
forbiddenValidation: batch.forbiddenValidation,
|
|
477
|
+
requiredArtifacts: batch.requiredArtifacts,
|
|
478
|
+
acceptanceMapping: Object.fromEntries(batch.acceptanceMapping)
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
function verifyValidationUnitFromBatch(batch: VerifyBatchPlan): VerifyValidationUnit {
|
|
484
|
+
return {
|
|
485
|
+
validationUnitId: batch.id,
|
|
486
|
+
timing: batch.timing,
|
|
487
|
+
taskIds: batch.tasks,
|
|
488
|
+
checks: batch.checks,
|
|
489
|
+
forbiddenValidation: batch.forbiddenValidation,
|
|
490
|
+
requiredArtifacts: batch.requiredArtifacts,
|
|
491
|
+
acceptanceMapping: Object.fromEntries(batch.acceptanceMapping)
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
function cleanYamlScalar(value: string): string {
|
|
496
|
+
const trimmed = value.trim();
|
|
497
|
+
if (trimmed.startsWith('"') && trimmed.endsWith('"')) {
|
|
498
|
+
try {
|
|
499
|
+
return JSON.parse(trimmed) as string;
|
|
500
|
+
} catch {
|
|
501
|
+
return trimmed.slice(1, -1);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
if (trimmed.startsWith("'") && trimmed.endsWith("'")) {
|
|
505
|
+
return trimmed.slice(1, -1);
|
|
506
|
+
}
|
|
507
|
+
return trimmed;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
function deriveWaveStatus(statuses: SddTestStatus[]): RuntimeValidationWaveStatus {
|
|
511
|
+
if (statuses.length === 0 || statuses.some((status) => status === 'BLOCKED')) {
|
|
512
|
+
return 'BLOCKED';
|
|
513
|
+
}
|
|
514
|
+
if (statuses.some((status) => status === 'FAIL')) {
|
|
515
|
+
return 'FAIL';
|
|
516
|
+
}
|
|
517
|
+
return 'PASS';
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
function validationEnvironmentReuseKey(plan: ValidationWavePlan): string {
|
|
521
|
+
return `${plan.branch}:${plan.batchId ?? plan.wave ?? 'all'}:${plan.taskIds.join(',')}`;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
function workflowScopeFromGateDecision(decision: WorkflowGateDecision | null): WorkflowGateScope | null {
|
|
525
|
+
if (!decision?.payload || typeof decision.payload !== 'object') {
|
|
526
|
+
return null;
|
|
527
|
+
}
|
|
528
|
+
return ((decision.payload as { workflowScope?: WorkflowGateScope }).workflowScope) ?? null;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
function finalWaveStatus(validationStatus: RuntimeValidationWaveStatus, workflowGateDecision: WorkflowGateDecision | null): RuntimeValidationWaveStatus {
|
|
532
|
+
if (validationStatus !== 'PASS') {
|
|
533
|
+
return validationStatus;
|
|
534
|
+
}
|
|
535
|
+
return workflowGateDecision?.status === 'PASS' ? 'PASS' : 'BLOCKED';
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
function nextForValidationWave(status: RuntimeValidationWaveStatus, branch: string, selectionBoundary: ValidationWaveSelectionBoundary, batchId: string | null, wave: number | null, taskIds: string[], workflowGateDecision: WorkflowGateDecision | null): string {
|
|
539
|
+
if (status === 'PASS') {
|
|
540
|
+
return `sdd test close --branch ${branch} --target goal-verify --compact-json`;
|
|
541
|
+
}
|
|
542
|
+
if (workflowGateDecision && workflowGateDecision.status !== 'PASS') {
|
|
543
|
+
return `Inspect validation wave gate ${workflowGateDecision.decisionId}, resolve blockers or decision-card requirements, then rerun ${rerunValidationCommand(branch, selectionBoundary, batchId, wave, taskIds)}.`;
|
|
544
|
+
}
|
|
545
|
+
return `Inspect validation wave evidence, fix blocked or failed tasks, then rerun ${rerunValidationCommand(branch, selectionBoundary, batchId, wave, taskIds)}.`;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
function rerunValidationCommand(branch: string, selectionBoundary: ValidationWaveSelectionBoundary, batchId: string | null, wave: number | null, taskIds: string[]): string {
|
|
549
|
+
if (selectionBoundary === 'batch' && batchId) {
|
|
550
|
+
return `sdd test ${batchId} --branch ${branch}`;
|
|
551
|
+
}
|
|
552
|
+
if (selectionBoundary === 'tasks' && taskIds.length > 0) {
|
|
553
|
+
return `sdd test ${taskIds.length === 1 ? `task-${taskIds[0]}` : taskIds.map((taskId) => `task-${taskId}`).join(',')} --branch ${branch}`;
|
|
554
|
+
}
|
|
555
|
+
return wave === null ? `sdd test wave-all --branch ${branch}` : `sdd test wave-${wave} --branch ${branch}`;
|
|
556
|
+
}
|