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,18 +1,21 @@
|
|
|
1
|
-
import { createHash } from 'node:crypto';
|
|
2
1
|
import { SDD_RESULT_CONTRACT, SDD_RESULT_VERSION } from '../contracts.js';
|
|
2
|
+
import { toBranchStageEvidenceRef } from '../runtime-paths.js';
|
|
3
3
|
import { artifactKind, writeArtifact } from '../run-state/artifacts.js';
|
|
4
4
|
import { appendEvent } from '../run-state/events.js';
|
|
5
|
-
import type { RunState } from '../run-state/model.js';
|
|
5
|
+
import type { RunState, RunStateTaskRuntime } from '../run-state/model.js';
|
|
6
6
|
import { createRun, readRunState, writeRunState } from '../run-state/run-state.js';
|
|
7
7
|
import { resolveSddContext } from '../sdd-docs/context.js';
|
|
8
8
|
import { bindRunStateToTask } from '../sdd-docs/run-binding.js';
|
|
9
9
|
import { inspectSddTask, taskGap } from '../sdd-docs/task-inspection.js';
|
|
10
10
|
import { parseSddBranch, type SddTask, type SddTaskGap } from '../sdd-docs/task-parser.js';
|
|
11
11
|
import type { AgentRouterDecision } from '../router/agent-runtime.js';
|
|
12
|
+
import type { LifecycleRiskDecision } from '../risk/contracts.js';
|
|
13
|
+
import { readLifecycleRiskDecisionProjection } from '../risk/kernel.js';
|
|
12
14
|
import type { TeamModeActivation } from '../router/route-cache.js';
|
|
13
15
|
import { routeSddTask } from '../router/route-sdd-task.js';
|
|
14
16
|
import { buildAgentExecutionRecord, buildTeamSessionRecord, writeAgentExecutionRecord, writeTeamSessionRecord } from '../execution/agent-execution-records.js';
|
|
15
17
|
import { runBackgroundExecutor } from '../execution/background-executor.js';
|
|
18
|
+
import { reconcileDoCollaborationClosure } from '../stage-collaboration.js';
|
|
16
19
|
|
|
17
20
|
export type SingleTaskLoopStatus = 'completed' | 'blocked' | 'failed';
|
|
18
21
|
|
|
@@ -44,7 +47,6 @@ export interface SingleTaskLoopResult {
|
|
|
44
47
|
gaps: SddTaskGap[];
|
|
45
48
|
requiredArtifacts: string[];
|
|
46
49
|
acceptedArtifacts: string[];
|
|
47
|
-
syncBackProposalPath: string;
|
|
48
50
|
routeDecision: AgentRouterDecision;
|
|
49
51
|
message: string;
|
|
50
52
|
}
|
|
@@ -53,21 +55,22 @@ export async function runSingleTaskLoop(projectRoot: string, options: SingleTask
|
|
|
53
55
|
const context = await resolveSddContext(projectRoot, options.branch ? { branch: options.branch, branchSource: 'cli_option' } : {});
|
|
54
56
|
const branch = context.partition;
|
|
55
57
|
const model = await parseSddBranch(projectRoot, branch);
|
|
56
|
-
const
|
|
58
|
+
const routeDecision = await routeSddTask(projectRoot, { taskId: options.taskId, branch, teamModeEnabled: options.teamModeEnabled, teamModeActivation: options.teamModeActivation, approved: options.approved });
|
|
59
|
+
const taskId = routeDecision.taskId;
|
|
60
|
+
const inspected = inspectSddTask(model, taskId);
|
|
57
61
|
const runState = options.runId ? await readRunState(projectRoot, options.runId) : await createRun(projectRoot);
|
|
58
|
-
const boundRunState = await bindRunStateToTask(projectRoot, runState, context, model, inspected.task ?? null,
|
|
62
|
+
const boundRunState = await bindRunStateToTask(projectRoot, runState, context, model, inspected.task ?? null, taskId);
|
|
59
63
|
const runId = boundRunState.runId;
|
|
60
|
-
const routeDecision = await routeSddTask(projectRoot, { taskId: options.taskId, branch, teamModeEnabled: options.teamModeEnabled, teamModeActivation: options.teamModeActivation, approved: options.approved });
|
|
61
64
|
await appendEvent(projectRoot, runId, {
|
|
62
65
|
event: 'agent_router_preflight',
|
|
63
66
|
runId,
|
|
64
|
-
summary: `Agent router preflight ${routeDecision.blockedReason ? 'blocked' : 'passed'} for ${
|
|
65
|
-
data: { taskId:
|
|
67
|
+
summary: `Agent router preflight ${routeDecision.blockedReason ? 'blocked' : 'passed'} for ${taskId}`,
|
|
68
|
+
data: { taskId: taskId, decision: routeDecision }
|
|
66
69
|
});
|
|
67
70
|
if (routeDecision.teamMode.enabled || routeDecision.teamMode.decision !== 'disabled') {
|
|
68
71
|
await writeTeamSessionRecord(projectRoot, buildTeamSessionRecord({
|
|
69
72
|
runId,
|
|
70
|
-
taskId:
|
|
73
|
+
taskId: taskId,
|
|
71
74
|
route: routeDecision,
|
|
72
75
|
status: routeDecision.teamMode.decision === 'enabled' ? 'created' : routeDecision.teamMode.decision === 'blocked' ? 'blocked' : 'disabled',
|
|
73
76
|
artifacts: [],
|
|
@@ -78,51 +81,57 @@ export async function runSingleTaskLoop(projectRoot: string, options: SingleTask
|
|
|
78
81
|
await appendEvent(projectRoot, runId, {
|
|
79
82
|
event: 'phase_started',
|
|
80
83
|
runId,
|
|
81
|
-
summary: `Phase 3.15 ingestion-aware task loop started for ${
|
|
82
|
-
data: { phase: 'do', branch, task:
|
|
84
|
+
summary: `Phase 3.15 ingestion-aware task loop started for ${taskId}`,
|
|
85
|
+
data: { phase: 'do', branch, task: taskId }
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
const stageEvidenceResult = await reconcileDoStageEvidenceIfAvailable(projectRoot, {
|
|
89
|
+
branch,
|
|
90
|
+
runId,
|
|
91
|
+
taskId: taskId,
|
|
92
|
+
task: inspected.task,
|
|
93
|
+
routeDecision,
|
|
94
|
+
options
|
|
83
95
|
});
|
|
96
|
+
if (stageEvidenceResult) {
|
|
97
|
+
return stageEvidenceResult;
|
|
98
|
+
}
|
|
84
99
|
|
|
85
100
|
if (routeDecision.blockedReason || routeDecision.toolPermission?.policy === 'deny' || !inspected.task || inspected.gaps.some((gap) => gap.severity === 'blocking')) {
|
|
86
|
-
const routeGap = routeDecision.blockedReason ? [taskGap(
|
|
87
|
-
const toolPermissionGap = routeDecision.toolPermission?.policy === 'deny' ? [taskGap(
|
|
101
|
+
const routeGap = routeDecision.blockedReason ? [taskGap(taskId, 'agent_router', routeDecision.blockedReason, routeDecision.nextAction)] : [];
|
|
102
|
+
const toolPermissionGap = routeDecision.toolPermission?.policy === 'deny' ? [taskGap(taskId, 'tool_permission', 'Agent router denied required tool permission for this task.', 'Change task scope, tool policy, or route through a permitted profile before execution.')] : [];
|
|
88
103
|
const allGaps = [...routeGap, ...toolPermissionGap, ...inspected.gaps];
|
|
89
|
-
const gapArtifact = await writeArtifact(projectRoot, runId, `gap-report-${options.taskId}.md`, renderLoopGapReport(options.taskId, allGaps));
|
|
90
|
-
const proposal = await writeSyncBackProposal(projectRoot, runId, options.taskId, 'blocked', [gapArtifact.runRelativePath], allGaps, 'Task selection is blocked by router preflight or parser/task gaps.');
|
|
91
104
|
await persistLoopState(projectRoot, runId, {
|
|
92
105
|
status: 'blocked',
|
|
93
106
|
phase: 'do',
|
|
94
|
-
taskId:
|
|
95
|
-
taskState:
|
|
107
|
+
taskId: taskId,
|
|
108
|
+
taskState: buildRuntimeTaskState(inspected.task, 'blocked', 'blocked', allGaps, []),
|
|
96
109
|
validationStatus: 'blocked',
|
|
97
|
-
|
|
98
|
-
syncBackProposalDigest: proposal.digest,
|
|
99
|
-
artifacts: [{ path: gapArtifact.runRelativePath, kind: 'gap-report', task: options.taskId, agent: 'runtime' }]
|
|
110
|
+
artifacts: []
|
|
100
111
|
});
|
|
101
112
|
await appendEvent(projectRoot, runId, {
|
|
102
113
|
event: 'gap_detected',
|
|
103
114
|
runId,
|
|
104
|
-
summary: `Task ${
|
|
105
|
-
data: { gaps: allGaps,
|
|
115
|
+
summary: `Task ${taskId} is blocked before implementation.`,
|
|
116
|
+
data: { gaps: allGaps, routeDecision }
|
|
106
117
|
});
|
|
107
118
|
await writeAgentExecutionRecord(projectRoot, buildAgentExecutionRecord({
|
|
108
119
|
runId,
|
|
109
|
-
taskId:
|
|
120
|
+
taskId: taskId,
|
|
110
121
|
agent: 'orchestrator',
|
|
111
122
|
route: routeDecision,
|
|
112
123
|
status: 'blocked',
|
|
113
|
-
delegationId: `P-${
|
|
114
|
-
artifactPath: gapArtifact.runRelativePath,
|
|
124
|
+
delegationId: `P-${taskId}-router-001`,
|
|
115
125
|
evidenceSummary: `Task loop blocked before implementation by router preflight or task gaps with ${allGaps.length} issue(s).`
|
|
116
126
|
}));
|
|
117
127
|
return {
|
|
118
128
|
runId,
|
|
119
|
-
taskId:
|
|
129
|
+
taskId: taskId,
|
|
120
130
|
status: 'blocked',
|
|
121
131
|
task: inspected.task,
|
|
122
132
|
gaps: allGaps,
|
|
123
133
|
requiredArtifacts: [],
|
|
124
|
-
acceptedArtifacts: [
|
|
125
|
-
syncBackProposalPath: proposal.runRelativePath,
|
|
134
|
+
acceptedArtifacts: [],
|
|
126
135
|
routeDecision,
|
|
127
136
|
message: 'Task loop blocked before implementation by router preflight or task gaps.'
|
|
128
137
|
};
|
|
@@ -131,52 +140,52 @@ export async function runSingleTaskLoop(projectRoot: string, options: SingleTask
|
|
|
131
140
|
await appendEvent(projectRoot, runId, {
|
|
132
141
|
event: 'task_selected',
|
|
133
142
|
runId,
|
|
134
|
-
summary: `Task selected for ingestion-aware task loop: ${
|
|
135
|
-
data: { task:
|
|
143
|
+
summary: `Task selected for ingestion-aware task loop: ${taskId}`,
|
|
144
|
+
data: { task: taskId, title: inspected.task.title, source: inspected.task.source }
|
|
136
145
|
});
|
|
137
146
|
|
|
138
|
-
const steps = buildLoopSteps(
|
|
147
|
+
const steps = buildLoopSteps(branch, taskId, options, inspected.task);
|
|
139
148
|
const acceptedArtifacts: string[] = [];
|
|
140
149
|
const gaps: SddTaskGap[] = [];
|
|
141
150
|
let terminalStatus: SingleTaskLoopStatus = 'completed';
|
|
142
|
-
let validationStatus: RunState['validation']['status'] = '
|
|
151
|
+
let validationStatus: RunState['validation']['status'] = 'not_run';
|
|
143
152
|
|
|
144
153
|
for (const step of steps) {
|
|
145
|
-
const stepRouteDecision = await routeSddTask(projectRoot, { taskId:
|
|
154
|
+
const stepRouteDecision = await routeSddTask(projectRoot, { taskId: taskId, branch, agent: step.agent, teamModeEnabled: options.teamModeEnabled, teamModeActivation: options.teamModeActivation, approved: options.approved });
|
|
146
155
|
if (!step.suppliedArtifact) {
|
|
147
156
|
if (!step.required) {
|
|
148
157
|
await appendEvent(projectRoot, runId, {
|
|
149
158
|
event: 'delegation_cancelled',
|
|
150
159
|
runId,
|
|
151
|
-
summary: `${step.agent} artifact not supplied; optional step skipped for ${
|
|
160
|
+
summary: `${step.agent} artifact not supplied; optional step skipped for ${taskId}`,
|
|
152
161
|
data: { agent: step.agent, expectedArtifact: step.expectedArtifact }
|
|
153
162
|
});
|
|
154
163
|
await writeAgentExecutionRecord(projectRoot, buildAgentExecutionRecord({
|
|
155
164
|
runId,
|
|
156
|
-
taskId:
|
|
165
|
+
taskId: taskId,
|
|
157
166
|
agent: step.agent,
|
|
158
167
|
route: stepRouteDecision,
|
|
159
168
|
status: 'skipped',
|
|
160
|
-
delegationId: `B-${
|
|
169
|
+
delegationId: `B-${taskId}-${step.agent}-001`,
|
|
161
170
|
evidenceSummary: `${step.agent} artifact was not supplied and the step is optional.`
|
|
162
171
|
}));
|
|
163
172
|
continue;
|
|
164
173
|
}
|
|
165
|
-
const gap = taskGap(
|
|
174
|
+
const gap = taskGap(taskId, step.agent, `${step.agent} artifact was not supplied; the task loop facade does not invoke external agents directly.`, `Run the ${step.agent} step in Claude Code and provide agent-authored evidence under .sdd/runs/<branch>/do/*.md before closing do-stage evidence.`);
|
|
166
175
|
gaps.push(gap);
|
|
167
176
|
await appendEvent(projectRoot, runId, {
|
|
168
177
|
event: 'delegation_failed',
|
|
169
178
|
runId,
|
|
170
|
-
summary: `${step.agent} artifact missing for ${
|
|
179
|
+
summary: `${step.agent} artifact missing for ${taskId}`,
|
|
171
180
|
data: { agent: step.agent, expectedArtifact: step.expectedArtifact }
|
|
172
181
|
});
|
|
173
182
|
await writeAgentExecutionRecord(projectRoot, buildAgentExecutionRecord({
|
|
174
183
|
runId,
|
|
175
|
-
taskId:
|
|
184
|
+
taskId: taskId,
|
|
176
185
|
agent: step.agent,
|
|
177
186
|
route: stepRouteDecision,
|
|
178
187
|
status: 'blocked',
|
|
179
|
-
delegationId: `B-${
|
|
188
|
+
delegationId: `B-${taskId}-${step.agent}-001`,
|
|
180
189
|
evidenceSummary: `${step.agent} artifact was not supplied; execution is blocked before host invocation.`
|
|
181
190
|
}));
|
|
182
191
|
terminalStatus = 'blocked';
|
|
@@ -187,19 +196,19 @@ export async function runSingleTaskLoop(projectRoot: string, options: SingleTask
|
|
|
187
196
|
const result = await runBackgroundExecutor(projectRoot, {
|
|
188
197
|
branch,
|
|
189
198
|
runId,
|
|
190
|
-
taskId:
|
|
199
|
+
taskId: taskId,
|
|
191
200
|
agent: step.agent,
|
|
192
201
|
artifactPath: step.suppliedArtifact,
|
|
193
|
-
delegationId: `B-${
|
|
202
|
+
delegationId: `B-${taskId}-${step.agent}-001`,
|
|
194
203
|
approved: options.approved
|
|
195
204
|
});
|
|
196
205
|
|
|
197
|
-
if (!result.ingestion || !result.ingestion.resultStatus) {
|
|
206
|
+
if (!result.ingestion || result.ingestion.status !== 'accepted' || !result.ingestion.resultStatus) {
|
|
198
207
|
const issueText = result.issues.map((issue) => issue.message).join('; ') || result.message;
|
|
199
208
|
const recommendation = issueText.includes('manual isolation gate') || issueText.includes('requires confirmation')
|
|
200
209
|
? 'Resolve the manual isolation or approval gate for this high-risk task before ingesting execution artifacts.'
|
|
201
|
-
: `Fix ${step.suppliedArtifact} so the Phase 3 executor can ingest one valid sdd-result block for ${step.agent}/${
|
|
202
|
-
gaps.push(taskGap(
|
|
210
|
+
: `Fix ${step.suppliedArtifact} so the Phase 3 executor can ingest one valid sdd-result block for ${step.agent}/${taskId}.`;
|
|
211
|
+
gaps.push(taskGap(taskId, step.agent, `${step.agent} artifact ${step.suppliedArtifact} could not be ingested: ${issueText}`, recommendation));
|
|
203
212
|
terminalStatus = 'blocked';
|
|
204
213
|
validationStatus = step.agent === 'validator' ? 'blocked' : validationStatus;
|
|
205
214
|
break;
|
|
@@ -209,11 +218,11 @@ export async function runSingleTaskLoop(projectRoot: string, options: SingleTask
|
|
|
209
218
|
|
|
210
219
|
if (step.agent === 'reviewer') {
|
|
211
220
|
if (result.ingestion.resultStatus === 'PASS') {
|
|
212
|
-
await appendEvent(projectRoot, runId, { event: 'review_passed', runId, summary: `Review passed for ${
|
|
221
|
+
await appendEvent(projectRoot, runId, { event: 'review_passed', runId, summary: `Review passed for ${taskId}`, data: { artifact: result.ingestion.artifactPath } });
|
|
213
222
|
} else {
|
|
214
|
-
await appendEvent(projectRoot, runId, { event: 'review_failed', runId, summary: `Review did not pass for ${
|
|
223
|
+
await appendEvent(projectRoot, runId, { event: 'review_failed', runId, summary: `Review did not pass for ${taskId}; debugger may be supplied once.`, data: { artifact: result.ingestion.artifactPath, status: result.ingestion.resultStatus } });
|
|
215
224
|
if (!options.debugArtifact) {
|
|
216
|
-
gaps.push(taskGap(
|
|
225
|
+
gaps.push(taskGap(taskId, 'debugger', 'Review did not pass and no debugger artifact was supplied.', 'Run one debugger attempt or create a gap report; the task loop allows only one debugger pass.'));
|
|
217
226
|
terminalStatus = result.ingestion.resultStatus === 'BLOCKED' ? 'blocked' : 'failed';
|
|
218
227
|
validationStatus = 'fail';
|
|
219
228
|
break;
|
|
@@ -223,16 +232,16 @@ export async function runSingleTaskLoop(projectRoot: string, options: SingleTask
|
|
|
223
232
|
|
|
224
233
|
if (step.agent === 'validator') {
|
|
225
234
|
if (result.ingestion.resultStatus === 'PASS') {
|
|
226
|
-
await appendEvent(projectRoot, runId, { event: 'validation_passed', runId, summary: `Validation passed for ${
|
|
235
|
+
await appendEvent(projectRoot, runId, { event: 'validation_passed', runId, summary: `Validation passed for ${taskId}`, data: { artifact: result.ingestion.artifactPath } });
|
|
227
236
|
validationStatus = 'pass';
|
|
228
237
|
} else if (result.ingestion.resultStatus === 'PASS_WITH_GAPS') {
|
|
229
|
-
await appendEvent(projectRoot, runId, { event: 'validation_passed', runId, summary: `Validation passed with gaps for ${
|
|
230
|
-
gaps.push(taskGap(
|
|
238
|
+
await appendEvent(projectRoot, runId, { event: 'validation_passed', runId, summary: `Validation passed with gaps for ${taskId}; task remains blocked until gaps are resolved.`, data: { artifact: result.ingestion.artifactPath, status: result.ingestion.resultStatus } });
|
|
239
|
+
gaps.push(taskGap(taskId, 'validation_gaps', 'Validator returned PASS_WITH_GAPS; the task loop cannot mark the task completed without structured gap evidence.', 'Inspect the validator artifact, resolve or defer each validation gap, then rerun with PASS validation evidence.'));
|
|
231
240
|
validationStatus = 'pass_with_gaps';
|
|
232
241
|
terminalStatus = 'blocked';
|
|
233
242
|
} else {
|
|
234
|
-
await appendEvent(projectRoot, runId, { event: 'validation_failed', runId, summary: `Validation failed for ${
|
|
235
|
-
gaps.push(taskGap(
|
|
243
|
+
await appendEvent(projectRoot, runId, { event: 'validation_failed', runId, summary: `Validation failed for ${taskId}`, data: { artifact: result.ingestion.artifactPath, status: result.ingestion.resultStatus } });
|
|
244
|
+
gaps.push(taskGap(taskId, 'validation', `Validator returned ${result.ingestion.resultStatus}.`, 'Do not mark the task completed; create a gap report or revise the task/plan.'));
|
|
236
245
|
validationStatus = result.ingestion.resultStatus === 'BLOCKED' ? 'blocked' : 'fail';
|
|
237
246
|
terminalStatus = result.ingestion.resultStatus === 'BLOCKED' ? 'blocked' : 'failed';
|
|
238
247
|
}
|
|
@@ -240,43 +249,37 @@ export async function runSingleTaskLoop(projectRoot: string, options: SingleTask
|
|
|
240
249
|
}
|
|
241
250
|
|
|
242
251
|
if (gaps.length > 0 && terminalStatus !== 'completed') {
|
|
243
|
-
const
|
|
244
|
-
|
|
252
|
+
const gapFileName = `gap-report-${taskId}.md`;
|
|
253
|
+
await writeArtifact(projectRoot, runId, gapFileName, renderLoopGapReport(branch, taskId, gaps));
|
|
254
|
+
const gapRef = toBranchStageEvidenceRef(branch, 'do', gapFileName);
|
|
255
|
+
acceptedArtifacts.push(gapRef);
|
|
245
256
|
await appendEvent(projectRoot, runId, {
|
|
246
257
|
event: 'gap_created',
|
|
247
258
|
runId,
|
|
248
|
-
summary: `Gap report created for ${
|
|
249
|
-
data: { artifact:
|
|
259
|
+
summary: `Gap report created for ${taskId}`,
|
|
260
|
+
data: { artifact: gapRef, gaps }
|
|
250
261
|
});
|
|
251
262
|
}
|
|
252
263
|
|
|
253
|
-
const
|
|
264
|
+
const taskState = buildRuntimeTaskState(inspected.task, terminalStatus, validationStatus, gaps, acceptedArtifacts);
|
|
254
265
|
await persistLoopState(projectRoot, runId, {
|
|
255
266
|
status: terminalStatus,
|
|
256
267
|
phase: 'do',
|
|
257
|
-
taskId:
|
|
258
|
-
taskState
|
|
268
|
+
taskId: taskId,
|
|
269
|
+
taskState,
|
|
259
270
|
validationStatus,
|
|
260
|
-
|
|
261
|
-
syncBackProposalDigest: proposal.digest,
|
|
262
|
-
artifacts: acceptedArtifacts.map((artifactPath) => ({ path: artifactPath, kind: artifactKind(artifactPath), task: options.taskId, agent: agentFromArtifactPath(artifactPath) }))
|
|
263
|
-
});
|
|
264
|
-
await appendEvent(projectRoot, runId, {
|
|
265
|
-
event: 'sync_back_proposed',
|
|
266
|
-
runId,
|
|
267
|
-
summary: `Sync-back proposal created for ${options.taskId}`,
|
|
268
|
-
data: { proposal: proposal.runRelativePath, status: terminalStatus }
|
|
271
|
+
artifacts: acceptedArtifacts.map((artifactPath) => ({ path: artifactPath, kind: artifactKind(artifactPath), task: taskId, agent: agentFromArtifactPath(artifactPath) }))
|
|
269
272
|
});
|
|
270
273
|
await appendEvent(projectRoot, runId, {
|
|
271
274
|
event: terminalStatus === 'completed' ? 'run_completed' : terminalStatus === 'blocked' ? 'gap_escalated' : 'validation_failed',
|
|
272
275
|
runId,
|
|
273
|
-
summary: `Phase 3.15 ingestion-aware task loop ${terminalStatus} for ${
|
|
274
|
-
data: { task:
|
|
276
|
+
summary: `Phase 3.15 ingestion-aware task loop ${terminalStatus} for ${taskId}`,
|
|
277
|
+
data: { task: taskId, artifacts: acceptedArtifacts, gaps }
|
|
275
278
|
});
|
|
276
279
|
if (routeDecision.teamMode.enabled || routeDecision.teamMode.decision !== 'disabled') {
|
|
277
280
|
await writeTeamSessionRecord(projectRoot, buildTeamSessionRecord({
|
|
278
281
|
runId,
|
|
279
|
-
taskId:
|
|
282
|
+
taskId: taskId,
|
|
280
283
|
route: routeDecision,
|
|
281
284
|
status: terminalStatus === 'completed' ? 'completed' : 'blocked',
|
|
282
285
|
artifacts: acceptedArtifacts,
|
|
@@ -286,38 +289,174 @@ export async function runSingleTaskLoop(projectRoot: string, options: SingleTask
|
|
|
286
289
|
|
|
287
290
|
return {
|
|
288
291
|
runId,
|
|
289
|
-
taskId:
|
|
292
|
+
taskId: taskId,
|
|
290
293
|
status: terminalStatus,
|
|
291
294
|
task: inspected.task,
|
|
292
295
|
gaps,
|
|
293
296
|
requiredArtifacts: steps.map((step) => step.expectedArtifact),
|
|
294
297
|
acceptedArtifacts,
|
|
295
|
-
syncBackProposalPath: proposal.runRelativePath,
|
|
296
298
|
routeDecision,
|
|
297
|
-
message: terminalStatus === 'completed' ? 'Task loop completed through Phase 3 executor artifact ingestion.' : validationStatus === 'pass_with_gaps' ? 'Task loop blocked because validator returned PASS_WITH_GAPS; inspect gap report and
|
|
299
|
+
message: terminalStatus === 'completed' ? 'Task loop completed through Phase 3 executor artifact ingestion.' : validationStatus === 'pass_with_gaps' ? 'Task loop blocked because validator returned PASS_WITH_GAPS; inspect gap report and stage runtime metadata.' : 'Task loop stopped; inspect gap report and stage runtime metadata.'
|
|
298
300
|
};
|
|
299
301
|
}
|
|
300
302
|
|
|
301
|
-
function
|
|
303
|
+
async function reconcileDoStageEvidenceIfAvailable(projectRoot: string, input: { branch: string; runId: string; taskId: string; task: SddTask | null; routeDecision: AgentRouterDecision; options: SingleTaskLoopOptions }): Promise<SingleTaskLoopResult | null> {
|
|
304
|
+
if (input.options.implementArtifact || input.options.reviewArtifact || input.options.validationArtifact || input.options.debugArtifact || input.routeDecision.blockedReason) {
|
|
305
|
+
return null;
|
|
306
|
+
}
|
|
307
|
+
const decision = await resolveDoLifecycleDecision(projectRoot, input.branch);
|
|
308
|
+
if (!decision) {
|
|
309
|
+
return null;
|
|
310
|
+
}
|
|
311
|
+
const result = await reconcileDoCollaborationClosure(projectRoot, {
|
|
312
|
+
decision,
|
|
313
|
+
runId: input.runId,
|
|
314
|
+
allowedChangedFileRefs: input.task?.affectedFiles ?? []
|
|
315
|
+
});
|
|
316
|
+
const health = result.adjudication.health;
|
|
317
|
+
const status: SingleTaskLoopStatus = doStageLoopStatus(health, result.adjudication.rejection?.reasonCode ?? null);
|
|
318
|
+
const gaps = status === 'completed' ? [] : [taskGap(input.taskId, 'do-stage-runtime', result.adjudication.rejection?.explanation ?? `Do-stage reconciliation returned ${health}.`, result.adjudication.rejection?.requiredNextAction ?? 'Inspect .sdd/runs/<branch>/do/*.md frontmatter, hashes, review verdict, and manager closure recommendation.')];
|
|
319
|
+
const acceptedArtifacts = result.artifactRefs.map((ref) => ref.ref);
|
|
320
|
+
const validationStatus: RunState['validation']['status'] = status === 'completed' ? 'not_run' : status === 'blocked' ? 'blocked' : 'fail';
|
|
321
|
+
const state = await readRunState(projectRoot, result.runId);
|
|
322
|
+
const createdAt = new Date().toISOString();
|
|
323
|
+
await writeRunState(projectRoot, {
|
|
324
|
+
...state,
|
|
325
|
+
status,
|
|
326
|
+
phase: 'do',
|
|
327
|
+
currentTask: input.taskId,
|
|
328
|
+
taskId: input.taskId,
|
|
329
|
+
tasks: {
|
|
330
|
+
...state.tasks,
|
|
331
|
+
[input.taskId]: buildRuntimeTaskState(input.task, status, validationStatus, gaps, acceptedArtifacts)
|
|
332
|
+
},
|
|
333
|
+
artifacts: acceptedArtifacts.map((artifactPath) => ({ path: artifactPath, kind: artifactKind(artifactPath), task: input.taskId, agent: agentFromStageEvidenceRef(artifactPath), createdAt })),
|
|
334
|
+
validation: {
|
|
335
|
+
...state.validation,
|
|
336
|
+
status: validationStatus
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
await appendEvent(projectRoot, result.runId, {
|
|
340
|
+
event: 'stage_collaboration_reconciled',
|
|
341
|
+
runId: result.runId,
|
|
342
|
+
summary: `Do-stage evidence reconciliation ${status} for ${input.taskId}.`,
|
|
343
|
+
data: { health, artifactRefs: acceptedArtifacts, projectionRef: result.projectionRef }
|
|
344
|
+
});
|
|
345
|
+
return {
|
|
346
|
+
runId: result.runId,
|
|
347
|
+
taskId: input.taskId,
|
|
348
|
+
status,
|
|
349
|
+
task: input.task,
|
|
350
|
+
gaps,
|
|
351
|
+
requiredArtifacts: ['.sdd/runs/<branch>/do/implementation-vN.md', '.sdd/runs/<branch>/do/code-review-vN.md', '.sdd/runs/<branch>/do/do-manager-vN.md'],
|
|
352
|
+
acceptedArtifacts,
|
|
353
|
+
routeDecision: input.routeDecision,
|
|
354
|
+
message: status === 'completed' ? 'Task loop completed through do-stage runtime reconciliation over .sdd/runs/<branch>/do/*.md evidence.' : 'Task loop stopped after do-stage runtime reconciliation; inspect stage collaboration rejection metadata.'
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
function doStageLoopStatus(health: string, reasonCode: string | null): SingleTaskLoopStatus {
|
|
359
|
+
if (health === 'ready_for_test') {
|
|
360
|
+
return 'completed';
|
|
361
|
+
}
|
|
362
|
+
if (health === 'blocked' || reasonCode === 'missing_refs') {
|
|
363
|
+
return 'blocked';
|
|
364
|
+
}
|
|
365
|
+
return 'failed';
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
async function resolveDoLifecycleDecision(projectRoot: string, branch: string): Promise<LifecycleRiskDecision | null> {
|
|
370
|
+
const existing = await readLifecycleRiskDecisionProjection(projectRoot, { branch });
|
|
371
|
+
return existing?.payload ?? null;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
function agentFromStageEvidenceRef(ref: string): string {
|
|
375
|
+
const fileName = ref.split('/').pop() ?? ref;
|
|
376
|
+
if (fileName.startsWith('implementation-')) {
|
|
377
|
+
return 'implementer';
|
|
378
|
+
}
|
|
379
|
+
if (fileName.startsWith('code-review-')) {
|
|
380
|
+
return 'reviewer';
|
|
381
|
+
}
|
|
382
|
+
if (fileName.startsWith('do-manager-')) {
|
|
383
|
+
return 'do-manager';
|
|
384
|
+
}
|
|
385
|
+
return 'stage-agent';
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
function buildLoopSteps(branch: string, taskId: string, options: SingleTaskLoopOptions, task: SddTask | null): LoopAgentStep[] {
|
|
302
389
|
const steps: LoopAgentStep[] = [
|
|
303
|
-
{ agent: 'implementer', suppliedArtifact: options.implementArtifact, expectedArtifact: `
|
|
304
|
-
{ agent: 'reviewer', suppliedArtifact: options.reviewArtifact, expectedArtifact: `
|
|
390
|
+
{ agent: 'implementer', suppliedArtifact: options.implementArtifact, expectedArtifact: toBranchStageEvidenceRef(branch, 'do', `implementation-${taskId}.md`), required: false },
|
|
391
|
+
{ agent: 'reviewer', suppliedArtifact: options.reviewArtifact, expectedArtifact: toBranchStageEvidenceRef(branch, 'do', `code-review-${taskId}.md`), required: true }
|
|
305
392
|
];
|
|
306
393
|
if (options.debugArtifact) {
|
|
307
|
-
steps.push({ agent: 'debugger', suppliedArtifact: options.debugArtifact, expectedArtifact: `
|
|
394
|
+
steps.push({ agent: 'debugger', suppliedArtifact: options.debugArtifact, expectedArtifact: toBranchStageEvidenceRef(branch, 'do', `debug-${taskId}.md`), required: false });
|
|
308
395
|
}
|
|
309
|
-
steps.push({ agent: 'validator', suppliedArtifact: options.validationArtifact, expectedArtifact: `
|
|
396
|
+
steps.push({ agent: 'validator', suppliedArtifact: options.validationArtifact, expectedArtifact: toBranchStageEvidenceRef(branch, 'test', `validation-${taskId}.md`), required: requiresImmediateValidation(task) });
|
|
310
397
|
return steps;
|
|
311
398
|
}
|
|
312
399
|
|
|
400
|
+
function requiresImmediateValidation(task: SddTask | null): boolean {
|
|
401
|
+
return !task || task.requiresVerifyBeforeNext || task.validationTiming === 'task_end';
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
function buildRuntimeTaskState(task: SddTask | null, status: SingleTaskLoopStatus, validationStatus: RunState['validation']['status'], gaps: SddTaskGap[], artifacts: string[]): RunStateTaskRuntime {
|
|
405
|
+
const implementationStatus: NonNullable<RunStateTaskRuntime['implementationStatus']> = status === 'completed' ? 'implemented' : status === 'blocked' ? 'blocked' : 'failed';
|
|
406
|
+
const verificationStatus: NonNullable<RunStateTaskRuntime['verificationStatus']> = verificationStatusForLoop(task, status, validationStatus);
|
|
407
|
+
return {
|
|
408
|
+
status: runtimeTaskStatus(implementationStatus, verificationStatus),
|
|
409
|
+
implementationStatus,
|
|
410
|
+
verificationStatus,
|
|
411
|
+
validationBatch: task?.validationBatch ?? null,
|
|
412
|
+
validationTiming: task?.validationTiming ?? 'task_end',
|
|
413
|
+
requiresVerifyBeforeNext: task?.requiresVerifyBeforeNext ?? true,
|
|
414
|
+
gaps,
|
|
415
|
+
artifacts
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
function verificationStatusForLoop(task: SddTask | null, status: SingleTaskLoopStatus, validationStatus: RunState['validation']['status']): NonNullable<RunStateTaskRuntime['verificationStatus']> {
|
|
420
|
+
if (validationStatus === 'pass') {
|
|
421
|
+
return 'pass';
|
|
422
|
+
}
|
|
423
|
+
if (validationStatus === 'pass_with_gaps') {
|
|
424
|
+
return 'pass_with_gaps';
|
|
425
|
+
}
|
|
426
|
+
if (validationStatus === 'blocked') {
|
|
427
|
+
return 'blocked';
|
|
428
|
+
}
|
|
429
|
+
if (validationStatus === 'fail') {
|
|
430
|
+
return 'failed';
|
|
431
|
+
}
|
|
432
|
+
if (status !== 'completed') {
|
|
433
|
+
return status === 'failed' ? 'failed' : 'blocked';
|
|
434
|
+
}
|
|
435
|
+
return task && !requiresImmediateValidation(task) ? 'pending_batch' : 'not_run';
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
function runtimeTaskStatus(implementationStatus: NonNullable<RunStateTaskRuntime['implementationStatus']>, verificationStatus: NonNullable<RunStateTaskRuntime['verificationStatus']>): string {
|
|
439
|
+
if (implementationStatus === 'implemented' && verificationStatus === 'pending_batch') {
|
|
440
|
+
return 'implemented_pending_validation';
|
|
441
|
+
}
|
|
442
|
+
if (implementationStatus === 'implemented' && verificationStatus === 'pass') {
|
|
443
|
+
return 'implemented_verified';
|
|
444
|
+
}
|
|
445
|
+
if (verificationStatus === 'pass_with_gaps' || verificationStatus === 'blocked') {
|
|
446
|
+
return 'validation_blocked';
|
|
447
|
+
}
|
|
448
|
+
if (implementationStatus === 'failed' || verificationStatus === 'failed') {
|
|
449
|
+
return 'failed';
|
|
450
|
+
}
|
|
451
|
+
return implementationStatus;
|
|
452
|
+
}
|
|
453
|
+
|
|
313
454
|
async function persistLoopState(projectRoot: string, runId: string, input: {
|
|
314
455
|
status: SingleTaskLoopStatus;
|
|
315
456
|
phase: string;
|
|
316
457
|
taskId: string;
|
|
317
|
-
taskState:
|
|
458
|
+
taskState: RunStateTaskRuntime;
|
|
318
459
|
validationStatus: RunState['validation']['status'];
|
|
319
|
-
syncBackProposalPath: string;
|
|
320
|
-
syncBackProposalDigest: string;
|
|
321
460
|
artifacts: Array<{ path: string; kind: string; task: string; agent: string }>;
|
|
322
461
|
}): Promise<void> {
|
|
323
462
|
const state = await readRunState(projectRoot, runId);
|
|
@@ -340,42 +479,16 @@ async function persistLoopState(projectRoot: string, runId: string, input: {
|
|
|
340
479
|
...state.validation,
|
|
341
480
|
status: input.validationStatus,
|
|
342
481
|
evidence: input.artifacts.filter((artifact) => artifact.kind === 'validation').map((artifact) => artifact.path)
|
|
343
|
-
},
|
|
344
|
-
syncBack: {
|
|
345
|
-
mode: 'proposal',
|
|
346
|
-
proposalPath: input.syncBackProposalPath,
|
|
347
|
-
proposalDigest: input.syncBackProposalDigest,
|
|
348
|
-
sourceVerifyStatus: input.status,
|
|
349
|
-
status: state.syncBack.status === 'applied' ? 'applied' : 'proposed'
|
|
350
482
|
}
|
|
351
483
|
});
|
|
352
484
|
}
|
|
353
485
|
|
|
354
|
-
async function writeSyncBackProposal(projectRoot: string, runId: string, taskId: string, status: string, artifacts: string[], gaps: SddTaskGap[], summary: string): Promise<{ absolutePath: string; runRelativePath: string; digest: string }> {
|
|
355
|
-
const content = `# Sync-back Proposal\n\n## ${taskId}\n\n- status: ${status}\n- summary: ${summary}\n- artifacts:\n${artifacts.length > 0 ? artifacts.map((artifact) => ` - ${artifact}`).join('\n') : ' - none'}\n- gaps:\n${gaps.length > 0 ? gaps.map((gap) => ` - [${gap.severity}] ${gap.type} ${gap.field}: ${gap.message}`).join('\n') : ' - none'}\n\n## Boundaries\n\n- Proposal only; tasks.md/spec.md/plan.md were not modified by runtime.\n- Runtime modeled agent/verify steps through supplied artifacts and contract validation; no external agent API was invoked.\n`;
|
|
356
|
-
const written = await writeArtifact(projectRoot, runId, 'sync-back-proposal.md', content);
|
|
357
|
-
return { ...written, digest: hashDocumentContent(content) };
|
|
358
|
-
}
|
|
359
486
|
|
|
360
|
-
function renderLoopGapReport(taskId: string, gaps: SddTaskGap[]): string {
|
|
361
|
-
|
|
487
|
+
function renderLoopGapReport(branch: string, taskId: string, gaps: SddTaskGap[]): string {
|
|
488
|
+
const gapRef = toBranchStageEvidenceRef(branch, 'do', `gap-report-${taskId}.md`);
|
|
489
|
+
return `# Gap Report ${taskId}\n\n\`\`\`sdd-result\ncontract: ${SDD_RESULT_CONTRACT}\nversion: ${SDD_RESULT_VERSION}\nagent: runtime\ntask: ${taskId}\nstatus: BLOCKED\nartifacts:\n - ${gapRef}\n\`\`\`\n\n## Gaps\n\n${gaps.length > 0 ? gaps.map((gap) => `- [${gap.severity}] ${gap.type} ${gap.field}: ${gap.message} Recommendation: ${gap.recommendation}`).join('\n') : '- No structured gaps were provided; inspect task selection and supplied stage evidence.'}\n`;
|
|
362
490
|
}
|
|
363
491
|
|
|
364
|
-
function artifactOptionName(agent: string): string {
|
|
365
|
-
if (agent === 'implementer') {
|
|
366
|
-
return '--implement-artifact';
|
|
367
|
-
}
|
|
368
|
-
if (agent === 'reviewer') {
|
|
369
|
-
return '--review-artifact';
|
|
370
|
-
}
|
|
371
|
-
if (agent === 'debugger') {
|
|
372
|
-
return '--debug-artifact';
|
|
373
|
-
}
|
|
374
|
-
if (agent === 'validator') {
|
|
375
|
-
return '--validation-artifact';
|
|
376
|
-
}
|
|
377
|
-
return '--artifact';
|
|
378
|
-
}
|
|
379
492
|
|
|
380
493
|
function agentFromArtifactPath(artifactPath: string): string {
|
|
381
494
|
const kind = artifactKind(artifactPath);
|
|
@@ -385,12 +498,9 @@ function agentFromArtifactPath(artifactPath: string): string {
|
|
|
385
498
|
if (kind === 'review' || kind === 'validation' || kind === 'debug') {
|
|
386
499
|
return kind === 'debug' ? 'debugger' : kind === 'review' ? 'reviewer' : 'validator';
|
|
387
500
|
}
|
|
388
|
-
if (kind === 'gap-report'
|
|
501
|
+
if (kind === 'gap-report') {
|
|
389
502
|
return 'runtime';
|
|
390
503
|
}
|
|
391
504
|
return 'unknown';
|
|
392
505
|
}
|
|
393
506
|
|
|
394
|
-
function hashDocumentContent(raw: string): string {
|
|
395
|
-
return createHash('sha256').update(raw).digest('hex');
|
|
396
|
-
}
|