sdd-agent-platform 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -39
- package/node_modules/@sdd-agent-platform/core/dist/ai-tools.js +72 -71
- package/node_modules/@sdd-agent-platform/core/dist/ai-tools.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/ingestion.js +64 -9
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/ingestion.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-evidence.js +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-evidence.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-result.js +26 -17
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-result.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/init-project.d.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/dist/config/init-project.js +13 -9
- package/node_modules/@sdd-agent-platform/core/dist/config/init-project.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/project-config.d.ts +3 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/project-config.js +7 -3
- package/node_modules/@sdd-agent-platform/core/dist/config/project-config.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.d.ts +4 -4
- package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.js +16 -20
- package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context/build-package.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context/build-package.js +1 -7
- package/node_modules/@sdd-agent-platform/core/dist/context/build-package.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context/evidence-summary.js +26 -8
- package/node_modules/@sdd-agent-platform/core/dist/context/evidence-summary.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context/log-worker.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/context/log-worker.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context-offload/contracts.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/contracts.d.ts +4 -1
- package/node_modules/@sdd-agent-platform/core/dist/contracts.js +3 -0
- package/node_modules/@sdd-agent-platform/core/dist/contracts.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/delegation/model.d.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/dist/delegation/validation.d.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/dist/delegation/validation.js +7 -4
- package/node_modules/@sdd-agent-platform/core/dist/delegation/validation.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/document-chain.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/document-chain.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/project.js +8 -8
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/project.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/registries.js +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/registries.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-evidence.js +7 -7
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-evidence.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-trust.js +0 -24
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-trust.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/runtime-contracts.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/runtime-contracts.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/doctor.js +277 -3
- package/node_modules/@sdd-agent-platform/core/dist/doctor/doctor.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.d.ts +23 -0
- package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.js +61 -0
- package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/evidence-runtime/contracts.d.ts +11 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/agent-execution-records.js +15 -8
- package/node_modules/@sdd-agent-platform/core/dist/execution/agent-execution-records.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/background-executor.js +4 -4
- package/node_modules/@sdd-agent-platform/core/dist/execution/background-executor.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/foreground-subagents.js +3 -3
- package/node_modules/@sdd-agent-platform/core/dist/execution/foreground-subagents.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/host-invocation.js +5 -4
- package/node_modules/@sdd-agent-platform/core/dist/execution/host-invocation.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/resident-worker.js +16 -7
- package/node_modules/@sdd-agent-platform/core/dist/execution/resident-worker.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/stage-team-runtime.d.ts +112 -0
- package/node_modules/@sdd-agent-platform/core/dist/execution/stage-team-runtime.js +145 -0
- package/node_modules/@sdd-agent-platform/core/dist/execution/stage-team-runtime.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/governance/policy.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/governance/policy.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/governance/policy.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/instructions.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/instructions.js +59 -66
- package/node_modules/@sdd-agent-platform/core/dist/instructions.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/decision-gate.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/decision-gate.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.d.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.js +55 -19
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/orchestration/contracts.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.d.ts +12 -2
- package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.js +62 -21
- package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.d.ts +20 -2
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.js +218 -18
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-registry.js +17 -17
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-registry.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-runtime-static.d.ts +10 -0
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-runtime-static.js +32 -2
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-runtime-static.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/capability-sources.d.ts +2 -17
- package/node_modules/@sdd-agent-platform/core/dist/registries/capability-sources.js +222 -10
- package/node_modules/@sdd-agent-platform/core/dist/registries/capability-sources.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.js +9 -9
- package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/eval-learning-context.js +4 -4
- package/node_modules/@sdd-agent-platform/core/dist/registries/eval-learning-context.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/query-status.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/registries/query-status.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/tool-capabilities.js +3 -3
- package/node_modules/@sdd-agent-platform/core/dist/registries/tool-capabilities.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/tool-plugins.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/registries/tool-plugins.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/worker-adapters.js +11 -11
- package/node_modules/@sdd-agent-platform/core/dist/registries/worker-adapters.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/workflow-gates.js +12 -12
- package/node_modules/@sdd-agent-platform/core/dist/registries/workflow-gates.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/risk/contracts.d.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/risk/kernel.js +4 -4
- package/node_modules/@sdd-agent-platform/core/dist/risk/kernel.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/risk/legacy-adapters.js +4 -7
- package/node_modules/@sdd-agent-platform/core/dist/risk/legacy-adapters.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/risk/workflow-gates.d.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/risk/workflow-gates.js +19 -17
- package/node_modules/@sdd-agent-platform/core/dist/risk/workflow-gates.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime-config.js +28 -13
- package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime-config.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime.d.ts +61 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.d.ts +3 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.js +192 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/routing.js +73 -17
- package/node_modules/@sdd-agent-platform/core/dist/router/routing.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-import.d.ts +28 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-import.js +373 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-import.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-inspection.js +11 -4
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-inspection.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-validation.js +31 -3
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-validation.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/stage-route-binding.d.ts +37 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/stage-route-binding.js +235 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/stage-route-binding.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/router.d.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/router.js +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/router.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/artifacts.d.ts +16 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/artifacts.js +168 -18
- package/node_modules/@sdd-agent-platform/core/dist/run-state/artifacts.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/events.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/run-state/events.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.d.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.js +22 -54
- package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/invocation-ledger.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/run-state/invocation-ledger.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/model.d.ts +53 -9
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-index.d.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-index.js +1 -3
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-index.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-state.js +51 -34
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-state.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.d.ts +65 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.js +169 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/timing.d.ts +8 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/timing.js +131 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/timing.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state.d.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state.js +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/build.js +0 -3
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/build.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/findings.js +5 -44
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/findings.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/model.d.ts +1 -17
- package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.d.ts +20 -0
- package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.js +109 -14
- package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/runtime-projection-p0.d.ts +64 -0
- package/node_modules/@sdd-agent-platform/core/dist/runtime-projection-p0.js +200 -0
- package/node_modules/@sdd-agent-platform/core/dist/runtime-projection-p0.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/context.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/context.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.d.ts +6 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.js +276 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/run-binding.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/run-binding.js +15 -4
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/run-binding.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.d.ts +21 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.js +139 -38
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/stage-artifacts.d.ts +55 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-artifacts.js +322 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-artifacts.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration-contracts.d.ts +55 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration-contracts.js +241 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration-contracts.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration.d.ts +888 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration.js +3870 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-runtime/runtime.js +8 -1
- package/node_modules/@sdd-agent-platform/core/dist/stage-runtime/runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/status/project-status.d.ts +105 -1
- package/node_modules/@sdd-agent-platform/core/dist/status/project-status.js +343 -8
- package/node_modules/@sdd-agent-platform/core/dist/status/project-status.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.d.ts +348 -3
- package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.js +1017 -8
- package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/subagents/contracts.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/subagents/runtime.js +7 -7
- package/node_modules/@sdd-agent-platform/core/dist/subagents/runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/test-support/fixtures.js +21 -0
- package/node_modules/@sdd-agent-platform/core/dist/test-support/fixtures.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.js +19 -20
- package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/truth-reconciliation.d.ts +44 -0
- package/node_modules/@sdd-agent-platform/core/dist/truth-reconciliation.js +138 -0
- package/node_modules/@sdd-agent-platform/core/dist/truth-reconciliation.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.d.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.js +44 -37
- package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.d.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.js +19 -49
- package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/review-gate.d.ts +22 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/review-gate.js +53 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/review-gate.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.d.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.js +213 -111
- package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.d.ts +28 -3
- package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.js +546 -125
- package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-cache.d.ts +26 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-cache.js +73 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-cache.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.d.ts +76 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.js +450 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.d.ts +3 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.js +105 -30
- package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification.d.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification.js +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/work-units/contracts.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.d.ts +24 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.js +395 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.d.ts +4 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.js +164 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.d.ts +4 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.js +182 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/types.d.ts +88 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/types.js +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/types.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.js +17 -3
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/dependencies.d.ts +8 -4
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/dependencies.js +25 -11
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/dependencies.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.d.ts +37 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.js +188 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/migration-recovery.d.ts +40 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/migration-recovery.js +110 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/migration-recovery.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/repair-contract.d.ts +12 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/repair-contract.js +63 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/repair-contract.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve-task-run.d.ts +21 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve-task-run.js +95 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve-task-run.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.d.ts +80 -3
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.js +674 -41
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/runtime-projections.d.ts +228 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/runtime-projections.js +452 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/runtime-projections.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state.d.ts +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state.js +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/package.json +3 -3
- package/node_modules/@sdd-agent-platform/core/src/ai-tools.test.ts +49 -1
- package/node_modules/@sdd-agent-platform/core/src/ai-tools.ts +72 -71
- package/node_modules/@sdd-agent-platform/core/src/artifacts/ingestion.test.ts +38 -0
- package/node_modules/@sdd-agent-platform/core/src/artifacts/ingestion.ts +65 -9
- package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-evidence.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-result.test.ts +52 -6
- package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-result.ts +26 -17
- package/node_modules/@sdd-agent-platform/core/src/config/init-project.test.ts +44 -29
- package/node_modules/@sdd-agent-platform/core/src/config/init-project.ts +15 -11
- package/node_modules/@sdd-agent-platform/core/src/config/project-config.ts +10 -4
- package/node_modules/@sdd-agent-platform/core/src/config/starter-documents.ts +17 -20
- package/node_modules/@sdd-agent-platform/core/src/context/build-package.ts +2 -8
- package/node_modules/@sdd-agent-platform/core/src/context/context-build.test.ts +3 -2
- package/node_modules/@sdd-agent-platform/core/src/context/evidence-summary.ts +27 -8
- package/node_modules/@sdd-agent-platform/core/src/context/log-worker.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/context-offload/contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/contracts.ts +4 -1
- package/node_modules/@sdd-agent-platform/core/src/delegation/model.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/src/delegation/validation.ts +8 -5
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/document-chain.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/project.ts +8 -8
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/registries.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/run-evidence.ts +7 -7
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/run-trust.ts +0 -21
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/runtime-contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/doctor/doctor.test.ts +217 -7
- package/node_modules/@sdd-agent-platform/core/src/doctor/doctor.ts +301 -3
- package/node_modules/@sdd-agent-platform/core/src/evidence/lookup.ts +88 -0
- package/node_modules/@sdd-agent-platform/core/src/evidence-runtime/contracts.ts +12 -1
- package/node_modules/@sdd-agent-platform/core/src/execution/agent-execution-records.ts +16 -11
- package/node_modules/@sdd-agent-platform/core/src/execution/background-executor.test.ts +57 -2
- package/node_modules/@sdd-agent-platform/core/src/execution/background-executor.ts +4 -4
- package/node_modules/@sdd-agent-platform/core/src/execution/foreground-subagents.test.ts +11 -2
- package/node_modules/@sdd-agent-platform/core/src/execution/foreground-subagents.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/src/execution/host-invocation.ts +5 -4
- package/node_modules/@sdd-agent-platform/core/src/execution/resident-worker.test.ts +17 -1
- package/node_modules/@sdd-agent-platform/core/src/execution/resident-worker.ts +16 -7
- package/node_modules/@sdd-agent-platform/core/src/execution/stage-team-runtime.test.ts +102 -0
- package/node_modules/@sdd-agent-platform/core/src/execution/stage-team-runtime.ts +271 -0
- package/node_modules/@sdd-agent-platform/core/src/execution/wave-executor.test.ts +14 -0
- package/node_modules/@sdd-agent-platform/core/src/governance/policy.test.ts +10 -0
- package/node_modules/@sdd-agent-platform/core/src/governance/policy.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/instructions.test.ts +34 -13
- package/node_modules/@sdd-agent-platform/core/src/instructions.ts +60 -67
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/decision-gate.test.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/decision-gate.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/ship.test.ts +47 -0
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/ship.ts +58 -19
- package/node_modules/@sdd-agent-platform/core/src/orchestration/contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/orchestration/runtime.ts +74 -22
- package/node_modules/@sdd-agent-platform/core/src/phase8-contracts.test.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/src/phase8-risk-kernel.test.ts +8 -3
- package/node_modules/@sdd-agent-platform/core/src/planning/task-graph.test.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/planning/wave-plan.test.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-capability-catalog.ts +319 -20
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-registry.ts +17 -17
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-runtime-static.ts +42 -2
- package/node_modules/@sdd-agent-platform/core/src/registries/capability-sources.ts +238 -15
- package/node_modules/@sdd-agent-platform/core/src/registries/command-team-runtime.ts +10 -10
- package/node_modules/@sdd-agent-platform/core/src/registries/eval-learning-context.ts +4 -4
- package/node_modules/@sdd-agent-platform/core/src/registries/query-status.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/registries/registries.test.ts +45 -4
- package/node_modules/@sdd-agent-platform/core/src/registries/tool-capabilities.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/src/registries/tool-plugins.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/registries/worker-adapters.ts +11 -11
- package/node_modules/@sdd-agent-platform/core/src/registries/workflow-gates.ts +12 -12
- package/node_modules/@sdd-agent-platform/core/src/risk/contracts.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/risk/kernel.ts +4 -4
- package/node_modules/@sdd-agent-platform/core/src/risk/legacy-adapters.ts +4 -7
- package/node_modules/@sdd-agent-platform/core/src/risk/workflow-gates.ts +20 -18
- package/node_modules/@sdd-agent-platform/core/src/router/agent-runtime-config.ts +32 -13
- package/node_modules/@sdd-agent-platform/core/src/router/agent-runtime.ts +68 -1
- package/node_modules/@sdd-agent-platform/core/src/router/route-projection.ts +212 -1
- package/node_modules/@sdd-agent-platform/core/src/router/route-sdd-task.test.ts +391 -6
- package/node_modules/@sdd-agent-platform/core/src/router/routing.ts +78 -17
- package/node_modules/@sdd-agent-platform/core/src/router/runtime-import.ts +453 -0
- package/node_modules/@sdd-agent-platform/core/src/router/runtime-inspection.ts +11 -4
- package/node_modules/@sdd-agent-platform/core/src/router/runtime-validation.ts +32 -3
- package/node_modules/@sdd-agent-platform/core/src/router/stage-route-binding.ts +279 -0
- package/node_modules/@sdd-agent-platform/core/src/router.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/run-state/artifacts.ts +173 -18
- package/node_modules/@sdd-agent-platform/core/src/run-state/events.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/run-state/inspect-run.ts +24 -59
- package/node_modules/@sdd-agent-platform/core/src/run-state/invocation-ledger.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/run-state/model.ts +59 -9
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-index.ts +1 -5
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-state.test.ts +53 -2
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-state.ts +55 -41
- package/node_modules/@sdd-agent-platform/core/src/run-state/task-evidence.ts +252 -0
- package/node_modules/@sdd-agent-platform/core/src/run-state/timing.ts +146 -0
- package/node_modules/@sdd-agent-platform/core/src/run-state.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/build.ts +0 -3
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/findings.ts +6 -46
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/model.ts +1 -13
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis.test.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/src/runtime-paths.ts +131 -14
- package/node_modules/@sdd-agent-platform/core/src/runtime-projection-p0.test.ts +96 -0
- package/node_modules/@sdd-agent-platform/core/src/runtime-projection-p0.ts +292 -0
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/context.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/document-hashes.ts +306 -0
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/run-binding.ts +15 -4
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.test.ts +261 -0
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.ts +169 -41
- package/node_modules/@sdd-agent-platform/core/src/stage-artifacts.ts +450 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-collaboration-contracts.ts +322 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-collaboration.test.ts +2903 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-collaboration.ts +5831 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-runtime/runtime.test.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/stage-runtime/runtime.ts +9 -1
- package/node_modules/@sdd-agent-platform/core/src/status/project-status.test.ts +239 -16
- package/node_modules/@sdd-agent-platform/core/src/status/project-status.ts +497 -8
- package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.test.ts +560 -4
- package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.ts +1510 -9
- package/node_modules/@sdd-agent-platform/core/src/subagents/contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/subagents/runtime.test.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/src/subagents/runtime.ts +7 -7
- package/node_modules/@sdd-agent-platform/core/src/test-support/fixtures.ts +21 -0
- package/node_modules/@sdd-agent-platform/core/src/test-support/run-state.ts +20 -20
- package/node_modules/@sdd-agent-platform/core/src/truth-reconciliation.test.ts +72 -0
- package/node_modules/@sdd-agent-platform/core/src/truth-reconciliation.ts +177 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/goal-verify.test.ts +13 -87
- package/node_modules/@sdd-agent-platform/core/src/verification/goal-verify.ts +46 -42
- package/node_modules/@sdd-agent-platform/core/src/verification/rendering.ts +18 -52
- package/node_modules/@sdd-agent-platform/core/src/verification/review-gate.test.ts +84 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/review-gate.ts +77 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/single-task-loop.test.ts +138 -64
- package/node_modules/@sdd-agent-platform/core/src/verification/single-task-loop.ts +226 -116
- package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.test.ts +148 -48
- package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.ts +619 -136
- package/node_modules/@sdd-agent-platform/core/src/verification/validation-cache.ts +106 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/validation-wave.test.ts +383 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/validation-wave.ts +556 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.test.ts +131 -8
- package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.ts +117 -30
- package/node_modules/@sdd-agent-platform/core/src/verification.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/work-units/contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/evidence-packet.ts +425 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.test.ts +507 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.ts +182 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.test.ts +174 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.ts +194 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/types.ts +115 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/affected-file-conflicts.ts +19 -4
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/dependencies.test.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/dependencies.ts +33 -11
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/latest-eligible-run.ts +224 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/migration-recovery.ts +158 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/repair-contract.ts +77 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve-task-run.ts +114 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve.test.ts +851 -9
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve.ts +862 -45
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/runtime-projections.ts +712 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state.ts +1 -0
- package/package.json +1 -1
- package/packages/cli/dist/args.js +2 -2
- package/packages/cli/dist/args.js.map +1 -1
- package/packages/cli/dist/commands/ai-tools.js +13 -2
- package/packages/cli/dist/commands/ai-tools.js.map +1 -1
- package/packages/cli/dist/commands/context.js +1 -1
- package/packages/cli/dist/commands/context.js.map +1 -1
- package/packages/cli/dist/commands/execution.js +49 -1
- package/packages/cli/dist/commands/execution.js.map +1 -1
- package/packages/cli/dist/commands/governance.js +1 -1
- package/packages/cli/dist/commands/governance.js.map +1 -1
- package/packages/cli/dist/commands/init.js +6 -1
- package/packages/cli/dist/commands/init.js.map +1 -1
- package/packages/cli/dist/commands/lifecycle.js +15 -2
- package/packages/cli/dist/commands/lifecycle.js.map +1 -1
- package/packages/cli/dist/commands/registry/runtime.js +48 -2
- package/packages/cli/dist/commands/registry/runtime.js.map +1 -1
- package/packages/cli/dist/commands/run.js +52 -2
- package/packages/cli/dist/commands/run.js.map +1 -1
- package/packages/cli/dist/commands/stage-close.d.ts +6 -0
- package/packages/cli/dist/commands/stage-close.js +295 -0
- package/packages/cli/dist/commands/stage-close.js.map +1 -0
- package/packages/cli/dist/commands/status.js +70 -4
- package/packages/cli/dist/commands/status.js.map +1 -1
- package/packages/cli/dist/commands/tasks.js +4 -4
- package/packages/cli/dist/commands/tasks.js.map +1 -1
- package/packages/cli/dist/commands/test.js +272 -5
- package/packages/cli/dist/commands/test.js.map +1 -1
- package/packages/cli/dist/commands/verifies.js +9 -5
- package/packages/cli/dist/commands/verifies.js.map +1 -1
- package/packages/cli/dist/commands/verify.js +257 -20
- package/packages/cli/dist/commands/verify.js.map +1 -1
- package/packages/cli/dist/dispatch.js +4 -9
- package/packages/cli/dist/dispatch.js.map +1 -1
- package/packages/cli/dist/help.js +42 -27
- package/packages/cli/dist/help.js.map +1 -1
- package/packages/cli/dist/renderers/doctor.js +1 -1
- package/packages/cli/dist/renderers/doctor.js.map +1 -1
- package/packages/cli/dist/renderers/execution.js +1 -1
- package/packages/cli/dist/renderers/execution.js.map +1 -1
- package/packages/cli/dist/renderers/json.d.ts +1 -0
- package/packages/cli/dist/renderers/json.js +3 -0
- package/packages/cli/dist/renderers/json.js.map +1 -1
- package/packages/cli/dist/renderers/registry-runtime.d.ts +2 -1
- package/packages/cli/dist/renderers/registry-runtime.js +27 -2
- package/packages/cli/dist/renderers/registry-runtime.js.map +1 -1
- package/packages/cli/dist/renderers/router.js +5 -3
- package/packages/cli/dist/renderers/router.js.map +1 -1
- package/packages/cli/dist/renderers/workflow.d.ts +0 -4
- package/packages/cli/dist/renderers/workflow.js +46 -84
- package/packages/cli/dist/renderers/workflow.js.map +1 -1
- package/packages/cli/dist/skill-import-args.d.ts +10 -0
- package/packages/cli/dist/skill-import-args.js +47 -0
- package/packages/cli/dist/skill-import-args.js.map +1 -0
- package/packages/cli/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/cli/package.json +2 -2
- package/packages/core/dist/ai-tools.js +72 -71
- package/packages/core/dist/ai-tools.js.map +1 -1
- package/packages/core/dist/artifacts/ingestion.js +64 -9
- package/packages/core/dist/artifacts/ingestion.js.map +1 -1
- package/packages/core/dist/artifacts/sdd-evidence.js +0 -1
- package/packages/core/dist/artifacts/sdd-evidence.js.map +1 -1
- package/packages/core/dist/artifacts/sdd-result.js +26 -17
- package/packages/core/dist/artifacts/sdd-result.js.map +1 -1
- package/packages/core/dist/config/init-project.d.ts +3 -0
- package/packages/core/dist/config/init-project.js +13 -9
- package/packages/core/dist/config/init-project.js.map +1 -1
- package/packages/core/dist/config/project-config.d.ts +3 -1
- package/packages/core/dist/config/project-config.js +7 -3
- package/packages/core/dist/config/project-config.js.map +1 -1
- package/packages/core/dist/config/starter-documents.d.ts +4 -4
- package/packages/core/dist/config/starter-documents.js +16 -20
- package/packages/core/dist/config/starter-documents.js.map +1 -1
- package/packages/core/dist/context/build-package.d.ts +1 -1
- package/packages/core/dist/context/build-package.js +1 -7
- package/packages/core/dist/context/build-package.js.map +1 -1
- package/packages/core/dist/context/evidence-summary.js +26 -8
- package/packages/core/dist/context/evidence-summary.js.map +1 -1
- package/packages/core/dist/context/log-worker.js +2 -2
- package/packages/core/dist/context/log-worker.js.map +1 -1
- package/packages/core/dist/context-offload/contracts.d.ts +1 -1
- package/packages/core/dist/contracts.d.ts +4 -1
- package/packages/core/dist/contracts.js +3 -0
- package/packages/core/dist/contracts.js.map +1 -1
- package/packages/core/dist/delegation/model.d.ts +3 -0
- package/packages/core/dist/delegation/validation.d.ts +3 -0
- package/packages/core/dist/delegation/validation.js +7 -4
- package/packages/core/dist/delegation/validation.js.map +1 -1
- package/packages/core/dist/doctor/checks/document-chain.js +1 -1
- package/packages/core/dist/doctor/checks/document-chain.js.map +1 -1
- package/packages/core/dist/doctor/checks/project.js +8 -8
- package/packages/core/dist/doctor/checks/project.js.map +1 -1
- package/packages/core/dist/doctor/checks/registries.js +0 -1
- package/packages/core/dist/doctor/checks/registries.js.map +1 -1
- package/packages/core/dist/doctor/checks/run-evidence.js +7 -7
- package/packages/core/dist/doctor/checks/run-evidence.js.map +1 -1
- package/packages/core/dist/doctor/checks/run-trust.js +0 -24
- package/packages/core/dist/doctor/checks/run-trust.js.map +1 -1
- package/packages/core/dist/doctor/checks/runtime-contracts.js +1 -1
- package/packages/core/dist/doctor/checks/runtime-contracts.js.map +1 -1
- package/packages/core/dist/doctor/doctor.js +277 -3
- package/packages/core/dist/doctor/doctor.js.map +1 -1
- package/packages/core/dist/evidence/lookup.d.ts +23 -0
- package/packages/core/dist/evidence/lookup.js +61 -0
- package/packages/core/dist/evidence/lookup.js.map +1 -0
- package/packages/core/dist/evidence-runtime/contracts.d.ts +11 -1
- package/packages/core/dist/execution/agent-execution-records.js +15 -8
- package/packages/core/dist/execution/agent-execution-records.js.map +1 -1
- package/packages/core/dist/execution/background-executor.js +4 -4
- package/packages/core/dist/execution/background-executor.js.map +1 -1
- package/packages/core/dist/execution/foreground-subagents.js +3 -3
- package/packages/core/dist/execution/foreground-subagents.js.map +1 -1
- package/packages/core/dist/execution/host-invocation.js +5 -4
- package/packages/core/dist/execution/host-invocation.js.map +1 -1
- package/packages/core/dist/execution/resident-worker.js +16 -7
- package/packages/core/dist/execution/resident-worker.js.map +1 -1
- package/packages/core/dist/execution/stage-team-runtime.d.ts +112 -0
- package/packages/core/dist/execution/stage-team-runtime.js +145 -0
- package/packages/core/dist/execution/stage-team-runtime.js.map +1 -0
- package/packages/core/dist/governance/policy.d.ts +1 -1
- package/packages/core/dist/governance/policy.js +1 -1
- package/packages/core/dist/governance/policy.js.map +1 -1
- package/packages/core/dist/instructions.d.ts +1 -1
- package/packages/core/dist/instructions.js +59 -66
- package/packages/core/dist/instructions.js.map +1 -1
- package/packages/core/dist/lifecycle/decision-gate.js +1 -1
- package/packages/core/dist/lifecycle/decision-gate.js.map +1 -1
- package/packages/core/dist/lifecycle/ship.d.ts +3 -0
- package/packages/core/dist/lifecycle/ship.js +55 -19
- package/packages/core/dist/lifecycle/ship.js.map +1 -1
- package/packages/core/dist/orchestration/contracts.d.ts +1 -1
- package/packages/core/dist/orchestration/runtime.d.ts +12 -2
- package/packages/core/dist/orchestration/runtime.js +62 -21
- package/packages/core/dist/orchestration/runtime.js.map +1 -1
- package/packages/core/dist/registries/agent-capability-catalog.d.ts +20 -2
- package/packages/core/dist/registries/agent-capability-catalog.js +218 -18
- package/packages/core/dist/registries/agent-capability-catalog.js.map +1 -1
- package/packages/core/dist/registries/agent-registry.js +17 -17
- package/packages/core/dist/registries/agent-registry.js.map +1 -1
- package/packages/core/dist/registries/agent-runtime-static.d.ts +10 -0
- package/packages/core/dist/registries/agent-runtime-static.js +32 -2
- package/packages/core/dist/registries/agent-runtime-static.js.map +1 -1
- package/packages/core/dist/registries/capability-sources.d.ts +2 -17
- package/packages/core/dist/registries/capability-sources.js +222 -10
- package/packages/core/dist/registries/capability-sources.js.map +1 -1
- package/packages/core/dist/registries/command-team-runtime.d.ts +1 -1
- package/packages/core/dist/registries/command-team-runtime.js +9 -9
- package/packages/core/dist/registries/command-team-runtime.js.map +1 -1
- package/packages/core/dist/registries/eval-learning-context.js +4 -4
- package/packages/core/dist/registries/eval-learning-context.js.map +1 -1
- package/packages/core/dist/registries/query-status.js +2 -2
- package/packages/core/dist/registries/query-status.js.map +1 -1
- package/packages/core/dist/registries/tool-capabilities.js +3 -3
- package/packages/core/dist/registries/tool-capabilities.js.map +1 -1
- package/packages/core/dist/registries/tool-plugins.js +2 -2
- package/packages/core/dist/registries/tool-plugins.js.map +1 -1
- package/packages/core/dist/registries/worker-adapters.js +11 -11
- package/packages/core/dist/registries/worker-adapters.js.map +1 -1
- package/packages/core/dist/registries/workflow-gates.js +12 -12
- package/packages/core/dist/registries/workflow-gates.js.map +1 -1
- package/packages/core/dist/risk/contracts.d.ts +2 -2
- package/packages/core/dist/risk/kernel.js +4 -4
- package/packages/core/dist/risk/kernel.js.map +1 -1
- package/packages/core/dist/risk/legacy-adapters.js +4 -7
- package/packages/core/dist/risk/legacy-adapters.js.map +1 -1
- package/packages/core/dist/risk/workflow-gates.d.ts +2 -2
- package/packages/core/dist/risk/workflow-gates.js +19 -17
- package/packages/core/dist/risk/workflow-gates.js.map +1 -1
- package/packages/core/dist/router/agent-runtime-config.js +28 -13
- package/packages/core/dist/router/agent-runtime-config.js.map +1 -1
- package/packages/core/dist/router/agent-runtime.d.ts +61 -1
- package/packages/core/dist/router/route-projection.d.ts +3 -1
- package/packages/core/dist/router/route-projection.js +192 -1
- package/packages/core/dist/router/route-projection.js.map +1 -1
- package/packages/core/dist/router/routing.js +73 -17
- package/packages/core/dist/router/routing.js.map +1 -1
- package/packages/core/dist/router/runtime-import.d.ts +28 -0
- package/packages/core/dist/router/runtime-import.js +373 -0
- package/packages/core/dist/router/runtime-import.js.map +1 -0
- package/packages/core/dist/router/runtime-inspection.js +11 -4
- package/packages/core/dist/router/runtime-inspection.js.map +1 -1
- package/packages/core/dist/router/runtime-validation.js +31 -3
- package/packages/core/dist/router/runtime-validation.js.map +1 -1
- package/packages/core/dist/router/stage-route-binding.d.ts +37 -0
- package/packages/core/dist/router/stage-route-binding.js +235 -0
- package/packages/core/dist/router/stage-route-binding.js.map +1 -0
- package/packages/core/dist/router.d.ts +2 -0
- package/packages/core/dist/router.js +2 -0
- package/packages/core/dist/router.js.map +1 -1
- package/packages/core/dist/run-state/artifacts.d.ts +16 -0
- package/packages/core/dist/run-state/artifacts.js +168 -18
- package/packages/core/dist/run-state/artifacts.js.map +1 -1
- package/packages/core/dist/run-state/events.js +2 -2
- package/packages/core/dist/run-state/events.js.map +1 -1
- package/packages/core/dist/run-state/inspect-run.d.ts +3 -3
- package/packages/core/dist/run-state/inspect-run.js +22 -54
- package/packages/core/dist/run-state/inspect-run.js.map +1 -1
- package/packages/core/dist/run-state/invocation-ledger.js +2 -2
- package/packages/core/dist/run-state/invocation-ledger.js.map +1 -1
- package/packages/core/dist/run-state/model.d.ts +53 -9
- package/packages/core/dist/run-state/run-index.d.ts +0 -2
- package/packages/core/dist/run-state/run-index.js +1 -3
- package/packages/core/dist/run-state/run-index.js.map +1 -1
- package/packages/core/dist/run-state/run-state.js +51 -34
- package/packages/core/dist/run-state/run-state.js.map +1 -1
- package/packages/core/dist/run-state/task-evidence.d.ts +65 -0
- package/packages/core/dist/run-state/task-evidence.js +169 -0
- package/packages/core/dist/run-state/task-evidence.js.map +1 -0
- package/packages/core/dist/run-state/timing.d.ts +8 -0
- package/packages/core/dist/run-state/timing.js +131 -0
- package/packages/core/dist/run-state/timing.js.map +1 -0
- package/packages/core/dist/run-state.d.ts +2 -0
- package/packages/core/dist/run-state.js +2 -0
- package/packages/core/dist/run-state.js.map +1 -1
- package/packages/core/dist/runtime-analysis/build.js +0 -3
- package/packages/core/dist/runtime-analysis/build.js.map +1 -1
- package/packages/core/dist/runtime-analysis/findings.js +5 -44
- package/packages/core/dist/runtime-analysis/findings.js.map +1 -1
- package/packages/core/dist/runtime-analysis/model.d.ts +1 -17
- package/packages/core/dist/runtime-paths.d.ts +20 -0
- package/packages/core/dist/runtime-paths.js +109 -14
- package/packages/core/dist/runtime-paths.js.map +1 -1
- package/packages/core/dist/runtime-projection-p0.d.ts +64 -0
- package/packages/core/dist/runtime-projection-p0.js +200 -0
- package/packages/core/dist/runtime-projection-p0.js.map +1 -0
- package/packages/core/dist/sdd-docs/context.js +1 -1
- package/packages/core/dist/sdd-docs/context.js.map +1 -1
- package/packages/core/dist/sdd-docs/document-hashes.d.ts +6 -0
- package/packages/core/dist/sdd-docs/document-hashes.js +276 -0
- package/packages/core/dist/sdd-docs/document-hashes.js.map +1 -0
- package/packages/core/dist/sdd-docs/run-binding.d.ts +1 -1
- package/packages/core/dist/sdd-docs/run-binding.js +15 -4
- package/packages/core/dist/sdd-docs/run-binding.js.map +1 -1
- package/packages/core/dist/sdd-docs/task-parser.d.ts +21 -0
- package/packages/core/dist/sdd-docs/task-parser.js +139 -38
- package/packages/core/dist/sdd-docs/task-parser.js.map +1 -1
- package/packages/core/dist/stage-artifacts.d.ts +55 -0
- package/packages/core/dist/stage-artifacts.js +322 -0
- package/packages/core/dist/stage-artifacts.js.map +1 -0
- package/packages/core/dist/stage-collaboration-contracts.d.ts +55 -0
- package/packages/core/dist/stage-collaboration-contracts.js +241 -0
- package/packages/core/dist/stage-collaboration-contracts.js.map +1 -0
- package/packages/core/dist/stage-collaboration.d.ts +888 -0
- package/packages/core/dist/stage-collaboration.js +3870 -0
- package/packages/core/dist/stage-collaboration.js.map +1 -0
- package/packages/core/dist/stage-runtime/runtime.js +8 -1
- package/packages/core/dist/stage-runtime/runtime.js.map +1 -1
- package/packages/core/dist/status/project-status.d.ts +105 -1
- package/packages/core/dist/status/project-status.js +343 -8
- package/packages/core/dist/status/project-status.js.map +1 -1
- package/packages/core/dist/storage/runtime-store.d.ts +348 -3
- package/packages/core/dist/storage/runtime-store.js +1017 -8
- package/packages/core/dist/storage/runtime-store.js.map +1 -1
- package/packages/core/dist/subagents/contracts.d.ts +1 -1
- package/packages/core/dist/subagents/runtime.js +7 -7
- package/packages/core/dist/subagents/runtime.js.map +1 -1
- package/packages/core/dist/test-support/fixtures.js +21 -0
- package/packages/core/dist/test-support/fixtures.js.map +1 -1
- package/packages/core/dist/test-support/run-state.d.ts +1 -1
- package/packages/core/dist/test-support/run-state.js +19 -20
- package/packages/core/dist/test-support/run-state.js.map +1 -1
- package/packages/core/dist/truth-reconciliation.d.ts +44 -0
- package/packages/core/dist/truth-reconciliation.js +138 -0
- package/packages/core/dist/truth-reconciliation.js.map +1 -0
- package/packages/core/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/core/dist/verification/goal-verify.d.ts +0 -1
- package/packages/core/dist/verification/goal-verify.js +44 -37
- package/packages/core/dist/verification/goal-verify.js.map +1 -1
- package/packages/core/dist/verification/rendering.d.ts +0 -2
- package/packages/core/dist/verification/rendering.js +19 -49
- package/packages/core/dist/verification/rendering.js.map +1 -1
- package/packages/core/dist/verification/review-gate.d.ts +22 -0
- package/packages/core/dist/verification/review-gate.js +53 -0
- package/packages/core/dist/verification/review-gate.js.map +1 -0
- package/packages/core/dist/verification/single-task-loop.d.ts +0 -1
- package/packages/core/dist/verification/single-task-loop.js +213 -111
- package/packages/core/dist/verification/single-task-loop.js.map +1 -1
- package/packages/core/dist/verification/test-runtime.d.ts +28 -3
- package/packages/core/dist/verification/test-runtime.js +546 -125
- package/packages/core/dist/verification/test-runtime.js.map +1 -1
- package/packages/core/dist/verification/validation-cache.d.ts +26 -0
- package/packages/core/dist/verification/validation-cache.js +73 -0
- package/packages/core/dist/verification/validation-cache.js.map +1 -0
- package/packages/core/dist/verification/validation-wave.d.ts +76 -0
- package/packages/core/dist/verification/validation-wave.js +450 -0
- package/packages/core/dist/verification/validation-wave.js.map +1 -0
- package/packages/core/dist/verification/verify-contract.d.ts +3 -1
- package/packages/core/dist/verification/verify-contract.js +105 -30
- package/packages/core/dist/verification/verify-contract.js.map +1 -1
- package/packages/core/dist/verification.d.ts +2 -0
- package/packages/core/dist/verification.js +2 -0
- package/packages/core/dist/verification.js.map +1 -1
- package/packages/core/dist/work-units/contracts.d.ts +1 -1
- package/packages/core/dist/workflow-gate/evidence-packet.d.ts +24 -0
- package/packages/core/dist/workflow-gate/evidence-packet.js +395 -0
- package/packages/core/dist/workflow-gate/evidence-packet.js.map +1 -0
- package/packages/core/dist/workflow-gate/hard-checks.d.ts +4 -0
- package/packages/core/dist/workflow-gate/hard-checks.js +164 -0
- package/packages/core/dist/workflow-gate/hard-checks.js.map +1 -0
- package/packages/core/dist/workflow-gate/policy.d.ts +4 -0
- package/packages/core/dist/workflow-gate/policy.js +182 -0
- package/packages/core/dist/workflow-gate/policy.js.map +1 -0
- package/packages/core/dist/workflow-gate/types.d.ts +88 -0
- package/packages/core/dist/workflow-gate/types.js +2 -0
- package/packages/core/dist/workflow-gate/types.js.map +1 -0
- package/packages/core/dist/workflow-state/affected-file-conflicts.d.ts +1 -1
- package/packages/core/dist/workflow-state/affected-file-conflicts.js +17 -3
- package/packages/core/dist/workflow-state/affected-file-conflicts.js.map +1 -1
- package/packages/core/dist/workflow-state/dependencies.d.ts +8 -4
- package/packages/core/dist/workflow-state/dependencies.js +25 -11
- package/packages/core/dist/workflow-state/dependencies.js.map +1 -1
- package/packages/core/dist/workflow-state/latest-eligible-run.d.ts +37 -0
- package/packages/core/dist/workflow-state/latest-eligible-run.js +188 -0
- package/packages/core/dist/workflow-state/latest-eligible-run.js.map +1 -0
- package/packages/core/dist/workflow-state/migration-recovery.d.ts +40 -0
- package/packages/core/dist/workflow-state/migration-recovery.js +110 -0
- package/packages/core/dist/workflow-state/migration-recovery.js.map +1 -0
- package/packages/core/dist/workflow-state/repair-contract.d.ts +12 -0
- package/packages/core/dist/workflow-state/repair-contract.js +63 -0
- package/packages/core/dist/workflow-state/repair-contract.js.map +1 -0
- package/packages/core/dist/workflow-state/resolve-task-run.d.ts +21 -0
- package/packages/core/dist/workflow-state/resolve-task-run.js +95 -0
- package/packages/core/dist/workflow-state/resolve-task-run.js.map +1 -0
- package/packages/core/dist/workflow-state/resolve.d.ts +80 -3
- package/packages/core/dist/workflow-state/resolve.js +674 -41
- package/packages/core/dist/workflow-state/resolve.js.map +1 -1
- package/packages/core/dist/workflow-state/runtime-projections.d.ts +228 -0
- package/packages/core/dist/workflow-state/runtime-projections.js +452 -0
- package/packages/core/dist/workflow-state/runtime-projections.js.map +1 -0
- package/packages/core/dist/workflow-state.d.ts +1 -0
- package/packages/core/dist/workflow-state.js +1 -0
- package/packages/core/dist/workflow-state.js.map +1 -1
- package/packages/core/package.json +3 -3
- package/node_modules/@sdd-agent-platform/core/dist/doctor/render.d.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/dist/doctor/render.js +0 -44
- package/node_modules/@sdd-agent-platform/core/dist/doctor/render.js.map +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.d.ts +0 -17
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.js +0 -221
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.js.map +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.d.ts +0 -91
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.js +0 -395
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.js.map +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/sync-back.d.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/dist/sync-back.js +0 -3
- package/node_modules/@sdd-agent-platform/core/dist/sync-back.js.map +0 -1
- package/node_modules/@sdd-agent-platform/core/src/sync-back/apply.ts +0 -248
- package/node_modules/@sdd-agent-platform/core/src/sync-back/inspect.ts +0 -522
- package/node_modules/@sdd-agent-platform/core/src/sync-back/sync-back.test.ts +0 -446
- package/node_modules/@sdd-agent-platform/core/src/sync-back.ts +0 -2
- package/packages/cli/dist/commands/artifact.d.ts +0 -6
- package/packages/cli/dist/commands/artifact.js +0 -168
- package/packages/cli/dist/commands/artifact.js.map +0 -1
- package/packages/cli/dist/commands/sync-back.d.ts +0 -6
- package/packages/cli/dist/commands/sync-back.js +0 -82
- package/packages/cli/dist/commands/sync-back.js.map +0 -1
- package/packages/cli/dist/renderers/artifacts.d.ts +0 -5
- package/packages/cli/dist/renderers/artifacts.js +0 -43
- package/packages/cli/dist/renderers/artifacts.js.map +0 -1
- package/packages/core/dist/doctor/render.d.ts +0 -2
- package/packages/core/dist/doctor/render.js +0 -44
- package/packages/core/dist/doctor/render.js.map +0 -1
- package/packages/core/dist/sync-back/apply.d.ts +0 -17
- package/packages/core/dist/sync-back/apply.js +0 -221
- package/packages/core/dist/sync-back/apply.js.map +0 -1
- package/packages/core/dist/sync-back/inspect.d.ts +0 -91
- package/packages/core/dist/sync-back/inspect.js +0 -395
- package/packages/core/dist/sync-back/inspect.js.map +0 -1
- package/packages/core/dist/sync-back.d.ts +0 -2
- package/packages/core/dist/sync-back.js +0 -3
- package/packages/core/dist/sync-back.js.map +0 -1
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
|
|
1
3
|
import { inspectAiToolEntryEvidence } from './checks/ai-entries.js';
|
|
2
4
|
import { inspectDocumentChainEvidence } from './checks/document-chain.js';
|
|
3
5
|
import { inspectLocalRunIndexEvidence } from './checks/local-run-index.js';
|
|
@@ -5,7 +7,15 @@ import { inspectGitRepository, inspectProjectConfig, inspectRunsDirectoryAccess,
|
|
|
5
7
|
import { inspectRunEvidence } from './checks/run-evidence.js';
|
|
6
8
|
import { inspectAgentCapabilityCatalogDoctorContract, inspectAgentSkillTeamRuntimeDoctorContract, inspectCapabilityRegistry, inspectCommandTeamRuntimeDoctorContract, inspectGovernancePolicyContract, inspectHarnessLearningDoctorContract, inspectProjectContextPackDoctorContract, inspectQueryStatusBoundaryContract, inspectSkillAgentEvalDoctorContract, inspectToolPluginContracts } from './checks/registries.js';
|
|
7
9
|
import { inspectBackgroundExecutorContract, inspectDelegationQueueContract, inspectDelegationStateMachineContract, inspectLocalRunIndexContract, inspectTaskGraphPlannerContract, inspectWaveExecutorContract, inspectWavePlannerContract, inspectWorkerAdapterContracts, inspectWorktreeIsolationContract, inspectWorktreeLifecycleContract } from './checks/runtime-contracts.js';
|
|
8
|
-
import { inspectRuntimeStoreEvidence } from '../storage/runtime-store.js';
|
|
10
|
+
import { inspectRuntimeStoreEvidence, listRuntimeRepairs, listRuntimeTestRuns, listRuntimeTestSteps, listRuntimeValidationCacheEntries, listRuntimeValidationCacheUses, recordRuntimeRepair, type RuntimeRepairRecord } from '../storage/runtime-store.js';
|
|
11
|
+
|
|
12
|
+
import { branchToSafePartition } from '../path-safety.js';
|
|
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';
|
|
9
19
|
import { getProjectStatus, statuslineProjectionFromStatus, type ProjectStatus } from '../status/project-status.js';
|
|
10
20
|
import type { DoctorCheck, DoctorReport } from './model.js';
|
|
11
21
|
import { summarizeDoctorStatus } from './summary.js';
|
|
@@ -58,6 +68,19 @@ export async function doctor(projectRoot: string, options: { allRuns?: boolean;
|
|
|
58
68
|
checks.push(...inspectWorkflowHandoffRuntime(statusSnapshot));
|
|
59
69
|
checks.push(...inspectContextOffloadRuntime(statusSnapshot));
|
|
60
70
|
checks.push(...inspectSubagentDispatchRuntime(statusSnapshot));
|
|
71
|
+
checks.push(...inspectCapabilityHealthRuntime(statusSnapshot));
|
|
72
|
+
checks.push(...inspectLatestEligibleRunSelector(statusSnapshot));
|
|
73
|
+
checks.push(...inspectDurableGapRuntime(statusSnapshot));
|
|
74
|
+
checks.push(...inspectStageTeamRuntime(statusSnapshot));
|
|
75
|
+
checks.push(...inspectWorkflowGateRuntime(statusSnapshot));
|
|
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);
|
|
61
84
|
|
|
62
85
|
return {
|
|
63
86
|
status: summarizeDoctorStatus(checks),
|
|
@@ -90,6 +113,191 @@ function unavailableRuntimeCheck(check: string, label: string, error: unknown):
|
|
|
90
113
|
}];
|
|
91
114
|
}
|
|
92
115
|
|
|
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[]> {
|
|
121
|
+
try {
|
|
122
|
+
const branchPartition = options.branch ? branchToSafePartition(options.branch) : null;
|
|
123
|
+
const states = (await readAllRunStates(projectRoot))
|
|
124
|
+
.filter((state) => options.allRuns || state.status !== 'archived')
|
|
125
|
+
.filter((state) => !branchPartition || state.partition === branchPartition || state.gitBranch === options.branch || (state.gitBranch ? branchToSafePartition(state.gitBranch) === branchPartition : false));
|
|
126
|
+
const staleOpenRuns: string[] = [];
|
|
127
|
+
const missingTestSteps: string[] = [];
|
|
128
|
+
const waitingDominatedRuns: string[] = [];
|
|
129
|
+
const slowValidationSteps: string[] = [];
|
|
130
|
+
const hostNoOutputRuns: string[] = [];
|
|
131
|
+
|
|
132
|
+
for (const state of states) {
|
|
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);
|
|
136
|
+
}
|
|
137
|
+
|
|
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);
|
|
145
|
+
}
|
|
146
|
+
|
|
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`);
|
|
153
|
+
}
|
|
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
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
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
|
+
}];
|
|
168
|
+
} catch (error) {
|
|
169
|
+
return unavailableRuntimeCheck('runtime_performance_observability', 'runtime performance observability', error);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
async function inspectValidationCacheVisibility(projectRoot: string, options: { branch?: string | null } = {}): Promise<DoctorCheck[]> {
|
|
174
|
+
try {
|
|
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);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
async function inspectRepairRecords(projectRoot: string, options: { branch?: string | null } = {}): Promise<DoctorCheck[]> {
|
|
191
|
+
try {
|
|
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
|
+
}
|
|
222
|
+
} catch {
|
|
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
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
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
|
+
|
|
93
301
|
function inspectContextTokenRuntime(snapshot: DoctorProjectStatusSnapshot): DoctorCheck[] {
|
|
94
302
|
if (!snapshot.status) {
|
|
95
303
|
return unavailableRuntimeCheck('context_token_runtime', 'token runtime projection', snapshot.error);
|
|
@@ -112,7 +320,7 @@ function inspectLifecycleRiskRuntime(snapshot: DoctorProjectStatusSnapshot): Doc
|
|
|
112
320
|
level: risk.status === 'blocked' || risk.status === 'incompatible' || risk.approvalPolicy === 'blocked' ? 'FAIL' : risk.status === 'missing' || risk.status === 'stale' || risk.approvalPolicy === 'human-required' ? 'WARN' : 'PASS',
|
|
113
321
|
check: 'lifecycle_risk_decision',
|
|
114
322
|
message: `status=${risk.status} profile=${risk.profile ?? 'none'} approval=${risk.approvalPolicy ?? 'none'} input=${risk.inputHash ?? 'none'} expected=${risk.expectedInputHash}`,
|
|
115
|
-
action: risk.status === 'fresh' ? undefined : `
|
|
323
|
+
action: risk.status === 'fresh' ? undefined : `sdd status --branch ${snapshot.status.branch} --compact-json`
|
|
116
324
|
}];
|
|
117
325
|
}
|
|
118
326
|
|
|
@@ -125,7 +333,7 @@ function inspectWorkflowHandoffRuntime(snapshot: DoctorProjectStatusSnapshot): D
|
|
|
125
333
|
level: handoff.status === 'blocked' || handoff.status === 'rejected' || handoff.status === 'incompatible' ? 'FAIL' : handoff.status === 'stale' ? 'WARN' : 'PASS',
|
|
126
334
|
check: 'workflow_handoff_state',
|
|
127
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}`,
|
|
128
|
-
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`
|
|
129
337
|
}];
|
|
130
338
|
}
|
|
131
339
|
|
|
@@ -153,4 +361,94 @@ function inspectSubagentDispatchRuntime(snapshot: DoctorProjectStatusSnapshot):
|
|
|
153
361
|
message: `status=${dispatches.status} dispatches=${dispatches.dispatches} blocking_open=${dispatches.blockingOpen} failed=${dispatches.failed} stale=${dispatches.stale} completed=${dispatches.completed} archived=${dispatches.archived} superseded=${dispatches.superseded}`,
|
|
154
362
|
action: dispatches.status === 'fresh' || dispatches.status === 'missing' ? undefined : dispatches.reasons.join(' ')
|
|
155
363
|
}];
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
function inspectCapabilityHealthRuntime(snapshot: DoctorProjectStatusSnapshot): DoctorCheck[] {
|
|
367
|
+
if (!snapshot.status) {
|
|
368
|
+
return unavailableRuntimeCheck('capability_health', 'capability health', snapshot.error);
|
|
369
|
+
}
|
|
370
|
+
const health = snapshot.status.capabilityHealth;
|
|
371
|
+
return [{
|
|
372
|
+
level: health.status === 'blocked' ? 'FAIL' : health.status === 'warn' ? 'WARN' : 'PASS',
|
|
373
|
+
check: 'capability_health',
|
|
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`
|
|
376
|
+
}];
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
function inspectWorkflowGateRuntime(snapshot: DoctorProjectStatusSnapshot): DoctorCheck[] {
|
|
380
|
+
if (!snapshot.status) {
|
|
381
|
+
return unavailableRuntimeCheck('workflow_gate_runtime', 'workflow gate runtime', snapshot.error);
|
|
382
|
+
}
|
|
383
|
+
const health = snapshot.status.workflowGateHealth;
|
|
384
|
+
const latest = health.latestDecision;
|
|
385
|
+
const level = health.blocked > 0 || health.humanRequired > 0 || health.warnings > 0 ? 'WARN' : 'PASS';
|
|
386
|
+
return [{
|
|
387
|
+
level,
|
|
388
|
+
check: 'workflow_gate_runtime',
|
|
389
|
+
message: `decisions=${health.decisions} blocked=${health.blocked} warn=${health.warnings} human_required=${health.humanRequired} latest=${latest ? `${latest.decisionKind}:${latest.status}:${latest.decisionId}` : 'none'}`,
|
|
390
|
+
action: level === 'PASS' ? undefined : `Workflow gate decisions are audit evidence; rerun the relevant gate command for current enforcement on ${snapshot.status.branch}.`
|
|
391
|
+
}];
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
function inspectStageTeamRuntime(snapshot: DoctorProjectStatusSnapshot): DoctorCheck[] {
|
|
395
|
+
if (!snapshot.status) {
|
|
396
|
+
return unavailableRuntimeCheck('stage_team_runtime', 'stage team runtime', snapshot.error);
|
|
397
|
+
}
|
|
398
|
+
const health = snapshot.status.stageTeamHealth;
|
|
399
|
+
const level = health.highConcernAdvisors > 0 || !health.directProfileRequiresNoTeam ? 'WARN' : 'PASS';
|
|
400
|
+
return [{
|
|
401
|
+
level,
|
|
402
|
+
check: 'stage_team_runtime',
|
|
403
|
+
message: `sessions=${health.sessions} role_results=${health.roleResults} advisors=${health.advisorAssessments} high_concern=${health.highConcernAdvisors} fan_in=${health.fanInEvidenceSets} profiles=${health.lifecycleProfiles.join(',') || 'none'} direct_required_team=${!health.directProfileRequiresNoTeam}`,
|
|
404
|
+
action: level === 'PASS' ? undefined : `Inspect task evidence for ${snapshot.status.branch}; agent-team and advisor outputs are gate inputs, not final lifecycle authority.`
|
|
405
|
+
}];
|
|
406
|
+
}
|
|
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
|
+
|
|
423
|
+
function inspectDurableGapRuntime(snapshot: DoctorProjectStatusSnapshot): DoctorCheck[] {
|
|
424
|
+
if (!snapshot.status) {
|
|
425
|
+
return unavailableRuntimeCheck('durable_gap_runtime', 'durable gap runtime', snapshot.error);
|
|
426
|
+
}
|
|
427
|
+
const gaps = snapshot.status.durableGaps;
|
|
428
|
+
const blocking = gaps.filter((gap) => gap.severity === 'blocking').length;
|
|
429
|
+
const warnings = gaps.filter((gap) => gap.severity === 'warning').length;
|
|
430
|
+
const tasks = [...new Set(gaps.map((gap) => gap.taskId).filter((taskId): taskId is string => typeof taskId === 'string'))].sort();
|
|
431
|
+
return [{
|
|
432
|
+
level: blocking > 0 ? 'FAIL' : warnings > 0 ? 'WARN' : 'PASS',
|
|
433
|
+
check: 'durable_gap_runtime',
|
|
434
|
+
message: `open=${gaps.length} blocking=${blocking} warning=${warnings} tasks=${tasks.join(',') || 'none'}`,
|
|
435
|
+
action: gaps.length > 0 ? `Inspect task evidence or status for ${snapshot.status.branch}; terminal durable gap closure is runtime/gate-policy controlled.` : undefined
|
|
436
|
+
}];
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
function inspectLatestEligibleRunSelector(snapshot: DoctorProjectStatusSnapshot): DoctorCheck[] {
|
|
440
|
+
if (!snapshot.status) {
|
|
441
|
+
return unavailableRuntimeCheck('latest_eligible_run_selector', 'latest eligible run selector', snapshot.error);
|
|
442
|
+
}
|
|
443
|
+
const selections = snapshot.status.latestEligibleRunsByTask;
|
|
444
|
+
const selected = selections.filter((selection) => selection.selected).length;
|
|
445
|
+
const candidates = selections.reduce((sum, selection) => sum + selection.candidates.length, 0);
|
|
446
|
+
const rejected = selections.reduce((sum, selection) => sum + selection.rejected.length, 0);
|
|
447
|
+
const blockedTasks = selections.filter((selection) => !selection.selected && selection.candidates.length > 0).map((selection) => selection.taskId);
|
|
448
|
+
return [{
|
|
449
|
+
level: blockedTasks.length > 0 ? 'WARN' : 'PASS',
|
|
450
|
+
check: 'latest_eligible_run_selector',
|
|
451
|
+
message: `tasks=${selections.length} selected=${selected} candidates=${candidates} rejected=${rejected} blocked_tasks=${blockedTasks.join(',') || 'none'}`,
|
|
452
|
+
action: blockedTasks.length > 0 ? `Inspect rejected candidates with sdd status --branch ${snapshot.status.branch}; default apply only uses compatible eligible runs.` : undefined
|
|
453
|
+
}];
|
|
156
454
|
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { branchToSafePartition } from '../path-safety.js';
|
|
2
|
+
import { listRuntimeArtifactPayloads } from '../storage/runtime-store.js';
|
|
3
|
+
import type { RuntimeArtifactPayloadRecord, RuntimeArtifactPayloadStatus } from '../storage/runtime-store.js';
|
|
4
|
+
|
|
5
|
+
export const EVIDENCE_LOOKUP_CONTRACT_VERSION = 'phase-8.12-evidence-lookup-v1';
|
|
6
|
+
|
|
7
|
+
export interface EvidenceLookupFilters {
|
|
8
|
+
branch?: string | null;
|
|
9
|
+
runId?: string | null;
|
|
10
|
+
taskId?: string | null;
|
|
11
|
+
logicalRef?: string | null;
|
|
12
|
+
status?: RuntimeArtifactPayloadStatus | 'any' | null;
|
|
13
|
+
role?: string | null;
|
|
14
|
+
kind?: string | null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface EvidenceLookupResult {
|
|
18
|
+
contract: typeof EVIDENCE_LOOKUP_CONTRACT_VERSION;
|
|
19
|
+
generatedAt: string;
|
|
20
|
+
retrievalMemoryOnly: true;
|
|
21
|
+
gateTruthAuthority: false;
|
|
22
|
+
reason: string;
|
|
23
|
+
filters: EvidenceLookupFilters;
|
|
24
|
+
payloads: RuntimeArtifactPayloadRecord[];
|
|
25
|
+
resolvedPayloads: RuntimeArtifactPayloadRecord[];
|
|
26
|
+
counts: Record<RuntimeArtifactPayloadStatus, number>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export async function lookupEvidence(projectRoot: string, filters: EvidenceLookupFilters = {}): Promise<EvidenceLookupResult> {
|
|
30
|
+
const payloads = await listRuntimeArtifactPayloads(projectRoot, {
|
|
31
|
+
runId: filters.runId ?? null,
|
|
32
|
+
branchSlug: filters.branch ? branchToSafePartition(filters.branch) : null,
|
|
33
|
+
taskId: filters.taskId ?? null,
|
|
34
|
+
logicalRef: filters.logicalRef ?? null,
|
|
35
|
+
status: filters.status && filters.status !== 'any' ? filters.status : null
|
|
36
|
+
});
|
|
37
|
+
const filtered = payloads.filter((payload) => matchesMetadata(payload, filters));
|
|
38
|
+
const resolvedPayloads = resolveActivePayloads(filtered);
|
|
39
|
+
return {
|
|
40
|
+
contract: EVIDENCE_LOOKUP_CONTRACT_VERSION,
|
|
41
|
+
generatedAt: new Date().toISOString(),
|
|
42
|
+
retrievalMemoryOnly: true,
|
|
43
|
+
gateTruthAuthority: false,
|
|
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
|
+
filters,
|
|
46
|
+
payloads: filtered,
|
|
47
|
+
resolvedPayloads,
|
|
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
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function matchesMetadata(payload: RuntimeArtifactPayloadRecord, filters: EvidenceLookupFilters): boolean {
|
|
66
|
+
if (filters.role && payload.artifactRole !== filters.role) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
if (filters.kind && payload.artifactRole !== filters.kind) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function resolveActivePayloads(payloads: RuntimeArtifactPayloadRecord[]): RuntimeArtifactPayloadRecord[] {
|
|
76
|
+
const byLogicalRef = new Map<string, RuntimeArtifactPayloadRecord>();
|
|
77
|
+
for (const payload of payloads) {
|
|
78
|
+
if (payload.status !== 'active') {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
const key = `${payload.branchSlug}\\0${payload.taskId ?? ''}\\0${payload.logicalRef}`;
|
|
82
|
+
const current = byLogicalRef.get(key);
|
|
83
|
+
if (!current || payload.sequence > current.sequence || (payload.sequence === current.sequence && payload.createdAt > current.createdAt)) {
|
|
84
|
+
byLogicalRef.set(key, payload);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return Array.from(byLogicalRef.values()).sort((left, right) => right.createdAt.localeCompare(left.createdAt) || right.sequence - left.sequence);
|
|
88
|
+
}
|
|
@@ -3,6 +3,7 @@ import { TEST_EVIDENCE_RUN_CONTRACT_VERSION } from '../contracts.js';
|
|
|
3
3
|
|
|
4
4
|
export type TestEvidenceStatus = 'PASS' | 'FAIL' | 'BLOCKED';
|
|
5
5
|
export type EvidenceCoverageStatus = 'complete' | 'partial' | 'missing' | 'stale';
|
|
6
|
+
export type CapabilityEvidenceClass = 'accepted' | 'candidate' | 'quarantined' | 'diagnostic' | 'blocked';
|
|
6
7
|
|
|
7
8
|
export interface TestCommandEvidence {
|
|
8
9
|
command: string;
|
|
@@ -21,6 +22,16 @@ export interface AcceptanceEvidenceCoverage {
|
|
|
21
22
|
gaps: string[];
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
export interface CapabilityEvidenceClassification {
|
|
26
|
+
class: CapabilityEvidenceClass;
|
|
27
|
+
source: 'professional_capability' | 'external_source' | 'runtime_diagnostic';
|
|
28
|
+
domainOrSourceId: string;
|
|
29
|
+
evidenceRefs: RuntimeRef[];
|
|
30
|
+
acceptanceRefs: string[];
|
|
31
|
+
provenanceRefs: RuntimeRef[];
|
|
32
|
+
reason: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
24
35
|
export interface UnifiedTestEvidenceRun {
|
|
25
36
|
contract: typeof TEST_EVIDENCE_RUN_CONTRACT_VERSION;
|
|
26
37
|
id: string;
|
|
@@ -30,7 +41,7 @@ export interface UnifiedTestEvidenceRun {
|
|
|
30
41
|
policyJudgment: TestEvidenceStatus;
|
|
31
42
|
commands: TestCommandEvidence[];
|
|
32
43
|
acceptanceCoverage: AcceptanceEvidenceCoverage[];
|
|
33
|
-
|
|
44
|
+
capabilityEvidence: CapabilityEvidenceClassification[];
|
|
34
45
|
gaps: string[];
|
|
35
46
|
next: string;
|
|
36
47
|
generatedAt: string;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
|
-
import {
|
|
2
|
+
import { readdir, readFile } from 'node:fs/promises';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import {
|
|
5
5
|
AGENT_EXECUTION_RECORD_CONTRACT_VERSION,
|
|
6
6
|
TEAM_SESSION_RECORD_CONTRACT_VERSION
|
|
7
7
|
} from '../contracts.js';
|
|
8
8
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
getTeamSessionRecordPath,
|
|
12
|
-
getTeamSessionsDir
|
|
9
|
+
getLegacyAgentExecutionsDir,
|
|
10
|
+
getLegacyTeamSessionsDir
|
|
13
11
|
} from '../runtime-paths.js';
|
|
14
12
|
import { exists } from '../storage/json-io.js';
|
|
13
|
+
import { listRuntimeAgentExecutions, listRuntimeTeamSessions, recordRuntimeAgentExecution, recordRuntimeTeamSession } from '../storage/runtime-store.js';
|
|
15
14
|
import { BUILT_IN_SKILL_CAPABILITIES } from '../registries/skill-capabilities.js';
|
|
16
15
|
import type { ArtifactResultIngestionRecord } from '../artifacts/ingestion.js';
|
|
17
16
|
import type {
|
|
@@ -24,19 +23,21 @@ import type {
|
|
|
24
23
|
} from '../router/agent-runtime.js';
|
|
25
24
|
|
|
26
25
|
export async function writeAgentExecutionRecord(projectRoot: string, record: AgentExecutionRecord): Promise<AgentExecutionRecord> {
|
|
27
|
-
await
|
|
28
|
-
await writeFile(getAgentExecutionRecordPath(projectRoot, record.runId, record.executionId), `${JSON.stringify(record, null, 2)}\n`, 'utf8');
|
|
26
|
+
await recordRuntimeAgentExecution(projectRoot, record);
|
|
29
27
|
return record;
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
export async function writeTeamSessionRecord(projectRoot: string, record: TeamSessionRecord): Promise<TeamSessionRecord> {
|
|
33
|
-
await
|
|
34
|
-
await writeFile(getTeamSessionRecordPath(projectRoot, record.runId, record.teamId), `${JSON.stringify(record, null, 2)}\n`, 'utf8');
|
|
31
|
+
await recordRuntimeTeamSession(projectRoot, record);
|
|
35
32
|
return record;
|
|
36
33
|
}
|
|
37
34
|
|
|
38
35
|
export async function listAgentExecutionRecords(projectRoot: string, runId: string): Promise<AgentExecutionRecord[]> {
|
|
39
|
-
const
|
|
36
|
+
const runtimeRecords = await listRuntimeAgentExecutions(projectRoot, runId);
|
|
37
|
+
if (runtimeRecords.length > 0) {
|
|
38
|
+
return runtimeRecords;
|
|
39
|
+
}
|
|
40
|
+
const recordsDir = getLegacyAgentExecutionsDir(projectRoot, runId);
|
|
40
41
|
if (!await exists(recordsDir)) {
|
|
41
42
|
return [];
|
|
42
43
|
}
|
|
@@ -54,7 +55,11 @@ export async function listAgentExecutionRecords(projectRoot: string, runId: stri
|
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
export async function listTeamSessionRecords(projectRoot: string, runId: string): Promise<TeamSessionRecord[]> {
|
|
57
|
-
const
|
|
58
|
+
const runtimeRecords = await listRuntimeTeamSessions(projectRoot, runId);
|
|
59
|
+
if (runtimeRecords.length > 0) {
|
|
60
|
+
return runtimeRecords;
|
|
61
|
+
}
|
|
62
|
+
const recordsDir = getLegacyTeamSessionsDir(projectRoot, runId);
|
|
58
63
|
if (!await exists(recordsDir)) {
|
|
59
64
|
return [];
|
|
60
65
|
}
|
|
@@ -9,13 +9,23 @@ import { doctor } from '../doctor/doctor.js';
|
|
|
9
9
|
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
|
+
import { writeVerifyContract } from '../verification/verify-contract.js';
|
|
13
|
+
import { evaluateLifecycleRiskDecisionForModel, recordLifecycleRiskDecisionProjection } from '../risk.js';
|
|
14
|
+
import { parseSddBranch } from '../sdd-docs/task-parser.js';
|
|
12
15
|
import { inspectBackgroundExecutor, runBackgroundExecutor } from './background-executor.js';
|
|
13
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
|
+
|
|
14
22
|
test('background executor claims one delegation and persists background run state', async () => {
|
|
15
23
|
const root = await mkdtemp(path.join(tmpdir(), 'sdd-background-claim-'));
|
|
16
24
|
try {
|
|
17
25
|
await initProject(root);
|
|
18
26
|
await writeBranchDocs(root, 'master', validTaskMarkdown('B1', []));
|
|
27
|
+
await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
|
|
28
|
+
await seedLifecycleRiskDecision(root, 'master');
|
|
19
29
|
|
|
20
30
|
const result = await runBackgroundExecutor(root, { taskId: 'B1' });
|
|
21
31
|
const state = await readRunState(root, result.runId);
|
|
@@ -39,6 +49,8 @@ test('background executor ingests supplied artifact and reaches terminal state',
|
|
|
39
49
|
try {
|
|
40
50
|
await initProject(root);
|
|
41
51
|
await writeBranchDocs(root, 'master', validTaskMarkdown('B1', []));
|
|
52
|
+
await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
|
|
53
|
+
await seedLifecycleRiskDecision(root, 'master');
|
|
42
54
|
|
|
43
55
|
const claimed = await runBackgroundExecutor(root, { taskId: 'B1' });
|
|
44
56
|
await writeArtifact(root, claimed.runId, 'implementer-B1.md', validResultArtifact('implementer', 'B1', 'PASS', 'artifacts/implementer-B1.md'));
|
|
@@ -63,16 +75,53 @@ test('background executor ingests supplied artifact and reaches terminal state',
|
|
|
63
75
|
}
|
|
64
76
|
});
|
|
65
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
|
+
|
|
66
113
|
test('claude code subagent worker spawns host process and ingests stdout artifact', async () => {
|
|
67
114
|
const root = await mkdtemp(path.join(tmpdir(), 'sdd-background-claude-host-'));
|
|
68
115
|
try {
|
|
69
116
|
await initProject(root);
|
|
70
117
|
await writeBranchDocs(root, 'master', validTaskMarkdown('B1', []));
|
|
118
|
+
await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
|
|
119
|
+
await seedLifecycleRiskDecision(root, 'master');
|
|
71
120
|
const hostScript = path.join(root, 'fake-claude-host.mjs');
|
|
72
121
|
await writeFile(hostScript, [
|
|
73
122
|
"const prompt = process.argv[2] ?? '';",
|
|
74
123
|
"if (!prompt.includes('Queue item id:')) process.exit(2);",
|
|
75
|
-
"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');"
|
|
76
125
|
].join('\n'), 'utf8');
|
|
77
126
|
|
|
78
127
|
const completed = await runBackgroundExecutor(root, {
|
|
@@ -86,7 +135,7 @@ test('claude code subagent worker spawns host process and ingests stdout artifac
|
|
|
86
135
|
|
|
87
136
|
assert.equal(completed.status, 'completed');
|
|
88
137
|
assert.equal(completed.hostInvocation?.exitCode, 0);
|
|
89
|
-
assert.equal(completed.hostInvocation?.artifactPath, '
|
|
138
|
+
assert.equal(completed.hostInvocation?.artifactPath, '.sdd/runs/master/do/implementer-B1.md');
|
|
90
139
|
assert.equal(completed.ingestion?.delegationStatus, 'COMPLETED');
|
|
91
140
|
assert.equal(state.delegations['B-B1-implementer-001']?.status, 'COMPLETED');
|
|
92
141
|
assert.equal(inspection.terminalDelegations, 1);
|
|
@@ -101,6 +150,8 @@ test('background executor blocks invalid artifact evidence instead of completing
|
|
|
101
150
|
try {
|
|
102
151
|
await initProject(root);
|
|
103
152
|
await writeBranchDocs(root, 'master', validTaskMarkdown('B1', []));
|
|
153
|
+
await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
|
|
154
|
+
await seedLifecycleRiskDecision(root, 'master');
|
|
104
155
|
|
|
105
156
|
const claimed = await runBackgroundExecutor(root, { taskId: 'B1' });
|
|
106
157
|
await writeArtifact(root, claimed.runId, 'implementer-B1.md', '# Missing contract\n');
|
|
@@ -125,6 +176,8 @@ test('background executor requires approval for database manual gate and accepts
|
|
|
125
176
|
try {
|
|
126
177
|
await initProject(root);
|
|
127
178
|
await writeBranchDocs(root, 'master', validTaskMarkdown('B1', []).replace('risk: []', 'risk:\n - database'));
|
|
179
|
+
await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
|
|
180
|
+
await seedLifecycleRiskDecision(root, 'master');
|
|
128
181
|
|
|
129
182
|
const blocked = await runBackgroundExecutor(root, { taskId: 'B1' });
|
|
130
183
|
assert.equal(blocked.status, 'blocked');
|
|
@@ -153,6 +206,8 @@ test('background executor blocks manual handoff worker adapters', async () => {
|
|
|
153
206
|
try {
|
|
154
207
|
await initProject(root);
|
|
155
208
|
await writeBranchDocs(root, 'master', validTaskMarkdown('B1', []));
|
|
209
|
+
await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
|
|
210
|
+
await seedLifecycleRiskDecision(root, 'master');
|
|
156
211
|
|
|
157
212
|
const result = await runBackgroundExecutor(root, { taskId: 'B1', workerAdapterId: 'manual-handoff-worker' });
|
|
158
213
|
|