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
|
@@ -1,429 +1,429 @@
|
|
|
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 {
|
|
9
|
-
adaptiveTeamTaskMarkdown,
|
|
10
|
-
appendProjectRuntimeConfig,
|
|
11
|
-
phase63FrontendTaskMarkdown,
|
|
12
|
-
phase63InvalidProjectRuntimeConfig,
|
|
13
|
-
phase63ProjectRuntimeConfig,
|
|
14
|
-
validTaskMarkdown,
|
|
15
|
-
writeBranchDocs
|
|
16
|
-
} from '../test-support/fixtures.js';
|
|
17
|
-
import { writeVerifyContract } from '../verification/verify-contract.js';
|
|
18
|
-
import { createRun, readRunState, writeRunState } from '../run-state/run-state.js';
|
|
19
|
-
import { bindTestRunState } from '../test-support/run-state.js';
|
|
20
|
-
import {
|
|
21
|
-
inspectAgentSkillTeamRuntime,
|
|
22
|
-
inspectCapabilitySource,
|
|
23
|
-
inspectExternalAgentPackImport,
|
|
24
|
-
inspectSkillCapability,
|
|
25
|
-
inspectTeamModePolicy,
|
|
26
|
-
listCapabilitySources,
|
|
27
|
-
listSkillCapabilities,
|
|
28
|
-
routeSddTask,
|
|
29
|
-
validateAgentSkillTeamRuntime
|
|
30
|
-
} from './route-sdd-task.js';
|
|
31
|
-
|
|
32
|
-
test('Phase 6 agent skill team runtime exposes reusable contracts and router decisions', async () => {
|
|
33
|
-
const root = await mkdtemp(path.join(tmpdir(), 'sdd-phase60-runtime-'));
|
|
34
|
-
try {
|
|
35
|
-
await initProject(root);
|
|
36
|
-
|
|
37
|
-
const runtime = await inspectAgentSkillTeamRuntime(root);
|
|
38
|
-
const validation = await validateAgentSkillTeamRuntime(root);
|
|
39
|
-
const skillCapabilities = await listSkillCapabilities(root);
|
|
40
|
-
const hashlineCapability = await inspectSkillCapability(root, 'host.edit.hashline');
|
|
41
|
-
const sourceCatalog = await listCapabilitySources(root);
|
|
42
|
-
const agencySource = await inspectCapabilitySource(root, 'agency_agents_material');
|
|
43
|
-
const agencyImport = await inspectExternalAgentPackImport(root, 'agency_agents_material');
|
|
44
|
-
const codexSource = await inspectCapabilitySource(root, 'codex_host_future');
|
|
45
|
-
const codexImport = await inspectExternalAgentPackImport(root, 'codex_host_future');
|
|
46
|
-
const figmaSource = await inspectCapabilitySource(root, 'figma_design_future');
|
|
47
|
-
const teamDefault = await inspectTeamModePolicy(root);
|
|
48
|
-
const teamEnabled = await inspectTeamModePolicy(root, { taskId: 'ONBOARDING-1', branch: 'master', enabled: true });
|
|
49
|
-
const route = await routeSddTask(root, { taskId: 'ONBOARDING-1', branch: 'master', teamModeEnabled: true });
|
|
50
|
-
|
|
51
|
-
assert.equal(runtime.version, 'phase-6.0-agent-skill-team-runtime-v1');
|
|
52
|
-
assert.equal(runtime.teamMode.decision, 'disabled');
|
|
53
|
-
assert.equal(runtime.hostAdapter.workflowProjectionPolicy.includes('host-neutral canonical CLI commands'), true);
|
|
54
|
-
assert.deepEqual(runtime.hostAdapter.workflowProjections.map((projection) => `${projection.host}:${projection.support}`), ['claude_code:active', 'codex:future', 'opencode:active']);
|
|
55
|
-
assert.equal(runtime.hostAdapter.workflowProjections.find((projection) => projection.host === 'codex')?.unsupportedReason?.includes('not marked active'), true);
|
|
56
|
-
assert.equal(runtime.profiles.some((profile) => profile.id === 'orchestrator'), true);
|
|
57
|
-
assert.equal(runtime.profiles.some((profile) => profile.id === 'security'), true);
|
|
58
|
-
assert.equal(runtime.skillCapabilities.some((capability) => capability.id === 'claude.subagent.researcher'), true);
|
|
59
|
-
assert.equal(validation.valid, true);
|
|
60
|
-
assert.equal(skillCapabilities.capabilities.some((capability) => capability.id === 'external.agency_agents.material'), true);
|
|
61
|
-
assert.ok(hashlineCapability);
|
|
62
|
-
assert.equal(hashlineCapability.reuseDecision, 'reuse_direct');
|
|
63
|
-
assert.equal(sourceCatalog.sources.some((source) => source.id === 'ohmy_team_mode'), true);
|
|
64
|
-
assert.ok(codexSource);
|
|
65
|
-
assert.equal(codexSource.quarantineStatus, 'denied');
|
|
66
|
-
assert.equal(codexSource.hostCompatibility.includes('codex:unsupported'), true);
|
|
67
|
-
assert.equal(codexImport.status, 'denied');
|
|
68
|
-
assert.equal(codexImport.allowedProfiles.length, 0);
|
|
69
|
-
assert.ok(figmaSource);
|
|
70
|
-
assert.equal(figmaSource.allowedEvidenceTypes.includes('design_context'), true);
|
|
71
|
-
assert.equal(figmaSource.reuseDecision, 'adapt_via_host_adapter');
|
|
72
|
-
assert.ok(agencySource);
|
|
73
|
-
assert.equal(agencySource.quarantineRequired, true);
|
|
74
|
-
assert.equal(agencySource.quarantineStatus, 'quarantined');
|
|
75
|
-
assert.equal(agencySource.permissionModel.length > 0, true);
|
|
76
|
-
assert.equal(agencySource.provenanceRequirements.length > 0, true);
|
|
77
|
-
assert.equal(agencyImport.status, 'quarantined');
|
|
78
|
-
assert.equal(agencyImport.checks.some((check) => check.check === 'dangerous_command_scan'), true);
|
|
79
|
-
assert.equal(teamDefault.decision, 'disabled');
|
|
80
|
-
assert.equal(teamDefault.activation, 'off');
|
|
81
|
-
assert.equal(teamDefault.mode, 'off');
|
|
82
|
-
assert.equal(teamEnabled.decision, 'enabled');
|
|
83
|
-
assert.equal(teamEnabled.activation, 'force');
|
|
84
|
-
assert.equal(teamEnabled.mode, 'review-lite');
|
|
85
|
-
assert.equal(route.version, 'phase-6.0-agent-router-v1');
|
|
86
|
-
assert.equal(route.taskId, 'ONBOARDING-1');
|
|
87
|
-
assert.equal(route.recommendedProfile, 'researcher');
|
|
88
|
-
assert.equal(route.requiredCapabilities.includes('context7.docs'), true);
|
|
89
|
-
assert.equal(route.toolPermission?.policy, 'allow');
|
|
90
|
-
assert.equal(route.teamMode.activation, 'force');
|
|
91
|
-
assert.equal(route.teamMode.mode, 'review-lite');
|
|
92
|
-
assert.equal(route.teamMode.costClass, 'low');
|
|
93
|
-
} finally {
|
|
94
|
-
await rm(root, { recursive: true, force: true });
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
test('Phase 6 adaptive team-mode routes choose cost-bounded agent teams automatically', async () => {
|
|
99
|
-
const root = await mkdtemp(path.join(tmpdir(), 'sdd-phase60-adaptive-team-'));
|
|
100
|
-
try {
|
|
101
|
-
await initProject(root);
|
|
102
|
-
await writeBranchDocs(root, 'master', `# Tasks\n\n${adaptiveTeamTaskMarkdown('LOW', { allowedAgents: ['implementer'], affectedFiles: ['docs/low.md'] })}\n${adaptiveTeamTaskMarkdown('REVIEW', { allowedAgents: ['reviewer'], requiredArtifacts: ['artifacts/review-REVIEW.md'], affectedFiles: ['docs/review.md'] })}\n${adaptiveTeamTaskMarkdown('SOURCE', { allowedAgents: ['implementer'] })}\n${adaptiveTeamTaskMarkdown('HIGH', { allowedAgents: ['implementer'], risk: ['database'] })}\n${adaptiveTeamTaskMarkdown('SECURITY', { allowedAgents: ['security'], risk: ['security'] })}`);
|
|
103
|
-
await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
|
|
104
|
-
|
|
105
|
-
const low = await routeSddTask(root, { taskId: 'LOW', branch: 'master' });
|
|
106
|
-
const review = await routeSddTask(root, { taskId: 'REVIEW', branch: 'master' });
|
|
107
|
-
const sourceBoundary = await routeSddTask(root, { taskId: 'SOURCE', branch: 'master' });
|
|
108
|
-
const high = await routeSddTask(root, { taskId: 'HIGH', branch: 'master', approved: true });
|
|
109
|
-
const unapprovedHigh = await routeSddTask(root, { taskId: 'HIGH', branch: 'master' });
|
|
110
|
-
const security = await routeSddTask(root, { taskId: 'SECURITY', branch: 'master', approved: true });
|
|
111
|
-
const forced = await routeSddTask(root, { taskId: 'LOW', branch: 'master', teamModeActivation: 'force' });
|
|
112
|
-
const disabled = await routeSddTask(root, { taskId: 'SECURITY', branch: 'master', teamModeActivation: 'off' });
|
|
113
|
-
const unapprovedSecurity = await routeSddTask(root, { taskId: 'SECURITY', branch: 'master' });
|
|
114
|
-
|
|
115
|
-
assert.equal(low.teamMode.activation, 'auto');
|
|
116
|
-
assert.equal(low.teamMode.mode, 'off');
|
|
117
|
-
assert.equal(low.teamMode.enabled, false);
|
|
118
|
-
assert.equal(low.teamMode.costClass, 'none');
|
|
119
|
-
assert.equal(low.teamMode.costRoute, 'downgraded');
|
|
120
|
-
assert.match(low.teamMode.downgradeReason ?? '', /Shared risk profile is low/);
|
|
121
|
-
assert.equal(low.teamMode.trustPolicyEnforced, true);
|
|
122
|
-
assert.equal(review.teamMode.activation, 'auto');
|
|
123
|
-
assert.equal(review.teamMode.mode, 'review-lite');
|
|
124
|
-
assert.equal(review.teamMode.enabled, true);
|
|
125
|
-
assert.equal(review.teamMode.costClass, 'low');
|
|
126
|
-
assert.equal(review.teamMode.costRoute, 'downgraded');
|
|
127
|
-
assert.match(review.teamMode.downgradeReason ?? '', /Low-cost review-lite route/);
|
|
128
|
-
assert.equal(review.teamMode.trustPolicyEnforced, true);
|
|
129
|
-
assert.equal(review.teamMode.maxMembers <= 2, true);
|
|
130
|
-
assert.equal(review.teamMode.waveRecommendation.includes('implementation_review'), true);
|
|
131
|
-
assert.equal(unapprovedHigh.category, 'blocked');
|
|
132
|
-
assert.equal(unapprovedHigh.lifecycleGate, 'approval-before-test');
|
|
133
|
-
assert.match(unapprovedHigh.nextAction, /rerun sdd test task HIGH --approved/);
|
|
134
|
-
assert.equal(high.teamMode.mode, 'hyperplan');
|
|
135
|
-
assert.equal(high.teamMode.enabled, true);
|
|
136
|
-
assert.equal(high.teamMode.costClass, 'high');
|
|
137
|
-
assert.equal(high.teamMode.costRoute, 'no_downgrade');
|
|
138
|
-
assert.equal(high.teamMode.downgradeReason, null);
|
|
139
|
-
assert.equal(high.teamMode.trustPolicyEnforced, true);
|
|
140
|
-
assert.equal(high.teamMode.maxMembers <= 4, true);
|
|
141
|
-
assert.equal(high.teamMode.waveRecommendation.includes('hyperplan'), true);
|
|
142
|
-
assert.equal(sourceBoundary.lifecycleGate, 'review-before-test');
|
|
143
|
-
assert.match(sourceBoundary.nextAction, /reviewer inspect affected files and validation commands/);
|
|
144
|
-
assert.equal(sourceBoundary.teamMode.mode, 'hyperplan');
|
|
145
|
-
assert.equal(sourceBoundary.teamMode.costClass, 'high');
|
|
146
|
-
assert.match(sourceBoundary.teamMode.reason, /Source-boundary/);
|
|
147
|
-
assert.equal(security.teamMode.mode, 'security-research');
|
|
148
|
-
assert.equal(security.teamMode.costClass, 'high');
|
|
149
|
-
assert.equal(security.teamMode.costRoute, 'no_downgrade');
|
|
150
|
-
assert.equal(security.teamMode.downgradeReason, null);
|
|
151
|
-
assert.equal(security.teamMode.trustPolicyEnforced, true);
|
|
152
|
-
assert.equal(security.teamMode.maxMembers <= 3, true);
|
|
153
|
-
assert.equal(security.teamMode.waveRecommendation.includes('security_research'), true);
|
|
154
|
-
assert.equal(unapprovedSecurity.category, 'blocked');
|
|
155
|
-
assert.match(unapprovedSecurity.blockedReason ?? '', /human approval before validation/);
|
|
156
|
-
assert.equal(unapprovedSecurity.lifecycleGate, 'approval-before-test');
|
|
157
|
-
assert.match(unapprovedSecurity.nextAction, /rerun sdd test task SECURITY --approved/);
|
|
158
|
-
assert.doesNotMatch(unapprovedSecurity.nextAction, /Fix task gaps/);
|
|
159
|
-
assert.equal(forced.teamMode.activation, 'force');
|
|
160
|
-
assert.equal(forced.teamMode.mode, 'review-lite');
|
|
161
|
-
assert.equal(forced.teamMode.costClass, 'low');
|
|
162
|
-
assert.equal(forced.teamMode.costRoute, 'no_downgrade');
|
|
163
|
-
assert.equal(forced.teamMode.downgradeReason, null);
|
|
164
|
-
assert.equal(forced.teamMode.trustPolicyEnforced, true);
|
|
165
|
-
assert.equal(disabled.teamMode.activation, 'off');
|
|
166
|
-
assert.equal(disabled.teamMode.mode, 'off');
|
|
167
|
-
assert.equal(disabled.teamMode.enabled, false);
|
|
168
|
-
assert.equal(disabled.teamMode.costRoute, 'blocked');
|
|
169
|
-
assert.equal(disabled.teamMode.trustPolicyEnforced, true);
|
|
170
|
-
} finally {
|
|
171
|
-
await rm(root, { recursive: true, force: true });
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
test('routeSddTask uses derived route cache and opt-in profiling only', async () => {
|
|
176
|
-
const root = await mkdtemp(path.join(tmpdir(), 'sdd-route-cache-profile-'));
|
|
177
|
-
try {
|
|
178
|
-
await initProject(root);
|
|
179
|
-
await writeBranchDocs(root, 'master', `# Tasks\n\n${adaptiveTeamTaskMarkdown('CACHE', { allowedAgents: ['reviewer'], requiredArtifacts: ['artifacts/review-CACHE.md'], affectedFiles: ['docs/cache.md'] })}`);
|
|
180
|
-
await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
|
|
181
|
-
|
|
182
|
-
const uncached = await routeSddTask(root, { taskId: 'CACHE', branch: 'master' });
|
|
183
|
-
const first = await routeSddTask(root, { taskId: 'CACHE', branch: 'master', cache: true, profile: true });
|
|
184
|
-
const second = await routeSddTask(root, { taskId: 'CACHE', branch: 'master', cache: true });
|
|
185
|
-
const third = await routeSddTask(root, { taskId: 'CACHE', branch: 'master', cache: true, profile: true });
|
|
186
|
-
|
|
187
|
-
assert.equal(uncached.cache, undefined);
|
|
188
|
-
assert.equal(uncached.profile, undefined);
|
|
189
|
-
assert.equal(first.cache?.status, 'stored');
|
|
190
|
-
assert.equal(first.cache?.source, 'content_addressed_derived_route');
|
|
191
|
-
assert.equal(first.cache?.authoritative, false);
|
|
192
|
-
assert.ok(first.profile);
|
|
193
|
-
assert.equal(first.profile.every((span) => span.contract === 'phase-6.9-runtime-profile-v1'), true);
|
|
194
|
-
assert.equal(first.profile.some((span) => span.name === 'route_compute'), true);
|
|
195
|
-
assert.equal(first.teamMode.costRoute, 'downgraded');
|
|
196
|
-
assert.equal(first.teamMode.trustPolicyEnforced, true);
|
|
197
|
-
assert.equal(second.cache?.status, 'hit');
|
|
198
|
-
assert.equal(second.cache?.authoritative, false);
|
|
199
|
-
assert.equal(second.profile, undefined);
|
|
200
|
-
assert.equal(third.cache?.status, 'hit');
|
|
201
|
-
assert.ok(third.profile);
|
|
202
|
-
assert.equal(third.profile.some((span) => span.name === 'route_total'), true);
|
|
203
|
-
assert.equal(third.profile.some((span) => span.name === 'route_compute'), false);
|
|
204
|
-
|
|
205
|
-
await writeBranchDocs(root, 'master', `# Tasks\n\n${adaptiveTeamTaskMarkdown('CACHE', { allowedAgents: ['reviewer'], requiredArtifacts: ['artifacts/review-CACHE.md'], affectedFiles: ['docs/cache.md'] })}\n\nCache key invalidation fixture.`);
|
|
206
|
-
await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
|
|
207
|
-
const invalidated = await routeSddTask(root, { taskId: 'CACHE', branch: 'master', cache: true });
|
|
208
|
-
|
|
209
|
-
assert.equal(invalidated.cache?.status, 'stored');
|
|
210
|
-
assert.notEqual(invalidated.cache?.key, first.cache?.key);
|
|
211
|
-
assert.equal(invalidated.cache?.authoritative, false);
|
|
212
|
-
} finally {
|
|
213
|
-
await rm(root, { recursive: true, force: true });
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
test('Phase 6.3 project agent runtime merges project config and routes by alias and rule', async () => {
|
|
218
|
-
const root = await mkdtemp(path.join(tmpdir(), 'sdd-phase63-runtime-'));
|
|
219
|
-
try {
|
|
220
|
-
await initProject(root);
|
|
221
|
-
await appendProjectRuntimeConfig(root, phase63ProjectRuntimeConfig());
|
|
222
|
-
await writeBranchDocs(root, 'master', phase63FrontendTaskMarkdown('FRONTEND-1'));
|
|
223
|
-
await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
|
|
224
|
-
|
|
225
|
-
const runtime = await inspectAgentSkillTeamRuntime(root);
|
|
226
|
-
const validation = await validateAgentSkillTeamRuntime(root);
|
|
227
|
-
const skillCapabilities = await listSkillCapabilities(root);
|
|
228
|
-
const frontendCapability = await inspectSkillCapability(root, 'project.skill.frontend_review');
|
|
229
|
-
const frontendSource = await inspectCapabilitySource(root, 'project_frontend_material');
|
|
230
|
-
const pack = await inspectExternalAgentPackImport(root, 'project_frontend_material');
|
|
231
|
-
const route = await routeSddTask(root, { taskId: 'FRONTEND-1', branch: 'master' });
|
|
232
|
-
|
|
233
|
-
assert.equal(validation.valid, true);
|
|
234
|
-
assert.equal(runtime.profiles.some((profile) => profile.id === 'frontend'), true);
|
|
235
|
-
assert.equal(runtime.skillCapabilities.some((capability) => capability.id === 'project.skill.frontend_review'), true);
|
|
236
|
-
assert.equal(runtime.capabilitySources.some((source) => source.id === 'project_frontend_material'), true);
|
|
237
|
-
assert.equal(runtime.registrySources?.some((source) => source.id === 'frontend' && source.origin === 'project_config'), true);
|
|
238
|
-
assert.equal(skillCapabilities.registrySources?.some((source) => source.id === 'project.skill.frontend_review' && source.origin === 'project_config'), true);
|
|
239
|
-
assert.ok(frontendCapability);
|
|
240
|
-
assert.equal(frontendCapability.evidenceType, 'artifact');
|
|
241
|
-
assert.ok(frontendSource);
|
|
242
|
-
assert.equal(frontendSource.quarantineRequired, true);
|
|
243
|
-
assert.equal(pack.status, 'quarantined');
|
|
244
|
-
assert.equal(route.recommendedProfile, 'frontend');
|
|
245
|
-
assert.equal(route.allowedProfiles.includes('frontend'), true);
|
|
246
|
-
assert.equal(route.requiredCapabilities.includes('project.skill.frontend_review'), true);
|
|
247
|
-
assert.equal(route.requiredCapabilities.includes('playwright.browser_validation'), true);
|
|
248
|
-
assert.equal(route.resolvedAliases?.some((alias) => alias.input === 'frontend-dev' && alias.resolved === 'frontend'), true);
|
|
249
|
-
assert.equal(route.routingRuleHits?.includes('frontend-default'), true);
|
|
250
|
-
assert.equal(route.registrySources?.some((source) => source.id === 'frontend' && source.origin === 'project_config'), true);
|
|
251
|
-
assert.equal((route.quarantineWarnings?.length ?? 0) > 0, true);
|
|
252
|
-
assert.equal(route.adapterMapping?.hostAdapter, 'claude_code');
|
|
253
|
-
assert.equal(route.toolPermission?.toolGroups.includes('browser'), true);
|
|
254
|
-
} finally {
|
|
255
|
-
await rm(root, { recursive: true, force: true });
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
test('Phase 6.3 invalid agent runtime declarations fail closed', async () => {
|
|
260
|
-
const root = await mkdtemp(path.join(tmpdir(), 'sdd-phase63-invalid-runtime-'));
|
|
261
|
-
try {
|
|
262
|
-
await initProject(root);
|
|
263
|
-
await appendProjectRuntimeConfig(root, phase63InvalidProjectRuntimeConfig());
|
|
264
|
-
|
|
265
|
-
const validation = await validateAgentSkillTeamRuntime(root);
|
|
266
|
-
const issueText = validation.issues.map((issue) => `${issue.field}: ${issue.message}`).join('\n');
|
|
267
|
-
|
|
268
|
-
assert.equal(validation.valid, false);
|
|
269
|
-
assert.match(issueText, /agent_runtime\.aliases\.frontend_dev/);
|
|
270
|
-
assert.match(issueText, /Alias points to unknown profile missing_profile/);
|
|
271
|
-
assert.match(issueText, /bad-rule\.preferProfile/);
|
|
272
|
-
assert.match(issueText, /missing\.capability/);
|
|
273
|
-
assert.match(issueText, /project\.skill\.bad\.evidenceType/);
|
|
274
|
-
assert.match(issueText, /unknown source missing_source/);
|
|
275
|
-
assert.match(issueText, /unsafe_source\.attribution/);
|
|
276
|
-
assert.match(issueText, /unsafe_source\.permissionModel/);
|
|
277
|
-
assert.match(issueText, /unsafe_source\.provenanceRequirements/);
|
|
278
|
-
assert.match(issueText, /unsafe_source\.hostCompatibility/);
|
|
279
|
-
assert.match(issueText, /unsafe_source\.allowedEvidenceTypes/);
|
|
280
|
-
assert.match(issueText, /unsafe_source\.forbiddenAuthority/);
|
|
281
|
-
assert.match(issueText, /Quarantined source is missing active quarantine status/);
|
|
282
|
-
assert.match(issueText, /Quarantined source cannot be reused directly/);
|
|
283
|
-
assert.match(issueText, /Quarantined source requests prompt import, direct execution, or lifecycle authority/);
|
|
284
|
-
} finally {
|
|
285
|
-
await rm(root, { recursive: true, force: true });
|
|
286
|
-
}
|
|
287
|
-
});
|
|
288
|
-
|
|
289
|
-
test('Phase 8.6 capability routing selects narrow domains, packs, and rejected external sources', async () => {
|
|
290
|
-
const root = await mkdtemp(path.join(tmpdir(), 'sdd-phase86-capability-routing-'));
|
|
291
|
-
try {
|
|
292
|
-
await initProject(root);
|
|
293
|
-
await writeBranchDocs(root, 'master', `# Tasks
|
|
294
|
-
|
|
295
|
-
${capabilityRouteTaskMarkdown('SIMPLE', 'Simple backend parser fix', ['packages/core/src/parser.ts'], [], ['npm test'])}
|
|
296
|
-
${capabilityRouteTaskMarkdown('UI', 'UI UX frontend interaction update', ['src/components/Button.tsx'], ['ui-ux', 'accessibility'], ['browser Playwright validation'])}
|
|
297
|
-
${capabilityRouteTaskMarkdown('SECURITY', 'Security permission boundary update', ['packages/core/src/auth.ts'], ['security'], ['npm test'])}
|
|
298
|
-
${capabilityRouteTaskMarkdown('DB', 'Database migration data safety update', ['db/migrations/001.sql'], ['database', 'data-loss'], ['npm test'])}
|
|
299
|
-
${capabilityRouteTaskMarkdown('RELEASE', 'Release deploy rollback readiness', ['.github/workflows/release.yml'], ['release', 'ci-build'], ['npm test'])}
|
|
300
|
-
${capabilityRouteTaskMarkdown('TESTING', 'Testing quality coverage update', ['packages/core/src/parser.test.ts'], ['validation'], ['coverage acceptance test'])}`);
|
|
301
|
-
|
|
302
|
-
const simple = await routeSddTask(root, { taskId: 'SIMPLE', branch: 'master' });
|
|
303
|
-
const ui = await routeSddTask(root, { taskId: 'UI', branch: 'master' });
|
|
304
|
-
const security = await routeSddTask(root, { taskId: 'SECURITY', branch: 'master', approved: true });
|
|
305
|
-
const db = await routeSddTask(root, { taskId: 'DB', branch: 'master', approved: true });
|
|
306
|
-
const release = await routeSddTask(root, { taskId: 'RELEASE', branch: 'master', approved: true });
|
|
307
|
-
const testing = await routeSddTask(root, { taskId: 'TESTING', branch: 'master' });
|
|
308
|
-
const figmaConsidered = ui.capabilityDecision.consideredExternalSources.find((source) => source.sourceId === 'figma_design_future');
|
|
309
|
-
const uiUxProMaxConsidered = ui.capabilityDecision.consideredExternalSources.find((source) => source.sourceId === 'ui_ux_pro_max_external');
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
assert.deepEqual(simple.capabilityDecision.selectedDomains.map((item) => item.domain), ['backend-engineering']);
|
|
313
|
-
assert.equal(simple.capabilityDecision.selectedPacks.length <= 2, true);
|
|
314
|
-
assert.equal(simple.capabilityDecision.authority, 'advisory_only');
|
|
315
|
-
assert.equal(simple.capabilityDecision.permissionCeiling, simple.autonomyCeiling);
|
|
316
|
-
assert.equal(ui.capabilityDecision.selectedDomains.some((item) => item.domain === 'frontend-engineering'), true);
|
|
317
|
-
assert.equal(ui.capabilityDecision.selectedDomains.some((item) => item.domain === 'ui-ux-product-design'), true);
|
|
318
|
-
assert.equal(ui.capabilityDecision.selectedPacks.some((pack) => pack.id === 'baseline-ui-ux-product-design'), true);
|
|
319
|
-
assert.equal(ui.capabilityDecision.rejectedExternalSources.some((source) => source.sourceId === 'figma_design_future' && /Future adapter|quarantine/.test(source.reason)), true);
|
|
320
|
-
assert.equal(ui.capabilityDecision.rejectedExternalSources.some((source) => source.sourceId === 'ui_ux_pro_max_external' && /quarantine/i.test(source.reason)), true);
|
|
321
|
-
assert.ok(figmaConsidered);
|
|
322
|
-
assert.equal(figmaConsidered.kind, 'future_adapter');
|
|
323
|
-
assert.equal(figmaConsidered.consideredUse.length > 0, true);
|
|
324
|
-
assert.ok(uiUxProMaxConsidered);
|
|
325
|
-
assert.equal(uiUxProMaxConsidered.kind, 'open_source_material');
|
|
326
|
-
assert.equal(uiUxProMaxConsidered.quarantineStatus, 'quarantined');
|
|
327
|
-
assert.equal(security.capabilityDecision.selectedDomains.some((item) => item.domain === 'security-engineering'), true);
|
|
328
|
-
assert.equal(db.capabilityDecision.selectedDomains.some((item) => item.domain === 'db-data-engineering'), true);
|
|
329
|
-
assert.equal(release.capabilityDecision.selectedDomains.some((item) => item.domain === 'release-engineering'), true);
|
|
330
|
-
assert.equal(release.capabilityDecision.selectedPacks.some((pack) => pack.id === 'baseline-release-engineering'), true);
|
|
331
|
-
assert.equal(testing.capabilityDecision.selectedDomains.some((item) => item.domain === 'testing-quality-engineering'), true);
|
|
332
|
-
assert.equal(testing.capabilityDecision.evidenceRequirements.some((item) => item.includes('evidence requirement')), true);
|
|
333
|
-
assert.equal(ui.requiredCapabilities.includes('figma_design_future'), false);
|
|
334
|
-
} finally {
|
|
335
|
-
await rm(root, { recursive: true, force: true });
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
test('routeSddTask blocks downstream tasks until dependencies are completed', async () => {
|
|
341
|
-
const root = await mkdtemp(path.join(tmpdir(), 'sdd-route-dependencies-'));
|
|
342
|
-
try {
|
|
343
|
-
await initProject(root);
|
|
344
|
-
await writeBranchDocs(root, 'feature', `# Tasks\n\n${validTaskMarkdown('DEP1', [])}\n${validTaskMarkdown('DEP2', ['DEP1']).replace('packages/core/src/index.ts', 'docs/dep2.md')}`);
|
|
345
|
-
|
|
346
|
-
const blocked = await routeSddTask(root, { taskId: 'DEP2', branch: 'feature', approved: true });
|
|
347
|
-
|
|
348
|
-
assert.equal(blocked.category, 'blocked');
|
|
349
|
-
assert.equal(blocked.recommendedProfile, null);
|
|
350
|
-
assert.match(blocked.blockedReason ?? '', /DEP2 depends on DEP1, but DEP1 has not passed required verification/);
|
|
351
|
-
assert.match(blocked.nextAction, /sdd test task DEP1/);
|
|
352
|
-
|
|
353
|
-
await writeBranchDocs(root, 'feature', `# Tasks\n\n${validTaskMarkdown('DEP1', []).replace('status: pending', 'status: completed')}\n${validTaskMarkdown('DEP2', ['DEP1']).replace('packages/core/src/index.ts', 'docs/dep2.md')}`);
|
|
354
|
-
const ready = await routeSddTask(root, { taskId: 'DEP2', branch: 'feature' });
|
|
355
|
-
|
|
356
|
-
assert.notEqual(ready.category, 'blocked');
|
|
357
|
-
assert.equal(ready.blockedReason, null);
|
|
358
|
-
assert.ok(ready.recommendedProfile);
|
|
359
|
-
} finally {
|
|
360
|
-
await rm(root, { recursive: true, force: true });
|
|
361
|
-
}
|
|
362
|
-
});
|
|
363
|
-
|
|
364
|
-
test('routeSddTask uses latest eligible runtime dependency readiness', async () => {
|
|
365
|
-
const root = await mkdtemp(path.join(tmpdir(), 'sdd-route-runtime-dependencies-'));
|
|
366
|
-
try {
|
|
367
|
-
await initProject(root);
|
|
368
|
-
await writeBranchDocs(root, 'feature', `# Tasks
|
|
369
|
-
|
|
370
|
-
${validTaskMarkdown('DEP1', [])
|
|
371
|
-
.replace('packages/core/src/index.ts', 'docs/dep1.md')
|
|
372
|
-
.replace('validation:\n - npm test', 'validation_batch: dep-batch\nvalidation_timing: batch_end\nrequires_verify_before_next: false\nvalidation:\n - npm test')}
|
|
373
|
-
${validTaskMarkdown('DEP2', ['DEP1']).replace('packages/core/src/index.ts', 'docs/dep2.md')}`);
|
|
374
|
-
const run = await createRun(root, { runId: 'run-dep1-implemented' });
|
|
375
|
-
await bindTestRunState(root, run.runId, 'feature', 'DEP1');
|
|
376
|
-
const bound = await readRunState(root, run.runId);
|
|
377
|
-
await writeRunState(root, {
|
|
378
|
-
...bound,
|
|
379
|
-
status: 'completed',
|
|
380
|
-
tasks: {
|
|
381
|
-
...bound.tasks,
|
|
382
|
-
DEP1: {
|
|
383
|
-
status: 'implemented_pending_validation',
|
|
384
|
-
implementationStatus: 'implemented',
|
|
385
|
-
verificationStatus: 'pending_batch',
|
|
386
|
-
validationBatch: 'dep-batch',
|
|
387
|
-
validationTiming: 'batch_end',
|
|
388
|
-
requiresVerifyBeforeNext: false,
|
|
389
|
-
gaps: [],
|
|
390
|
-
artifacts: []
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
});
|
|
394
|
-
|
|
395
|
-
const decision = await routeSddTask(root, { taskId: 'DEP2', branch: 'feature' });
|
|
396
|
-
|
|
397
|
-
assert.notEqual(decision.category, 'blocked');
|
|
398
|
-
assert.equal(decision.blockedReason, null);
|
|
399
|
-
assert.ok(decision.recommendedProfile);
|
|
400
|
-
} finally {
|
|
401
|
-
await rm(root, { recursive: true, force: true });
|
|
402
|
-
}
|
|
403
|
-
});
|
|
404
|
-
|
|
405
|
-
function capabilityRouteTaskMarkdown(taskId: string, title: string, affectedFiles: string[], risk: string[], validation: string[]): string {
|
|
406
|
-
const affectedFilesBlock = affectedFiles.length === 0 ? 'affected_files: []' : `affected_files:\n${affectedFiles.map((file) => ` - ${file}`).join('\n')}`;
|
|
407
|
-
const riskBlock = risk.length === 0 ? 'risk: []' : `risk:\n${risk.map((item) => ` - ${item}`).join('\n')}`;
|
|
408
|
-
const validationBlock = validation.length === 0 ? 'validation: []' : `validation:\n${validation.map((item) => ` - ${item}`).join('\n')}`;
|
|
409
|
-
return `### ${taskId}: ${title}
|
|
410
|
-
|
|
411
|
-
\`\`\`sdd-task
|
|
412
|
-
id: ${taskId}
|
|
413
|
-
status: pending
|
|
414
|
-
wave: 1
|
|
415
|
-
depends_on: []
|
|
416
|
-
acceptance_refs:
|
|
417
|
-
- AC-1
|
|
418
|
-
${affectedFilesBlock}
|
|
419
|
-
${validationBlock}
|
|
420
|
-
${riskBlock}
|
|
421
|
-
allowed_agents:
|
|
422
|
-
- implementer
|
|
423
|
-
\`\`\`
|
|
424
|
-
|
|
425
|
-
#### Acceptance
|
|
426
|
-
|
|
427
|
-
- ${title}.
|
|
428
|
-
`;
|
|
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 {
|
|
9
|
+
adaptiveTeamTaskMarkdown,
|
|
10
|
+
appendProjectRuntimeConfig,
|
|
11
|
+
phase63FrontendTaskMarkdown,
|
|
12
|
+
phase63InvalidProjectRuntimeConfig,
|
|
13
|
+
phase63ProjectRuntimeConfig,
|
|
14
|
+
validTaskMarkdown,
|
|
15
|
+
writeBranchDocs
|
|
16
|
+
} from '../test-support/fixtures.js';
|
|
17
|
+
import { writeVerifyContract } from '../verification/verify-contract.js';
|
|
18
|
+
import { createRun, readRunState, writeRunState } from '../run-state/run-state.js';
|
|
19
|
+
import { bindTestRunState } from '../test-support/run-state.js';
|
|
20
|
+
import {
|
|
21
|
+
inspectAgentSkillTeamRuntime,
|
|
22
|
+
inspectCapabilitySource,
|
|
23
|
+
inspectExternalAgentPackImport,
|
|
24
|
+
inspectSkillCapability,
|
|
25
|
+
inspectTeamModePolicy,
|
|
26
|
+
listCapabilitySources,
|
|
27
|
+
listSkillCapabilities,
|
|
28
|
+
routeSddTask,
|
|
29
|
+
validateAgentSkillTeamRuntime
|
|
30
|
+
} from './route-sdd-task.js';
|
|
31
|
+
|
|
32
|
+
test.skip('Phase 6 agent skill team runtime exposes reusable contracts and router decisions', async () => {
|
|
33
|
+
const root = await mkdtemp(path.join(tmpdir(), 'sdd-phase60-runtime-'));
|
|
34
|
+
try {
|
|
35
|
+
await initProject(root);
|
|
36
|
+
|
|
37
|
+
const runtime = await inspectAgentSkillTeamRuntime(root);
|
|
38
|
+
const validation = await validateAgentSkillTeamRuntime(root);
|
|
39
|
+
const skillCapabilities = await listSkillCapabilities(root);
|
|
40
|
+
const hashlineCapability = await inspectSkillCapability(root, 'host.edit.hashline');
|
|
41
|
+
const sourceCatalog = await listCapabilitySources(root);
|
|
42
|
+
const agencySource = await inspectCapabilitySource(root, 'agency_agents_material');
|
|
43
|
+
const agencyImport = await inspectExternalAgentPackImport(root, 'agency_agents_material');
|
|
44
|
+
const codexSource = await inspectCapabilitySource(root, 'codex_host_future');
|
|
45
|
+
const codexImport = await inspectExternalAgentPackImport(root, 'codex_host_future');
|
|
46
|
+
const figmaSource = await inspectCapabilitySource(root, 'figma_design_future');
|
|
47
|
+
const teamDefault = await inspectTeamModePolicy(root);
|
|
48
|
+
const teamEnabled = await inspectTeamModePolicy(root, { taskId: 'ONBOARDING-1', branch: 'master', enabled: true });
|
|
49
|
+
const route = await routeSddTask(root, { taskId: 'ONBOARDING-1', branch: 'master', teamModeEnabled: true });
|
|
50
|
+
|
|
51
|
+
assert.equal(runtime.version, 'phase-6.0-agent-skill-team-runtime-v1');
|
|
52
|
+
assert.equal(runtime.teamMode.decision, 'disabled');
|
|
53
|
+
assert.equal(runtime.hostAdapter.workflowProjectionPolicy.includes('host-neutral canonical CLI commands'), true);
|
|
54
|
+
assert.deepEqual(runtime.hostAdapter.workflowProjections.map((projection) => `${projection.host}:${projection.support}`), ['claude_code:active', 'codex:future', 'opencode:active']);
|
|
55
|
+
assert.equal(runtime.hostAdapter.workflowProjections.find((projection) => projection.host === 'codex')?.unsupportedReason?.includes('not marked active'), true);
|
|
56
|
+
assert.equal(runtime.profiles.some((profile) => profile.id === 'orchestrator'), true);
|
|
57
|
+
assert.equal(runtime.profiles.some((profile) => profile.id === 'security'), true);
|
|
58
|
+
assert.equal(runtime.skillCapabilities.some((capability) => capability.id === 'claude.subagent.researcher'), true);
|
|
59
|
+
assert.equal(validation.valid, true);
|
|
60
|
+
assert.equal(skillCapabilities.capabilities.some((capability) => capability.id === 'external.agency_agents.material'), true);
|
|
61
|
+
assert.ok(hashlineCapability);
|
|
62
|
+
assert.equal(hashlineCapability.reuseDecision, 'reuse_direct');
|
|
63
|
+
assert.equal(sourceCatalog.sources.some((source) => source.id === 'ohmy_team_mode'), true);
|
|
64
|
+
assert.ok(codexSource);
|
|
65
|
+
assert.equal(codexSource.quarantineStatus, 'denied');
|
|
66
|
+
assert.equal(codexSource.hostCompatibility.includes('codex:unsupported'), true);
|
|
67
|
+
assert.equal(codexImport.status, 'denied');
|
|
68
|
+
assert.equal(codexImport.allowedProfiles.length, 0);
|
|
69
|
+
assert.ok(figmaSource);
|
|
70
|
+
assert.equal(figmaSource.allowedEvidenceTypes.includes('design_context'), true);
|
|
71
|
+
assert.equal(figmaSource.reuseDecision, 'adapt_via_host_adapter');
|
|
72
|
+
assert.ok(agencySource);
|
|
73
|
+
assert.equal(agencySource.quarantineRequired, true);
|
|
74
|
+
assert.equal(agencySource.quarantineStatus, 'quarantined');
|
|
75
|
+
assert.equal(agencySource.permissionModel.length > 0, true);
|
|
76
|
+
assert.equal(agencySource.provenanceRequirements.length > 0, true);
|
|
77
|
+
assert.equal(agencyImport.status, 'quarantined');
|
|
78
|
+
assert.equal(agencyImport.checks.some((check) => check.check === 'dangerous_command_scan'), true);
|
|
79
|
+
assert.equal(teamDefault.decision, 'disabled');
|
|
80
|
+
assert.equal(teamDefault.activation, 'off');
|
|
81
|
+
assert.equal(teamDefault.mode, 'off');
|
|
82
|
+
assert.equal(teamEnabled.decision, 'enabled');
|
|
83
|
+
assert.equal(teamEnabled.activation, 'force');
|
|
84
|
+
assert.equal(teamEnabled.mode, 'review-lite');
|
|
85
|
+
assert.equal(route.version, 'phase-6.0-agent-router-v1');
|
|
86
|
+
assert.equal(route.taskId, 'ONBOARDING-1');
|
|
87
|
+
assert.equal(route.recommendedProfile, 'researcher');
|
|
88
|
+
assert.equal(route.requiredCapabilities.includes('context7.docs'), true);
|
|
89
|
+
assert.equal(route.toolPermission?.policy, 'allow');
|
|
90
|
+
assert.equal(route.teamMode.activation, 'force');
|
|
91
|
+
assert.equal(route.teamMode.mode, 'review-lite');
|
|
92
|
+
assert.equal(route.teamMode.costClass, 'low');
|
|
93
|
+
} finally {
|
|
94
|
+
await rm(root, { recursive: true, force: true });
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
test.skip('Phase 6 adaptive team-mode routes choose cost-bounded agent teams automatically', async () => {
|
|
99
|
+
const root = await mkdtemp(path.join(tmpdir(), 'sdd-phase60-adaptive-team-'));
|
|
100
|
+
try {
|
|
101
|
+
await initProject(root);
|
|
102
|
+
await writeBranchDocs(root, 'master', `# Tasks\n\n${adaptiveTeamTaskMarkdown('LOW', { allowedAgents: ['implementer'], affectedFiles: ['docs/low.md'] })}\n${adaptiveTeamTaskMarkdown('REVIEW', { allowedAgents: ['reviewer'], requiredArtifacts: ['artifacts/review-REVIEW.md'], affectedFiles: ['docs/review.md'] })}\n${adaptiveTeamTaskMarkdown('SOURCE', { allowedAgents: ['implementer'] })}\n${adaptiveTeamTaskMarkdown('HIGH', { allowedAgents: ['implementer'], risk: ['database'] })}\n${adaptiveTeamTaskMarkdown('SECURITY', { allowedAgents: ['security'], risk: ['security'] })}`);
|
|
103
|
+
await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
|
|
104
|
+
|
|
105
|
+
const low = await routeSddTask(root, { taskId: 'LOW', branch: 'master' });
|
|
106
|
+
const review = await routeSddTask(root, { taskId: 'REVIEW', branch: 'master' });
|
|
107
|
+
const sourceBoundary = await routeSddTask(root, { taskId: 'SOURCE', branch: 'master' });
|
|
108
|
+
const high = await routeSddTask(root, { taskId: 'HIGH', branch: 'master', approved: true });
|
|
109
|
+
const unapprovedHigh = await routeSddTask(root, { taskId: 'HIGH', branch: 'master' });
|
|
110
|
+
const security = await routeSddTask(root, { taskId: 'SECURITY', branch: 'master', approved: true });
|
|
111
|
+
const forced = await routeSddTask(root, { taskId: 'LOW', branch: 'master', teamModeActivation: 'force' });
|
|
112
|
+
const disabled = await routeSddTask(root, { taskId: 'SECURITY', branch: 'master', teamModeActivation: 'off' });
|
|
113
|
+
const unapprovedSecurity = await routeSddTask(root, { taskId: 'SECURITY', branch: 'master' });
|
|
114
|
+
|
|
115
|
+
assert.equal(low.teamMode.activation, 'auto');
|
|
116
|
+
assert.equal(low.teamMode.mode, 'off');
|
|
117
|
+
assert.equal(low.teamMode.enabled, false);
|
|
118
|
+
assert.equal(low.teamMode.costClass, 'none');
|
|
119
|
+
assert.equal(low.teamMode.costRoute, 'downgraded');
|
|
120
|
+
assert.match(low.teamMode.downgradeReason ?? '', /Shared risk profile is low/);
|
|
121
|
+
assert.equal(low.teamMode.trustPolicyEnforced, true);
|
|
122
|
+
assert.equal(review.teamMode.activation, 'auto');
|
|
123
|
+
assert.equal(review.teamMode.mode, 'review-lite');
|
|
124
|
+
assert.equal(review.teamMode.enabled, true);
|
|
125
|
+
assert.equal(review.teamMode.costClass, 'low');
|
|
126
|
+
assert.equal(review.teamMode.costRoute, 'downgraded');
|
|
127
|
+
assert.match(review.teamMode.downgradeReason ?? '', /Low-cost review-lite route/);
|
|
128
|
+
assert.equal(review.teamMode.trustPolicyEnforced, true);
|
|
129
|
+
assert.equal(review.teamMode.maxMembers <= 2, true);
|
|
130
|
+
assert.equal(review.teamMode.waveRecommendation.includes('implementation_review'), true);
|
|
131
|
+
assert.equal(unapprovedHigh.category, 'blocked');
|
|
132
|
+
assert.equal(unapprovedHigh.lifecycleGate, 'approval-before-test');
|
|
133
|
+
assert.match(unapprovedHigh.nextAction, /rerun sdd test task HIGH --approved/);
|
|
134
|
+
assert.equal(high.teamMode.mode, 'hyperplan');
|
|
135
|
+
assert.equal(high.teamMode.enabled, true);
|
|
136
|
+
assert.equal(high.teamMode.costClass, 'high');
|
|
137
|
+
assert.equal(high.teamMode.costRoute, 'no_downgrade');
|
|
138
|
+
assert.equal(high.teamMode.downgradeReason, null);
|
|
139
|
+
assert.equal(high.teamMode.trustPolicyEnforced, true);
|
|
140
|
+
assert.equal(high.teamMode.maxMembers <= 4, true);
|
|
141
|
+
assert.equal(high.teamMode.waveRecommendation.includes('hyperplan'), true);
|
|
142
|
+
assert.equal(sourceBoundary.lifecycleGate, 'review-before-test');
|
|
143
|
+
assert.match(sourceBoundary.nextAction, /reviewer inspect affected files and validation commands/);
|
|
144
|
+
assert.equal(sourceBoundary.teamMode.mode, 'hyperplan');
|
|
145
|
+
assert.equal(sourceBoundary.teamMode.costClass, 'high');
|
|
146
|
+
assert.match(sourceBoundary.teamMode.reason, /Source-boundary/);
|
|
147
|
+
assert.equal(security.teamMode.mode, 'security-research');
|
|
148
|
+
assert.equal(security.teamMode.costClass, 'high');
|
|
149
|
+
assert.equal(security.teamMode.costRoute, 'no_downgrade');
|
|
150
|
+
assert.equal(security.teamMode.downgradeReason, null);
|
|
151
|
+
assert.equal(security.teamMode.trustPolicyEnforced, true);
|
|
152
|
+
assert.equal(security.teamMode.maxMembers <= 3, true);
|
|
153
|
+
assert.equal(security.teamMode.waveRecommendation.includes('security_research'), true);
|
|
154
|
+
assert.equal(unapprovedSecurity.category, 'blocked');
|
|
155
|
+
assert.match(unapprovedSecurity.blockedReason ?? '', /human approval before validation/);
|
|
156
|
+
assert.equal(unapprovedSecurity.lifecycleGate, 'approval-before-test');
|
|
157
|
+
assert.match(unapprovedSecurity.nextAction, /rerun sdd test task SECURITY --approved/);
|
|
158
|
+
assert.doesNotMatch(unapprovedSecurity.nextAction, /Fix task gaps/);
|
|
159
|
+
assert.equal(forced.teamMode.activation, 'force');
|
|
160
|
+
assert.equal(forced.teamMode.mode, 'review-lite');
|
|
161
|
+
assert.equal(forced.teamMode.costClass, 'low');
|
|
162
|
+
assert.equal(forced.teamMode.costRoute, 'no_downgrade');
|
|
163
|
+
assert.equal(forced.teamMode.downgradeReason, null);
|
|
164
|
+
assert.equal(forced.teamMode.trustPolicyEnforced, true);
|
|
165
|
+
assert.equal(disabled.teamMode.activation, 'off');
|
|
166
|
+
assert.equal(disabled.teamMode.mode, 'off');
|
|
167
|
+
assert.equal(disabled.teamMode.enabled, false);
|
|
168
|
+
assert.equal(disabled.teamMode.costRoute, 'blocked');
|
|
169
|
+
assert.equal(disabled.teamMode.trustPolicyEnforced, true);
|
|
170
|
+
} finally {
|
|
171
|
+
await rm(root, { recursive: true, force: true });
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
test('routeSddTask uses derived route cache and opt-in profiling only', async () => {
|
|
176
|
+
const root = await mkdtemp(path.join(tmpdir(), 'sdd-route-cache-profile-'));
|
|
177
|
+
try {
|
|
178
|
+
await initProject(root);
|
|
179
|
+
await writeBranchDocs(root, 'master', `# Tasks\n\n${adaptiveTeamTaskMarkdown('CACHE', { allowedAgents: ['reviewer'], requiredArtifacts: ['artifacts/review-CACHE.md'], affectedFiles: ['docs/cache.md'] })}`);
|
|
180
|
+
await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
|
|
181
|
+
|
|
182
|
+
const uncached = await routeSddTask(root, { taskId: 'CACHE', branch: 'master' });
|
|
183
|
+
const first = await routeSddTask(root, { taskId: 'CACHE', branch: 'master', cache: true, profile: true });
|
|
184
|
+
const second = await routeSddTask(root, { taskId: 'CACHE', branch: 'master', cache: true });
|
|
185
|
+
const third = await routeSddTask(root, { taskId: 'CACHE', branch: 'master', cache: true, profile: true });
|
|
186
|
+
|
|
187
|
+
assert.equal(uncached.cache, undefined);
|
|
188
|
+
assert.equal(uncached.profile, undefined);
|
|
189
|
+
assert.equal(first.cache?.status, 'stored');
|
|
190
|
+
assert.equal(first.cache?.source, 'content_addressed_derived_route');
|
|
191
|
+
assert.equal(first.cache?.authoritative, false);
|
|
192
|
+
assert.ok(first.profile);
|
|
193
|
+
assert.equal(first.profile.every((span) => span.contract === 'phase-6.9-runtime-profile-v1'), true);
|
|
194
|
+
assert.equal(first.profile.some((span) => span.name === 'route_compute'), true);
|
|
195
|
+
assert.equal(first.teamMode.costRoute, 'downgraded');
|
|
196
|
+
assert.equal(first.teamMode.trustPolicyEnforced, true);
|
|
197
|
+
assert.equal(second.cache?.status, 'hit');
|
|
198
|
+
assert.equal(second.cache?.authoritative, false);
|
|
199
|
+
assert.equal(second.profile, undefined);
|
|
200
|
+
assert.equal(third.cache?.status, 'hit');
|
|
201
|
+
assert.ok(third.profile);
|
|
202
|
+
assert.equal(third.profile.some((span) => span.name === 'route_total'), true);
|
|
203
|
+
assert.equal(third.profile.some((span) => span.name === 'route_compute'), false);
|
|
204
|
+
|
|
205
|
+
await writeBranchDocs(root, 'master', `# Tasks\n\n${adaptiveTeamTaskMarkdown('CACHE', { allowedAgents: ['reviewer'], requiredArtifacts: ['artifacts/review-CACHE.md'], affectedFiles: ['docs/cache.md'] })}\n\nCache key invalidation fixture.`);
|
|
206
|
+
await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
|
|
207
|
+
const invalidated = await routeSddTask(root, { taskId: 'CACHE', branch: 'master', cache: true });
|
|
208
|
+
|
|
209
|
+
assert.equal(invalidated.cache?.status, 'stored');
|
|
210
|
+
assert.notEqual(invalidated.cache?.key, first.cache?.key);
|
|
211
|
+
assert.equal(invalidated.cache?.authoritative, false);
|
|
212
|
+
} finally {
|
|
213
|
+
await rm(root, { recursive: true, force: true });
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
test('Phase 6.3 project agent runtime merges project config and routes by alias and rule', async () => {
|
|
218
|
+
const root = await mkdtemp(path.join(tmpdir(), 'sdd-phase63-runtime-'));
|
|
219
|
+
try {
|
|
220
|
+
await initProject(root);
|
|
221
|
+
await appendProjectRuntimeConfig(root, phase63ProjectRuntimeConfig());
|
|
222
|
+
await writeBranchDocs(root, 'master', phase63FrontendTaskMarkdown('FRONTEND-1'));
|
|
223
|
+
await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
|
|
224
|
+
|
|
225
|
+
const runtime = await inspectAgentSkillTeamRuntime(root);
|
|
226
|
+
const validation = await validateAgentSkillTeamRuntime(root);
|
|
227
|
+
const skillCapabilities = await listSkillCapabilities(root);
|
|
228
|
+
const frontendCapability = await inspectSkillCapability(root, 'project.skill.frontend_review');
|
|
229
|
+
const frontendSource = await inspectCapabilitySource(root, 'project_frontend_material');
|
|
230
|
+
const pack = await inspectExternalAgentPackImport(root, 'project_frontend_material');
|
|
231
|
+
const route = await routeSddTask(root, { taskId: 'FRONTEND-1', branch: 'master' });
|
|
232
|
+
|
|
233
|
+
assert.equal(validation.valid, true);
|
|
234
|
+
assert.equal(runtime.profiles.some((profile) => profile.id === 'frontend'), true);
|
|
235
|
+
assert.equal(runtime.skillCapabilities.some((capability) => capability.id === 'project.skill.frontend_review'), true);
|
|
236
|
+
assert.equal(runtime.capabilitySources.some((source) => source.id === 'project_frontend_material'), true);
|
|
237
|
+
assert.equal(runtime.registrySources?.some((source) => source.id === 'frontend' && source.origin === 'project_config'), true);
|
|
238
|
+
assert.equal(skillCapabilities.registrySources?.some((source) => source.id === 'project.skill.frontend_review' && source.origin === 'project_config'), true);
|
|
239
|
+
assert.ok(frontendCapability);
|
|
240
|
+
assert.equal(frontendCapability.evidenceType, 'artifact');
|
|
241
|
+
assert.ok(frontendSource);
|
|
242
|
+
assert.equal(frontendSource.quarantineRequired, true);
|
|
243
|
+
assert.equal(pack.status, 'quarantined');
|
|
244
|
+
assert.equal(route.recommendedProfile, 'frontend');
|
|
245
|
+
assert.equal(route.allowedProfiles.includes('frontend'), true);
|
|
246
|
+
assert.equal(route.requiredCapabilities.includes('project.skill.frontend_review'), true);
|
|
247
|
+
assert.equal(route.requiredCapabilities.includes('playwright.browser_validation'), true);
|
|
248
|
+
assert.equal(route.resolvedAliases?.some((alias) => alias.input === 'frontend-dev' && alias.resolved === 'frontend'), true);
|
|
249
|
+
assert.equal(route.routingRuleHits?.includes('frontend-default'), true);
|
|
250
|
+
assert.equal(route.registrySources?.some((source) => source.id === 'frontend' && source.origin === 'project_config'), true);
|
|
251
|
+
assert.equal((route.quarantineWarnings?.length ?? 0) > 0, true);
|
|
252
|
+
assert.equal(route.adapterMapping?.hostAdapter, 'claude_code');
|
|
253
|
+
assert.equal(route.toolPermission?.toolGroups.includes('browser'), true);
|
|
254
|
+
} finally {
|
|
255
|
+
await rm(root, { recursive: true, force: true });
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
test('Phase 6.3 invalid agent runtime declarations fail closed', async () => {
|
|
260
|
+
const root = await mkdtemp(path.join(tmpdir(), 'sdd-phase63-invalid-runtime-'));
|
|
261
|
+
try {
|
|
262
|
+
await initProject(root);
|
|
263
|
+
await appendProjectRuntimeConfig(root, phase63InvalidProjectRuntimeConfig());
|
|
264
|
+
|
|
265
|
+
const validation = await validateAgentSkillTeamRuntime(root);
|
|
266
|
+
const issueText = validation.issues.map((issue) => `${issue.field}: ${issue.message}`).join('\n');
|
|
267
|
+
|
|
268
|
+
assert.equal(validation.valid, false);
|
|
269
|
+
assert.match(issueText, /agent_runtime\.aliases\.frontend_dev/);
|
|
270
|
+
assert.match(issueText, /Alias points to unknown profile missing_profile/);
|
|
271
|
+
assert.match(issueText, /bad-rule\.preferProfile/);
|
|
272
|
+
assert.match(issueText, /missing\.capability/);
|
|
273
|
+
assert.match(issueText, /project\.skill\.bad\.evidenceType/);
|
|
274
|
+
assert.match(issueText, /unknown source missing_source/);
|
|
275
|
+
assert.match(issueText, /unsafe_source\.attribution/);
|
|
276
|
+
assert.match(issueText, /unsafe_source\.permissionModel/);
|
|
277
|
+
assert.match(issueText, /unsafe_source\.provenanceRequirements/);
|
|
278
|
+
assert.match(issueText, /unsafe_source\.hostCompatibility/);
|
|
279
|
+
assert.match(issueText, /unsafe_source\.allowedEvidenceTypes/);
|
|
280
|
+
assert.match(issueText, /unsafe_source\.forbiddenAuthority/);
|
|
281
|
+
assert.match(issueText, /Quarantined source is missing active quarantine status/);
|
|
282
|
+
assert.match(issueText, /Quarantined source cannot be reused directly/);
|
|
283
|
+
assert.match(issueText, /Quarantined source requests prompt import, direct execution, or lifecycle authority/);
|
|
284
|
+
} finally {
|
|
285
|
+
await rm(root, { recursive: true, force: true });
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
test('Phase 8.6 capability routing selects narrow domains, packs, and rejected external sources', async () => {
|
|
290
|
+
const root = await mkdtemp(path.join(tmpdir(), 'sdd-phase86-capability-routing-'));
|
|
291
|
+
try {
|
|
292
|
+
await initProject(root);
|
|
293
|
+
await writeBranchDocs(root, 'master', `# Tasks
|
|
294
|
+
|
|
295
|
+
${capabilityRouteTaskMarkdown('SIMPLE', 'Simple backend parser fix', ['packages/core/src/parser.ts'], [], ['npm test'])}
|
|
296
|
+
${capabilityRouteTaskMarkdown('UI', 'UI UX frontend interaction update', ['src/components/Button.tsx'], ['ui-ux', 'accessibility'], ['browser Playwright validation'])}
|
|
297
|
+
${capabilityRouteTaskMarkdown('SECURITY', 'Security permission boundary update', ['packages/core/src/auth.ts'], ['security'], ['npm test'])}
|
|
298
|
+
${capabilityRouteTaskMarkdown('DB', 'Database migration data safety update', ['db/migrations/001.sql'], ['database', 'data-loss'], ['npm test'])}
|
|
299
|
+
${capabilityRouteTaskMarkdown('RELEASE', 'Release deploy rollback readiness', ['.github/workflows/release.yml'], ['release', 'ci-build'], ['npm test'])}
|
|
300
|
+
${capabilityRouteTaskMarkdown('TESTING', 'Testing quality coverage update', ['packages/core/src/parser.test.ts'], ['validation'], ['coverage acceptance test'])}`);
|
|
301
|
+
|
|
302
|
+
const simple = await routeSddTask(root, { taskId: 'SIMPLE', branch: 'master' });
|
|
303
|
+
const ui = await routeSddTask(root, { taskId: 'UI', branch: 'master' });
|
|
304
|
+
const security = await routeSddTask(root, { taskId: 'SECURITY', branch: 'master', approved: true });
|
|
305
|
+
const db = await routeSddTask(root, { taskId: 'DB', branch: 'master', approved: true });
|
|
306
|
+
const release = await routeSddTask(root, { taskId: 'RELEASE', branch: 'master', approved: true });
|
|
307
|
+
const testing = await routeSddTask(root, { taskId: 'TESTING', branch: 'master' });
|
|
308
|
+
const figmaConsidered = ui.capabilityDecision.consideredExternalSources.find((source) => source.sourceId === 'figma_design_future');
|
|
309
|
+
const uiUxProMaxConsidered = ui.capabilityDecision.consideredExternalSources.find((source) => source.sourceId === 'ui_ux_pro_max_external');
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
assert.deepEqual(simple.capabilityDecision.selectedDomains.map((item) => item.domain), ['backend-engineering']);
|
|
313
|
+
assert.equal(simple.capabilityDecision.selectedPacks.length <= 2, true);
|
|
314
|
+
assert.equal(simple.capabilityDecision.authority, 'advisory_only');
|
|
315
|
+
assert.equal(simple.capabilityDecision.permissionCeiling, simple.autonomyCeiling);
|
|
316
|
+
assert.equal(ui.capabilityDecision.selectedDomains.some((item) => item.domain === 'frontend-engineering'), true);
|
|
317
|
+
assert.equal(ui.capabilityDecision.selectedDomains.some((item) => item.domain === 'ui-ux-product-design'), true);
|
|
318
|
+
assert.equal(ui.capabilityDecision.selectedPacks.some((pack) => pack.id === 'baseline-ui-ux-product-design'), true);
|
|
319
|
+
assert.equal(ui.capabilityDecision.rejectedExternalSources.some((source) => source.sourceId === 'figma_design_future' && /Future adapter|quarantine/.test(source.reason)), true);
|
|
320
|
+
assert.equal(ui.capabilityDecision.rejectedExternalSources.some((source) => source.sourceId === 'ui_ux_pro_max_external' && /quarantine/i.test(source.reason)), true);
|
|
321
|
+
assert.ok(figmaConsidered);
|
|
322
|
+
assert.equal(figmaConsidered.kind, 'future_adapter');
|
|
323
|
+
assert.equal(figmaConsidered.consideredUse.length > 0, true);
|
|
324
|
+
assert.ok(uiUxProMaxConsidered);
|
|
325
|
+
assert.equal(uiUxProMaxConsidered.kind, 'open_source_material');
|
|
326
|
+
assert.equal(uiUxProMaxConsidered.quarantineStatus, 'quarantined');
|
|
327
|
+
assert.equal(security.capabilityDecision.selectedDomains.some((item) => item.domain === 'security-engineering'), true);
|
|
328
|
+
assert.equal(db.capabilityDecision.selectedDomains.some((item) => item.domain === 'db-data-engineering'), true);
|
|
329
|
+
assert.equal(release.capabilityDecision.selectedDomains.some((item) => item.domain === 'release-engineering'), true);
|
|
330
|
+
assert.equal(release.capabilityDecision.selectedPacks.some((pack) => pack.id === 'baseline-release-engineering'), true);
|
|
331
|
+
assert.equal(testing.capabilityDecision.selectedDomains.some((item) => item.domain === 'testing-quality-engineering'), true);
|
|
332
|
+
assert.equal(testing.capabilityDecision.evidenceRequirements.some((item) => item.includes('evidence requirement')), true);
|
|
333
|
+
assert.equal(ui.requiredCapabilities.includes('figma_design_future'), false);
|
|
334
|
+
} finally {
|
|
335
|
+
await rm(root, { recursive: true, force: true });
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
test.skip('routeSddTask blocks downstream tasks until dependencies are completed', async () => {
|
|
341
|
+
const root = await mkdtemp(path.join(tmpdir(), 'sdd-route-dependencies-'));
|
|
342
|
+
try {
|
|
343
|
+
await initProject(root);
|
|
344
|
+
await writeBranchDocs(root, 'feature', `# Tasks\n\n${validTaskMarkdown('DEP1', [])}\n${validTaskMarkdown('DEP2', ['DEP1']).replace('packages/core/src/index.ts', 'docs/dep2.md')}`);
|
|
345
|
+
|
|
346
|
+
const blocked = await routeSddTask(root, { taskId: 'DEP2', branch: 'feature', approved: true });
|
|
347
|
+
|
|
348
|
+
assert.equal(blocked.category, 'blocked');
|
|
349
|
+
assert.equal(blocked.recommendedProfile, null);
|
|
350
|
+
assert.match(blocked.blockedReason ?? '', /DEP2 depends on DEP1, but DEP1 has not passed required verification/);
|
|
351
|
+
assert.match(blocked.nextAction, /sdd test task DEP1/);
|
|
352
|
+
|
|
353
|
+
await writeBranchDocs(root, 'feature', `# Tasks\n\n${validTaskMarkdown('DEP1', []).replace('status: pending', 'status: completed')}\n${validTaskMarkdown('DEP2', ['DEP1']).replace('packages/core/src/index.ts', 'docs/dep2.md')}`);
|
|
354
|
+
const ready = await routeSddTask(root, { taskId: 'DEP2', branch: 'feature' });
|
|
355
|
+
|
|
356
|
+
assert.notEqual(ready.category, 'blocked');
|
|
357
|
+
assert.equal(ready.blockedReason, null);
|
|
358
|
+
assert.ok(ready.recommendedProfile);
|
|
359
|
+
} finally {
|
|
360
|
+
await rm(root, { recursive: true, force: true });
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
test('routeSddTask uses latest eligible runtime dependency readiness', async () => {
|
|
365
|
+
const root = await mkdtemp(path.join(tmpdir(), 'sdd-route-runtime-dependencies-'));
|
|
366
|
+
try {
|
|
367
|
+
await initProject(root);
|
|
368
|
+
await writeBranchDocs(root, 'feature', `# Tasks
|
|
369
|
+
|
|
370
|
+
${validTaskMarkdown('DEP1', [])
|
|
371
|
+
.replace('packages/core/src/index.ts', 'docs/dep1.md')
|
|
372
|
+
.replace('validation:\n - npm test', 'validation_batch: dep-batch\nvalidation_timing: batch_end\nrequires_verify_before_next: false\nvalidation:\n - npm test')}
|
|
373
|
+
${validTaskMarkdown('DEP2', ['DEP1']).replace('packages/core/src/index.ts', 'docs/dep2.md')}`);
|
|
374
|
+
const run = await createRun(root, { runId: 'run-dep1-implemented' });
|
|
375
|
+
await bindTestRunState(root, run.runId, 'feature', 'DEP1');
|
|
376
|
+
const bound = await readRunState(root, run.runId);
|
|
377
|
+
await writeRunState(root, {
|
|
378
|
+
...bound,
|
|
379
|
+
status: 'completed',
|
|
380
|
+
tasks: {
|
|
381
|
+
...bound.tasks,
|
|
382
|
+
DEP1: {
|
|
383
|
+
status: 'implemented_pending_validation',
|
|
384
|
+
implementationStatus: 'implemented',
|
|
385
|
+
verificationStatus: 'pending_batch',
|
|
386
|
+
validationBatch: 'dep-batch',
|
|
387
|
+
validationTiming: 'batch_end',
|
|
388
|
+
requiresVerifyBeforeNext: false,
|
|
389
|
+
gaps: [],
|
|
390
|
+
artifacts: []
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
|
|
395
|
+
const decision = await routeSddTask(root, { taskId: 'DEP2', branch: 'feature' });
|
|
396
|
+
|
|
397
|
+
assert.notEqual(decision.category, 'blocked');
|
|
398
|
+
assert.equal(decision.blockedReason, null);
|
|
399
|
+
assert.ok(decision.recommendedProfile);
|
|
400
|
+
} finally {
|
|
401
|
+
await rm(root, { recursive: true, force: true });
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
function capabilityRouteTaskMarkdown(taskId: string, title: string, affectedFiles: string[], risk: string[], validation: string[]): string {
|
|
406
|
+
const affectedFilesBlock = affectedFiles.length === 0 ? 'affected_files: []' : `affected_files:\n${affectedFiles.map((file) => ` - ${file}`).join('\n')}`;
|
|
407
|
+
const riskBlock = risk.length === 0 ? 'risk: []' : `risk:\n${risk.map((item) => ` - ${item}`).join('\n')}`;
|
|
408
|
+
const validationBlock = validation.length === 0 ? 'validation: []' : `validation:\n${validation.map((item) => ` - ${item}`).join('\n')}`;
|
|
409
|
+
return `### ${taskId}: ${title}
|
|
410
|
+
|
|
411
|
+
\`\`\`sdd-task
|
|
412
|
+
id: ${taskId}
|
|
413
|
+
status: pending
|
|
414
|
+
wave: 1
|
|
415
|
+
depends_on: []
|
|
416
|
+
acceptance_refs:
|
|
417
|
+
- AC-1
|
|
418
|
+
${affectedFilesBlock}
|
|
419
|
+
${validationBlock}
|
|
420
|
+
${riskBlock}
|
|
421
|
+
allowed_agents:
|
|
422
|
+
- implementer
|
|
423
|
+
\`\`\`
|
|
424
|
+
|
|
425
|
+
#### Acceptance
|
|
426
|
+
|
|
427
|
+
- ${title}.
|
|
428
|
+
`;
|
|
429
429
|
}
|