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,6 +1,6 @@
|
|
|
1
1
|
import test from 'node:test';
|
|
2
2
|
import assert from 'node:assert/strict';
|
|
3
|
-
import { mkdtemp, rm } from 'node:fs/promises';
|
|
3
|
+
import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
|
|
4
4
|
import { tmpdir } from 'node:os';
|
|
5
5
|
import path from 'node:path';
|
|
6
6
|
import { execFile } from 'node:child_process';
|
|
@@ -8,10 +8,15 @@ import { promisify } from 'node:util';
|
|
|
8
8
|
|
|
9
9
|
import { initProject } from '../config/init-project.js';
|
|
10
10
|
import { createRun, readRunState, writeRunState } from '../run-state/run-state.js';
|
|
11
|
-
import { validTaskMarkdown, writeBranchDocs } from '../test-support/fixtures.js';
|
|
12
|
-
import { bindTestRunState,
|
|
11
|
+
import { hashTestDocument, validTaskMarkdown, writeBranchDocs } from '../test-support/fixtures.js';
|
|
12
|
+
import { bindTestRunState, markTestRunReadyForShip } from '../test-support/run-state.js';
|
|
13
13
|
import { createDelegationRecord } from '../delegation/validation.js';
|
|
14
|
+
import { recordRuntimeProjectionEnvelope, recordRuntimeRepair } from '../storage/runtime-store.js';
|
|
15
|
+
import { buildOpenRepairRecord } from './repair-contract.js';
|
|
16
|
+
import { recordTruthAlignmentProjection, SPEC_COLLABORATION_ADJUDICATION_PROJECTION_TYPE, specCollaborationScopeKey, TEST_COLLABORATION_ADJUDICATION_PROJECTION_TYPE, testCollaborationScopeKey, type TruthAlignmentProjection } from '../stage-collaboration.js';
|
|
17
|
+
import { readTruthReconciliationProjection } from '../truth-reconciliation.js';
|
|
14
18
|
import { resolveWorkflowState } from './resolve.js';
|
|
19
|
+
import { readNextIntentProjection, readTaskOrchestrationProjection, readValidationUnitProjection, readWorkflowCurrentStateProjection } from './runtime-projections.js';
|
|
15
20
|
|
|
16
21
|
const execFileAsync = promisify(execFile);
|
|
17
22
|
|
|
@@ -22,7 +27,7 @@ test('workflow state resolver projects branch docs latest run and next action',
|
|
|
22
27
|
await writeBranchDocs(root, 'feature', validTaskMarkdown('T1', []));
|
|
23
28
|
const run = await createRun(root, { runId: 'run-1' });
|
|
24
29
|
await bindTestRunState(root, run.runId, 'feature', 'T1');
|
|
25
|
-
await
|
|
30
|
+
await markTestRunReadyForShip(root, run.runId, 'T1');
|
|
26
31
|
|
|
27
32
|
const workflow = await resolveWorkflowState(root, { branch: 'feature', taskId: 'T1' });
|
|
28
33
|
|
|
@@ -31,13 +36,37 @@ test('workflow state resolver projects branch docs latest run and next action',
|
|
|
31
36
|
assert.equal(workflow.latestRun?.runId, 'run-1');
|
|
32
37
|
assert.deepEqual(workflow.latestRunsByTask.map((entry) => `${entry.partition}:${entry.taskId}:${entry.runId}`), ['feature:T1:run-1']);
|
|
33
38
|
assert.equal(workflow.taskCounts.total, 1);
|
|
34
|
-
assert.equal(workflow.recommendedNextCommand, 'sdd ship --branch feature --
|
|
39
|
+
assert.equal(workflow.recommendedNextCommand, 'sdd ship close --branch feature --compact-json');
|
|
40
|
+
assert.equal(workflow.nextIntent.bundle, 'ship');
|
|
41
|
+
assert.equal(workflow.nextIntent.targetRuntimeStage, 'ship');
|
|
42
|
+
assert.equal(workflow.nextIntent.hostProjections.find((projection) => projection.host === 'claude_code')?.entry, '/sdd:ship close --branch feature --compact-json');
|
|
43
|
+
const currentStateProjection = await readWorkflowCurrentStateProjection(root, 'feature');
|
|
44
|
+
const nextIntentProjection = await readNextIntentProjection(root, 'feature');
|
|
45
|
+
const taskOrchestrationProjection = await readTaskOrchestrationProjection(root, 'feature');
|
|
46
|
+
const validationUnitProjection = await readValidationUnitProjection(root, 'feature');
|
|
47
|
+
|
|
48
|
+
assert.equal(currentStateProjection?.payload.contract, 'sdd-workflow-current-state-projection-v1');
|
|
49
|
+
assert.equal(currentStateProjection?.payload.lifecycle.currentStage, 'ship');
|
|
50
|
+
assert.equal(currentStateProjection?.payload.lifecycle.writer, 'runtime_sqlite');
|
|
51
|
+
assert.equal(currentStateProjection?.payload.tasks[0]?.taskId, 'T1');
|
|
52
|
+
assert.equal(currentStateProjection?.payload.tasks[0]?.consumability, 'consumable');
|
|
53
|
+
assert.equal(currentStateProjection?.payload.validationUnits[0]?.validationUnitId, 'T1');
|
|
54
|
+
assert.equal(taskOrchestrationProjection?.payload.contract, 'sdd-task-orchestration-projection-v1');
|
|
55
|
+
assert.equal(taskOrchestrationProjection?.payload.tasks[0]?.taskId, 'T1');
|
|
56
|
+
assert.equal(taskOrchestrationProjection?.payload.tasks[0]?.sourceRef.ref, 'specs/feature/tasks.md#T1');
|
|
57
|
+
assert.equal(validationUnitProjection?.payload.contract, 'sdd-validation-unit-projection-v1');
|
|
58
|
+
assert.deepEqual(validationUnitProjection?.payload.validationUnits[0]?.taskIds, ['T1']);
|
|
59
|
+
assert.equal(nextIntentProjection?.payload.contract, 'sdd-next-intent-projection-v1');
|
|
60
|
+
assert.equal(nextIntentProjection?.payload.advisory, true);
|
|
61
|
+
assert.equal(nextIntentProjection?.payload.rules.recommendationIsNotAGate, true);
|
|
62
|
+
assert.equal(nextIntentProjection?.payload.primary.canonicalCommand, workflow.nextIntent.canonicalCommand);
|
|
63
|
+
assert.equal(nextIntentProjection?.payload.primary.targetRuntimeStage, 'ship');
|
|
35
64
|
} finally {
|
|
36
65
|
await rm(root, { recursive: true, force: true });
|
|
37
66
|
}
|
|
38
67
|
});
|
|
39
68
|
|
|
40
|
-
test('workflow state routes validation PASS to
|
|
69
|
+
test('workflow state routes validation PASS to goal-verify before ship readiness', async () => {
|
|
41
70
|
const root = await mkdtemp(path.join(tmpdir(), 'sdd-workflow-state-test-pass-'));
|
|
42
71
|
try {
|
|
43
72
|
await initProject(root);
|
|
@@ -52,18 +81,435 @@ test('workflow state routes validation PASS to ship without requiring sync-back
|
|
|
52
81
|
status: 'pass',
|
|
53
82
|
commands: ['npm test'],
|
|
54
83
|
evidence: ['artifacts/validation-T1.md']
|
|
55
|
-
},
|
|
56
|
-
syncBack: {
|
|
57
|
-
...bound.syncBack,
|
|
58
|
-
status: 'not_created'
|
|
59
84
|
}
|
|
60
85
|
});
|
|
61
86
|
|
|
62
87
|
const workflow = await resolveWorkflowState(root, { branch: 'feature', taskId: 'T1' });
|
|
63
88
|
|
|
64
|
-
assert.equal(workflow.nextIntent.stage, '
|
|
65
|
-
assert.equal(workflow.nextIntent.
|
|
66
|
-
assert.equal(workflow.
|
|
89
|
+
assert.equal(workflow.nextIntent.stage, 'test');
|
|
90
|
+
assert.equal(workflow.nextIntent.bundle, 'test');
|
|
91
|
+
assert.equal(workflow.nextIntent.targetRuntimeStage, 'goal-verify');
|
|
92
|
+
assert.equal(workflow.nextIntent.intent, 'run_goal_verify');
|
|
93
|
+
assert.equal(workflow.recommendedNextCommand, 'sdd test close --branch feature --target goal-verify --compact-json');
|
|
94
|
+
} finally {
|
|
95
|
+
await rm(root, { recursive: true, force: true });
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
test('workflow state routes non-aligned truthAlignment to owner stage-manager reconciliation', async () => {
|
|
100
|
+
const root = await mkdtemp(path.join(tmpdir(), 'sdd-workflow-state-truth-reconcile-'));
|
|
101
|
+
try {
|
|
102
|
+
await initProject(root);
|
|
103
|
+
await writeBranchDocs(root, 'feature', validTaskMarkdown('T1', []));
|
|
104
|
+
await recordTruthAlignmentProjection(root, truthAlignmentProjection({
|
|
105
|
+
branch: 'feature',
|
|
106
|
+
status: 'drift_detected',
|
|
107
|
+
ownerStage: 'do',
|
|
108
|
+
semanticImpact: 'material',
|
|
109
|
+
invalidatesStages: ['do'],
|
|
110
|
+
staleRefs: [{ kind: 'artifact', ref: '.sdd/runs/feature/do/implementation-v1.md', hash: 'old-implementation-hash' }],
|
|
111
|
+
reasons: ['accepted implementation evidence no longer matches declared truth']
|
|
112
|
+
}));
|
|
113
|
+
|
|
114
|
+
const workflow = await resolveWorkflowState(root, { branch: 'feature', taskId: 'T1' });
|
|
115
|
+
const projection = await readTruthReconciliationProjection(root, 'feature');
|
|
116
|
+
|
|
117
|
+
assert.equal(workflow.nextIntent.intent, 'reconcile_truth');
|
|
118
|
+
assert.equal(workflow.nextIntent.bundle, 'do');
|
|
119
|
+
assert.equal(workflow.nextIntent.targetRuntimeStage, 'do');
|
|
120
|
+
assert.equal(workflow.recommendedNextCommand, 'sdd do task <task_id> --branch feature');
|
|
121
|
+
assert.equal(workflow.truthReconciliation?.changeKind, 'implementation_mismatch');
|
|
122
|
+
assert.deepEqual(workflow.truthReconciliation?.minimalFrontier, ['do', 'test', 'goal-verify', 'ship']);
|
|
123
|
+
assert.equal(workflow.truthReconciliation?.preservesEvidenceRefs.length, 0);
|
|
124
|
+
assert.equal(workflow.truthReconciliation?.supersedesEvidenceRefs.length, 2);
|
|
125
|
+
assert.equal(projection?.payload.nextIntent.canonicalCommand, workflow.nextIntent.canonicalCommand);
|
|
126
|
+
assert.equal(workflow.nextIntent.hostProjections.find((host) => host.host === 'claude_code')?.entry, '/sdd:do task <task_id> --branch feature');
|
|
127
|
+
assert.equal(workflow.nextIntent.canonicalCommand.includes('sync-back'), false);
|
|
128
|
+
} finally {
|
|
129
|
+
await rm(root, { recursive: true, force: true });
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
test('workflow state advances material truth reconciliation frontier after do correction evidence', async () => {
|
|
134
|
+
const root = await mkdtemp(path.join(tmpdir(), 'sdd-workflow-state-truth-frontier-'));
|
|
135
|
+
try {
|
|
136
|
+
await initProject(root);
|
|
137
|
+
await writeBranchDocs(root, 'feature', validTaskMarkdown('T1', []));
|
|
138
|
+
await recordTruthAlignmentProjection(root, truthAlignmentProjection({
|
|
139
|
+
branch: 'feature',
|
|
140
|
+
status: 'drift_detected',
|
|
141
|
+
ownerStage: 'do',
|
|
142
|
+
semanticImpact: 'material',
|
|
143
|
+
invalidatesStages: ['do'],
|
|
144
|
+
staleRefs: [{ kind: 'artifact', ref: '.sdd/runs/feature/do/implementation-v1.md', hash: 'old-implementation-hash' }],
|
|
145
|
+
reasons: ['accepted implementation evidence no longer matches declared truth'],
|
|
146
|
+
createdAt: '2020-01-01T00:00:00.000Z'
|
|
147
|
+
}));
|
|
148
|
+
const run = await createRun(root, { runId: 'run-post-truth-do', branch: 'feature', taskId: 'T1' });
|
|
149
|
+
await writeRunState(root, {
|
|
150
|
+
...run,
|
|
151
|
+
status: 'completed',
|
|
152
|
+
createdAt: '2026-06-01T00:00:01.000Z',
|
|
153
|
+
updatedAt: '2026-06-01T00:00:01.000Z',
|
|
154
|
+
tasks: {
|
|
155
|
+
T1: {
|
|
156
|
+
status: 'implemented_pending_validation',
|
|
157
|
+
implementationStatus: 'implemented',
|
|
158
|
+
verificationStatus: 'not_run',
|
|
159
|
+
validationBatch: null,
|
|
160
|
+
validationTiming: 'task_end',
|
|
161
|
+
requiresVerifyBeforeNext: true,
|
|
162
|
+
gaps: [],
|
|
163
|
+
artifacts: ['.sdd/runs/feature/do/implementation-v2.md']
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
const workflow = await resolveWorkflowState(root, { branch: 'feature', taskId: 'T1' });
|
|
169
|
+
|
|
170
|
+
assert.equal(workflow.truthReconciliation?.ownerStage, 'do');
|
|
171
|
+
assert.deepEqual(workflow.truthReconciliation?.minimalFrontier, ['do', 'test', 'goal-verify', 'ship']);
|
|
172
|
+
assert.equal(workflow.nextIntent.intent, 'reconcile_truth');
|
|
173
|
+
assert.equal(workflow.nextIntent.bundle, 'test');
|
|
174
|
+
assert.equal(workflow.nextIntent.targetRuntimeStage, 'test');
|
|
175
|
+
assert.equal(workflow.recommendedNextCommand, 'sdd test close --branch feature --compact-json');
|
|
176
|
+
assert.equal(workflow.nextIntent.canonicalCommand.includes('sync-back'), false);
|
|
177
|
+
} finally {
|
|
178
|
+
await rm(root, { recursive: true, force: true });
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
test('workflow state advances material truth reconciliation frontier after test stage close', async () => {
|
|
183
|
+
const root = await mkdtemp(path.join(tmpdir(), 'sdd-workflow-state-truth-test-frontier-'));
|
|
184
|
+
try {
|
|
185
|
+
await initProject(root);
|
|
186
|
+
await writeBranchDocs(root, 'feature', validTaskMarkdown('T1', []));
|
|
187
|
+
await recordTruthAlignmentProjection(root, truthAlignmentProjection({
|
|
188
|
+
branch: 'feature',
|
|
189
|
+
status: 'drift_detected',
|
|
190
|
+
ownerStage: 'do',
|
|
191
|
+
semanticImpact: 'material',
|
|
192
|
+
invalidatesStages: ['do'],
|
|
193
|
+
staleRefs: [{ kind: 'artifact', ref: '.sdd/runs/feature/do/implementation-v1.md', hash: 'old-implementation-hash' }],
|
|
194
|
+
reasons: ['accepted implementation evidence no longer matches declared truth'],
|
|
195
|
+
createdAt: '2020-01-01T00:00:00.000Z'
|
|
196
|
+
}));
|
|
197
|
+
const doRun = await createRun(root, { runId: 'run-post-truth-do', branch: 'feature', taskId: 'T1' });
|
|
198
|
+
await writeRunState(root, {
|
|
199
|
+
...doRun,
|
|
200
|
+
status: 'completed',
|
|
201
|
+
tasks: {
|
|
202
|
+
T1: {
|
|
203
|
+
status: 'implemented_pending_validation',
|
|
204
|
+
implementationStatus: 'implemented',
|
|
205
|
+
verificationStatus: 'not_run',
|
|
206
|
+
validationBatch: null,
|
|
207
|
+
validationTiming: 'task_end',
|
|
208
|
+
requiresVerifyBeforeNext: true,
|
|
209
|
+
gaps: [],
|
|
210
|
+
artifacts: ['.sdd/runs/feature/do/implementation-v2.md']
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
const acceptedTestRef = { kind: 'artifact' as const, ref: '.sdd/runs/feature/test/validation-v2.md', hash: 'validation-v2-hash' };
|
|
215
|
+
const generatedAt = '2026-06-01T00:00:02.000Z';
|
|
216
|
+
await recordRuntimeProjectionEnvelope(root, {
|
|
217
|
+
projectionType: TEST_COLLABORATION_ADJUDICATION_PROJECTION_TYPE,
|
|
218
|
+
scopeKey: testCollaborationScopeKey({ branch: 'feature' }),
|
|
219
|
+
inputHash: 'test-adjudication-v2',
|
|
220
|
+
producer: 'phase9.6-test-stage-collaboration-runtime',
|
|
221
|
+
producerVersion: 'phase9.6-test-stage-collaboration-runtime-v1',
|
|
222
|
+
generatedAt,
|
|
223
|
+
payload: {
|
|
224
|
+
contract: 'phase-9.1-stage-collaboration-runtime-v1',
|
|
225
|
+
adjudicationId: 'test-adjudication-v2',
|
|
226
|
+
stage: 'test',
|
|
227
|
+
scope: { branch: 'feature' },
|
|
228
|
+
health: 'ready_for_goal_verify',
|
|
229
|
+
stageDecision: {
|
|
230
|
+
contract: 'phase-9.1-stage-collaboration-runtime-v1',
|
|
231
|
+
decisionId: 'test-stage-decision-v2',
|
|
232
|
+
stage: 'test',
|
|
233
|
+
scope: { branch: 'feature' },
|
|
234
|
+
status: 'completed',
|
|
235
|
+
health: 'ready_for_goal_verify',
|
|
236
|
+
acceptedDecisionRefs: [acceptedTestRef],
|
|
237
|
+
advisoryRefs: [],
|
|
238
|
+
capabilityRefs: [],
|
|
239
|
+
blockingReasons: [],
|
|
240
|
+
createdAt: generatedAt
|
|
241
|
+
},
|
|
242
|
+
handoffPacket: null,
|
|
243
|
+
rejection: null,
|
|
244
|
+
nextActions: [],
|
|
245
|
+
closureRefs: {
|
|
246
|
+
runRef: { kind: 'run', ref: 'run-post-truth-test' },
|
|
247
|
+
acceptedTestEvidenceRef: acceptedTestRef,
|
|
248
|
+
testAcceptanceStatus: 'accepted',
|
|
249
|
+
testEvidenceHash: 'validation-v2-hash',
|
|
250
|
+
acceptedDoHandoffRef: null,
|
|
251
|
+
artifactRefs: [acceptedTestRef],
|
|
252
|
+
collaborationContractRef: null,
|
|
253
|
+
lifecycleRiskProjectionRef: { kind: 'projection', ref: 'phase8_lifecycle_risk_decision:feature:all:none:none' },
|
|
254
|
+
adjudicationProjectionRef: { kind: 'projection', ref: `${TEST_COLLABORATION_ADJUDICATION_PROJECTION_TYPE}:${testCollaborationScopeKey({ branch: 'feature' })}` },
|
|
255
|
+
stageRunProjectionRef: { kind: 'projection', ref: 'phase8_stage_run:feature:all:run-post-truth-test:none:test' },
|
|
256
|
+
reasons: []
|
|
257
|
+
},
|
|
258
|
+
createdAt: generatedAt
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
const workflow = await resolveWorkflowState(root, { branch: 'feature', taskId: 'T1' });
|
|
263
|
+
|
|
264
|
+
assert.equal(workflow.nextIntent.intent, 'reconcile_truth');
|
|
265
|
+
assert.equal(workflow.nextIntent.bundle, 'test');
|
|
266
|
+
assert.equal(workflow.nextIntent.targetRuntimeStage, 'goal-verify');
|
|
267
|
+
assert.equal(workflow.recommendedNextCommand, 'sdd test close --branch feature --target goal-verify --compact-json');
|
|
268
|
+
assert.equal(workflow.nextIntent.canonicalCommand.includes('sync-back'), false);
|
|
269
|
+
} finally {
|
|
270
|
+
await rm(root, { recursive: true, force: true });
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
test('workflow state maps intra-bundle truth reconciliation to task and test command bundles', async () => {
|
|
275
|
+
const root = await mkdtemp(path.join(tmpdir(), 'sdd-workflow-state-truth-bundles-'));
|
|
276
|
+
try {
|
|
277
|
+
await initProject(root);
|
|
278
|
+
await writeBranchDocs(root, 'feature', validTaskMarkdown('T1', []));
|
|
279
|
+
await recordTruthAlignmentProjection(root, truthAlignmentProjection({
|
|
280
|
+
branch: 'feature',
|
|
281
|
+
status: 'update_required',
|
|
282
|
+
ownerStage: 'verifies',
|
|
283
|
+
semanticImpact: 'none',
|
|
284
|
+
invalidatesStages: ['verifies'],
|
|
285
|
+
staleRefs: [{ kind: 'document', ref: 'specs/feature/verify.md', hash: 'old-verify-hash' }],
|
|
286
|
+
reasons: ['verify contract needs documentation catch-up']
|
|
287
|
+
}));
|
|
288
|
+
|
|
289
|
+
const verifiesWorkflow = await resolveWorkflowState(root, { branch: 'feature' });
|
|
290
|
+
|
|
291
|
+
assert.equal(verifiesWorkflow.nextIntent.bundle, 'tasks');
|
|
292
|
+
assert.equal(verifiesWorkflow.nextIntent.targetRuntimeStage, 'verifies');
|
|
293
|
+
assert.equal(verifiesWorkflow.nextIntent.displayCommand, '/sdd:tasks target=verifies close --branch feature --compact-json');
|
|
294
|
+
assert.equal(verifiesWorkflow.nextIntent.canonicalCommand, 'sdd tasks close --branch feature --target verifies --compact-json');
|
|
295
|
+
|
|
296
|
+
await recordTruthAlignmentProjection(root, truthAlignmentProjection({
|
|
297
|
+
branch: 'feature',
|
|
298
|
+
status: 'drift_detected',
|
|
299
|
+
ownerStage: 'goal-verify',
|
|
300
|
+
semanticImpact: 'bounded',
|
|
301
|
+
invalidatesStages: ['goal-verify'],
|
|
302
|
+
staleRefs: [{ kind: 'projection', ref: 'phase9_12_truth_alignment:feature', hash: 'old-gate-hash' }],
|
|
303
|
+
reasons: ['goal verification gate policy changed']
|
|
304
|
+
}));
|
|
305
|
+
|
|
306
|
+
const goalVerifyWorkflow = await resolveWorkflowState(root, { branch: 'feature' });
|
|
307
|
+
|
|
308
|
+
assert.equal(goalVerifyWorkflow.nextIntent.bundle, 'test');
|
|
309
|
+
assert.equal(goalVerifyWorkflow.nextIntent.targetRuntimeStage, 'goal-verify');
|
|
310
|
+
assert.equal(goalVerifyWorkflow.nextIntent.displayCommand, '/sdd:test target=goal-verify close --branch feature --compact-json');
|
|
311
|
+
assert.equal(goalVerifyWorkflow.nextIntent.canonicalCommand, 'sdd test close --branch feature --target goal-verify --compact-json');
|
|
312
|
+
assert.equal(goalVerifyWorkflow.nextIntent.canonicalCommand.includes('sync-back'), false);
|
|
313
|
+
} finally {
|
|
314
|
+
await rm(root, { recursive: true, force: true });
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
test('workflow state routes stale aligned truthAlignment refs to minimal document reconciliation', async () => {
|
|
319
|
+
const root = await mkdtemp(path.join(tmpdir(), 'sdd-workflow-state-stale-truth-'));
|
|
320
|
+
try {
|
|
321
|
+
await initProject(root);
|
|
322
|
+
await writeBranchDocs(root, 'feature', validTaskMarkdown('T1', []));
|
|
323
|
+
const specPath = path.join(root, 'specs', 'feature', 'spec.md');
|
|
324
|
+
const tasksPath = path.join(root, 'specs', 'feature', 'tasks.md');
|
|
325
|
+
const specHash = hashTestDocument(await readFile(specPath, 'utf8'));
|
|
326
|
+
const tasksHash = hashTestDocument(await readFile(tasksPath, 'utf8'));
|
|
327
|
+
await recordTruthAlignmentProjection(root, {
|
|
328
|
+
contract: 'sdd-truth-alignment-v1',
|
|
329
|
+
branch: 'feature',
|
|
330
|
+
sourceStage: 'goal-verify',
|
|
331
|
+
declaredTruthRefs: [
|
|
332
|
+
{ kind: 'document', ref: 'specs/feature/spec.md', hash: specHash },
|
|
333
|
+
{ kind: 'document', ref: 'specs/feature/tasks.md', hash: tasksHash }
|
|
334
|
+
],
|
|
335
|
+
acceptedRealityRefs: [{ kind: 'artifact', ref: '.sdd/runs/feature/goal-verify/goal-verification-v1.md' }],
|
|
336
|
+
status: 'aligned',
|
|
337
|
+
ownerStage: null,
|
|
338
|
+
semanticImpact: 'none',
|
|
339
|
+
staleRefs: [],
|
|
340
|
+
invalidatesStages: [],
|
|
341
|
+
reasons: ['Accepted goal verification is structurally aligned with declared upstream truth refs.'],
|
|
342
|
+
createdAt: '2026-06-01T00:00:00.000Z'
|
|
343
|
+
});
|
|
344
|
+
await writeFile(tasksPath, `${await readFile(tasksPath, 'utf8')}\nAdditional documentation-only acceptance clarification.\n`, 'utf8');
|
|
345
|
+
|
|
346
|
+
const workflow = await resolveWorkflowState(root, { branch: 'feature' });
|
|
347
|
+
|
|
348
|
+
assert.equal(workflow.nextIntent.intent, 'reconcile_truth');
|
|
349
|
+
assert.equal(workflow.nextIntent.bundle, 'tasks');
|
|
350
|
+
assert.equal(workflow.nextIntent.targetRuntimeStage, 'tasks');
|
|
351
|
+
assert.equal(workflow.recommendedNextCommand, 'sdd tasks close --branch feature --compact-json');
|
|
352
|
+
assert.equal(workflow.truthReconciliation?.changeKind, 'documentation_catchup');
|
|
353
|
+
assert.equal(workflow.truthReconciliation?.semanticImpact, 'none');
|
|
354
|
+
assert.deepEqual(workflow.truthReconciliation?.minimalFrontier, ['tasks']);
|
|
355
|
+
assert.equal(workflow.truthReconciliation?.changedRef.ref, 'specs/feature/tasks.md');
|
|
356
|
+
assert.equal(workflow.truthReconciliation?.oldHash, tasksHash);
|
|
357
|
+
assert.notEqual(workflow.truthReconciliation?.newHash, tasksHash);
|
|
358
|
+
assert.equal(workflow.nextIntent.canonicalCommand.includes('sync-back'), false);
|
|
359
|
+
} finally {
|
|
360
|
+
await rm(root, { recursive: true, force: true });
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
test('workflow state skips document truth refs already accepted by stage close', async () => {
|
|
365
|
+
const root = await mkdtemp(path.join(tmpdir(), 'sdd-workflow-state-stale-truth-close-'));
|
|
366
|
+
try {
|
|
367
|
+
await initProject(root);
|
|
368
|
+
await writeBranchDocs(root, 'feature', validTaskMarkdown('T1', []));
|
|
369
|
+
const specPath = path.join(root, 'specs', 'feature', 'spec.md');
|
|
370
|
+
const tasksPath = path.join(root, 'specs', 'feature', 'tasks.md');
|
|
371
|
+
const originalSpecHash = hashTestDocument(await readFile(specPath, 'utf8'));
|
|
372
|
+
const originalTasksHash = hashTestDocument(await readFile(tasksPath, 'utf8'));
|
|
373
|
+
await recordTruthAlignmentProjection(root, {
|
|
374
|
+
contract: 'sdd-truth-alignment-v1',
|
|
375
|
+
branch: 'feature',
|
|
376
|
+
sourceStage: 'goal-verify',
|
|
377
|
+
declaredTruthRefs: [
|
|
378
|
+
{ kind: 'document', ref: 'specs/feature/spec.md', hash: originalSpecHash },
|
|
379
|
+
{ kind: 'document', ref: 'specs/feature/tasks.md', hash: originalTasksHash }
|
|
380
|
+
],
|
|
381
|
+
acceptedRealityRefs: [{ kind: 'artifact', ref: '.sdd/runs/feature/goal-verify/goal-verification-v1.md' }],
|
|
382
|
+
status: 'aligned',
|
|
383
|
+
ownerStage: null,
|
|
384
|
+
semanticImpact: 'none',
|
|
385
|
+
staleRefs: [],
|
|
386
|
+
invalidatesStages: [],
|
|
387
|
+
reasons: ['Accepted goal verification is structurally aligned with declared upstream truth refs.'],
|
|
388
|
+
createdAt: '2026-06-01T00:00:00.000Z'
|
|
389
|
+
});
|
|
390
|
+
await writeFile(specPath, `${await readFile(specPath, 'utf8')}\nSpec documentation-only correction.\n`, 'utf8');
|
|
391
|
+
await writeFile(tasksPath, `${await readFile(tasksPath, 'utf8')}\nTasks documentation-only correction.\n`, 'utf8');
|
|
392
|
+
const currentSpecHash = hashTestDocument(await readFile(specPath, 'utf8'));
|
|
393
|
+
const currentTasksHash = hashTestDocument(await readFile(tasksPath, 'utf8'));
|
|
394
|
+
const acceptedSpecRef = { kind: 'document' as const, ref: 'specs/feature/spec.md', hash: currentSpecHash };
|
|
395
|
+
const generatedAt = '2026-06-01T00:00:02.000Z';
|
|
396
|
+
await recordRuntimeProjectionEnvelope(root, {
|
|
397
|
+
projectionType: SPEC_COLLABORATION_ADJUDICATION_PROJECTION_TYPE,
|
|
398
|
+
scopeKey: specCollaborationScopeKey({ branch: 'feature' }),
|
|
399
|
+
inputHash: 'spec-adjudication-v2',
|
|
400
|
+
producer: 'phase9.1-spec-stage-collaboration-runtime',
|
|
401
|
+
producerVersion: 'phase9.1-spec-stage-collaboration-runtime-v1',
|
|
402
|
+
generatedAt,
|
|
403
|
+
payload: {
|
|
404
|
+
contract: 'phase-9.1-stage-collaboration-runtime-v1',
|
|
405
|
+
adjudicationId: 'spec-adjudication-v2',
|
|
406
|
+
stage: 'spec',
|
|
407
|
+
scope: { branch: 'feature' },
|
|
408
|
+
health: 'ready_for_plan',
|
|
409
|
+
stageDecision: {
|
|
410
|
+
contract: 'phase-9.1-stage-collaboration-runtime-v1',
|
|
411
|
+
decisionId: 'spec-stage-decision-v2',
|
|
412
|
+
stage: 'spec',
|
|
413
|
+
scope: { branch: 'feature' },
|
|
414
|
+
status: 'completed',
|
|
415
|
+
health: 'ready_for_plan',
|
|
416
|
+
acceptedDecisionRefs: [acceptedSpecRef],
|
|
417
|
+
advisoryRefs: [],
|
|
418
|
+
capabilityRefs: [],
|
|
419
|
+
blockingReasons: [],
|
|
420
|
+
createdAt: generatedAt
|
|
421
|
+
},
|
|
422
|
+
handoffPacket: null,
|
|
423
|
+
rejection: null,
|
|
424
|
+
nextActions: [],
|
|
425
|
+
closureRefs: {
|
|
426
|
+
acceptedSpecRef,
|
|
427
|
+
specHash: currentSpecHash,
|
|
428
|
+
reasons: []
|
|
429
|
+
},
|
|
430
|
+
createdAt: generatedAt
|
|
431
|
+
}
|
|
432
|
+
});
|
|
433
|
+
|
|
434
|
+
const workflow = await resolveWorkflowState(root, { branch: 'feature' });
|
|
435
|
+
|
|
436
|
+
assert.equal(workflow.nextIntent.intent, 'reconcile_truth');
|
|
437
|
+
assert.equal(workflow.nextIntent.bundle, 'tasks');
|
|
438
|
+
assert.equal(workflow.nextIntent.targetRuntimeStage, 'tasks');
|
|
439
|
+
assert.equal(workflow.recommendedNextCommand, 'sdd tasks close --branch feature --compact-json');
|
|
440
|
+
assert.equal(workflow.truthReconciliation?.changedRef.ref, 'specs/feature/tasks.md');
|
|
441
|
+
assert.equal(workflow.truthReconciliation?.oldHash, originalTasksHash);
|
|
442
|
+
assert.equal(workflow.truthReconciliation?.newHash, currentTasksHash);
|
|
443
|
+
assert.equal(workflow.truthReconciliation?.reasons.some((reason) => reason.includes('specs/feature/spec.md')), false);
|
|
444
|
+
} finally {
|
|
445
|
+
await rm(root, { recursive: true, force: true });
|
|
446
|
+
}
|
|
447
|
+
});
|
|
448
|
+
|
|
449
|
+
test('workflow state routes open repairs before repeating do or validation', async () => {
|
|
450
|
+
const root = await mkdtemp(path.join(tmpdir(), 'sdd-workflow-state-repair-'));
|
|
451
|
+
try {
|
|
452
|
+
await initProject(root);
|
|
453
|
+
await writeBranchDocs(root, 'feature', validTaskMarkdown('T1', []));
|
|
454
|
+
await recordRuntimeRepair(root, buildOpenRepairRecord({
|
|
455
|
+
branchSlug: 'feature',
|
|
456
|
+
taskId: 'T1',
|
|
457
|
+
message: 'validation command is not directly executable: manual: inspect service',
|
|
458
|
+
recommendedCommands: ['sdd doctor --branch feature --latest-only']
|
|
459
|
+
}));
|
|
460
|
+
|
|
461
|
+
const workflow = await resolveWorkflowState(root, { branch: 'feature', taskId: 'T1' });
|
|
462
|
+
|
|
463
|
+
assert.equal(workflow.openRepairs.length, 1);
|
|
464
|
+
assert.equal(workflow.nextIntent.intent, 'repair_failure');
|
|
465
|
+
assert.equal(workflow.recommendedNextCommand, 'sdd doctor --branch feature --latest-only');
|
|
466
|
+
assert.equal(workflow.blockingReasons.some((reason) => reason.includes('not directly executable')), true);
|
|
467
|
+
} finally {
|
|
468
|
+
await rm(root, { recursive: true, force: true });
|
|
469
|
+
}
|
|
470
|
+
});
|
|
471
|
+
|
|
472
|
+
test('workflow state strict stale rejection names tasks contract drift', async () => {
|
|
473
|
+
const root = await mkdtemp(path.join(tmpdir(), 'sdd-workflow-state-stale-dimension-'));
|
|
474
|
+
try {
|
|
475
|
+
await initProject(root);
|
|
476
|
+
const originalTasks = validTaskMarkdown('T1', []);
|
|
477
|
+
await writeBranchDocs(root, 'feature', originalTasks);
|
|
478
|
+
const run = await createRun(root, { runId: 'run-stale-contract' });
|
|
479
|
+
await bindTestRunState(root, run.runId, 'feature', 'T1');
|
|
480
|
+
await markTestRunReadyForShip(root, run.runId, 'T1');
|
|
481
|
+
await writeBranchDocs(root, 'feature', originalTasks.replace('risk: []', 'required_artifacts:\n - artifacts/implement-T1.md\nrisk: []'));
|
|
482
|
+
|
|
483
|
+
const workflow = await resolveWorkflowState(root, { branch: 'feature', taskId: 'T1' });
|
|
484
|
+
const rejected = workflow.latestEligibleRunsByTask.find((selection) => selection.taskId === 'T1')?.rejected.find((candidate) => candidate.runId === 'run-stale-contract');
|
|
485
|
+
|
|
486
|
+
assert.equal(workflow.latestRun, null);
|
|
487
|
+
assert.equal(rejected?.compatibility, 'strict_stale');
|
|
488
|
+
assert.equal(rejected?.reasons.some((reason) => reason.includes('tasks contract hash drift')), true);
|
|
489
|
+
} finally {
|
|
490
|
+
await rm(root, { recursive: true, force: true });
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
test('workflow state does not route to ship until every required task has PASS evidence', async () => {
|
|
496
|
+
const root = await mkdtemp(path.join(tmpdir(), 'sdd-workflow-state-readiness-'));
|
|
497
|
+
try {
|
|
498
|
+
await initProject(root);
|
|
499
|
+
await writeBranchDocs(root, 'feature', `# Tasks\n\n${validTaskMarkdown('T1', []).replace('packages/core/src/index.ts', 'docs/t1.md')}\n${validTaskMarkdown('T2', []).replace('T1', 'T2').replace('packages/core/src/index.ts', 'docs/t2.md')}`);
|
|
500
|
+
const run = await createRun(root, { runId: 'run-t1-pass' });
|
|
501
|
+
await bindTestRunState(root, run.runId, 'feature', 'T1');
|
|
502
|
+
await markTestRunReadyForShip(root, run.runId, 'T1');
|
|
503
|
+
|
|
504
|
+
const workflow = await resolveWorkflowState(root, { branch: 'feature', taskId: 'T1' });
|
|
505
|
+
|
|
506
|
+
assert.equal(workflow.nextIntent.stage, 'do');
|
|
507
|
+
assert.equal(workflow.recommendedNextCommand, 'sdd do task T2 --branch feature');
|
|
508
|
+
assert.deepEqual(workflow.workflowReadiness.requiredTaskIds, ['T1', 'T2']);
|
|
509
|
+
assert.deepEqual(workflow.workflowReadiness.acceptedTaskIds, ['T1']);
|
|
510
|
+
assert.deepEqual(workflow.workflowReadiness.missingTaskIds, ['T2']);
|
|
511
|
+
assert.equal(workflow.workflowReadiness.readyForShip, false);
|
|
512
|
+
assert.deepEqual(workflow.whyNotShip, ['Task T2 has no accepted validation PASS evidence.']);
|
|
67
513
|
} finally {
|
|
68
514
|
await rm(root, { recursive: true, force: true });
|
|
69
515
|
}
|
|
@@ -76,7 +522,7 @@ test('workflow state resolver reports affected-file conflicts without run-index
|
|
|
76
522
|
await writeBranchDocs(root, 'feature', `${validTaskMarkdown('T1', []).replace('packages/core/src/index.ts', 'src/shared.ts')}\n${validTaskMarkdown('T2', []).replace('T1', 'T2').replace('packages/core/src/index.ts', 'src/shared.ts')}`);
|
|
77
523
|
const runA = await createRun(root, { runId: 'run-a' });
|
|
78
524
|
await bindTestRunState(root, runA.runId, 'feature', 'T1');
|
|
79
|
-
await
|
|
525
|
+
await markTestRunReadyForShip(root, runA.runId, 'T1');
|
|
80
526
|
const runB = await createRun(root, { runId: 'run-b' });
|
|
81
527
|
await bindTestRunState(root, runB.runId, 'feature', 'T2');
|
|
82
528
|
const archived = await createRun(root, { runId: 'run-c' });
|
|
@@ -122,7 +568,7 @@ test('workflow state ignores superseded failed and foreground observer conflict
|
|
|
122
568
|
});
|
|
123
569
|
const retry = await createRun(root, { runId: 'run-retry' });
|
|
124
570
|
await bindTestRunState(root, retry.runId, 'feature', 'T1');
|
|
125
|
-
await
|
|
571
|
+
await markTestRunReadyForShip(root, retry.runId, 'T1');
|
|
126
572
|
|
|
127
573
|
const workflow = await resolveWorkflowState(root, { branch: 'feature', taskId: 'T1' });
|
|
128
574
|
|
|
@@ -227,7 +673,7 @@ ${validTaskMarkdown('DEP2', ['DEP1']).replace('packages/core/src/index.ts', 'doc
|
|
|
227
673
|
|
|
228
674
|
assert.deepEqual(workflow.dependencyBlockers.map((blocker) => `${blocker.taskId}->${blocker.dependencyId}`), ['DEP2->DEP1']);
|
|
229
675
|
assert.equal(workflow.blockingReasons.some((reason) => reason.includes('has not passed required verification')), true);
|
|
230
|
-
assert.equal(workflow.recommendedNextCommand, 'sdd test task
|
|
676
|
+
assert.equal(workflow.recommendedNextCommand, 'sdd test task-DEP1 --branch feature');
|
|
231
677
|
} finally {
|
|
232
678
|
await rm(root, { recursive: true, force: true });
|
|
233
679
|
}
|
|
@@ -241,17 +687,18 @@ test('latest eligible selector prefers older compatible evidence over newer stri
|
|
|
241
687
|
await writeBranchDocs(root, 'feature', validTaskMarkdown('T1', []));
|
|
242
688
|
const compatible = await createRun(root, { runId: 'run-compatible' });
|
|
243
689
|
await bindTestRunState(root, compatible.runId, 'feature', 'T1');
|
|
244
|
-
await
|
|
690
|
+
await markTestRunReadyForShip(root, compatible.runId, 'T1');
|
|
245
691
|
|
|
246
692
|
const strictStale = await createRun(root, { runId: 'run-strict-stale' });
|
|
247
693
|
await bindTestRunState(root, strictStale.runId, 'feature', 'T1');
|
|
248
|
-
await
|
|
694
|
+
await markTestRunReadyForShip(root, strictStale.runId, 'T1');
|
|
249
695
|
const strictStaleState = await readRunState(root, strictStale.runId);
|
|
250
696
|
await writeRunState(root, {
|
|
251
697
|
...strictStaleState,
|
|
252
698
|
documentSnapshot: {
|
|
253
699
|
...strictStaleState.documentSnapshot,
|
|
254
|
-
tasksContractHash: 'stale-tasks-contract-hash'
|
|
700
|
+
tasksContractHash: 'stale-tasks-contract-hash',
|
|
701
|
+
taskContractHash: 'stale-task-contract-hash',
|
|
255
702
|
}
|
|
256
703
|
});
|
|
257
704
|
|
|
@@ -267,6 +714,29 @@ test('latest eligible selector prefers older compatible evidence over newer stri
|
|
|
267
714
|
}
|
|
268
715
|
});
|
|
269
716
|
|
|
717
|
+
test('latest eligible selector keeps task-local evidence when another task changes', async () => {
|
|
718
|
+
const root = await mkdtemp(path.join(tmpdir(), 'sdd-workflow-state-task-local-eligible-'));
|
|
719
|
+
try {
|
|
720
|
+
await initProject(root);
|
|
721
|
+
const task1 = validTaskMarkdown('T1', []).replace('packages/core/src/index.ts', 'docs/t1.md');
|
|
722
|
+
const task2 = validTaskMarkdown('T2', []).replace('T1', 'T2').replace('packages/core/src/index.ts', 'docs/t2.md');
|
|
723
|
+
await writeBranchDocs(root, 'feature', `# Tasks\n\n${task1}\n${task2}`);
|
|
724
|
+
const run = await createRun(root, { runId: 'run-t1-compatible' });
|
|
725
|
+
await bindTestRunState(root, run.runId, 'feature', 'T1');
|
|
726
|
+
await markTestRunReadyForShip(root, run.runId, 'T1');
|
|
727
|
+
await writeBranchDocs(root, 'feature', `# Tasks\n\n${task1}\n${task2.replace('risk: []', 'risk:\n - security')}`);
|
|
728
|
+
|
|
729
|
+
const workflow = await resolveWorkflowState(root, { branch: 'feature', taskId: 'T1' });
|
|
730
|
+
const selection = workflow.latestEligibleRunsByTask.find((entry) => entry.taskId === 'T1');
|
|
731
|
+
|
|
732
|
+
assert.equal(workflow.latestRun?.runId, 'run-t1-compatible');
|
|
733
|
+
assert.equal(selection?.selected?.runId, 'run-t1-compatible');
|
|
734
|
+
assert.deepEqual(selection?.rejected.map((entry) => entry.runId), []);
|
|
735
|
+
} finally {
|
|
736
|
+
await rm(root, { recursive: true, force: true });
|
|
737
|
+
}
|
|
738
|
+
});
|
|
739
|
+
|
|
270
740
|
test('latest eligible selector rejects newer blocked runs and keeps older completed evidence eligible', async () => {
|
|
271
741
|
const root = await mkdtemp(path.join(tmpdir(), 'sdd-workflow-state-blocked-eligible-'));
|
|
272
742
|
try {
|
|
@@ -274,11 +744,11 @@ test('latest eligible selector rejects newer blocked runs and keeps older comple
|
|
|
274
744
|
await writeBranchDocs(root, 'feature', validTaskMarkdown('T1', []));
|
|
275
745
|
const completed = await createRun(root, { runId: 'run-completed' });
|
|
276
746
|
await bindTestRunState(root, completed.runId, 'feature', 'T1');
|
|
277
|
-
await
|
|
747
|
+
await markTestRunReadyForShip(root, completed.runId, 'T1');
|
|
278
748
|
|
|
279
749
|
const blocked = await createRun(root, { runId: 'run-blocked' });
|
|
280
750
|
await bindTestRunState(root, blocked.runId, 'feature', 'T1');
|
|
281
|
-
await
|
|
751
|
+
await markTestRunReadyForShip(root, blocked.runId, 'T1');
|
|
282
752
|
await writeRunState(root, { ...await readRunState(root, blocked.runId), status: 'blocked' });
|
|
283
753
|
|
|
284
754
|
const workflow = await resolveWorkflowState(root, { branch: 'feature', taskId: 'T1' });
|
|
@@ -357,7 +827,7 @@ test('workflow state uses explicit partition runtime despite divergent git branc
|
|
|
357
827
|
assert.equal(selection?.selected?.runId, 'run-divergent');
|
|
358
828
|
assert.deepEqual(selection?.rejected.map((entry) => entry.runId), []);
|
|
359
829
|
assert.equal(workflow.nextIntent.intent, 'run_task_validation');
|
|
360
|
-
assert.equal(workflow.recommendedNextCommand, 'sdd test task
|
|
830
|
+
assert.equal(workflow.recommendedNextCommand, 'sdd test task-T1 --branch feature');
|
|
361
831
|
} finally {
|
|
362
832
|
await rm(root, { recursive: true, force: true });
|
|
363
833
|
}
|
|
@@ -396,7 +866,7 @@ ${validTaskMarkdown('W1', [])
|
|
|
396
866
|
const workflow = await resolveWorkflowState(root, { branch: 'feature', taskId: 'W1' });
|
|
397
867
|
|
|
398
868
|
assert.equal(workflow.nextIntent.intent, 'run_wave_validation');
|
|
399
|
-
assert.equal(workflow.recommendedNextCommand, 'sdd test wave --branch feature
|
|
869
|
+
assert.equal(workflow.recommendedNextCommand, 'sdd test docs-wave --branch feature');
|
|
400
870
|
} finally {
|
|
401
871
|
await rm(root, { recursive: true, force: true });
|
|
402
872
|
}
|
|
@@ -457,8 +927,31 @@ ${validTaskMarkdown('DEP2', ['DEP1']).replace('packages/core/src/index.ts', 'doc
|
|
|
457
927
|
const workflow = await resolveWorkflowState(root, { branch: 'feature', taskId: 'DEP2' });
|
|
458
928
|
|
|
459
929
|
assert.deepEqual(workflow.dependencyBlockers, []);
|
|
460
|
-
assert.equal(workflow.recommendedNextCommand, 'sdd test
|
|
930
|
+
assert.equal(workflow.recommendedNextCommand, 'sdd test dep-batch --branch feature');
|
|
461
931
|
} finally {
|
|
462
932
|
await rm(root, { recursive: true, force: true });
|
|
463
933
|
}
|
|
464
|
-
});
|
|
934
|
+
});
|
|
935
|
+
|
|
936
|
+
function truthAlignmentProjection(input: Pick<TruthAlignmentProjection, 'branch' | 'status' | 'ownerStage' | 'semanticImpact' | 'invalidatesStages' | 'staleRefs' | 'reasons'> & { createdAt?: string }): TruthAlignmentProjection {
|
|
937
|
+
return {
|
|
938
|
+
contract: 'sdd-truth-alignment-v1',
|
|
939
|
+
branch: input.branch,
|
|
940
|
+
sourceStage: 'goal-verify',
|
|
941
|
+
declaredTruthRefs: [
|
|
942
|
+
{ kind: 'document', ref: `specs/${input.branch}/spec.md`, hash: 'spec-hash' },
|
|
943
|
+
{ kind: 'document', ref: `specs/${input.branch}/tasks.md`, hash: 'tasks-hash' }
|
|
944
|
+
],
|
|
945
|
+
acceptedRealityRefs: [
|
|
946
|
+
{ kind: 'artifact', ref: `.sdd/runs/${input.branch}/goal-verify/goal-verification-v1.md`, hash: 'goal-hash' },
|
|
947
|
+
{ kind: 'artifact', ref: `.sdd/runs/${input.branch}/do/implementation-v1.md`, hash: 'implementation-hash' }
|
|
948
|
+
],
|
|
949
|
+
status: input.status,
|
|
950
|
+
ownerStage: input.ownerStage,
|
|
951
|
+
semanticImpact: input.semanticImpact,
|
|
952
|
+
staleRefs: input.staleRefs,
|
|
953
|
+
invalidatesStages: input.invalidatesStages,
|
|
954
|
+
reasons: input.reasons,
|
|
955
|
+
createdAt: input.createdAt ?? '2026-06-01T00:00:00.000Z'
|
|
956
|
+
};
|
|
957
|
+
}
|