sdd-agent-platform 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -39
- package/node_modules/@sdd-agent-platform/core/dist/ai-tools.js +72 -71
- package/node_modules/@sdd-agent-platform/core/dist/ai-tools.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/ingestion.js +64 -9
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/ingestion.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-evidence.js +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-evidence.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-result.js +26 -17
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-result.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/init-project.d.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/dist/config/init-project.js +13 -9
- package/node_modules/@sdd-agent-platform/core/dist/config/init-project.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/project-config.d.ts +3 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/project-config.js +7 -3
- package/node_modules/@sdd-agent-platform/core/dist/config/project-config.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.d.ts +4 -4
- package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.js +16 -20
- package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context/build-package.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context/build-package.js +1 -7
- package/node_modules/@sdd-agent-platform/core/dist/context/build-package.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context/evidence-summary.js +26 -8
- package/node_modules/@sdd-agent-platform/core/dist/context/evidence-summary.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context/log-worker.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/context/log-worker.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context-offload/contracts.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/contracts.d.ts +4 -1
- package/node_modules/@sdd-agent-platform/core/dist/contracts.js +3 -0
- package/node_modules/@sdd-agent-platform/core/dist/contracts.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/delegation/model.d.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/dist/delegation/validation.d.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/dist/delegation/validation.js +7 -4
- package/node_modules/@sdd-agent-platform/core/dist/delegation/validation.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/document-chain.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/document-chain.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/project.js +8 -8
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/project.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/registries.js +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/registries.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-evidence.js +7 -7
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-evidence.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-trust.js +0 -24
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-trust.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/runtime-contracts.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/runtime-contracts.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/doctor.js +277 -3
- 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 +61 -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 -1
- 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/background-executor.js +4 -4
- package/node_modules/@sdd-agent-platform/core/dist/execution/background-executor.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/foreground-subagents.js +3 -3
- package/node_modules/@sdd-agent-platform/core/dist/execution/foreground-subagents.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/host-invocation.js +5 -4
- package/node_modules/@sdd-agent-platform/core/dist/execution/host-invocation.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/resident-worker.js +16 -7
- 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/governance/policy.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/governance/policy.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/governance/policy.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/instructions.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/instructions.js +59 -66
- package/node_modules/@sdd-agent-platform/core/dist/instructions.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/decision-gate.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/decision-gate.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.d.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.js +55 -19
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/orchestration/contracts.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.d.ts +12 -2
- package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.js +62 -21
- package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.d.ts +20 -2
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.js +218 -18
- 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 +17 -17
- 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 +32 -2
- 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/command-team-runtime.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.js +9 -9
- package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/eval-learning-context.js +4 -4
- package/node_modules/@sdd-agent-platform/core/dist/registries/eval-learning-context.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/query-status.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/registries/query-status.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/tool-capabilities.js +3 -3
- package/node_modules/@sdd-agent-platform/core/dist/registries/tool-capabilities.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/tool-plugins.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/registries/tool-plugins.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/worker-adapters.js +11 -11
- package/node_modules/@sdd-agent-platform/core/dist/registries/worker-adapters.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/workflow-gates.js +12 -12
- package/node_modules/@sdd-agent-platform/core/dist/registries/workflow-gates.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/risk/contracts.d.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/risk/kernel.js +4 -4
- package/node_modules/@sdd-agent-platform/core/dist/risk/kernel.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/risk/legacy-adapters.js +4 -7
- package/node_modules/@sdd-agent-platform/core/dist/risk/legacy-adapters.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/risk/workflow-gates.d.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/risk/workflow-gates.js +19 -17
- package/node_modules/@sdd-agent-platform/core/dist/risk/workflow-gates.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime-config.js +28 -13
- 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 +61 -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 +192 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/routing.js +73 -17
- package/node_modules/@sdd-agent-platform/core/dist/router/routing.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-import.d.ts +28 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-import.js +373 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-import.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-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/router/stage-route-binding.d.ts +37 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/stage-route-binding.js +235 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/stage-route-binding.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/router.d.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/router.js +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/router.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/artifacts.d.ts +16 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/artifacts.js +168 -18
- 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 -3
- package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.js +22 -54
- 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 +53 -9
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-index.d.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-index.js +1 -3
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-index.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-state.js +51 -34
- 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 +65 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.js +169 -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/timing.d.ts +8 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/timing.js +131 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/timing.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state.d.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state.js +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/build.js +0 -3
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/build.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/findings.js +5 -44
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/findings.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/model.d.ts +1 -17
- package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.d.ts +20 -0
- package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.js +109 -14
- package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/runtime-projection-p0.d.ts +64 -0
- package/node_modules/@sdd-agent-platform/core/dist/runtime-projection-p0.js +200 -0
- package/node_modules/@sdd-agent-platform/core/dist/runtime-projection-p0.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/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 +6 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.js +276 -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.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/run-binding.js +15 -4
- 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 +21 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.js +139 -38
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/stage-artifacts.d.ts +55 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-artifacts.js +322 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-artifacts.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration-contracts.d.ts +55 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration-contracts.js +241 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration-contracts.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration.d.ts +888 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration.js +3870 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-runtime/runtime.js +8 -1
- package/node_modules/@sdd-agent-platform/core/dist/stage-runtime/runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/status/project-status.d.ts +105 -1
- package/node_modules/@sdd-agent-platform/core/dist/status/project-status.js +343 -8
- 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 +348 -3
- package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.js +1017 -8
- package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/subagents/contracts.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/subagents/runtime.js +7 -7
- package/node_modules/@sdd-agent-platform/core/dist/subagents/runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/test-support/fixtures.js +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.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.js +19 -20
- package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/truth-reconciliation.d.ts +44 -0
- package/node_modules/@sdd-agent-platform/core/dist/truth-reconciliation.js +138 -0
- package/node_modules/@sdd-agent-platform/core/dist/truth-reconciliation.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.d.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.js +44 -37
- package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.d.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.js +19 -49
- 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.d.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.js +213 -111
- 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 +28 -3
- package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.js +546 -125
- package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-cache.d.ts +26 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-cache.js +73 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-cache.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.d.ts +76 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.js +450 -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 +3 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.js +105 -30
- 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/work-units/contracts.d.ts +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 +395 -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 +164 -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 +182 -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 +88 -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 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.js +17 -3
- 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 +37 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.js +188 -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/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 +80 -3
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.js +674 -41
- 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/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 +3 -3
- package/node_modules/@sdd-agent-platform/core/src/ai-tools.test.ts +49 -1
- package/node_modules/@sdd-agent-platform/core/src/ai-tools.ts +72 -71
- package/node_modules/@sdd-agent-platform/core/src/artifacts/ingestion.test.ts +38 -0
- package/node_modules/@sdd-agent-platform/core/src/artifacts/ingestion.ts +65 -9
- package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-evidence.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-result.test.ts +52 -6
- package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-result.ts +26 -17
- package/node_modules/@sdd-agent-platform/core/src/config/init-project.test.ts +44 -29
- package/node_modules/@sdd-agent-platform/core/src/config/init-project.ts +15 -11
- package/node_modules/@sdd-agent-platform/core/src/config/project-config.ts +10 -4
- package/node_modules/@sdd-agent-platform/core/src/config/starter-documents.ts +17 -20
- package/node_modules/@sdd-agent-platform/core/src/context/build-package.ts +2 -8
- package/node_modules/@sdd-agent-platform/core/src/context/context-build.test.ts +3 -2
- package/node_modules/@sdd-agent-platform/core/src/context/evidence-summary.ts +27 -8
- package/node_modules/@sdd-agent-platform/core/src/context/log-worker.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/context-offload/contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/contracts.ts +4 -1
- package/node_modules/@sdd-agent-platform/core/src/delegation/model.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/src/delegation/validation.ts +8 -5
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/document-chain.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/project.ts +8 -8
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/registries.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/run-evidence.ts +7 -7
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/run-trust.ts +0 -21
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/runtime-contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/doctor/doctor.test.ts +217 -7
- package/node_modules/@sdd-agent-platform/core/src/doctor/doctor.ts +301 -3
- package/node_modules/@sdd-agent-platform/core/src/evidence/lookup.ts +88 -0
- package/node_modules/@sdd-agent-platform/core/src/evidence-runtime/contracts.ts +12 -1
- 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 +57 -2
- package/node_modules/@sdd-agent-platform/core/src/execution/background-executor.ts +4 -4
- package/node_modules/@sdd-agent-platform/core/src/execution/foreground-subagents.test.ts +11 -2
- package/node_modules/@sdd-agent-platform/core/src/execution/foreground-subagents.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/src/execution/host-invocation.ts +5 -4
- package/node_modules/@sdd-agent-platform/core/src/execution/resident-worker.test.ts +17 -1
- package/node_modules/@sdd-agent-platform/core/src/execution/resident-worker.ts +16 -7
- 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 +14 -0
- package/node_modules/@sdd-agent-platform/core/src/governance/policy.test.ts +10 -0
- package/node_modules/@sdd-agent-platform/core/src/governance/policy.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/instructions.test.ts +34 -13
- package/node_modules/@sdd-agent-platform/core/src/instructions.ts +60 -67
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/decision-gate.test.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/decision-gate.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/ship.test.ts +47 -0
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/ship.ts +58 -19
- package/node_modules/@sdd-agent-platform/core/src/orchestration/contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/orchestration/runtime.ts +74 -22
- package/node_modules/@sdd-agent-platform/core/src/phase8-contracts.test.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/src/phase8-risk-kernel.test.ts +8 -3
- 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 +319 -20
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-registry.ts +17 -17
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-runtime-static.ts +42 -2
- package/node_modules/@sdd-agent-platform/core/src/registries/capability-sources.ts +238 -15
- package/node_modules/@sdd-agent-platform/core/src/registries/command-team-runtime.ts +10 -10
- package/node_modules/@sdd-agent-platform/core/src/registries/eval-learning-context.ts +4 -4
- package/node_modules/@sdd-agent-platform/core/src/registries/query-status.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/registries/registries.test.ts +45 -4
- package/node_modules/@sdd-agent-platform/core/src/registries/tool-capabilities.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/src/registries/tool-plugins.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/registries/worker-adapters.ts +11 -11
- package/node_modules/@sdd-agent-platform/core/src/registries/workflow-gates.ts +12 -12
- package/node_modules/@sdd-agent-platform/core/src/risk/contracts.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/risk/kernel.ts +4 -4
- package/node_modules/@sdd-agent-platform/core/src/risk/legacy-adapters.ts +4 -7
- package/node_modules/@sdd-agent-platform/core/src/risk/workflow-gates.ts +20 -18
- package/node_modules/@sdd-agent-platform/core/src/router/agent-runtime-config.ts +32 -13
- package/node_modules/@sdd-agent-platform/core/src/router/agent-runtime.ts +68 -1
- package/node_modules/@sdd-agent-platform/core/src/router/route-projection.ts +212 -1
- package/node_modules/@sdd-agent-platform/core/src/router/route-sdd-task.test.ts +391 -6
- package/node_modules/@sdd-agent-platform/core/src/router/routing.ts +78 -17
- package/node_modules/@sdd-agent-platform/core/src/router/runtime-import.ts +453 -0
- 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/router/stage-route-binding.ts +279 -0
- package/node_modules/@sdd-agent-platform/core/src/router.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/run-state/artifacts.ts +173 -18
- 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 +24 -59
- 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 +59 -9
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-index.ts +1 -5
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-state.test.ts +53 -2
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-state.ts +55 -41
- package/node_modules/@sdd-agent-platform/core/src/run-state/task-evidence.ts +252 -0
- 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 +2 -0
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/build.ts +0 -3
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/findings.ts +6 -46
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/model.ts +1 -13
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis.test.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/src/runtime-paths.ts +131 -14
- package/node_modules/@sdd-agent-platform/core/src/runtime-projection-p0.test.ts +96 -0
- package/node_modules/@sdd-agent-platform/core/src/runtime-projection-p0.ts +292 -0
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/context.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/document-hashes.ts +306 -0
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/run-binding.ts +15 -4
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.test.ts +261 -0
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.ts +169 -41
- package/node_modules/@sdd-agent-platform/core/src/stage-artifacts.ts +450 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-collaboration-contracts.ts +322 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-collaboration.test.ts +2903 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-collaboration.ts +5831 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-runtime/runtime.test.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/stage-runtime/runtime.ts +9 -1
- package/node_modules/@sdd-agent-platform/core/src/status/project-status.test.ts +239 -16
- package/node_modules/@sdd-agent-platform/core/src/status/project-status.ts +497 -8
- package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.test.ts +560 -4
- package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.ts +1510 -9
- package/node_modules/@sdd-agent-platform/core/src/subagents/contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/subagents/runtime.test.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/src/subagents/runtime.ts +7 -7
- package/node_modules/@sdd-agent-platform/core/src/test-support/fixtures.ts +21 -0
- package/node_modules/@sdd-agent-platform/core/src/test-support/run-state.ts +20 -20
- package/node_modules/@sdd-agent-platform/core/src/truth-reconciliation.test.ts +72 -0
- package/node_modules/@sdd-agent-platform/core/src/truth-reconciliation.ts +177 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/goal-verify.test.ts +13 -87
- package/node_modules/@sdd-agent-platform/core/src/verification/goal-verify.ts +46 -42
- package/node_modules/@sdd-agent-platform/core/src/verification/rendering.ts +18 -52
- package/node_modules/@sdd-agent-platform/core/src/verification/review-gate.test.ts +84 -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 +138 -64
- package/node_modules/@sdd-agent-platform/core/src/verification/single-task-loop.ts +226 -116
- package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.test.ts +148 -48
- package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.ts +619 -136
- package/node_modules/@sdd-agent-platform/core/src/verification/validation-cache.ts +106 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/validation-wave.test.ts +383 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/validation-wave.ts +556 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.test.ts +131 -8
- package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.ts +117 -30
- package/node_modules/@sdd-agent-platform/core/src/verification.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/work-units/contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/evidence-packet.ts +425 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.test.ts +507 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.ts +182 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.test.ts +174 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.ts +194 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/types.ts +115 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/affected-file-conflicts.ts +19 -4
- 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 +224 -0
- 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 +851 -9
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve.ts +862 -45
- 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 +1 -0
- package/package.json +1 -1
- package/packages/cli/dist/args.js +2 -2
- package/packages/cli/dist/args.js.map +1 -1
- package/packages/cli/dist/commands/ai-tools.js +13 -2
- package/packages/cli/dist/commands/ai-tools.js.map +1 -1
- package/packages/cli/dist/commands/context.js +1 -1
- package/packages/cli/dist/commands/context.js.map +1 -1
- package/packages/cli/dist/commands/execution.js +49 -1
- package/packages/cli/dist/commands/execution.js.map +1 -1
- package/packages/cli/dist/commands/governance.js +1 -1
- package/packages/cli/dist/commands/governance.js.map +1 -1
- package/packages/cli/dist/commands/init.js +6 -1
- package/packages/cli/dist/commands/init.js.map +1 -1
- package/packages/cli/dist/commands/lifecycle.js +15 -2
- package/packages/cli/dist/commands/lifecycle.js.map +1 -1
- package/packages/cli/dist/commands/registry/runtime.js +48 -2
- package/packages/cli/dist/commands/registry/runtime.js.map +1 -1
- package/packages/cli/dist/commands/run.js +52 -2
- package/packages/cli/dist/commands/run.js.map +1 -1
- package/packages/cli/dist/commands/stage-close.d.ts +6 -0
- package/packages/cli/dist/commands/stage-close.js +295 -0
- package/packages/cli/dist/commands/stage-close.js.map +1 -0
- package/packages/cli/dist/commands/status.js +70 -4
- package/packages/cli/dist/commands/status.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 +272 -5
- package/packages/cli/dist/commands/test.js.map +1 -1
- package/packages/cli/dist/commands/verifies.js +9 -5
- package/packages/cli/dist/commands/verifies.js.map +1 -1
- package/packages/cli/dist/commands/verify.js +257 -20
- package/packages/cli/dist/commands/verify.js.map +1 -1
- package/packages/cli/dist/dispatch.js +4 -9
- package/packages/cli/dist/dispatch.js.map +1 -1
- package/packages/cli/dist/help.js +42 -27
- package/packages/cli/dist/help.js.map +1 -1
- package/packages/cli/dist/renderers/doctor.js +1 -1
- package/packages/cli/dist/renderers/doctor.js.map +1 -1
- package/packages/cli/dist/renderers/execution.js +1 -1
- package/packages/cli/dist/renderers/execution.js.map +1 -1
- package/packages/cli/dist/renderers/json.d.ts +1 -0
- package/packages/cli/dist/renderers/json.js +3 -0
- package/packages/cli/dist/renderers/json.js.map +1 -1
- package/packages/cli/dist/renderers/registry-runtime.d.ts +2 -1
- package/packages/cli/dist/renderers/registry-runtime.js +27 -2
- package/packages/cli/dist/renderers/registry-runtime.js.map +1 -1
- package/packages/cli/dist/renderers/router.js +5 -3
- package/packages/cli/dist/renderers/router.js.map +1 -1
- package/packages/cli/dist/renderers/workflow.d.ts +0 -4
- package/packages/cli/dist/renderers/workflow.js +46 -84
- 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 +72 -71
- package/packages/core/dist/ai-tools.js.map +1 -1
- package/packages/core/dist/artifacts/ingestion.js +64 -9
- package/packages/core/dist/artifacts/ingestion.js.map +1 -1
- package/packages/core/dist/artifacts/sdd-evidence.js +0 -1
- package/packages/core/dist/artifacts/sdd-evidence.js.map +1 -1
- package/packages/core/dist/artifacts/sdd-result.js +26 -17
- package/packages/core/dist/artifacts/sdd-result.js.map +1 -1
- package/packages/core/dist/config/init-project.d.ts +3 -0
- package/packages/core/dist/config/init-project.js +13 -9
- package/packages/core/dist/config/init-project.js.map +1 -1
- package/packages/core/dist/config/project-config.d.ts +3 -1
- package/packages/core/dist/config/project-config.js +7 -3
- package/packages/core/dist/config/project-config.js.map +1 -1
- package/packages/core/dist/config/starter-documents.d.ts +4 -4
- package/packages/core/dist/config/starter-documents.js +16 -20
- package/packages/core/dist/config/starter-documents.js.map +1 -1
- package/packages/core/dist/context/build-package.d.ts +1 -1
- package/packages/core/dist/context/build-package.js +1 -7
- package/packages/core/dist/context/build-package.js.map +1 -1
- package/packages/core/dist/context/evidence-summary.js +26 -8
- package/packages/core/dist/context/evidence-summary.js.map +1 -1
- package/packages/core/dist/context/log-worker.js +2 -2
- package/packages/core/dist/context/log-worker.js.map +1 -1
- package/packages/core/dist/context-offload/contracts.d.ts +1 -1
- package/packages/core/dist/contracts.d.ts +4 -1
- package/packages/core/dist/contracts.js +3 -0
- package/packages/core/dist/contracts.js.map +1 -1
- package/packages/core/dist/delegation/model.d.ts +3 -0
- package/packages/core/dist/delegation/validation.d.ts +3 -0
- package/packages/core/dist/delegation/validation.js +7 -4
- package/packages/core/dist/delegation/validation.js.map +1 -1
- package/packages/core/dist/doctor/checks/document-chain.js +1 -1
- package/packages/core/dist/doctor/checks/document-chain.js.map +1 -1
- package/packages/core/dist/doctor/checks/project.js +8 -8
- package/packages/core/dist/doctor/checks/project.js.map +1 -1
- package/packages/core/dist/doctor/checks/registries.js +0 -1
- package/packages/core/dist/doctor/checks/registries.js.map +1 -1
- package/packages/core/dist/doctor/checks/run-evidence.js +7 -7
- package/packages/core/dist/doctor/checks/run-evidence.js.map +1 -1
- package/packages/core/dist/doctor/checks/run-trust.js +0 -24
- package/packages/core/dist/doctor/checks/run-trust.js.map +1 -1
- package/packages/core/dist/doctor/checks/runtime-contracts.js +1 -1
- package/packages/core/dist/doctor/checks/runtime-contracts.js.map +1 -1
- package/packages/core/dist/doctor/doctor.js +277 -3
- 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 +61 -0
- package/packages/core/dist/evidence/lookup.js.map +1 -0
- package/packages/core/dist/evidence-runtime/contracts.d.ts +11 -1
- 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/background-executor.js +4 -4
- package/packages/core/dist/execution/background-executor.js.map +1 -1
- package/packages/core/dist/execution/foreground-subagents.js +3 -3
- package/packages/core/dist/execution/foreground-subagents.js.map +1 -1
- package/packages/core/dist/execution/host-invocation.js +5 -4
- package/packages/core/dist/execution/host-invocation.js.map +1 -1
- package/packages/core/dist/execution/resident-worker.js +16 -7
- 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/governance/policy.d.ts +1 -1
- package/packages/core/dist/governance/policy.js +1 -1
- package/packages/core/dist/governance/policy.js.map +1 -1
- package/packages/core/dist/instructions.d.ts +1 -1
- package/packages/core/dist/instructions.js +59 -66
- package/packages/core/dist/instructions.js.map +1 -1
- package/packages/core/dist/lifecycle/decision-gate.js +1 -1
- package/packages/core/dist/lifecycle/decision-gate.js.map +1 -1
- package/packages/core/dist/lifecycle/ship.d.ts +3 -0
- package/packages/core/dist/lifecycle/ship.js +55 -19
- package/packages/core/dist/lifecycle/ship.js.map +1 -1
- package/packages/core/dist/orchestration/contracts.d.ts +1 -1
- package/packages/core/dist/orchestration/runtime.d.ts +12 -2
- package/packages/core/dist/orchestration/runtime.js +62 -21
- package/packages/core/dist/orchestration/runtime.js.map +1 -1
- package/packages/core/dist/registries/agent-capability-catalog.d.ts +20 -2
- package/packages/core/dist/registries/agent-capability-catalog.js +218 -18
- package/packages/core/dist/registries/agent-capability-catalog.js.map +1 -1
- package/packages/core/dist/registries/agent-registry.js +17 -17
- 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 +32 -2
- 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/command-team-runtime.d.ts +1 -1
- package/packages/core/dist/registries/command-team-runtime.js +9 -9
- package/packages/core/dist/registries/command-team-runtime.js.map +1 -1
- package/packages/core/dist/registries/eval-learning-context.js +4 -4
- package/packages/core/dist/registries/eval-learning-context.js.map +1 -1
- package/packages/core/dist/registries/query-status.js +2 -2
- package/packages/core/dist/registries/query-status.js.map +1 -1
- package/packages/core/dist/registries/tool-capabilities.js +3 -3
- package/packages/core/dist/registries/tool-capabilities.js.map +1 -1
- package/packages/core/dist/registries/tool-plugins.js +2 -2
- package/packages/core/dist/registries/tool-plugins.js.map +1 -1
- package/packages/core/dist/registries/worker-adapters.js +11 -11
- package/packages/core/dist/registries/worker-adapters.js.map +1 -1
- package/packages/core/dist/registries/workflow-gates.js +12 -12
- package/packages/core/dist/registries/workflow-gates.js.map +1 -1
- package/packages/core/dist/risk/contracts.d.ts +2 -2
- package/packages/core/dist/risk/kernel.js +4 -4
- package/packages/core/dist/risk/kernel.js.map +1 -1
- package/packages/core/dist/risk/legacy-adapters.js +4 -7
- package/packages/core/dist/risk/legacy-adapters.js.map +1 -1
- package/packages/core/dist/risk/workflow-gates.d.ts +2 -2
- package/packages/core/dist/risk/workflow-gates.js +19 -17
- package/packages/core/dist/risk/workflow-gates.js.map +1 -1
- package/packages/core/dist/router/agent-runtime-config.js +28 -13
- package/packages/core/dist/router/agent-runtime-config.js.map +1 -1
- package/packages/core/dist/router/agent-runtime.d.ts +61 -1
- package/packages/core/dist/router/route-projection.d.ts +3 -1
- package/packages/core/dist/router/route-projection.js +192 -1
- package/packages/core/dist/router/route-projection.js.map +1 -1
- package/packages/core/dist/router/routing.js +73 -17
- package/packages/core/dist/router/routing.js.map +1 -1
- package/packages/core/dist/router/runtime-import.d.ts +28 -0
- package/packages/core/dist/router/runtime-import.js +373 -0
- package/packages/core/dist/router/runtime-import.js.map +1 -0
- package/packages/core/dist/router/runtime-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/router/stage-route-binding.d.ts +37 -0
- package/packages/core/dist/router/stage-route-binding.js +235 -0
- package/packages/core/dist/router/stage-route-binding.js.map +1 -0
- package/packages/core/dist/router.d.ts +2 -0
- package/packages/core/dist/router.js +2 -0
- package/packages/core/dist/router.js.map +1 -1
- package/packages/core/dist/run-state/artifacts.d.ts +16 -0
- package/packages/core/dist/run-state/artifacts.js +168 -18
- 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 -3
- package/packages/core/dist/run-state/inspect-run.js +22 -54
- 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 +53 -9
- package/packages/core/dist/run-state/run-index.d.ts +0 -2
- package/packages/core/dist/run-state/run-index.js +1 -3
- package/packages/core/dist/run-state/run-index.js.map +1 -1
- package/packages/core/dist/run-state/run-state.js +51 -34
- package/packages/core/dist/run-state/run-state.js.map +1 -1
- package/packages/core/dist/run-state/task-evidence.d.ts +65 -0
- package/packages/core/dist/run-state/task-evidence.js +169 -0
- package/packages/core/dist/run-state/task-evidence.js.map +1 -0
- package/packages/core/dist/run-state/timing.d.ts +8 -0
- package/packages/core/dist/run-state/timing.js +131 -0
- package/packages/core/dist/run-state/timing.js.map +1 -0
- package/packages/core/dist/run-state.d.ts +2 -0
- package/packages/core/dist/run-state.js +2 -0
- package/packages/core/dist/run-state.js.map +1 -1
- package/packages/core/dist/runtime-analysis/build.js +0 -3
- package/packages/core/dist/runtime-analysis/build.js.map +1 -1
- package/packages/core/dist/runtime-analysis/findings.js +5 -44
- package/packages/core/dist/runtime-analysis/findings.js.map +1 -1
- package/packages/core/dist/runtime-analysis/model.d.ts +1 -17
- package/packages/core/dist/runtime-paths.d.ts +20 -0
- package/packages/core/dist/runtime-paths.js +109 -14
- package/packages/core/dist/runtime-paths.js.map +1 -1
- package/packages/core/dist/runtime-projection-p0.d.ts +64 -0
- package/packages/core/dist/runtime-projection-p0.js +200 -0
- package/packages/core/dist/runtime-projection-p0.js.map +1 -0
- package/packages/core/dist/sdd-docs/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 +6 -0
- package/packages/core/dist/sdd-docs/document-hashes.js +276 -0
- package/packages/core/dist/sdd-docs/document-hashes.js.map +1 -0
- package/packages/core/dist/sdd-docs/run-binding.d.ts +1 -1
- package/packages/core/dist/sdd-docs/run-binding.js +15 -4
- package/packages/core/dist/sdd-docs/run-binding.js.map +1 -1
- package/packages/core/dist/sdd-docs/task-parser.d.ts +21 -0
- package/packages/core/dist/sdd-docs/task-parser.js +139 -38
- package/packages/core/dist/sdd-docs/task-parser.js.map +1 -1
- package/packages/core/dist/stage-artifacts.d.ts +55 -0
- package/packages/core/dist/stage-artifacts.js +322 -0
- package/packages/core/dist/stage-artifacts.js.map +1 -0
- package/packages/core/dist/stage-collaboration-contracts.d.ts +55 -0
- package/packages/core/dist/stage-collaboration-contracts.js +241 -0
- package/packages/core/dist/stage-collaboration-contracts.js.map +1 -0
- package/packages/core/dist/stage-collaboration.d.ts +888 -0
- package/packages/core/dist/stage-collaboration.js +3870 -0
- package/packages/core/dist/stage-collaboration.js.map +1 -0
- package/packages/core/dist/stage-runtime/runtime.js +8 -1
- package/packages/core/dist/stage-runtime/runtime.js.map +1 -1
- package/packages/core/dist/status/project-status.d.ts +105 -1
- package/packages/core/dist/status/project-status.js +343 -8
- package/packages/core/dist/status/project-status.js.map +1 -1
- package/packages/core/dist/storage/runtime-store.d.ts +348 -3
- package/packages/core/dist/storage/runtime-store.js +1017 -8
- package/packages/core/dist/storage/runtime-store.js.map +1 -1
- package/packages/core/dist/subagents/contracts.d.ts +1 -1
- package/packages/core/dist/subagents/runtime.js +7 -7
- package/packages/core/dist/subagents/runtime.js.map +1 -1
- package/packages/core/dist/test-support/fixtures.js +21 -0
- package/packages/core/dist/test-support/fixtures.js.map +1 -1
- package/packages/core/dist/test-support/run-state.d.ts +1 -1
- package/packages/core/dist/test-support/run-state.js +19 -20
- package/packages/core/dist/test-support/run-state.js.map +1 -1
- package/packages/core/dist/truth-reconciliation.d.ts +44 -0
- package/packages/core/dist/truth-reconciliation.js +138 -0
- package/packages/core/dist/truth-reconciliation.js.map +1 -0
- package/packages/core/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/core/dist/verification/goal-verify.d.ts +0 -1
- package/packages/core/dist/verification/goal-verify.js +44 -37
- package/packages/core/dist/verification/goal-verify.js.map +1 -1
- package/packages/core/dist/verification/rendering.d.ts +0 -2
- package/packages/core/dist/verification/rendering.js +19 -49
- 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.d.ts +0 -1
- package/packages/core/dist/verification/single-task-loop.js +213 -111
- package/packages/core/dist/verification/single-task-loop.js.map +1 -1
- package/packages/core/dist/verification/test-runtime.d.ts +28 -3
- package/packages/core/dist/verification/test-runtime.js +546 -125
- package/packages/core/dist/verification/test-runtime.js.map +1 -1
- package/packages/core/dist/verification/validation-cache.d.ts +26 -0
- package/packages/core/dist/verification/validation-cache.js +73 -0
- package/packages/core/dist/verification/validation-cache.js.map +1 -0
- package/packages/core/dist/verification/validation-wave.d.ts +76 -0
- package/packages/core/dist/verification/validation-wave.js +450 -0
- package/packages/core/dist/verification/validation-wave.js.map +1 -0
- package/packages/core/dist/verification/verify-contract.d.ts +3 -1
- package/packages/core/dist/verification/verify-contract.js +105 -30
- 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/work-units/contracts.d.ts +1 -1
- package/packages/core/dist/workflow-gate/evidence-packet.d.ts +24 -0
- package/packages/core/dist/workflow-gate/evidence-packet.js +395 -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 +164 -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 +182 -0
- package/packages/core/dist/workflow-gate/policy.js.map +1 -0
- package/packages/core/dist/workflow-gate/types.d.ts +88 -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 -1
- package/packages/core/dist/workflow-state/affected-file-conflicts.js +17 -3
- 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 +37 -0
- package/packages/core/dist/workflow-state/latest-eligible-run.js +188 -0
- package/packages/core/dist/workflow-state/latest-eligible-run.js.map +1 -0
- 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 +80 -3
- package/packages/core/dist/workflow-state/resolve.js +674 -41
- 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/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 +3 -3
- package/node_modules/@sdd-agent-platform/core/dist/doctor/render.d.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/dist/doctor/render.js +0 -44
- package/node_modules/@sdd-agent-platform/core/dist/doctor/render.js.map +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.d.ts +0 -17
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.js +0 -221
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.js.map +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.d.ts +0 -91
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.js +0 -395
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.js.map +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/sync-back.d.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/dist/sync-back.js +0 -3
- package/node_modules/@sdd-agent-platform/core/dist/sync-back.js.map +0 -1
- package/node_modules/@sdd-agent-platform/core/src/sync-back/apply.ts +0 -248
- package/node_modules/@sdd-agent-platform/core/src/sync-back/inspect.ts +0 -522
- package/node_modules/@sdd-agent-platform/core/src/sync-back/sync-back.test.ts +0 -446
- package/node_modules/@sdd-agent-platform/core/src/sync-back.ts +0 -2
- package/packages/cli/dist/commands/artifact.d.ts +0 -6
- package/packages/cli/dist/commands/artifact.js +0 -168
- package/packages/cli/dist/commands/artifact.js.map +0 -1
- package/packages/cli/dist/commands/sync-back.d.ts +0 -6
- package/packages/cli/dist/commands/sync-back.js +0 -82
- package/packages/cli/dist/commands/sync-back.js.map +0 -1
- package/packages/cli/dist/renderers/artifacts.d.ts +0 -5
- package/packages/cli/dist/renderers/artifacts.js +0 -43
- package/packages/cli/dist/renderers/artifacts.js.map +0 -1
- package/packages/core/dist/doctor/render.d.ts +0 -2
- package/packages/core/dist/doctor/render.js +0 -44
- package/packages/core/dist/doctor/render.js.map +0 -1
- package/packages/core/dist/sync-back/apply.d.ts +0 -17
- package/packages/core/dist/sync-back/apply.js +0 -221
- package/packages/core/dist/sync-back/apply.js.map +0 -1
- package/packages/core/dist/sync-back/inspect.d.ts +0 -91
- package/packages/core/dist/sync-back/inspect.js +0 -395
- package/packages/core/dist/sync-back/inspect.js.map +0 -1
- package/packages/core/dist/sync-back.d.ts +0 -2
- package/packages/core/dist/sync-back.js +0 -3
- package/packages/core/dist/sync-back.js.map +0 -1
|
@@ -1,26 +1,47 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
1
3
|
import { WORKFLOW_STATE_RESOLVER_CONTRACT_VERSION } from '../contracts.js';
|
|
2
|
-
import { recordRuntimeProjection } from '../storage/runtime-store.js';
|
|
4
|
+
import { listRuntimeProjections, listRuntimeRepairs, recordRuntimeProjection } from '../storage/runtime-store.js';
|
|
3
5
|
import { affectedFileConflictsForSelectedRun } from './affected-file-conflicts.js';
|
|
4
6
|
import { readAllRunStates, summarizeRunState } from '../run-state/run-state.js';
|
|
5
7
|
import { resolveSddContext } from '../sdd-docs/context.js';
|
|
6
8
|
import { parseSddBranch } from '../sdd-docs/task-parser.js';
|
|
7
|
-
import { workflowDependencyBlockers } from './dependencies.js';
|
|
9
|
+
import { dependencyBlockingReasonsForTask, workflowDependencyBlockers } from './dependencies.js';
|
|
10
|
+
import { selectLatestEligibleRunsByTask } from './latest-eligible-run.js';
|
|
11
|
+
import { DO_COLLABORATION_ADJUDICATION_PROJECTION_TYPE, GOAL_VERIFY_COLLABORATION_ADJUDICATION_PROJECTION_TYPE, PLAN_COLLABORATION_ADJUDICATION_PROJECTION_TYPE, readTruthAlignmentProjection, SHIP_COLLABORATION_ADJUDICATION_PROJECTION_TYPE, SPEC_COLLABORATION_ADJUDICATION_PROJECTION_TYPE, TASKS_COLLABORATION_ADJUDICATION_PROJECTION_TYPE, TEST_COLLABORATION_ADJUDICATION_PROJECTION_TYPE, VERIFIES_COLLABORATION_ADJUDICATION_PROJECTION_TYPE } from '../stage-collaboration.js';
|
|
12
|
+
import { buildTruthReconciliationDecision, minimalReworkFrontier, recordTruthReconciliationDecision, truthDriftClassForAlignment, truthReconciliationOwnerStage } from '../truth-reconciliation.js';
|
|
13
|
+
import { normalizePortablePath } from '../path-safety.js';
|
|
14
|
+
import { hashDocumentContent } from '../sdd-docs/document-hashes.js';
|
|
15
|
+
import { recordWorkflowRuntimeProjections } from './runtime-projections.js';
|
|
16
|
+
export const COMMAND_BUNDLES = {
|
|
17
|
+
spec: ['spec'],
|
|
18
|
+
plan: ['plan'],
|
|
19
|
+
tasks: ['tasks', 'verifies'],
|
|
20
|
+
do: ['do'],
|
|
21
|
+
test: ['test', 'goal-verify'],
|
|
22
|
+
ship: ['ship']
|
|
23
|
+
};
|
|
8
24
|
export async function resolveWorkflowState(projectRoot, options = {}) {
|
|
9
25
|
const context = await resolveSddContext(projectRoot, options);
|
|
10
26
|
const branch = context.partition;
|
|
11
|
-
const [model, states] = await Promise.all([parseSddBranch(projectRoot, branch), readAllRunStates(projectRoot)]);
|
|
27
|
+
const [model, states, openRepairs, truthAlignmentEnvelope] = await Promise.all([parseSddBranch(projectRoot, branch), readAllRunStates(projectRoot), listRuntimeRepairs(projectRoot, { branchSlug: branch, status: 'open' }), readTruthAlignmentProjection(projectRoot, { branch })]);
|
|
12
28
|
const visibleGaps = workflowIsActive(model) ? model.gaps : [];
|
|
13
|
-
const
|
|
29
|
+
const latestEligibleRunsByTask = selectLatestEligibleRunsByTask({ states, model, partition: branch, currentGitBranch: context.currentGitBranch });
|
|
30
|
+
const latestRunsByTask = selectedLatestTaskRuns(latestEligibleRunsByTask);
|
|
14
31
|
const selectedTaskRun = options.taskId
|
|
15
32
|
? latestRunsByTask.find((entry) => entry.taskId === options.taskId) ?? null
|
|
16
33
|
: latestRunsByTask.slice().sort((left, right) => Date.parse(right.updatedAt) - Date.parse(left.updatedAt))[0] ?? null;
|
|
17
34
|
const latestRunState = selectedTaskRun ? states.find((state) => state.runId === selectedTaskRun.runId) ?? null : null;
|
|
18
35
|
const affectedFileConflicts = latestRunState ? affectedFileConflictsForSelectedRun(states, latestRunState) : [];
|
|
19
|
-
const
|
|
20
|
-
const
|
|
36
|
+
const runtimeByTask = latestRuntimeTaskStates(latestEligibleRunsByTask, states);
|
|
37
|
+
const dependencyBlockers = workflowDependencyBlockers(model, { runtimeByTask });
|
|
38
|
+
const readiness = workflowReadinessSummary(model, latestRunsByTask);
|
|
39
|
+
const generatedAt = new Date().toISOString();
|
|
40
|
+
const blockingReasons = [...blockingWorkflowReasons(visibleGaps, affectedFileConflicts, dependencyBlockers), ...openRepairs.map(formatOpenRepairReason)];
|
|
41
|
+
const truthReconciliation = await resolveTruthReconciliationDecision(projectRoot, branch, truthAlignmentEnvelope?.payload ?? null, generatedAt, { states, model });
|
|
21
42
|
const resolution = {
|
|
22
43
|
contract: WORKFLOW_STATE_RESOLVER_CONTRACT_VERSION,
|
|
23
|
-
generatedAt
|
|
44
|
+
generatedAt,
|
|
24
45
|
branch,
|
|
25
46
|
workflowStatus: workflowIsActive(model) ? 'active' : 'not_started',
|
|
26
47
|
context,
|
|
@@ -31,12 +52,25 @@ export async function resolveWorkflowState(projectRoot, options = {}) {
|
|
|
31
52
|
latestRun: latestRunState ? summarizeRunState(latestRunState) : null,
|
|
32
53
|
latestRunState,
|
|
33
54
|
latestRunsByTask,
|
|
55
|
+
latestEligibleRunsByTask,
|
|
34
56
|
affectedFileConflicts,
|
|
35
57
|
dependencyBlockers,
|
|
58
|
+
openRepairs,
|
|
36
59
|
blockingReasons,
|
|
37
|
-
|
|
60
|
+
workflowReadiness: readiness,
|
|
61
|
+
whyNotShip: readiness.whyNotShip,
|
|
62
|
+
nextIntent: recommendedWorkflowNextIntent(context, model, latestRunsByTask, visibleGaps, dependencyBlockers, runtimeByTask, readiness, openRepairs, truthReconciliation),
|
|
63
|
+
truthReconciliation,
|
|
64
|
+
recommendedNextCommand: ''
|
|
38
65
|
};
|
|
39
|
-
|
|
66
|
+
resolution.recommendedNextCommand = resolution.nextIntent.canonicalCommand;
|
|
67
|
+
try {
|
|
68
|
+
await recordRuntimeProjection(projectRoot, 'workflow_state', branch, projectWorkflowStateProjection(resolution));
|
|
69
|
+
await recordWorkflowRuntimeProjections(projectRoot, resolution);
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
// Projection writes are rebuildable and must not block workflow resolution.
|
|
73
|
+
}
|
|
40
74
|
return resolution;
|
|
41
75
|
}
|
|
42
76
|
function workflowIsActive(model) {
|
|
@@ -54,29 +88,23 @@ function taskCounts(model, gaps) {
|
|
|
54
88
|
gaps: gaps.length
|
|
55
89
|
};
|
|
56
90
|
}
|
|
57
|
-
function
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const existing = latest.get(entry.taskId);
|
|
75
|
-
if (!existing || Date.parse(entry.updatedAt) > Date.parse(existing.updatedAt) || (entry.updatedAt === existing.updatedAt && entry.runId.localeCompare(existing.runId) > 0)) {
|
|
76
|
-
latest.set(entry.taskId, entry);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return Array.from(latest.values()).sort((left, right) => left.taskId.localeCompare(right.taskId));
|
|
91
|
+
function selectedLatestTaskRuns(selections) {
|
|
92
|
+
return selections
|
|
93
|
+
.flatMap((selection) => selection.selected ? [selection.selected] : [])
|
|
94
|
+
.map((candidate) => ({
|
|
95
|
+
partition: candidate.partition,
|
|
96
|
+
gitBranch: candidate.gitBranch,
|
|
97
|
+
taskId: candidate.taskId,
|
|
98
|
+
runId: candidate.runId,
|
|
99
|
+
runStatus: candidate.runStatus,
|
|
100
|
+
validationStatus: candidate.validationStatus,
|
|
101
|
+
affectedFiles: candidate.affectedFiles,
|
|
102
|
+
updatedAt: candidate.updatedAt,
|
|
103
|
+
compatibility: candidate.compatibility,
|
|
104
|
+
eligibleForDefaultApply: candidate.eligibleForDefaultApply,
|
|
105
|
+
reasons: candidate.reasons
|
|
106
|
+
}))
|
|
107
|
+
.sort((left, right) => left.taskId.localeCompare(right.taskId));
|
|
80
108
|
}
|
|
81
109
|
function blockingWorkflowReasons(gaps, conflicts, dependencyBlockers) {
|
|
82
110
|
const reasons = gaps.filter((gap) => gap.severity === 'blocking').map((gap) => `${gap.field}: ${gap.message}`);
|
|
@@ -88,22 +116,621 @@ function blockingWorkflowReasons(gaps, conflicts, dependencyBlockers) {
|
|
|
88
116
|
}
|
|
89
117
|
return reasons;
|
|
90
118
|
}
|
|
91
|
-
function
|
|
119
|
+
async function resolveTruthReconciliationDecision(projectRoot, branch, truthAlignment, generatedAt, progress) {
|
|
120
|
+
if (!truthAlignment) {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
const freshness = await refreshAlignedTruthAlignmentFreshness(projectRoot, branch, truthAlignment);
|
|
124
|
+
if (freshness.truthAlignment.status === 'aligned') {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
const changeKind = truthDriftClassForAlignment(freshness.truthAlignment);
|
|
128
|
+
const ownerStage = truthReconciliationOwnerStage(changeKind, freshness.truthAlignment.ownerStage);
|
|
129
|
+
const minimalFrontier = minimalReworkFrontier({ ownerStage, semanticImpact: freshness.truthAlignment.semanticImpact, invalidatesStages: freshness.truthAlignment.invalidatesStages });
|
|
130
|
+
const targetStage = await activeTruthReconciliationStage(projectRoot, minimalFrontier, freshness.truthAlignment, progress);
|
|
131
|
+
const nextIntent = truthReconciliationNextIntent(branch, targetStage, freshness.truthAlignment.reasons);
|
|
132
|
+
const decision = buildTruthReconciliationDecision({
|
|
133
|
+
truthAlignment: freshness.truthAlignment,
|
|
134
|
+
nextIntent,
|
|
135
|
+
changeKind,
|
|
136
|
+
changedRef: freshness.changedRef,
|
|
137
|
+
oldHash: freshness.oldHash,
|
|
138
|
+
newHash: freshness.newHash
|
|
139
|
+
});
|
|
140
|
+
await recordTruthReconciliationDecision(projectRoot, decision, generatedAt);
|
|
141
|
+
return decision;
|
|
142
|
+
}
|
|
143
|
+
async function refreshAlignedTruthAlignmentFreshness(projectRoot, branch, truthAlignment) {
|
|
144
|
+
if (truthAlignment.status !== 'aligned') {
|
|
145
|
+
return { truthAlignment };
|
|
146
|
+
}
|
|
147
|
+
const staleRefs = [];
|
|
148
|
+
for (const ref of [...truthAlignment.declaredTruthRefs, ...truthAlignment.acceptedRealityRefs]) {
|
|
149
|
+
if (!ref.hash || ref.kind === 'projection' || ref.kind === 'run') {
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
const currentHash = await currentTruthRefHash(projectRoot, ref);
|
|
153
|
+
if (currentHash !== ref.hash) {
|
|
154
|
+
staleRefs.push({ ref, currentHash });
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const unresolvedStaleRefs = await unresolvedStaleTruthRefs(projectRoot, branch, truthAlignment, staleRefs);
|
|
158
|
+
const firstStaleRef = unresolvedStaleRefs[0];
|
|
159
|
+
if (!firstStaleRef) {
|
|
160
|
+
return { truthAlignment };
|
|
161
|
+
}
|
|
162
|
+
const ownerStage = ownerStageForTruthRef(branch, firstStaleRef.ref) ?? truthAlignment.ownerStage ?? 'ship';
|
|
163
|
+
const semanticImpact = semanticImpactForTruthRef(branch, firstStaleRef.ref);
|
|
164
|
+
const reasons = [
|
|
165
|
+
...truthAlignment.reasons,
|
|
166
|
+
...unresolvedStaleRefs.map((entry) => `TruthAlignment ref hash is stale for ${entry.ref.ref}: expected ${entry.ref.hash ?? 'unknown'}, actual ${entry.currentHash}.`)
|
|
167
|
+
];
|
|
168
|
+
return {
|
|
169
|
+
truthAlignment: {
|
|
170
|
+
...truthAlignment,
|
|
171
|
+
status: 'update_required',
|
|
172
|
+
ownerStage,
|
|
173
|
+
semanticImpact,
|
|
174
|
+
staleRefs: uniqueRuntimeRefs([...truthAlignment.staleRefs, ...unresolvedStaleRefs.map((entry) => entry.ref)]),
|
|
175
|
+
invalidatesStages: uniqueStages([...truthAlignment.invalidatesStages, ownerStage]),
|
|
176
|
+
reasons: uniqueStrings(reasons)
|
|
177
|
+
},
|
|
178
|
+
changedRef: firstStaleRef.ref,
|
|
179
|
+
oldHash: firstStaleRef.ref.hash,
|
|
180
|
+
newHash: firstStaleRef.currentHash
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
async function unresolvedStaleTruthRefs(projectRoot, branch, truthAlignment, staleRefs) {
|
|
184
|
+
const unresolved = [];
|
|
185
|
+
for (const entry of staleRefs) {
|
|
186
|
+
if (!await staleTruthRefReconciledAfterAlignment(projectRoot, branch, truthAlignment, entry)) {
|
|
187
|
+
unresolved.push(entry);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return unresolved;
|
|
191
|
+
}
|
|
192
|
+
async function staleTruthRefReconciledAfterAlignment(projectRoot, branch, truthAlignment, entry) {
|
|
193
|
+
const stage = ownerStageForTruthRef(branch, entry.ref);
|
|
194
|
+
return stage ? await stageCloseAcceptedTruthRefAfterTruthAlignment(projectRoot, truthAlignment, stage, entry.ref, entry.currentHash) : false;
|
|
195
|
+
}
|
|
196
|
+
async function activeTruthReconciliationStage(projectRoot, frontier, truthAlignment, progress) {
|
|
197
|
+
for (const stage of frontier) {
|
|
198
|
+
if (!await truthReconciliationStageCompleted(projectRoot, stage, truthAlignment, progress)) {
|
|
199
|
+
return stage;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return frontier[frontier.length - 1] ?? truthAlignment.ownerStage ?? 'ship';
|
|
203
|
+
}
|
|
204
|
+
async function truthReconciliationStageCompleted(projectRoot, stage, truthAlignment, progress) {
|
|
205
|
+
if (await stageCloseCompletedAfterTruthAlignment(projectRoot, truthAlignment, stage)) {
|
|
206
|
+
return true;
|
|
207
|
+
}
|
|
208
|
+
const taskIds = reconciliationTaskIds(truthAlignment, progress);
|
|
209
|
+
if (stage === 'do') {
|
|
210
|
+
return taskIds.every((taskId) => progress.states.some((state) => stateAfterTruthAlignment(state, truthAlignment) && stateTaskImplemented(state.tasks[taskId])));
|
|
211
|
+
}
|
|
212
|
+
if (stage === 'test') {
|
|
213
|
+
return taskIds.every((taskId) => progress.states.some((state) => stateAfterTruthAlignment(state, truthAlignment) && stateTaskValidationPassed(state.tasks[taskId], state)));
|
|
214
|
+
}
|
|
215
|
+
if (stage === 'goal-verify') {
|
|
216
|
+
return truthAlignment.status === 'aligned';
|
|
217
|
+
}
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
function reconciliationTaskIds(truthAlignment, progress) {
|
|
221
|
+
const requiredIds = requiredTaskIds(progress.model);
|
|
222
|
+
const requiredIdSet = new Set(requiredIds);
|
|
223
|
+
const targetRefs = new Set([...truthAlignment.staleRefs, ...truthAlignment.acceptedRealityRefs].map((ref) => normalizePortablePath(ref.ref)).filter(Boolean));
|
|
224
|
+
const taskIds = new Set();
|
|
225
|
+
for (const state of progress.states) {
|
|
226
|
+
if (state.partition && state.partition !== truthAlignment.branch) {
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
if (!stateReferencesAnyRef(state, targetRefs)) {
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
for (const taskId of stateTaskIds(state)) {
|
|
233
|
+
if (requiredIdSet.has(taskId)) {
|
|
234
|
+
taskIds.add(taskId);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
const scopedTaskIds = [...taskIds].sort();
|
|
239
|
+
return scopedTaskIds.length > 0 ? scopedTaskIds : requiredIds;
|
|
240
|
+
}
|
|
241
|
+
function stateReferencesAnyRef(state, targetRefs) {
|
|
242
|
+
if (targetRefs.size === 0) {
|
|
243
|
+
return false;
|
|
244
|
+
}
|
|
245
|
+
const refs = [
|
|
246
|
+
...state.artifacts.map((artifact) => artifact.path),
|
|
247
|
+
...Object.values(state.tasks).flatMap((runtime) => [...(runtime.artifacts ?? []), ...(runtime.evidence ?? [])])
|
|
248
|
+
];
|
|
249
|
+
return refs.some((ref) => refMatchesTarget(ref, targetRefs));
|
|
250
|
+
}
|
|
251
|
+
function refMatchesTarget(ref, targetRefs) {
|
|
252
|
+
const normalized = normalizePortablePath(ref);
|
|
253
|
+
return Boolean(normalized && [...targetRefs].some((target) => normalized === target || normalized.endsWith(`/${target}`) || target.endsWith(`/${normalized}`)));
|
|
254
|
+
}
|
|
255
|
+
function stateTaskIds(state) {
|
|
256
|
+
return [...new Set([state.taskId, state.currentTask, ...Object.keys(state.tasks)].filter((taskId) => typeof taskId === 'string' && taskId.length > 0))];
|
|
257
|
+
}
|
|
258
|
+
async function stageCloseCompletedAfterTruthAlignment(projectRoot, truthAlignment, stage) {
|
|
259
|
+
const projectionType = stageAdjudicationProjectionType(stage);
|
|
260
|
+
if (!projectionType) {
|
|
261
|
+
return false;
|
|
262
|
+
}
|
|
263
|
+
const projections = await listRuntimeProjections(projectRoot, [projectionType]);
|
|
264
|
+
return projections
|
|
265
|
+
.map((projection) => projection.payload)
|
|
266
|
+
.some((envelope) => stageAdjudicationCompletedAfterTruthAlignment(envelope, truthAlignment, stage));
|
|
267
|
+
}
|
|
268
|
+
function stageAdjudicationProjectionType(stage) {
|
|
269
|
+
const projectionTypes = {
|
|
270
|
+
spec: SPEC_COLLABORATION_ADJUDICATION_PROJECTION_TYPE,
|
|
271
|
+
plan: PLAN_COLLABORATION_ADJUDICATION_PROJECTION_TYPE,
|
|
272
|
+
tasks: TASKS_COLLABORATION_ADJUDICATION_PROJECTION_TYPE,
|
|
273
|
+
verifies: VERIFIES_COLLABORATION_ADJUDICATION_PROJECTION_TYPE,
|
|
274
|
+
do: DO_COLLABORATION_ADJUDICATION_PROJECTION_TYPE,
|
|
275
|
+
test: TEST_COLLABORATION_ADJUDICATION_PROJECTION_TYPE,
|
|
276
|
+
'goal-verify': GOAL_VERIFY_COLLABORATION_ADJUDICATION_PROJECTION_TYPE,
|
|
277
|
+
ship: SHIP_COLLABORATION_ADJUDICATION_PROJECTION_TYPE
|
|
278
|
+
};
|
|
279
|
+
return projectionTypes[stage] ?? null;
|
|
280
|
+
}
|
|
281
|
+
async function stageCloseAcceptedTruthRefAfterTruthAlignment(projectRoot, truthAlignment, stage, staleRef, currentHash) {
|
|
282
|
+
const projectionType = stageAdjudicationProjectionType(stage);
|
|
283
|
+
if (!projectionType) {
|
|
284
|
+
return false;
|
|
285
|
+
}
|
|
286
|
+
const projections = await listRuntimeProjections(projectRoot, [projectionType]);
|
|
287
|
+
return projections
|
|
288
|
+
.map((projection) => projection.payload)
|
|
289
|
+
.some((envelope) => stageAdjudicationCompletedAfterTruthAlignment(envelope, truthAlignment, stage)
|
|
290
|
+
&& acceptedStageRefs(envelope.payload).some((acceptedRef) => acceptedTruthRefMatchesCurrent(acceptedRef, staleRef, currentHash)));
|
|
291
|
+
}
|
|
292
|
+
function acceptedTruthRefMatchesCurrent(acceptedRef, staleRef, currentHash) {
|
|
293
|
+
return acceptedRef.kind === staleRef.kind
|
|
294
|
+
&& normalizePortablePath(acceptedRef.ref) === normalizePortablePath(staleRef.ref)
|
|
295
|
+
&& acceptedRef.hash === currentHash;
|
|
296
|
+
}
|
|
297
|
+
function stageAdjudicationCompletedAfterTruthAlignment(envelope, truthAlignment, stage) {
|
|
298
|
+
const expectedHealth = expectedStageCloseHealth(stage);
|
|
299
|
+
return envelope.payload?.scope?.branch === truthAlignment.branch
|
|
300
|
+
&& envelope.payload.stage === stage
|
|
301
|
+
&& Date.parse(envelope.generatedAt) > Date.parse(truthAlignment.createdAt)
|
|
302
|
+
&& envelope.payload.stageDecision?.status === 'completed'
|
|
303
|
+
&& (envelope.payload.health === expectedHealth || envelope.payload.stageDecision?.health === expectedHealth)
|
|
304
|
+
&& acceptedStageRefs(envelope.payload).some((ref) => ownerStageForTruthRef(truthAlignment.branch, ref) === stage);
|
|
305
|
+
}
|
|
306
|
+
function expectedStageCloseHealth(stage) {
|
|
307
|
+
const expectedHealth = {
|
|
308
|
+
spec: 'ready_for_plan',
|
|
309
|
+
plan: 'ready_for_tasks',
|
|
310
|
+
tasks: 'ready_for_verifies',
|
|
311
|
+
verifies: 'ready_for_do',
|
|
312
|
+
do: 'ready_for_test',
|
|
313
|
+
test: 'ready_for_goal_verify',
|
|
314
|
+
'goal-verify': 'ready_for_ship',
|
|
315
|
+
ship: 'ship_ready'
|
|
316
|
+
};
|
|
317
|
+
return expectedHealth[stage];
|
|
318
|
+
}
|
|
319
|
+
function acceptedStageRefs(adjudication) {
|
|
320
|
+
const refs = Array.isArray(adjudication.stageDecision?.acceptedDecisionRefs) ? adjudication.stageDecision.acceptedDecisionRefs : [];
|
|
321
|
+
const closureRefs = adjudication.closureRefs ?? {};
|
|
322
|
+
const closureRefKeys = [
|
|
323
|
+
'acceptedSpecRef',
|
|
324
|
+
'acceptedPlanRef',
|
|
325
|
+
'acceptedTasksRef',
|
|
326
|
+
'acceptedVerifyRef',
|
|
327
|
+
'acceptedImplementationRef',
|
|
328
|
+
'acceptedTestEvidenceRef',
|
|
329
|
+
'acceptedGoalVerificationRef',
|
|
330
|
+
'acceptedShipReadinessRef'
|
|
331
|
+
];
|
|
332
|
+
return [
|
|
333
|
+
...refs,
|
|
334
|
+
...closureRefKeys.map((key) => runtimeRefFromUnknown(closureRefs[key]))
|
|
335
|
+
].filter((ref) => ref !== null);
|
|
336
|
+
}
|
|
337
|
+
function runtimeRefFromUnknown(value) {
|
|
338
|
+
if (!value || typeof value !== 'object') {
|
|
339
|
+
return null;
|
|
340
|
+
}
|
|
341
|
+
const candidate = value;
|
|
342
|
+
if (typeof candidate.kind !== 'string' || typeof candidate.ref !== 'string') {
|
|
343
|
+
return null;
|
|
344
|
+
}
|
|
345
|
+
return {
|
|
346
|
+
kind: candidate.kind,
|
|
347
|
+
ref: candidate.ref,
|
|
348
|
+
hash: typeof candidate.hash === 'string' ? candidate.hash : undefined
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
function requiredTaskIds(model) {
|
|
352
|
+
return model.tasks.filter((task) => task.status !== 'deferred').map((task) => task.id);
|
|
353
|
+
}
|
|
354
|
+
function stateAfterTruthAlignment(state, truthAlignment) {
|
|
355
|
+
return Date.parse(state.updatedAt) > Date.parse(truthAlignment.createdAt);
|
|
356
|
+
}
|
|
357
|
+
function stateTaskImplemented(runtime) {
|
|
358
|
+
return runtimeTaskImplemented(runtime);
|
|
359
|
+
}
|
|
360
|
+
function stateTaskValidationPassed(runtime, state) {
|
|
361
|
+
return runtime?.verificationStatus === 'pass' || runtime?.status === 'implemented_verified' || state.validation.status === 'pass';
|
|
362
|
+
}
|
|
363
|
+
async function currentTruthRefHash(projectRoot, ref) {
|
|
364
|
+
const normalized = normalizePortablePath(ref.ref);
|
|
365
|
+
if (!normalized || normalized === '.' || normalized === '..' || normalized.includes('..') || path.isAbsolute(ref.ref)) {
|
|
366
|
+
return 'unsafe-ref';
|
|
367
|
+
}
|
|
368
|
+
const projectPath = path.resolve(projectRoot);
|
|
369
|
+
const filePath = path.resolve(projectPath, normalized);
|
|
370
|
+
if (!filePath.startsWith(`${projectPath}${path.sep}`)) {
|
|
371
|
+
return 'escaped-ref';
|
|
372
|
+
}
|
|
373
|
+
try {
|
|
374
|
+
return hashDocumentContent(await readFile(filePath, 'utf8'));
|
|
375
|
+
}
|
|
376
|
+
catch {
|
|
377
|
+
return 'missing-ref';
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
function ownerStageForTruthRef(branch, ref) {
|
|
381
|
+
const normalized = normalizePortablePath(ref.ref);
|
|
382
|
+
if (!normalized) {
|
|
383
|
+
return null;
|
|
384
|
+
}
|
|
385
|
+
if (normalized === `specs/${branch}/spec.md`) {
|
|
386
|
+
return 'spec';
|
|
387
|
+
}
|
|
388
|
+
if (normalized === `specs/${branch}/plan.md`) {
|
|
389
|
+
return 'plan';
|
|
390
|
+
}
|
|
391
|
+
if (normalized === `specs/${branch}/tasks.md`) {
|
|
392
|
+
return 'tasks';
|
|
393
|
+
}
|
|
394
|
+
if (normalized === `specs/${branch}/verify.md`) {
|
|
395
|
+
return 'verifies';
|
|
396
|
+
}
|
|
397
|
+
if (normalized === `specs/${branch}/release.md`) {
|
|
398
|
+
return 'ship';
|
|
399
|
+
}
|
|
400
|
+
const runStage = normalized.match(new RegExp(`^\\.sdd/runs/${escapeRegExp(branch)}/([^/]+)/`))?.[1];
|
|
401
|
+
return runStage && isSddStage(runStage) ? runStage : null;
|
|
402
|
+
}
|
|
403
|
+
function semanticImpactForTruthRef(branch, ref) {
|
|
404
|
+
const ownerStage = ownerStageForTruthRef(branch, ref);
|
|
405
|
+
return ref.kind === 'document' || ownerStage === 'spec' || ownerStage === 'plan' || ownerStage === 'tasks' || ownerStage === 'verifies' ? 'none' : 'material';
|
|
406
|
+
}
|
|
407
|
+
function uniqueRuntimeRefs(refs) {
|
|
408
|
+
const seen = new Set();
|
|
409
|
+
const result = [];
|
|
410
|
+
for (const ref of refs) {
|
|
411
|
+
const key = `${ref.kind}:${ref.ref}:${ref.hash ?? ''}`;
|
|
412
|
+
if (!seen.has(key)) {
|
|
413
|
+
seen.add(key);
|
|
414
|
+
result.push(ref);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
return result;
|
|
418
|
+
}
|
|
419
|
+
function uniqueStages(stages) {
|
|
420
|
+
return ['spec', 'plan', 'tasks', 'verifies', 'do', 'test', 'goal-verify', 'ship'].filter((stage) => stages.includes(stage));
|
|
421
|
+
}
|
|
422
|
+
function uniqueStrings(values) {
|
|
423
|
+
return [...new Set(values)];
|
|
424
|
+
}
|
|
425
|
+
function escapeRegExp(value) {
|
|
426
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
427
|
+
}
|
|
428
|
+
function truthReconciliationNextIntent(branch, ownerStage, reasons) {
|
|
429
|
+
const bundle = commandBundleForRuntimeStage(ownerStage);
|
|
430
|
+
return workflowNextIntent(bundle, 'reconcile_truth', truthReconciliationCommand(branch, ownerStage), `Reconcile truth drift in ${ownerStage}-manager before downstream ship readiness.`, reasons.join('; ') || 'truthAlignment requires reconciliation', {
|
|
431
|
+
targetRuntimeStage: ownerStage,
|
|
432
|
+
resumeMode: 'reconcile',
|
|
433
|
+
canAutoAdvanceWithinBundle: ownerStage === 'verifies' || ownerStage === 'goal-verify',
|
|
434
|
+
evidenceSurface: [...evidenceSurfaceForRuntimeStage(ownerStage), 'truthReconciliation projection']
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
function truthReconciliationCommand(branch, ownerStage) {
|
|
438
|
+
if (ownerStage === 'do') {
|
|
439
|
+
return `sdd do task <task_id> --branch ${branch}`;
|
|
440
|
+
}
|
|
441
|
+
return stageCloseCommandForRuntimeStage(branch, ownerStage);
|
|
442
|
+
}
|
|
443
|
+
function stageCloseCommandForRuntimeStage(branch, stage) {
|
|
444
|
+
if (stage === 'verifies') {
|
|
445
|
+
return `sdd tasks close --branch ${branch} --target verifies --compact-json`;
|
|
446
|
+
}
|
|
447
|
+
if (stage === 'goal-verify') {
|
|
448
|
+
return `sdd test close --branch ${branch} --target goal-verify --compact-json`;
|
|
449
|
+
}
|
|
450
|
+
return `sdd ${stage} close --branch ${branch} --compact-json`;
|
|
451
|
+
}
|
|
452
|
+
function formatOpenRepairReason(repair) {
|
|
453
|
+
return `Open ${repair.repairType} ${repair.repairId}: ${repair.blockers.join('; ')}`;
|
|
454
|
+
}
|
|
455
|
+
function recommendedWorkflowNextIntent(context, model, latestRunsByTask, gaps, dependencyBlockers, runtimeByTask, readiness, openRepairs, truthReconciliation) {
|
|
92
456
|
if (!workflowIsActive(model)) {
|
|
93
|
-
return
|
|
457
|
+
return workflowNextIntent('spec', 'start_spec', `sdd spec --branch ${context.partition}`, 'Start the spec stage before planning or task execution.', null);
|
|
458
|
+
}
|
|
459
|
+
const blockingGap = gaps.find((gap) => gap.severity === 'blocking');
|
|
460
|
+
if (blockingGap) {
|
|
461
|
+
return workflowNextIntent('tasks', 'resolve_task_gaps', `sdd tasks gaps --branch ${context.partition}`, 'Resolve blocking task document gaps before execution evidence can be trusted.', `${blockingGap.field}: ${blockingGap.message}`);
|
|
462
|
+
}
|
|
463
|
+
const openRepair = openRepairs[0];
|
|
464
|
+
if (openRepair) {
|
|
465
|
+
return workflowNextIntent('test', 'repair_failure', openRepair.recommendedCommands[0] ?? `sdd doctor --branch ${context.partition} --latest-only`, openRepair.requiredEvidence.join('; ') || 'Resolve the open repair with new accepted evidence or a fresh gate PASS.', formatOpenRepairReason(openRepair));
|
|
94
466
|
}
|
|
95
|
-
if (
|
|
96
|
-
return
|
|
467
|
+
if (truthReconciliation) {
|
|
468
|
+
return truthReconciliation.nextIntent;
|
|
469
|
+
}
|
|
470
|
+
const strictTask = model.tasks.find((task) => needsTaskValidation(task, runtimeByTask.get(task.id)));
|
|
471
|
+
if (strictTask) {
|
|
472
|
+
return workflowNextIntent('test', 'run_task_validation', validationUnitCommand(context.partition, validationUnitIdForTask(strictTask)), 'Validate this verify.md validation unit before more implementation proceeds.', null);
|
|
473
|
+
}
|
|
474
|
+
const readyBoundary = readyValidationBoundary(model, runtimeByTask);
|
|
475
|
+
if (readyBoundary?.kind === 'batch') {
|
|
476
|
+
return workflowNextIntent('test', 'run_batch_validation', validationUnitCommand(context.partition, readyBoundary.id), `Validate accumulated implementation evidence for validation unit ${readyBoundary.id}.`, null);
|
|
477
|
+
}
|
|
478
|
+
if (readyBoundary?.kind === 'wave') {
|
|
479
|
+
return workflowNextIntent('test', 'run_wave_validation', validationUnitCommand(context.partition, readyBoundary.id), `Validate accumulated implementation evidence for validation unit ${readyBoundary.id}.`, null);
|
|
480
|
+
}
|
|
481
|
+
if (readiness.readyForShip) {
|
|
482
|
+
if (goalVerificationPassedForShip(model, runtimeByTask)) {
|
|
483
|
+
return workflowNextIntent('ship', 'ship_readiness', `sdd ship close --branch ${context.partition} --compact-json`, 'Goal verification passed; close ship readiness with ship-stage evidence.', null);
|
|
484
|
+
}
|
|
485
|
+
return workflowNextIntent('test', 'run_goal_verify', stageCloseCommandForRuntimeStage(context.partition, 'goal-verify'), 'Close goal verification inside the /sdd:test bundle and compute truthAlignment before ship readiness can run.', null, {
|
|
486
|
+
targetRuntimeStage: 'goal-verify',
|
|
487
|
+
resumeMode: 'resume',
|
|
488
|
+
canAutoAdvanceWithinBundle: true,
|
|
489
|
+
evidenceSurface: ['.sdd/runs/<branch>/goal-verify/*.md', 'truthAlignment projection']
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
const nextTask = model.tasks.find((task) => task.status === 'pending' && !runtimeTaskImplemented(runtimeByTask.get(task.id)) && dependencyBlockingReasonsForTask(model, task.id, { runtimeByTask }).length === 0);
|
|
493
|
+
if (nextTask) {
|
|
494
|
+
return workflowNextIntent('do', 'continue_do', `sdd do task ${nextTask.id} --branch ${context.partition}`, 'Continue sequential implementation; validation can wait until the declared task or batch boundary.', null);
|
|
97
495
|
}
|
|
98
496
|
const dependencyBlocker = dependencyBlockers[0];
|
|
99
497
|
if (dependencyBlocker) {
|
|
100
|
-
return `sdd tasks inspect ${dependencyBlocker.dependencyId} --branch ${context.partition}
|
|
101
|
-
}
|
|
102
|
-
if (latestRun?.syncBack.status === 'proposed' && latestRun.currentTask) {
|
|
103
|
-
return `sdd sync-back inspect --branch ${context.partition} --task ${latestRun.currentTask}`;
|
|
498
|
+
return workflowNextIntent('tasks', 'inspect_dependency', `sdd tasks inspect ${dependencyBlocker.dependencyId} --branch ${context.partition}`, 'Inspect the dependency task before continuing this workflow.', dependencyBlocker.reason);
|
|
104
499
|
}
|
|
105
500
|
const pendingTask = model.tasks.find((task) => task.status === 'pending');
|
|
106
|
-
return pendingTask
|
|
501
|
+
return pendingTask
|
|
502
|
+
? workflowNextIntent('tasks', 'inspect_task', `sdd tasks inspect ${pendingTask.id} --branch ${context.partition}`, 'Inspect task boundary, acceptance, validation, and capability needs before do/test.', null)
|
|
503
|
+
: workflowNextIntent('tasks', 'list_tasks', `sdd tasks list --branch ${context.partition}`, 'Inspect task state and decide whether to continue or ship.', null);
|
|
504
|
+
}
|
|
505
|
+
export function latestRuntimeTaskStates(selections, states) {
|
|
506
|
+
const stateByRunId = new Map(states.map((state) => [state.runId, state]));
|
|
507
|
+
const result = new Map();
|
|
508
|
+
for (const selection of selections) {
|
|
509
|
+
const selected = selection.selected;
|
|
510
|
+
if (!selected) {
|
|
511
|
+
continue;
|
|
512
|
+
}
|
|
513
|
+
const taskState = stateByRunId.get(selected.runId)?.tasks[selected.taskId];
|
|
514
|
+
if (taskState) {
|
|
515
|
+
result.set(selected.taskId, taskState);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
return result;
|
|
519
|
+
}
|
|
520
|
+
function needsTaskValidation(task, runtime) {
|
|
521
|
+
return Boolean(runtimeTaskImplemented(runtime) && runtime?.verificationStatus !== 'pass' && (task.requiresVerifyBeforeNext || task.validationTiming === 'task_end'));
|
|
522
|
+
}
|
|
523
|
+
function validationUnitIdForTask(task) {
|
|
524
|
+
return task.validationBatch ?? `task-${task.id}`;
|
|
525
|
+
}
|
|
526
|
+
function readyValidationBoundary(model, runtimeByTask) {
|
|
527
|
+
const batchGroups = new Map();
|
|
528
|
+
const waveGroups = new Map();
|
|
529
|
+
for (const task of model.tasks) {
|
|
530
|
+
if (task.validationTiming === 'batch_end' && task.validationBatch) {
|
|
531
|
+
batchGroups.set(task.validationBatch, [...(batchGroups.get(task.validationBatch) ?? []), task]);
|
|
532
|
+
}
|
|
533
|
+
if (task.validationTiming === 'wave_end') {
|
|
534
|
+
const id = validationUnitIdForTask(task);
|
|
535
|
+
waveGroups.set(id, [...(waveGroups.get(id) ?? []), task]);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
for (const [id, tasks] of batchGroups) {
|
|
539
|
+
if (validationBoundaryReady(tasks, runtimeByTask)) {
|
|
540
|
+
return { kind: 'batch', id };
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
for (const [id, tasks] of waveGroups) {
|
|
544
|
+
if (validationBoundaryReady(tasks, runtimeByTask)) {
|
|
545
|
+
return { kind: 'wave', id };
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
return null;
|
|
549
|
+
}
|
|
550
|
+
function validationBoundaryReady(tasks, runtimeByTask) {
|
|
551
|
+
return tasks.every((task) => runtimeTaskImplemented(runtimeByTask.get(task.id)))
|
|
552
|
+
&& tasks.some((task) => runtimeByTask.get(task.id)?.verificationStatus !== 'pass');
|
|
553
|
+
}
|
|
554
|
+
function runtimeTaskImplemented(runtime) {
|
|
555
|
+
return runtime?.implementationStatus === 'implemented' || runtime?.status === 'implemented_pending_validation' || runtime?.status === 'implemented_verified';
|
|
556
|
+
}
|
|
557
|
+
function latestEligibleRunReadyForShip(run) {
|
|
558
|
+
return run.runStatus === 'completed' && run.validationStatus === 'pass';
|
|
559
|
+
}
|
|
560
|
+
function goalVerificationPassedForShip(model, runtimeByTask) {
|
|
561
|
+
const requiredTasks = model.tasks.filter((task) => task.status !== 'deferred');
|
|
562
|
+
return requiredTasks.length > 0 && requiredTasks.every((task) => {
|
|
563
|
+
const runtime = runtimeByTask.get(task.id);
|
|
564
|
+
return runtime?.verifyStatus === 'PASS' || runtime?.status === 'implemented_verified';
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
function workflowReadinessSummary(model, latestRunsByTask) {
|
|
568
|
+
const requiredTaskIds = model.tasks.filter((task) => task.status !== 'deferred').map((task) => task.id).sort();
|
|
569
|
+
const acceptedTaskIds = requiredTaskIds.filter((taskId) => latestRunsByTask.some((run) => run.taskId === taskId && latestEligibleRunReadyForShip(run))).sort();
|
|
570
|
+
const missingTaskIds = requiredTaskIds.filter((taskId) => !acceptedTaskIds.includes(taskId));
|
|
571
|
+
return {
|
|
572
|
+
requiredTaskIds,
|
|
573
|
+
acceptedTaskIds,
|
|
574
|
+
missingTaskIds,
|
|
575
|
+
readyForShip: requiredTaskIds.length > 0 && missingTaskIds.length === 0,
|
|
576
|
+
whyNotShip: missingTaskIds.length === 0 ? [] : missingTaskIds.map((taskId) => `Task ${taskId} has no accepted validation PASS evidence.`)
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
function validationUnitCommand(branch, validationUnitId) {
|
|
580
|
+
return `sdd test ${validationUnitId} --branch ${branch}`;
|
|
581
|
+
}
|
|
582
|
+
export function workflowNextIntent(stage, intent, canonicalCommand, evidenceRequirement, blockingReason, options = {}) {
|
|
583
|
+
const targetRuntimeStage = options.targetRuntimeStage ?? runtimeStageForCommand(canonicalCommand, stage);
|
|
584
|
+
const bundle = commandBundleForRuntimeStage(targetRuntimeStage);
|
|
585
|
+
const stages = [...COMMAND_BUNDLES[bundle]];
|
|
586
|
+
const autoAdvanceTo = options.autoAdvanceTo ?? null;
|
|
587
|
+
const canAutoAdvanceWithinBundle = options.canAutoAdvanceWithinBundle ?? Boolean(autoAdvanceTo && stages.includes(autoAdvanceTo));
|
|
588
|
+
const displayCommand = options.displayCommand ?? commandBundleDisplayCommand(bundle, targetRuntimeStage, canonicalCommand);
|
|
589
|
+
const stopReasons = options.stopReasons ?? [];
|
|
590
|
+
const evidenceSurface = options.evidenceSurface ?? evidenceSurfaceForRuntimeStage(targetRuntimeStage);
|
|
591
|
+
const resumeMode = options.resumeMode ?? defaultResumeMode(intent, targetRuntimeStage);
|
|
592
|
+
const commandBundle = {
|
|
593
|
+
contract: 'sdd-command-bundle-plan-v1',
|
|
594
|
+
branch: branchFromCommand(canonicalCommand),
|
|
595
|
+
bundle,
|
|
596
|
+
stages,
|
|
597
|
+
targetRuntimeStage,
|
|
598
|
+
resumeMode,
|
|
599
|
+
canonicalCommand,
|
|
600
|
+
displayCommand,
|
|
601
|
+
canAutoAdvanceWithinBundle,
|
|
602
|
+
autoAdvanceTo,
|
|
603
|
+
stopReasons,
|
|
604
|
+
evidenceSurface
|
|
605
|
+
};
|
|
606
|
+
return {
|
|
607
|
+
stage: bundle,
|
|
608
|
+
bundle,
|
|
609
|
+
targetRuntimeStage,
|
|
610
|
+
resumeMode,
|
|
611
|
+
intent,
|
|
612
|
+
canonicalCommand,
|
|
613
|
+
displayCommand,
|
|
614
|
+
commandSemantics: commandSemanticsForTarget(bundle, targetRuntimeStage, canonicalCommand),
|
|
615
|
+
evidenceRequirement,
|
|
616
|
+
blockingReason,
|
|
617
|
+
canAutoAdvanceWithinBundle,
|
|
618
|
+
autoAdvanceTo,
|
|
619
|
+
stopReasons,
|
|
620
|
+
evidenceSurface,
|
|
621
|
+
commandBundle,
|
|
622
|
+
hostProjections: hostCommandProjections(commandBundle)
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
export function commandBundleForRuntimeStage(stage) {
|
|
626
|
+
if (stage === 'verifies') {
|
|
627
|
+
return 'tasks';
|
|
628
|
+
}
|
|
629
|
+
if (stage === 'goal-verify') {
|
|
630
|
+
return 'test';
|
|
631
|
+
}
|
|
632
|
+
return stage;
|
|
633
|
+
}
|
|
634
|
+
function runtimeStageForCommand(canonicalCommand, fallbackBundle) {
|
|
635
|
+
const command = canonicalCommand.replace(/^sdd\s+/, '').split(/\s+/)[0];
|
|
636
|
+
return isSddStage(command) ? command : COMMAND_BUNDLES[fallbackBundle][0];
|
|
637
|
+
}
|
|
638
|
+
function isSddStage(value) {
|
|
639
|
+
return value === 'spec' || value === 'plan' || value === 'tasks' || value === 'verifies' || value === 'do' || value === 'test' || value === 'goal-verify' || value === 'ship';
|
|
640
|
+
}
|
|
641
|
+
function defaultResumeMode(intent, targetRuntimeStage) {
|
|
642
|
+
if (intent === 'repair_failure') {
|
|
643
|
+
return 'repair';
|
|
644
|
+
}
|
|
645
|
+
if (intent === 'run_goal_verify' || targetRuntimeStage === 'verifies' || targetRuntimeStage === 'goal-verify') {
|
|
646
|
+
return 'resume';
|
|
647
|
+
}
|
|
648
|
+
return 'start';
|
|
649
|
+
}
|
|
650
|
+
function commandSemanticsForTarget(bundle, targetRuntimeStage, canonicalCommand) {
|
|
651
|
+
if (/^sdd\s+status\b/.test(canonicalCommand)) {
|
|
652
|
+
return 'inspection_navigation';
|
|
653
|
+
}
|
|
654
|
+
return bundle === 'do' || bundle === 'test' || bundle === 'ship' || /\sclose\b/.test(canonicalCommand) || targetRuntimeStage === 'verifies' || targetRuntimeStage === 'goal-verify'
|
|
655
|
+
? 'gate_execution'
|
|
656
|
+
: 'inspection_navigation';
|
|
657
|
+
}
|
|
658
|
+
function evidenceSurfaceForRuntimeStage(stage) {
|
|
659
|
+
const surfaces = {
|
|
660
|
+
spec: ['specs/<branch>/spec.md', '.sdd/runs/<branch>/spec/*.md'],
|
|
661
|
+
plan: ['specs/<branch>/plan.md', '.sdd/runs/<branch>/plan/*.md'],
|
|
662
|
+
tasks: ['specs/<branch>/tasks.md', '.sdd/runs/<branch>/tasks/*.md'],
|
|
663
|
+
verifies: ['specs/<branch>/verify.md', '.sdd/runs/<branch>/verifies/*.md'],
|
|
664
|
+
do: ['.sdd/runs/<branch>/do/*.md'],
|
|
665
|
+
test: ['.sdd/runs/<branch>/test/*.md'],
|
|
666
|
+
'goal-verify': ['.sdd/runs/<branch>/goal-verify/*.md', 'truthAlignment projection'],
|
|
667
|
+
ship: ['.sdd/runs/<branch>/ship/*.md', 'truthAlignment projection']
|
|
668
|
+
};
|
|
669
|
+
return surfaces[stage] ?? [`.sdd/runs/<branch>/${stage}/*.md`];
|
|
670
|
+
}
|
|
671
|
+
function branchFromCommand(canonicalCommand) {
|
|
672
|
+
const tokens = canonicalCommand.split(/\s+/);
|
|
673
|
+
const branchIndex = tokens.indexOf('--branch');
|
|
674
|
+
return branchIndex >= 0 ? tokens[branchIndex + 1] ?? '<branch>' : '<branch>';
|
|
675
|
+
}
|
|
676
|
+
function commandBundleDisplayCommand(bundle, targetRuntimeStage, canonicalCommand) {
|
|
677
|
+
return claudeCodeSlashEntry({ bundle, targetRuntimeStage, canonicalCommand });
|
|
678
|
+
}
|
|
679
|
+
function hostCommandProjections(commandBundle) {
|
|
680
|
+
return [
|
|
681
|
+
{
|
|
682
|
+
host: 'claude_code',
|
|
683
|
+
status: 'active',
|
|
684
|
+
entry: claudeCodeSlashEntry(commandBundle),
|
|
685
|
+
projectionSurfaces: ['slash command', 'skill', 'settings/hooks/statusline metadata'],
|
|
686
|
+
permissionProjection: 'Claude Code permission mode/tool prompts remain host enforcement, not SDD lifecycle truth.',
|
|
687
|
+
reason: 'Claude Code supports slash/skill/statusline projections; the canonical CLI command remains the portable source of workflow intent.'
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
host: 'codex',
|
|
691
|
+
status: 'future',
|
|
692
|
+
entry: null,
|
|
693
|
+
projectionSurfaces: ['config.toml profile', 'AGENTS.md instruction surface', 'approval_policy', 'sandbox_mode'],
|
|
694
|
+
permissionProjection: 'Codex approval and sandbox controls can project execution policy; custom command/skill projection is not marked active without stronger evidence.',
|
|
695
|
+
reason: 'Codex exposes approval, sandbox, AGENTS.md, and built-in slash surfaces, but project custom workflow command semantics stay future until validated.'
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
host: 'opencode',
|
|
699
|
+
status: 'active',
|
|
700
|
+
entry: opencodeCommandEntry(commandBundle),
|
|
701
|
+
projectionSurfaces: ['opencode.json/jsonc', '.opencode/commands', '.opencode/agents', '.opencode/skills', 'permissions'],
|
|
702
|
+
permissionProjection: 'OpenCode allow/ask/deny permissions can project SDD tool policy; SDD artifacts remain authoritative evidence.',
|
|
703
|
+
reason: 'OpenCode documents project commands, agents, skills, and permissions suitable for host-specific projection.'
|
|
704
|
+
}
|
|
705
|
+
];
|
|
706
|
+
}
|
|
707
|
+
function claudeCodeSlashEntry(commandBundle) {
|
|
708
|
+
return projectedCommandEntry('/sdd:', commandBundle, ':');
|
|
709
|
+
}
|
|
710
|
+
function opencodeCommandEntry(commandBundle) {
|
|
711
|
+
return projectedCommandEntry('/sdd ', commandBundle, ' ');
|
|
712
|
+
}
|
|
713
|
+
function projectedCommandEntry(prefix, commandBundle, separator) {
|
|
714
|
+
const tokens = commandBundle.canonicalCommand.replace(/^sdd\s+/, '').split(/\s+/).filter(Boolean);
|
|
715
|
+
const [command, ...rest] = tokens;
|
|
716
|
+
if (!command || !isSddStage(command)) {
|
|
717
|
+
return `/sdd ${tokens.join(' ')}`;
|
|
718
|
+
}
|
|
719
|
+
const target = commandBundle.targetRuntimeStage === commandBundle.bundle ? '' : ` target=${commandBundle.targetRuntimeStage}`;
|
|
720
|
+
const tailTokens = stripTargetOption(rest);
|
|
721
|
+
const head = separator === ':' ? `${prefix}${commandBundle.bundle}` : `${prefix}${commandBundle.bundle}`;
|
|
722
|
+
return `${head}${target}${tailTokens.length > 0 ? ` ${tailTokens.join(' ')}` : ''}`;
|
|
723
|
+
}
|
|
724
|
+
function stripTargetOption(tokens) {
|
|
725
|
+
const result = [];
|
|
726
|
+
for (let index = 0; index < tokens.length; index += 1) {
|
|
727
|
+
if (tokens[index] === '--target') {
|
|
728
|
+
index += 1;
|
|
729
|
+
continue;
|
|
730
|
+
}
|
|
731
|
+
result.push(tokens[index]);
|
|
732
|
+
}
|
|
733
|
+
return result;
|
|
107
734
|
}
|
|
108
735
|
function projectWorkflowStateProjection(resolution) {
|
|
109
736
|
return {
|
|
@@ -115,9 +742,15 @@ function projectWorkflowStateProjection(resolution) {
|
|
|
115
742
|
taskCounts: resolution.taskCounts,
|
|
116
743
|
latestRun: resolution.latestRun,
|
|
117
744
|
latestRunsByTask: resolution.latestRunsByTask,
|
|
745
|
+
latestEligibleRunsByTask: resolution.latestEligibleRunsByTask,
|
|
118
746
|
affectedFileConflicts: resolution.affectedFileConflicts,
|
|
119
747
|
dependencyBlockers: resolution.dependencyBlockers,
|
|
748
|
+
openRepairs: resolution.openRepairs,
|
|
120
749
|
blockingReasons: resolution.blockingReasons,
|
|
750
|
+
workflowReadiness: resolution.workflowReadiness,
|
|
751
|
+
whyNotShip: resolution.whyNotShip,
|
|
752
|
+
nextIntent: resolution.nextIntent,
|
|
753
|
+
truthReconciliation: resolution.truthReconciliation,
|
|
121
754
|
recommendedNextCommand: resolution.recommendedNextCommand
|
|
122
755
|
};
|
|
123
756
|
}
|