sdd-agent-platform 0.4.1 → 0.5.0
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 +24 -28
- package/node_modules/@sdd-agent-platform/core/dist/ai-tools.js +84 -103
- package/node_modules/@sdd-agent-platform/core/dist/ai-tools.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/init-project.d.ts +10 -6
- package/node_modules/@sdd-agent-platform/core/dist/config/init-project.js +7 -8
- 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 +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.js +374 -421
- 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 +7 -19
- package/node_modules/@sdd-agent-platform/core/dist/context/build-package.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/contracts.d.ts +7 -1
- package/node_modules/@sdd-agent-platform/core/dist/contracts.js +6 -0
- package/node_modules/@sdd-agent-platform/core/dist/contracts.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/document-chain.js +2 -12
- 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/doctor.js +1 -18
- package/node_modules/@sdd-agent-platform/core/dist/doctor/doctor.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.js +1 -1
- 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/evidence-runtime/coordination.js +110 -0
- package/node_modules/@sdd-agent-platform/core/dist/evidence-runtime/coordination.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/execution/host-invocation.js +83 -83
- package/node_modules/@sdd-agent-platform/core/dist/instructions.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/instructions.js +37 -80
- package/node_modules/@sdd-agent-platform/core/dist/instructions.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.js +58 -68
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle-graph/contracts.d.ts +159 -0
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle-graph/contracts.js +7 -0
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle-graph/contracts.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle-graph/kernel.d.ts +16 -0
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle-graph/kernel.js +461 -0
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle-graph/kernel.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle-graph.d.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle-graph.js +3 -0
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle-graph.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/orchestration/contracts.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.js +21 -28
- package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-registry.js +124 -40
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-registry.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.js +6 -13
- 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/plan-scout-domains.d.ts +13 -0
- package/node_modules/@sdd-agent-platform/core/dist/registries/plan-scout-domains.js +76 -0
- package/node_modules/@sdd-agent-platform/core/dist/registries/plan-scout-domains.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/registries/skill-capabilities.js +7 -7
- package/node_modules/@sdd-agent-platform/core/dist/registries/skill-capabilities.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/tool-capabilities.js +6 -6
- package/node_modules/@sdd-agent-platform/core/dist/registries/tool-capabilities.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/workflow-gates.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/workflow-gates.js +18 -18
- package/node_modules/@sdd-agent-platform/core/dist/registries/workflow-gates.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/risk/consumer-diagnostics.js +2 -1
- package/node_modules/@sdd-agent-platform/core/dist/risk/consumer-diagnostics.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 +7 -7
- 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 +12 -27
- 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.js +6 -6
- 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/routing.js +2 -4
- 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 +383 -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/stage-route-binding.d.ts +37 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/stage-route-binding.js +227 -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 +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/router.js +1 -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 +6 -0
- 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/model.d.ts +20 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-state.js +7 -7
- 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 +1 -2
- package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.js +2 -9
- 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/runtime-analysis/build.js +1 -4
- 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 +0 -39
- 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 +211 -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/artifact-depth.d.ts +14 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/artifact-depth.js +179 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/artifact-depth.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.d.ts +5 -1
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.js +60 -22
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-rendering.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-rendering.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/spec-entry.js +40 -0
- package/node_modules/@sdd-agent-platform/core/dist/spec-entry.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/spec-manager-contracts.d.ts +12 -0
- package/node_modules/@sdd-agent-platform/core/dist/spec-manager-contracts.js +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/spec-manager-contracts.js.map +1 -0
- 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 +315 -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 +238 -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 +736 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration.js +4018 -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.js +25 -1
- 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 +597 -85
- package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.d.ts +1 -17
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.js +1 -242
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.d.ts +1 -110
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.js +1 -496
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sync-back.d.ts +1 -2
- package/node_modules/@sdd-agent-platform/core/dist/sync-back.js +1 -2
- package/node_modules/@sdd-agent-platform/core/dist/sync-back.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/task-execution-contract.d.ts +167 -0
- package/node_modules/@sdd-agent-platform/core/dist/task-execution-contract.js +377 -0
- package/node_modules/@sdd-agent-platform/core/dist/task-execution-contract.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/test-support/fixtures.js +329 -314
- package/node_modules/@sdd-agent-platform/core/dist/test-support/fixtures.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.d.ts +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.js +31 -0
- 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 +135 -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 -49
- package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.js +1 -545
- 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 +5 -7
- package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.js +15 -55
- 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.js +1 -40
- 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/task-evidence-judgment.d.ts +49 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/task-evidence-judgment.js +521 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/task-evidence-judgment.js.map +1 -0
- 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 +247 -112
- 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/verify-contract.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.js +49 -72
- package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification.d.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/dist/verification.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/verification.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.js +2 -7
- 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 +0 -7
- 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 +2 -4
- 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 +3 -5
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.js +30 -4
- 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 +518 -36
- 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 +6 -3
- package/node_modules/@sdd-agent-platform/core/src/ai-tools.test.ts +238 -137
- package/node_modules/@sdd-agent-platform/core/src/ai-tools.ts +84 -103
- package/node_modules/@sdd-agent-platform/core/src/artifacts/ingestion.test.ts +189 -189
- package/node_modules/@sdd-agent-platform/core/src/artifacts/ingestion.ts +222 -222
- package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-evidence.test.ts +28 -28
- package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-evidence.ts +302 -302
- package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-result.test.ts +181 -181
- package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-result.ts +231 -231
- package/node_modules/@sdd-agent-platform/core/src/artifacts/templates.ts +99 -99
- package/node_modules/@sdd-agent-platform/core/src/artifacts.ts +4 -4
- package/node_modules/@sdd-agent-platform/core/src/coding-facts/contracts.ts +79 -79
- package/node_modules/@sdd-agent-platform/core/src/coding-facts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/config/init-project.test.ts +314 -306
- package/node_modules/@sdd-agent-platform/core/src/config/init-project.ts +128 -120
- package/node_modules/@sdd-agent-platform/core/src/config/project-config.ts +265 -259
- package/node_modules/@sdd-agent-platform/core/src/config/project-detection.ts +147 -147
- package/node_modules/@sdd-agent-platform/core/src/config/starter-documents.ts +400 -445
- package/node_modules/@sdd-agent-platform/core/src/context/budget.ts +30 -30
- package/node_modules/@sdd-agent-platform/core/src/context/build-package.ts +305 -317
- package/node_modules/@sdd-agent-platform/core/src/context/command-summary.ts +45 -45
- package/node_modules/@sdd-agent-platform/core/src/context/context-build.test.ts +188 -188
- package/node_modules/@sdd-agent-platform/core/src/context/evidence-summary.ts +144 -144
- package/node_modules/@sdd-agent-platform/core/src/context/log-worker.ts +48 -48
- package/node_modules/@sdd-agent-platform/core/src/context/source-refs.ts +41 -41
- package/node_modules/@sdd-agent-platform/core/src/context-offload/contracts.ts +47 -47
- package/node_modules/@sdd-agent-platform/core/src/context-offload/runtime.test.ts +71 -71
- package/node_modules/@sdd-agent-platform/core/src/context-offload/runtime.ts +178 -178
- package/node_modules/@sdd-agent-platform/core/src/context-offload.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/context.ts +6 -6
- package/node_modules/@sdd-agent-platform/core/src/contracts/issues.ts +13 -13
- package/node_modules/@sdd-agent-platform/core/src/contracts.test.ts +9 -9
- package/node_modules/@sdd-agent-platform/core/src/contracts.ts +121 -115
- package/node_modules/@sdd-agent-platform/core/src/delegation/delegation.test.ts +183 -183
- package/node_modules/@sdd-agent-platform/core/src/delegation/model.ts +23 -23
- package/node_modules/@sdd-agent-platform/core/src/delegation/queue.ts +58 -58
- package/node_modules/@sdd-agent-platform/core/src/delegation/run-state.ts +14 -14
- package/node_modules/@sdd-agent-platform/core/src/delegation/state-machine.ts +90 -90
- package/node_modules/@sdd-agent-platform/core/src/delegation/validation.ts +124 -124
- package/node_modules/@sdd-agent-platform/core/src/delegation.ts +26 -26
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/ai-entries.ts +28 -28
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/document-chain.ts +104 -112
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/local-run-index.ts +27 -27
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/project.ts +84 -84
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/registries.ts +252 -252
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/run-evidence.ts +330 -330
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/run-records.ts +79 -79
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/run-trust.ts +128 -128
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/runtime-contracts.ts +300 -300
- package/node_modules/@sdd-agent-platform/core/src/doctor/doctor.test.ts +627 -657
- package/node_modules/@sdd-agent-platform/core/src/doctor/doctor.ts +301 -318
- package/node_modules/@sdd-agent-platform/core/src/doctor/model.ts +13 -13
- package/node_modules/@sdd-agent-platform/core/src/doctor/summary.ts +11 -11
- package/node_modules/@sdd-agent-platform/core/src/doctor.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/evidence/lookup.ts +80 -80
- package/node_modules/@sdd-agent-platform/core/src/evidence-runtime/contracts.ts +48 -49
- package/node_modules/@sdd-agent-platform/core/src/evidence-runtime.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/execution/agent-execution-records.ts +195 -195
- package/node_modules/@sdd-agent-platform/core/src/execution/background-executor.test.ts +187 -187
- package/node_modules/@sdd-agent-platform/core/src/execution/background-executor.ts +305 -305
- package/node_modules/@sdd-agent-platform/core/src/execution/foreground-subagents.test.ts +97 -97
- package/node_modules/@sdd-agent-platform/core/src/execution/foreground-subagents.ts +453 -453
- package/node_modules/@sdd-agent-platform/core/src/execution/host-invocation.ts +225 -225
- package/node_modules/@sdd-agent-platform/core/src/execution/resident-worker.test.ts +132 -132
- package/node_modules/@sdd-agent-platform/core/src/execution/resident-worker.ts +436 -436
- package/node_modules/@sdd-agent-platform/core/src/execution/stage-team-runtime.test.ts +102 -102
- package/node_modules/@sdd-agent-platform/core/src/execution/stage-team-runtime.ts +271 -271
- package/node_modules/@sdd-agent-platform/core/src/execution/wave-executor.test.ts +111 -111
- package/node_modules/@sdd-agent-platform/core/src/execution/wave-executor.ts +231 -231
- package/node_modules/@sdd-agent-platform/core/src/execution.ts +5 -5
- package/node_modules/@sdd-agent-platform/core/src/governance/policy.test.ts +57 -57
- package/node_modules/@sdd-agent-platform/core/src/governance/policy.ts +175 -175
- package/node_modules/@sdd-agent-platform/core/src/governance.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/instructions.test.ts +80 -49
- package/node_modules/@sdd-agent-platform/core/src/instructions.ts +38 -81
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/decision-gate.test.ts +174 -174
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/decision-gate.ts +373 -373
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/rendering.ts +29 -29
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/risk-signals.ts +146 -146
- 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 +255 -263
- package/node_modules/@sdd-agent-platform/core/src/lifecycle-graph/contracts.ts +179 -0
- package/node_modules/@sdd-agent-platform/core/src/lifecycle-graph/kernel.ts +522 -0
- package/node_modules/@sdd-agent-platform/core/src/lifecycle-graph.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/lifecycle.ts +4 -4
- package/node_modules/@sdd-agent-platform/core/src/orchestration/contracts.ts +50 -50
- package/node_modules/@sdd-agent-platform/core/src/orchestration/index.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/orchestration/runtime.ts +331 -342
- package/node_modules/@sdd-agent-platform/core/src/path-safety.test.ts +22 -22
- package/node_modules/@sdd-agent-platform/core/src/phase8-contracts.test.ts +243 -243
- package/node_modules/@sdd-agent-platform/core/src/phase8-projection-compat.test.ts +152 -153
- package/node_modules/@sdd-agent-platform/core/src/phase8-risk-kernel.test.ts +277 -277
- package/node_modules/@sdd-agent-platform/core/src/phase9-lifecycle-graph.test.ts +103 -0
- package/node_modules/@sdd-agent-platform/core/src/planning/task-graph.test.ts +88 -88
- package/node_modules/@sdd-agent-platform/core/src/planning/task-graph.ts +222 -222
- package/node_modules/@sdd-agent-platform/core/src/planning/wave-plan.test.ts +79 -79
- package/node_modules/@sdd-agent-platform/core/src/planning/wave-plan.ts +160 -160
- package/node_modules/@sdd-agent-platform/core/src/planning.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-capability-catalog.ts +426 -426
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-registry.ts +230 -146
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-runtime-static.ts +142 -142
- package/node_modules/@sdd-agent-platform/core/src/registries/capability-sources.ts +253 -253
- package/node_modules/@sdd-agent-platform/core/src/registries/command-team-runtime.ts +302 -309
- package/node_modules/@sdd-agent-platform/core/src/registries/eval-learning-context.ts +246 -246
- package/node_modules/@sdd-agent-platform/core/src/registries/plan-scout-domains.ts +89 -0
- package/node_modules/@sdd-agent-platform/core/src/registries/query-status.ts +119 -119
- package/node_modules/@sdd-agent-platform/core/src/registries/registries.test.ts +454 -429
- package/node_modules/@sdd-agent-platform/core/src/registries/skill-capabilities.ts +37 -37
- package/node_modules/@sdd-agent-platform/core/src/registries/tool-capabilities.ts +135 -135
- package/node_modules/@sdd-agent-platform/core/src/registries/tool-plugins.ts +132 -132
- package/node_modules/@sdd-agent-platform/core/src/registries/worker-adapters.ts +144 -144
- package/node_modules/@sdd-agent-platform/core/src/registries/workflow-gates.ts +111 -111
- package/node_modules/@sdd-agent-platform/core/src/registries.ts +42 -42
- package/node_modules/@sdd-agent-platform/core/src/risk/consumer-diagnostics.ts +98 -97
- package/node_modules/@sdd-agent-platform/core/src/risk/contracts.ts +63 -63
- package/node_modules/@sdd-agent-platform/core/src/risk/kernel.ts +233 -233
- package/node_modules/@sdd-agent-platform/core/src/risk/legacy-adapters.ts +251 -266
- package/node_modules/@sdd-agent-platform/core/src/risk/workflow-gates.ts +203 -203
- package/node_modules/@sdd-agent-platform/core/src/risk.ts +5 -5
- package/node_modules/@sdd-agent-platform/core/src/router/agent-runtime-config.ts +327 -327
- package/node_modules/@sdd-agent-platform/core/src/router/agent-runtime.ts +388 -388
- package/node_modules/@sdd-agent-platform/core/src/router/profile-resolution.ts +154 -154
- package/node_modules/@sdd-agent-platform/core/src/router/risk-policy.ts +33 -33
- package/node_modules/@sdd-agent-platform/core/src/router/route-cache.ts +100 -100
- package/node_modules/@sdd-agent-platform/core/src/router/route-projection.ts +356 -356
- package/node_modules/@sdd-agent-platform/core/src/router/route-sdd-task.test.ts +428 -428
- package/node_modules/@sdd-agent-platform/core/src/router/route-sdd-task.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/router/routing-rules.ts +73 -73
- package/node_modules/@sdd-agent-platform/core/src/router/routing.ts +189 -191
- package/node_modules/@sdd-agent-platform/core/src/router/runtime-import.ts +464 -0
- package/node_modules/@sdd-agent-platform/core/src/router/runtime-inspection.ts +124 -124
- package/node_modules/@sdd-agent-platform/core/src/router/runtime-registry.ts +123 -123
- package/node_modules/@sdd-agent-platform/core/src/router/runtime-validation.ts +277 -277
- package/node_modules/@sdd-agent-platform/core/src/router/stage-route-binding.ts +273 -0
- package/node_modules/@sdd-agent-platform/core/src/router/team-mode.ts +170 -170
- package/node_modules/@sdd-agent-platform/core/src/router.ts +5 -4
- package/node_modules/@sdd-agent-platform/core/src/run-state/artifacts.ts +126 -118
- package/node_modules/@sdd-agent-platform/core/src/run-state/events.ts +27 -27
- package/node_modules/@sdd-agent-platform/core/src/run-state/inspect-run.ts +172 -172
- package/node_modules/@sdd-agent-platform/core/src/run-state/invocation-ledger.ts +109 -109
- package/node_modules/@sdd-agent-platform/core/src/run-state/model.ts +252 -230
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-index.test.ts +52 -52
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-index.ts +356 -356
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-state.test.ts +70 -70
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-state.ts +406 -406
- package/node_modules/@sdd-agent-platform/core/src/run-state/task-evidence.ts +198 -206
- 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 +8 -8
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/build.ts +60 -63
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/findings.ts +257 -296
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/model.ts +140 -152
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis.test.ts +66 -68
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/runtime-paths.ts +253 -176
- package/node_modules/@sdd-agent-platform/core/src/runtime-projection-p0.test.ts +101 -0
- package/node_modules/@sdd-agent-platform/core/src/runtime-projection-p0.ts +314 -0
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/artifact-depth.test.ts +380 -0
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/artifact-depth.ts +207 -0
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/context.ts +111 -111
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/document-hashes.ts +207 -207
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/run-binding.ts +95 -95
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-inspection.ts +39 -39
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.test.ts +467 -401
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.ts +738 -694
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-rendering.ts +81 -81
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs.ts +5 -5
- package/node_modules/@sdd-agent-platform/core/src/spec-manager-contracts.ts +13 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-artifacts.ts +435 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-collaboration-contracts.ts +316 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-collaboration.test.ts +2964 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-collaboration.ts +5856 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-runtime/contracts.ts +40 -40
- package/node_modules/@sdd-agent-platform/core/src/stage-runtime/runtime.test.ts +209 -209
- package/node_modules/@sdd-agent-platform/core/src/stage-runtime/runtime.ts +360 -352
- package/node_modules/@sdd-agent-platform/core/src/stage-runtime.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/status/project-status.test.ts +288 -288
- package/node_modules/@sdd-agent-platform/core/src/status/project-status.ts +651 -625
- package/node_modules/@sdd-agent-platform/core/src/status.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/storage/json-io.ts +10 -10
- package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.test.ts +489 -489
- package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.ts +1981 -1175
- package/node_modules/@sdd-agent-platform/core/src/subagents/contracts.ts +45 -45
- package/node_modules/@sdd-agent-platform/core/src/subagents/runtime.test.ts +232 -232
- package/node_modules/@sdd-agent-platform/core/src/subagents/runtime.ts +307 -307
- package/node_modules/@sdd-agent-platform/core/src/subagents.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/task-execution-contract.test.ts +141 -0
- package/node_modules/@sdd-agent-platform/core/src/task-execution-contract.ts +566 -0
- package/node_modules/@sdd-agent-platform/core/src/task-risk-profile.ts +193 -193
- package/node_modules/@sdd-agent-platform/core/src/test-support/fixtures.ts +413 -398
- package/node_modules/@sdd-agent-platform/core/src/test-support/run-state.ts +102 -70
- package/node_modules/@sdd-agent-platform/core/src/test-support.ts +2 -2
- 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 +174 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/rendering.ts +137 -181
- package/node_modules/@sdd-agent-platform/core/src/verification/review-gate.test.ts +77 -77
- package/node_modules/@sdd-agent-platform/core/src/verification/review-gate.ts +77 -77
- package/node_modules/@sdd-agent-platform/core/src/verification/single-task-loop.ts +455 -494
- package/node_modules/@sdd-agent-platform/core/src/verification/{goal-verify.test.ts → task-evidence-judgment.test.ts} +261 -335
- package/node_modules/@sdd-agent-platform/core/src/verification/{goal-verify.ts → task-evidence-judgment.ts} +619 -648
- package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.ts +1190 -1032
- 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.ts +513 -513
- package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.ts +334 -358
- package/node_modules/@sdd-agent-platform/core/src/verification.ts +8 -8
- package/node_modules/@sdd-agent-platform/core/src/work-units/contracts.ts +26 -26
- package/node_modules/@sdd-agent-platform/core/src/work-units/runtime.test.ts +88 -88
- package/node_modules/@sdd-agent-platform/core/src/work-units/runtime.ts +112 -112
- package/node_modules/@sdd-agent-platform/core/src/work-units.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/evidence-packet.ts +190 -196
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.test.ts +169 -171
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.ts +136 -143
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.test.ts +135 -137
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.ts +153 -155
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/types.ts +111 -114
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/affected-file-conflicts.ts +95 -95
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/dependencies.test.ts +32 -32
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/dependencies.ts +114 -114
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/latest-eligible-run.ts +184 -156
- 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 +970 -464
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve.ts +967 -363
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/runtime-projections.ts +712 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/worktree/isolation.ts +130 -130
- package/node_modules/@sdd-agent-platform/core/src/worktree/lifecycle.ts +269 -269
- package/node_modules/@sdd-agent-platform/core/src/worktree/worktree.test.ts +150 -150
- package/node_modules/@sdd-agent-platform/core/src/worktree.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/tsconfig.json +15 -15
- package/package.json +2 -2
- package/packages/cli/dist/args.js +1 -1
- package/packages/cli/dist/args.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/evidence.js.map +1 -0
- package/packages/cli/dist/commands/execution.js +126 -0
- package/packages/cli/dist/commands/execution.js.map +1 -1
- package/packages/cli/dist/commands/instructions.d.ts +1 -1
- package/packages/cli/dist/commands/instructions.js +15 -1
- package/packages/cli/dist/commands/instructions.js.map +1 -1
- package/packages/cli/dist/commands/registry/runtime.js +70 -1
- package/packages/cli/dist/commands/registry/runtime.js.map +1 -1
- package/packages/cli/dist/commands/run.js +12 -1
- package/packages/cli/dist/commands/run.js.map +1 -1
- package/packages/cli/dist/commands/stage-close.d.ts +66 -0
- package/packages/cli/dist/commands/stage-close.js +524 -0
- package/packages/cli/dist/commands/stage-close.js.map +1 -0
- package/packages/cli/dist/commands/status.js +8 -1
- package/packages/cli/dist/commands/status.js.map +1 -1
- package/packages/cli/dist/commands/tasks.js.map +1 -1
- package/packages/cli/dist/dispatch.js +6 -31
- package/packages/cli/dist/dispatch.js.map +1 -1
- package/packages/cli/dist/help.js +153 -158
- package/packages/cli/dist/help.js.map +1 -1
- package/packages/cli/dist/renderers/workflow.d.ts +51 -2
- 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 +84 -103
- package/packages/core/dist/ai-tools.js.map +1 -1
- package/packages/core/dist/config/init-project.d.ts +10 -6
- package/packages/core/dist/config/init-project.js +7 -8
- 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 +0 -1
- package/packages/core/dist/config/starter-documents.js +374 -421
- 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 +7 -19
- package/packages/core/dist/context/build-package.js.map +1 -1
- package/packages/core/dist/contracts.d.ts +7 -1
- package/packages/core/dist/contracts.js +6 -0
- package/packages/core/dist/contracts.js.map +1 -1
- package/packages/core/dist/doctor/checks/document-chain.js +2 -12
- package/packages/core/dist/doctor/checks/document-chain.js.map +1 -1
- package/packages/core/dist/doctor/doctor.js +1 -18
- package/packages/core/dist/doctor/doctor.js.map +1 -1
- package/packages/core/dist/evidence/lookup.d.ts +1 -1
- package/packages/core/dist/evidence/lookup.js +1 -1
- 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/evidence-runtime/coordination.js +110 -0
- package/packages/core/dist/evidence-runtime/coordination.js.map +1 -0
- package/packages/core/dist/execution/host-invocation.js +83 -83
- package/packages/core/dist/instructions.d.ts +1 -1
- package/packages/core/dist/instructions.js +37 -80
- package/packages/core/dist/instructions.js.map +1 -1
- package/packages/core/dist/lifecycle/ship.js +58 -68
- package/packages/core/dist/lifecycle/ship.js.map +1 -1
- package/packages/core/dist/lifecycle-graph/contracts.d.ts +159 -0
- package/packages/core/dist/lifecycle-graph/contracts.js +7 -0
- package/packages/core/dist/lifecycle-graph/contracts.js.map +1 -0
- package/packages/core/dist/lifecycle-graph/kernel.d.ts +16 -0
- package/packages/core/dist/lifecycle-graph/kernel.js +461 -0
- package/packages/core/dist/lifecycle-graph/kernel.js.map +1 -0
- package/packages/core/dist/lifecycle-graph.d.ts +2 -0
- package/packages/core/dist/lifecycle-graph.js +3 -0
- package/packages/core/dist/lifecycle-graph.js.map +1 -0
- package/packages/core/dist/orchestration/contracts.d.ts +1 -1
- package/packages/core/dist/orchestration/runtime.js +21 -28
- package/packages/core/dist/orchestration/runtime.js.map +1 -1
- package/packages/core/dist/registries/agent-registry.js +124 -40
- package/packages/core/dist/registries/agent-registry.js.map +1 -1
- package/packages/core/dist/registries/command-team-runtime.d.ts +1 -1
- package/packages/core/dist/registries/command-team-runtime.js +6 -13
- package/packages/core/dist/registries/command-team-runtime.js.map +1 -1
- package/packages/core/dist/registries/plan-scout-domains.d.ts +13 -0
- package/packages/core/dist/registries/plan-scout-domains.js +76 -0
- package/packages/core/dist/registries/plan-scout-domains.js.map +1 -0
- package/packages/core/dist/registries/skill-capabilities.js +7 -7
- package/packages/core/dist/registries/skill-capabilities.js.map +1 -1
- package/packages/core/dist/registries/tool-capabilities.js +6 -6
- package/packages/core/dist/registries/tool-capabilities.js.map +1 -1
- package/packages/core/dist/registries/workflow-gates.d.ts +1 -1
- package/packages/core/dist/registries/workflow-gates.js +18 -18
- package/packages/core/dist/registries/workflow-gates.js.map +1 -1
- package/packages/core/dist/risk/consumer-diagnostics.js +2 -1
- package/packages/core/dist/risk/consumer-diagnostics.js.map +1 -1
- package/packages/core/dist/risk/contracts.d.ts +2 -2
- package/packages/core/dist/risk/kernel.js +7 -7
- package/packages/core/dist/risk/kernel.js.map +1 -1
- package/packages/core/dist/risk/legacy-adapters.js +12 -27
- package/packages/core/dist/risk/legacy-adapters.js.map +1 -1
- package/packages/core/dist/risk/workflow-gates.js +6 -6
- 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/routing.js +2 -4
- 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 +383 -0
- package/packages/core/dist/router/runtime-import.js.map +1 -0
- package/packages/core/dist/router/stage-route-binding.d.ts +37 -0
- package/packages/core/dist/router/stage-route-binding.js +227 -0
- package/packages/core/dist/router/stage-route-binding.js.map +1 -0
- package/packages/core/dist/router.d.ts +1 -0
- package/packages/core/dist/router.js +1 -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 +6 -0
- package/packages/core/dist/run-state/artifacts.js.map +1 -1
- package/packages/core/dist/run-state/model.d.ts +20 -0
- package/packages/core/dist/run-state/run-state.js +7 -7
- package/packages/core/dist/run-state/run-state.js.map +1 -1
- package/packages/core/dist/run-state/task-evidence.d.ts +1 -2
- package/packages/core/dist/run-state/task-evidence.js +2 -9
- 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/runtime-analysis/build.js +1 -4
- package/packages/core/dist/runtime-analysis/build.js.map +1 -1
- package/packages/core/dist/runtime-analysis/findings.js +0 -39
- 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 +211 -0
- package/packages/core/dist/runtime-projection-p0.js.map +1 -0
- package/packages/core/dist/sdd-docs/artifact-depth.d.ts +14 -0
- package/packages/core/dist/sdd-docs/artifact-depth.js +179 -0
- package/packages/core/dist/sdd-docs/artifact-depth.js.map +1 -0
- package/packages/core/dist/sdd-docs/task-parser.d.ts +5 -1
- package/packages/core/dist/sdd-docs/task-parser.js +60 -22
- package/packages/core/dist/sdd-docs/task-parser.js.map +1 -1
- package/packages/core/dist/sdd-docs/task-rendering.js +2 -2
- package/packages/core/dist/sdd-docs/task-rendering.js.map +1 -1
- package/packages/core/dist/spec-entry.js +40 -0
- package/packages/core/dist/spec-entry.js.map +1 -0
- package/packages/core/dist/spec-manager-contracts.d.ts +12 -0
- package/packages/core/dist/spec-manager-contracts.js +2 -0
- package/packages/core/dist/spec-manager-contracts.js.map +1 -0
- package/packages/core/dist/stage-artifacts.d.ts +55 -0
- package/packages/core/dist/stage-artifacts.js +315 -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 +238 -0
- package/packages/core/dist/stage-collaboration-contracts.js.map +1 -0
- package/packages/core/dist/stage-collaboration.d.ts +736 -0
- package/packages/core/dist/stage-collaboration.js +4018 -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.js +25 -1
- 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 +597 -85
- package/packages/core/dist/storage/runtime-store.js.map +1 -1
- package/packages/core/dist/sync-back/apply.d.ts +1 -17
- package/packages/core/dist/sync-back/apply.js +1 -242
- package/packages/core/dist/sync-back/apply.js.map +1 -1
- package/packages/core/dist/sync-back/inspect.d.ts +1 -110
- package/packages/core/dist/sync-back/inspect.js +1 -496
- package/packages/core/dist/sync-back/inspect.js.map +1 -1
- package/packages/core/dist/sync-back.d.ts +1 -2
- package/packages/core/dist/sync-back.js +1 -2
- package/packages/core/dist/sync-back.js.map +1 -1
- package/packages/core/dist/task-execution-contract.d.ts +167 -0
- package/packages/core/dist/task-execution-contract.js +377 -0
- package/packages/core/dist/task-execution-contract.js.map +1 -0
- package/packages/core/dist/test-support/fixtures.js +329 -314
- package/packages/core/dist/test-support/fixtures.js.map +1 -1
- package/packages/core/dist/test-support/run-state.d.ts +1 -0
- package/packages/core/dist/test-support/run-state.js +31 -0
- 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 +135 -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 -49
- package/packages/core/dist/verification/goal-verify.js +1 -545
- package/packages/core/dist/verification/goal-verify.js.map +1 -1
- package/packages/core/dist/verification/rendering.d.ts +5 -7
- package/packages/core/dist/verification/rendering.js +15 -55
- package/packages/core/dist/verification/rendering.js.map +1 -1
- package/packages/core/dist/verification/single-task-loop.js +1 -40
- package/packages/core/dist/verification/single-task-loop.js.map +1 -1
- package/packages/core/dist/verification/task-evidence-judgment.d.ts +49 -0
- package/packages/core/dist/verification/task-evidence-judgment.js +521 -0
- package/packages/core/dist/verification/task-evidence-judgment.js.map +1 -0
- package/packages/core/dist/verification/test-runtime.d.ts +12 -2
- package/packages/core/dist/verification/test-runtime.js +247 -112
- 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/verify-contract.d.ts +1 -1
- package/packages/core/dist/verification/verify-contract.js +49 -72
- package/packages/core/dist/verification/verify-contract.js.map +1 -1
- package/packages/core/dist/verification.d.ts +3 -3
- package/packages/core/dist/verification.js +2 -2
- package/packages/core/dist/verification.js.map +1 -1
- package/packages/core/dist/workflow-gate/evidence-packet.js +2 -7
- package/packages/core/dist/workflow-gate/evidence-packet.js.map +1 -1
- package/packages/core/dist/workflow-gate/hard-checks.js +0 -7
- package/packages/core/dist/workflow-gate/hard-checks.js.map +1 -1
- package/packages/core/dist/workflow-gate/policy.js +2 -4
- package/packages/core/dist/workflow-gate/policy.js.map +1 -1
- package/packages/core/dist/workflow-gate/types.d.ts +3 -5
- package/packages/core/dist/workflow-state/latest-eligible-run.js +30 -4
- 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 +518 -36
- 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 +6 -3
- package/tsconfig.build.json +6 -7
- 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/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/node_modules/@sdd-agent-platform/core/src/verification/single-task-loop.test.ts +0 -255
- package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.test.ts +0 -439
- package/node_modules/@sdd-agent-platform/core/src/verification/validation-wave.test.ts +0 -341
- package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.test.ts +0 -204
- package/packages/cli/dist/commands/lifecycle.d.ts +0 -6
- package/packages/cli/dist/commands/lifecycle.js +0 -112
- package/packages/cli/dist/commands/lifecycle.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/commands/test.d.ts +0 -6
- package/packages/cli/dist/commands/test.js +0 -195
- package/packages/cli/dist/commands/test.js.map +0 -1
- package/packages/cli/dist/commands/verifies.d.ts +0 -6
- package/packages/cli/dist/commands/verifies.js +0 -85
- package/packages/cli/dist/commands/verifies.js.map +0 -1
- package/packages/cli/dist/commands/verify.d.ts +0 -6
- package/packages/cli/dist/commands/verify.js +0 -134
- package/packages/cli/dist/commands/verify.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
|
@@ -2,7 +2,7 @@ import { SDD_VERSION } from './ai-tools.js';
|
|
|
2
2
|
|
|
3
3
|
export const SDD_INSTRUCTIONS_CONTRACT = 'sdd-instructions-v1';
|
|
4
4
|
|
|
5
|
-
export type InstructionAction = 'overview' | 'init' | 'doctor' | 'update' | 'spec' | 'plan' | 'tasks' | '
|
|
5
|
+
export type InstructionAction = 'overview' | 'init' | 'doctor' | 'update' | 'spec' | 'plan' | 'tasks' | 'execute' | 'ship';
|
|
6
6
|
|
|
7
7
|
export interface SddInstructionPayload {
|
|
8
8
|
contract: typeof SDD_INSTRUCTIONS_CONTRACT;
|
|
@@ -17,26 +17,25 @@ export interface SddInstructionPayload {
|
|
|
17
17
|
|
|
18
18
|
const INSTRUCTION_PAYLOADS: Record<InstructionAction, Omit<SddInstructionPayload, 'contract' | 'version' | 'action'>> = {
|
|
19
19
|
overview: {
|
|
20
|
-
summary: 'Route natural-language SDD intent
|
|
21
|
-
requiredCommands: ['sdd status', 'sdd
|
|
20
|
+
summary: 'Route natural-language SDD intent through the fixed public lifecycle spec -> plan -> tasks -> execute -> ship while keeping runtime projection, accepted evidence, checkpoint, and release readiness as CLI/core-owned truth.',
|
|
21
|
+
requiredCommands: ['sdd status', 'sdd doctor', 'sdd instructions spec --json', 'sdd instructions plan --json', 'sdd instructions tasks --json', 'sdd instructions execute --json', 'sdd execute --branch <branch> --json', 'sdd ship close --branch <branch> --json'],
|
|
22
22
|
allowedSideEffects: ['read .sdd state', 'read specs documents', 'read generated AI entries'],
|
|
23
|
-
forbiddenSideEffects: ['background write', 'worktree creation', 'auto commit', 'force push', '
|
|
23
|
+
forbiddenSideEffects: ['background write', 'worktree creation', 'auto commit', 'force push', 'publish or push release artifacts without explicit human confirmation'],
|
|
24
24
|
nextSteps: [
|
|
25
25
|
'Treat /sdd as a natural-language intent router, then run sdd status first to see branch/source context and the recommended next command; report only workflow state, blocker/current task, and next action unless the user asks for full detail.',
|
|
26
26
|
'Dynamic routing comes from CLI/core output; follow the recommended next command and do not infer dynamic state from generated markdown.',
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'Use `sdd sync-back inspect|apply` only for explicit diagnostic, recovery, replay, or legacy compatibility work; do not add it as a normal happy-path step.'
|
|
27
|
+
'Use the fixed public lifecycle: /sdd:spec -> /sdd:plan -> /sdd:tasks -> /sdd:execute -> /sdd:ship.',
|
|
28
|
+
'Use /sdd:tasks to produce AI-ready implementation tickets with work-unit context, boundaries, rollback units, completion evidence, validation expected results, and failure routes; verification-design semantics belong in tasks, not a public verifies stage.',
|
|
29
|
+
'Use /sdd:execute for implementation, review, validation, debug, checkpoint, and evidence-judgment lanes; do not expose do/test/verify/goal-verify as public lifecycle stages.',
|
|
30
|
+
'If status reports generated entry drift, missing config, compatibility drift, or projection drift, run sdd doctor and follow its current-run repair or rebuild recommendation before normal execute/ship.',
|
|
31
|
+
'If status recommends a pending task, run sdd tasks inspect <task_id> and execute only the approved task boundary; scout/implementer/reviewer/validator participation should be recorded as stage evidence rather than hidden in the main chat.'
|
|
33
32
|
]
|
|
34
33
|
},
|
|
35
34
|
init: {
|
|
36
35
|
summary: 'Initialize .sdd project configuration and managed AI tool entries for the current repository; workflow partition documents are entered through the spec stage, not init.',
|
|
37
36
|
requiredCommands: ['sdd init --ai claude-code', 'sdd status', 'sdd instructions spec --json', 'sdd doctor'],
|
|
38
|
-
allowedSideEffects: ['write .sdd/project.yml', '
|
|
39
|
-
forbiddenSideEffects: ['create workflow partition documents unless explicitly using the spec stage
|
|
37
|
+
allowedSideEffects: ['write .sdd/project.yml', 'initialize runtime.sqlite state', 'write managed generated AI entries'],
|
|
38
|
+
forbiddenSideEffects: ['create workflow partition documents unless explicitly using the spec stage', 'overwrite foreign AI entry files', 'background write', 'auto commit'],
|
|
40
39
|
nextSteps: ['Run sdd init --ai claude-code.', 'Run sdd status to inspect current Git branch partition state and the recommended next command.', 'Use the spec stage to create or refine specs/<partition>/spec.md; omitted --branch uses the current Git branch, explicit --branch uses the requested partition.', 'Run sdd doctor after initialization.']
|
|
41
40
|
},
|
|
42
41
|
doctor: {
|
|
@@ -54,82 +53,40 @@ const INSTRUCTION_PAYLOADS: Record<InstructionAction, Omit<SddInstructionPayload
|
|
|
54
53
|
nextSteps: ['Run sdd update.', 'Run sdd doctor to verify drift is resolved.']
|
|
55
54
|
},
|
|
56
55
|
spec: {
|
|
57
|
-
summary: '
|
|
58
|
-
requiredCommands: ['sdd status', 'sdd
|
|
59
|
-
allowedSideEffects: ['read project context', '
|
|
60
|
-
forbiddenSideEffects: ['implement code', 'design technical solution in spec.md', 'silently advance to plan', 'auto commit'],
|
|
61
|
-
nextSteps: ['Resolve the workflow partition: omit --branch to use the current Git branch, or pass --branch <name> only when intentionally writing another partition.', '
|
|
56
|
+
summary: 'Enter the spec stage through projection-backed SpecStageWorkOrderHandoff, then let spec-manager produce or refine specs/<partition>/spec.md V3 as the only runtime primary spec artifact for plan/tasks.',
|
|
57
|
+
requiredCommands: ['sdd status', 'sdd instructions spec --json', 'read specs/<partition>/spec.md', 'write specs/<partition>/spec.md', 'sdd spec close --branch <branch> --json'],
|
|
58
|
+
allowedSideEffects: ['read project context', 'read the resolved specs/<partition> directory', 'write final spec.md V3 after spec-manager synthesis', 'optionally write spec-stage side logs under .sdd/runs/<branch>/spec/'],
|
|
59
|
+
forbiddenSideEffects: ['implement code', 'design technical solution in spec.md', 'write spec-stage subagent output as runtime primary evidence', 'silently advance to plan', 'auto commit'],
|
|
60
|
+
nextSteps: ['Resolve the workflow partition: omit --branch to use the current Git branch, or pass --branch <name> only when intentionally writing another partition.', 'Run sdd instructions spec --json and read specStageWorkOrderHandoff; if it is missing, stop on the runtime authority repair reason instead of writing spec.md directly.', 'Hand off to spec-manager with the user request, current spec.md when present, the spec.md V3 artifact-depth template, and the projection-backed handoff.', 'Spec-manager uses the content chain surface request -> reframed problem -> real intent -> scope boundary -> acceptance criterion -> evidence target; it resolves knowable or researchable uncertainty through scout evidence when useful and asks the user only for blocking user decisions.', 'Spec-reviewer pressure should identify changelog-only specs, hidden user decisions, weak acceptance evidence, and plan/task leakage as repairable content findings, not runtime primary evidence.', 'Final spec.md V3 should contain Problem Reframing / Intent Discovery, Change Delta, Scope, Requirements with reasoning, Acceptance Criteria / Evidence Targets, Definitions / Rules, Planning Constraints / Signals, Open Questions / Ambiguity Ledger, and Close Quality Evidence.', 'Treat scout output, review output, and manager trace as internal or side-log material; runtime spec close accepts final spec.md ref/hash plus boundary facts only.', 'Do not include legacy lifecycle metadata, runtime gate metadata, candidate/analyzer handoff wording, implementation plan, task list, validation plan, or subagent trace in spec.md.', 'If blocking user decisions remain before plan, spec-manager must ask the user before producing a close-ready final spec.md.', 'Run sdd spec close --branch <branch> --json after final spec.md V3 is ready; plan/tasks must consume only the runtime accepted spec ref/hash.']
|
|
62
61
|
},
|
|
63
62
|
plan: {
|
|
64
|
-
summary: '
|
|
65
|
-
requiredCommands: ['sdd status', 'read
|
|
66
|
-
allowedSideEffects: ['read project context', 'read spec document', 'write
|
|
67
|
-
forbiddenSideEffects: ['implement code', 'silently advance to tasks', 'bypass unresolved spec gaps'],
|
|
68
|
-
nextSteps: ['
|
|
63
|
+
summary: 'Enter the plan stage through projection-backed PlanStageWorkOrderHandoff, then let plan-manager produce specs/<partition>/plan.md V3 as an AI-ready technical design artifact for tasks.',
|
|
64
|
+
requiredCommands: ['sdd status', 'sdd instructions plan --json', 'read planStageWorkOrderHandoff.acceptedSpecRef', 'read accepted specs/<partition>/spec.md by matching hash', 'write specs/<partition>/plan.md', 'sdd plan close --branch <branch> --json'],
|
|
65
|
+
allowedSideEffects: ['read project context', 'read runtime-accepted spec document by ref/hash', 'write final plan.md V3 after plan-manager synthesis', 'optionally write plan-stage side logs under .sdd/runs/<branch>/plan/'],
|
|
66
|
+
forbiddenSideEffects: ['runtime-authored Markdown artifacts', 'implement code', 'silently advance to tasks', 'bypass unresolved spec gaps', 'write plan-stage side logs as runtime primary evidence', 'put task topology or task decomposition in plan.md'],
|
|
67
|
+
nextSteps: ['Run sdd instructions plan --json and read planStageWorkOrderHandoff; if it is missing, stop on the runtime authority repair reason instead of planning from latest spec.md.', 'Verify the opened specs/<partition>/spec.md content hash matches planStageWorkOrderHandoff.acceptedSpecRef before planning.', 'Hand off to plan-manager with the accepted spec, current plan.md when present, the plan.md V3 technical design depth template, and the projection-backed handoff.', 'Plan-manager uses the content chain code/data fact -> design implication -> technical decision -> risk control -> validation scenario, grounded in concrete project files, APIs, SQL, UI, config, or tests.', 'Use plan-scout as bounded evidence-to-plan input when code/data/domain facts are missing, and use plan-review-agent to detect dense-but-shallow plans, vague mappings, missing risk controls, weak validation hooks, and task-list leakage.', 'Do not consume spec-stage side logs, subagent payload, warnings, or spec-manager internal trace as plan input; do not expose plan-stage side logs to tasks-stage as primary input.', 'Final plan.md V3 should contain Upstream Spec Trace, Planning Problem / Strategy Framing, Current Implementation Map, Target Design Overview, Change Topology / Responsibility Boundaries, Interface / API / Schema Design, State / Data / Concurrency Design, Key Design Decisions, Alternatives Considered, Risk Controls, Validation Strategy, Rollout / Rollback / Compatibility, Task-stage Constraints, Open Questions / User Decisions, and Plan Close Quality Evidence.', 'If blocking design decisions or open questions remain before tasks, plan-manager must ask the user before producing a close-ready final plan.md.', 'Plan side logs and professional agent findings may exist as optional/internal audit material, but runtime plan close accepts final plan.md ref/hash plus boundary facts only.', 'Do not include task graph, task units, task decomposition, code diff, validation results, runtime gate metadata, candidate/analyzer wording, or subagent trace in plan.md.', 'Run sdd plan close --branch <branch> --json after final plan.md V3 is ready; tasks must consume only the runtime accepted spec and plan refs/hashes.']
|
|
69
68
|
},
|
|
70
69
|
tasks: {
|
|
71
|
-
summary: '
|
|
72
|
-
requiredCommands: ['sdd status', '
|
|
73
|
-
allowedSideEffects: ['read spec and plan documents', 'write
|
|
74
|
-
forbiddenSideEffects: ['implement code', 'execute dependency waves', 'run validation commands', 'silently advance to
|
|
75
|
-
nextSteps: ['
|
|
70
|
+
summary: 'Enter the tasks stage through projection-backed TasksStageWorkOrderHandoff, then let tasks-manager produce specs/<partition>/tasks.md V2 as a readable execute playbook, not a runtime metadata form.',
|
|
71
|
+
requiredCommands: ['sdd status', 'sdd instructions tasks --json', 'read tasksStageWorkOrderHandoff.acceptedSpecRef', 'read tasksStageWorkOrderHandoff.acceptedPlanRef', 'read accepted specs/<partition>/spec.md and plan.md by matching hashes', 'sdd tasks format', 'write specs/<partition>/tasks.md', 'sdd tasks close --branch <branch> --json'],
|
|
72
|
+
allowedSideEffects: ['read runtime-accepted spec and plan documents by ref/hash', 'write final tasks.md V2 after tasks-manager synthesis', 'optionally write tasks-stage side logs under .sdd/runs/<branch>/tasks/'],
|
|
73
|
+
forbiddenSideEffects: ['runtime-authored Markdown artifacts', 'implement code', 'execute dependency waves', 'run validation commands', 'silently advance to execute', 'turn tasks.md into project-management backlog', 'write tasks-stage side logs as runtime primary evidence'],
|
|
74
|
+
nextSteps: ['Run sdd instructions tasks --json and read tasksStageWorkOrderHandoff; if it is missing, stop on the runtime authority repair reason instead of slicing from latest docs.', 'Verify opened specs/<partition>/spec.md and plan.md content hashes match tasksStageWorkOrderHandoff accepted upstream refs before task slicing.', 'Hand off to tasks-manager with accepted spec, accepted plan, current tasks.md when present, the tasks.md V2 execution playbook rubric, and the projection-backed handoff.', 'Tasks-manager builds coverage across requirements, acceptance criteria, plan decisions, risks, and non-goals, then writes task units using the chain: plan decision -> work-unit boundary -> dependency / rollback rationale -> internal execution sequence -> completion evidence -> one-to-one validation task -> failure route.', 'Do not mechanically split by file type: if backend Java, SQL, XML/Dubbo wiring, UI/config, or other surfaces are one rollback unit, keep them in one implementation task and write ordered internal steps for execute.', 'Every implementation task must hand off to exactly one validation task, and every validation task must validate exactly one implementation task; split broad validation scenarios into per-task checks instead of many-to-one mappings.', 'Prefer readable execute context over schema-first metadata: each task should explain why it exists, where execute should start, what to change, what not to change, what proves completion, which validation task proves it, and where failure routes.', 'Implementation tasks do code review and basic code sanity only; validation closure belongs to validation task units and execute validation lanes.', 'Use task-slicer when rollback unit, dependency unlock, validation closure, shared writable ownership, or parallelism safety is unclear.', 'Use task-review-agent to detect TOO_THIN_FOR_EXECUTE, CHECKLIST_TASKS, SCHEMA_FIRST_TASKS, BOUNDARY_CONFLICT, VALIDATION_INSUFFICIENT, oversized-without-sequence, many-to-one validation, scope expansion, missing expected results, and missing failure routes.', 'Keep only minimal structured anchors needed for routing and parsing; do not add obligation matrices, runtime projection payloads, or metadata fields just to force quality.', 'Tasks side logs and review notes may exist as optional/internal audit material, but runtime tasks close accepts final tasks.md ref/hash plus boundary facts only.', 'Do not include code diff, validation execution results, long-term backlog state, runtime gate metadata, candidate/analyzer wording, subagent trace, or obligation/projection payloads in tasks.md.', 'Run sdd tasks close --branch <branch> --json after final tasks.md V2 is ready; execute must consume only the runtime accepted tasks ref/hash plus minimal task routing/read model.']
|
|
76
75
|
},
|
|
77
|
-
|
|
78
|
-
summary: '
|
|
79
|
-
requiredCommands: ['sdd status', 'sdd
|
|
80
|
-
allowedSideEffects: ['
|
|
81
|
-
forbiddenSideEffects: ['
|
|
82
|
-
nextSteps: ['Run sdd status and confirm
|
|
83
|
-
},
|
|
84
|
-
test: {
|
|
85
|
-
summary: 'Execute validation commands from the frozen tasks.md + verify.md contract boundary, capture command output, evaluate acceptance evidence coverage, and return one unified task, batch, or wave judgment without authoring verify.md.',
|
|
86
|
-
requiredCommands: ['sdd status', 'sdd test task <task_id> --branch <branch>', 'sdd test batch <batch_id> --branch <branch>', 'sdd test wave --branch <branch> --wave <n>'],
|
|
87
|
-
allowedSideEffects: ['run declared validation commands', 'write branch-scoped test evidence artifacts', 'update runtime.sqlite test run and validation wave records', 'write validator evidence artifact'],
|
|
88
|
-
forbiddenSideEffects: ['modify source files outside the validation command effects', 'author or refresh verify.md', 'apply sync-back', 'auto commit', 'publish or push', 'treat command success alone as semantic PASS'],
|
|
89
|
-
nextSteps: ['Run sdd status and resolve the task, batch, or wave boundary plus branch.', 'Confirm verify.md exists and is current for the selected branch; if it is missing or stale, return to /sdd:tasks or use explicit sdd verifies write recovery before executing tests.', 'Use sdd test task <task_id> --branch <branch> for strict/task_end tasks or deliberate narrowed overrides with --run, --command, --command-json, --command-file, or passthrough argv.', 'Use sdd test batch <batch_id> --branch <branch> or sdd test wave --branch <branch> --wave <n> for batch_end or wave_end tasks so accumulated implementation evidence is judged together.', 'Inspect the generated command logs, test index, validator artifacts, acceptance maps, and workflow gate decision.', 'If the selected test boundary returns PASS, proceed to a decision card if policy requires one, otherwise run `sdd ship --branch <branch> --dry-run`; if it returns FAIL or BLOCKED, fix the reported command/evidence gaps and rerun the same boundary.']
|
|
90
|
-
},
|
|
91
|
-
do: {
|
|
92
|
-
summary: 'Execute one approved task boundary through the ingestion-aware SDD task workflow with explicit scout/implementer/reviewer/validator evidence handoff.',
|
|
93
|
-
requiredCommands: ['sdd status', 'sdd instructions do --json', 'sdd tasks inspect <task_id>', 'sdd artifact template artifacts/<agent>-<task_id>.md --task <task_id> --agent <agent> --run <run_id> --write', 'sdd artifact validate <run_id> <artifact> --task <task_id> --agent <agent>', 'sdd do task <task_id>'],
|
|
94
|
-
allowedSideEffects: ['write branch-scoped .sdd/runs evidence artifacts', 'update runtime.sqlite run state', 'modify files within selected task boundary'],
|
|
95
|
-
forbiddenSideEffects: ['background write', 'worktree creation', 'auto commit', 'expand beyond selected task boundary without checkpoint', 'mark missing evidence as PASS'],
|
|
96
|
-
nextSteps: ['Run sdd status and resolve exactly one task id from the user request or recommended next command.', 'Run sdd instructions do --json and sdd tasks inspect <task_id>.', 'Restate only the task Boundary, blocking gaps, and validation commands before implementation.', 'Use scout for bounded context only, implementer for selected-boundary edits, reviewer for review evidence, and validator for validation plus acceptance mapping.', 'Create or resolve the task run id, then write implement/review/validation result artifacts only with sdd artifact template artifacts/<agent>-<task_id>.md --task <task_id> --agent <agent> --run <run_id> --write; do not manually create copies under specs/<branch>/artifacts/ or specs/<branch>/evidence/artifacts/.', 'Pass run-relative artifacts/<file> paths to CLI flags, and keep source/test files in ## Evidence, not in sdd-result.artifacts.', 'Run sdd artifact validate before passing artifacts into sdd do task <task_id>.', 'Run or coordinate implementation only within the selected task boundary.', 'Run sdd do task <task_id> with explicit artifact paths when evidence is available.', 'Report run id, final status, blocking gaps, and next gate; if completed, follow sdd status recommended next command: continue sequential sdd do task, run sdd test task for strict/task_end work, or run sdd test batch / sdd test wave at the declared validation boundary.']
|
|
97
|
-
},
|
|
98
|
-
verify: {
|
|
99
|
-
summary: 'Run compatibility/diagnostic task acceptance coverage from reviewer/validator artifacts, resolving the latest eligible run from partition + task id unless --run is explicit; `sdd test task|batch|wave` is the primary runtime gate.',
|
|
100
|
-
requiredCommands: ['sdd status', 'sdd instructions verify --json', 'sdd artifact template artifacts/validation-<task_id>.md --task <task_id> --agent validator --run <run_id> --write', 'sdd artifact validate <run_id> <artifact> --task <task_id> --agent validator', 'sdd verify task <task_id> [--branch <branch>] [--run <run_id>]'],
|
|
101
|
-
allowedSideEffects: ['write acceptance coverage artifact', 'update runtime.sqlite diagnostic verification state'],
|
|
102
|
-
forbiddenSideEffects: ['auto commit', 'force push', 'auto-fix failures', 'create sync-back proposal as normal happy path', 'unapproved sync-back apply', 'mark completed with blocking validation gaps'],
|
|
103
|
-
nextSteps: ['Run sdd status and resolve exactly one task id plus workflow partition from the recommended command or user request.', 'Omit --run by default so CLI resolves the latest eligible run for partition + task id; pass --run only for explicit replay, CI, or old-run inspection.', 'Ensure the validator artifact includes exact Acceptance text, preferably under ## Acceptance Mapping from sdd artifact template.', 'When a validator artifact must be created manually for a run, write it only with sdd artifact template artifacts/validation-<task_id>.md --task <task_id> --agent validator --run <run_id> --write; do not manually create copies under specs/<branch>/artifacts/ or specs/<branch>/evidence/artifacts/.', 'Pass run-relative artifacts/<file> paths to validate/verify CLI flags.', 'Run sdd artifact validate before compatibility verify.', 'Run sdd instructions verify --json and sdd verify task <task_id> --branch <branch> only for explicit low-level diagnostics.', 'For the primary lifecycle path, use `sdd test task|batch|wave`; after PASS proceed to a decision card if policy requires one or `sdd ship --branch <branch> --dry-run`.', 'Report PASS/BLOCKED status and unresolved blockers; avoid pasting full acceptance coverage unless requested.']
|
|
104
|
-
},
|
|
105
|
-
'sync-back': {
|
|
106
|
-
summary: 'Inspect or replay verified task completion write-back state for diagnostic, recovery, replay, and legacy compatibility use.',
|
|
107
|
-
requiredCommands: ['sdd status', 'sdd instructions sync-back --json', 'sdd sync-back inspect [<run_id>] --branch <branch> --task <task_id>', 'sdd sync-back apply [<run_id>] --branch <branch> --task <task_id> [--approved]'],
|
|
108
|
-
allowedSideEffects: ['read runtime.sqlite run state', 'read sync-back proposal artifact', 'read specs/<partition>/tasks.md', 'write specs/<partition>/tasks.md during apply', 'write specs/<partition>/verify.md only when explicit --refresh-verify is supplied', 'update run sync_back state only during apply'],
|
|
109
|
-
forbiddenSideEffects: ['auto commit', 'force push', 'apply without inspect', 'apply confirm-required proposals without human approval', 'change source files outside tasks.md'],
|
|
110
|
-
nextSteps: ['Run sdd status and resolve exactly one task id plus workflow partition from an explicit diagnostic, recovery, replay, CI, or old-run inspection request.', 'Run sdd sync-back inspect --branch <branch> --task <task_id> first; pass an explicit run id only for replay, CI, or old-run inspection.', 'Report the inspect target update before asking for approval: target tasks file, task id, markdown status transition, proposal path, evidence artifacts, apply_policy, and policy reasons.', 'If apply_policy=direct and status=ready, run sdd sync-back apply --branch <branch> --task <task_id> only for explicit recovery/replay; if approval_required=true, ask for explicit confirmation and then add --approved.', 'Explain that default apply writes the task block status to completed, appends the sync-back implementation note from the proposal/evidence, marks the run sync_back state applied, and rebuilds the local run index; --refresh-verify is an explicit recovery option after reviewed task-contract changes.', 'After apply, report the updated task id, tasks.md path, applied flag, and sync_back state.']
|
|
76
|
+
execute: {
|
|
77
|
+
summary: 'Use /sdd:execute to consume accepted tasks.md ref/hash and the selected task brief, then implement or validate from readable task context without reinterpreting spec.md or plan.md.',
|
|
78
|
+
requiredCommands: ['sdd status', 'sdd instructions execute --json', 'sdd tasks inspect <bound_task_id>', 'sdd execute --branch <branch> --json', 'sdd execute close --branch <branch> --json'],
|
|
79
|
+
allowedSideEffects: ['modify files within selected task boundaries', 'run declared validation commands', 'write optional agent-authored execute side evidence under .sdd/runs/<branch>/execute/', 'update runtime.sqlite projections and run state through runtime commands'],
|
|
80
|
+
forbiddenSideEffects: ['runtime-authored Markdown artifacts', 'background write', 'worktree creation', 'auto commit', 'expand beyond selected task boundary without checkpoint', 'treat command success alone as semantic PASS', 'publish or push'],
|
|
81
|
+
nextSteps: ['Run sdd status and confirm the active public stage is execute or the recommended next command routes to execute.', 'Use the accepted tasks -> execute handoff and selected task brief as the primary input; read spec.md/plan.md only as shallow constraints for ambiguity, acceptance mapping, and goal validation.', 'If the current tasks.md hash differs from the accepted tasks ref/hash, stop and route back to tasks close/repair before implementation.', 'Use implementation board lanes for implementation/review/debug work and validation/checkpoint/evidence-judgment work; report them as execute lane state, not separate public stages.', 'Start from task context: why the task exists, where to start, allowed/forbidden boundary, completion evidence, validation handoff, and failure route. Do not repair tasks.md during execute unless runtime routes back to tasks.', 'Close the public stage through sdd execute close --branch <branch> --json; execute close validates accepted tasks ref/hash and projections, not fixed execute Markdown evidence files.', 'Stop and route back to tasks/plan/spec if the task brief still lacks boundary, validation, checkpoint, acceptance, or routing context after reading the accepted tasks artifact.']
|
|
111
82
|
},
|
|
112
83
|
ship: {
|
|
113
|
-
summary: '
|
|
114
|
-
requiredCommands: ['sdd ship --
|
|
115
|
-
allowedSideEffects: ['read project status', 'read SDD documents and run evidence', 'write
|
|
116
|
-
forbiddenSideEffects: ['npm publish', 'git push', 'git tag', 'create GitHub release', 'force push', 'auto commit', 'skip failed gates', 'treat historical doctor debt as a release blocker unless it affects current run evidence'],
|
|
117
|
-
nextSteps: ['Run sdd
|
|
118
|
-
},
|
|
119
|
-
'run-task': {
|
|
120
|
-
summary: 'Run the ingestion-aware task workflow using CLI/core runtime state and artifacts.',
|
|
121
|
-
requiredCommands: ['sdd tasks inspect <task_id>', 'sdd do task <task_id>'],
|
|
122
|
-
allowedSideEffects: ['write branch-scoped .sdd/runs evidence artifacts', 'update runtime.sqlite run state'],
|
|
123
|
-
forbiddenSideEffects: ['background write', 'worktree creation', 'auto commit'],
|
|
124
|
-
nextSteps: ['Inspect the task.', 'Run the task loop with explicit artifacts and validation evidence.']
|
|
84
|
+
summary: 'Close ship readiness through agent-authored .sdd/runs/<branch>/ship/*.md evidence; optional release.md is ship-agent authored, not runtime-authored.',
|
|
85
|
+
requiredCommands: ['sdd status', 'sdd instructions ship --json', 'write .sdd/runs/<branch>/ship/ship-readiness-vN.md', 'write .sdd/runs/<branch>/ship/release-review-vN.md', 'write .sdd/runs/<branch>/ship/ship-manager-vN.md', 'write .sdd/runs/<branch>/ship/ship-collaboration-contract-vN.md', 'sdd ship close --branch <branch> --json', 'npm run build', 'npm pack --dry-run --json', 'git status'],
|
|
86
|
+
allowedSideEffects: ['read project status', 'read SDD documents and run evidence', 'write agent-authored .sdd/runs/<branch>/ship/*.md evidence', 'write optional agent-authored specs/<branch>/release.md', 'run local validation commands', 'record runtime ship projections in .sdd/runtime.sqlite'],
|
|
87
|
+
forbiddenSideEffects: ['runtime-authored Markdown artifacts', 'npm publish', 'git push', 'git tag', 'create GitHub release', 'force push', 'auto commit', 'skip failed gates', 'treat historical doctor debt as a release blocker unless it affects current run evidence'],
|
|
88
|
+
nextSteps: ['Run sdd status and confirm execute has accepted implementation, validation, checkpoint, and evidence-judgment evidence for the branch.', 'Have ship-manager/release agent author .sdd/runs/<branch>/ship/*.md evidence including a StageCollaborationContract; write specs/<branch>/release.md only as an explicit ship-agent artifact if needed.', 'Run sdd ship close --branch <branch> --json; runtime validates readiness refs/contracts/truthAlignment and writes only .sdd/runtime.sqlite.', 'Run package/build dry-run gates when preparing a real release.', 'Report PASS/BLOCKED by runtime ship readiness and local package checks.', 'Stop before npm publish, git push, git tag, or external release creation unless the user explicitly approves that separate action.']
|
|
125
89
|
},
|
|
126
|
-
'verify-task': {
|
|
127
|
-
summary: 'Verify task acceptance coverage using CLI/core verifier artifacts and partition-aware run resolution.',
|
|
128
|
-
requiredCommands: ['sdd verify task <task_id> [--branch <branch>] [--run <run_id>]'],
|
|
129
|
-
allowedSideEffects: ['write acceptance coverage artifact', 'update .sdd run state'],
|
|
130
|
-
forbiddenSideEffects: ['auto commit', 'force push', 'unapproved sync-back apply'],
|
|
131
|
-
nextSteps: ['Run goal-level verify without --run for the latest eligible partition/task run, unless inspecting an explicit run.', 'Use sdd test task for primary lifecycle judgment; use sync-back only for explicit diagnostic/recovery/replay.']
|
|
132
|
-
}
|
|
133
90
|
};
|
|
134
91
|
|
|
135
92
|
|
|
@@ -161,5 +118,5 @@ export function renderSddInstructions(payload: SddInstructionPayload): string {
|
|
|
161
118
|
}
|
|
162
119
|
|
|
163
120
|
function isInstructionAction(action: string): action is InstructionAction {
|
|
164
|
-
return action === 'overview' || action === 'init' || action === 'doctor' || action === 'update' || action === 'spec' || action === 'plan' || action === 'tasks' || action === '
|
|
121
|
+
return action === 'overview' || action === 'init' || action === 'doctor' || action === 'update' || action === 'spec' || action === 'plan' || action === 'tasks' || action === 'execute' || action === 'ship';
|
|
165
122
|
}
|
|
@@ -1,174 +1,174 @@
|
|
|
1
|
-
import test from 'node:test';
|
|
2
|
-
import assert from 'node:assert/strict';
|
|
3
|
-
import { mkdtemp, rm } from 'node:fs/promises';
|
|
4
|
-
import { tmpdir } from 'node:os';
|
|
5
|
-
import path from 'node:path';
|
|
6
|
-
|
|
7
|
-
import { initProject } from '../config/init-project.js';
|
|
8
|
-
import { readRunEvents } from '../run-state/events.js';
|
|
9
|
-
import { createRun, readRunState } from '../run-state/run-state.js';
|
|
10
|
-
import { evaluateLifecycleDecisionGate, recordLifecycleDecision } from './decision-gate.js';
|
|
11
|
-
import { renderLifecycleDecisionGate } from './rendering.js';
|
|
12
|
-
import { extractLifecycleRiskSignalsFromText } from './risk-signals.js';
|
|
13
|
-
|
|
14
|
-
test('lifecycle decision gate allows direct only through conservative whitelist', () => {
|
|
15
|
-
const result = evaluateLifecycleDecisionGate({
|
|
16
|
-
intent_clarity: 'high',
|
|
17
|
-
acceptance_clarity: 'high',
|
|
18
|
-
estimated_change_size: 'tiny',
|
|
19
|
-
task_count_estimate: 1,
|
|
20
|
-
file_count_estimate: 1,
|
|
21
|
-
impact_confidence: 'high',
|
|
22
|
-
risk_tags: [],
|
|
23
|
-
reversibility: 'reversible',
|
|
24
|
-
validation_clarity: 'clear',
|
|
25
|
-
validation_available: true,
|
|
26
|
-
validation_cost: 'cheap',
|
|
27
|
-
requires_agents: false,
|
|
28
|
-
handoff_count: 0,
|
|
29
|
-
artifact_dependency: false,
|
|
30
|
-
runtime_recovery_need: false,
|
|
31
|
-
orchestration_uncertainty: 'low'
|
|
32
|
-
}, new Date('2026-05-01T00:00:00.000Z'));
|
|
33
|
-
|
|
34
|
-
assert.equal(result.record.decision.profile, 'direct');
|
|
35
|
-
assert.equal(result.record.decision.confidence, 'high');
|
|
36
|
-
assert.equal(result.record.decision.hard_gate_hits.length, 0);
|
|
37
|
-
assert.equal(result.record.decision.human_checkpoint_required, false);
|
|
38
|
-
assert.equal(result.record.decision.skipped_stages.includes('full-spec'), true);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
test('lifecycle hard gates force full profile for contract and state risks', () => {
|
|
42
|
-
const result = evaluateLifecycleDecisionGate({
|
|
43
|
-
intent_clarity: 'high',
|
|
44
|
-
acceptance_clarity: 'high',
|
|
45
|
-
impact_confidence: 'high',
|
|
46
|
-
validation_clarity: 'clear',
|
|
47
|
-
validation_available: true,
|
|
48
|
-
validation_cost: 'cheap',
|
|
49
|
-
reversibility: 'reversible',
|
|
50
|
-
affected_contracts: ['public-api'],
|
|
51
|
-
risk_tags: ['state-machine']
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
assert.equal(result.record.decision.profile, 'full');
|
|
55
|
-
assert.equal(result.record.decision.hard_gate_hits.includes('api_schema_contract'), true);
|
|
56
|
-
assert.equal(result.record.decision.hard_gate_hits.includes('state_machine_concurrency_liveness'), true);
|
|
57
|
-
assert.equal(result.record.decision.required_stages.includes('verify'), true);
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
test('lifecycle database risk forces full hard gate and human checkpoint', () => {
|
|
61
|
-
const result = evaluateLifecycleDecisionGate({
|
|
62
|
-
intent_clarity: 'high',
|
|
63
|
-
acceptance_clarity: 'high',
|
|
64
|
-
impact_confidence: 'high',
|
|
65
|
-
validation_clarity: 'clear',
|
|
66
|
-
validation_available: true,
|
|
67
|
-
validation_cost: 'cheap',
|
|
68
|
-
reversibility: 'reversible',
|
|
69
|
-
risk_tags: ['database']
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
assert.equal(result.record.decision.profile, 'full');
|
|
73
|
-
assert.equal(result.record.decision.hard_gate_hits.includes('database_or_data_loss'), true);
|
|
74
|
-
assert.equal(result.record.decision.human_checkpoint_required, true);
|
|
75
|
-
assert.equal(result.checkpointRequired, true);
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
test('Phase 5.1 lifecycle risk extraction maps Chinese hard-gate text', () => {
|
|
79
|
-
const extraction = extractLifecycleRiskSignalsFromText('三线程状态流转,并发更新,SQL 拼接,数据一致性风险');
|
|
80
|
-
const categories = extraction.evidence.map((item) => item.category);
|
|
81
|
-
const result = evaluateLifecycleDecisionGate(extraction.signals);
|
|
82
|
-
const rendered = renderLifecycleDecisionGate(result);
|
|
83
|
-
|
|
84
|
-
assert.equal(extraction.source, 'from_text');
|
|
85
|
-
assert.equal(extraction.riskTags.includes('state-machine'), true);
|
|
86
|
-
assert.equal(extraction.riskTags.includes('concurrency'), true);
|
|
87
|
-
assert.equal(extraction.riskTags.includes('database'), true);
|
|
88
|
-
assert.equal(categories.includes('state_machine'), true);
|
|
89
|
-
assert.equal(categories.includes('concurrency'), true);
|
|
90
|
-
assert.equal(categories.includes('sql'), true);
|
|
91
|
-
assert.equal(categories.includes('database_data_loss'), true);
|
|
92
|
-
assert.equal(result.record.decision.profile, 'full');
|
|
93
|
-
assert.equal(result.record.decision.hard_gate_hits.includes('state_machine_concurrency_liveness'), true);
|
|
94
|
-
assert.equal(result.record.decision.hard_gate_hits.includes('database_or_data_loss'), true);
|
|
95
|
-
assert.equal(result.autonomyCeiling, 'full_sdd_with_checkpoint');
|
|
96
|
-
assert.equal(rendered.includes('Lifecycle checkpoint is required.'), true);
|
|
97
|
-
assert.equal(rendered.includes('Why:'), true);
|
|
98
|
-
assert.equal(rendered.includes('Next:'), true);
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
test('lifecycle checkpoint triggers are recorded without executing workflow', () => {
|
|
102
|
-
const result = evaluateLifecycleDecisionGate({
|
|
103
|
-
intent_clarity: 'high',
|
|
104
|
-
acceptance_clarity: 'high',
|
|
105
|
-
impact_confidence: 'high',
|
|
106
|
-
validation_clarity: 'clear',
|
|
107
|
-
validation_available: true,
|
|
108
|
-
validation_cost: 'cheap',
|
|
109
|
-
reversibility: 'reversible',
|
|
110
|
-
policy_hits: ['git_commit'],
|
|
111
|
-
permission_required: ['dependency_install'],
|
|
112
|
-
human_checkpoint_required: true
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
assert.equal(result.record.decision.profile, 'compact');
|
|
116
|
-
assert.equal(result.record.decision.human_checkpoint_required, true);
|
|
117
|
-
assert.equal(result.record.decision.hard_gate_hits.includes('policy_or_permission_checkpoint'), true);
|
|
118
|
-
assert.match(result.boundaries.join('\n'), /must not execute Phase 1.8 task implementation loop/);
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
test('lifecycle research gate handles unscoutable unknown impact', () => {
|
|
122
|
-
const result = evaluateLifecycleDecisionGate({
|
|
123
|
-
impact_confidence: 'low',
|
|
124
|
-
can_scout_impact: false
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
assert.equal(result.record.decision.profile, 'research');
|
|
128
|
-
assert.equal(result.record.decision.confidence, 'low');
|
|
129
|
-
assert.equal(result.record.decision.hard_gate_hits.includes('low_impact_confidence_unscoutable'), true);
|
|
130
|
-
assert.equal(result.record.decision.required_stages[0], 'research');
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
test('lifecycle decision gate emits canonical Phase 1.3 contract id for new records', () => {
|
|
134
|
-
const result = evaluateLifecycleDecisionGate({
|
|
135
|
-
intent_clarity: 'high',
|
|
136
|
-
acceptance_clarity: 'high',
|
|
137
|
-
impact_confidence: 'high',
|
|
138
|
-
validation_clarity: 'clear',
|
|
139
|
-
validation_available: true,
|
|
140
|
-
validation_cost: 'cheap',
|
|
141
|
-
reversibility: 'reversible'
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
assert.equal(result.record.contract, 'sdd-lifecycle-decision-v1');
|
|
145
|
-
assert.equal(result.record.version, '1.3.0');
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
test('recordLifecycleDecision persists command gate output to run state and events', async () => {
|
|
149
|
-
const root = await mkdtemp(path.join(tmpdir(), 'sdd-lifecycle-'));
|
|
150
|
-
try {
|
|
151
|
-
await initProject(root);
|
|
152
|
-
const state = await createRun(root, { runId: 'run-1' });
|
|
153
|
-
const result = evaluateLifecycleDecisionGate({
|
|
154
|
-
intent_clarity: 'high',
|
|
155
|
-
acceptance_clarity: 'high',
|
|
156
|
-
impact_confidence: 'high',
|
|
157
|
-
validation_clarity: 'clear',
|
|
158
|
-
validation_available: true,
|
|
159
|
-
validation_cost: 'cheap',
|
|
160
|
-
reversibility: 'reversible',
|
|
161
|
-
risk_tags: ['database']
|
|
162
|
-
}, new Date('2026-05-01T00:00:00.000Z'));
|
|
163
|
-
|
|
164
|
-
await recordLifecycleDecision(root, state.runId, result.record);
|
|
165
|
-
const restored = await readRunState(root, state.runId);
|
|
166
|
-
const events = await readRunEvents(root, state.runId);
|
|
167
|
-
assert.equal(restored.lifecycleDecision?.decision.profile, 'full');
|
|
168
|
-
assert.equal(restored.lifecycleDecision?.decision.hard_gate_hits.includes('database_or_data_loss'), true);
|
|
169
|
-
assert.equal(restored.lifecycleDecision?.decision.human_checkpoint_required, true);
|
|
170
|
-
assert.equal(events.some((event) => /Lifecycle decision recorded by Phase 1.7 command gate/.test(event.summary ?? '')), true);
|
|
171
|
-
} finally {
|
|
172
|
-
await rm(root, { recursive: true, force: true });
|
|
173
|
-
}
|
|
174
|
-
});
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { mkdtemp, rm } from 'node:fs/promises';
|
|
4
|
+
import { tmpdir } from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
|
|
7
|
+
import { initProject } from '../config/init-project.js';
|
|
8
|
+
import { readRunEvents } from '../run-state/events.js';
|
|
9
|
+
import { createRun, readRunState } from '../run-state/run-state.js';
|
|
10
|
+
import { evaluateLifecycleDecisionGate, recordLifecycleDecision } from './decision-gate.js';
|
|
11
|
+
import { renderLifecycleDecisionGate } from './rendering.js';
|
|
12
|
+
import { extractLifecycleRiskSignalsFromText } from './risk-signals.js';
|
|
13
|
+
|
|
14
|
+
test('lifecycle decision gate allows direct only through conservative whitelist', () => {
|
|
15
|
+
const result = evaluateLifecycleDecisionGate({
|
|
16
|
+
intent_clarity: 'high',
|
|
17
|
+
acceptance_clarity: 'high',
|
|
18
|
+
estimated_change_size: 'tiny',
|
|
19
|
+
task_count_estimate: 1,
|
|
20
|
+
file_count_estimate: 1,
|
|
21
|
+
impact_confidence: 'high',
|
|
22
|
+
risk_tags: [],
|
|
23
|
+
reversibility: 'reversible',
|
|
24
|
+
validation_clarity: 'clear',
|
|
25
|
+
validation_available: true,
|
|
26
|
+
validation_cost: 'cheap',
|
|
27
|
+
requires_agents: false,
|
|
28
|
+
handoff_count: 0,
|
|
29
|
+
artifact_dependency: false,
|
|
30
|
+
runtime_recovery_need: false,
|
|
31
|
+
orchestration_uncertainty: 'low'
|
|
32
|
+
}, new Date('2026-05-01T00:00:00.000Z'));
|
|
33
|
+
|
|
34
|
+
assert.equal(result.record.decision.profile, 'direct');
|
|
35
|
+
assert.equal(result.record.decision.confidence, 'high');
|
|
36
|
+
assert.equal(result.record.decision.hard_gate_hits.length, 0);
|
|
37
|
+
assert.equal(result.record.decision.human_checkpoint_required, false);
|
|
38
|
+
assert.equal(result.record.decision.skipped_stages.includes('full-spec'), true);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test('lifecycle hard gates force full profile for contract and state risks', () => {
|
|
42
|
+
const result = evaluateLifecycleDecisionGate({
|
|
43
|
+
intent_clarity: 'high',
|
|
44
|
+
acceptance_clarity: 'high',
|
|
45
|
+
impact_confidence: 'high',
|
|
46
|
+
validation_clarity: 'clear',
|
|
47
|
+
validation_available: true,
|
|
48
|
+
validation_cost: 'cheap',
|
|
49
|
+
reversibility: 'reversible',
|
|
50
|
+
affected_contracts: ['public-api'],
|
|
51
|
+
risk_tags: ['state-machine']
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
assert.equal(result.record.decision.profile, 'full');
|
|
55
|
+
assert.equal(result.record.decision.hard_gate_hits.includes('api_schema_contract'), true);
|
|
56
|
+
assert.equal(result.record.decision.hard_gate_hits.includes('state_machine_concurrency_liveness'), true);
|
|
57
|
+
assert.equal(result.record.decision.required_stages.includes('verify'), true);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test('lifecycle database risk forces full hard gate and human checkpoint', () => {
|
|
61
|
+
const result = evaluateLifecycleDecisionGate({
|
|
62
|
+
intent_clarity: 'high',
|
|
63
|
+
acceptance_clarity: 'high',
|
|
64
|
+
impact_confidence: 'high',
|
|
65
|
+
validation_clarity: 'clear',
|
|
66
|
+
validation_available: true,
|
|
67
|
+
validation_cost: 'cheap',
|
|
68
|
+
reversibility: 'reversible',
|
|
69
|
+
risk_tags: ['database']
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
assert.equal(result.record.decision.profile, 'full');
|
|
73
|
+
assert.equal(result.record.decision.hard_gate_hits.includes('database_or_data_loss'), true);
|
|
74
|
+
assert.equal(result.record.decision.human_checkpoint_required, true);
|
|
75
|
+
assert.equal(result.checkpointRequired, true);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
test('Phase 5.1 lifecycle risk extraction maps Chinese hard-gate text', () => {
|
|
79
|
+
const extraction = extractLifecycleRiskSignalsFromText('三线程状态流转,并发更新,SQL 拼接,数据一致性风险');
|
|
80
|
+
const categories = extraction.evidence.map((item) => item.category);
|
|
81
|
+
const result = evaluateLifecycleDecisionGate(extraction.signals);
|
|
82
|
+
const rendered = renderLifecycleDecisionGate(result);
|
|
83
|
+
|
|
84
|
+
assert.equal(extraction.source, 'from_text');
|
|
85
|
+
assert.equal(extraction.riskTags.includes('state-machine'), true);
|
|
86
|
+
assert.equal(extraction.riskTags.includes('concurrency'), true);
|
|
87
|
+
assert.equal(extraction.riskTags.includes('database'), true);
|
|
88
|
+
assert.equal(categories.includes('state_machine'), true);
|
|
89
|
+
assert.equal(categories.includes('concurrency'), true);
|
|
90
|
+
assert.equal(categories.includes('sql'), true);
|
|
91
|
+
assert.equal(categories.includes('database_data_loss'), true);
|
|
92
|
+
assert.equal(result.record.decision.profile, 'full');
|
|
93
|
+
assert.equal(result.record.decision.hard_gate_hits.includes('state_machine_concurrency_liveness'), true);
|
|
94
|
+
assert.equal(result.record.decision.hard_gate_hits.includes('database_or_data_loss'), true);
|
|
95
|
+
assert.equal(result.autonomyCeiling, 'full_sdd_with_checkpoint');
|
|
96
|
+
assert.equal(rendered.includes('Lifecycle checkpoint is required.'), true);
|
|
97
|
+
assert.equal(rendered.includes('Why:'), true);
|
|
98
|
+
assert.equal(rendered.includes('Next:'), true);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
test('lifecycle checkpoint triggers are recorded without executing workflow', () => {
|
|
102
|
+
const result = evaluateLifecycleDecisionGate({
|
|
103
|
+
intent_clarity: 'high',
|
|
104
|
+
acceptance_clarity: 'high',
|
|
105
|
+
impact_confidence: 'high',
|
|
106
|
+
validation_clarity: 'clear',
|
|
107
|
+
validation_available: true,
|
|
108
|
+
validation_cost: 'cheap',
|
|
109
|
+
reversibility: 'reversible',
|
|
110
|
+
policy_hits: ['git_commit'],
|
|
111
|
+
permission_required: ['dependency_install'],
|
|
112
|
+
human_checkpoint_required: true
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
assert.equal(result.record.decision.profile, 'compact');
|
|
116
|
+
assert.equal(result.record.decision.human_checkpoint_required, true);
|
|
117
|
+
assert.equal(result.record.decision.hard_gate_hits.includes('policy_or_permission_checkpoint'), true);
|
|
118
|
+
assert.match(result.boundaries.join('\n'), /must not execute Phase 1.8 task implementation loop/);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
test('lifecycle research gate handles unscoutable unknown impact', () => {
|
|
122
|
+
const result = evaluateLifecycleDecisionGate({
|
|
123
|
+
impact_confidence: 'low',
|
|
124
|
+
can_scout_impact: false
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
assert.equal(result.record.decision.profile, 'research');
|
|
128
|
+
assert.equal(result.record.decision.confidence, 'low');
|
|
129
|
+
assert.equal(result.record.decision.hard_gate_hits.includes('low_impact_confidence_unscoutable'), true);
|
|
130
|
+
assert.equal(result.record.decision.required_stages[0], 'research');
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
test('lifecycle decision gate emits canonical Phase 1.3 contract id for new records', () => {
|
|
134
|
+
const result = evaluateLifecycleDecisionGate({
|
|
135
|
+
intent_clarity: 'high',
|
|
136
|
+
acceptance_clarity: 'high',
|
|
137
|
+
impact_confidence: 'high',
|
|
138
|
+
validation_clarity: 'clear',
|
|
139
|
+
validation_available: true,
|
|
140
|
+
validation_cost: 'cheap',
|
|
141
|
+
reversibility: 'reversible'
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
assert.equal(result.record.contract, 'sdd-lifecycle-decision-v1');
|
|
145
|
+
assert.equal(result.record.version, '1.3.0');
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
test('recordLifecycleDecision persists command gate output to run state and events', async () => {
|
|
149
|
+
const root = await mkdtemp(path.join(tmpdir(), 'sdd-lifecycle-'));
|
|
150
|
+
try {
|
|
151
|
+
await initProject(root);
|
|
152
|
+
const state = await createRun(root, { runId: 'run-1' });
|
|
153
|
+
const result = evaluateLifecycleDecisionGate({
|
|
154
|
+
intent_clarity: 'high',
|
|
155
|
+
acceptance_clarity: 'high',
|
|
156
|
+
impact_confidence: 'high',
|
|
157
|
+
validation_clarity: 'clear',
|
|
158
|
+
validation_available: true,
|
|
159
|
+
validation_cost: 'cheap',
|
|
160
|
+
reversibility: 'reversible',
|
|
161
|
+
risk_tags: ['database']
|
|
162
|
+
}, new Date('2026-05-01T00:00:00.000Z'));
|
|
163
|
+
|
|
164
|
+
await recordLifecycleDecision(root, state.runId, result.record);
|
|
165
|
+
const restored = await readRunState(root, state.runId);
|
|
166
|
+
const events = await readRunEvents(root, state.runId);
|
|
167
|
+
assert.equal(restored.lifecycleDecision?.decision.profile, 'full');
|
|
168
|
+
assert.equal(restored.lifecycleDecision?.decision.hard_gate_hits.includes('database_or_data_loss'), true);
|
|
169
|
+
assert.equal(restored.lifecycleDecision?.decision.human_checkpoint_required, true);
|
|
170
|
+
assert.equal(events.some((event) => /Lifecycle decision recorded by Phase 1.7 command gate/.test(event.summary ?? '')), true);
|
|
171
|
+
} finally {
|
|
172
|
+
await rm(root, { recursive: true, force: true });
|
|
173
|
+
}
|
|
174
|
+
});
|