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
|
@@ -27,11 +27,12 @@ export function synthesizeWorkflowGateDecision(packet: WorkflowGateEvidencePacke
|
|
|
27
27
|
forbiddenNextActions,
|
|
28
28
|
humanRequired,
|
|
29
29
|
reasons: decisionReasons(status, hardBlocks, warnings, advisorSummary),
|
|
30
|
-
evidenceRefs: sortedUnique(
|
|
30
|
+
evidenceRefs: sortedUnique(selectedEvidenceRefs(packet)),
|
|
31
31
|
payload: {
|
|
32
32
|
contract: WORKFLOW_GATE_RUNTIME_CONTRACT_VERSION,
|
|
33
33
|
packetId: packet.packetId,
|
|
34
|
-
workflowScope: packet.workflowScope
|
|
34
|
+
workflowScope: packet.workflowScope,
|
|
35
|
+
evidenceBinding: gateEvidenceBinding(packet)
|
|
35
36
|
}
|
|
36
37
|
};
|
|
37
38
|
}
|
|
@@ -65,10 +66,14 @@ export function inputHash(packet: WorkflowGateEvidencePacket): string {
|
|
|
65
66
|
durableGaps: packet.durableGaps,
|
|
66
67
|
dependencyBlockers: packet.dependencyBlockers,
|
|
67
68
|
affectedFileConflicts: packet.affectedFileConflicts,
|
|
68
|
-
syncBackDecision: packet.syncBackDecision,
|
|
69
|
-
syncBackDecisions: packet.syncBackDecisions,
|
|
70
69
|
fanInEvidenceSets: packet.fanInEvidenceSets,
|
|
71
70
|
advisorAssessments: packet.advisorAssessments,
|
|
71
|
+
selectedEvidence: {
|
|
72
|
+
source: packet.selectedEvidence.source,
|
|
73
|
+
evidenceSetId: packet.selectedEvidence.evidenceSet?.evidenceSetId ?? null,
|
|
74
|
+
selectedEvidenceSetId: packet.selectedEvidence.pointer?.selectedEvidenceSetId ?? null,
|
|
75
|
+
payloads: packet.selectedEvidence.payloads.map((payload) => ({ payloadId: payload.payloadId, logicalRef: payload.logicalRef, digest: payload.digest, status: payload.status }))
|
|
76
|
+
},
|
|
72
77
|
canonicalEvidenceRefs: packet.canonicalEvidenceRefs,
|
|
73
78
|
requiredArtifactRefs: packet.requiredArtifactRefs,
|
|
74
79
|
artifactPayloadHealth: packet.artifactPayloadHealth,
|
|
@@ -113,7 +118,7 @@ function allowedActions(status: WorkflowGateStatus, packet: WorkflowGateEvidence
|
|
|
113
118
|
|
|
114
119
|
function forbiddenActions(status: WorkflowGateStatus, packet: WorkflowGateEvidencePacket): string[] {
|
|
115
120
|
if (status === 'BLOCKED') {
|
|
116
|
-
return ['ship', '
|
|
121
|
+
return ['ship', 'truth-alignment-approval', 'mark-task-complete', 'stage-pass'];
|
|
117
122
|
}
|
|
118
123
|
if (status === 'HUMAN_REQUIRED') {
|
|
119
124
|
return ['satisfy-with-role-result', 'satisfy-with-subagent-output'];
|
|
@@ -121,7 +126,7 @@ function forbiddenActions(status: WorkflowGateStatus, packet: WorkflowGateEviden
|
|
|
121
126
|
if (status === 'ADVISORY_ONLY') {
|
|
122
127
|
return ['treat-advisor-as-pass'];
|
|
123
128
|
}
|
|
124
|
-
return status === 'WARN' ? ['ship', '
|
|
129
|
+
return status === 'WARN' ? ['ship', 'truth-alignment-approval', 'mark-task-complete', 'stage-pass'] : packet.decisionKind === 'ship' ? [] : ['skip-evidence-recording'];
|
|
125
130
|
}
|
|
126
131
|
|
|
127
132
|
function decisionReasons(status: WorkflowGateStatus, hardBlocks: WorkflowGateHardCheck[], warnings: WorkflowGateHardCheck[], advisorSummary: WorkflowGateAdvisorSummary): string[] {
|
|
@@ -140,6 +145,40 @@ function decisionReasons(status: WorkflowGateStatus, hardBlocks: WorkflowGateHar
|
|
|
140
145
|
return [`runtime_policy produced ${status}`];
|
|
141
146
|
}
|
|
142
147
|
|
|
148
|
+
function selectedEvidenceRefs(packet: WorkflowGateEvidencePacket): string[] {
|
|
149
|
+
return packet.selectedEvidence.payloads.map((payload) => payload.logicalRef);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function gateEvidenceBinding(packet: WorkflowGateEvidencePacket): Record<string, unknown> {
|
|
153
|
+
const selectedRefs = packet.selectedEvidence.payloads.map((payload) => ({
|
|
154
|
+
payloadId: payload.payloadId,
|
|
155
|
+
logicalRef: payload.logicalRef,
|
|
156
|
+
digest: payload.digest,
|
|
157
|
+
status: payload.status
|
|
158
|
+
}));
|
|
159
|
+
return {
|
|
160
|
+
contract: 'sdd-gate-evidence-binding-v1',
|
|
161
|
+
branch: packet.partition,
|
|
162
|
+
gate: packet.decisionKind,
|
|
163
|
+
selectionPointerRef: packet.selectedEvidence.pointer ? `selection:${packet.selectedEvidence.pointer.scopeKind}:${packet.selectedEvidence.pointer.scopeId}` : null,
|
|
164
|
+
acceptedEvidenceSetRef: packet.selectedEvidence.evidenceSet?.evidenceSetId ?? null,
|
|
165
|
+
source: packet.selectedEvidence.source,
|
|
166
|
+
selectedRefs,
|
|
167
|
+
blockedRefs: packet.hardChecks.flatMap((check) => check.refs),
|
|
168
|
+
selectionReasons: sortedUnique([packet.selectedEvidence.pointer?.reason ?? '', ...evidenceSetSelectionReasons(packet.selectedEvidence.evidenceSet?.payload)]),
|
|
169
|
+
decision: packet.hardChecks.some((check) => check.severity === 'blocked') ? 'blocked' : 'pass',
|
|
170
|
+
reasons: packet.hardChecks.map((check) => `${check.code}: ${check.message}`)
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function evidenceSetSelectionReasons(payload: unknown): string[] {
|
|
175
|
+
if (!payload || typeof payload !== 'object') {
|
|
176
|
+
return [];
|
|
177
|
+
}
|
|
178
|
+
const reasons = (payload as { selectionReasons?: unknown }).selectionReasons;
|
|
179
|
+
return Array.isArray(reasons) ? reasons.filter((reason): reason is string => typeof reason === 'string') : [];
|
|
180
|
+
}
|
|
181
|
+
|
|
143
182
|
function sortedUnique(values: string[]): string[] {
|
|
144
183
|
return [...new Set(values.filter(Boolean))].sort();
|
|
145
184
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FanInEvidenceSetRecord, LlmAdvisorAssessmentRecord } from '../execution/stage-team-runtime.js';
|
|
2
|
-
import type { RuntimeDurableGapRecord,
|
|
2
|
+
import type { RuntimeDurableGapRecord, RuntimeResolvedEvidenceSelection } from '../storage/runtime-store.js';
|
|
3
3
|
import type { LatestEligibleRunSelection } from '../workflow-state/latest-eligible-run.js';
|
|
4
4
|
import type { WorkflowDependencyBlocker } from '../workflow-state/dependencies.js';
|
|
5
5
|
import type { WorkflowAffectedFileConflict } from '../workflow-state/affected-file-conflicts.js';
|
|
@@ -8,7 +8,7 @@ import type { SddTaskModel } from '../sdd-docs/task-parser.js';
|
|
|
8
8
|
export type WorkflowGateStatus = 'PASS' | 'WARN' | 'BLOCKED' | 'HUMAN_REQUIRED' | 'ADVISORY_ONLY';
|
|
9
9
|
export type WorkflowGateHardCheckSeverity = 'info' | 'warning' | 'blocked';
|
|
10
10
|
export type WorkflowGateAdvisorSummaryStatus = 'none' | 'low_concern' | 'medium_concern' | 'high_concern' | 'invalid';
|
|
11
|
-
export type WorkflowGateDecisionKind = 'test' | 'validation_wave' | 'review_gate' | '
|
|
11
|
+
export type WorkflowGateDecisionKind = 'test' | 'validation_wave' | 'review_gate' | 'ship' | 'stage_transition';
|
|
12
12
|
|
|
13
13
|
export type WorkflowGateHardCheckCode =
|
|
14
14
|
| 'schema_health_unavailable'
|
|
@@ -21,10 +21,12 @@ export type WorkflowGateHardCheckCode =
|
|
|
21
21
|
| 'missing_payload'
|
|
22
22
|
| 'digest_drift'
|
|
23
23
|
| 'missing_required_artifact'
|
|
24
|
+
| 'missing_evidence_selection'
|
|
25
|
+
| 'non_consumable_evidence'
|
|
26
|
+
| 'non_primary_evidence'
|
|
24
27
|
| 'validation_failure'
|
|
25
28
|
| 'dependency_blocker'
|
|
26
29
|
| 'authority_violation'
|
|
27
|
-
| 'sync_back_divergence'
|
|
28
30
|
| 'affected_file_conflict'
|
|
29
31
|
| 'durable_gap_blocking';
|
|
30
32
|
|
|
@@ -73,10 +75,9 @@ export interface WorkflowGateEvidencePacket {
|
|
|
73
75
|
durableGaps: RuntimeDurableGapRecord[];
|
|
74
76
|
dependencyBlockers: WorkflowDependencyBlocker[];
|
|
75
77
|
affectedFileConflicts: WorkflowAffectedFileConflict[];
|
|
76
|
-
syncBackDecision: RuntimeSyncBackDecisionRecord | null;
|
|
77
|
-
syncBackDecisions: RuntimeSyncBackDecisionRecord[];
|
|
78
78
|
fanInEvidenceSets: FanInEvidenceSetRecord[];
|
|
79
79
|
advisorAssessments: LlmAdvisorAssessmentRecord[];
|
|
80
|
+
selectedEvidence: RuntimeResolvedEvidenceSelection;
|
|
80
81
|
canonicalEvidenceRefs: string[];
|
|
81
82
|
requiredArtifactRefs: string[];
|
|
82
83
|
artifactPayloadHealth: WorkflowGateArtifactPayloadHealth[];
|
|
@@ -7,7 +7,6 @@ export interface WorkflowAffectedFileConflict {
|
|
|
7
7
|
taskId: string;
|
|
8
8
|
runId: string;
|
|
9
9
|
runStatus: RunState['status'];
|
|
10
|
-
syncBackStatus: RunState['syncBack']['status'];
|
|
11
10
|
updatedAt: string;
|
|
12
11
|
}
|
|
13
12
|
|
|
@@ -31,7 +30,6 @@ export function affectedFileConflictsForSelectedRun(states: RunState[], selected
|
|
|
31
30
|
taskId: state.taskId,
|
|
32
31
|
runId: state.runId,
|
|
33
32
|
runStatus: state.status,
|
|
34
|
-
syncBackStatus: state.syncBack.status,
|
|
35
33
|
updatedAt: state.updatedAt
|
|
36
34
|
});
|
|
37
35
|
}
|
|
@@ -71,7 +69,7 @@ function selectedSupersedesCandidate(selected: RunState, candidate: RunState): b
|
|
|
71
69
|
selected.status === 'completed' &&
|
|
72
70
|
selected.validation.status === 'pass' &&
|
|
73
71
|
Date.parse(selected.updatedAt) > Date.parse(candidate.updatedAt) &&
|
|
74
|
-
(candidate.status === 'failed' || candidate.status === 'blocked' || candidate.validation.status === 'fail' || candidate.validation.status === 'blocked'
|
|
72
|
+
(candidate.status === 'failed' || candidate.status === 'blocked' || candidate.validation.status === 'fail' || candidate.validation.status === 'blocked')
|
|
75
73
|
);
|
|
76
74
|
}
|
|
77
75
|
|
|
@@ -93,7 +93,7 @@ function dependencyReadinessEntry(taskId: string, dependencyId: string, dependen
|
|
|
93
93
|
status: dependency.status,
|
|
94
94
|
ready: false,
|
|
95
95
|
reason: dependencyRequiresVerifiedBoundary(dependency)
|
|
96
|
-
? `Task ${taskId} depends on ${dependency.id}, but ${dependency.id} has not passed required verification; run sdd test task
|
|
96
|
+
? `Task ${taskId} depends on ${dependency.id}, but ${dependency.id} has not passed required verification; run sdd test task-${dependency.id} before continuing ${taskId}.`
|
|
97
97
|
: `Task ${taskId} depends on ${dependency.id}, but ${dependency.id} is not implemented; run sdd do task ${dependency.id} before continuing ${taskId}.`
|
|
98
98
|
};
|
|
99
99
|
}
|
|
@@ -10,7 +10,6 @@ export interface LatestEligibleRunCandidate {
|
|
|
10
10
|
runId: string;
|
|
11
11
|
runStatus: RunState['status'];
|
|
12
12
|
validationStatus: RunState['validation']['status'];
|
|
13
|
-
syncBackStatus: RunState['syncBack']['status'];
|
|
14
13
|
affectedFiles: string[];
|
|
15
14
|
updatedAt: string;
|
|
16
15
|
compatibility: DocumentCompatibilityClass;
|
|
@@ -54,7 +53,7 @@ export function selectLatestEligibleRunsByTask(input: { states: RunState[]; mode
|
|
|
54
53
|
|
|
55
54
|
function latestEligibleCandidate(state: RunState, model: SddTaskModel): LatestEligibleRunCandidate {
|
|
56
55
|
const compatibility = classifyDocumentCompatibility(state, model);
|
|
57
|
-
const reasons = candidateRejectionReasons(state, compatibility);
|
|
56
|
+
const reasons = candidateRejectionReasons(state, model, compatibility);
|
|
58
57
|
return {
|
|
59
58
|
partition: state.partition ?? model.branch,
|
|
60
59
|
gitBranch: state.gitBranch,
|
|
@@ -62,7 +61,6 @@ function latestEligibleCandidate(state: RunState, model: SddTaskModel): LatestEl
|
|
|
62
61
|
runId: state.runId,
|
|
63
62
|
runStatus: state.status,
|
|
64
63
|
validationStatus: state.validation.status,
|
|
65
|
-
syncBackStatus: state.syncBack.status,
|
|
66
64
|
affectedFiles: state.affectedFiles,
|
|
67
65
|
updatedAt: state.updatedAt,
|
|
68
66
|
compatibility,
|
|
@@ -83,14 +81,21 @@ export function classifyDocumentCompatibility(state: RunState, model: SddTaskMod
|
|
|
83
81
|
const planMismatch = snapshot.planContractHash !== null
|
|
84
82
|
? documentHashMismatch(snapshot.planContractHash, model.documents.planContractHash ?? null)
|
|
85
83
|
: documentHashMismatch(snapshot.planHash, model.documents.planHash ?? null);
|
|
84
|
+
const task = (state.taskId ?? state.currentTask) ? model.tasks.find((candidate) => candidate.id === (state.taskId ?? state.currentTask)) ?? null : null;
|
|
85
|
+
const taskContractMismatch = snapshot.taskContractHash !== null && task
|
|
86
|
+
? documentHashMismatch(snapshot.taskContractHash, task.contractHash)
|
|
87
|
+
: false;
|
|
86
88
|
const tasksSemanticMismatch = snapshot.tasksContractHash !== null
|
|
87
|
-
? documentHashMismatch(snapshot.tasksContractHash, model.documents.tasksContractHash ?? null)
|
|
89
|
+
? documentHashMismatch(snapshot.tasksContractHash, model.documents.tasksContractHash ?? null) && !runTaskContractStillCompatible(state, task)
|
|
88
90
|
: false;
|
|
89
91
|
const tasksDocMismatch = documentHashMismatch(snapshot.tasksHash, model.documents.tasksHash ?? null);
|
|
90
92
|
if (specMismatch || planMismatch) {
|
|
91
93
|
return 'strict_stale';
|
|
92
94
|
}
|
|
93
|
-
if (model.documents.planStale || model.documents.
|
|
95
|
+
if (model.documents.planStale || model.documents.verifyStale) {
|
|
96
|
+
return 'strict_stale';
|
|
97
|
+
}
|
|
98
|
+
if (taskContractMismatch) {
|
|
94
99
|
return 'strict_stale';
|
|
95
100
|
}
|
|
96
101
|
if (tasksSemanticMismatch) {
|
|
@@ -102,7 +107,7 @@ export function classifyDocumentCompatibility(state: RunState, model: SddTaskMod
|
|
|
102
107
|
return 'compatible';
|
|
103
108
|
}
|
|
104
109
|
|
|
105
|
-
function candidateRejectionReasons(state: RunState, compatibility: DocumentCompatibilityClass): string[] {
|
|
110
|
+
function candidateRejectionReasons(state: RunState, model: SddTaskModel, compatibility: DocumentCompatibilityClass): string[] {
|
|
106
111
|
const reasons: string[] = [];
|
|
107
112
|
if (state.status === 'archived') {
|
|
108
113
|
reasons.push('Run is archived.');
|
|
@@ -117,7 +122,7 @@ function candidateRejectionReasons(state: RunState, compatibility: DocumentCompa
|
|
|
117
122
|
reasons.push(`Run validation status is ${state.validation.status}.`);
|
|
118
123
|
}
|
|
119
124
|
if (compatibility === 'strict_stale') {
|
|
120
|
-
reasons.push(
|
|
125
|
+
reasons.push(...strictStaleReasons(state, model));
|
|
121
126
|
}
|
|
122
127
|
if (compatibility === 'incompatible') {
|
|
123
128
|
reasons.push('Run document compatibility is incompatible.');
|
|
@@ -125,6 +130,69 @@ function candidateRejectionReasons(state: RunState, compatibility: DocumentCompa
|
|
|
125
130
|
return reasons;
|
|
126
131
|
}
|
|
127
132
|
|
|
133
|
+
function strictStaleReasons(state: RunState, model: SddTaskModel): string[] {
|
|
134
|
+
const snapshot = state.documentSnapshot;
|
|
135
|
+
const reasons: string[] = [];
|
|
136
|
+
if (documentHashMismatch(snapshot.specContractHash ?? snapshot.specHash, snapshot.specContractHash !== null ? model.documents.specContractHash ?? null : model.documents.specHash ?? null)) {
|
|
137
|
+
reasons.push('Run document compatibility is strict_stale: spec hash drift.');
|
|
138
|
+
}
|
|
139
|
+
if (documentHashMismatch(snapshot.planContractHash ?? snapshot.planHash, snapshot.planContractHash !== null ? model.documents.planContractHash ?? null : model.documents.planHash ?? null)) {
|
|
140
|
+
reasons.push('Run document compatibility is strict_stale: plan hash drift.');
|
|
141
|
+
}
|
|
142
|
+
const task = (state.taskId ?? state.currentTask) ? model.tasks.find((candidate) => candidate.id === (state.taskId ?? state.currentTask)) ?? null : null;
|
|
143
|
+
if (snapshot.taskContractHash !== null && task && documentHashMismatch(snapshot.taskContractHash, task.contractHash)) {
|
|
144
|
+
reasons.push('Run document compatibility is strict_stale: task contract hash drift.');
|
|
145
|
+
}
|
|
146
|
+
if (snapshot.tasksContractHash !== null && documentHashMismatch(snapshot.tasksContractHash, model.documents.tasksContractHash ?? null) && !runTaskContractStillCompatible(state, task)) {
|
|
147
|
+
reasons.push('Run document compatibility is strict_stale: tasks contract hash drift.');
|
|
148
|
+
}
|
|
149
|
+
if (snapshot.tasksContractHash === null && documentHashMismatch(snapshot.tasksHash, model.documents.tasksHash ?? null) && !runTaskContractStillCompatible(state, task)) {
|
|
150
|
+
reasons.push('Run document compatibility is strict_stale: tasks semantic hash drift.');
|
|
151
|
+
}
|
|
152
|
+
if (model.documents.planStale) {
|
|
153
|
+
reasons.push('Run document compatibility is strict_stale: plan contract hash drift.');
|
|
154
|
+
}
|
|
155
|
+
if (model.documents.verifyStale) {
|
|
156
|
+
reasons.push('Run document compatibility is strict_stale: verify contract hash drift.');
|
|
157
|
+
}
|
|
158
|
+
return reasons.length > 0 ? reasons : ['Run document compatibility is strict_stale.'];
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function runTaskContractStillCompatible(state: RunState, task: SddTaskModel['tasks'][number] | null): boolean {
|
|
162
|
+
if (!task) {
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
const snapshot = state.documentSnapshot;
|
|
166
|
+
if (snapshot.taskContractHash !== null) {
|
|
167
|
+
return !documentHashMismatch(snapshot.taskContractHash, task.contractHash);
|
|
168
|
+
}
|
|
169
|
+
if (state.affectedFiles.length > 0 && !sameStringList(state.affectedFiles, task.affectedFiles)) {
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
const runtime = state.tasks[task.id];
|
|
173
|
+
if (runtime) {
|
|
174
|
+
if ((runtime.validationBatch ?? null) !== (task.validationBatch ?? null)) {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
if ((runtime.validationTiming ?? 'task_end') !== task.validationTiming) {
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
if ((runtime.requiresVerifyBeforeNext ?? true) !== task.requiresVerifyBeforeNext) {
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return true;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function sameStringList(left: string[], right: string[]): boolean {
|
|
188
|
+
if (left.length !== right.length) {
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
const normalizedLeft = [...left].sort();
|
|
192
|
+
const normalizedRight = [...right].sort();
|
|
193
|
+
return normalizedLeft.every((value, index) => value === normalizedRight[index]);
|
|
194
|
+
}
|
|
195
|
+
|
|
128
196
|
function documentHashMismatch(expected: string | null, actual: string | null): boolean {
|
|
129
197
|
if (!expected && !actual) {
|
|
130
198
|
return false;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import type { SddTask, SddTaskModel } from '../sdd-docs/task-parser.js';
|
|
2
|
+
import type { LatestEligibleRunSelection } from './latest-eligible-run.js';
|
|
3
|
+
|
|
4
|
+
export type MixedVersionRecoveryIssueKind = 'legacy_artifact_ref' | 'non_executable_validation' | 'strict_stale_contract_drift' | 'legacy_stage_state' | 'missing_stage_evidence_rule';
|
|
5
|
+
export type MixedVersionRecoveryIssueSeverity = 'info' | 'warn' | 'blocking';
|
|
6
|
+
|
|
7
|
+
export interface MixedVersionRecoveryIssue {
|
|
8
|
+
kind: MixedVersionRecoveryIssueKind;
|
|
9
|
+
severity: MixedVersionRecoveryIssueSeverity;
|
|
10
|
+
file?: string;
|
|
11
|
+
taskId?: string;
|
|
12
|
+
current?: string;
|
|
13
|
+
expected?: string;
|
|
14
|
+
safeFixAvailable: boolean;
|
|
15
|
+
message: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface MixedVersionMechanicalUpdate {
|
|
19
|
+
issueKind: MixedVersionRecoveryIssueKind;
|
|
20
|
+
file: string;
|
|
21
|
+
current: string;
|
|
22
|
+
expected: string;
|
|
23
|
+
preview: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface MixedVersionStaleRunImpact {
|
|
27
|
+
taskId: string;
|
|
28
|
+
runId: string;
|
|
29
|
+
reasons: string[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface MixedVersionRecoveryPlan {
|
|
33
|
+
detectedIssues: MixedVersionRecoveryIssue[];
|
|
34
|
+
safeMechanicalUpdates: MixedVersionMechanicalUpdate[];
|
|
35
|
+
behaviorChangingUpdates: MixedVersionRecoveryIssue[];
|
|
36
|
+
staleRunImpact: MixedVersionStaleRunImpact[];
|
|
37
|
+
evidenceReplayNeeded: string[];
|
|
38
|
+
nextCommands: string[];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function buildMixedVersionRecoveryPlan(input: { model: SddTaskModel; latestEligibleRunsByTask: LatestEligibleRunSelection[]; verifyText?: string | null }): MixedVersionRecoveryPlan {
|
|
42
|
+
const issues = [
|
|
43
|
+
...legacyArtifactRefIssues(input.model),
|
|
44
|
+
...validationCommandIssues(input.model),
|
|
45
|
+
...strictStaleIssues(input.latestEligibleRunsByTask)
|
|
46
|
+
];
|
|
47
|
+
if (input.model.documents.verifyExists && input.verifyText !== undefined && !mentionsStageEvidenceRule(input.verifyText)) {
|
|
48
|
+
issues.push({
|
|
49
|
+
kind: 'missing_stage_evidence_rule',
|
|
50
|
+
severity: 'warn',
|
|
51
|
+
file: input.model.verifyPath,
|
|
52
|
+
current: 'missing stage evidence ref rule',
|
|
53
|
+
expected: 'verify.md states result evidence must use .sdd/runs/<branch>/<stage>/*.md refs',
|
|
54
|
+
safeFixAvailable: false,
|
|
55
|
+
message: 'verify.md does not state the stage evidence reference rule.'
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
const safeMechanicalUpdates = issues.flatMap((issue) => mechanicalUpdateForIssue(issue));
|
|
59
|
+
const staleRunImpact = input.latestEligibleRunsByTask.flatMap((selection) => selection.rejected
|
|
60
|
+
.filter((candidate) => candidate.reasons.some((reason) => reason.includes('strict_stale')))
|
|
61
|
+
.map((candidate) => ({ taskId: selection.taskId, runId: candidate.runId, reasons: candidate.reasons })));
|
|
62
|
+
const evidenceReplayNeeded = [...new Set(staleRunImpact.map((impact) => impact.taskId))].sort();
|
|
63
|
+
return {
|
|
64
|
+
detectedIssues: issues,
|
|
65
|
+
safeMechanicalUpdates,
|
|
66
|
+
behaviorChangingUpdates: issues.filter((issue) => !issue.safeFixAvailable),
|
|
67
|
+
staleRunImpact,
|
|
68
|
+
evidenceReplayNeeded,
|
|
69
|
+
nextCommands: nextCommands(input.model.branch, safeMechanicalUpdates.length, evidenceReplayNeeded)
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function canonicalRunRelativeArtifactRef(_branch: string, _ref: string): string | null {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function legacyArtifactRefIssues(model: SddTaskModel): MixedVersionRecoveryIssue[] {
|
|
78
|
+
return model.tasks.flatMap((task) => task.requiredArtifacts.flatMap((artifact) => {
|
|
79
|
+
const canonical = canonicalRunRelativeArtifactRef(model.branch, artifact);
|
|
80
|
+
return canonical ? [{
|
|
81
|
+
kind: 'legacy_artifact_ref' as const,
|
|
82
|
+
severity: 'warn' as const,
|
|
83
|
+
file: task.source.filePath,
|
|
84
|
+
taskId: task.id,
|
|
85
|
+
current: artifact,
|
|
86
|
+
expected: canonical,
|
|
87
|
+
safeFixAvailable: true,
|
|
88
|
+
message: `Task ${task.id} uses legacy evidence ref ${artifact}; use .sdd/runs/<branch>/<stage>/*.md stage evidence refs instead.`
|
|
89
|
+
}] : [];
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
function validationCommandIssues(model: SddTaskModel): MixedVersionRecoveryIssue[] {
|
|
95
|
+
return model.tasks.flatMap((task) => task.validationCommands.flatMap((command) => nonExecutableValidationIssue(task, command.command)));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function nonExecutableValidationIssue(task: SddTask, command: string): MixedVersionRecoveryIssue[] {
|
|
99
|
+
const normalized = command.trim().toLowerCase();
|
|
100
|
+
if (!normalized.startsWith('```') && !normalized.startsWith('powershell') && !normalized.startsWith('manual:')) {
|
|
101
|
+
return [];
|
|
102
|
+
}
|
|
103
|
+
return [{
|
|
104
|
+
kind: 'non_executable_validation',
|
|
105
|
+
severity: 'blocking',
|
|
106
|
+
file: task.source.filePath,
|
|
107
|
+
taskId: task.id,
|
|
108
|
+
current: command,
|
|
109
|
+
expected: 'plain executable validation command',
|
|
110
|
+
safeFixAvailable: normalized.startsWith('```'),
|
|
111
|
+
message: `Task ${task.id} validation command is not directly executable: ${command}`
|
|
112
|
+
}];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function strictStaleIssues(selections: LatestEligibleRunSelection[]): MixedVersionRecoveryIssue[] {
|
|
116
|
+
return selections.flatMap((selection) => selection.rejected.flatMap((candidate) => candidate.reasons
|
|
117
|
+
.filter((reason) => reason.includes('strict_stale'))
|
|
118
|
+
.map((reason) => ({
|
|
119
|
+
kind: 'strict_stale_contract_drift' as const,
|
|
120
|
+
severity: 'warn' as const,
|
|
121
|
+
taskId: selection.taskId,
|
|
122
|
+
current: candidate.runId,
|
|
123
|
+
expected: 'replay evidence against current document contracts',
|
|
124
|
+
safeFixAvailable: false,
|
|
125
|
+
message: reason
|
|
126
|
+
}))));
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function mentionsStageEvidenceRule(verifyText: string | null): boolean {
|
|
130
|
+
return Boolean(verifyText && /runs\/<branch>\/<stage>|stage evidence/i.test(verifyText));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function mechanicalUpdateForIssue(issue: MixedVersionRecoveryIssue): MixedVersionMechanicalUpdate[] {
|
|
134
|
+
if (!issue.safeFixAvailable || !issue.file || !issue.current || !issue.expected) {
|
|
135
|
+
return [];
|
|
136
|
+
}
|
|
137
|
+
return [{
|
|
138
|
+
issueKind: issue.kind,
|
|
139
|
+
file: issue.file,
|
|
140
|
+
current: issue.current,
|
|
141
|
+
expected: issue.expected,
|
|
142
|
+
preview: `replace ${issue.current} -> ${issue.expected}`
|
|
143
|
+
}];
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function nextCommands(branch: string, safeFixes: number, replayTaskIds: string[]): string[] {
|
|
147
|
+
const commands: string[] = [];
|
|
148
|
+
if (safeFixes > 0) {
|
|
149
|
+
commands.push(`sdd doctor --branch ${branch} --latest-only`);
|
|
150
|
+
}
|
|
151
|
+
for (const taskId of replayTaskIds) {
|
|
152
|
+
commands.push(`sdd test task-${taskId} --branch ${branch}`);
|
|
153
|
+
}
|
|
154
|
+
if (commands.length === 0) {
|
|
155
|
+
commands.push(`sdd status --branch ${branch}`);
|
|
156
|
+
}
|
|
157
|
+
return commands;
|
|
158
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { RuntimeRepairRecord, RuntimeRepairType } from '../storage/runtime-store.js';
|
|
2
|
+
import { runtimeScopedId } from '../storage/runtime-store.js';
|
|
3
|
+
|
|
4
|
+
export interface RepairClassificationInput {
|
|
5
|
+
branchSlug: string;
|
|
6
|
+
taskId?: string | null;
|
|
7
|
+
runId?: string | null;
|
|
8
|
+
gateDecisionId?: string | null;
|
|
9
|
+
message: string;
|
|
10
|
+
recommendedCommands?: string[];
|
|
11
|
+
requiredEvidence?: string[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function classifyRepairType(message: string): RuntimeRepairType {
|
|
15
|
+
const normalized = message.toLowerCase();
|
|
16
|
+
if (normalized.includes('mixed-version') || normalized.includes('legacy') || normalized.includes('0.4.x')) {
|
|
17
|
+
return 'migration_repair';
|
|
18
|
+
}
|
|
19
|
+
if (normalized.includes('contract') || normalized.includes('stale') || normalized.includes('spec') || normalized.includes('plan') || normalized.includes('verify.md') || normalized.includes('tasks.md')) {
|
|
20
|
+
return 'contract_repair';
|
|
21
|
+
}
|
|
22
|
+
if (normalized.includes('validation command') || normalized.includes('not directly executable') || normalized.includes('manual:')) {
|
|
23
|
+
return 'validation_command_repair';
|
|
24
|
+
}
|
|
25
|
+
if (normalized.includes('artifact') || normalized.includes('digest') || normalized.includes('evidence')) {
|
|
26
|
+
return 'artifact_repair';
|
|
27
|
+
}
|
|
28
|
+
if (normalized.includes('env') || normalized.includes('node:sqlite') || normalized.includes('maven') || normalized.includes('jdk') || normalized.includes('external service')) {
|
|
29
|
+
return 'environment_repair';
|
|
30
|
+
}
|
|
31
|
+
if (normalized.includes('gate') || normalized.includes('policy') || normalized.includes('human')) {
|
|
32
|
+
return 'gate_policy_repair';
|
|
33
|
+
}
|
|
34
|
+
return 'implementation_repair';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function buildOpenRepairRecord(input: RepairClassificationInput): RuntimeRepairRecord {
|
|
38
|
+
const repairType = classifyRepairType(input.message);
|
|
39
|
+
const taskId = input.taskId ?? null;
|
|
40
|
+
const runId = input.runId ?? null;
|
|
41
|
+
return {
|
|
42
|
+
repairId: runtimeScopedId('repair', input.branchSlug, taskId ?? 'workflow', runId ?? 'none', repairType, input.message),
|
|
43
|
+
branchSlug: input.branchSlug,
|
|
44
|
+
taskId,
|
|
45
|
+
repairType,
|
|
46
|
+
repairOfRunId: runId,
|
|
47
|
+
repairOfGateDecisionId: input.gateDecisionId ?? null,
|
|
48
|
+
status: 'open',
|
|
49
|
+
affectedTasks: taskId ? [taskId] : [],
|
|
50
|
+
blockers: [input.message],
|
|
51
|
+
recommendedCommands: input.recommendedCommands ?? defaultRepairCommands(input.branchSlug, taskId, repairType),
|
|
52
|
+
requiredEvidence: input.requiredEvidence ?? defaultRequiredEvidence(repairType),
|
|
53
|
+
createdAt: new Date().toISOString(),
|
|
54
|
+
resolvedAt: null,
|
|
55
|
+
payload: { source: 'repair_classifier' }
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function defaultRepairCommands(branchSlug: string, taskId: string | null, repairType: RuntimeRepairType): string[] {
|
|
60
|
+
if (repairType === 'contract_repair' || repairType === 'migration_repair' || repairType === 'validation_command_repair') {
|
|
61
|
+
return [`sdd doctor --branch ${branchSlug} --latest-only`];
|
|
62
|
+
}
|
|
63
|
+
if (taskId) {
|
|
64
|
+
return [`sdd test task-${taskId} --branch ${branchSlug}`];
|
|
65
|
+
}
|
|
66
|
+
return [`sdd status --branch ${branchSlug}`];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function defaultRequiredEvidence(repairType: RuntimeRepairType): string[] {
|
|
70
|
+
if (repairType === 'contract_repair' || repairType === 'migration_repair' || repairType === 'validation_command_repair') {
|
|
71
|
+
return ['current document contract and executable validation evidence'];
|
|
72
|
+
}
|
|
73
|
+
if (repairType === 'gate_policy_repair') {
|
|
74
|
+
return ['accepted workflow gate PASS decision'];
|
|
75
|
+
}
|
|
76
|
+
return ['new accepted validation evidence'];
|
|
77
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { RunState } from '../run-state/model.js';
|
|
2
|
+
import { readAllRunStates, readRunState } from '../run-state/run-state.js';
|
|
3
|
+
import type { ContextResolverContract } from '../sdd-docs/context.js';
|
|
4
|
+
import { resolveRunStateContext, resolveSddContext } from '../sdd-docs/context.js';
|
|
5
|
+
import { documentHashMatches } from '../sdd-docs/document-hashes.js';
|
|
6
|
+
import { inspectSddTask } from '../sdd-docs/task-inspection.js';
|
|
7
|
+
import { parseSddBranch, type SddTask, type SddTaskModel } from '../sdd-docs/task-parser.js';
|
|
8
|
+
import { affectedFileConflictsForSelectedRun, type WorkflowAffectedFileConflict } from './affected-file-conflicts.js';
|
|
9
|
+
import { resolveWorkflowState } from './resolve.js';
|
|
10
|
+
|
|
11
|
+
export interface ResolvedTaskRun {
|
|
12
|
+
runId: string;
|
|
13
|
+
state: RunState;
|
|
14
|
+
context: ContextResolverContract;
|
|
15
|
+
model: SddTaskModel;
|
|
16
|
+
task: SddTask | null;
|
|
17
|
+
explicitRunId: boolean;
|
|
18
|
+
staleReasons: string[];
|
|
19
|
+
affectedFileConflicts: WorkflowAffectedFileConflict[];
|
|
20
|
+
selectorRejectionReasons: string[];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export async function resolveTaskRun(projectRoot: string, options: { runId?: string; branch?: string; taskId: string }): Promise<ResolvedTaskRun> {
|
|
24
|
+
if (options.runId) {
|
|
25
|
+
const state = await readRunState(projectRoot, options.runId);
|
|
26
|
+
const context = options.branch
|
|
27
|
+
? await resolveSddContext(projectRoot, { branch: options.branch, branchSource: 'cli_option' })
|
|
28
|
+
: await resolveRunStateContext(projectRoot, state);
|
|
29
|
+
const model = await parseSddBranch(projectRoot, context.partition);
|
|
30
|
+
const inspected = inspectSddTask(model, options.taskId);
|
|
31
|
+
if (state.partition && state.partition !== context.partition) {
|
|
32
|
+
throw new Error(`Run ${state.runId} belongs to partition ${state.partition}, not ${context.partition}.`);
|
|
33
|
+
}
|
|
34
|
+
if (state.taskId && state.taskId !== options.taskId) {
|
|
35
|
+
throw new Error(`Run ${state.runId} belongs to task ${state.taskId}, not ${options.taskId}.`);
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
runId: state.runId,
|
|
39
|
+
state,
|
|
40
|
+
context,
|
|
41
|
+
model,
|
|
42
|
+
task: inspected.task,
|
|
43
|
+
explicitRunId: true,
|
|
44
|
+
staleReasons: runDocumentStaleReasons(state, model),
|
|
45
|
+
affectedFileConflicts: await affectedFileConflictsForRun(projectRoot, state),
|
|
46
|
+
selectorRejectionReasons: []
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const workflow = await resolveWorkflowState(projectRoot, {
|
|
51
|
+
branch: options.branch,
|
|
52
|
+
branchSource: options.branch ? 'cli_option' : undefined,
|
|
53
|
+
taskId: options.taskId
|
|
54
|
+
});
|
|
55
|
+
const inspected = inspectSddTask(workflow.model, options.taskId);
|
|
56
|
+
const selection = workflow.latestEligibleRunsByTask.find((entry) => entry.taskId === options.taskId);
|
|
57
|
+
const candidate = selection?.selected ?? selection?.rejected[0] ?? null;
|
|
58
|
+
if (!candidate) {
|
|
59
|
+
throw new Error(`No eligible run found for ${workflow.context.partition}/${options.taskId}. Run sdd do task ${options.taskId} first, or pass --run <run_id>.`);
|
|
60
|
+
}
|
|
61
|
+
const state = selection?.selected && workflow.latestRunState && selection.selected.runId === workflow.latestRunState.runId
|
|
62
|
+
? workflow.latestRunState
|
|
63
|
+
: await readRunState(projectRoot, candidate.runId);
|
|
64
|
+
if (!state) {
|
|
65
|
+
throw new Error(`Run state ${candidate.runId} is unavailable for ${workflow.context.partition}/${options.taskId}. Pass --run <run_id> or rerun the task.`);
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
runId: state.runId,
|
|
69
|
+
state,
|
|
70
|
+
context: workflow.context,
|
|
71
|
+
model: workflow.model,
|
|
72
|
+
task: inspected.task,
|
|
73
|
+
explicitRunId: false,
|
|
74
|
+
staleReasons: runDocumentStaleReasons(state, workflow.model),
|
|
75
|
+
affectedFileConflicts: workflow.affectedFileConflicts,
|
|
76
|
+
selectorRejectionReasons: selection?.selected ? [] : candidate.reasons
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function runDocumentStaleReasons(state: RunState, model: SddTaskModel): string[] {
|
|
81
|
+
const reasons: string[] = [];
|
|
82
|
+
const snapshot = state.documentSnapshot;
|
|
83
|
+
if (!snapshot.specHash && !snapshot.planHash && !snapshot.tasksHash) {
|
|
84
|
+
reasons.push('Run has no document snapshot hashes; rerun do task before test or goal-verify.');
|
|
85
|
+
}
|
|
86
|
+
appendDocumentHashMismatch(reasons, 'spec.md', snapshot.specHash, model.documents.specHash ?? null);
|
|
87
|
+
appendDocumentHashMismatch(reasons, 'plan.md', snapshot.planHash, model.documents.planHash ?? null);
|
|
88
|
+
appendDocumentHashMismatch(reasons, 'tasks.md', snapshot.tasksHash, model.documents.tasksHash ?? null);
|
|
89
|
+
if (model.documents.planStale) {
|
|
90
|
+
reasons.push('Current plan.md is stale against spec.md.');
|
|
91
|
+
}
|
|
92
|
+
if (model.documents.tasksStale) {
|
|
93
|
+
reasons.push('Current tasks.md is stale against plan.md or spec.md.');
|
|
94
|
+
}
|
|
95
|
+
return reasons;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
async function affectedFileConflictsForRun(projectRoot: string, state: RunState): Promise<WorkflowAffectedFileConflict[]> {
|
|
99
|
+
const states = await readAllRunStates(projectRoot);
|
|
100
|
+
return affectedFileConflictsForSelectedRun(states, state);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function appendDocumentHashMismatch(reasons: string[], documentName: string, expected: string | null, actual: string | null): void {
|
|
104
|
+
if (shouldReportDocumentHashMismatch(expected, actual)) {
|
|
105
|
+
reasons.push(`Run snapshot for ${documentName} is ${expected ?? 'missing'}, current hash is ${actual ?? 'missing'}.`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function shouldReportDocumentHashMismatch(expected: string | null, actual: string | null): boolean {
|
|
110
|
+
if (!expected && !actual) {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
return !expected || !actual || !documentHashMatches(expected, actual);
|
|
114
|
+
}
|