sdd-agent-platform 0.4.1 → 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 +30 -28
- package/node_modules/@sdd-agent-platform/core/dist/ai-tools.js +67 -69
- 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 +12 -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 +12 -25
- 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 +2 -1
- package/node_modules/@sdd-agent-platform/core/dist/contracts.js +1 -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 +4 -4
- 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 +178 -58
- package/node_modules/@sdd-agent-platform/core/dist/doctor/doctor.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.js +14 -7
- package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/evidence-runtime/contracts.d.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/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 +3 -2
- 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.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/execution/stage-team-runtime.js.map +1 -1
- 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 +54 -61
- 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 +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.js +24 -8
- 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 +5 -2
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.js +69 -27
- 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 +15 -15
- 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.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-runtime-static.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/capability-sources.js +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 +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime-config.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime.d.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.js +1 -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 +45 -15
- 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-validation.js +2 -2
- 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 +126 -9
- 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/inspect-run.d.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.js +7 -5
- 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/model.d.ts +28 -8
- 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 +37 -27
- 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 +5 -2
- package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.js +53 -14
- package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/timing.d.ts +8 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/timing.js +131 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/timing.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state.d.ts +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state.js +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/runtime-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 +10 -0
- package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.js +65 -0
- package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/runtime-projection-p0.d.ts +64 -0
- package/node_modules/@sdd-agent-platform/core/dist/runtime-projection-p0.js +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/document-hashes.d.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.js +97 -10
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.js.map +1 -1
- 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 +8 -6
- 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 +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.js +55 -34
- 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 +44 -1
- package/node_modules/@sdd-agent-platform/core/dist/status/project-status.js +170 -23
- package/node_modules/@sdd-agent-platform/core/dist/status/project-status.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.d.ts +170 -18
- package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.js +544 -32
- 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 +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 +8 -23
- 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 +28 -53
- 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 +10 -50
- package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.d.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.js +159 -150
- 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 +12 -2
- package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.js +238 -103
- 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 +18 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.js +27 -5
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.js +9 -32
- package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.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.js +228 -15
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.js +49 -15
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.js +42 -6
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/types.d.ts +4 -5
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.d.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.js +1 -2
- 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.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.d.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.js +72 -6
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/migration-recovery.d.ts +40 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/migration-recovery.js +110 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/migration-recovery.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/repair-contract.d.ts +12 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/repair-contract.js +63 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/repair-contract.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve-task-run.d.ts +21 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve-task-run.js +95 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve-task-run.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.d.ts +55 -5
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.js +538 -34
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/runtime-projections.d.ts +228 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/runtime-projections.js +452 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/runtime-projections.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/package.json +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 +67 -69
- 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 +2 -2
- 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 +43 -31
- package/node_modules/@sdd-agent-platform/core/src/config/init-project.ts +14 -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 +12 -25
- 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 +2 -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 +4 -4
- 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 +143 -45
- package/node_modules/@sdd-agent-platform/core/src/doctor/doctor.ts +193 -58
- package/node_modules/@sdd-agent-platform/core/src/evidence/lookup.ts +15 -7
- package/node_modules/@sdd-agent-platform/core/src/evidence-runtime/contracts.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/src/execution/background-executor.test.ts +50 -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 +12 -1
- package/node_modules/@sdd-agent-platform/core/src/execution/resident-worker.ts +3 -2
- package/node_modules/@sdd-agent-platform/core/src/execution/stage-team-runtime.test.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/execution/stage-team-runtime.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/execution/wave-executor.test.ts +10 -0
- package/node_modules/@sdd-agent-platform/core/src/governance/policy.test.ts +8 -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 +33 -18
- package/node_modules/@sdd-agent-platform/core/src/instructions.ts +55 -62
- 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 +25 -8
- 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 +2 -3
- package/node_modules/@sdd-agent-platform/core/src/phase8-risk-kernel.test.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-capability-catalog.ts +82 -35
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-registry.ts +15 -15
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-runtime-static.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/registries/capability-sources.ts +1 -1
- 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 +18 -2
- 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 +1 -1
- package/node_modules/@sdd-agent-platform/core/src/router/agent-runtime.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/router/route-projection.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/router/route-sdd-task.test.ts +241 -4
- package/node_modules/@sdd-agent-platform/core/src/router/routing.ts +47 -15
- package/node_modules/@sdd-agent-platform/core/src/router/runtime-import.ts +453 -0
- package/node_modules/@sdd-agent-platform/core/src/router/runtime-validation.ts +2 -2
- 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 +132 -10
- package/node_modules/@sdd-agent-platform/core/src/run-state/inspect-run.ts +7 -7
- package/node_modules/@sdd-agent-platform/core/src/run-state/model.ts +31 -8
- 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 +50 -2
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-state.ts +39 -29
- package/node_modules/@sdd-agent-platform/core/src/run-state/task-evidence.ts +62 -16
- 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 +1 -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 +77 -0
- 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/document-hashes.ts +109 -10
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/run-binding.ts +8 -6
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.test.ts +123 -1
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.ts +58 -43
- 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 +249 -23
- package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.test.ts +196 -4
- package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.ts +860 -54
- 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 +1 -1
- package/node_modules/@sdd-agent-platform/core/src/test-support/run-state.ts +9 -23
- 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 +27 -56
- package/node_modules/@sdd-agent-platform/core/src/verification/rendering.ts +10 -54
- package/node_modules/@sdd-agent-platform/core/src/verification/review-gate.test.ts +8 -1
- package/node_modules/@sdd-agent-platform/core/src/verification/single-task-loop.test.ts +93 -79
- package/node_modules/@sdd-agent-platform/core/src/verification/single-task-loop.ts +166 -154
- package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.test.ts +100 -47
- package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.ts +265 -107
- 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 +47 -5
- package/node_modules/@sdd-agent-platform/core/src/verification/validation-wave.ts +48 -5
- package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.test.ts +15 -31
- package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.ts +9 -33
- 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 +246 -17
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.test.ts +339 -3
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.ts +53 -14
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.test.ts +45 -8
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.ts +45 -6
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/types.ts +6 -5
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/affected-file-conflicts.ts +1 -3
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/dependencies.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/latest-eligible-run.ts +75 -7
- 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 +518 -25
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve.ts +670 -41
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/runtime-projections.ts +712 -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 +68 -2
- package/packages/cli/dist/commands/status.js.map +1 -1
- package/packages/cli/dist/commands/test.js +180 -2
- package/packages/cli/dist/commands/test.js.map +1 -1
- package/packages/cli/dist/commands/verifies.js +7 -5
- package/packages/cli/dist/commands/verifies.js.map +1 -1
- package/packages/cli/dist/commands/verify.js +222 -26
- 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 +27 -26
- 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 +20 -0
- package/packages/cli/dist/renderers/registry-runtime.js.map +1 -1
- package/packages/cli/dist/renderers/router.js +1 -1
- 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 +30 -89
- 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 +67 -69
- 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 +12 -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 +12 -25
- 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 +2 -1
- package/packages/core/dist/contracts.js +1 -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 +4 -4
- 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 +178 -58
- package/packages/core/dist/doctor/doctor.js.map +1 -1
- package/packages/core/dist/evidence/lookup.js +14 -7
- package/packages/core/dist/evidence/lookup.js.map +1 -1
- package/packages/core/dist/evidence-runtime/contracts.d.ts +0 -1
- package/packages/core/dist/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 +3 -2
- package/packages/core/dist/execution/resident-worker.js.map +1 -1
- package/packages/core/dist/execution/stage-team-runtime.js +2 -2
- package/packages/core/dist/execution/stage-team-runtime.js.map +1 -1
- 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 +54 -61
- 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 +1 -0
- package/packages/core/dist/lifecycle/ship.js +24 -8
- 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 +5 -2
- package/packages/core/dist/registries/agent-capability-catalog.js +69 -27
- package/packages/core/dist/registries/agent-capability-catalog.js.map +1 -1
- package/packages/core/dist/registries/agent-registry.js +15 -15
- package/packages/core/dist/registries/agent-registry.js.map +1 -1
- package/packages/core/dist/registries/agent-runtime-static.js +1 -1
- package/packages/core/dist/registries/agent-runtime-static.js.map +1 -1
- package/packages/core/dist/registries/capability-sources.js +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 +1 -1
- package/packages/core/dist/router/agent-runtime-config.js.map +1 -1
- package/packages/core/dist/router/agent-runtime.d.ts +2 -0
- package/packages/core/dist/router/route-projection.js +1 -1
- package/packages/core/dist/router/route-projection.js.map +1 -1
- package/packages/core/dist/router/routing.js +45 -15
- 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-validation.js +2 -2
- 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 +126 -9
- package/packages/core/dist/run-state/artifacts.js.map +1 -1
- package/packages/core/dist/run-state/inspect-run.d.ts +0 -2
- package/packages/core/dist/run-state/inspect-run.js +7 -5
- package/packages/core/dist/run-state/inspect-run.js.map +1 -1
- package/packages/core/dist/run-state/model.d.ts +28 -8
- 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 +37 -27
- package/packages/core/dist/run-state/run-state.js.map +1 -1
- package/packages/core/dist/run-state/task-evidence.d.ts +5 -2
- package/packages/core/dist/run-state/task-evidence.js +53 -14
- package/packages/core/dist/run-state/task-evidence.js.map +1 -1
- package/packages/core/dist/run-state/timing.d.ts +8 -0
- package/packages/core/dist/run-state/timing.js +131 -0
- package/packages/core/dist/run-state/timing.js.map +1 -0
- package/packages/core/dist/run-state.d.ts +1 -0
- package/packages/core/dist/run-state.js +1 -0
- package/packages/core/dist/run-state.js.map +1 -1
- package/packages/core/dist/runtime-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 +10 -0
- package/packages/core/dist/runtime-paths.js +65 -0
- package/packages/core/dist/runtime-paths.js.map +1 -1
- package/packages/core/dist/runtime-projection-p0.d.ts +64 -0
- package/packages/core/dist/runtime-projection-p0.js +200 -0
- package/packages/core/dist/runtime-projection-p0.js.map +1 -0
- package/packages/core/dist/sdd-docs/document-hashes.d.ts +2 -0
- package/packages/core/dist/sdd-docs/document-hashes.js +97 -10
- package/packages/core/dist/sdd-docs/document-hashes.js.map +1 -1
- package/packages/core/dist/sdd-docs/run-binding.d.ts +1 -1
- package/packages/core/dist/sdd-docs/run-binding.js +8 -6
- package/packages/core/dist/sdd-docs/run-binding.js.map +1 -1
- package/packages/core/dist/sdd-docs/task-parser.d.ts +1 -0
- package/packages/core/dist/sdd-docs/task-parser.js +55 -34
- 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 +44 -1
- package/packages/core/dist/status/project-status.js +170 -23
- package/packages/core/dist/status/project-status.js.map +1 -1
- package/packages/core/dist/storage/runtime-store.d.ts +170 -18
- package/packages/core/dist/storage/runtime-store.js +544 -32
- 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 +1 -1
- package/packages/core/dist/test-support/run-state.d.ts +1 -1
- package/packages/core/dist/test-support/run-state.js +8 -23
- 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 +28 -53
- 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 +10 -50
- package/packages/core/dist/verification/rendering.js.map +1 -1
- package/packages/core/dist/verification/single-task-loop.d.ts +0 -1
- package/packages/core/dist/verification/single-task-loop.js +159 -150
- package/packages/core/dist/verification/single-task-loop.js.map +1 -1
- package/packages/core/dist/verification/test-runtime.d.ts +12 -2
- package/packages/core/dist/verification/test-runtime.js +238 -103
- 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 +18 -0
- package/packages/core/dist/verification/validation-wave.js +27 -5
- package/packages/core/dist/verification/validation-wave.js.map +1 -1
- package/packages/core/dist/verification/verify-contract.d.ts +1 -1
- package/packages/core/dist/verification/verify-contract.js +9 -32
- package/packages/core/dist/verification/verify-contract.js.map +1 -1
- package/packages/core/dist/work-units/contracts.d.ts +1 -1
- package/packages/core/dist/workflow-gate/evidence-packet.js +228 -15
- package/packages/core/dist/workflow-gate/evidence-packet.js.map +1 -1
- package/packages/core/dist/workflow-gate/hard-checks.js +49 -15
- package/packages/core/dist/workflow-gate/hard-checks.js.map +1 -1
- package/packages/core/dist/workflow-gate/policy.js +42 -6
- package/packages/core/dist/workflow-gate/policy.js.map +1 -1
- package/packages/core/dist/workflow-gate/types.d.ts +4 -5
- package/packages/core/dist/workflow-state/affected-file-conflicts.d.ts +0 -1
- package/packages/core/dist/workflow-state/affected-file-conflicts.js +1 -2
- package/packages/core/dist/workflow-state/affected-file-conflicts.js.map +1 -1
- package/packages/core/dist/workflow-state/dependencies.js +1 -1
- package/packages/core/dist/workflow-state/latest-eligible-run.d.ts +0 -1
- package/packages/core/dist/workflow-state/latest-eligible-run.js +72 -6
- package/packages/core/dist/workflow-state/latest-eligible-run.js.map +1 -1
- package/packages/core/dist/workflow-state/migration-recovery.d.ts +40 -0
- package/packages/core/dist/workflow-state/migration-recovery.js +110 -0
- package/packages/core/dist/workflow-state/migration-recovery.js.map +1 -0
- package/packages/core/dist/workflow-state/repair-contract.d.ts +12 -0
- package/packages/core/dist/workflow-state/repair-contract.js +63 -0
- package/packages/core/dist/workflow-state/repair-contract.js.map +1 -0
- package/packages/core/dist/workflow-state/resolve-task-run.d.ts +21 -0
- package/packages/core/dist/workflow-state/resolve-task-run.js +95 -0
- package/packages/core/dist/workflow-state/resolve-task-run.js.map +1 -0
- package/packages/core/dist/workflow-state/resolve.d.ts +55 -5
- package/packages/core/dist/workflow-state/resolve.js +538 -34
- package/packages/core/dist/workflow-state/resolve.js.map +1 -1
- package/packages/core/dist/workflow-state/runtime-projections.d.ts +228 -0
- package/packages/core/dist/workflow-state/runtime-projections.js +452 -0
- package/packages/core/dist/workflow-state/runtime-projections.js.map +1 -0
- package/packages/core/package.json +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 -243
- 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 -110
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.js +0 -497
- 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 -270
- package/node_modules/@sdd-agent-platform/core/src/sync-back/inspect.ts +0 -655
- package/node_modules/@sdd-agent-platform/core/src/sync-back/sync-back.test.ts +0 -569
- package/node_modules/@sdd-agent-platform/core/src/sync-back.ts +0 -2
- package/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 -243
- package/packages/core/dist/sync-back/apply.js.map +0 -1
- package/packages/core/dist/sync-back/inspect.d.ts +0 -110
- package/packages/core/dist/sync-back/inspect.js +0 -497
- 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,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
|
|
3
3
|
import { inspectAiToolEntryEvidence } from './checks/ai-entries.js';
|
|
4
4
|
import { inspectDocumentChainEvidence } from './checks/document-chain.js';
|
|
5
5
|
import { inspectLocalRunIndexEvidence } from './checks/local-run-index.js';
|
|
@@ -7,10 +7,15 @@ import { inspectGitRepository, inspectProjectConfig, inspectRunsDirectoryAccess,
|
|
|
7
7
|
import { inspectRunEvidence } from './checks/run-evidence.js';
|
|
8
8
|
import { inspectAgentCapabilityCatalogDoctorContract, inspectAgentSkillTeamRuntimeDoctorContract, inspectCapabilityRegistry, inspectCommandTeamRuntimeDoctorContract, inspectGovernancePolicyContract, inspectHarnessLearningDoctorContract, inspectProjectContextPackDoctorContract, inspectQueryStatusBoundaryContract, inspectSkillAgentEvalDoctorContract, inspectToolPluginContracts } from './checks/registries.js';
|
|
9
9
|
import { inspectBackgroundExecutorContract, inspectDelegationQueueContract, inspectDelegationStateMachineContract, inspectLocalRunIndexContract, inspectTaskGraphPlannerContract, inspectWaveExecutorContract, inspectWavePlannerContract, inspectWorkerAdapterContracts, inspectWorktreeIsolationContract, inspectWorktreeLifecycleContract } from './checks/runtime-contracts.js';
|
|
10
|
-
import { inspectRuntimeStoreEvidence,
|
|
11
|
-
|
|
10
|
+
import { inspectRuntimeStoreEvidence, listRuntimeRepairs, listRuntimeTestRuns, listRuntimeTestSteps, listRuntimeValidationCacheEntries, listRuntimeValidationCacheUses, recordRuntimeRepair, type RuntimeRepairRecord } from '../storage/runtime-store.js';
|
|
11
|
+
|
|
12
12
|
import { branchToSafePartition } from '../path-safety.js';
|
|
13
13
|
import { readAllRunStates } from '../run-state/run-state.js';
|
|
14
|
+
import { readRunEvents } from '../run-state/events.js';
|
|
15
|
+
import { buildRunDurationBreakdown } from '../run-state/timing.js';
|
|
16
|
+
import { parseSddBranch } from '../sdd-docs/task-parser.js';
|
|
17
|
+
import { buildMixedVersionRecoveryPlan } from '../workflow-state/migration-recovery.js';
|
|
18
|
+
import { buildOpenRepairRecord } from '../workflow-state/repair-contract.js';
|
|
14
19
|
import { getProjectStatus, statuslineProjectionFromStatus, type ProjectStatus } from '../status/project-status.js';
|
|
15
20
|
import type { DoctorCheck, DoctorReport } from './model.js';
|
|
16
21
|
import { summarizeDoctorStatus } from './summary.js';
|
|
@@ -68,7 +73,14 @@ export async function doctor(projectRoot: string, options: { allRuns?: boolean;
|
|
|
68
73
|
checks.push(...inspectDurableGapRuntime(statusSnapshot));
|
|
69
74
|
checks.push(...inspectStageTeamRuntime(statusSnapshot));
|
|
70
75
|
checks.push(...inspectWorkflowGateRuntime(statusSnapshot));
|
|
71
|
-
checks.push(...
|
|
76
|
+
checks.push(...inspectSpecCollaborationRuntime(statusSnapshot));
|
|
77
|
+
checks.push(...await inspectRuntimePerformanceObservability(projectRoot, options));
|
|
78
|
+
checks.push(...await inspectValidationCacheVisibility(projectRoot, options));
|
|
79
|
+
checks.push(...await inspectMixedVersionRecovery(projectRoot, statusSnapshot, options));
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
checks.push(...await inspectRepairRecords(projectRoot, options));
|
|
83
|
+
await recordDoctorRepairs(projectRoot, checks, options.branch ?? null);
|
|
72
84
|
|
|
73
85
|
return {
|
|
74
86
|
status: summarizeDoctorStatus(checks),
|
|
@@ -101,83 +113,191 @@ function unavailableRuntimeCheck(check: string, label: string, error: unknown):
|
|
|
101
113
|
}];
|
|
102
114
|
}
|
|
103
115
|
|
|
104
|
-
|
|
116
|
+
const STALE_OPEN_RUN_MS = 30 * 60 * 1000;
|
|
117
|
+
const WAITING_DOMINATED_MIN_MS = 10_000;
|
|
118
|
+
const SLOW_VALIDATION_STEP_MS = 30_000;
|
|
119
|
+
|
|
120
|
+
async function inspectRuntimePerformanceObservability(projectRoot: string, options: { allRuns?: boolean; branch?: string | null } = {}): Promise<DoctorCheck[]> {
|
|
105
121
|
try {
|
|
106
122
|
const branchPartition = options.branch ? branchToSafePartition(options.branch) : null;
|
|
107
123
|
const states = (await readAllRunStates(projectRoot))
|
|
108
124
|
.filter((state) => options.allRuns || state.status !== 'archived')
|
|
109
125
|
.filter((state) => !branchPartition || state.partition === branchPartition || state.gitBranch === options.branch || (state.gitBranch ? branchToSafePartition(state.gitBranch) === branchPartition : false));
|
|
110
|
-
const
|
|
111
|
-
const
|
|
112
|
-
const
|
|
113
|
-
const
|
|
126
|
+
const staleOpenRuns: string[] = [];
|
|
127
|
+
const missingTestSteps: string[] = [];
|
|
128
|
+
const waitingDominatedRuns: string[] = [];
|
|
129
|
+
const slowValidationSteps: string[] = [];
|
|
130
|
+
const hostNoOutputRuns: string[] = [];
|
|
114
131
|
|
|
115
132
|
for (const state of states) {
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (await fileExists(path.join(legacyRunDir, fileName))) {
|
|
120
|
-
legacyRunFiles.push(`${state.runId}:${fileName}`);
|
|
121
|
-
}
|
|
133
|
+
const ageMs = Date.now() - Date.parse(state.updatedAt);
|
|
134
|
+
if (!isTerminalRunStatus(state.status) && Number.isFinite(ageMs) && ageMs >= STALE_OPEN_RUN_MS) {
|
|
135
|
+
staleOpenRuns.push(state.runId);
|
|
122
136
|
}
|
|
123
137
|
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
];
|
|
129
|
-
if (
|
|
130
|
-
|
|
138
|
+
const [events, testRuns, testSteps] = await Promise.all([
|
|
139
|
+
readRunEvents(projectRoot, state.runId),
|
|
140
|
+
listRuntimeTestRuns(projectRoot, state.runId),
|
|
141
|
+
listRuntimeTestSteps(projectRoot, { runId: state.runId })
|
|
142
|
+
]);
|
|
143
|
+
if (testRuns.length > 0 && testSteps.length === 0) {
|
|
144
|
+
missingTestSteps.push(state.runId);
|
|
131
145
|
}
|
|
132
146
|
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
147
|
+
const breakdown = buildRunDurationBreakdown(state, { events, testRuns, testSteps });
|
|
148
|
+
if (breakdown.waitingDurationMs >= WAITING_DOMINATED_MIN_MS && breakdown.waitingDurationMs > breakdown.activeRuntimeDurationMs) {
|
|
149
|
+
waitingDominatedRuns.push(`${state.runId}:${breakdown.waitingDurationMs}ms`);
|
|
150
|
+
}
|
|
151
|
+
if (breakdown.hostWaitingDurationMs >= WAITING_DOMINATED_MIN_MS && testSteps.length === 0) {
|
|
152
|
+
hostNoOutputRuns.push(`${state.runId}:${breakdown.hostWaitingDurationMs}ms`);
|
|
137
153
|
}
|
|
138
|
-
|
|
139
|
-
|
|
154
|
+
for (const step of testSteps) {
|
|
155
|
+
if (step.durationMs >= SLOW_VALIDATION_STEP_MS) {
|
|
156
|
+
slowValidationSteps.push(`${step.runId}:${step.stepId}:${step.durationMs}ms`);
|
|
157
|
+
}
|
|
140
158
|
}
|
|
141
159
|
}
|
|
142
160
|
|
|
143
|
-
const
|
|
144
|
-
return [
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
: { level: 'PASS', check: 'phase8_18_legacy_sidecars', message: 'No legacy per-run agent/team/worker sidecar directories found in inspected runs.' },
|
|
151
|
-
syncBackJsonOnly.length > 0 || syncBackDivergence.length > 0
|
|
152
|
-
? { level: 'WARN', check: 'phase8_18_sync_back_compat', message: `state_json_only=${syncBackJsonOnly.join(',') || 'none'} divergence=${syncBackDivergence.join(',') || 'none'}`, action: 'Use sdd sync-back inspect only for explicit diagnostic/recovery/replay, then reconcile canonical sync_back_decisions before relying on write-back state.' }
|
|
153
|
-
: { level: 'PASS', check: 'phase8_18_sync_back_compat', message: 'Canonical sync_back_decisions are consistent with inspected run compatibility summaries.' },
|
|
154
|
-
oldSyncBackProjection
|
|
155
|
-
? { level: 'WARN', check: 'phase8_18_ai_projection_compat', message: 'Found legacy /sdd:syncback projection at .claude/commands/sdd/syncback.md.', action: 'Run sdd update to remove obsolete managed syncback projection; use diagnostic sync-back only when explicitly requested.' }
|
|
156
|
-
: { level: 'PASS', check: 'phase8_18_ai_projection_compat', message: 'No legacy /sdd:syncback projection found.' },
|
|
157
|
-
{ level: 'PASS', check: 'phase9_readiness', message: 'code_graph_signals=optional_advisory_only authority=phase8_runtime_policy', action: 'Phase 9 graph providers may feed risk/context/test-impact/status/doctor signals but cannot replace Phase 8 gate truth.' }
|
|
158
|
-
];
|
|
161
|
+
const warnings = staleOpenRuns.length + missingTestSteps.length + waitingDominatedRuns.length + slowValidationSteps.length + hostNoOutputRuns.length;
|
|
162
|
+
return [{
|
|
163
|
+
level: warnings > 0 ? 'WARN' : 'PASS',
|
|
164
|
+
check: 'runtime_performance_observability',
|
|
165
|
+
message: `runs=${states.length} stale_open=${staleOpenRuns.join(',') || 'none'} missing_test_steps=${missingTestSteps.join(',') || 'none'} waiting_dominated=${waitingDominatedRuns.join(',') || 'none'} slow_validation=${slowValidationSteps.join(',') || 'none'} host_no_output=${hostNoOutputRuns.join(',') || 'none'}`,
|
|
166
|
+
action: warnings > 0 ? 'Inspect run duration breakdowns with sdd run inspect; persist test_steps for validation commands and investigate long waiting or host-no-output gaps.' : undefined
|
|
167
|
+
}];
|
|
159
168
|
} catch (error) {
|
|
160
|
-
return unavailableRuntimeCheck('
|
|
169
|
+
return unavailableRuntimeCheck('runtime_performance_observability', 'runtime performance observability', error);
|
|
161
170
|
}
|
|
162
171
|
}
|
|
163
172
|
|
|
164
|
-
async function
|
|
173
|
+
async function inspectValidationCacheVisibility(projectRoot: string, options: { branch?: string | null } = {}): Promise<DoctorCheck[]> {
|
|
165
174
|
try {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
175
|
+
const branchPartition = options.branch ? branchToSafePartition(options.branch) : null;
|
|
176
|
+
const entries = await listRuntimeValidationCacheEntries(projectRoot, { branchSlug: branchPartition, status: 'valid' });
|
|
177
|
+
const uses = await listRuntimeValidationCacheUses(projectRoot, { branchSlug: branchPartition });
|
|
178
|
+
const staleEntries = entries.filter((entry) => !entry.payload || typeof entry.payload !== 'object' || !('cachePlan' in entry.payload));
|
|
179
|
+
return [{
|
|
180
|
+
level: staleEntries.length > 0 ? 'WARN' : 'PASS',
|
|
181
|
+
check: 'validation_cache_visibility',
|
|
182
|
+
message: `entries=${entries.length} uses=${uses.length} stale_entries=${staleEntries.map((entry) => entry.cacheKey).join(',') || 'none'} hit_sources=${[...new Set(uses.map((use) => use.sourceTestRunId))].join(',') || 'none'}`,
|
|
183
|
+
action: staleEntries.length > 0 ? 'Replay stale validation cache entries; cache hits must remain tied to current cachePlan payload and accepted evidence mapping.' : undefined
|
|
184
|
+
}];
|
|
185
|
+
} catch (error) {
|
|
186
|
+
return unavailableRuntimeCheck('validation_cache_visibility', 'validation cache visibility', error);
|
|
169
187
|
}
|
|
170
188
|
}
|
|
171
189
|
|
|
172
|
-
async function
|
|
190
|
+
async function inspectRepairRecords(projectRoot: string, options: { branch?: string | null } = {}): Promise<DoctorCheck[]> {
|
|
173
191
|
try {
|
|
174
|
-
|
|
175
|
-
|
|
192
|
+
const branchPartition = options.branch ? branchToSafePartition(options.branch) : null;
|
|
193
|
+
const repairs = await listRuntimeRepairs(projectRoot, { branchSlug: branchPartition, status: 'open' });
|
|
194
|
+
return [{
|
|
195
|
+
level: repairs.length > 0 ? 'WARN' : 'PASS',
|
|
196
|
+
check: 'repair_records',
|
|
197
|
+
message: `open=${repairs.length} types=${[...new Set(repairs.map((repair) => repair.repairType))].join(',') || 'none'} next=${repairs.flatMap((repair) => repair.recommendedCommands).slice(0, 3).join(' | ') || 'none'}`,
|
|
198
|
+
action: repairs.length > 0 ? 'Resolve open repair records with new accepted evidence or a fresh gate PASS; diagnostic text alone does not close repairs.' : undefined
|
|
199
|
+
}];
|
|
200
|
+
} catch (error) {
|
|
201
|
+
return unavailableRuntimeCheck('repair_records', 'repair records', error);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
async function recordDoctorRepairs(projectRoot: string, checks: DoctorCheck[], branch: string | null): Promise<void> {
|
|
206
|
+
const branchSlug = branch ? branchToSafePartition(branch) : 'master';
|
|
207
|
+
const repairable = checks.filter((check) => doctorCheckCreatesRepair(check));
|
|
208
|
+
const repairableCheckNames = new Set(repairable.map((check) => check.check));
|
|
209
|
+
try {
|
|
210
|
+
const openRepairs = await listRuntimeRepairs(projectRoot, { branchSlug, status: 'open' });
|
|
211
|
+
for (const repair of openRepairs) {
|
|
212
|
+
const checkName = doctorRepairCheckName(repair);
|
|
213
|
+
if (checkName && (!repairableCheckNames.has(checkName) || repair.recommendedCommands.some((command) => !doctorRepairCommandLooksExecutable(command)))) {
|
|
214
|
+
await recordRuntimeRepair(projectRoot, {
|
|
215
|
+
...repair,
|
|
216
|
+
status: 'superseded',
|
|
217
|
+
resolvedAt: new Date().toISOString(),
|
|
218
|
+
payload: { ...doctorRepairPayload(repair.payload), supersededBy: 'doctor_fail_check_cleared' }
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
}
|
|
176
222
|
} catch {
|
|
177
|
-
return
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
for (const check of repairable) {
|
|
226
|
+
try {
|
|
227
|
+
await recordRuntimeRepair(projectRoot, buildOpenRepairRecord({
|
|
228
|
+
branchSlug,
|
|
229
|
+
message: `${check.check}: ${check.message}`,
|
|
230
|
+
recommendedCommands: doctorRepairCommands(branchSlug, check),
|
|
231
|
+
requiredEvidence: ['new accepted evidence or fresh gate PASS']
|
|
232
|
+
}));
|
|
233
|
+
} catch {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
178
236
|
}
|
|
179
237
|
}
|
|
180
238
|
|
|
239
|
+
function doctorCheckCreatesRepair(check: DoctorCheck): boolean {
|
|
240
|
+
return check.check !== 'repair_records' && check.check !== 'capability_health' && check.level === 'FAIL';
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function doctorRepairCheckName(repair: RuntimeRepairRecord): string | null {
|
|
244
|
+
const blocker = repair.blockers[0] ?? '';
|
|
245
|
+
const separator = blocker.indexOf(':');
|
|
246
|
+
return separator > 0 ? blocker.slice(0, separator) : null;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
function doctorRepairPayload(payload: unknown): Record<string, unknown> {
|
|
250
|
+
return payload && typeof payload === 'object' && !Array.isArray(payload) ? payload as Record<string, unknown> : { previousPayload: payload };
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
function doctorRepairCommands(branchSlug: string, check: DoctorCheck): string[] {
|
|
254
|
+
if (check.check === 'ai_entry_projection') {
|
|
255
|
+
return ['sdd update'];
|
|
256
|
+
}
|
|
257
|
+
if (check.check === 'capability_health') {
|
|
258
|
+
return [`sdd status --branch ${branchSlug} --compact-json`];
|
|
259
|
+
}
|
|
260
|
+
if (check.check === 'document_chain' || check.check === 'verify_contract' || check.message.includes('verify.md')) {
|
|
261
|
+
return [`sdd verifies write --branch ${branchSlug} --force`];
|
|
262
|
+
}
|
|
263
|
+
return [`sdd doctor --branch ${branchSlug} --latest-only`];
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function doctorRepairCommandLooksExecutable(command: string): boolean {
|
|
267
|
+
const normalized = command.trim().toLowerCase();
|
|
268
|
+
return normalized.startsWith('sdd ') || normalized.startsWith('npm ') || normalized.startsWith('node ') || normalized.startsWith('npx ');
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
function isTerminalRunStatus(status: string): boolean {
|
|
272
|
+
return status === 'completed' || status === 'failed' || status === 'blocked' || status === 'archived';
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
async function inspectMixedVersionRecovery(projectRoot: string, snapshot: DoctorProjectStatusSnapshot, options: { branch?: string | null } = {}): Promise<DoctorCheck[]> {
|
|
277
|
+
if (!snapshot.status) {
|
|
278
|
+
return unavailableRuntimeCheck('mixed_version_recovery', 'mixed-version recovery plan', snapshot.error);
|
|
279
|
+
}
|
|
280
|
+
try {
|
|
281
|
+
const model = await parseSddBranch(projectRoot, snapshot.status.branch);
|
|
282
|
+
const verifyText = model.documents.verifyExists ? await readFile(model.verifyPath, 'utf8') : null;
|
|
283
|
+
const plan = buildMixedVersionRecoveryPlan({ model, latestEligibleRunsByTask: snapshot.status.latestEligibleRunsByTask, verifyText });
|
|
284
|
+
const blocking = plan.detectedIssues.filter((issue) => issue.severity === 'blocking').length;
|
|
285
|
+
const warnings = plan.detectedIssues.filter((issue) => issue.severity === 'warn').length;
|
|
286
|
+
const legacyArtifacts = plan.detectedIssues.filter((issue) => issue.kind === 'legacy_artifact_ref').map((issue) => `${issue.taskId}:${issue.current}->${issue.expected}`);
|
|
287
|
+
const strictStale = plan.staleRunImpact.map((impact) => `${impact.taskId}:${impact.runId}`);
|
|
288
|
+
return [{
|
|
289
|
+
level: blocking > 0 ? 'FAIL' : warnings > 0 || plan.staleRunImpact.length > 0 ? 'WARN' : 'PASS',
|
|
290
|
+
check: 'mixed_version_recovery',
|
|
291
|
+
message: `issues=${plan.detectedIssues.length} safe_fixes=${plan.safeMechanicalUpdates.length} behavior_changes=${plan.behaviorChangingUpdates.length} legacy_artifacts=${legacyArtifacts.join(',') || 'none'} stale_runs=${strictStale.join(',') || 'none'} replay=${plan.evidenceReplayNeeded.join(',') || 'none'} next=${plan.nextCommands.join(' | ')}`,
|
|
292
|
+
action: plan.detectedIssues.length > 0 ? 'Apply only safe mechanical fixes in dry-run/preview first, then replay validation evidence; do not promote legacy stale runs as accepted truth.' : undefined
|
|
293
|
+
}];
|
|
294
|
+
} catch (error) {
|
|
295
|
+
return unavailableRuntimeCheck('mixed_version_recovery', 'mixed-version recovery plan', error);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
181
301
|
function inspectContextTokenRuntime(snapshot: DoctorProjectStatusSnapshot): DoctorCheck[] {
|
|
182
302
|
if (!snapshot.status) {
|
|
183
303
|
return unavailableRuntimeCheck('context_token_runtime', 'token runtime projection', snapshot.error);
|
|
@@ -200,7 +320,7 @@ function inspectLifecycleRiskRuntime(snapshot: DoctorProjectStatusSnapshot): Doc
|
|
|
200
320
|
level: risk.status === 'blocked' || risk.status === 'incompatible' || risk.approvalPolicy === 'blocked' ? 'FAIL' : risk.status === 'missing' || risk.status === 'stale' || risk.approvalPolicy === 'human-required' ? 'WARN' : 'PASS',
|
|
201
321
|
check: 'lifecycle_risk_decision',
|
|
202
322
|
message: `status=${risk.status} profile=${risk.profile ?? 'none'} approval=${risk.approvalPolicy ?? 'none'} input=${risk.inputHash ?? 'none'} expected=${risk.expectedInputHash}`,
|
|
203
|
-
action: risk.status === 'fresh' ? undefined : `
|
|
323
|
+
action: risk.status === 'fresh' ? undefined : `sdd status --branch ${snapshot.status.branch} --compact-json`
|
|
204
324
|
}];
|
|
205
325
|
}
|
|
206
326
|
|
|
@@ -213,7 +333,7 @@ function inspectWorkflowHandoffRuntime(snapshot: DoctorProjectStatusSnapshot): D
|
|
|
213
333
|
level: handoff.status === 'blocked' || handoff.status === 'rejected' || handoff.status === 'incompatible' ? 'FAIL' : handoff.status === 'stale' ? 'WARN' : 'PASS',
|
|
214
334
|
check: 'workflow_handoff_state',
|
|
215
335
|
message: `status=${handoff.status} active_stage=${handoff.activeStage?.stage ?? 'none'} latest_stage=${handoff.latestStageRun?.stage ?? 'none'} latest_handoff=${handoff.latestHandoff ? `${handoff.latestHandoff.fromStage}->${handoff.latestHandoff.toStage}:${handoff.latestHandoff.status}` : 'none'} stage_projections=${handoff.projectionCounts.stageRuns} handoff_projections=${handoff.projectionCounts.handoffs}`,
|
|
216
|
-
action: handoff.status === 'fresh' || handoff.status === 'missing' ? undefined : `
|
|
336
|
+
action: handoff.status === 'fresh' || handoff.status === 'missing' ? undefined : `sdd status --branch ${snapshot.status.branch} --compact-json`
|
|
217
337
|
}];
|
|
218
338
|
}
|
|
219
339
|
|
|
@@ -251,8 +371,8 @@ function inspectCapabilityHealthRuntime(snapshot: DoctorProjectStatusSnapshot):
|
|
|
251
371
|
return [{
|
|
252
372
|
level: health.status === 'blocked' ? 'FAIL' : health.status === 'warn' ? 'WARN' : 'PASS',
|
|
253
373
|
check: 'capability_health',
|
|
254
|
-
message: `status=${health.status} baseline=${health.baselineDomains.length}/${health.requiredProfessionalDomains.length} packs=${health.materialPacks} active=${health.activeDomains.join(',') || 'none'} sources_quarantined=${health.sources.quarantined} sources_denied=${health.sources.denied} evidence_candidate=${health.evidence.candidate} release_critical_gaps=${health.releaseCriticalGaps.join(',') || 'none'}`,
|
|
255
|
-
action: health.status === 'pass' ? undefined :
|
|
374
|
+
message: `status=${health.status} baseline=${health.baselineDomains.length}/${health.requiredProfessionalDomains.length} packs=${health.materialPacks} active=${health.activeDomains.join(',') || 'none'} sources_quarantined=${health.sources.quarantined} sources_denied=${health.sources.denied} evidence_candidate=${health.evidence.candidate} adoptions=${health.adoptions.adopted}/${health.adoptions.rejected}/${health.adoptions.unresolved} adoption_closures=${health.adoptions.releaseCriticalClosures.join(',') || 'none'} release_critical_gaps=${health.releaseCriticalGaps.join(',') || 'none'}`,
|
|
375
|
+
action: health.status === 'pass' ? undefined : `sdd status --branch ${snapshot.status.branch} --compact-json`
|
|
256
376
|
}];
|
|
257
377
|
}
|
|
258
378
|
|
|
@@ -285,6 +405,21 @@ function inspectStageTeamRuntime(snapshot: DoctorProjectStatusSnapshot): DoctorC
|
|
|
285
405
|
}];
|
|
286
406
|
}
|
|
287
407
|
|
|
408
|
+
function inspectSpecCollaborationRuntime(snapshot: DoctorProjectStatusSnapshot): DoctorCheck[] {
|
|
409
|
+
if (!snapshot.status) {
|
|
410
|
+
return unavailableRuntimeCheck('spec_collaboration_runtime', 'spec collaboration runtime', snapshot.error);
|
|
411
|
+
}
|
|
412
|
+
const health = snapshot.status.specCollaborationHealth;
|
|
413
|
+
const level = health.status === 'blocked' || health.status === 'rejected' || health.status === 'incompatible' ? 'FAIL' : health.status === 'needs_clarification' ? 'WARN' : 'PASS';
|
|
414
|
+
return [{
|
|
415
|
+
level,
|
|
416
|
+
check: 'spec_collaboration_runtime',
|
|
417
|
+
message: `status=${health.status} projections=${health.projectionCount} clarification=${health.latestClarificationGateId ?? 'none'} handoff=${health.latestHandoffId ?? 'none'} rejection=${health.latestRejectionReason ?? 'none'}`,
|
|
418
|
+
action: level === 'PASS' ? undefined : health.reasons.join(' ')
|
|
419
|
+
}];
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
|
|
288
423
|
function inspectDurableGapRuntime(snapshot: DoctorProjectStatusSnapshot): DoctorCheck[] {
|
|
289
424
|
if (!snapshot.status) {
|
|
290
425
|
return unavailableRuntimeCheck('durable_gap_runtime', 'durable gap runtime', snapshot.error);
|
|
@@ -41,16 +41,24 @@ export async function lookupEvidence(projectRoot: string, filters: EvidenceLooku
|
|
|
41
41
|
generatedAt: new Date().toISOString(),
|
|
42
42
|
retrievalMemoryOnly: true,
|
|
43
43
|
gateTruthAuthority: false,
|
|
44
|
-
reason: 'Evidence Lookup is retrieval memory over SQLite metadata and payload refs; PASS, verify, and
|
|
44
|
+
reason: 'Evidence Lookup is retrieval memory over SQLite metadata and payload refs; PASS, verify, and truth-alignment authority must use runtime evidence gates.',
|
|
45
45
|
filters,
|
|
46
46
|
payloads: filtered,
|
|
47
47
|
resolvedPayloads,
|
|
48
|
-
counts:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
counts: countByStatus(filtered)
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function countByStatus(payloads: RuntimeArtifactPayloadRecord[]): Record<RuntimeArtifactPayloadStatus, number> {
|
|
53
|
+
return {
|
|
54
|
+
active: payloads.filter((payload) => payload.status === 'active').length,
|
|
55
|
+
candidate: payloads.filter((payload) => payload.status === 'candidate').length,
|
|
56
|
+
partial: payloads.filter((payload) => payload.status === 'partial').length,
|
|
57
|
+
active_attempt: payloads.filter((payload) => payload.status === 'active_attempt').length,
|
|
58
|
+
rejected: payloads.filter((payload) => payload.status === 'rejected').length,
|
|
59
|
+
superseded: payloads.filter((payload) => payload.status === 'superseded').length,
|
|
60
|
+
quarantined: payloads.filter((payload) => payload.status === 'quarantined').length,
|
|
61
|
+
stale: payloads.filter((payload) => payload.status === 'stale').length
|
|
54
62
|
};
|
|
55
63
|
}
|
|
56
64
|
|
|
@@ -42,7 +42,6 @@ export interface UnifiedTestEvidenceRun {
|
|
|
42
42
|
commands: TestCommandEvidence[];
|
|
43
43
|
acceptanceCoverage: AcceptanceEvidenceCoverage[];
|
|
44
44
|
capabilityEvidence: CapabilityEvidenceClassification[];
|
|
45
|
-
syncBackReady: boolean;
|
|
46
45
|
gaps: string[];
|
|
47
46
|
next: string;
|
|
48
47
|
generatedAt: string;
|
|
@@ -10,14 +10,22 @@ import { writeArtifact } from '../run-state/artifacts.js';
|
|
|
10
10
|
import { readRunState } from '../run-state/run-state.js';
|
|
11
11
|
import { validResultArtifact, validTaskMarkdown, writeBranchDocs } from '../test-support/fixtures.js';
|
|
12
12
|
import { writeVerifyContract } from '../verification/verify-contract.js';
|
|
13
|
+
import { evaluateLifecycleRiskDecisionForModel, recordLifecycleRiskDecisionProjection } from '../risk.js';
|
|
14
|
+
import { parseSddBranch } from '../sdd-docs/task-parser.js';
|
|
13
15
|
import { inspectBackgroundExecutor, runBackgroundExecutor } from './background-executor.js';
|
|
14
16
|
|
|
17
|
+
async function seedLifecycleRiskDecision(root: string, branch: string): Promise<void> {
|
|
18
|
+
const model = await parseSddBranch(root, branch);
|
|
19
|
+
await recordLifecycleRiskDecisionProjection(root, evaluateLifecycleRiskDecisionForModel(branch, model));
|
|
20
|
+
}
|
|
21
|
+
|
|
15
22
|
test('background executor claims one delegation and persists background run state', async () => {
|
|
16
23
|
const root = await mkdtemp(path.join(tmpdir(), 'sdd-background-claim-'));
|
|
17
24
|
try {
|
|
18
25
|
await initProject(root);
|
|
19
26
|
await writeBranchDocs(root, 'master', validTaskMarkdown('B1', []));
|
|
20
27
|
await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
|
|
28
|
+
await seedLifecycleRiskDecision(root, 'master');
|
|
21
29
|
|
|
22
30
|
const result = await runBackgroundExecutor(root, { taskId: 'B1' });
|
|
23
31
|
const state = await readRunState(root, result.runId);
|
|
@@ -42,6 +50,7 @@ test('background executor ingests supplied artifact and reaches terminal state',
|
|
|
42
50
|
await initProject(root);
|
|
43
51
|
await writeBranchDocs(root, 'master', validTaskMarkdown('B1', []));
|
|
44
52
|
await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
|
|
53
|
+
await seedLifecycleRiskDecision(root, 'master');
|
|
45
54
|
|
|
46
55
|
const claimed = await runBackgroundExecutor(root, { taskId: 'B1' });
|
|
47
56
|
await writeArtifact(root, claimed.runId, 'implementer-B1.md', validResultArtifact('implementer', 'B1', 'PASS', 'artifacts/implementer-B1.md'));
|
|
@@ -66,17 +75,53 @@ test('background executor ingests supplied artifact and reaches terminal state',
|
|
|
66
75
|
}
|
|
67
76
|
});
|
|
68
77
|
|
|
78
|
+
test('background executor replays changed terminal artifact into a new attempt', async () => {
|
|
79
|
+
const root = await mkdtemp(path.join(tmpdir(), 'sdd-background-replay-'));
|
|
80
|
+
try {
|
|
81
|
+
await initProject(root);
|
|
82
|
+
await writeBranchDocs(root, 'master', validTaskMarkdown('B1', []));
|
|
83
|
+
await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
|
|
84
|
+
await seedLifecycleRiskDecision(root, 'master');
|
|
85
|
+
|
|
86
|
+
const claimed = await runBackgroundExecutor(root, { taskId: 'B1' });
|
|
87
|
+
await writeArtifact(root, claimed.runId, 'implementer-B1.md', validResultArtifact('implementer', 'B1', 'PASS', 'artifacts/implementer-B1.md'));
|
|
88
|
+
const completed = await runBackgroundExecutor(root, {
|
|
89
|
+
runId: claimed.runId,
|
|
90
|
+
taskId: 'B1',
|
|
91
|
+
artifactPath: 'artifacts/implementer-B1.md'
|
|
92
|
+
});
|
|
93
|
+
await writeArtifact(root, claimed.runId, 'implementer-B1.md', `${validResultArtifact('implementer', 'B1', 'PASS', 'artifacts/implementer-B1.md')}\nReplay evidence.\n`);
|
|
94
|
+
const replayed = await runBackgroundExecutor(root, {
|
|
95
|
+
runId: claimed.runId,
|
|
96
|
+
taskId: 'B1',
|
|
97
|
+
artifactPath: 'artifacts/implementer-B1.md'
|
|
98
|
+
});
|
|
99
|
+
const state = await readRunState(root, claimed.runId);
|
|
100
|
+
|
|
101
|
+
assert.equal(completed.status, 'completed');
|
|
102
|
+
assert.equal(replayed.status, 'completed');
|
|
103
|
+
assert.equal(replayed.delegationId, 'B-B1-implementer-001');
|
|
104
|
+
assert.equal(replayed.ingestion?.delegationId, 'B-B1-implementer-002');
|
|
105
|
+
assert.equal(replayed.ingestion?.retryOf, 'B-B1-implementer-001');
|
|
106
|
+
assert.equal(state.delegations['B-B1-implementer-001']?.status, 'COMPLETED');
|
|
107
|
+
assert.equal(state.delegations['B-B1-implementer-002']?.status, 'COMPLETED');
|
|
108
|
+
} finally {
|
|
109
|
+
await rm(root, { recursive: true, force: true });
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
|
|
69
113
|
test('claude code subagent worker spawns host process and ingests stdout artifact', async () => {
|
|
70
114
|
const root = await mkdtemp(path.join(tmpdir(), 'sdd-background-claude-host-'));
|
|
71
115
|
try {
|
|
72
116
|
await initProject(root);
|
|
73
117
|
await writeBranchDocs(root, 'master', validTaskMarkdown('B1', []));
|
|
74
118
|
await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
|
|
119
|
+
await seedLifecycleRiskDecision(root, 'master');
|
|
75
120
|
const hostScript = path.join(root, 'fake-claude-host.mjs');
|
|
76
121
|
await writeFile(hostScript, [
|
|
77
122
|
"const prompt = process.argv[2] ?? '';",
|
|
78
123
|
"if (!prompt.includes('Queue item id:')) process.exit(2);",
|
|
79
|
-
"process.stdout.write('# implementer result\\n\\n```sdd-result\\ncontract: sdd-result-v1\\nversion: 1.3.0\\nagent: implementer\\ntask: B1\\nstatus: PASS\\nartifacts:\\n -
|
|
124
|
+
"process.stdout.write('# implementer result\\n\\n```sdd-result\\ncontract: sdd-result-v1\\nversion: 1.3.0\\nagent: implementer\\ntask: B1\\nstatus: PASS\\nartifacts:\\n - .sdd/runs/master/do/implementer-B1.md\\n```\\n');"
|
|
80
125
|
].join('\n'), 'utf8');
|
|
81
126
|
|
|
82
127
|
const completed = await runBackgroundExecutor(root, {
|
|
@@ -90,7 +135,7 @@ test('claude code subagent worker spawns host process and ingests stdout artifac
|
|
|
90
135
|
|
|
91
136
|
assert.equal(completed.status, 'completed');
|
|
92
137
|
assert.equal(completed.hostInvocation?.exitCode, 0);
|
|
93
|
-
assert.equal(completed.hostInvocation?.artifactPath, '
|
|
138
|
+
assert.equal(completed.hostInvocation?.artifactPath, '.sdd/runs/master/do/implementer-B1.md');
|
|
94
139
|
assert.equal(completed.ingestion?.delegationStatus, 'COMPLETED');
|
|
95
140
|
assert.equal(state.delegations['B-B1-implementer-001']?.status, 'COMPLETED');
|
|
96
141
|
assert.equal(inspection.terminalDelegations, 1);
|
|
@@ -106,6 +151,7 @@ test('background executor blocks invalid artifact evidence instead of completing
|
|
|
106
151
|
await initProject(root);
|
|
107
152
|
await writeBranchDocs(root, 'master', validTaskMarkdown('B1', []));
|
|
108
153
|
await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
|
|
154
|
+
await seedLifecycleRiskDecision(root, 'master');
|
|
109
155
|
|
|
110
156
|
const claimed = await runBackgroundExecutor(root, { taskId: 'B1' });
|
|
111
157
|
await writeArtifact(root, claimed.runId, 'implementer-B1.md', '# Missing contract\n');
|
|
@@ -131,6 +177,7 @@ test('background executor requires approval for database manual gate and accepts
|
|
|
131
177
|
await initProject(root);
|
|
132
178
|
await writeBranchDocs(root, 'master', validTaskMarkdown('B1', []).replace('risk: []', 'risk:\n - database'));
|
|
133
179
|
await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
|
|
180
|
+
await seedLifecycleRiskDecision(root, 'master');
|
|
134
181
|
|
|
135
182
|
const blocked = await runBackgroundExecutor(root, { taskId: 'B1' });
|
|
136
183
|
assert.equal(blocked.status, 'blocked');
|
|
@@ -160,6 +207,7 @@ test('background executor blocks manual handoff worker adapters', async () => {
|
|
|
160
207
|
await initProject(root);
|
|
161
208
|
await writeBranchDocs(root, 'master', validTaskMarkdown('B1', []));
|
|
162
209
|
await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
|
|
210
|
+
await seedLifecycleRiskDecision(root, 'master');
|
|
163
211
|
|
|
164
212
|
const result = await runBackgroundExecutor(root, { taskId: 'B1', workerAdapterId: 'manual-handoff-worker' });
|
|
165
213
|
|
|
@@ -6,7 +6,7 @@ import { createDelegationRecord, isDelegationTerminal } from '../delegation/vali
|
|
|
6
6
|
import { listDelegationQueueItems } from '../delegation/queue.js';
|
|
7
7
|
import { persistDelegation } from '../delegation/run-state.js';
|
|
8
8
|
import { evaluateGovernancePolicy } from '../governance/policy.js';
|
|
9
|
-
import {
|
|
9
|
+
import { normalizeStageEvidenceOrLegacyArtifactRef, toBranchStageEvidenceRef } from '../runtime-paths.js';
|
|
10
10
|
import { appendEvent } from '../run-state/events.js';
|
|
11
11
|
import { createRun, readRunState, writeRunState } from '../run-state/run-state.js';
|
|
12
12
|
import type { DelegationQueueItem } from '../run-state/run-index.js';
|
|
@@ -119,10 +119,10 @@ export async function runBackgroundExecutor(projectRoot: string, options: Backgr
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
const delegationId = options.delegationId ?? `B-${options.taskId}-${agent}-001`;
|
|
122
|
-
const expectedArtifact = options.artifactPath ?
|
|
122
|
+
const expectedArtifact = options.artifactPath ? normalizeStageEvidenceOrLegacyArtifactRef(options.artifactPath) : toBranchStageEvidenceRef(branch, agent === 'validator' ? 'test' : 'do', `${agent}-${options.taskId}.md`);
|
|
123
123
|
const existingDelegation = boundRunState.delegations[delegationId];
|
|
124
|
-
if (existingDelegation && isDelegationTerminal(existingDelegation.status)) {
|
|
125
|
-
issues.push(contractIssue('delegationId', `Delegation ${delegationId} is already terminal.`, '
|
|
124
|
+
if (existingDelegation && isDelegationTerminal(existingDelegation.status) && !options.artifactPath) {
|
|
125
|
+
issues.push(contractIssue('delegationId', `Delegation ${delegationId} is already terminal.`, 'Rerun with an artifact path to idempotently reingest the same digest or allocate a retry attempt for changed evidence.'));
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
const governance = await evaluateGovernancePolicy(projectRoot, {
|
|
@@ -8,6 +8,8 @@ import { initProject } from '../config/init-project.js';
|
|
|
8
8
|
import { readRunState } from '../run-state/run-state.js';
|
|
9
9
|
import { listRuntimeProjections } from '../storage/runtime-store.js';
|
|
10
10
|
import { validTaskMarkdown, writeBranchDocs } from '../test-support/fixtures.js';
|
|
11
|
+
import { evaluateLifecycleRiskDecisionForModel, recordLifecycleRiskDecisionProjection } from '../risk.js';
|
|
12
|
+
import { parseSddBranch } from '../sdd-docs/task-parser.js';
|
|
11
13
|
import { runForegroundSubagents } from './foreground-subagents.js';
|
|
12
14
|
|
|
13
15
|
const hostCommand = [
|
|
@@ -20,11 +22,17 @@ const hostCommand = [
|
|
|
20
22
|
"process.stdout.write(result + evidence);"
|
|
21
23
|
].join('\n');
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
async function seedLifecycleRiskDecision(root: string, branch: string): Promise<void> {
|
|
26
|
+
const model = await parseSddBranch(root, branch);
|
|
27
|
+
await recordLifecycleRiskDecisionProjection(root, evaluateLifecycleRiskDecisionForModel(branch, model));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
test('runForegroundSubagents collects non-authoritative foreground artifacts after lifecycle decision', async () => {
|
|
24
31
|
const root = await mkdtemp(path.join(tmpdir(), 'sdd-foreground-subagents-'));
|
|
25
32
|
try {
|
|
26
33
|
await initProject(root);
|
|
27
34
|
await writeBranchDocs(root, 'feature', validTaskMarkdown('T1', []).replace('packages/core/src/index.ts', 'docs/t1.md'));
|
|
35
|
+
await seedLifecycleRiskDecision(root, 'feature');
|
|
28
36
|
|
|
29
37
|
const result = await runForegroundSubagents(root, {
|
|
30
38
|
branch: 'feature',
|
|
@@ -35,7 +43,7 @@ test('runForegroundSubagents collects all foreground subagent artifacts without
|
|
|
35
43
|
|
|
36
44
|
assert.equal(result.status, 'completed');
|
|
37
45
|
assert.deepEqual(result.agents.map((agent) => `${agent.agent}:${agent.status}`), ['reviewer:completed', 'validator:completed']);
|
|
38
|
-
assert.equal(result.agents.every((agent) => agent.artifactPath?.startsWith('
|
|
46
|
+
assert.equal(result.agents.every((agent) => agent.artifactPath?.startsWith('.sdd/runs/feature/do/')), true);
|
|
39
47
|
assert.equal(result.agents.every((agent) => agent.ingestion?.status === 'accepted'), true);
|
|
40
48
|
|
|
41
49
|
const state = await readRunState(root, result.runId);
|
|
@@ -74,6 +82,7 @@ test('runForegroundSubagents blocks before host invocation when dependencies are
|
|
|
74
82
|
try {
|
|
75
83
|
await initProject(root);
|
|
76
84
|
await writeBranchDocs(root, 'feature', `# Tasks\n\n${validTaskMarkdown('DEP1', [])}\n${validTaskMarkdown('DEP2', ['DEP1']).replace('packages/core/src/index.ts', 'docs/dep2.md')}`);
|
|
85
|
+
await seedLifecycleRiskDecision(root, 'feature');
|
|
77
86
|
|
|
78
87
|
const result = await runForegroundSubagents(root, {
|
|
79
88
|
branch: 'feature',
|
|
@@ -13,7 +13,7 @@ import { parseSddBranch } from '../sdd-docs/task-parser.js';
|
|
|
13
13
|
import { routeSddTask } from '../router/route-sdd-task.js';
|
|
14
14
|
import { buildAgentExecutionRecord, writeAgentExecutionRecord } from './agent-execution-records.js';
|
|
15
15
|
import { invokeClaudeCodeSubagentHost, type HostInvocationCommandOptions, type HostInvocationResult } from './host-invocation.js';
|
|
16
|
-
import {
|
|
16
|
+
import { toBranchStageEvidenceRef, toEvidencePayloadFileName } from '../runtime-paths.js';
|
|
17
17
|
import { recordRuntimeProjection } from '../storage/runtime-store.js';
|
|
18
18
|
import { recordSubagentDispatchProjection, recordSubagentResultProjection } from '../subagents/runtime.js';
|
|
19
19
|
import type { SubagentDispatch, SubagentResult } from '../subagents/contracts.js';
|
|
@@ -122,7 +122,7 @@ export async function runForegroundSubagents(projectRoot: string, options: Foreg
|
|
|
122
122
|
|
|
123
123
|
const slots = agents.map((agent, index) => {
|
|
124
124
|
const delegationId = `F-${options.taskId}-${safeToken(agent)}-${String(index + 1).padStart(3, '0')}`;
|
|
125
|
-
const expectedArtifact =
|
|
125
|
+
const expectedArtifact = toBranchStageEvidenceRef(branch, 'do', `${safeToken(agent)}-${options.taskId}-${String(index + 1).padStart(3, '0')}.md`);
|
|
126
126
|
return { agent, delegationId, expectedArtifact };
|
|
127
127
|
});
|
|
128
128
|
|
|
@@ -342,7 +342,7 @@ function buildHostFailureDigest(taskId: string, agent: string, delegationId: str
|
|
|
342
342
|
|
|
343
343
|
async function readArtifactText(projectRoot: string, runId: string, artifactPath: string): Promise<string> {
|
|
344
344
|
try {
|
|
345
|
-
return await readArtifact(projectRoot, runId,
|
|
345
|
+
return await readArtifact(projectRoot, runId, toEvidencePayloadFileName(artifactPath));
|
|
346
346
|
} catch {
|
|
347
347
|
return '';
|
|
348
348
|
}
|