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,24 +1,33 @@
|
|
|
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 type { RunState } from '../run-state/model.js';
|
|
6
|
-
import { createRun, readRunState, writeRunState } from '../run-state/run-state.js';
|
|
7
|
-
import {
|
|
4
|
+
import { appendArtifactHashLedgerEntry, appendInvocationLedgerEntry } from '../run-state/invocation-ledger.js';
|
|
5
|
+
import type { RunState, RunStateTaskRuntime } from '../run-state/model.js';
|
|
6
|
+
import { createRun, readAllRunStates, readRunState, writeRunState } from '../run-state/run-state.js';
|
|
7
|
+
import { recordRuntimeOnlyArtifact, recordStageEvidenceArtifact } from '../run-state/artifacts.js';
|
|
8
|
+
import { toBranchStageEvidenceRef } from '../runtime-paths.js';
|
|
8
9
|
import { resolveSddContext } from '../sdd-docs/context.js';
|
|
9
10
|
import { bindRunStateToTask } from '../sdd-docs/run-binding.js';
|
|
10
|
-
import { parseSddBranch, type SddTask } from '../sdd-docs/task-parser.js';
|
|
11
|
-
import {
|
|
11
|
+
import { parseSddBranch, type SddTask, type SddTaskModel } from '../sdd-docs/task-parser.js';
|
|
12
|
+
import { inspectSddTask } from '../sdd-docs/task-inspection.js';
|
|
13
|
+
import { listRuntimeArtifactPayloads, readRuntimeValidationCacheEntry, recordRuntimeAcceptanceEvidenceMap, recordRuntimeDurableGap, recordRuntimeProjection, recordRuntimeTestRun, recordRuntimeTestStep, recordRuntimeValidationCacheEntry, recordRuntimeValidationCacheUse, recordRuntimeValidationEnvironmentSession, recordRuntimeValidationWaveRun, runtimeScopedId, updateRuntimeDurableGapStatus, type RuntimeValidationCacheEntryRecord } from '../storage/runtime-store.js';
|
|
12
14
|
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';
|
|
13
15
|
import type { LifecycleRiskDecision } from '../risk/contracts.js';
|
|
14
|
-
import { inspectVerifyContract,
|
|
15
|
-
import type { AcceptanceEvidenceCoverage, EvidenceCoverageStatus, TestEvidenceStatus, UnifiedTestEvidenceRun } from '../evidence-runtime.js';
|
|
16
|
+
import { inspectVerifyContract, type VerifyContractInspection } from './verify-contract.js';
|
|
17
|
+
import type { AcceptanceEvidenceCoverage, CapabilityEvidenceClassification, EvidenceCoverageStatus, TestEvidenceStatus, UnifiedTestEvidenceRun } from '../evidence-runtime.js';
|
|
16
18
|
import { ensureTaskOrchestration, inspectOrchestrationGate } from '../orchestration/runtime.js';
|
|
17
19
|
import { recordStageRunProjection, recordWorkflowHandoffProjection, validateWorkflowHandoff } from '../stage-runtime/runtime.js';
|
|
18
20
|
import type { StageRun, WorkflowHandoff } from '../stage-runtime/contracts.js';
|
|
19
21
|
import { evaluateTaskWorkflowGate, verifyContractBlockedGate, type ApprovalPolicy, type LifecycleRiskProfile, type LifecycleWorkflowGate } from '../risk.js';
|
|
20
22
|
import { validateSddResultArtifact } from '../artifacts/sdd-result.js';
|
|
21
23
|
import { dependencyBlockingReasonsForTask } from '../workflow-state/dependencies.js';
|
|
24
|
+
import { selectLatestEligibleRunsByTask } from '../workflow-state/latest-eligible-run.js';
|
|
25
|
+
import { latestRuntimeTaskStates } from '../workflow-state/resolve.js';
|
|
26
|
+
import { routeSddTask } from '../router/route-sdd-task.js';
|
|
27
|
+
import type { AgentCapabilityRouteDecision } from '../router/agent-runtime.js';
|
|
28
|
+
import { evaluateAndRecordWorkflowGateDecision } from '../workflow-gate/evidence-packet.js';
|
|
29
|
+
import type { WorkflowGateDecision, WorkflowGateStatus } from '../workflow-gate/types.js';
|
|
30
|
+
import { buildValidationCachePlan, type ValidationCacheUnsafeReason } from './validation-cache.js';
|
|
22
31
|
|
|
23
32
|
const DEFAULT_TEST_TIMEOUT_MS = 120_000;
|
|
24
33
|
const MAX_CAPTURE_BYTES = 256 * 1024;
|
|
@@ -41,10 +50,20 @@ export interface SddTestCommandStep {
|
|
|
41
50
|
exitCode: number | null;
|
|
42
51
|
signal: string | null;
|
|
43
52
|
durationMs: number;
|
|
44
|
-
outputArtifact: string;
|
|
53
|
+
outputArtifact: string | null;
|
|
45
54
|
stdoutBytes: number;
|
|
46
55
|
stderrBytes: number;
|
|
47
56
|
truncated: boolean;
|
|
57
|
+
startedAt: string;
|
|
58
|
+
endedAt: string;
|
|
59
|
+
cwd: string;
|
|
60
|
+
stdoutDigest: string;
|
|
61
|
+
stderrDigest: string;
|
|
62
|
+
outputSummary: string;
|
|
63
|
+
cacheStatus: 'hit' | 'miss' | 'unsafe';
|
|
64
|
+
cacheKey: string | null;
|
|
65
|
+
cacheSourceTestRunId: string | null;
|
|
66
|
+
cacheUnsafeReasons: ValidationCacheUnsafeReason[];
|
|
48
67
|
}
|
|
49
68
|
|
|
50
69
|
interface NormalizedSddTestCommand {
|
|
@@ -53,20 +72,23 @@ interface NormalizedSddTestCommand {
|
|
|
53
72
|
shell: boolean;
|
|
54
73
|
}
|
|
55
74
|
|
|
56
|
-
interface TestSyncBackProposal {
|
|
57
|
-
path: string;
|
|
58
|
-
digest: string;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
75
|
type VerifyContractAction = 'none' | 'created' | 'refreshed' | 'blocked';
|
|
62
76
|
|
|
77
|
+
type RuntimeTestJudgment = WorkflowGateStatus;
|
|
78
|
+
|
|
63
79
|
export interface SddTestResult {
|
|
64
80
|
contract: 'sdd-test-runtime-v1';
|
|
65
81
|
runId: string;
|
|
66
82
|
testRunId: string;
|
|
83
|
+
validationWaveRunId: string;
|
|
84
|
+
validationEnvironmentSessionId: string;
|
|
67
85
|
branch: string;
|
|
68
86
|
taskId: string;
|
|
69
87
|
status: SddTestStatus;
|
|
88
|
+
validationStatus: SddTestStatus;
|
|
89
|
+
workflowGateStatus: WorkflowGateStatus;
|
|
90
|
+
runtimeJudgment: RuntimeTestJudgment;
|
|
91
|
+
workflowGateDecision: WorkflowGateDecision;
|
|
70
92
|
verifyContractStatus: string;
|
|
71
93
|
verifyContractAction: VerifyContractAction;
|
|
72
94
|
lifecycleGate: LifecycleWorkflowGate;
|
|
@@ -78,7 +100,7 @@ export interface SddTestResult {
|
|
|
78
100
|
evidenceCoverage: EvidenceCoverageStatus;
|
|
79
101
|
policyJudgment: TestEvidenceStatus;
|
|
80
102
|
acceptanceCoverage: AcceptanceEvidenceCoverage[];
|
|
81
|
-
|
|
103
|
+
capabilityEvidence: CapabilityEvidenceClassification[];
|
|
82
104
|
commands: string[];
|
|
83
105
|
steps: SddTestCommandStep[];
|
|
84
106
|
validationArtifact: string | null;
|
|
@@ -95,18 +117,16 @@ export interface RunSddTestOptions {
|
|
|
95
117
|
commandInputs?: SddTestCommandInput[];
|
|
96
118
|
timeoutMs?: number;
|
|
97
119
|
approved?: boolean;
|
|
120
|
+
validationWave?: { waveRunId: string; environmentSessionId: string; taskIds: string[]; acceptanceRefsByTask?: Record<string, string[]> };
|
|
98
121
|
}
|
|
99
122
|
|
|
100
123
|
export async function runSddTest(projectRoot: string, options: RunSddTestOptions): Promise<SddTestResult> {
|
|
101
124
|
const context = await resolveSddContext(projectRoot, { branch: options.branch ?? undefined, branchSource: options.branch ? 'cli_option' : undefined });
|
|
102
|
-
|
|
103
|
-
|
|
125
|
+
const model = await parseSddBranch(projectRoot, context.partition);
|
|
126
|
+
const inspected = inspectSddTask(model, options.taskId);
|
|
127
|
+
const task = inspected.task;
|
|
104
128
|
const verifyContract = await ensureVerifyContractForTest(projectRoot, context.partition);
|
|
105
129
|
const verifyInspection = verifyContract.inspection;
|
|
106
|
-
if (verifyContract.action === 'created' || verifyContract.action === 'refreshed') {
|
|
107
|
-
model = await parseSddBranch(projectRoot, context.partition);
|
|
108
|
-
task = model.tasks.find((candidate) => candidate.id === options.taskId) ?? null;
|
|
109
|
-
}
|
|
110
130
|
const initialState = options.runId ? await readRunState(projectRoot, options.runId) : await createRun(projectRoot);
|
|
111
131
|
const state = await bindRunStateToTask(projectRoot, initialState, context, model, task, options.taskId);
|
|
112
132
|
const testRunId = runtimeScopedId(state.runId, options.taskId, new Date().toISOString(), 'sdd-test');
|
|
@@ -114,6 +134,36 @@ export async function runSddTest(projectRoot: string, options: RunSddTestOptions
|
|
|
114
134
|
const commands = commandInputs.map((input) => input.command);
|
|
115
135
|
const gaps: string[] = [];
|
|
116
136
|
const startedAt = new Date().toISOString();
|
|
137
|
+
const ownsValidationWave = !options.validationWave;
|
|
138
|
+
const validationWaveRunId = options.validationWave?.waveRunId ?? runtimeScopedId(context.partition, options.taskId, state.runId, testRunId, 'validation-wave');
|
|
139
|
+
const validationEnvironmentSessionId = options.validationWave?.environmentSessionId ?? runtimeScopedId(context.partition, validationWaveRunId, 'validation-env');
|
|
140
|
+
const validationWaveTaskIds = options.validationWave?.taskIds ?? [options.taskId];
|
|
141
|
+
const validationWaveAcceptanceRefs = options.validationWave?.acceptanceRefsByTask?.[options.taskId];
|
|
142
|
+
const validationWaveScopeAcceptanceRefs = [...new Set(Object.values(options.validationWave?.acceptanceRefsByTask ?? { [options.taskId]: task?.acceptanceRefs ?? [] }).flat())].sort();
|
|
143
|
+
if (ownsValidationWave) {
|
|
144
|
+
await recordRuntimeValidationEnvironmentSession(projectRoot, {
|
|
145
|
+
sessionId: validationEnvironmentSessionId,
|
|
146
|
+
partition: context.partition,
|
|
147
|
+
runId: state.runId,
|
|
148
|
+
waveRunId: validationWaveRunId,
|
|
149
|
+
status: 'active',
|
|
150
|
+
reuseKey: `${context.partition}:${options.taskId}`,
|
|
151
|
+
createdAt: startedAt,
|
|
152
|
+
updatedAt: startedAt,
|
|
153
|
+
payload: { contract: 'phase-8.17-validation-wave-runtime-v1', mode: 'single-task' }
|
|
154
|
+
});
|
|
155
|
+
await recordRuntimeValidationWaveRun(projectRoot, {
|
|
156
|
+
waveRunId: validationWaveRunId,
|
|
157
|
+
partition: context.partition,
|
|
158
|
+
runId: state.runId,
|
|
159
|
+
taskIds: validationWaveTaskIds,
|
|
160
|
+
status: 'RUNNING',
|
|
161
|
+
environmentSessionId: validationEnvironmentSessionId,
|
|
162
|
+
startedAt,
|
|
163
|
+
completedAt: startedAt,
|
|
164
|
+
payload: { contract: 'phase-8.17-validation-wave-runtime-v1', mode: 'single-task', taskId: options.taskId }
|
|
165
|
+
});
|
|
166
|
+
}
|
|
117
167
|
|
|
118
168
|
await appendEvent(projectRoot, state.runId, {
|
|
119
169
|
event: 'test_runtime_started',
|
|
@@ -122,11 +172,16 @@ export async function runSddTest(projectRoot: string, options: RunSddTestOptions
|
|
|
122
172
|
data: { taskId: options.taskId, branch: context.partition, testRunId, commands }
|
|
123
173
|
});
|
|
124
174
|
|
|
175
|
+
const states = await readAllRunStates(projectRoot);
|
|
176
|
+
const latestEligibleRunsByTask = selectLatestEligibleRunsByTask({ states, model, partition: context.partition, currentGitBranch: context.currentGitBranch });
|
|
177
|
+
const runtimeByTask = latestRuntimeTaskStates(latestEligibleRunsByTask, states);
|
|
178
|
+
|
|
125
179
|
if (!task) {
|
|
126
180
|
gaps.push(`Task ${options.taskId} was not found in specs/${context.partition}/tasks.md.`);
|
|
127
181
|
}
|
|
128
182
|
if (task) {
|
|
129
|
-
gaps.push(...
|
|
183
|
+
gaps.push(...inspected.gaps.filter((gap) => gap.severity === 'blocking').map((gap) => `${gap.field}: ${gap.message}`));
|
|
184
|
+
gaps.push(...dependencyBlockingReasonsForTask(model, options.taskId, { runtimeByTask }));
|
|
130
185
|
}
|
|
131
186
|
if (verifyContract.action === 'blocked') {
|
|
132
187
|
gaps.push(verifyContractBlocker(verifyInspection));
|
|
@@ -175,7 +230,7 @@ export async function runSddTest(projectRoot: string, options: RunSddTestOptions
|
|
|
175
230
|
const steps: SddTestCommandStep[] = [];
|
|
176
231
|
if (gaps.length === 0) {
|
|
177
232
|
for (const [index, commandInput] of commandInputs.entries()) {
|
|
178
|
-
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);
|
|
233
|
+
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);
|
|
179
234
|
steps.push(step);
|
|
180
235
|
await appendEvent(projectRoot, state.runId, {
|
|
181
236
|
event: 'test_step_completed',
|
|
@@ -187,40 +242,30 @@ export async function runSddTest(projectRoot: string, options: RunSddTestOptions
|
|
|
187
242
|
}
|
|
188
243
|
|
|
189
244
|
const commandStatus = deriveCommandStatus(gaps, steps);
|
|
190
|
-
const acceptanceCoverage = buildAcceptanceCoverage(task, steps, commandStatus);
|
|
245
|
+
const acceptanceCoverage = buildAcceptanceCoverage(task, steps, commandStatus, validationWaveAcceptanceRefs);
|
|
191
246
|
const evidenceCoverage = summarizeEvidenceCoverage(acceptanceCoverage);
|
|
192
247
|
const policyJudgment = derivePolicyJudgment(commandStatus, evidenceCoverage);
|
|
193
|
-
|
|
194
|
-
const
|
|
195
|
-
const
|
|
196
|
-
const
|
|
197
|
-
const
|
|
198
|
-
|
|
248
|
+
await recordAcceptanceEvidenceMaps(projectRoot, validationWaveRunId, testRunId, context.partition, state.runId, options.taskId, acceptanceCoverage);
|
|
249
|
+
const validationStatus = policyJudgment;
|
|
250
|
+
const capabilityRoute = task ? await routeSddTask(projectRoot, { taskId: options.taskId, branch: context.partition, approved: options.approved }) : null;
|
|
251
|
+
const capabilityEvidence = buildCapabilityEvidenceClassification(capabilityRoute?.capabilityDecision ?? null, steps);
|
|
252
|
+
const validationArtifact = task ? await writeValidationArtifact(projectRoot, state.runId, context.partition, task, validationStatus, steps, gaps, capabilityEvidence) : null;
|
|
253
|
+
const evidenceBeforeGate = runtimeEvidenceRefs(validationArtifact?.runRelativePath ?? null, steps);
|
|
254
|
+
await persistTestRunState(projectRoot, state, options.taskId, validationStatus, commands, evidenceBeforeGate, validationArtifact?.runRelativePath ?? null);
|
|
255
|
+
await resolveTestRuntimeDurableGap(projectRoot, context.partition, state.runId, options.taskId, validationStatus, gaps);
|
|
256
|
+
|
|
257
|
+
const gateDecision = (await evaluateAndRecordWorkflowGateDecision(projectRoot, {
|
|
199
258
|
branch: context.partition,
|
|
200
259
|
taskId: options.taskId,
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
primaryReason: workflowGate.primaryReason,
|
|
209
|
-
commandStatus,
|
|
210
|
-
evidenceCoverage,
|
|
211
|
-
policyJudgment,
|
|
212
|
-
acceptanceCoverage,
|
|
213
|
-
syncBackReady,
|
|
214
|
-
commands,
|
|
215
|
-
steps,
|
|
216
|
-
validationArtifact: validationArtifact?.runRelativePath ?? null,
|
|
217
|
-
gaps
|
|
218
|
-
});
|
|
260
|
+
runId: state.runId,
|
|
261
|
+
decisionKind: 'test'
|
|
262
|
+
})).decision;
|
|
263
|
+
const runtimeJudgment = gateDecision.status;
|
|
264
|
+
const status = finalStatusForTest(validationStatus, runtimeJudgment);
|
|
265
|
+
await recordTestRuntimeDurableGap(projectRoot, context.partition, state.runId, options.taskId, status, validationStatus, runtimeJudgment, gaps, evidenceBeforeGate);
|
|
266
|
+
const unifiedEvidence = buildUnifiedTestEvidenceRun(testRunId, context.partition, state.runId, options.taskId, commandStatus, evidenceCoverage, policyJudgment, status, runtimeJudgment, steps, acceptanceCoverage, capabilityEvidence, gaps, workflowGate.nextAction, gateDecision);
|
|
219
267
|
const completedAt = new Date().toISOString();
|
|
220
|
-
const evidence =
|
|
221
|
-
const syncBackProposal = syncBackReady
|
|
222
|
-
? await writeTestSyncBackProposal(projectRoot, state.runId, options.taskId, evidence, acceptanceCoverage)
|
|
223
|
-
: null;
|
|
268
|
+
const evidence = runtimeEvidenceRefs(validationArtifact?.runRelativePath ?? null, steps);
|
|
224
269
|
|
|
225
270
|
await recordRuntimeTestRun(projectRoot, {
|
|
226
271
|
testRunId,
|
|
@@ -230,7 +275,7 @@ export async function runSddTest(projectRoot: string, options: RunSddTestOptions
|
|
|
230
275
|
status,
|
|
231
276
|
startedAt,
|
|
232
277
|
completedAt,
|
|
233
|
-
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,
|
|
278
|
+
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 }
|
|
234
279
|
});
|
|
235
280
|
await recordRuntimeProjection(projectRoot, 'test_runtime', `${context.partition}:${options.taskId}:${state.runId}`, {
|
|
236
281
|
contract: 'sdd-test-runtime-v1',
|
|
@@ -238,6 +283,9 @@ export async function runSddTest(projectRoot: string, options: RunSddTestOptions
|
|
|
238
283
|
runId: state.runId,
|
|
239
284
|
taskId: options.taskId,
|
|
240
285
|
status,
|
|
286
|
+
validationStatus,
|
|
287
|
+
workflowGateStatus: gateDecision.status,
|
|
288
|
+
runtimeJudgment,
|
|
241
289
|
lifecycleGate: workflowGate.lifecycleGate,
|
|
242
290
|
primaryReason: workflowGate.primaryReason,
|
|
243
291
|
evidence,
|
|
@@ -253,21 +301,52 @@ export async function runSddTest(projectRoot: string, options: RunSddTestOptions
|
|
|
253
301
|
gaps,
|
|
254
302
|
riskDecision: orchestration.riskDecision
|
|
255
303
|
});
|
|
256
|
-
await
|
|
304
|
+
await persistTestGateOutcome(projectRoot, state.runId, options.taskId, status, validationStatus, commands, evidence, validationArtifact?.runRelativePath ?? null, gateDecision);
|
|
305
|
+
if (ownsValidationWave) {
|
|
306
|
+
await recordRuntimeValidationWaveRun(projectRoot, {
|
|
307
|
+
waveRunId: validationWaveRunId,
|
|
308
|
+
partition: context.partition,
|
|
309
|
+
runId: state.runId,
|
|
310
|
+
taskIds: validationWaveTaskIds,
|
|
311
|
+
status,
|
|
312
|
+
environmentSessionId: validationEnvironmentSessionId,
|
|
313
|
+
startedAt,
|
|
314
|
+
completedAt,
|
|
315
|
+
payload: { contract: 'phase-8.17-validation-wave-runtime-v1', mode: 'single-task', taskId: options.taskId, testRunId, evidence, gaps, workflowGateDecision: gateDecision }
|
|
316
|
+
});
|
|
317
|
+
await recordRuntimeValidationEnvironmentSession(projectRoot, {
|
|
318
|
+
sessionId: validationEnvironmentSessionId,
|
|
319
|
+
partition: context.partition,
|
|
320
|
+
runId: state.runId,
|
|
321
|
+
waveRunId: validationWaveRunId,
|
|
322
|
+
status: status === 'PASS' ? 'completed' : status === 'FAIL' ? 'failed' : 'blocked',
|
|
323
|
+
reuseKey: `${context.partition}:${options.taskId}`,
|
|
324
|
+
createdAt: startedAt,
|
|
325
|
+
updatedAt: completedAt,
|
|
326
|
+
payload: { contract: 'phase-8.17-validation-wave-runtime-v1', mode: 'single-task', taskId: options.taskId, validationStatus, workflowGateStatus: gateDecision.status, status }
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
|
|
257
330
|
await appendEvent(projectRoot, state.runId, {
|
|
258
|
-
event: status === 'PASS' ? 'test_runtime_passed' : '
|
|
331
|
+
event: status === 'PASS' ? 'test_runtime_passed' : 'test_runtime_blocked',
|
|
259
332
|
runId: state.runId,
|
|
260
333
|
summary: `SDD test runtime ${status} for ${options.taskId}`,
|
|
261
|
-
data: { taskId: options.taskId, testRunId, status, evidence, gaps }
|
|
334
|
+
data: { taskId: options.taskId, testRunId, status, validationStatus, evidence, gaps, gateDecisionId: gateDecision.decisionId, gateStatus: gateDecision.status }
|
|
262
335
|
});
|
|
263
336
|
|
|
264
337
|
return {
|
|
265
338
|
contract: 'sdd-test-runtime-v1',
|
|
266
339
|
runId: state.runId,
|
|
267
340
|
testRunId,
|
|
341
|
+
validationWaveRunId,
|
|
342
|
+
validationEnvironmentSessionId,
|
|
268
343
|
branch: context.partition,
|
|
269
344
|
taskId: options.taskId,
|
|
270
345
|
status,
|
|
346
|
+
validationStatus,
|
|
347
|
+
workflowGateStatus: gateDecision.status,
|
|
348
|
+
runtimeJudgment,
|
|
349
|
+
workflowGateDecision: gateDecision,
|
|
271
350
|
verifyContractStatus: verifyInspection.status,
|
|
272
351
|
verifyContractAction: verifyContract.action,
|
|
273
352
|
lifecycleGate: workflowGate.lifecycleGate,
|
|
@@ -279,16 +358,36 @@ export async function runSddTest(projectRoot: string, options: RunSddTestOptions
|
|
|
279
358
|
evidenceCoverage,
|
|
280
359
|
policyJudgment,
|
|
281
360
|
acceptanceCoverage,
|
|
282
|
-
|
|
361
|
+
capabilityEvidence,
|
|
283
362
|
commands,
|
|
284
363
|
steps,
|
|
285
364
|
validationArtifact: validationArtifact?.runRelativePath ?? null,
|
|
286
|
-
indexArtifact:
|
|
365
|
+
indexArtifact: null,
|
|
287
366
|
gaps,
|
|
288
|
-
next: nextForTestResult(status, context.partition, options.taskId,
|
|
367
|
+
next: nextForTestResult(status, runtimeJudgment, context.partition, options.taskId, workflowGate.nextAction, gateDecision)
|
|
289
368
|
};
|
|
290
369
|
}
|
|
291
370
|
|
|
371
|
+
async function recordAcceptanceEvidenceMaps(projectRoot: string, waveRunId: string, testRunId: string, partition: string, runId: string, taskId: string, acceptanceCoverage: AcceptanceEvidenceCoverage[]): Promise<void> {
|
|
372
|
+
const createdAt = new Date().toISOString();
|
|
373
|
+
for (const coverage of acceptanceCoverage) {
|
|
374
|
+
await recordRuntimeAcceptanceEvidenceMap(projectRoot, {
|
|
375
|
+
mapId: runtimeScopedId(waveRunId, testRunId, taskId, coverage.acceptanceRef),
|
|
376
|
+
waveRunId,
|
|
377
|
+
testRunId,
|
|
378
|
+
partition,
|
|
379
|
+
runId,
|
|
380
|
+
taskId,
|
|
381
|
+
acceptanceRef: coverage.acceptanceRef,
|
|
382
|
+
status: coverage.status,
|
|
383
|
+
evidenceRefs: coverage.evidenceRefs.map((ref) => ref.ref),
|
|
384
|
+
gaps: coverage.gaps,
|
|
385
|
+
createdAt,
|
|
386
|
+
payload: coverage
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
292
391
|
async function recordTestWorkflowProjection(projectRoot: string, input: { taskId: string; stageRun: StageRun; status: SddTestStatus; completedAt: string; evidence: string[]; gaps: string[]; riskDecision: LifecycleRiskDecision }): Promise<void> {
|
|
293
392
|
const outputRefs = input.evidence.map((ref) => ({ kind: 'artifact' as const, ref }));
|
|
294
393
|
const completedStage: StageRun = {
|
|
@@ -324,20 +423,8 @@ async function recordTestWorkflowProjection(projectRoot: string, input: { taskId
|
|
|
324
423
|
|
|
325
424
|
|
|
326
425
|
async function ensureVerifyContractForTest(projectRoot: string, branch: string): Promise<{ inspection: VerifyContractInspection; action: VerifyContractAction }> {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
return { inspection, action: 'blocked' };
|
|
330
|
-
}
|
|
331
|
-
if (inspection.status === 'PASS') {
|
|
332
|
-
return { inspection, action: 'none' };
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
const written = await writeVerifyContract(projectRoot, { branch, branchSource: 'cli_option', force: inspection.exists });
|
|
336
|
-
inspection = await inspectVerifyContract(projectRoot, { branch, branchSource: 'cli_option' });
|
|
337
|
-
if (inspection.status !== 'PASS') {
|
|
338
|
-
return { inspection, action: 'blocked' };
|
|
339
|
-
}
|
|
340
|
-
return { inspection, action: written.status === 'created' ? 'created' : 'refreshed' };
|
|
426
|
+
const inspection = await inspectVerifyContract(projectRoot, { branch, branchSource: 'cli_option' });
|
|
427
|
+
return { inspection, action: inspection.status === 'PASS' ? 'none' : 'blocked' };
|
|
341
428
|
}
|
|
342
429
|
|
|
343
430
|
function verifyContractBlocker(inspection: VerifyContractInspection): string {
|
|
@@ -346,12 +433,17 @@ function verifyContractBlocker(inspection: VerifyContractInspection): string {
|
|
|
346
433
|
}
|
|
347
434
|
|
|
348
435
|
async function hasReviewerCheckpoint(projectRoot: string, state: RunState, taskId: string): Promise<boolean> {
|
|
349
|
-
const artifactPaths = new Set(
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
436
|
+
const artifactPaths = new Set(state.artifacts
|
|
437
|
+
.filter((artifact) => artifact.task === taskId && (artifact.agent === 'reviewer' || artifact.kind === 'review'))
|
|
438
|
+
.map((artifact) => artifact.path));
|
|
439
|
+
const branch = state.partition ?? state.gitBranch ?? 'unscoped';
|
|
440
|
+
const payloads = await listRuntimeArtifactPayloads(projectRoot, { runId: state.runId, taskId });
|
|
441
|
+
for (const payload of payloads) {
|
|
442
|
+
const fileName = payload.logicalRef.replace(/\\/g, '/').split('/').filter(Boolean).pop();
|
|
443
|
+
if (fileName && (payload.artifactRole === 'review' || /review/i.test(fileName))) {
|
|
444
|
+
artifactPaths.add(toBranchStageEvidenceRef(branch, 'do', fileName));
|
|
445
|
+
}
|
|
446
|
+
}
|
|
355
447
|
|
|
356
448
|
for (const artifactPath of artifactPaths) {
|
|
357
449
|
const report = await validateSddResultArtifact(projectRoot, state.runId, artifactPath, { expectedTask: taskId, expectedAgent: 'reviewer' });
|
|
@@ -369,8 +461,14 @@ export function renderSddTestResult(result: SddTestResult): string {
|
|
|
369
461
|
'',
|
|
370
462
|
resultSentenceForTest(result),
|
|
371
463
|
'',
|
|
464
|
+
'Decision:',
|
|
465
|
+
`- validation_status=${result.validationStatus}`,
|
|
466
|
+
`- workflow_gate_status=${result.workflowGateStatus}`,
|
|
467
|
+
`- workflow_gate_decision=${result.workflowGateDecision.decisionId}`,
|
|
468
|
+
'',
|
|
372
469
|
'Why:',
|
|
373
470
|
`- ${result.primaryReason}`,
|
|
471
|
+
`- capability_evidence=${capabilityEvidenceSummary(result.capabilityEvidence)}`,
|
|
374
472
|
'',
|
|
375
473
|
'Next:',
|
|
376
474
|
`- ${result.next}`
|
|
@@ -378,14 +476,40 @@ export function renderSddTestResult(result: SddTestResult): string {
|
|
|
378
476
|
}
|
|
379
477
|
|
|
380
478
|
|
|
381
|
-
async function runCommandStep(projectRoot: string, runId: string, branch: string, taskId: string, testRunId: string, sequence: number, commandInput: NormalizedSddTestCommand, acceptanceRefs: string[], timeoutMs: number): Promise<SddTestCommandStep> {
|
|
479
|
+
async function runCommandStep(projectRoot: string, runId: string, branch: string, taskId: string, testRunId: string, sequence: number, commandInput: NormalizedSddTestCommand, acceptanceRefs: string[], timeoutMs: number, model: SddTaskModel, task: SddTask, validationScopeTaskIds: string[], validationScopeAcceptanceRefs: string[]): Promise<SddTestCommandStep> {
|
|
480
|
+
const cachePlan = buildValidationCachePlan({ branch, model, task, command: commandInput.command, argv: commandInput.argv, shell: commandInput.shell, validationScopeTaskIds, acceptanceRefs: validationScopeAcceptanceRefs });
|
|
481
|
+
const cached = cachePlan.eligible ? await readRuntimeValidationCacheEntry(projectRoot, { branchSlug: branch, cacheKey: cachePlan.cacheKey }) : null;
|
|
482
|
+
if (cached) {
|
|
483
|
+
return recordCachedCommandStep(projectRoot, runId, branch, taskId, testRunId, sequence, commandInput, acceptanceRefs, cachePlan.cacheKey, cached);
|
|
484
|
+
}
|
|
485
|
+
|
|
382
486
|
const started = Date.now();
|
|
487
|
+
const startedAt = new Date(started).toISOString();
|
|
383
488
|
const executed = await executeCommand(projectRoot, commandInput, timeoutMs);
|
|
384
|
-
const
|
|
489
|
+
const ended = Date.now();
|
|
490
|
+
const endedAt = new Date(ended).toISOString();
|
|
491
|
+
const durationMs = ended - started;
|
|
385
492
|
const status: SddTestStepStatus = executed.timedOut || executed.error ? 'blocked' : executed.exitCode === 0 ? 'pass' : 'fail';
|
|
386
493
|
const stepId = `${testRunId}-${String(sequence).padStart(3, '0')}`;
|
|
387
|
-
const
|
|
388
|
-
const
|
|
494
|
+
const cacheStatus = cachePlan.eligible ? 'miss' : 'unsafe';
|
|
495
|
+
const shouldPersistOutputArtifact = shouldPersistCommandOutputArtifact(status, executed, cacheStatus, cachePlan.unsafeReasons);
|
|
496
|
+
const outputFileName = shouldPersistOutputArtifact ? `test-${taskId}-${String(sequence).padStart(3, '0')}.log` : null;
|
|
497
|
+
const outputRef = outputFileName ? toBranchStageEvidenceRef(branch, 'test', outputFileName) : null;
|
|
498
|
+
const output = outputFileName ? renderCommandOutput(commandInput, status, executed, durationMs, cacheStatus, cachePlan.cacheKey, null, cachePlan.unsafeReasons) : null;
|
|
499
|
+
if (outputFileName && outputRef && output) {
|
|
500
|
+
await recordRuntimeOnlyArtifact(projectRoot, runId, outputFileName, output, { logicalRef: outputRef, branch, taskId, artifactRole: 'test-command-output' });
|
|
501
|
+
await appendArtifactHashLedgerEntry(projectRoot, {
|
|
502
|
+
runId,
|
|
503
|
+
taskId,
|
|
504
|
+
branch,
|
|
505
|
+
artifactPath: outputRef,
|
|
506
|
+
content: output,
|
|
507
|
+
status: 'recorded'
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
const stdoutDigest = hashDocumentContent(executed.stdout);
|
|
511
|
+
const stderrDigest = hashDocumentContent(executed.stderr);
|
|
512
|
+
const outputSummary = summarizeCommandOutput(executed);
|
|
389
513
|
await appendInvocationLedgerEntry(projectRoot, {
|
|
390
514
|
runId,
|
|
391
515
|
taskId,
|
|
@@ -393,10 +517,11 @@ async function runCommandStep(projectRoot: string, runId: string, branch: string
|
|
|
393
517
|
kind: 'command',
|
|
394
518
|
ref: commandInput.command,
|
|
395
519
|
status,
|
|
396
|
-
artifactPath:
|
|
397
|
-
outputHash: hashDocumentContent(output),
|
|
398
|
-
materialRefs: [
|
|
520
|
+
artifactPath: outputRef,
|
|
521
|
+
outputHash: output ? hashDocumentContent(output) : null,
|
|
522
|
+
materialRefs: outputRef ? [outputRef] : [],
|
|
399
523
|
metadata: {
|
|
524
|
+
stepId,
|
|
400
525
|
source: 'sdd-test',
|
|
401
526
|
exitCode: executed.exitCode,
|
|
402
527
|
durationMs,
|
|
@@ -405,7 +530,12 @@ async function runCommandStep(projectRoot: string, runId: string, branch: string
|
|
|
405
530
|
truncated: executed.truncated,
|
|
406
531
|
acceptanceRefs: acceptanceRefs.join(','),
|
|
407
532
|
shell: commandInput.shell,
|
|
408
|
-
argv: commandInput.argv ? JSON.stringify(commandInput.argv) : null
|
|
533
|
+
argv: commandInput.argv ? JSON.stringify(commandInput.argv) : null,
|
|
534
|
+
stdoutDigest,
|
|
535
|
+
stderrDigest,
|
|
536
|
+
cacheKey: cachePlan.cacheKey,
|
|
537
|
+
cacheStatus,
|
|
538
|
+
cacheUnsafeReasons: cachePlan.unsafeReasons.join(',')
|
|
409
539
|
}
|
|
410
540
|
});
|
|
411
541
|
const step: SddTestCommandStep = {
|
|
@@ -418,10 +548,20 @@ async function runCommandStep(projectRoot: string, runId: string, branch: string
|
|
|
418
548
|
exitCode: executed.exitCode,
|
|
419
549
|
signal: executed.signal,
|
|
420
550
|
durationMs,
|
|
421
|
-
outputArtifact:
|
|
551
|
+
outputArtifact: outputRef,
|
|
422
552
|
stdoutBytes: executed.stdoutBytes,
|
|
423
553
|
stderrBytes: executed.stderrBytes,
|
|
424
|
-
truncated: executed.truncated
|
|
554
|
+
truncated: executed.truncated,
|
|
555
|
+
startedAt,
|
|
556
|
+
endedAt,
|
|
557
|
+
cwd: projectRoot,
|
|
558
|
+
stdoutDigest,
|
|
559
|
+
stderrDigest,
|
|
560
|
+
outputSummary,
|
|
561
|
+
cacheStatus,
|
|
562
|
+
cacheKey: cachePlan.cacheKey,
|
|
563
|
+
cacheSourceTestRunId: null,
|
|
564
|
+
cacheUnsafeReasons: cachePlan.unsafeReasons
|
|
425
565
|
};
|
|
426
566
|
await recordRuntimeTestStep(projectRoot, {
|
|
427
567
|
stepId,
|
|
@@ -432,9 +572,96 @@ async function runCommandStep(projectRoot: string, runId: string, branch: string
|
|
|
432
572
|
status,
|
|
433
573
|
exitCode: executed.exitCode,
|
|
434
574
|
durationMs,
|
|
435
|
-
outputArtifact:
|
|
575
|
+
outputArtifact: outputRef,
|
|
436
576
|
payload: step
|
|
437
577
|
});
|
|
578
|
+
if (status === 'pass' && cachePlan.eligible) {
|
|
579
|
+
const now = new Date().toISOString();
|
|
580
|
+
await recordRuntimeValidationCacheEntry(projectRoot, {
|
|
581
|
+
cacheKey: cachePlan.cacheKey,
|
|
582
|
+
branchSlug: branch,
|
|
583
|
+
command: commandInput.command,
|
|
584
|
+
status: 'valid',
|
|
585
|
+
sourceTestRunId: testRunId,
|
|
586
|
+
sourceRunId: runId,
|
|
587
|
+
sourceEvidenceSetId: null,
|
|
588
|
+
outputArtifact: outputRef,
|
|
589
|
+
stdoutDigest,
|
|
590
|
+
stderrDigest,
|
|
591
|
+
createdAt: now,
|
|
592
|
+
lastUsedAt: now,
|
|
593
|
+
payload: { cachePlan, step }
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
return step;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
async function recordCachedCommandStep(projectRoot: string, runId: string, branch: string, taskId: string, testRunId: string, sequence: number, commandInput: NormalizedSddTestCommand, acceptanceRefs: string[], cacheKey: string, cached: RuntimeValidationCacheEntryRecord): Promise<SddTestCommandStep> {
|
|
600
|
+
const now = new Date().toISOString();
|
|
601
|
+
const stepId = `${testRunId}-${String(sequence).padStart(3, '0')}`;
|
|
602
|
+
const step: SddTestCommandStep = {
|
|
603
|
+
stepId,
|
|
604
|
+
command: commandInput.command,
|
|
605
|
+
argv: commandInput.argv,
|
|
606
|
+
shell: commandInput.shell,
|
|
607
|
+
acceptanceRefs,
|
|
608
|
+
status: 'pass',
|
|
609
|
+
exitCode: 0,
|
|
610
|
+
signal: null,
|
|
611
|
+
durationMs: 0,
|
|
612
|
+
outputArtifact: null,
|
|
613
|
+
stdoutBytes: 0,
|
|
614
|
+
stderrBytes: 0,
|
|
615
|
+
truncated: false,
|
|
616
|
+
startedAt: now,
|
|
617
|
+
endedAt: now,
|
|
618
|
+
cwd: projectRoot,
|
|
619
|
+
stdoutDigest: cached.stdoutDigest,
|
|
620
|
+
stderrDigest: cached.stderrDigest,
|
|
621
|
+
outputSummary: `cache_hit source_test_run=${cached.sourceTestRunId} source_artifact=${cached.outputArtifact ?? 'none'}`,
|
|
622
|
+
cacheStatus: 'hit',
|
|
623
|
+
cacheKey,
|
|
624
|
+
cacheSourceTestRunId: cached.sourceTestRunId,
|
|
625
|
+
cacheUnsafeReasons: []
|
|
626
|
+
};
|
|
627
|
+
await appendInvocationLedgerEntry(projectRoot, {
|
|
628
|
+
runId,
|
|
629
|
+
taskId,
|
|
630
|
+
branch,
|
|
631
|
+
kind: 'command',
|
|
632
|
+
ref: commandInput.command,
|
|
633
|
+
status: 'pass',
|
|
634
|
+
artifactPath: null,
|
|
635
|
+
outputHash: null,
|
|
636
|
+
materialRefs: cached.outputArtifact ? [cached.outputArtifact] : [],
|
|
637
|
+
metadata: { source: 'sdd-test-cache', stepId, cacheKey, sourceTestRunId: cached.sourceTestRunId, sourceEvidenceSetId: cached.sourceEvidenceSetId, acceptanceRefs: acceptanceRefs.join(',') }
|
|
638
|
+
});
|
|
639
|
+
await recordRuntimeTestStep(projectRoot, {
|
|
640
|
+
stepId,
|
|
641
|
+
testRunId,
|
|
642
|
+
runId,
|
|
643
|
+
taskId,
|
|
644
|
+
command: commandInput.command,
|
|
645
|
+
status: 'pass',
|
|
646
|
+
exitCode: 0,
|
|
647
|
+
durationMs: 0,
|
|
648
|
+
outputArtifact: null,
|
|
649
|
+
payload: step
|
|
650
|
+
});
|
|
651
|
+
await recordRuntimeValidationCacheUse(projectRoot, {
|
|
652
|
+
useId: runtimeScopedId(cacheKey, testRunId, taskId, stepId),
|
|
653
|
+
cacheKey,
|
|
654
|
+
branchSlug: branch,
|
|
655
|
+
testRunId,
|
|
656
|
+
runId,
|
|
657
|
+
taskId,
|
|
658
|
+
sourceTestRunId: cached.sourceTestRunId,
|
|
659
|
+
sourceEvidenceSetId: cached.sourceEvidenceSetId,
|
|
660
|
+
reusedAt: now,
|
|
661
|
+
mappedTaskIds: [taskId],
|
|
662
|
+
reason: 'same validation cache key within compatible branch contract scope',
|
|
663
|
+
payload: { sourceRunId: cached.sourceRunId, sourceArtifact: cached.outputArtifact }
|
|
664
|
+
});
|
|
438
665
|
return step;
|
|
439
666
|
}
|
|
440
667
|
|
|
@@ -485,31 +712,62 @@ function executeCommand(projectRoot: string, commandInput: NormalizedSddTestComm
|
|
|
485
712
|
});
|
|
486
713
|
}
|
|
487
714
|
|
|
488
|
-
async function writeValidationArtifact(projectRoot: string, runId: string, task: SddTask, status: SddTestStatus, steps: SddTestCommandStep[], gaps: string[]): Promise<{ absolutePath: string; runRelativePath: string }> {
|
|
489
|
-
const artifactPath =
|
|
490
|
-
const
|
|
715
|
+
async function writeValidationArtifact(projectRoot: string, runId: string, branch: string, task: SddTask, status: SddTestStatus, steps: SddTestCommandStep[], gaps: string[], _capabilityEvidence: CapabilityEvidenceClassification[]): Promise<{ absolutePath: string; runRelativePath: string }> {
|
|
716
|
+
const artifactPath = validationArtifactPath(task);
|
|
717
|
+
const stageEvidenceRef = toBranchStageEvidenceRef(branch, 'test', artifactPath);
|
|
491
718
|
const resultStatus = status === 'PASS' ? 'PASS' : status === 'FAIL' ? 'FAIL' : 'BLOCKED';
|
|
492
|
-
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 - ${
|
|
493
|
-
|
|
719
|
+
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`;
|
|
720
|
+
const written = await recordStageEvidenceArtifact(projectRoot, runId, stageEvidenceRef, content, { taskId: task.id, artifactRole: 'test-validation' });
|
|
721
|
+
return { ...written, runRelativePath: stageEvidenceRef };
|
|
494
722
|
}
|
|
495
723
|
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
const written = await writeArtifact(projectRoot, runId, 'sync-back-proposal.md', content);
|
|
499
|
-
return { path: written.runRelativePath, digest: hashDocumentContent(content) };
|
|
724
|
+
function validationArtifactPath(task: SddTask): string {
|
|
725
|
+
return `test-validation-${task.id}.md`;
|
|
500
726
|
}
|
|
501
727
|
|
|
502
|
-
async function writeIndexArtifact(projectRoot: string, runId: string, payload: Omit<SddTestResult, 'contract' | 'runId' | 'indexArtifact' | 'next'>): Promise<{ absolutePath: string; runRelativePath: string }> {
|
|
503
|
-
return writeArtifact(projectRoot, runId, `test-index-${payload.taskId}.json`, `${JSON.stringify({ contract: 'sdd-test-runtime-v1', runId, ...payload }, null, 2)}\n`);
|
|
504
|
-
}
|
|
505
728
|
|
|
506
|
-
|
|
729
|
+
|
|
730
|
+
async function persistTestRunState(projectRoot: string, state: RunState, taskId: string, validationStatus: SddTestStatus, commands: string[], evidence: string[], validationArtifact: string | null): Promise<void> {
|
|
507
731
|
const latest = await readRunState(projectRoot, state.runId);
|
|
508
732
|
const knownArtifacts = new Set(latest.artifacts.map((artifact) => artifact.path));
|
|
509
733
|
const now = new Date().toISOString();
|
|
510
734
|
const nextArtifacts = evidence
|
|
511
735
|
.filter((artifactPath) => !knownArtifacts.has(artifactPath))
|
|
512
|
-
.map((artifactPath) => ({ path: artifactPath, kind: artifactPath
|
|
736
|
+
.map((artifactPath) => ({ path: artifactPath, kind: testArtifactKind(artifactPath), task: taskId, agent: 'test-runtime', createdAt: now }));
|
|
737
|
+
const existingTaskState = latest.tasks[taskId];
|
|
738
|
+
await writeRunState(projectRoot, {
|
|
739
|
+
...latest,
|
|
740
|
+
status: validationStatus === 'PASS' ? 'running' : validationStatus === 'FAIL' ? 'failed' : 'blocked',
|
|
741
|
+
phase: 'test',
|
|
742
|
+
currentTask: taskId,
|
|
743
|
+
tasks: {
|
|
744
|
+
...latest.tasks,
|
|
745
|
+
[taskId]: {
|
|
746
|
+
...baseRuntimeTaskState(existingTaskState),
|
|
747
|
+
status: validationStatus === 'PASS' ? 'validation_passed_pending_gate' : validationStatus === 'FAIL' ? 'validation_failed' : 'validation_blocked',
|
|
748
|
+
implementationStatus: existingTaskState?.implementationStatus ?? 'not_started',
|
|
749
|
+
verificationStatus: verificationStatusFromTest(validationStatus),
|
|
750
|
+
testStatus: validationStatus,
|
|
751
|
+
evidence
|
|
752
|
+
}
|
|
753
|
+
},
|
|
754
|
+
artifacts: [...latest.artifacts, ...nextArtifacts],
|
|
755
|
+
validation: {
|
|
756
|
+
status: validationStatus === 'PASS' ? 'pass' : validationStatus === 'FAIL' ? 'fail' : 'blocked',
|
|
757
|
+
commands,
|
|
758
|
+
evidence
|
|
759
|
+
}
|
|
760
|
+
});
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
async function persistTestGateOutcome(projectRoot: string, runId: string, taskId: string, status: SddTestStatus, validationStatus: SddTestStatus, commands: string[], evidence: string[], validationArtifact: string | null, gateDecision: WorkflowGateDecision): Promise<void> {
|
|
764
|
+
const latest = await readRunState(projectRoot, runId);
|
|
765
|
+
const knownArtifacts = new Set(latest.artifacts.map((artifact) => artifact.path));
|
|
766
|
+
const now = new Date().toISOString();
|
|
767
|
+
const nextArtifacts = evidence
|
|
768
|
+
.filter((artifactPath) => !knownArtifacts.has(artifactPath))
|
|
769
|
+
.map((artifactPath) => ({ path: artifactPath, kind: testArtifactKind(artifactPath), task: taskId, agent: 'test-runtime', createdAt: now }));
|
|
770
|
+
const existingTaskState = latest.tasks[taskId];
|
|
513
771
|
await writeRunState(projectRoot, {
|
|
514
772
|
...latest,
|
|
515
773
|
status: status === 'PASS' ? 'completed' : status === 'FAIL' ? 'failed' : 'blocked',
|
|
@@ -518,29 +776,68 @@ async function persistTestRunState(projectRoot: string, state: RunState, taskId:
|
|
|
518
776
|
tasks: {
|
|
519
777
|
...latest.tasks,
|
|
520
778
|
[taskId]: {
|
|
521
|
-
|
|
779
|
+
...baseRuntimeTaskState(existingTaskState),
|
|
780
|
+
status: runtimeTaskStatusAfterGate(status, validationStatus),
|
|
781
|
+
implementationStatus: existingTaskState?.implementationStatus ?? 'not_started',
|
|
782
|
+
verificationStatus: verificationStatusFromTest(validationStatus),
|
|
522
783
|
testStatus: status,
|
|
784
|
+
validationStatus,
|
|
785
|
+
workflowGateStatus: gateDecision.status,
|
|
786
|
+
workflowGateDecisionId: gateDecision.decisionId,
|
|
523
787
|
evidence
|
|
524
788
|
}
|
|
525
789
|
},
|
|
526
790
|
artifacts: [...latest.artifacts, ...nextArtifacts],
|
|
527
791
|
validation: {
|
|
528
|
-
status:
|
|
792
|
+
status: validationStatus === 'PASS' ? 'pass' : validationStatus === 'FAIL' ? 'fail' : 'blocked',
|
|
529
793
|
commands,
|
|
530
794
|
evidence
|
|
531
|
-
}
|
|
532
|
-
syncBack: syncBackProposal
|
|
533
|
-
? {
|
|
534
|
-
mode: 'proposal',
|
|
535
|
-
proposalPath: syncBackProposal.path,
|
|
536
|
-
proposalDigest: syncBackProposal.digest,
|
|
537
|
-
sourceVerifyStatus: status,
|
|
538
|
-
status: 'proposed'
|
|
539
|
-
}
|
|
540
|
-
: latest.syncBack
|
|
795
|
+
}
|
|
541
796
|
});
|
|
542
797
|
}
|
|
543
798
|
|
|
799
|
+
function testArtifactKind(artifactPath: string): string {
|
|
800
|
+
const fileName = artifactPath.split('/').pop() ?? artifactPath;
|
|
801
|
+
if (fileName.startsWith('test-validation-')) {
|
|
802
|
+
return 'test-validation';
|
|
803
|
+
}
|
|
804
|
+
return 'test';
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
function baseRuntimeTaskState(existing: RunStateTaskRuntime | undefined): RunStateTaskRuntime {
|
|
808
|
+
return {
|
|
809
|
+
status: existing?.status ?? 'not_started',
|
|
810
|
+
implementationStatus: existing?.implementationStatus ?? 'not_started',
|
|
811
|
+
verificationStatus: existing?.verificationStatus ?? 'not_run',
|
|
812
|
+
validationBatch: existing?.validationBatch ?? null,
|
|
813
|
+
validationTiming: existing?.validationTiming ?? 'task_end',
|
|
814
|
+
requiresVerifyBeforeNext: existing?.requiresVerifyBeforeNext ?? true,
|
|
815
|
+
gaps: existing?.gaps,
|
|
816
|
+
artifacts: existing?.artifacts,
|
|
817
|
+
testStatus: existing?.testStatus,
|
|
818
|
+
workflowGateStatus: existing?.workflowGateStatus,
|
|
819
|
+
workflowGateDecisionId: existing?.workflowGateDecisionId,
|
|
820
|
+
evidence: existing?.evidence
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
function verificationStatusFromTest(validationStatus: SddTestStatus): RunStateTaskRuntime['verificationStatus'] {
|
|
825
|
+
if (validationStatus === 'PASS') {
|
|
826
|
+
return 'pass';
|
|
827
|
+
}
|
|
828
|
+
return validationStatus === 'FAIL' ? 'failed' : 'blocked';
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
function runtimeTaskStatusAfterGate(status: SddTestStatus, validationStatus: SddTestStatus): string {
|
|
832
|
+
if (status === 'PASS') {
|
|
833
|
+
return 'implemented_verified';
|
|
834
|
+
}
|
|
835
|
+
if (validationStatus === 'PASS') {
|
|
836
|
+
return 'workflow_gate_blocked';
|
|
837
|
+
}
|
|
838
|
+
return validationStatus === 'FAIL' ? 'validation_failed' : 'validation_blocked';
|
|
839
|
+
}
|
|
840
|
+
|
|
544
841
|
function deriveCommandStatus(gaps: string[], steps: SddTestCommandStep[]): TestEvidenceStatus {
|
|
545
842
|
if (gaps.length > 0 || steps.some((step) => step.status === 'blocked')) {
|
|
546
843
|
return 'BLOCKED';
|
|
@@ -551,8 +848,8 @@ function deriveCommandStatus(gaps: string[], steps: SddTestCommandStep[]): TestE
|
|
|
551
848
|
return 'PASS';
|
|
552
849
|
}
|
|
553
850
|
|
|
554
|
-
function buildAcceptanceCoverage(task: SddTask | null, steps: SddTestCommandStep[], commandStatus: TestEvidenceStatus): AcceptanceEvidenceCoverage[] {
|
|
555
|
-
const acceptanceRefs = task ? taskAcceptanceRefs(task) : [];
|
|
851
|
+
function buildAcceptanceCoverage(task: SddTask | null, steps: SddTestCommandStep[], commandStatus: TestEvidenceStatus, acceptanceRefsOverride: string[] | undefined): AcceptanceEvidenceCoverage[] {
|
|
852
|
+
const acceptanceRefs = acceptanceRefsOverride && acceptanceRefsOverride.length > 0 ? [...new Set(acceptanceRefsOverride)] : task ? taskAcceptanceRefs(task) : [];
|
|
556
853
|
return acceptanceRefs.map((acceptanceRef) => {
|
|
557
854
|
const mappedSteps = steps.filter((step) => step.acceptanceRefs.includes(acceptanceRef));
|
|
558
855
|
const hasPassingEvidence = mappedSteps.some((step) => step.status === 'pass');
|
|
@@ -565,12 +862,24 @@ function buildAcceptanceCoverage(task: SddTask | null, steps: SddTestCommandStep
|
|
|
565
862
|
return {
|
|
566
863
|
acceptanceRef,
|
|
567
864
|
status,
|
|
568
|
-
evidenceRefs: mappedSteps.map(
|
|
569
|
-
gaps: status === 'complete' ? [] : [`Acceptance ${acceptanceRef} has no complete non-stale evidence from
|
|
865
|
+
evidenceRefs: mappedSteps.map(commandStepRuntimeRef),
|
|
866
|
+
gaps: status === 'complete' ? [] : [`Acceptance ${acceptanceRef} has no complete non-stale evidence from sdd test task.`]
|
|
570
867
|
};
|
|
571
868
|
});
|
|
572
869
|
}
|
|
573
870
|
|
|
871
|
+
function runtimeEvidenceRefs(validationArtifact: string | null, steps: SddTestCommandStep[]): string[] {
|
|
872
|
+
return [validationArtifact, ...steps.map((step) => step.outputArtifact)].filter((item): item is string => Boolean(item));
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
function commandStepRuntimeRef(step: SddTestCommandStep): { kind: 'command'; ref: string } {
|
|
876
|
+
return { kind: 'command', ref: step.stepId };
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
function artifactRuntimeRefs(ref: string | null): Array<{ kind: 'artifact'; ref: string }> {
|
|
880
|
+
return ref ? [{ kind: 'artifact', ref }] : [];
|
|
881
|
+
}
|
|
882
|
+
|
|
574
883
|
function summarizeEvidenceCoverage(acceptanceCoverage: AcceptanceEvidenceCoverage[]): EvidenceCoverageStatus {
|
|
575
884
|
if (acceptanceCoverage.length === 0) {
|
|
576
885
|
return 'missing';
|
|
@@ -594,7 +903,72 @@ function derivePolicyJudgment(commandStatus: TestEvidenceStatus, evidenceCoverag
|
|
|
594
903
|
return 'PASS';
|
|
595
904
|
}
|
|
596
905
|
|
|
597
|
-
function
|
|
906
|
+
async function resolveTestRuntimeDurableGap(
|
|
907
|
+
projectRoot: string,
|
|
908
|
+
branch: string,
|
|
909
|
+
runId: string,
|
|
910
|
+
taskId: string,
|
|
911
|
+
validationStatus: SddTestStatus,
|
|
912
|
+
gaps: string[]
|
|
913
|
+
): Promise<void> {
|
|
914
|
+
if (validationStatus !== 'PASS' || gaps.length > 0) {
|
|
915
|
+
return;
|
|
916
|
+
}
|
|
917
|
+
await updateRuntimeDurableGapStatus(projectRoot, {
|
|
918
|
+
gapId: testRuntimeGapId(branch, runId, taskId),
|
|
919
|
+
status: 'resolved',
|
|
920
|
+
source: 'gate_policy',
|
|
921
|
+
payload: { validationStatus, gaps }
|
|
922
|
+
});
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
async function recordTestRuntimeDurableGap(
|
|
926
|
+
projectRoot: string,
|
|
927
|
+
branch: string,
|
|
928
|
+
runId: string,
|
|
929
|
+
taskId: string,
|
|
930
|
+
status: SddTestStatus,
|
|
931
|
+
validationStatus: SddTestStatus,
|
|
932
|
+
runtimeJudgment: WorkflowGateStatus,
|
|
933
|
+
gaps: string[],
|
|
934
|
+
evidenceRefs: string[]
|
|
935
|
+
): Promise<void> {
|
|
936
|
+
if (status === 'PASS' && gaps.length === 0) {
|
|
937
|
+
return;
|
|
938
|
+
}
|
|
939
|
+
const message = gaps[0] ?? (runtimeJudgment === 'PASS' ? `Validation status is ${validationStatus}.` : `Workflow gate status is ${runtimeJudgment}.`);
|
|
940
|
+
await recordRuntimeDurableGap(projectRoot, {
|
|
941
|
+
gapId: testRuntimeGapId(branch, runId, taskId),
|
|
942
|
+
partition: branch,
|
|
943
|
+
taskId,
|
|
944
|
+
runId,
|
|
945
|
+
stage: 'test',
|
|
946
|
+
gate: 'test',
|
|
947
|
+
source: 'runtime',
|
|
948
|
+
category: runtimeJudgment === 'PASS' ? 'validation' : 'workflow_gate',
|
|
949
|
+
severity: 'blocking',
|
|
950
|
+
status: 'open',
|
|
951
|
+
message,
|
|
952
|
+
recommendation: `Resolve test runtime gaps for ${taskId}, then rerun ${testValidationUnitCommand(branch, taskId)}.`,
|
|
953
|
+
evidenceRefs,
|
|
954
|
+
proposalRefs: [],
|
|
955
|
+
sourceRefs: [],
|
|
956
|
+
payload: { status, validationStatus, runtimeJudgment, gaps }
|
|
957
|
+
});
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
function testRuntimeGapId(branch: string, _runId: string, taskId: string): string {
|
|
961
|
+
return runtimeScopedId(branch, taskId, 'test-runtime-gap');
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
function finalStatusForTest(validationStatus: SddTestStatus, runtimeJudgment: WorkflowGateStatus): SddTestStatus {
|
|
965
|
+
if (validationStatus !== 'PASS') {
|
|
966
|
+
return validationStatus;
|
|
967
|
+
}
|
|
968
|
+
return runtimeJudgment === 'PASS' || runtimeJudgment === 'WARN' ? 'PASS' : 'BLOCKED';
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
function buildUnifiedTestEvidenceRun(id: string, branch: string, runId: string, taskId: string, commandStatus: TestEvidenceStatus, evidenceCoverage: EvidenceCoverageStatus, policyJudgment: TestEvidenceStatus, status: SddTestStatus, runtimeJudgment: WorkflowGateStatus, steps: SddTestCommandStep[], acceptanceCoverage: AcceptanceEvidenceCoverage[], capabilityEvidence: CapabilityEvidenceClassification[], gaps: string[], gateNextAction: string | null, gateDecision: WorkflowGateDecision | null): UnifiedTestEvidenceRun {
|
|
598
972
|
return {
|
|
599
973
|
contract: TEST_EVIDENCE_RUN_CONTRACT_VERSION,
|
|
600
974
|
id,
|
|
@@ -605,33 +979,110 @@ function buildUnifiedTestEvidenceRun(id: string, branch: string, runId: string,
|
|
|
605
979
|
commands: steps.map((step) => ({
|
|
606
980
|
command: step.command,
|
|
607
981
|
status: step.status === 'pass' ? 'PASS' : step.status === 'fail' ? 'FAIL' : 'BLOCKED',
|
|
608
|
-
outputRef: { kind: 'artifact', ref: step.outputArtifact },
|
|
609
|
-
evidenceRefs: [
|
|
982
|
+
outputRef: step.outputArtifact ? { kind: 'artifact', ref: step.outputArtifact } : undefined,
|
|
983
|
+
evidenceRefs: [commandStepRuntimeRef(step), ...artifactRuntimeRefs(step.outputArtifact)],
|
|
610
984
|
acceptanceRefs: step.acceptanceRefs,
|
|
611
985
|
startedAt: new Date(Date.now() - step.durationMs).toISOString(),
|
|
612
986
|
completedAt: new Date().toISOString()
|
|
613
987
|
})),
|
|
614
988
|
acceptanceCoverage,
|
|
615
|
-
|
|
989
|
+
capabilityEvidence,
|
|
616
990
|
gaps: [...gaps, ...acceptanceCoverage.flatMap((coverage) => coverage.gaps)],
|
|
617
|
-
next: nextForTestResult(
|
|
991
|
+
next: nextForTestResult(status, runtimeJudgment, branch, taskId, gateNextAction, gateDecision),
|
|
618
992
|
generatedAt: new Date().toISOString()
|
|
619
993
|
};
|
|
620
994
|
}
|
|
621
995
|
|
|
622
|
-
function
|
|
996
|
+
function buildCapabilityEvidenceClassification(decision: AgentCapabilityRouteDecision | null, steps: SddTestCommandStep[]): CapabilityEvidenceClassification[] {
|
|
997
|
+
if (!decision) {
|
|
998
|
+
return [{
|
|
999
|
+
class: 'diagnostic',
|
|
1000
|
+
source: 'runtime_diagnostic',
|
|
1001
|
+
domainOrSourceId: 'capability-routing',
|
|
1002
|
+
evidenceRefs: [],
|
|
1003
|
+
acceptanceRefs: [],
|
|
1004
|
+
provenanceRefs: [],
|
|
1005
|
+
reason: 'Capability routing did not run; no capability output is accepted as test evidence.'
|
|
1006
|
+
}];
|
|
1007
|
+
}
|
|
1008
|
+
const acceptanceRefs = [...new Set(steps.flatMap((step) => step.acceptanceRefs))];
|
|
1009
|
+
const professionalEvidence = decision.selectedDomains.map((domain) => ({
|
|
1010
|
+
class: 'candidate' as const,
|
|
1011
|
+
source: 'professional_capability' as const,
|
|
1012
|
+
domainOrSourceId: domain.domain,
|
|
1013
|
+
evidenceRefs: [],
|
|
1014
|
+
acceptanceRefs,
|
|
1015
|
+
provenanceRefs: [{ kind: 'projection' as const, ref: `capability:${domain.capabilityId}` }],
|
|
1016
|
+
reason: `${domain.reason}; capability output is advisory candidate evidence until accepted by command evidence and policy refs.`
|
|
1017
|
+
}));
|
|
1018
|
+
const externalEvidence = decision.rejectedExternalSources.map((source) => ({
|
|
1019
|
+
class: capabilityClassForRejectedSource(source.quarantineStatus) as CapabilityEvidenceClassification['class'],
|
|
1020
|
+
source: 'external_source' as const,
|
|
1021
|
+
domainOrSourceId: source.sourceId,
|
|
1022
|
+
evidenceRefs: [],
|
|
1023
|
+
acceptanceRefs: [],
|
|
1024
|
+
provenanceRefs: [{ kind: 'external' as const, ref: source.sourceId }],
|
|
1025
|
+
reason: source.reason
|
|
1026
|
+
}));
|
|
1027
|
+
return [...professionalEvidence, ...externalEvidence];
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
function capabilityClassForRejectedSource(status: AgentCapabilityRouteDecision['rejectedExternalSources'][number]['quarantineStatus']): CapabilityEvidenceClassification['class'] {
|
|
1031
|
+
if (status === 'denied') {
|
|
1032
|
+
return 'blocked';
|
|
1033
|
+
}
|
|
1034
|
+
if (status === 'required' || status === 'quarantined') {
|
|
1035
|
+
return 'quarantined';
|
|
1036
|
+
}
|
|
1037
|
+
return 'diagnostic';
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
|
|
1041
|
+
function capabilityEvidenceSummary(items: CapabilityEvidenceClassification[]): string {
|
|
1042
|
+
if (items.length === 0) {
|
|
1043
|
+
return 'none';
|
|
1044
|
+
}
|
|
1045
|
+
const counts = new Map<CapabilityEvidenceClassification['class'], number>();
|
|
1046
|
+
for (const item of items) {
|
|
1047
|
+
counts.set(item.class, (counts.get(item.class) ?? 0) + 1);
|
|
1048
|
+
}
|
|
1049
|
+
return [...counts.entries()].map(([kind, count]) => `${kind}:${count}`).join(',');
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
function nextForTestResult(status: SddTestStatus, runtimeJudgment: WorkflowGateStatus, branch: string, taskId: string, gateNextAction: string | null, gateDecision: WorkflowGateDecision | null): string {
|
|
1053
|
+
const inspectHint = `Inspect runtime test read model for ${taskId}`;
|
|
623
1054
|
if (status === 'PASS') {
|
|
624
|
-
return `sdd
|
|
1055
|
+
return `sdd test close --branch ${branch} --target goal-verify --compact-json`;
|
|
1056
|
+
}
|
|
1057
|
+
if (gateNextAction) {
|
|
1058
|
+
return gateNextAction;
|
|
1059
|
+
}
|
|
1060
|
+
if (runtimeJudgment === 'HUMAN_REQUIRED') {
|
|
1061
|
+
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)}.`;
|
|
1062
|
+
}
|
|
1063
|
+
if (runtimeJudgment === 'WARN') {
|
|
1064
|
+
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)}.`;
|
|
1065
|
+
}
|
|
1066
|
+
if (runtimeJudgment === 'ADVISORY_ONLY') {
|
|
1067
|
+
return `Inspect advisor assessments for ${taskId}; advisory output cannot satisfy the test gate.`;
|
|
1068
|
+
}
|
|
1069
|
+
if (status === 'FAIL') {
|
|
1070
|
+
return `${inspectHint}, fix failing validation commands, then rerun ${testValidationUnitCommand(branch, taskId)}.`;
|
|
625
1071
|
}
|
|
626
|
-
return
|
|
1072
|
+
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)}.`;
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
function testValidationUnitCommand(branch: string, taskId: string): string {
|
|
1077
|
+
return `sdd test task-${taskId} --branch ${branch}`;
|
|
627
1078
|
}
|
|
628
1079
|
|
|
629
1080
|
function resultSentenceForTest(result: SddTestResult): string {
|
|
630
|
-
if (result.status === 'PASS' && result.lifecycleGate === 'direct') {
|
|
631
|
-
return 'Validation passed and sync-back is ready.';
|
|
632
|
-
}
|
|
633
1081
|
if (result.status === 'PASS') {
|
|
634
|
-
return 'Validation passed;
|
|
1082
|
+
return 'Validation and workflow gate passed; proceed to goal verification and truthAlignment before release readiness.';
|
|
1083
|
+
}
|
|
1084
|
+
if (result.validationStatus === 'PASS' && result.workflowGateStatus !== 'PASS') {
|
|
1085
|
+
return `Validation passed, but workflow gate returned ${result.workflowGateStatus}.`;
|
|
635
1086
|
}
|
|
636
1087
|
if (result.commandStatus === 'BLOCKED') {
|
|
637
1088
|
return 'Blocked before validation commands ran.';
|
|
@@ -652,7 +1103,7 @@ function renderEvidenceBlocks(task: SddTask, status: SddTestStatus, sourceArtifa
|
|
|
652
1103
|
}
|
|
653
1104
|
return mappedEvidence.map(({ acceptance, steps: mappedSteps }) => {
|
|
654
1105
|
const evidenceStatus = evidenceStatusForMappedSteps(status, mappedSteps);
|
|
655
|
-
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(
|
|
1106
|
+
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\`\`\``;
|
|
656
1107
|
}).join('\n\n');
|
|
657
1108
|
}
|
|
658
1109
|
|
|
@@ -677,7 +1128,10 @@ function normalizeTestCommandInput(input: SddTestCommandInput): NormalizedSddTes
|
|
|
677
1128
|
throw new Error('Command input must include command or argv.');
|
|
678
1129
|
}
|
|
679
1130
|
|
|
680
|
-
function acceptanceRefsForCommand(task: SddTask | null, command: string): string[] {
|
|
1131
|
+
function acceptanceRefsForCommand(task: SddTask | null, command: string, acceptanceRefsOverride: string[] | undefined): string[] {
|
|
1132
|
+
if (acceptanceRefsOverride && acceptanceRefsOverride.length > 0) {
|
|
1133
|
+
return [...new Set(acceptanceRefsOverride)];
|
|
1134
|
+
}
|
|
681
1135
|
return [...new Set((task?.validationCommands ?? [])
|
|
682
1136
|
.filter((entry) => entry.command === command)
|
|
683
1137
|
.flatMap((entry) => entry.acceptanceRefs))];
|
|
@@ -698,10 +1152,39 @@ function evidenceStatusForMappedSteps(status: SddTestStatus, steps: SddTestComma
|
|
|
698
1152
|
return 'PASS';
|
|
699
1153
|
}
|
|
700
1154
|
|
|
701
|
-
function renderCommandOutput(commandInput: NormalizedSddTestCommand, status: SddTestStepStatus, executed: { exitCode: number | null; signal: string | null; stdout: string; stderr: string; truncated: boolean; timedOut: boolean; error: string | null }, durationMs: number): string {
|
|
702
|
-
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`;
|
|
1155
|
+
function renderCommandOutput(commandInput: NormalizedSddTestCommand, status: SddTestStepStatus, executed: { exitCode: number | null; signal: string | null; stdout: string; stderr: string; truncated: boolean; timedOut: boolean; error: string | null }, durationMs: number, cacheStatus: 'hit' | 'miss' | 'unsafe' = 'unsafe', cacheKey: string | null = null, cacheSourceTestRunId: string | null = null, cacheUnsafeReasons: ValidationCacheUnsafeReason[] = []): string {
|
|
1156
|
+
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`;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
function shouldPersistCommandOutputArtifact(status: SddTestStepStatus, executed: { truncated: boolean; timedOut: boolean; error: string | null }, cacheStatus: 'hit' | 'miss' | 'unsafe', cacheUnsafeReasons: ValidationCacheUnsafeReason[]): boolean {
|
|
1160
|
+
return status !== 'pass' || executed.truncated || executed.timedOut || Boolean(executed.error) || cacheStatus === 'unsafe' || cacheUnsafeReasons.length > 0;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
function renderStepEvidenceRefs(step: SddTestCommandStep): string {
|
|
1164
|
+
const refs = [` - command:${step.stepId}`];
|
|
1165
|
+
if (step.outputArtifact) {
|
|
1166
|
+
refs.push(` - artifact:${step.outputArtifact}`);
|
|
1167
|
+
}
|
|
1168
|
+
return refs.join('\n');
|
|
703
1169
|
}
|
|
704
1170
|
|
|
1171
|
+
|
|
1172
|
+
function summarizeCommandOutput(executed: { exitCode: number | null; signal: string | null; stdout: string; stderr: string; stdoutBytes: number; stderrBytes: number; truncated: boolean; timedOut: boolean; error: string | null }): string {
|
|
1173
|
+
const parts = [
|
|
1174
|
+
`exit=${executed.exitCode ?? 'none'}`,
|
|
1175
|
+
`signal=${executed.signal ?? 'none'}`,
|
|
1176
|
+
`stdout_bytes=${executed.stdoutBytes}`,
|
|
1177
|
+
`stderr_bytes=${executed.stderrBytes}`,
|
|
1178
|
+
`truncated=${executed.truncated}`,
|
|
1179
|
+
`timed_out=${executed.timedOut}`
|
|
1180
|
+
];
|
|
1181
|
+
if (executed.error) {
|
|
1182
|
+
parts.push(`error=${executed.error}`);
|
|
1183
|
+
}
|
|
1184
|
+
return parts.join(' ');
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
|
|
705
1188
|
function hashDocumentContent(raw: string): string {
|
|
706
1189
|
return createHash('sha256').update(raw.replace(/\r\n/g, '\n'), 'utf8').digest('hex');
|
|
707
1190
|
}
|