sdd-agent-platform 0.4.0 → 0.4.1
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 +18 -23
- package/node_modules/@sdd-agent-platform/core/dist/ai-tools.js +31 -28
- 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.js +3 -2
- package/node_modules/@sdd-agent-platform/core/dist/config/init-project.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.js +14 -5
- package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/contracts.d.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/contracts.js +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/contracts.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-evidence.js +3 -3
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-evidence.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/doctor.js +155 -1
- 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 +23 -0
- package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.js +54 -0
- package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/evidence-runtime/contracts.d.ts +11 -0
- package/node_modules/@sdd-agent-platform/core/dist/execution/agent-execution-records.js +15 -8
- package/node_modules/@sdd-agent-platform/core/dist/execution/agent-execution-records.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/resident-worker.js +14 -6
- package/node_modules/@sdd-agent-platform/core/dist/execution/resident-worker.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/stage-team-runtime.d.ts +112 -0
- package/node_modules/@sdd-agent-platform/core/dist/execution/stage-team-runtime.js +145 -0
- package/node_modules/@sdd-agent-platform/core/dist/execution/stage-team-runtime.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/instructions.js +36 -36
- package/node_modules/@sdd-agent-platform/core/dist/instructions.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.d.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.js +37 -17
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.d.ts +16 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.js +174 -16
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-registry.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-registry.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-runtime-static.d.ts +10 -0
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-runtime-static.js +31 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-runtime-static.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/capability-sources.d.ts +2 -17
- package/node_modules/@sdd-agent-platform/core/dist/registries/capability-sources.js +222 -10
- package/node_modules/@sdd-agent-platform/core/dist/registries/capability-sources.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/workflow-gates.js +5 -5
- package/node_modules/@sdd-agent-platform/core/dist/registries/workflow-gates.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime-config.js +27 -12
- package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime-config.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime.d.ts +59 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.d.ts +3 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.js +191 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/routing.js +32 -6
- package/node_modules/@sdd-agent-platform/core/dist/router/routing.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-inspection.js +11 -4
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-inspection.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-validation.js +31 -3
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-validation.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/artifacts.js +48 -15
- 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/events.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/run-state/events.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.d.ts +3 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.js +15 -49
- package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/invocation-ledger.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/run-state/invocation-ledger.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/model.d.ts +25 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-state.js +21 -14
- 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 +62 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.js +130 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state.d.ts +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state.js +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.d.ts +10 -0
- package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.js +44 -14
- package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/context.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/context.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.d.ts +4 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.js +189 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/run-binding.js +12 -3
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/run-binding.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.d.ts +20 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.js +101 -21
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/status/project-status.d.ts +62 -1
- package/node_modules/@sdd-agent-platform/core/dist/status/project-status.js +192 -4
- 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 +195 -2
- package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.js +499 -2
- 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.js +23 -1
- 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 +19 -0
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.js +114 -12
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/test-support/fixtures.js +21 -0
- 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.js +16 -2
- package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.js +34 -2
- 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.js +15 -5
- package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/review-gate.d.ts +22 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/review-gate.js +53 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/review-gate.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.js +102 -9
- package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.d.ts +16 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.js +355 -69
- 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-wave.d.ts +58 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.js +428 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.d.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.js +116 -18
- 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 +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification.js +2 -0
- 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.d.ts +24 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.js +182 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.d.ts +4 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.js +130 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.d.ts +4 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.js +146 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/types.d.ts +89 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/types.js +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/types.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.d.ts +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.js +16 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/dependencies.d.ts +8 -4
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/dependencies.js +25 -11
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/dependencies.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.d.ts +38 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.js +122 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.d.ts +27 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.js +166 -37
- 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.d.ts +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state.js +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/package.json +1 -1
- package/node_modules/@sdd-agent-platform/core/src/ai-tools.ts +31 -28
- package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-result.test.ts +50 -4
- package/node_modules/@sdd-agent-platform/core/src/config/init-project.test.ts +13 -10
- package/node_modules/@sdd-agent-platform/core/src/config/init-project.ts +3 -2
- package/node_modules/@sdd-agent-platform/core/src/config/starter-documents.ts +15 -5
- package/node_modules/@sdd-agent-platform/core/src/contracts.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/run-evidence.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/src/doctor/doctor.test.ts +117 -5
- package/node_modules/@sdd-agent-platform/core/src/doctor/doctor.ts +164 -1
- package/node_modules/@sdd-agent-platform/core/src/evidence/lookup.ts +80 -0
- package/node_modules/@sdd-agent-platform/core/src/evidence-runtime/contracts.ts +12 -0
- package/node_modules/@sdd-agent-platform/core/src/execution/agent-execution-records.ts +16 -11
- package/node_modules/@sdd-agent-platform/core/src/execution/background-executor.test.ts +7 -0
- package/node_modules/@sdd-agent-platform/core/src/execution/resident-worker.test.ts +5 -0
- package/node_modules/@sdd-agent-platform/core/src/execution/resident-worker.ts +14 -6
- package/node_modules/@sdd-agent-platform/core/src/execution/stage-team-runtime.test.ts +102 -0
- package/node_modules/@sdd-agent-platform/core/src/execution/stage-team-runtime.ts +271 -0
- package/node_modules/@sdd-agent-platform/core/src/execution/wave-executor.test.ts +4 -0
- package/node_modules/@sdd-agent-platform/core/src/governance/policy.test.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/instructions.test.ts +11 -5
- package/node_modules/@sdd-agent-platform/core/src/instructions.ts +36 -36
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/ship.ts +39 -17
- package/node_modules/@sdd-agent-platform/core/src/phase8-contracts.test.ts +3 -2
- package/node_modules/@sdd-agent-platform/core/src/phase8-risk-kernel.test.ts +5 -0
- package/node_modules/@sdd-agent-platform/core/src/planning/task-graph.test.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/planning/wave-plan.test.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-capability-catalog.ts +269 -17
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-registry.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-runtime-static.ts +41 -1
- package/node_modules/@sdd-agent-platform/core/src/registries/capability-sources.ts +238 -15
- package/node_modules/@sdd-agent-platform/core/src/registries/registries.test.ts +27 -2
- package/node_modules/@sdd-agent-platform/core/src/registries/workflow-gates.ts +5 -5
- package/node_modules/@sdd-agent-platform/core/src/router/agent-runtime-config.ts +31 -12
- package/node_modules/@sdd-agent-platform/core/src/router/agent-runtime.ts +66 -1
- package/node_modules/@sdd-agent-platform/core/src/router/route-projection.ts +211 -0
- package/node_modules/@sdd-agent-platform/core/src/router/route-sdd-task.test.ts +151 -3
- package/node_modules/@sdd-agent-platform/core/src/router/routing.ts +35 -6
- package/node_modules/@sdd-agent-platform/core/src/router/runtime-inspection.ts +11 -4
- package/node_modules/@sdd-agent-platform/core/src/router/runtime-validation.ts +32 -3
- package/node_modules/@sdd-agent-platform/core/src/run-state/artifacts.ts +48 -15
- package/node_modules/@sdd-agent-platform/core/src/run-state/events.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/run-state/inspect-run.ts +17 -52
- package/node_modules/@sdd-agent-platform/core/src/run-state/invocation-ledger.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/run-state/model.ts +28 -1
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-state.test.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-state.ts +22 -18
- package/node_modules/@sdd-agent-platform/core/src/run-state/task-evidence.ts +206 -0
- package/node_modules/@sdd-agent-platform/core/src/run-state.ts +1 -0
- package/node_modules/@sdd-agent-platform/core/src/runtime-paths.ts +54 -14
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/context.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/document-hashes.ts +207 -0
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/run-binding.ts +12 -3
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.test.ts +139 -0
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.ts +137 -24
- package/node_modules/@sdd-agent-platform/core/src/status/project-status.ts +268 -5
- package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.test.ts +368 -4
- package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.ts +697 -2
- package/node_modules/@sdd-agent-platform/core/src/sync-back/apply.ts +23 -1
- package/node_modules/@sdd-agent-platform/core/src/sync-back/inspect.ts +145 -12
- package/node_modules/@sdd-agent-platform/core/src/sync-back/sync-back.test.ts +132 -9
- package/node_modules/@sdd-agent-platform/core/src/test-support/fixtures.ts +21 -0
- package/node_modules/@sdd-agent-platform/core/src/test-support/run-state.ts +16 -2
- package/node_modules/@sdd-agent-platform/core/src/verification/goal-verify.test.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/verification/goal-verify.ts +38 -5
- package/node_modules/@sdd-agent-platform/core/src/verification/rendering.ts +15 -5
- package/node_modules/@sdd-agent-platform/core/src/verification/review-gate.test.ts +77 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/review-gate.ts +77 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/single-task-loop.test.ts +64 -4
- package/node_modules/@sdd-agent-platform/core/src/verification/single-task-loop.ts +110 -12
- package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.test.ts +72 -25
- package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.ts +402 -77
- package/node_modules/@sdd-agent-platform/core/src/verification/validation-wave.test.ts +341 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/validation-wave.ts +513 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.test.ts +144 -5
- package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.ts +129 -18
- package/node_modules/@sdd-agent-platform/core/src/verification.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/evidence-packet.ts +196 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.test.ts +171 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.ts +143 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.test.ts +137 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.ts +155 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/types.ts +114 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/affected-file-conflicts.ts +18 -1
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/dependencies.test.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/dependencies.ts +33 -11
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/latest-eligible-run.ts +156 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve.test.ts +351 -2
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve.ts +227 -39
- package/node_modules/@sdd-agent-platform/core/src/workflow-state.ts +1 -0
- package/package.json +1 -1
- package/packages/cli/dist/commands/status.js +2 -2
- package/packages/cli/dist/commands/status.js.map +1 -1
- package/packages/cli/dist/commands/sync-back.js +1 -1
- package/packages/cli/dist/commands/sync-back.js.map +1 -1
- package/packages/cli/dist/commands/tasks.js +4 -4
- package/packages/cli/dist/commands/tasks.js.map +1 -1
- package/packages/cli/dist/commands/test.js +94 -5
- package/packages/cli/dist/commands/test.js.map +1 -1
- package/packages/cli/dist/commands/verifies.js +5 -3
- package/packages/cli/dist/commands/verifies.js.map +1 -1
- package/packages/cli/dist/commands/verify.js +48 -7
- package/packages/cli/dist/commands/verify.js.map +1 -1
- package/packages/cli/dist/help.js +32 -18
- package/packages/cli/dist/help.js.map +1 -1
- package/packages/cli/dist/renderers/artifacts.js +1 -1
- package/packages/cli/dist/renderers/artifacts.js.map +1 -1
- package/packages/cli/dist/renderers/registry-runtime.js +7 -2
- package/packages/cli/dist/renderers/registry-runtime.js.map +1 -1
- package/packages/cli/dist/renderers/router.js +4 -2
- package/packages/cli/dist/renderers/router.js.map +1 -1
- package/packages/cli/dist/renderers/workflow.js +33 -12
- package/packages/cli/dist/renderers/workflow.js.map +1 -1
- package/packages/cli/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/cli/package.json +2 -2
- package/packages/core/dist/ai-tools.js +31 -28
- package/packages/core/dist/ai-tools.js.map +1 -1
- package/packages/core/dist/config/init-project.js +3 -2
- package/packages/core/dist/config/init-project.js.map +1 -1
- package/packages/core/dist/config/starter-documents.d.ts +1 -1
- package/packages/core/dist/config/starter-documents.js +14 -5
- package/packages/core/dist/config/starter-documents.js.map +1 -1
- package/packages/core/dist/contracts.d.ts +2 -0
- package/packages/core/dist/contracts.js +2 -0
- package/packages/core/dist/contracts.js.map +1 -1
- package/packages/core/dist/doctor/checks/run-evidence.js +3 -3
- package/packages/core/dist/doctor/checks/run-evidence.js.map +1 -1
- package/packages/core/dist/doctor/doctor.js +155 -1
- package/packages/core/dist/doctor/doctor.js.map +1 -1
- package/packages/core/dist/evidence/lookup.d.ts +23 -0
- package/packages/core/dist/evidence/lookup.js +54 -0
- package/packages/core/dist/evidence/lookup.js.map +1 -0
- package/packages/core/dist/evidence-runtime/contracts.d.ts +11 -0
- package/packages/core/dist/execution/agent-execution-records.js +15 -8
- package/packages/core/dist/execution/agent-execution-records.js.map +1 -1
- package/packages/core/dist/execution/resident-worker.js +14 -6
- package/packages/core/dist/execution/resident-worker.js.map +1 -1
- package/packages/core/dist/execution/stage-team-runtime.d.ts +112 -0
- package/packages/core/dist/execution/stage-team-runtime.js +145 -0
- package/packages/core/dist/execution/stage-team-runtime.js.map +1 -0
- package/packages/core/dist/instructions.js +36 -36
- package/packages/core/dist/instructions.js.map +1 -1
- package/packages/core/dist/lifecycle/ship.d.ts +2 -0
- package/packages/core/dist/lifecycle/ship.js +37 -17
- package/packages/core/dist/lifecycle/ship.js.map +1 -1
- package/packages/core/dist/registries/agent-capability-catalog.d.ts +16 -1
- package/packages/core/dist/registries/agent-capability-catalog.js +174 -16
- package/packages/core/dist/registries/agent-capability-catalog.js.map +1 -1
- package/packages/core/dist/registries/agent-registry.js +2 -2
- package/packages/core/dist/registries/agent-registry.js.map +1 -1
- package/packages/core/dist/registries/agent-runtime-static.d.ts +10 -0
- package/packages/core/dist/registries/agent-runtime-static.js +31 -1
- package/packages/core/dist/registries/agent-runtime-static.js.map +1 -1
- package/packages/core/dist/registries/capability-sources.d.ts +2 -17
- package/packages/core/dist/registries/capability-sources.js +222 -10
- package/packages/core/dist/registries/capability-sources.js.map +1 -1
- package/packages/core/dist/registries/workflow-gates.js +5 -5
- package/packages/core/dist/registries/workflow-gates.js.map +1 -1
- package/packages/core/dist/router/agent-runtime-config.js +27 -12
- package/packages/core/dist/router/agent-runtime-config.js.map +1 -1
- package/packages/core/dist/router/agent-runtime.d.ts +59 -1
- package/packages/core/dist/router/route-projection.d.ts +3 -1
- package/packages/core/dist/router/route-projection.js +191 -0
- package/packages/core/dist/router/route-projection.js.map +1 -1
- package/packages/core/dist/router/routing.js +32 -6
- package/packages/core/dist/router/routing.js.map +1 -1
- package/packages/core/dist/router/runtime-inspection.js +11 -4
- package/packages/core/dist/router/runtime-inspection.js.map +1 -1
- package/packages/core/dist/router/runtime-validation.js +31 -3
- package/packages/core/dist/router/runtime-validation.js.map +1 -1
- package/packages/core/dist/run-state/artifacts.js +48 -15
- package/packages/core/dist/run-state/artifacts.js.map +1 -1
- package/packages/core/dist/run-state/events.js +2 -2
- package/packages/core/dist/run-state/events.js.map +1 -1
- package/packages/core/dist/run-state/inspect-run.d.ts +3 -1
- package/packages/core/dist/run-state/inspect-run.js +15 -49
- package/packages/core/dist/run-state/inspect-run.js.map +1 -1
- package/packages/core/dist/run-state/invocation-ledger.js +2 -2
- package/packages/core/dist/run-state/invocation-ledger.js.map +1 -1
- package/packages/core/dist/run-state/model.d.ts +25 -1
- package/packages/core/dist/run-state/run-state.js +21 -14
- package/packages/core/dist/run-state/run-state.js.map +1 -1
- package/packages/core/dist/run-state/task-evidence.d.ts +62 -0
- package/packages/core/dist/run-state/task-evidence.js +130 -0
- package/packages/core/dist/run-state/task-evidence.js.map +1 -0
- package/packages/core/dist/run-state.d.ts +1 -0
- package/packages/core/dist/run-state.js +1 -0
- package/packages/core/dist/run-state.js.map +1 -1
- package/packages/core/dist/runtime-paths.d.ts +10 -0
- package/packages/core/dist/runtime-paths.js +44 -14
- package/packages/core/dist/runtime-paths.js.map +1 -1
- package/packages/core/dist/sdd-docs/context.js +1 -1
- package/packages/core/dist/sdd-docs/context.js.map +1 -1
- package/packages/core/dist/sdd-docs/document-hashes.d.ts +4 -0
- package/packages/core/dist/sdd-docs/document-hashes.js +189 -0
- package/packages/core/dist/sdd-docs/document-hashes.js.map +1 -0
- package/packages/core/dist/sdd-docs/run-binding.js +12 -3
- package/packages/core/dist/sdd-docs/run-binding.js.map +1 -1
- package/packages/core/dist/sdd-docs/task-parser.d.ts +20 -0
- package/packages/core/dist/sdd-docs/task-parser.js +101 -21
- package/packages/core/dist/sdd-docs/task-parser.js.map +1 -1
- package/packages/core/dist/status/project-status.d.ts +62 -1
- package/packages/core/dist/status/project-status.js +192 -4
- package/packages/core/dist/status/project-status.js.map +1 -1
- package/packages/core/dist/storage/runtime-store.d.ts +195 -2
- package/packages/core/dist/storage/runtime-store.js +499 -2
- package/packages/core/dist/storage/runtime-store.js.map +1 -1
- package/packages/core/dist/sync-back/apply.js +23 -1
- package/packages/core/dist/sync-back/apply.js.map +1 -1
- package/packages/core/dist/sync-back/inspect.d.ts +19 -0
- package/packages/core/dist/sync-back/inspect.js +114 -12
- package/packages/core/dist/sync-back/inspect.js.map +1 -1
- package/packages/core/dist/test-support/fixtures.js +21 -0
- package/packages/core/dist/test-support/fixtures.js.map +1 -1
- package/packages/core/dist/test-support/run-state.js +16 -2
- package/packages/core/dist/test-support/run-state.js.map +1 -1
- package/packages/core/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/core/dist/verification/goal-verify.js +34 -2
- package/packages/core/dist/verification/goal-verify.js.map +1 -1
- package/packages/core/dist/verification/rendering.js +15 -5
- package/packages/core/dist/verification/rendering.js.map +1 -1
- package/packages/core/dist/verification/review-gate.d.ts +22 -0
- package/packages/core/dist/verification/review-gate.js +53 -0
- package/packages/core/dist/verification/review-gate.js.map +1 -0
- package/packages/core/dist/verification/single-task-loop.js +102 -9
- package/packages/core/dist/verification/single-task-loop.js.map +1 -1
- package/packages/core/dist/verification/test-runtime.d.ts +16 -1
- package/packages/core/dist/verification/test-runtime.js +355 -69
- package/packages/core/dist/verification/test-runtime.js.map +1 -1
- package/packages/core/dist/verification/validation-wave.d.ts +58 -0
- package/packages/core/dist/verification/validation-wave.js +428 -0
- package/packages/core/dist/verification/validation-wave.js.map +1 -0
- package/packages/core/dist/verification/verify-contract.d.ts +2 -0
- package/packages/core/dist/verification/verify-contract.js +116 -18
- package/packages/core/dist/verification/verify-contract.js.map +1 -1
- package/packages/core/dist/verification.d.ts +2 -0
- package/packages/core/dist/verification.js +2 -0
- package/packages/core/dist/verification.js.map +1 -1
- package/packages/core/dist/workflow-gate/evidence-packet.d.ts +24 -0
- package/packages/core/dist/workflow-gate/evidence-packet.js +182 -0
- package/packages/core/dist/workflow-gate/evidence-packet.js.map +1 -0
- package/packages/core/dist/workflow-gate/hard-checks.d.ts +4 -0
- package/packages/core/dist/workflow-gate/hard-checks.js +130 -0
- package/packages/core/dist/workflow-gate/hard-checks.js.map +1 -0
- package/packages/core/dist/workflow-gate/policy.d.ts +4 -0
- package/packages/core/dist/workflow-gate/policy.js +146 -0
- package/packages/core/dist/workflow-gate/policy.js.map +1 -0
- package/packages/core/dist/workflow-gate/types.d.ts +89 -0
- package/packages/core/dist/workflow-gate/types.js +2 -0
- package/packages/core/dist/workflow-gate/types.js.map +1 -0
- package/packages/core/dist/workflow-state/affected-file-conflicts.d.ts +1 -0
- package/packages/core/dist/workflow-state/affected-file-conflicts.js +16 -1
- package/packages/core/dist/workflow-state/affected-file-conflicts.js.map +1 -1
- package/packages/core/dist/workflow-state/dependencies.d.ts +8 -4
- package/packages/core/dist/workflow-state/dependencies.js +25 -11
- package/packages/core/dist/workflow-state/dependencies.js.map +1 -1
- package/packages/core/dist/workflow-state/latest-eligible-run.d.ts +38 -0
- package/packages/core/dist/workflow-state/latest-eligible-run.js +122 -0
- package/packages/core/dist/workflow-state/latest-eligible-run.js.map +1 -0
- package/packages/core/dist/workflow-state/resolve.d.ts +27 -0
- package/packages/core/dist/workflow-state/resolve.js +166 -37
- package/packages/core/dist/workflow-state/resolve.js.map +1 -1
- package/packages/core/dist/workflow-state.d.ts +1 -0
- package/packages/core/dist/workflow-state.js +1 -0
- package/packages/core/dist/workflow-state.js.map +1 -1
- package/packages/core/package.json +1 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { FanInEvidenceSetRecord, LlmAdvisorAssessmentRecord } from '../execution/stage-team-runtime.js';
|
|
2
|
+
import type { RuntimeDurableGapRecord, RuntimeSyncBackDecisionRecord } from '../storage/runtime-store.js';
|
|
3
|
+
import type { LatestEligibleRunSelection } from '../workflow-state/latest-eligible-run.js';
|
|
4
|
+
import type { WorkflowDependencyBlocker } from '../workflow-state/dependencies.js';
|
|
5
|
+
import type { WorkflowAffectedFileConflict } from '../workflow-state/affected-file-conflicts.js';
|
|
6
|
+
import type { SddTaskModel } from '../sdd-docs/task-parser.js';
|
|
7
|
+
|
|
8
|
+
export type WorkflowGateStatus = 'PASS' | 'WARN' | 'BLOCKED' | 'HUMAN_REQUIRED' | 'ADVISORY_ONLY';
|
|
9
|
+
export type WorkflowGateHardCheckSeverity = 'info' | 'warning' | 'blocked';
|
|
10
|
+
export type WorkflowGateAdvisorSummaryStatus = 'none' | 'low_concern' | 'medium_concern' | 'high_concern' | 'invalid';
|
|
11
|
+
export type WorkflowGateDecisionKind = 'test' | 'validation_wave' | 'review_gate' | 'sync_back' | 'ship' | 'stage_transition';
|
|
12
|
+
|
|
13
|
+
export type WorkflowGateHardCheckCode =
|
|
14
|
+
| 'schema_health_unavailable'
|
|
15
|
+
| 'missing_documents'
|
|
16
|
+
| 'stale_documents'
|
|
17
|
+
| 'contract_hash_mismatch'
|
|
18
|
+
| 'run_rejected'
|
|
19
|
+
| 'blocked_failed_or_archived_run'
|
|
20
|
+
| 'latest_eligible_missing'
|
|
21
|
+
| 'missing_payload'
|
|
22
|
+
| 'digest_drift'
|
|
23
|
+
| 'missing_required_artifact'
|
|
24
|
+
| 'validation_failure'
|
|
25
|
+
| 'dependency_blocker'
|
|
26
|
+
| 'authority_violation'
|
|
27
|
+
| 'sync_back_divergence'
|
|
28
|
+
| 'affected_file_conflict'
|
|
29
|
+
| 'durable_gap_blocking';
|
|
30
|
+
|
|
31
|
+
export interface WorkflowGateHardCheck {
|
|
32
|
+
code: WorkflowGateHardCheckCode;
|
|
33
|
+
severity: WorkflowGateHardCheckSeverity;
|
|
34
|
+
scope: string;
|
|
35
|
+
message: string;
|
|
36
|
+
recovery: string;
|
|
37
|
+
refs: string[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface WorkflowGateArtifactPayloadHealth {
|
|
41
|
+
payloadId: string;
|
|
42
|
+
logicalRef: string;
|
|
43
|
+
physicalPayloadPath: string;
|
|
44
|
+
expectedDigest: string;
|
|
45
|
+
actualDigest: string | null;
|
|
46
|
+
status: 'ok' | 'missing' | 'digest_drift';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface WorkflowGateRuntimeHealth {
|
|
50
|
+
status: 'ok' | 'unavailable';
|
|
51
|
+
issues: string[];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface WorkflowGateScope {
|
|
55
|
+
waveRunId: string | null;
|
|
56
|
+
taskIds: string[];
|
|
57
|
+
runIds: string[];
|
|
58
|
+
evidenceRefs: string[];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface WorkflowGateEvidencePacket {
|
|
62
|
+
packetId: string;
|
|
63
|
+
generatedAt: string;
|
|
64
|
+
decisionKind: WorkflowGateDecisionKind;
|
|
65
|
+
partition: string;
|
|
66
|
+
taskId: string | null;
|
|
67
|
+
runId: string | null;
|
|
68
|
+
documents: SddTaskModel['documents'];
|
|
69
|
+
latestEligibleSelection: LatestEligibleRunSelection | null;
|
|
70
|
+
latestEligibleSelections: LatestEligibleRunSelection[];
|
|
71
|
+
workflowScope: WorkflowGateScope;
|
|
72
|
+
runtimeHealth: WorkflowGateRuntimeHealth;
|
|
73
|
+
durableGaps: RuntimeDurableGapRecord[];
|
|
74
|
+
dependencyBlockers: WorkflowDependencyBlocker[];
|
|
75
|
+
affectedFileConflicts: WorkflowAffectedFileConflict[];
|
|
76
|
+
syncBackDecision: RuntimeSyncBackDecisionRecord | null;
|
|
77
|
+
syncBackDecisions: RuntimeSyncBackDecisionRecord[];
|
|
78
|
+
fanInEvidenceSets: FanInEvidenceSetRecord[];
|
|
79
|
+
advisorAssessments: LlmAdvisorAssessmentRecord[];
|
|
80
|
+
canonicalEvidenceRefs: string[];
|
|
81
|
+
requiredArtifactRefs: string[];
|
|
82
|
+
artifactPayloadHealth: WorkflowGateArtifactPayloadHealth[];
|
|
83
|
+
hardChecks: WorkflowGateHardCheck[];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface WorkflowGateAdvisorSummary {
|
|
87
|
+
status: WorkflowGateAdvisorSummaryStatus;
|
|
88
|
+
highConcernCount: number;
|
|
89
|
+
mediumConcernCount: number;
|
|
90
|
+
invalidCount: number;
|
|
91
|
+
lowConfidenceCount: number;
|
|
92
|
+
summaries: string[];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface WorkflowGateDecision {
|
|
96
|
+
decisionId: string;
|
|
97
|
+
inputHash: string;
|
|
98
|
+
generatedAt: string;
|
|
99
|
+
partition: string;
|
|
100
|
+
taskId: string | null;
|
|
101
|
+
runId: string | null;
|
|
102
|
+
decisionKind: WorkflowGateDecisionKind;
|
|
103
|
+
status: WorkflowGateStatus;
|
|
104
|
+
decidedBy: 'runtime_policy';
|
|
105
|
+
hardBlocks: WorkflowGateHardCheck[];
|
|
106
|
+
warnings: WorkflowGateHardCheck[];
|
|
107
|
+
advisorSummary: WorkflowGateAdvisorSummary;
|
|
108
|
+
allowedNextActions: string[];
|
|
109
|
+
forbiddenNextActions: string[];
|
|
110
|
+
humanRequired: boolean;
|
|
111
|
+
reasons: string[];
|
|
112
|
+
evidenceRefs: string[];
|
|
113
|
+
payload: unknown;
|
|
114
|
+
}
|
|
@@ -40,6 +40,11 @@ export function affectedFileConflictsForSelectedRun(states: RunState[], selected
|
|
|
40
40
|
return conflicts.sort((left, right) => left.file.localeCompare(right.file) || left.partition.localeCompare(right.partition) || left.taskId.localeCompare(right.taskId) || left.runId.localeCompare(right.runId));
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
export function affectedFileConflictsForSelectedRuns(states: RunState[], selectedRuns: RunState[]): WorkflowAffectedFileConflict[] {
|
|
44
|
+
const conflicts = selectedRuns.flatMap((selected) => affectedFileConflictsForSelectedRun(states, selected));
|
|
45
|
+
return uniqueBy(conflicts, (conflict) => `${conflict.file}:${conflict.partition}:${conflict.taskId}:${conflict.runId}`);
|
|
46
|
+
}
|
|
47
|
+
|
|
43
48
|
function isAffectedFileConflictCandidate(candidate: RunState, selected: RunState): candidate is RunState & { partition: string; taskId: string } {
|
|
44
49
|
if (candidate.runId === selected.runId || candidate.status === 'archived' || !candidate.partition || !candidate.taskId) {
|
|
45
50
|
return false;
|
|
@@ -54,7 +59,7 @@ function isAffectedFileConflictCandidate(candidate: RunState, selected: RunState
|
|
|
54
59
|
}
|
|
55
60
|
|
|
56
61
|
function isActiveAffectedFileRun(state: RunState): boolean {
|
|
57
|
-
return state.status === 'created' || state.status === 'running'
|
|
62
|
+
return state.status === 'created' || state.status === 'running';
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
function selectedSupersedesCandidate(selected: RunState, candidate: RunState): boolean {
|
|
@@ -77,3 +82,15 @@ function isNonAuthoritativeForegroundRun(state: RunState): boolean {
|
|
|
77
82
|
const delegations = Object.values(state.delegations);
|
|
78
83
|
return delegations.length > 0 && delegations.every((delegation) => delegation.runMode === 'foreground' && !delegation.blocking && !delegation.requiredForPhaseExit);
|
|
79
84
|
}
|
|
85
|
+
|
|
86
|
+
function uniqueBy<T>(items: T[], keyOf: (item: T) => string): T[] {
|
|
87
|
+
const seen = new Set<string>();
|
|
88
|
+
return items.filter((item) => {
|
|
89
|
+
const key = keyOf(item);
|
|
90
|
+
if (seen.has(key)) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
seen.add(key);
|
|
94
|
+
return true;
|
|
95
|
+
});
|
|
96
|
+
}
|
|
@@ -16,7 +16,7 @@ test('dependency readiness blocks tasks until dependencies are completed', () =>
|
|
|
16
16
|
|
|
17
17
|
assert.equal(readiness.ready, false);
|
|
18
18
|
assert.deepEqual(readiness.dependencies.map((dependency) => `${dependency.taskId}:${dependency.status}:${dependency.ready}`), ['DEP1:pending:false']);
|
|
19
|
-
assert.match(readiness.blockingReasons[0], /DEP2 depends on DEP1, but DEP1
|
|
19
|
+
assert.match(readiness.blockingReasons[0], /DEP2 depends on DEP1, but DEP1 has not passed required verification/);
|
|
20
20
|
assert.deepEqual(workflowDependencyBlockers(model).map((blocker) => `${blocker.taskId}->${blocker.dependencyId}:${blocker.dependencyStatus}`), ['DEP2->DEP1:pending']);
|
|
21
21
|
});
|
|
22
22
|
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import type { RunStateTaskRuntime } from '../run-state/model.js';
|
|
1
2
|
import type { SddTask, SddTaskModel } from '../sdd-docs/task-parser.js';
|
|
2
3
|
type TaskDependencyModel = Pick<SddTaskModel, 'tasks'>;
|
|
3
4
|
|
|
5
|
+
export interface TaskDependencyReadinessOptions {
|
|
6
|
+
runtimeByTask?: Map<string, RunStateTaskRuntime>;
|
|
7
|
+
}
|
|
8
|
+
|
|
4
9
|
export interface TaskDependencyReadinessEntry {
|
|
5
10
|
taskId: string;
|
|
6
11
|
status: SddTask['status'] | 'missing';
|
|
@@ -22,13 +27,13 @@ export interface WorkflowDependencyBlocker {
|
|
|
22
27
|
reason: string;
|
|
23
28
|
}
|
|
24
29
|
|
|
25
|
-
export function resolveTaskDependencyReadiness(model: TaskDependencyModel, taskId: string): TaskDependencyReadiness {
|
|
30
|
+
export function resolveTaskDependencyReadiness(model: TaskDependencyModel, taskId: string, options: TaskDependencyReadinessOptions = {}): TaskDependencyReadiness {
|
|
26
31
|
const task = model.tasks.find((candidate) => candidate.id === taskId) ?? null;
|
|
27
32
|
if (!task) {
|
|
28
33
|
return { taskId, ready: false, dependencies: [], blockingReasons: [`Task ${taskId} was not found.`] };
|
|
29
34
|
}
|
|
30
35
|
|
|
31
|
-
const dependencies = task.dependsOn.map((dependencyId) => dependencyReadinessEntry(task.id, dependencyId, model.tasks.find((candidate) => candidate.id === dependencyId) ?? null));
|
|
36
|
+
const dependencies = task.dependsOn.map((dependencyId) => dependencyReadinessEntry(task.id, dependencyId, model.tasks.find((candidate) => candidate.id === dependencyId) ?? null, options.runtimeByTask?.get(dependencyId)));
|
|
32
37
|
const blockingReasons = dependencies.map((dependency) => dependency.reason).filter((reason): reason is string => Boolean(reason));
|
|
33
38
|
return {
|
|
34
39
|
taskId: task.id,
|
|
@@ -38,17 +43,17 @@ export function resolveTaskDependencyReadiness(model: TaskDependencyModel, taskI
|
|
|
38
43
|
};
|
|
39
44
|
}
|
|
40
45
|
|
|
41
|
-
export function dependencyBlockingReasonsForTask(model: TaskDependencyModel, taskId: string): string[] {
|
|
42
|
-
return resolveTaskDependencyReadiness(model, taskId).blockingReasons;
|
|
46
|
+
export function dependencyBlockingReasonsForTask(model: TaskDependencyModel, taskId: string, options: TaskDependencyReadinessOptions = {}): string[] {
|
|
47
|
+
return resolveTaskDependencyReadiness(model, taskId, options).blockingReasons;
|
|
43
48
|
}
|
|
44
49
|
|
|
45
|
-
export function workflowDependencyBlockers(model: TaskDependencyModel): WorkflowDependencyBlocker[] {
|
|
50
|
+
export function workflowDependencyBlockers(model: TaskDependencyModel, options: TaskDependencyReadinessOptions = {}): WorkflowDependencyBlocker[] {
|
|
46
51
|
const blockers: WorkflowDependencyBlocker[] = [];
|
|
47
52
|
for (const task of model.tasks) {
|
|
48
53
|
if (task.status === 'completed' || task.status === 'deferred') {
|
|
49
54
|
continue;
|
|
50
55
|
}
|
|
51
|
-
for (const dependency of resolveTaskDependencyReadiness(model, task.id).dependencies) {
|
|
56
|
+
for (const dependency of resolveTaskDependencyReadiness(model, task.id, options).dependencies) {
|
|
52
57
|
if (!dependency.ready && dependency.reason) {
|
|
53
58
|
blockers.push({
|
|
54
59
|
taskId: task.id,
|
|
@@ -62,11 +67,11 @@ export function workflowDependencyBlockers(model: TaskDependencyModel): Workflow
|
|
|
62
67
|
return blockers;
|
|
63
68
|
}
|
|
64
69
|
|
|
65
|
-
export function nextDependencyTaskId(model: TaskDependencyModel, taskId: string): string | null {
|
|
66
|
-
return resolveTaskDependencyReadiness(model, taskId).dependencies.find((dependency) => !dependency.ready)?.taskId ?? null;
|
|
70
|
+
export function nextDependencyTaskId(model: TaskDependencyModel, taskId: string, options: TaskDependencyReadinessOptions = {}): string | null {
|
|
71
|
+
return resolveTaskDependencyReadiness(model, taskId, options).dependencies.find((dependency) => !dependency.ready)?.taskId ?? null;
|
|
67
72
|
}
|
|
68
73
|
|
|
69
|
-
function dependencyReadinessEntry(taskId: string, dependencyId: string, dependency: SddTask | null): TaskDependencyReadinessEntry {
|
|
74
|
+
function dependencyReadinessEntry(taskId: string, dependencyId: string, dependency: SddTask | null, runtime: RunStateTaskRuntime | undefined): TaskDependencyReadinessEntry {
|
|
70
75
|
if (!dependency) {
|
|
71
76
|
return {
|
|
72
77
|
taskId: dependencyId,
|
|
@@ -75,7 +80,7 @@ function dependencyReadinessEntry(taskId: string, dependencyId: string, dependen
|
|
|
75
80
|
reason: `Task ${taskId} depends on ${dependencyId}, but ${dependencyId} was not found; restore or remove the dependency before continuing ${taskId}.`
|
|
76
81
|
};
|
|
77
82
|
}
|
|
78
|
-
if (dependency.status === 'completed') {
|
|
83
|
+
if (dependency.status === 'completed' || dependencyRuntimeSatisfiesImplementationBoundary(dependency, runtime)) {
|
|
79
84
|
return {
|
|
80
85
|
taskId: dependency.id,
|
|
81
86
|
status: dependency.status,
|
|
@@ -87,6 +92,23 @@ function dependencyReadinessEntry(taskId: string, dependencyId: string, dependen
|
|
|
87
92
|
taskId: dependency.id,
|
|
88
93
|
status: dependency.status,
|
|
89
94
|
ready: false,
|
|
90
|
-
reason:
|
|
95
|
+
reason: dependencyRequiresVerifiedBoundary(dependency)
|
|
96
|
+
? `Task ${taskId} depends on ${dependency.id}, but ${dependency.id} has not passed required verification; run sdd test task ${dependency.id} before continuing ${taskId}.`
|
|
97
|
+
: `Task ${taskId} depends on ${dependency.id}, but ${dependency.id} is not implemented; run sdd do task ${dependency.id} before continuing ${taskId}.`
|
|
91
98
|
};
|
|
92
99
|
}
|
|
100
|
+
|
|
101
|
+
function dependencyRuntimeSatisfiesImplementationBoundary(task: SddTask, runtime: RunStateTaskRuntime | undefined): boolean {
|
|
102
|
+
if (!runtimeTaskImplemented(runtime)) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
return !dependencyRequiresVerifiedBoundary(task) || runtime?.verificationStatus === 'pass' || runtime?.status === 'implemented_verified';
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function dependencyRequiresVerifiedBoundary(task: SddTask): boolean {
|
|
109
|
+
return task.requiresVerifyBeforeNext || task.validationTiming === 'task_end';
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function runtimeTaskImplemented(runtime: RunStateTaskRuntime | undefined): boolean {
|
|
113
|
+
return runtime?.implementationStatus === 'implemented' || runtime?.status === 'implemented_pending_validation' || runtime?.status === 'implemented_verified';
|
|
114
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import type { RunState } from '../run-state/model.js';
|
|
2
|
+
import type { SddTaskModel } from '../sdd-docs/task-parser.js';
|
|
3
|
+
|
|
4
|
+
export type DocumentCompatibilityClass = 'compatible' | 'soft_stale' | 'strict_stale' | 'incompatible';
|
|
5
|
+
|
|
6
|
+
export interface LatestEligibleRunCandidate {
|
|
7
|
+
partition: string;
|
|
8
|
+
gitBranch: string | null;
|
|
9
|
+
taskId: string;
|
|
10
|
+
runId: string;
|
|
11
|
+
runStatus: RunState['status'];
|
|
12
|
+
validationStatus: RunState['validation']['status'];
|
|
13
|
+
syncBackStatus: RunState['syncBack']['status'];
|
|
14
|
+
affectedFiles: string[];
|
|
15
|
+
updatedAt: string;
|
|
16
|
+
compatibility: DocumentCompatibilityClass;
|
|
17
|
+
eligibleForDefaultApply: boolean;
|
|
18
|
+
reasons: string[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface LatestEligibleRunSelection {
|
|
22
|
+
partition: string;
|
|
23
|
+
taskId: string;
|
|
24
|
+
selected: LatestEligibleRunCandidate | null;
|
|
25
|
+
candidates: LatestEligibleRunCandidate[];
|
|
26
|
+
rejected: LatestEligibleRunCandidate[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function selectLatestEligibleRun(input: { states: RunState[]; model: SddTaskModel; partition: string; taskId: string; currentGitBranch?: string | null }): LatestEligibleRunSelection {
|
|
30
|
+
const candidates = input.states
|
|
31
|
+
.filter((state) => state.partition === input.partition && state.taskId === input.taskId)
|
|
32
|
+
.map((state) => latestEligibleCandidate(state, input.model));
|
|
33
|
+
const visible = candidates.filter((candidate) => candidate.runStatus !== 'archived').sort(compareCandidates);
|
|
34
|
+
const eligible = visible.filter((candidate) => candidate.eligibleForDefaultApply);
|
|
35
|
+
return {
|
|
36
|
+
partition: input.partition,
|
|
37
|
+
taskId: input.taskId,
|
|
38
|
+
selected: eligible[0] ?? null,
|
|
39
|
+
candidates: visible,
|
|
40
|
+
rejected: candidates.filter((candidate) => !candidate.eligibleForDefaultApply).sort(compareCandidates)
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function selectLatestEligibleRunsByTask(input: { states: RunState[]; model: SddTaskModel; partition: string; currentGitBranch?: string | null }): LatestEligibleRunSelection[] {
|
|
45
|
+
const taskIds = Array.from(new Set([
|
|
46
|
+
...input.model.tasks.map((task) => task.id),
|
|
47
|
+
...input.states
|
|
48
|
+
.filter((state) => state.partition === input.partition && state.taskId)
|
|
49
|
+
.map((state) => state.taskId as string)
|
|
50
|
+
]))
|
|
51
|
+
.sort((left, right) => left.localeCompare(right));
|
|
52
|
+
return taskIds.map((taskId) => selectLatestEligibleRun({ ...input, taskId }));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function latestEligibleCandidate(state: RunState, model: SddTaskModel): LatestEligibleRunCandidate {
|
|
56
|
+
const compatibility = classifyDocumentCompatibility(state, model);
|
|
57
|
+
const reasons = candidateRejectionReasons(state, compatibility);
|
|
58
|
+
return {
|
|
59
|
+
partition: state.partition ?? model.branch,
|
|
60
|
+
gitBranch: state.gitBranch,
|
|
61
|
+
taskId: state.taskId ?? state.currentTask ?? '',
|
|
62
|
+
runId: state.runId,
|
|
63
|
+
runStatus: state.status,
|
|
64
|
+
validationStatus: state.validation.status,
|
|
65
|
+
syncBackStatus: state.syncBack.status,
|
|
66
|
+
affectedFiles: state.affectedFiles,
|
|
67
|
+
updatedAt: state.updatedAt,
|
|
68
|
+
compatibility,
|
|
69
|
+
eligibleForDefaultApply: reasons.length === 0,
|
|
70
|
+
reasons
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function classifyDocumentCompatibility(state: RunState, model: SddTaskModel): DocumentCompatibilityClass {
|
|
75
|
+
const snapshot = state.documentSnapshot;
|
|
76
|
+
const hasSnapshot = Boolean(snapshot.specHash || snapshot.planHash || snapshot.tasksHash || snapshot.specContractHash || snapshot.planContractHash || snapshot.tasksContractHash);
|
|
77
|
+
if (!hasSnapshot) {
|
|
78
|
+
return 'incompatible';
|
|
79
|
+
}
|
|
80
|
+
const specMismatch = snapshot.specContractHash !== null
|
|
81
|
+
? documentHashMismatch(snapshot.specContractHash, model.documents.specContractHash ?? null)
|
|
82
|
+
: documentHashMismatch(snapshot.specHash, model.documents.specHash ?? null);
|
|
83
|
+
const planMismatch = snapshot.planContractHash !== null
|
|
84
|
+
? documentHashMismatch(snapshot.planContractHash, model.documents.planContractHash ?? null)
|
|
85
|
+
: documentHashMismatch(snapshot.planHash, model.documents.planHash ?? null);
|
|
86
|
+
const tasksSemanticMismatch = snapshot.tasksContractHash !== null
|
|
87
|
+
? documentHashMismatch(snapshot.tasksContractHash, model.documents.tasksContractHash ?? null)
|
|
88
|
+
: false;
|
|
89
|
+
const tasksDocMismatch = documentHashMismatch(snapshot.tasksHash, model.documents.tasksHash ?? null);
|
|
90
|
+
if (specMismatch || planMismatch) {
|
|
91
|
+
return 'strict_stale';
|
|
92
|
+
}
|
|
93
|
+
if (model.documents.planStale || model.documents.tasksStale) {
|
|
94
|
+
return 'strict_stale';
|
|
95
|
+
}
|
|
96
|
+
if (tasksSemanticMismatch) {
|
|
97
|
+
return 'strict_stale';
|
|
98
|
+
}
|
|
99
|
+
if (tasksDocMismatch) {
|
|
100
|
+
return 'soft_stale';
|
|
101
|
+
}
|
|
102
|
+
return 'compatible';
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function candidateRejectionReasons(state: RunState, compatibility: DocumentCompatibilityClass): string[] {
|
|
106
|
+
const reasons: string[] = [];
|
|
107
|
+
if (state.status === 'archived') {
|
|
108
|
+
reasons.push('Run is archived.');
|
|
109
|
+
}
|
|
110
|
+
if (state.status === 'failed') {
|
|
111
|
+
reasons.push('Run failed.');
|
|
112
|
+
}
|
|
113
|
+
if (state.status === 'blocked') {
|
|
114
|
+
reasons.push('Run is blocked.');
|
|
115
|
+
}
|
|
116
|
+
if (state.validation.status === 'fail' || state.validation.status === 'blocked') {
|
|
117
|
+
reasons.push(`Run validation status is ${state.validation.status}.`);
|
|
118
|
+
}
|
|
119
|
+
if (compatibility === 'strict_stale') {
|
|
120
|
+
reasons.push('Run document compatibility is strict_stale.');
|
|
121
|
+
}
|
|
122
|
+
if (compatibility === 'incompatible') {
|
|
123
|
+
reasons.push('Run document compatibility is incompatible.');
|
|
124
|
+
}
|
|
125
|
+
return reasons;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function documentHashMismatch(expected: string | null, actual: string | null): boolean {
|
|
129
|
+
if (!expected && !actual) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
return expected !== actual;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function compareCandidates(left: LatestEligibleRunCandidate, right: LatestEligibleRunCandidate): number {
|
|
136
|
+
const leftRank = compatibilityRank(left.compatibility);
|
|
137
|
+
const rightRank = compatibilityRank(right.compatibility);
|
|
138
|
+
if (leftRank !== rightRank) {
|
|
139
|
+
return leftRank - rightRank;
|
|
140
|
+
}
|
|
141
|
+
const updatedAt = Date.parse(right.updatedAt) - Date.parse(left.updatedAt);
|
|
142
|
+
return updatedAt !== 0 ? updatedAt : right.runId.localeCompare(left.runId);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function compatibilityRank(compatibility: DocumentCompatibilityClass): number {
|
|
146
|
+
switch (compatibility) {
|
|
147
|
+
case 'compatible':
|
|
148
|
+
return 0;
|
|
149
|
+
case 'soft_stale':
|
|
150
|
+
return 1;
|
|
151
|
+
case 'strict_stale':
|
|
152
|
+
return 2;
|
|
153
|
+
case 'incompatible':
|
|
154
|
+
return 3;
|
|
155
|
+
}
|
|
156
|
+
}
|