sdd-agent-platform 0.4.1 → 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 +30 -28
- package/node_modules/@sdd-agent-platform/core/dist/ai-tools.js +67 -69
- 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 +12 -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 +12 -25
- 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 +2 -1
- package/node_modules/@sdd-agent-platform/core/dist/contracts.js +1 -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 +4 -4
- 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 +178 -58
- package/node_modules/@sdd-agent-platform/core/dist/doctor/doctor.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.js +14 -7
- package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/evidence-runtime/contracts.d.ts +0 -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 +3 -2
- 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.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/execution/stage-team-runtime.js.map +1 -1
- 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 +54 -61
- 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 +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.js +24 -8
- 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 +5 -2
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.js +69 -27
- 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 +15 -15
- 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.js +1 -1
- 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.js +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 +1 -1
- 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 +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.js +1 -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 +45 -15
- 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-validation.js +2 -2
- 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 +126 -9
- 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/inspect-run.d.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.js +7 -5
- 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/model.d.ts +28 -8
- 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 +37 -27
- 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 +5 -2
- package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.js +53 -14
- package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.js.map +1 -1
- 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 +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state.js +1 -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 +10 -0
- package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.js +65 -0
- 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/document-hashes.d.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.js +97 -10
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.js.map +1 -1
- 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 +8 -6
- 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 +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.js +55 -34
- 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 +44 -1
- package/node_modules/@sdd-agent-platform/core/dist/status/project-status.js +170 -23
- 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 +170 -18
- package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.js +544 -32
- 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 +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 +8 -23
- 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 +28 -53
- 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 +10 -50
- package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.js.map +1 -1
- 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 +159 -150
- 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 +12 -2
- package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.js +238 -103
- 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 +18 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.js +27 -5
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.js +9 -32
- package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.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.js +228 -15
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.js +49 -15
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.js +42 -6
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/types.d.ts +4 -5
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.d.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.js +1 -2
- 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.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.d.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.js +72 -6
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.js.map +1 -1
- 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 +55 -5
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.js +538 -34
- 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/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 +67 -69
- 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 +2 -2
- 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 +43 -31
- package/node_modules/@sdd-agent-platform/core/src/config/init-project.ts +14 -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 +12 -25
- 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 +2 -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 +4 -4
- 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 +143 -45
- package/node_modules/@sdd-agent-platform/core/src/doctor/doctor.ts +193 -58
- package/node_modules/@sdd-agent-platform/core/src/evidence/lookup.ts +15 -7
- package/node_modules/@sdd-agent-platform/core/src/evidence-runtime/contracts.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/src/execution/background-executor.test.ts +50 -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 +12 -1
- package/node_modules/@sdd-agent-platform/core/src/execution/resident-worker.ts +3 -2
- package/node_modules/@sdd-agent-platform/core/src/execution/stage-team-runtime.test.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/execution/stage-team-runtime.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/execution/wave-executor.test.ts +10 -0
- package/node_modules/@sdd-agent-platform/core/src/governance/policy.test.ts +8 -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 +33 -18
- package/node_modules/@sdd-agent-platform/core/src/instructions.ts +55 -62
- 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 +25 -8
- 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 +2 -3
- package/node_modules/@sdd-agent-platform/core/src/phase8-risk-kernel.test.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-capability-catalog.ts +82 -35
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-registry.ts +15 -15
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-runtime-static.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/registries/capability-sources.ts +1 -1
- 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 +18 -2
- 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 +1 -1
- package/node_modules/@sdd-agent-platform/core/src/router/agent-runtime.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/router/route-projection.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/router/route-sdd-task.test.ts +241 -4
- package/node_modules/@sdd-agent-platform/core/src/router/routing.ts +47 -15
- package/node_modules/@sdd-agent-platform/core/src/router/runtime-import.ts +453 -0
- package/node_modules/@sdd-agent-platform/core/src/router/runtime-validation.ts +2 -2
- 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 +132 -10
- package/node_modules/@sdd-agent-platform/core/src/run-state/inspect-run.ts +7 -7
- package/node_modules/@sdd-agent-platform/core/src/run-state/model.ts +31 -8
- 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 +50 -2
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-state.ts +39 -29
- package/node_modules/@sdd-agent-platform/core/src/run-state/task-evidence.ts +62 -16
- 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 +1 -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 +77 -0
- 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/document-hashes.ts +109 -10
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/run-binding.ts +8 -6
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.test.ts +123 -1
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.ts +58 -43
- 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 +249 -23
- package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.test.ts +196 -4
- package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.ts +860 -54
- 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 +1 -1
- package/node_modules/@sdd-agent-platform/core/src/test-support/run-state.ts +9 -23
- 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 +27 -56
- package/node_modules/@sdd-agent-platform/core/src/verification/rendering.ts +10 -54
- package/node_modules/@sdd-agent-platform/core/src/verification/review-gate.test.ts +8 -1
- package/node_modules/@sdd-agent-platform/core/src/verification/single-task-loop.test.ts +93 -79
- package/node_modules/@sdd-agent-platform/core/src/verification/single-task-loop.ts +166 -154
- package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.test.ts +100 -47
- package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.ts +265 -107
- 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 +47 -5
- package/node_modules/@sdd-agent-platform/core/src/verification/validation-wave.ts +48 -5
- package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.test.ts +15 -31
- package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.ts +9 -33
- 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 +246 -17
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.test.ts +339 -3
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.ts +53 -14
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.test.ts +45 -8
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.ts +45 -6
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/types.ts +6 -5
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/affected-file-conflicts.ts +1 -3
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/dependencies.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/latest-eligible-run.ts +75 -7
- 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 +518 -25
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve.ts +670 -41
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/runtime-projections.ts +712 -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 +68 -2
- package/packages/cli/dist/commands/status.js.map +1 -1
- package/packages/cli/dist/commands/test.js +180 -2
- package/packages/cli/dist/commands/test.js.map +1 -1
- package/packages/cli/dist/commands/verifies.js +7 -5
- package/packages/cli/dist/commands/verifies.js.map +1 -1
- package/packages/cli/dist/commands/verify.js +222 -26
- 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 +27 -26
- 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 +20 -0
- package/packages/cli/dist/renderers/registry-runtime.js.map +1 -1
- package/packages/cli/dist/renderers/router.js +1 -1
- 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 +30 -89
- 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 +67 -69
- 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 +12 -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 +12 -25
- 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 +2 -1
- package/packages/core/dist/contracts.js +1 -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 +4 -4
- 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 +178 -58
- package/packages/core/dist/doctor/doctor.js.map +1 -1
- package/packages/core/dist/evidence/lookup.js +14 -7
- package/packages/core/dist/evidence/lookup.js.map +1 -1
- package/packages/core/dist/evidence-runtime/contracts.d.ts +0 -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 +3 -2
- package/packages/core/dist/execution/resident-worker.js.map +1 -1
- package/packages/core/dist/execution/stage-team-runtime.js +2 -2
- package/packages/core/dist/execution/stage-team-runtime.js.map +1 -1
- 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 +54 -61
- 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 +1 -0
- package/packages/core/dist/lifecycle/ship.js +24 -8
- 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 +5 -2
- package/packages/core/dist/registries/agent-capability-catalog.js +69 -27
- package/packages/core/dist/registries/agent-capability-catalog.js.map +1 -1
- package/packages/core/dist/registries/agent-registry.js +15 -15
- package/packages/core/dist/registries/agent-registry.js.map +1 -1
- package/packages/core/dist/registries/agent-runtime-static.js +1 -1
- package/packages/core/dist/registries/agent-runtime-static.js.map +1 -1
- package/packages/core/dist/registries/capability-sources.js +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 +1 -1
- package/packages/core/dist/router/agent-runtime-config.js.map +1 -1
- package/packages/core/dist/router/agent-runtime.d.ts +2 -0
- package/packages/core/dist/router/route-projection.js +1 -1
- package/packages/core/dist/router/route-projection.js.map +1 -1
- package/packages/core/dist/router/routing.js +45 -15
- 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-validation.js +2 -2
- 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 +126 -9
- package/packages/core/dist/run-state/artifacts.js.map +1 -1
- package/packages/core/dist/run-state/inspect-run.d.ts +0 -2
- package/packages/core/dist/run-state/inspect-run.js +7 -5
- package/packages/core/dist/run-state/inspect-run.js.map +1 -1
- package/packages/core/dist/run-state/model.d.ts +28 -8
- 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 +37 -27
- package/packages/core/dist/run-state/run-state.js.map +1 -1
- package/packages/core/dist/run-state/task-evidence.d.ts +5 -2
- package/packages/core/dist/run-state/task-evidence.js +53 -14
- package/packages/core/dist/run-state/task-evidence.js.map +1 -1
- 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 +1 -0
- package/packages/core/dist/run-state.js +1 -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 +10 -0
- package/packages/core/dist/runtime-paths.js +65 -0
- 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/document-hashes.d.ts +2 -0
- package/packages/core/dist/sdd-docs/document-hashes.js +97 -10
- package/packages/core/dist/sdd-docs/document-hashes.js.map +1 -1
- package/packages/core/dist/sdd-docs/run-binding.d.ts +1 -1
- package/packages/core/dist/sdd-docs/run-binding.js +8 -6
- package/packages/core/dist/sdd-docs/run-binding.js.map +1 -1
- package/packages/core/dist/sdd-docs/task-parser.d.ts +1 -0
- package/packages/core/dist/sdd-docs/task-parser.js +55 -34
- 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 +44 -1
- package/packages/core/dist/status/project-status.js +170 -23
- package/packages/core/dist/status/project-status.js.map +1 -1
- package/packages/core/dist/storage/runtime-store.d.ts +170 -18
- package/packages/core/dist/storage/runtime-store.js +544 -32
- 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 +1 -1
- package/packages/core/dist/test-support/run-state.d.ts +1 -1
- package/packages/core/dist/test-support/run-state.js +8 -23
- 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 +28 -53
- 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 +10 -50
- package/packages/core/dist/verification/rendering.js.map +1 -1
- package/packages/core/dist/verification/single-task-loop.d.ts +0 -1
- package/packages/core/dist/verification/single-task-loop.js +159 -150
- package/packages/core/dist/verification/single-task-loop.js.map +1 -1
- package/packages/core/dist/verification/test-runtime.d.ts +12 -2
- package/packages/core/dist/verification/test-runtime.js +238 -103
- 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 +18 -0
- package/packages/core/dist/verification/validation-wave.js +27 -5
- package/packages/core/dist/verification/validation-wave.js.map +1 -1
- package/packages/core/dist/verification/verify-contract.d.ts +1 -1
- package/packages/core/dist/verification/verify-contract.js +9 -32
- package/packages/core/dist/verification/verify-contract.js.map +1 -1
- package/packages/core/dist/work-units/contracts.d.ts +1 -1
- package/packages/core/dist/workflow-gate/evidence-packet.js +228 -15
- package/packages/core/dist/workflow-gate/evidence-packet.js.map +1 -1
- package/packages/core/dist/workflow-gate/hard-checks.js +49 -15
- package/packages/core/dist/workflow-gate/hard-checks.js.map +1 -1
- package/packages/core/dist/workflow-gate/policy.js +42 -6
- package/packages/core/dist/workflow-gate/policy.js.map +1 -1
- package/packages/core/dist/workflow-gate/types.d.ts +4 -5
- package/packages/core/dist/workflow-state/affected-file-conflicts.d.ts +0 -1
- package/packages/core/dist/workflow-state/affected-file-conflicts.js +1 -2
- package/packages/core/dist/workflow-state/affected-file-conflicts.js.map +1 -1
- package/packages/core/dist/workflow-state/dependencies.js +1 -1
- package/packages/core/dist/workflow-state/latest-eligible-run.d.ts +0 -1
- package/packages/core/dist/workflow-state/latest-eligible-run.js +72 -6
- package/packages/core/dist/workflow-state/latest-eligible-run.js.map +1 -1
- 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 +55 -5
- package/packages/core/dist/workflow-state/resolve.js +538 -34
- 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/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 -243
- 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 -110
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.js +0 -497
- 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 -270
- package/node_modules/@sdd-agent-platform/core/src/sync-back/inspect.ts +0 -655
- package/node_modules/@sdd-agent-platform/core/src/sync-back/sync-back.test.ts +0 -569
- 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 -243
- package/packages/core/dist/sync-back/apply.js.map +0 -1
- package/packages/core/dist/sync-back/inspect.d.ts +0 -110
- package/packages/core/dist/sync-back/inspect.js +0 -497
- 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,15 +1,16 @@
|
|
|
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';
|
|
4
|
+
import { appendArtifactHashLedgerEntry, appendInvocationLedgerEntry } from '../run-state/invocation-ledger.js';
|
|
5
5
|
import type { RunState, RunStateTaskRuntime } from '../run-state/model.js';
|
|
6
|
-
import { createRun, readRunState, writeRunState } from '../run-state/run-state.js';
|
|
7
|
-
import {
|
|
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 { parseSddBranch, type SddTask, type SddTaskModel } from '../sdd-docs/task-parser.js';
|
|
11
12
|
import { inspectSddTask } from '../sdd-docs/task-inspection.js';
|
|
12
|
-
import { recordRuntimeAcceptanceEvidenceMap, recordRuntimeDurableGap, recordRuntimeProjection, recordRuntimeTestRun, recordRuntimeTestStep, recordRuntimeValidationEnvironmentSession, recordRuntimeValidationWaveRun, runtimeScopedId, updateRuntimeDurableGapStatus } from '../storage/runtime-store.js';
|
|
13
|
+
import { listRuntimeArtifactPayloads, readRuntimeValidationCacheEntry, recordRuntimeAcceptanceEvidenceMap, recordRuntimeDurableGap, recordRuntimeProjection, recordRuntimeTestRun, recordRuntimeTestStep, recordRuntimeValidationCacheEntry, recordRuntimeValidationCacheUse, recordRuntimeValidationEnvironmentSession, recordRuntimeValidationWaveRun, runtimeScopedId, updateRuntimeDurableGapStatus, type RuntimeValidationCacheEntryRecord } from '../storage/runtime-store.js';
|
|
13
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';
|
|
14
15
|
import type { LifecycleRiskDecision } from '../risk/contracts.js';
|
|
15
16
|
import { inspectVerifyContract, type VerifyContractInspection } from './verify-contract.js';
|
|
@@ -20,10 +21,13 @@ import type { StageRun, WorkflowHandoff } from '../stage-runtime/contracts.js';
|
|
|
20
21
|
import { evaluateTaskWorkflowGate, verifyContractBlockedGate, type ApprovalPolicy, type LifecycleRiskProfile, type LifecycleWorkflowGate } from '../risk.js';
|
|
21
22
|
import { validateSddResultArtifact } from '../artifacts/sdd-result.js';
|
|
22
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';
|
|
23
26
|
import { routeSddTask } from '../router/route-sdd-task.js';
|
|
24
27
|
import type { AgentCapabilityRouteDecision } from '../router/agent-runtime.js';
|
|
25
28
|
import { evaluateAndRecordWorkflowGateDecision } from '../workflow-gate/evidence-packet.js';
|
|
26
29
|
import type { WorkflowGateDecision, WorkflowGateStatus } from '../workflow-gate/types.js';
|
|
30
|
+
import { buildValidationCachePlan, type ValidationCacheUnsafeReason } from './validation-cache.js';
|
|
27
31
|
|
|
28
32
|
const DEFAULT_TEST_TIMEOUT_MS = 120_000;
|
|
29
33
|
const MAX_CAPTURE_BYTES = 256 * 1024;
|
|
@@ -46,10 +50,20 @@ export interface SddTestCommandStep {
|
|
|
46
50
|
exitCode: number | null;
|
|
47
51
|
signal: string | null;
|
|
48
52
|
durationMs: number;
|
|
49
|
-
outputArtifact: string;
|
|
53
|
+
outputArtifact: string | null;
|
|
50
54
|
stdoutBytes: number;
|
|
51
55
|
stderrBytes: number;
|
|
52
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[];
|
|
53
67
|
}
|
|
54
68
|
|
|
55
69
|
interface NormalizedSddTestCommand {
|
|
@@ -87,7 +101,6 @@ export interface SddTestResult {
|
|
|
87
101
|
policyJudgment: TestEvidenceStatus;
|
|
88
102
|
acceptanceCoverage: AcceptanceEvidenceCoverage[];
|
|
89
103
|
capabilityEvidence: CapabilityEvidenceClassification[];
|
|
90
|
-
syncBackReady: boolean;
|
|
91
104
|
commands: string[];
|
|
92
105
|
steps: SddTestCommandStep[];
|
|
93
106
|
validationArtifact: string | null;
|
|
@@ -126,6 +139,7 @@ export async function runSddTest(projectRoot: string, options: RunSddTestOptions
|
|
|
126
139
|
const validationEnvironmentSessionId = options.validationWave?.environmentSessionId ?? runtimeScopedId(context.partition, validationWaveRunId, 'validation-env');
|
|
127
140
|
const validationWaveTaskIds = options.validationWave?.taskIds ?? [options.taskId];
|
|
128
141
|
const validationWaveAcceptanceRefs = options.validationWave?.acceptanceRefsByTask?.[options.taskId];
|
|
142
|
+
const validationWaveScopeAcceptanceRefs = [...new Set(Object.values(options.validationWave?.acceptanceRefsByTask ?? { [options.taskId]: task?.acceptanceRefs ?? [] }).flat())].sort();
|
|
129
143
|
if (ownsValidationWave) {
|
|
130
144
|
await recordRuntimeValidationEnvironmentSession(projectRoot, {
|
|
131
145
|
sessionId: validationEnvironmentSessionId,
|
|
@@ -158,12 +172,16 @@ export async function runSddTest(projectRoot: string, options: RunSddTestOptions
|
|
|
158
172
|
data: { taskId: options.taskId, branch: context.partition, testRunId, commands }
|
|
159
173
|
});
|
|
160
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
|
+
|
|
161
179
|
if (!task) {
|
|
162
180
|
gaps.push(`Task ${options.taskId} was not found in specs/${context.partition}/tasks.md.`);
|
|
163
181
|
}
|
|
164
182
|
if (task) {
|
|
165
183
|
gaps.push(...inspected.gaps.filter((gap) => gap.severity === 'blocking').map((gap) => `${gap.field}: ${gap.message}`));
|
|
166
|
-
gaps.push(...dependencyBlockingReasonsForTask(model, options.taskId));
|
|
184
|
+
gaps.push(...dependencyBlockingReasonsForTask(model, options.taskId, { runtimeByTask }));
|
|
167
185
|
}
|
|
168
186
|
if (verifyContract.action === 'blocked') {
|
|
169
187
|
gaps.push(verifyContractBlocker(verifyInspection));
|
|
@@ -212,7 +230,7 @@ export async function runSddTest(projectRoot: string, options: RunSddTestOptions
|
|
|
212
230
|
const steps: SddTestCommandStep[] = [];
|
|
213
231
|
if (gaps.length === 0) {
|
|
214
232
|
for (const [index, commandInput] of commandInputs.entries()) {
|
|
215
|
-
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);
|
|
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);
|
|
216
234
|
steps.push(step);
|
|
217
235
|
await appendEvent(projectRoot, state.runId, {
|
|
218
236
|
event: 'test_step_completed',
|
|
@@ -229,12 +247,11 @@ export async function runSddTest(projectRoot: string, options: RunSddTestOptions
|
|
|
229
247
|
const policyJudgment = derivePolicyJudgment(commandStatus, evidenceCoverage);
|
|
230
248
|
await recordAcceptanceEvidenceMaps(projectRoot, validationWaveRunId, testRunId, context.partition, state.runId, options.taskId, acceptanceCoverage);
|
|
231
249
|
const validationStatus = policyJudgment;
|
|
232
|
-
const syncBackReady = false;
|
|
233
250
|
const capabilityRoute = task ? await routeSddTask(projectRoot, { taskId: options.taskId, branch: context.partition, approved: options.approved }) : null;
|
|
234
251
|
const capabilityEvidence = buildCapabilityEvidenceClassification(capabilityRoute?.capabilityDecision ?? null, steps);
|
|
235
|
-
const validationArtifact = task ? await writeValidationArtifact(projectRoot, state.runId, task, validationStatus, steps, gaps, capabilityEvidence) : null;
|
|
236
|
-
const
|
|
237
|
-
await persistTestRunState(projectRoot, state, options.taskId, validationStatus, commands,
|
|
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);
|
|
238
255
|
await resolveTestRuntimeDurableGap(projectRoot, context.partition, state.runId, options.taskId, validationStatus, gaps);
|
|
239
256
|
|
|
240
257
|
const gateDecision = (await evaluateAndRecordWorkflowGateDecision(projectRoot, {
|
|
@@ -245,39 +262,10 @@ export async function runSddTest(projectRoot: string, options: RunSddTestOptions
|
|
|
245
262
|
})).decision;
|
|
246
263
|
const runtimeJudgment = gateDecision.status;
|
|
247
264
|
const status = finalStatusForTest(validationStatus, runtimeJudgment);
|
|
248
|
-
await recordTestRuntimeDurableGap(projectRoot, context.partition, state.runId, options.taskId, status, validationStatus, runtimeJudgment, gaps,
|
|
249
|
-
const unifiedEvidence = buildUnifiedTestEvidenceRun(testRunId, context.partition, state.runId, options.taskId, commandStatus, evidenceCoverage, policyJudgment, status, runtimeJudgment, steps, acceptanceCoverage, capabilityEvidence,
|
|
250
|
-
const indexArtifact = await writeIndexArtifact(projectRoot, state.runId, {
|
|
251
|
-
testRunId,
|
|
252
|
-
validationWaveRunId,
|
|
253
|
-
validationEnvironmentSessionId,
|
|
254
|
-
branch: context.partition,
|
|
255
|
-
taskId: options.taskId,
|
|
256
|
-
status,
|
|
257
|
-
validationStatus,
|
|
258
|
-
workflowGateStatus: gateDecision.status,
|
|
259
|
-
runtimeJudgment,
|
|
260
|
-
workflowGateDecision: gateDecision,
|
|
261
|
-
verifyContractStatus: verifyInspection.status,
|
|
262
|
-
verifyContractAction: verifyContract.action,
|
|
263
|
-
lifecycleGate: workflowGate.lifecycleGate,
|
|
264
|
-
lifecycleProfile: workflowGate.lifecycleProfile,
|
|
265
|
-
approvalPolicy: workflowGate.approvalPolicy,
|
|
266
|
-
requiredStages: workflowGate.requiredStages,
|
|
267
|
-
primaryReason: workflowGate.primaryReason,
|
|
268
|
-
commandStatus,
|
|
269
|
-
evidenceCoverage,
|
|
270
|
-
policyJudgment,
|
|
271
|
-
acceptanceCoverage,
|
|
272
|
-
capabilityEvidence,
|
|
273
|
-
syncBackReady,
|
|
274
|
-
commands,
|
|
275
|
-
steps,
|
|
276
|
-
validationArtifact: validationArtifact?.runRelativePath ?? null,
|
|
277
|
-
gaps
|
|
278
|
-
});
|
|
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);
|
|
279
267
|
const completedAt = new Date().toISOString();
|
|
280
|
-
const evidence =
|
|
268
|
+
const evidence = runtimeEvidenceRefs(validationArtifact?.runRelativePath ?? null, steps);
|
|
281
269
|
|
|
282
270
|
await recordRuntimeTestRun(projectRoot, {
|
|
283
271
|
testRunId,
|
|
@@ -287,7 +275,7 @@ export async function runSddTest(projectRoot: string, options: RunSddTestOptions
|
|
|
287
275
|
status,
|
|
288
276
|
startedAt,
|
|
289
277
|
completedAt,
|
|
290
|
-
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,
|
|
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 }
|
|
291
279
|
});
|
|
292
280
|
await recordRuntimeProjection(projectRoot, 'test_runtime', `${context.partition}:${options.taskId}:${state.runId}`, {
|
|
293
281
|
contract: 'sdd-test-runtime-v1',
|
|
@@ -371,13 +359,12 @@ export async function runSddTest(projectRoot: string, options: RunSddTestOptions
|
|
|
371
359
|
policyJudgment,
|
|
372
360
|
acceptanceCoverage,
|
|
373
361
|
capabilityEvidence,
|
|
374
|
-
syncBackReady,
|
|
375
362
|
commands,
|
|
376
363
|
steps,
|
|
377
364
|
validationArtifact: validationArtifact?.runRelativePath ?? null,
|
|
378
|
-
indexArtifact:
|
|
365
|
+
indexArtifact: null,
|
|
379
366
|
gaps,
|
|
380
|
-
next: nextForTestResult(status, runtimeJudgment, context.partition, options.taskId,
|
|
367
|
+
next: nextForTestResult(status, runtimeJudgment, context.partition, options.taskId, workflowGate.nextAction, gateDecision)
|
|
381
368
|
};
|
|
382
369
|
}
|
|
383
370
|
|
|
@@ -446,12 +433,17 @@ function verifyContractBlocker(inspection: VerifyContractInspection): string {
|
|
|
446
433
|
}
|
|
447
434
|
|
|
448
435
|
async function hasReviewerCheckpoint(projectRoot: string, state: RunState, taskId: string): Promise<boolean> {
|
|
449
|
-
const artifactPaths = new Set(
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
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
|
+
}
|
|
455
447
|
|
|
456
448
|
for (const artifactPath of artifactPaths) {
|
|
457
449
|
const report = await validateSddResultArtifact(projectRoot, state.runId, artifactPath, { expectedTask: taskId, expectedAgent: 'reviewer' });
|
|
@@ -484,14 +476,40 @@ export function renderSddTestResult(result: SddTestResult): string {
|
|
|
484
476
|
}
|
|
485
477
|
|
|
486
478
|
|
|
487
|
-
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
|
+
|
|
488
486
|
const started = Date.now();
|
|
487
|
+
const startedAt = new Date(started).toISOString();
|
|
489
488
|
const executed = await executeCommand(projectRoot, commandInput, timeoutMs);
|
|
490
|
-
const
|
|
489
|
+
const ended = Date.now();
|
|
490
|
+
const endedAt = new Date(ended).toISOString();
|
|
491
|
+
const durationMs = ended - started;
|
|
491
492
|
const status: SddTestStepStatus = executed.timedOut || executed.error ? 'blocked' : executed.exitCode === 0 ? 'pass' : 'fail';
|
|
492
493
|
const stepId = `${testRunId}-${String(sequence).padStart(3, '0')}`;
|
|
493
|
-
const
|
|
494
|
-
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);
|
|
495
513
|
await appendInvocationLedgerEntry(projectRoot, {
|
|
496
514
|
runId,
|
|
497
515
|
taskId,
|
|
@@ -499,10 +517,11 @@ async function runCommandStep(projectRoot: string, runId: string, branch: string
|
|
|
499
517
|
kind: 'command',
|
|
500
518
|
ref: commandInput.command,
|
|
501
519
|
status,
|
|
502
|
-
artifactPath:
|
|
503
|
-
outputHash: hashDocumentContent(output),
|
|
504
|
-
materialRefs: [
|
|
520
|
+
artifactPath: outputRef,
|
|
521
|
+
outputHash: output ? hashDocumentContent(output) : null,
|
|
522
|
+
materialRefs: outputRef ? [outputRef] : [],
|
|
505
523
|
metadata: {
|
|
524
|
+
stepId,
|
|
506
525
|
source: 'sdd-test',
|
|
507
526
|
exitCode: executed.exitCode,
|
|
508
527
|
durationMs,
|
|
@@ -511,7 +530,12 @@ async function runCommandStep(projectRoot: string, runId: string, branch: string
|
|
|
511
530
|
truncated: executed.truncated,
|
|
512
531
|
acceptanceRefs: acceptanceRefs.join(','),
|
|
513
532
|
shell: commandInput.shell,
|
|
514
|
-
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(',')
|
|
515
539
|
}
|
|
516
540
|
});
|
|
517
541
|
const step: SddTestCommandStep = {
|
|
@@ -524,10 +548,20 @@ async function runCommandStep(projectRoot: string, runId: string, branch: string
|
|
|
524
548
|
exitCode: executed.exitCode,
|
|
525
549
|
signal: executed.signal,
|
|
526
550
|
durationMs,
|
|
527
|
-
outputArtifact:
|
|
551
|
+
outputArtifact: outputRef,
|
|
528
552
|
stdoutBytes: executed.stdoutBytes,
|
|
529
553
|
stderrBytes: executed.stderrBytes,
|
|
530
|
-
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
|
|
531
565
|
};
|
|
532
566
|
await recordRuntimeTestStep(projectRoot, {
|
|
533
567
|
stepId,
|
|
@@ -538,9 +572,96 @@ async function runCommandStep(projectRoot: string, runId: string, branch: string
|
|
|
538
572
|
status,
|
|
539
573
|
exitCode: executed.exitCode,
|
|
540
574
|
durationMs,
|
|
541
|
-
outputArtifact:
|
|
575
|
+
outputArtifact: outputRef,
|
|
576
|
+
payload: step
|
|
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,
|
|
542
649
|
payload: step
|
|
543
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
|
+
});
|
|
544
665
|
return step;
|
|
545
666
|
}
|
|
546
667
|
|
|
@@ -591,19 +712,21 @@ function executeCommand(projectRoot: string, commandInput: NormalizedSddTestComm
|
|
|
591
712
|
});
|
|
592
713
|
}
|
|
593
714
|
|
|
594
|
-
async function writeValidationArtifact(projectRoot: string, runId: string, task: SddTask, status: SddTestStatus, steps: SddTestCommandStep[], gaps: string[],
|
|
595
|
-
const artifactPath =
|
|
596
|
-
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);
|
|
597
718
|
const resultStatus = status === 'PASS' ? 'PASS' : status === 'FAIL' ? 'FAIL' : 'BLOCKED';
|
|
598
|
-
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 - ${
|
|
599
|
-
|
|
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 };
|
|
600
722
|
}
|
|
601
723
|
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
return writeArtifact(projectRoot, runId, `test-index-${payload.taskId}.json`, `${JSON.stringify({ contract: 'sdd-test-runtime-v1', runId, ...payload }, null, 2)}\n`);
|
|
724
|
+
function validationArtifactPath(task: SddTask): string {
|
|
725
|
+
return `test-validation-${task.id}.md`;
|
|
605
726
|
}
|
|
606
727
|
|
|
728
|
+
|
|
729
|
+
|
|
607
730
|
async function persistTestRunState(projectRoot: string, state: RunState, taskId: string, validationStatus: SddTestStatus, commands: string[], evidence: string[], validationArtifact: string | null): Promise<void> {
|
|
608
731
|
const latest = await readRunState(projectRoot, state.runId);
|
|
609
732
|
const knownArtifacts = new Set(latest.artifacts.map((artifact) => artifact.path));
|
|
@@ -622,7 +745,7 @@ async function persistTestRunState(projectRoot: string, state: RunState, taskId:
|
|
|
622
745
|
[taskId]: {
|
|
623
746
|
...baseRuntimeTaskState(existingTaskState),
|
|
624
747
|
status: validationStatus === 'PASS' ? 'validation_passed_pending_gate' : validationStatus === 'FAIL' ? 'validation_failed' : 'validation_blocked',
|
|
625
|
-
implementationStatus: existingTaskState?.implementationStatus ?? '
|
|
748
|
+
implementationStatus: existingTaskState?.implementationStatus ?? 'not_started',
|
|
626
749
|
verificationStatus: verificationStatusFromTest(validationStatus),
|
|
627
750
|
testStatus: validationStatus,
|
|
628
751
|
evidence
|
|
@@ -633,8 +756,7 @@ async function persistTestRunState(projectRoot: string, state: RunState, taskId:
|
|
|
633
756
|
status: validationStatus === 'PASS' ? 'pass' : validationStatus === 'FAIL' ? 'fail' : 'blocked',
|
|
634
757
|
commands,
|
|
635
758
|
evidence
|
|
636
|
-
}
|
|
637
|
-
syncBack: latest.syncBack
|
|
759
|
+
}
|
|
638
760
|
});
|
|
639
761
|
}
|
|
640
762
|
|
|
@@ -656,7 +778,7 @@ async function persistTestGateOutcome(projectRoot: string, runId: string, taskId
|
|
|
656
778
|
[taskId]: {
|
|
657
779
|
...baseRuntimeTaskState(existingTaskState),
|
|
658
780
|
status: runtimeTaskStatusAfterGate(status, validationStatus),
|
|
659
|
-
implementationStatus: existingTaskState?.implementationStatus ?? '
|
|
781
|
+
implementationStatus: existingTaskState?.implementationStatus ?? 'not_started',
|
|
660
782
|
verificationStatus: verificationStatusFromTest(validationStatus),
|
|
661
783
|
testStatus: status,
|
|
662
784
|
validationStatus,
|
|
@@ -670,8 +792,7 @@ async function persistTestGateOutcome(projectRoot: string, runId: string, taskId
|
|
|
670
792
|
status: validationStatus === 'PASS' ? 'pass' : validationStatus === 'FAIL' ? 'fail' : 'blocked',
|
|
671
793
|
commands,
|
|
672
794
|
evidence
|
|
673
|
-
}
|
|
674
|
-
syncBack: latest.syncBack
|
|
795
|
+
}
|
|
675
796
|
});
|
|
676
797
|
}
|
|
677
798
|
|
|
@@ -680,9 +801,6 @@ function testArtifactKind(artifactPath: string): string {
|
|
|
680
801
|
if (fileName.startsWith('test-validation-')) {
|
|
681
802
|
return 'test-validation';
|
|
682
803
|
}
|
|
683
|
-
if (fileName.startsWith('test-index-')) {
|
|
684
|
-
return 'test-index';
|
|
685
|
-
}
|
|
686
804
|
return 'test';
|
|
687
805
|
}
|
|
688
806
|
|
|
@@ -744,12 +862,24 @@ function buildAcceptanceCoverage(task: SddTask | null, steps: SddTestCommandStep
|
|
|
744
862
|
return {
|
|
745
863
|
acceptanceRef,
|
|
746
864
|
status,
|
|
747
|
-
evidenceRefs: mappedSteps.map(
|
|
865
|
+
evidenceRefs: mappedSteps.map(commandStepRuntimeRef),
|
|
748
866
|
gaps: status === 'complete' ? [] : [`Acceptance ${acceptanceRef} has no complete non-stale evidence from sdd test task.`]
|
|
749
867
|
};
|
|
750
868
|
});
|
|
751
869
|
}
|
|
752
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
|
+
|
|
753
883
|
function summarizeEvidenceCoverage(acceptanceCoverage: AcceptanceEvidenceCoverage[]): EvidenceCoverageStatus {
|
|
754
884
|
if (acceptanceCoverage.length === 0) {
|
|
755
885
|
return 'missing';
|
|
@@ -819,7 +949,7 @@ async function recordTestRuntimeDurableGap(
|
|
|
819
949
|
severity: 'blocking',
|
|
820
950
|
status: 'open',
|
|
821
951
|
message,
|
|
822
|
-
recommendation: `Resolve test runtime gaps for ${taskId}, then rerun
|
|
952
|
+
recommendation: `Resolve test runtime gaps for ${taskId}, then rerun ${testValidationUnitCommand(branch, taskId)}.`,
|
|
823
953
|
evidenceRefs,
|
|
824
954
|
proposalRefs: [],
|
|
825
955
|
sourceRefs: [],
|
|
@@ -835,10 +965,10 @@ function finalStatusForTest(validationStatus: SddTestStatus, runtimeJudgment: Wo
|
|
|
835
965
|
if (validationStatus !== 'PASS') {
|
|
836
966
|
return validationStatus;
|
|
837
967
|
}
|
|
838
|
-
return runtimeJudgment === 'PASS' ? 'PASS' : 'BLOCKED';
|
|
968
|
+
return runtimeJudgment === 'PASS' || runtimeJudgment === 'WARN' ? 'PASS' : 'BLOCKED';
|
|
839
969
|
}
|
|
840
970
|
|
|
841
|
-
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[],
|
|
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 {
|
|
842
972
|
return {
|
|
843
973
|
contract: TEST_EVIDENCE_RUN_CONTRACT_VERSION,
|
|
844
974
|
id,
|
|
@@ -849,17 +979,16 @@ function buildUnifiedTestEvidenceRun(id: string, branch: string, runId: string,
|
|
|
849
979
|
commands: steps.map((step) => ({
|
|
850
980
|
command: step.command,
|
|
851
981
|
status: step.status === 'pass' ? 'PASS' : step.status === 'fail' ? 'FAIL' : 'BLOCKED',
|
|
852
|
-
outputRef: { kind: 'artifact', ref: step.outputArtifact },
|
|
853
|
-
evidenceRefs: [
|
|
982
|
+
outputRef: step.outputArtifact ? { kind: 'artifact', ref: step.outputArtifact } : undefined,
|
|
983
|
+
evidenceRefs: [commandStepRuntimeRef(step), ...artifactRuntimeRefs(step.outputArtifact)],
|
|
854
984
|
acceptanceRefs: step.acceptanceRefs,
|
|
855
985
|
startedAt: new Date(Date.now() - step.durationMs).toISOString(),
|
|
856
986
|
completedAt: new Date().toISOString()
|
|
857
987
|
})),
|
|
858
988
|
acceptanceCoverage,
|
|
859
989
|
capabilityEvidence,
|
|
860
|
-
syncBackReady,
|
|
861
990
|
gaps: [...gaps, ...acceptanceCoverage.flatMap((coverage) => coverage.gaps)],
|
|
862
|
-
next: nextForTestResult(status, runtimeJudgment, branch, taskId,
|
|
991
|
+
next: nextForTestResult(status, runtimeJudgment, branch, taskId, gateNextAction, gateDecision),
|
|
863
992
|
generatedAt: new Date().toISOString()
|
|
864
993
|
};
|
|
865
994
|
}
|
|
@@ -908,12 +1037,6 @@ function capabilityClassForRejectedSource(status: AgentCapabilityRouteDecision['
|
|
|
908
1037
|
return 'diagnostic';
|
|
909
1038
|
}
|
|
910
1039
|
|
|
911
|
-
function renderCapabilityEvidenceClassification(items: CapabilityEvidenceClassification[]): string {
|
|
912
|
-
if (items.length === 0) {
|
|
913
|
-
return '- none';
|
|
914
|
-
}
|
|
915
|
-
return items.map((item) => `- [${item.class}] ${item.source}:${item.domainOrSourceId} — ${item.reason}`).join('\n');
|
|
916
|
-
}
|
|
917
1040
|
|
|
918
1041
|
function capabilityEvidenceSummary(items: CapabilityEvidenceClassification[]): string {
|
|
919
1042
|
if (items.length === 0) {
|
|
@@ -926,31 +1049,37 @@ function capabilityEvidenceSummary(items: CapabilityEvidenceClassification[]): s
|
|
|
926
1049
|
return [...counts.entries()].map(([kind, count]) => `${kind}:${count}`).join(',');
|
|
927
1050
|
}
|
|
928
1051
|
|
|
929
|
-
function nextForTestResult(status: SddTestStatus, runtimeJudgment: WorkflowGateStatus, branch: string, taskId: string,
|
|
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}`;
|
|
930
1054
|
if (status === 'PASS') {
|
|
931
|
-
return `sdd
|
|
1055
|
+
return `sdd test close --branch ${branch} --target goal-verify --compact-json`;
|
|
932
1056
|
}
|
|
933
1057
|
if (gateNextAction) {
|
|
934
1058
|
return gateNextAction;
|
|
935
1059
|
}
|
|
936
1060
|
if (runtimeJudgment === 'HUMAN_REQUIRED') {
|
|
937
|
-
return gateDecision ? `Create a decision card for workflow gate ${gateDecision.decisionId}, then rerun
|
|
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)}.`;
|
|
938
1062
|
}
|
|
939
1063
|
if (runtimeJudgment === 'WARN') {
|
|
940
|
-
return gateDecision ? `Review workflow gate ${gateDecision.decisionId} warnings, then rerun
|
|
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)}.`;
|
|
941
1065
|
}
|
|
942
1066
|
if (runtimeJudgment === 'ADVISORY_ONLY') {
|
|
943
1067
|
return `Inspect advisor assessments for ${taskId}; advisory output cannot satisfy the test gate.`;
|
|
944
1068
|
}
|
|
945
1069
|
if (status === 'FAIL') {
|
|
946
|
-
return
|
|
1070
|
+
return `${inspectHint}, fix failing validation commands, then rerun ${testValidationUnitCommand(branch, taskId)}.`;
|
|
947
1071
|
}
|
|
948
|
-
return gateDecision ?
|
|
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}`;
|
|
949
1078
|
}
|
|
950
1079
|
|
|
951
1080
|
function resultSentenceForTest(result: SddTestResult): string {
|
|
952
1081
|
if (result.status === 'PASS') {
|
|
953
|
-
return 'Validation and workflow gate passed; proceed to release readiness.';
|
|
1082
|
+
return 'Validation and workflow gate passed; proceed to goal verification and truthAlignment before release readiness.';
|
|
954
1083
|
}
|
|
955
1084
|
if (result.validationStatus === 'PASS' && result.workflowGateStatus !== 'PASS') {
|
|
956
1085
|
return `Validation passed, but workflow gate returned ${result.workflowGateStatus}.`;
|
|
@@ -974,7 +1103,7 @@ function renderEvidenceBlocks(task: SddTask, status: SddTestStatus, sourceArtifa
|
|
|
974
1103
|
}
|
|
975
1104
|
return mappedEvidence.map(({ acceptance, steps: mappedSteps }) => {
|
|
976
1105
|
const evidenceStatus = evidenceStatusForMappedSteps(status, mappedSteps);
|
|
977
|
-
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\`\`\``;
|
|
978
1107
|
}).join('\n\n');
|
|
979
1108
|
}
|
|
980
1109
|
|
|
@@ -1023,10 +1152,39 @@ function evidenceStatusForMappedSteps(status: SddTestStatus, steps: SddTestComma
|
|
|
1023
1152
|
return 'PASS';
|
|
1024
1153
|
}
|
|
1025
1154
|
|
|
1026
|
-
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 {
|
|
1027
|
-
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');
|
|
1169
|
+
}
|
|
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(' ');
|
|
1028
1185
|
}
|
|
1029
1186
|
|
|
1187
|
+
|
|
1030
1188
|
function hashDocumentContent(raw: string): string {
|
|
1031
1189
|
return createHash('sha256').update(raw.replace(/\r\n/g, '\n'), 'utf8').digest('hex');
|
|
1032
1190
|
}
|