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
|
@@ -88,21 +88,38 @@ Use the local or globally installed \`sdd\` CLI as the source of truth for this
|
|
|
88
88
|
|
|
89
89
|
1. Accept the user's natural-language intent, then run \`sdd status\` first and report only workflow state, blocker/current task, and the recommended next command; do not paste or restate full status unless asked.
|
|
90
90
|
2. Run \`sdd instructions overview --json\` only when the next action is unclear or you need the full dynamic command contract.
|
|
91
|
-
3. Dynamic routing comes from CLI/core output, not this skill text; follow the recommended next command before choosing a
|
|
92
|
-
4. If the intent is still ambiguous after status, ask one clarifying question before spec/plan/do/test/
|
|
91
|
+
3. Dynamic routing comes from CLI/core output, not this skill text; follow the recommended next command before choosing a projected command bundle (\`spec\`, \`plan\`, \`tasks\`, \`do\`, \`test\`, \`ship\`, or \`doctor\`). The \`tasks\` bundle covers \`tasks -> verifies\`; the \`test\` bundle covers \`test -> goal-verify\`.
|
|
92
|
+
4. If the intent is still ambiguous after status, ask one clarifying question before spec/plan/do/test/ship work.
|
|
93
93
|
5. For risky requests that mention state-machine, concurrency, database, SQL, security, API/schema, CI/build, or external unknowns, run \`sdd lifecycle decide --from-text <text>\` before spec/plan work.
|
|
94
|
-
6. If status reports workflow_status=not_started,
|
|
94
|
+
6. If status reports workflow_status=not_started, start the spec stage for the resolved Git branch partition; do not use \`sdd init\` as the workflow branch entry.
|
|
95
95
|
7. If status points to gaps, drift, or doctor/update work, handle that maintenance action before do/test/ship.
|
|
96
|
-
8. If status recommends a task, run \`sdd tasks inspect <task_id>\` and use the task Boundary and Acceptance before
|
|
97
|
-
9. If status recommends do,
|
|
98
|
-
10. If status
|
|
99
|
-
11. If the user asks to release or go online,
|
|
96
|
+
8. If status recommends a task, run \`sdd tasks inspect <task_id>\` and use the task Boundary and Acceptance before starting \`do\`.
|
|
97
|
+
9. If status recommends do, tasks, or test, follow the corresponding projected command bundle or its canonical CLI command instead of inferring completion from chat.
|
|
98
|
+
10. If status exposes projection drift, run \`sdd doctor\` and follow diagnostic/recovery guidance before resuming the ordinary happy path.
|
|
99
|
+
11. If the user asks to release or go online, run \`sdd ship close --branch <branch> --json\` for local readiness first; do not publish, push, tag, or create external release state without explicit confirmation.
|
|
100
100
|
|
|
101
101
|
Refresh this managed skill with \`sdd update\` when drift is reported.
|
|
102
102
|
`
|
|
103
103
|
},
|
|
104
104
|
|
|
105
105
|
commandEntry('sdd-doctor', '.claude/commands/sdd/doctor.md', 'doctor', 'Check project config, scoped run evidence, generated AI entry drift, and use sdd doctor fast|deep|recover for explicit diagnostic scope.'),
|
|
106
|
+
{
|
|
107
|
+
id: 'sdd-update',
|
|
108
|
+
kind: 'command',
|
|
109
|
+
relativePath: '.claude/commands/sdd/update.md',
|
|
110
|
+
title: 'SDD update',
|
|
111
|
+
body: `Refresh SDD-managed AI entries and re-import declared external/user-global/project skill capability metadata through the same idempotent update path used by init bootstrap. Use this for existing initialized projects when generated entries drift or a skill import needs dedupe/refresh.
|
|
112
|
+
|
|
113
|
+
Run:
|
|
114
|
+
|
|
115
|
+
\`\`\`bash
|
|
116
|
+
sdd update
|
|
117
|
+
sdd update --import-skill <capability_id> --source project|user-global|external --source-ref <path-or-reference> --domain <domain> --stage <stage>
|
|
118
|
+
\`\`\`
|
|
119
|
+
|
|
120
|
+
This command is maintenance only: it updates SDD-managed projections and non-authoritative skill capability metadata in .sdd/project.yml. It does not execute imported skills, grant lifecycle authority, close gates, or publish external state.
|
|
121
|
+
`
|
|
122
|
+
},
|
|
106
123
|
{
|
|
107
124
|
id: 'sdd-spec',
|
|
108
125
|
kind: 'command',
|
|
@@ -119,7 +136,7 @@ sdd instructions spec --json
|
|
|
119
136
|
|
|
120
137
|
Then create or refine \`specs/<partition>/spec.md\` with objective/customer value, problem/intent, users/actors, user stories or scenarios, in-scope/out-of-scope boundaries, functional and non-functional requirements, acceptance criteria with stable IDs such as AC-1, assumptions/dependencies, risks/hard gates, open questions, and lifecycle decision reference.
|
|
121
138
|
|
|
122
|
-
Repeated
|
|
139
|
+
Repeated spec-stage revisions represent requirement revisions. If plan/tasks/run evidence already exists, status must expose stale downstream hash state before plan/tasks/do continues.
|
|
123
140
|
|
|
124
141
|
Do not design implementation in \`spec.md\`; stop before plan work when requirements, acceptance IDs, or risk gates are unclear.
|
|
125
142
|
`
|
|
@@ -129,122 +146,106 @@ Do not design implementation in \`spec.md\`; stop before plan work when requirem
|
|
|
129
146
|
kind: 'command',
|
|
130
147
|
relativePath: '.claude/commands/sdd/plan.md',
|
|
131
148
|
title: 'SDD plan',
|
|
132
|
-
body: `Refine
|
|
149
|
+
body: `Refine specs/<branch>/plan.md and .sdd/runs/<branch>/plan/*.md as agent-authored plan-stage evidence. Runtime close validates refs, hashes, contracts, and handoff state into .sdd/runtime.sqlite; it must not create or modify Markdown.
|
|
133
150
|
|
|
134
151
|
Run:
|
|
135
152
|
|
|
136
153
|
\`\`\`bash
|
|
137
154
|
sdd instructions plan --json
|
|
155
|
+
sdd plan close --branch <branch> --json
|
|
138
156
|
\`\`\`
|
|
139
157
|
|
|
140
|
-
Then write or refine \`specs/<branch>/plan.md\` as the technical bridge from approved spec to task-ready execution.
|
|
158
|
+
Then write or refine \`specs/<branch>/plan.md\` as the technical bridge from approved spec to task-ready execution. Have planner/reviewer/plan-manager author \`.sdd/runs/<branch>/plan/*.md\` evidence, including \`plan-collaboration-contract-vN.md\`, before close.
|
|
141
159
|
|
|
142
|
-
Use PlantUML fences for diagrams when useful: component diagrams for impact surface, sequence/activity diagrams for workflows and concurrency, state diagrams for state-machine risk, and deployment/data diagrams when release or data topology matters.
|
|
160
|
+
Use PlantUML fences for diagrams when useful: component diagrams for impact surface, sequence/activity diagrams for workflows and concurrency, state diagrams for state-machine risk, and deployment/data diagrams when release or data topology matters. Stop before tasks when the technical solution is incomplete or has unresolved design gaps.
|
|
143
161
|
|
|
144
|
-
|
|
145
|
-
`
|
|
162
|
+
Do not let runtime author, repair, normalize, or migrate Markdown.`
|
|
146
163
|
},
|
|
147
164
|
{
|
|
148
165
|
id: 'sdd-tasks',
|
|
149
166
|
kind: 'command',
|
|
150
167
|
relativePath: '.claude/commands/sdd/tasks.md',
|
|
151
168
|
title: 'SDD tasks',
|
|
152
|
-
body: `
|
|
169
|
+
body: `Use this generated command as the user-visible bundle for the \`tasks -> verifies\` runtime stages. First refine specs/<branch>/tasks.md and .sdd/runs/<branch>/tasks/*.md as agent-authored tasks-stage evidence, then continue to verifies through this bundle only after runtime/status targets that internal stage.
|
|
153
170
|
|
|
154
171
|
Run:
|
|
155
172
|
|
|
156
173
|
\`\`\`bash
|
|
174
|
+
sdd status
|
|
157
175
|
sdd instructions tasks --json
|
|
158
176
|
sdd tasks format
|
|
177
|
+
sdd tasks close --branch <branch> --json
|
|
178
|
+
sdd tasks close --branch <branch> --target verifies --json
|
|
159
179
|
\`\`\`
|
|
160
180
|
|
|
161
|
-
|
|
181
|
+
Workflow:
|
|
162
182
|
|
|
163
|
-
|
|
164
|
-
|
|
183
|
+
1. Write or refine \`specs/<branch>/tasks.md\` from the approved spec and plan. Include Delivery Map, implementation waves, validation batches/waves, review gate declarations, task blocks with acceptance_refs and plan_refs, affected_files, change_surface, implementation_wave, validation_batch, validation_timing, requires_verify_before_next, validation, risk, agent_fit, allowed_agents, required_artifacts, verification_availability, autonomy, plus companion sections for Boundary, Acceptance, Definition of Done, Evidence Expectations, and Implementation Notes.
|
|
184
|
+
2. Have task-planner/reviewer/tasks-manager author \`.sdd/runs/<branch>/tasks/*.md\` evidence, including \`tasks-collaboration-contract-vN.md\`, before \`sdd tasks close\`. Keep metadata inside the \`\`\`sdd-task fenced block and companion sections outside it.
|
|
185
|
+
3. Run \`sdd tasks close --branch <branch> --json\`; runtime validates refs/frontmatter/hashes/contracts and writes only SQLite.
|
|
186
|
+
4. If the fresh runtime handoff targets \`verifies\` inside this same bundle, have verification-designer/reviewer/verifies-manager author \`specs/<branch>/verify.md\` plus \`.sdd/runs/<branch>/verifies/*.md\` evidence, including \`verifies-collaboration-contract-vN.md\`.
|
|
187
|
+
5. Run \`sdd tasks close --branch <branch> --target verifies --json\`; runtime validates verifies-stage refs/contracts and returns the next legal route.
|
|
188
|
+
|
|
189
|
+
Do not implement code, run validation commands, silently advance to do, or let runtime author Markdown.`
|
|
165
190
|
},
|
|
166
191
|
{
|
|
167
192
|
id: 'sdd-test',
|
|
168
193
|
kind: 'command',
|
|
169
194
|
relativePath: '.claude/commands/sdd/test.md',
|
|
170
195
|
title: 'SDD test',
|
|
171
|
-
body: `
|
|
196
|
+
body: `Use this generated command as the user-visible bundle for the \`test -> goal-verify\` runtime stages. Bind validation intent to an accepted verify.md validation unit, execute that unit, keep command summaries in runtime read models, have test-stage agents author .sdd/runs/<branch>/test/*.md evidence, then continue to goal verification through this bundle only after runtime/status targets that internal stage.
|
|
172
197
|
|
|
173
198
|
Run:
|
|
174
199
|
|
|
175
200
|
\`\`\`bash
|
|
176
201
|
sdd status
|
|
177
202
|
sdd instructions test --json
|
|
178
|
-
sdd
|
|
179
|
-
sdd test
|
|
203
|
+
sdd test <validation_unit_id-or-validation_text> --branch <branch>
|
|
204
|
+
sdd test close --branch <branch> --json
|
|
205
|
+
sdd test close --branch <branch> --target goal-verify --json
|
|
180
206
|
\`\`\`
|
|
181
207
|
|
|
182
208
|
Workflow:
|
|
183
209
|
|
|
184
|
-
1. Confirm \`verify.md\` exists
|
|
185
|
-
2.
|
|
186
|
-
3.
|
|
187
|
-
4.
|
|
210
|
+
1. Confirm accepted \`verify.md\` exists for the selected branch; if missing or stale, return to verifies through the tasks bundle.
|
|
211
|
+
2. Use \`sdd test <validation_unit_id-or-validation_text> --branch <branch>\` as the normal entry; task id, validation batch id, and accepted task title/text are equivalent only when they bind to one verify.md validation unit.
|
|
212
|
+
3. Use \`sdd test task|batch|wave\` only for explicit low-level diagnostics, replay, or narrowed override flags such as \`--command\`, \`--run\`, \`--command-json\`, \`--command-file\`, or passthrough argv.
|
|
213
|
+
4. Have test-runner/reviewer/test-manager author \`.sdd/runs/<branch>/test/*.md\` evidence, including \`test-collaboration-contract-vN.md\`; PASS command output should not create log artifacts unless the validation contract explicitly needs stdout/stderr as primary evidence.
|
|
214
|
+
5. Run \`sdd test close --branch <branch> --json\`; runtime validates refs/frontmatter/hashes/contracts and writes only SQLite.
|
|
215
|
+
6. If the fresh runtime handoff targets \`goal-verify\` inside this same bundle, have goal-verifier/reviewer author \`.sdd/runs/<branch>/goal-verify/*.md\` evidence, then run \`sdd test close --branch <branch> --target goal-verify --json\` so runtime records truthAlignment before ship readiness.
|
|
188
216
|
|
|
189
|
-
Do not auto-fix failures,
|
|
190
|
-
`
|
|
217
|
+
Do not auto-fix failures, author or refresh \`verify.md\`, mutate \`tasks.md\`, commit, publish, or treat command success alone as semantic PASS.`
|
|
191
218
|
},
|
|
192
219
|
{
|
|
193
220
|
id: 'sdd-do',
|
|
194
221
|
kind: 'command',
|
|
195
222
|
relativePath: '.claude/commands/sdd/do.md',
|
|
196
223
|
title: 'SDD do',
|
|
197
|
-
body: `
|
|
224
|
+
body: `Semantically bind /sdd:do or sdd do task input to one accepted task boundary, then run do-stage collaboration: implementer/reviewer/do-manager write .sdd/runs/<branch>/do/*.md evidence and runtime reconciles gate truth into SQLite.
|
|
198
225
|
|
|
199
226
|
Run:
|
|
200
227
|
|
|
201
228
|
\`\`\`bash
|
|
202
229
|
sdd status
|
|
203
230
|
sdd instructions do --json
|
|
204
|
-
sdd tasks inspect <
|
|
231
|
+
sdd tasks inspect <bound_task_id>
|
|
205
232
|
\`\`\`
|
|
206
233
|
|
|
207
234
|
Workflow:
|
|
208
235
|
|
|
209
|
-
|
|
236
|
+
Use CLI/core output as the source of truth. Task id and accepted task title/text are equivalent when they bind to the same accepted task boundary. Agent evidence flow: implementer edits only inside the bound task boundary and writes \`.sdd/runs/<branch>/do/implementation-vN.md\`; code-reviewer writes \`.sdd/runs/<branch>/do/code-review-vN.md\`; do-manager writes \`.sdd/runs/<branch>/do/do-manager-vN.md\` as a closure request. Runtime reads these Markdown refs/hashes/frontmatter, validates the gate, and writes only SQLite projections/run state. This command entry does not authorize autonomous background execution.
|
|
210
237
|
|
|
211
238
|
|
|
212
|
-
1.
|
|
213
|
-
2.
|
|
239
|
+
1. Run \`sdd status\`, then let CLI/core bind the user request or recommended next command to exactly one accepted task boundary. Stop if binding is ambiguous, missing, stale, or boundary-expanding.
|
|
240
|
+
2. Run \`sdd instructions do --json\` and \`sdd tasks inspect <bound_task_id>\`; restate only the bound task Boundary, blocking gaps, and validation commands.
|
|
214
241
|
3. Work only inside the selected task boundary; do not expand scope without a checkpoint.
|
|
215
|
-
4.
|
|
216
|
-
5.
|
|
217
|
-
6.
|
|
218
|
-
7.
|
|
242
|
+
4. Implement within affected_files and capture changed file refs/hashes in \`.sdd/runs/<branch>/do/implementation-vN.md\` frontmatter.
|
|
243
|
+
5. Have code-reviewer write \`.sdd/runs/<branch>/do/code-review-vN.md\` against the implementation evidence hash, whether approved or blocked.
|
|
244
|
+
6. Have do-manager write \`.sdd/runs/<branch>/do/do-manager-vN.md\` as a closure request that references the reviewed implementation and review hash.
|
|
245
|
+
7. Run \`sdd do task <task_id-or-task-text> --branch <branch>\`; runtime must read \`.sdd/runs/<branch>/do/*.md\`, validate frontmatter/hash/review/manager closure, and write only SQLite projections/run state.
|
|
246
|
+
8. Report the run id, status, binding target, blocking gaps, accepted evidence refs, and next gate. If completed, proceed to \`sdd test <validation_unit_id-or-validation_text> --branch <branch>\` for verification.
|
|
219
247
|
|
|
220
|
-
Do not create worktrees, auto commit,
|
|
221
|
-
`
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
id: 'sdd-sync-back',
|
|
225
|
-
kind: 'command',
|
|
226
|
-
relativePath: '.claude/commands/sdd/sync-back.md',
|
|
227
|
-
title: 'SDD sync-back',
|
|
228
|
-
body: `Inspect and optionally apply the verified task completion proposal back into tasks.md. Sync-back is a document write-back gate, not another implementation step.
|
|
229
|
-
|
|
230
|
-
Run:
|
|
231
|
-
|
|
232
|
-
\`\`\`bash
|
|
233
|
-
sdd status
|
|
234
|
-
sdd instructions sync-back --json
|
|
235
|
-
sdd sync-back inspect --branch <branch> --task <task_id>
|
|
236
|
-
\`\`\`
|
|
237
|
-
|
|
238
|
-
Workflow:
|
|
239
|
-
|
|
240
|
-
1. Resolve exactly one task id and workflow partition from \`sdd status\`, the recommended command, or the user request. Stop and ask if either is ambiguous.
|
|
241
|
-
2. Run \`sdd sync-back inspect --branch <branch> --task <task_id>\` before any apply; pass \`<run_id>\` only for replay, CI, or old-run inspection.
|
|
242
|
-
3. Report what apply would write: target tasks file, task id, markdown status transition, proposal path, evidence artifacts, apply_policy, and policy reasons.
|
|
243
|
-
4. If inspect reports \`status=ready\` and \`apply_policy=direct\`, run \`sdd sync-back apply --branch <branch> --task <task_id>\`.
|
|
244
|
-
5. If inspect reports approval_required=true, ask for explicit human confirmation and only then run \`sdd sync-back apply --branch <branch> --task <task_id> --approved\`.
|
|
245
|
-
6. Explain that apply writes only tasks.md for the target task, appends the sync-back implementation note, marks run sync_back applied, and rebuilds the local run index.
|
|
246
|
-
|
|
247
|
-
Do not apply without inspect, do not use \`--approved\` without human confirmation, and do not change source files during sync-back.
|
|
248
|
+
Do not create worktrees, auto commit, mark missing evidence as PASS, or let runtime author Markdown artifacts.
|
|
248
249
|
`
|
|
249
250
|
},
|
|
250
251
|
{
|
|
@@ -252,26 +253,26 @@ Do not apply without inspect, do not use \`--approved\` without human confirmati
|
|
|
252
253
|
kind: 'command',
|
|
253
254
|
relativePath: '.claude/commands/sdd/ship.md',
|
|
254
255
|
title: 'SDD ship',
|
|
255
|
-
body: `
|
|
256
|
+
body: `Close ship readiness through agent-authored .sdd/runs/<branch>/ship/*.md evidence. Optional specs/<branch>/release.md is ship-agent authored, not runtime-authored.
|
|
256
257
|
|
|
257
258
|
Run:
|
|
258
259
|
|
|
259
260
|
\`\`\`bash
|
|
260
|
-
sdd
|
|
261
|
+
sdd status
|
|
261
262
|
sdd instructions ship --json
|
|
263
|
+
sdd ship close --branch <branch> --json
|
|
262
264
|
\`\`\`
|
|
263
265
|
|
|
264
266
|
Workflow:
|
|
265
267
|
|
|
266
268
|
1. Resolve the target branch/partition from \`sdd status\` or the user's explicit branch.
|
|
267
|
-
2.
|
|
268
|
-
3.
|
|
269
|
-
4.
|
|
269
|
+
2. Confirm goal-verify has recorded aligned truthAlignment or validated reconciliation truth.
|
|
270
|
+
3. Have ship-manager/release agent author \`.sdd/runs/<branch>/ship/*.md\` evidence, including \`ship-collaboration-contract-vN.md\`; write \`specs/<branch>/release.md\` only as an explicit ship-agent artifact if needed.
|
|
271
|
+
4. Run \`sdd ship close --branch <branch> --json\`; runtime validates readiness refs/contracts/truthAlignment and writes only \`.sdd/runtime.sqlite\`.
|
|
270
272
|
5. Run generated-entry drift, current-run health, typecheck, test, build, and package dry-run gates when preparing a real package release.
|
|
271
273
|
6. Stop before publish, push, tag, deploy, or external release creation unless the user explicitly approves that separate action.
|
|
272
274
|
|
|
273
|
-
Do not skip failed gates, do not treat historical doctor debt as a release blocker unless it affects current evidence, and do not
|
|
274
|
-
`
|
|
275
|
+
Do not skip failed gates, do not treat historical doctor debt as a release blocker unless it affects current evidence, and do not let runtime author release Markdown.`
|
|
275
276
|
}
|
|
276
277
|
];
|
|
277
278
|
}
|
|
@@ -340,7 +341,7 @@ function workflowCommandEntry(id: string, relativePath: string, action: string,
|
|
|
340
341
|
kind: 'command',
|
|
341
342
|
relativePath,
|
|
342
343
|
title: `SDD ${action}`,
|
|
343
|
-
body: `${summary}\n\nRun:\n\n\`\`\`bash\nsdd instructions ${action} --json\n${helperCommand}\n\`\`\`\n\nUse the helper command output as the canonical format reference. Keep harness metadata such as agent_fit, verification_availability, autonomy, allowed_agents, and required_artifacts inside the fenced sdd-task block; keep companion sections such as #### Boundary and #### Acceptance outside the fence. Then follow the returned CLI/core instruction payload.\n`
|
|
344
|
+
body: `${summary}\n\nRun:\n\n\`\`\`bash\nsdd instructions ${action} --json\n${helperCommand}\n\`\`\`\n\nUse the helper command output as the canonical format reference. Keep harness metadata such as change_surface, implementation_wave, validation_batch, validation_timing, requires_verify_before_next, agent_fit, verification_availability, autonomy, allowed_agents, and required_artifacts inside the fenced sdd-task block; keep companion sections such as #### Boundary and #### Acceptance outside the fence. Then follow the returned CLI/core instruction payload.\n`
|
|
344
345
|
};
|
|
345
346
|
}
|
|
346
347
|
|
|
@@ -54,6 +54,7 @@ artifacts:
|
|
|
54
54
|
assert.equal(first.record.delegationStatus, 'COMPLETED');
|
|
55
55
|
assert.equal(second.valid, true);
|
|
56
56
|
assert.equal(second.duplicate, true);
|
|
57
|
+
assert.equal(second.record.contentDigest, first.record.contentDigest);
|
|
57
58
|
assert.equal(nextState.delegations[delegation.delegationId].status, 'COMPLETED');
|
|
58
59
|
assert.equal(nextState.artifacts.filter((artifact) => artifact.path === 'artifacts/review-T1.md').length, 1);
|
|
59
60
|
assert.equal(inspection.valid, true);
|
|
@@ -65,6 +66,43 @@ artifacts:
|
|
|
65
66
|
}
|
|
66
67
|
});
|
|
67
68
|
|
|
69
|
+
test('ingestArtifactResult allocates a retry attempt for changed terminal artifact content', async () => {
|
|
70
|
+
const root = await mkdtemp(path.join(tmpdir(), 'sdd-artifact-ingest-retry-'));
|
|
71
|
+
try {
|
|
72
|
+
await initProject(root);
|
|
73
|
+
const state = await createRun(root, { runId: 'run-1' });
|
|
74
|
+
const delegation = createDelegationRecord({
|
|
75
|
+
delegationId: 'B-T1-reviewer-001',
|
|
76
|
+
task: 'T1',
|
|
77
|
+
agent: 'reviewer',
|
|
78
|
+
expectedArtifact: 'artifacts/review-T1.md',
|
|
79
|
+
runMode: 'background'
|
|
80
|
+
});
|
|
81
|
+
await writeRunState(root, { ...state, delegations: { [delegation.delegationId]: delegation } });
|
|
82
|
+
await writeArtifact(root, state.runId, 'review-T1.md', validResultArtifact('reviewer', 'T1', 'PASS', 'artifacts/review-T1.md'));
|
|
83
|
+
|
|
84
|
+
const first = await ingestArtifactResult(root, state.runId, { delegationId: delegation.delegationId, artifactPath: 'artifacts/review-T1.md' });
|
|
85
|
+
await writeArtifact(root, state.runId, 'review-T1.md', `${validResultArtifact('reviewer', 'T1', 'PASS', 'artifacts/review-T1.md')}\nChanged evidence.\n`);
|
|
86
|
+
const retry = await ingestArtifactResult(root, state.runId, { delegationId: delegation.delegationId, artifactPath: 'artifacts/review-T1.md' });
|
|
87
|
+
const nextState = await readRunState(root, state.runId);
|
|
88
|
+
const inspection = await inspectArtifactResultIngestions(root, state.runId);
|
|
89
|
+
|
|
90
|
+
assert.equal(first.valid, true);
|
|
91
|
+
assert.equal(retry.valid, true);
|
|
92
|
+
assert.equal(retry.duplicate, false);
|
|
93
|
+
assert.equal(retry.record.delegationId, 'B-T1-reviewer-002');
|
|
94
|
+
assert.equal(retry.record.retryOf, 'B-T1-reviewer-001');
|
|
95
|
+
assert.equal(retry.record.replayReason, 'artifact_reingest');
|
|
96
|
+
assert.notEqual(retry.record.contentDigest, first.record.contentDigest);
|
|
97
|
+
assert.equal(nextState.delegations['B-T1-reviewer-001'].status, 'COMPLETED');
|
|
98
|
+
assert.equal(nextState.delegations['B-T1-reviewer-002'].status, 'COMPLETED');
|
|
99
|
+
assert.equal(nextState.delegations['B-T1-reviewer-002'].retryOf, 'B-T1-reviewer-001');
|
|
100
|
+
assert.deepEqual(inspection.records.map((record) => record.delegationId), ['B-T1-reviewer-001', 'B-T1-reviewer-002']);
|
|
101
|
+
} finally {
|
|
102
|
+
await rm(root, { recursive: true, force: true });
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
|
|
68
106
|
test('ingestArtifactResult rejects invalid artifact without accepted evidence', async () => {
|
|
69
107
|
const root = await mkdtemp(path.join(tmpdir(), 'sdd-artifact-ingest-invalid-'));
|
|
70
108
|
try {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { readFile } from 'node:fs/promises';
|
|
3
|
+
|
|
1
4
|
import { ARTIFACT_RESULT_INGESTION_CONTRACT_VERSION } from '../contracts.js';
|
|
2
|
-
import {
|
|
3
|
-
import { artifactKind } from '../run-state/artifacts.js';
|
|
5
|
+
import { getBranchStageEvidencePathFromRef, isBranchStageEvidenceRef, normalizeStageEvidenceOrLegacyArtifactRef, toArtifactRootRelativePath, toEvidencePayloadFileName } from '../runtime-paths.js';
|
|
6
|
+
import { artifactKind, readArtifact } from '../run-state/artifacts.js';
|
|
4
7
|
import { appendEvent } from '../run-state/events.js';
|
|
5
8
|
import type { RunState, RunStateArtifactIngestionRecord, RunStateContractValidationIssue, RunStateDelegationRecord, RunStateTaskGap } from '../run-state/model.js';
|
|
6
9
|
import { readRunState, writeRunState } from '../run-state/run-state.js';
|
|
@@ -35,16 +38,31 @@ export interface ArtifactResultIngestionInspection {
|
|
|
35
38
|
|
|
36
39
|
export async function ingestArtifactResult(projectRoot: string, runId: string, input: { delegationId: string; artifactPath: string }): Promise<ArtifactResultIngestionResult> {
|
|
37
40
|
const state = await readRunState(projectRoot, runId);
|
|
38
|
-
const
|
|
39
|
-
if (!
|
|
41
|
+
const originalDelegation = state.delegations[input.delegationId];
|
|
42
|
+
if (!originalDelegation) {
|
|
40
43
|
throw new Error(`Unknown delegation ${input.delegationId} in run ${runId}.`);
|
|
41
44
|
}
|
|
42
45
|
|
|
43
|
-
const artifactPath =
|
|
44
|
-
const
|
|
46
|
+
const artifactPath = normalizeStageEvidenceOrLegacyArtifactRef(input.artifactPath);
|
|
47
|
+
const contentDigest = await hashArtifact(projectRoot, runId, artifactPath);
|
|
48
|
+
let delegation = originalDelegation;
|
|
49
|
+
let key = artifactIngestionKey(delegation.delegationId, artifactPath);
|
|
45
50
|
const existing = (state.artifactIngestions ?? {})[key] as ArtifactResultIngestionRecord | undefined;
|
|
46
|
-
if (existing) {
|
|
51
|
+
if (existing?.status === 'accepted' && (!existing.contentDigest || existing.contentDigest === contentDigest)) {
|
|
52
|
+
return { valid: true, duplicate: true, record: existing, delegation };
|
|
53
|
+
}
|
|
54
|
+
if (existing?.status === 'accepted' && existing.contentDigest !== contentDigest) {
|
|
55
|
+
delegation = allocateRetryDelegation(state, originalDelegation, 'artifact_reingest');
|
|
56
|
+
key = artifactIngestionKey(delegation.delegationId, artifactPath);
|
|
57
|
+
const retryExisting = (state.artifactIngestions ?? {})[key] as ArtifactResultIngestionRecord | undefined;
|
|
58
|
+
if (retryExisting?.status === 'accepted' && retryExisting.contentDigest === contentDigest) {
|
|
59
|
+
return { valid: true, duplicate: true, record: retryExisting, delegation };
|
|
60
|
+
}
|
|
61
|
+
} else if (existing) {
|
|
47
62
|
return { valid: existing.status === 'accepted', duplicate: true, record: existing, delegation };
|
|
63
|
+
} else if (isDelegationTerminal(delegation.status)) {
|
|
64
|
+
delegation = allocateRetryDelegation(state, originalDelegation, 'artifact_reingest');
|
|
65
|
+
key = artifactIngestionKey(delegation.delegationId, artifactPath);
|
|
48
66
|
}
|
|
49
67
|
|
|
50
68
|
const report = await validateSddResultArtifact(projectRoot, runId, artifactPath, { expectedTask: delegation.task, expectedAgent: delegation.agent });
|
|
@@ -72,7 +90,10 @@ export async function ingestArtifactResult(projectRoot: string, runId: string, i
|
|
|
72
90
|
delegationStatus: accepted ? targetStatus : (report.valid ? null : 'RECOVERABLE'),
|
|
73
91
|
ingestedAt: now,
|
|
74
92
|
issues,
|
|
75
|
-
gaps: accepted ? gaps : []
|
|
93
|
+
gaps: accepted ? gaps : [],
|
|
94
|
+
contentDigest,
|
|
95
|
+
retryOf: delegation.retryOf ?? null,
|
|
96
|
+
replayReason: delegation.replayReason ?? null
|
|
76
97
|
};
|
|
77
98
|
|
|
78
99
|
const nextDelegation = accepted
|
|
@@ -176,6 +197,41 @@ async function recordRuntimeEvidenceAdmission(projectRoot: string, state: RunSta
|
|
|
176
197
|
});
|
|
177
198
|
}
|
|
178
199
|
|
|
200
|
+
async function hashArtifact(projectRoot: string, runId: string, evidenceRef: string): Promise<string> {
|
|
201
|
+
if (isBranchStageEvidenceRef(evidenceRef)) {
|
|
202
|
+
try {
|
|
203
|
+
return createHash('sha256').update(await readFile(getBranchStageEvidencePathFromRef(projectRoot, evidenceRef), 'utf8'), 'utf8').digest('hex');
|
|
204
|
+
} catch {
|
|
205
|
+
return createHash('sha256').update(await readArtifact(projectRoot, runId, toEvidencePayloadFileName(evidenceRef)), 'utf8').digest('hex');
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return createHash('sha256').update(await readArtifact(projectRoot, runId, toArtifactRootRelativePath(evidenceRef)), 'utf8').digest('hex');
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function allocateRetryDelegation(state: RunState, delegation: RunStateDelegationRecord, replayReason: NonNullable<RunStateDelegationRecord['replayReason']>): RunStateDelegationRecord {
|
|
212
|
+
const attempt = nextDelegationAttempt(state, delegation.task, delegation.agent);
|
|
213
|
+
return {
|
|
214
|
+
...delegation,
|
|
215
|
+
delegationId: `B-${delegation.task}-${delegation.agent}-${String(attempt).padStart(3, '0')}`,
|
|
216
|
+
status: 'RUNNING',
|
|
217
|
+
startedAt: new Date().toISOString(),
|
|
218
|
+
lastHeartbeatAt: null,
|
|
219
|
+
terminalEventAt: null,
|
|
220
|
+
attempt,
|
|
221
|
+
retryOf: delegation.delegationId,
|
|
222
|
+
replayReason
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function nextDelegationAttempt(state: RunState, taskId: string, agent: string): number {
|
|
227
|
+
const prefix = `B-${taskId}-${agent}-`;
|
|
228
|
+
const attempts = Object.keys(state.delegations)
|
|
229
|
+
.filter((delegationId) => delegationId.startsWith(prefix))
|
|
230
|
+
.map((delegationId) => Number.parseInt(delegationId.slice(prefix.length), 10))
|
|
231
|
+
.filter(Number.isFinite);
|
|
232
|
+
return Math.max(1, ...attempts) + 1;
|
|
233
|
+
}
|
|
234
|
+
|
|
179
235
|
function artifactIngestionKey(delegationId: string, artifactPath: string): string {
|
|
180
236
|
return `${delegationId}:${artifactPath}`;
|
|
181
237
|
}
|
|
@@ -214,7 +270,7 @@ function artifactIngestionGaps(delegation: RunStateDelegationRecord, status: Sdd
|
|
|
214
270
|
if (status === 'PASS') {
|
|
215
271
|
return [];
|
|
216
272
|
}
|
|
217
|
-
return [taskGap(delegation.task, delegation.agent, `Artifact ingestion returned ${status} for ${delegation.delegationId}.`, 'Inspect the ingested artifact evidence before
|
|
273
|
+
return [taskGap(delegation.task, delegation.agent, `Artifact ingestion returned ${status} for ${delegation.delegationId}.`, 'Inspect the ingested artifact evidence before continuing stage closure.')];
|
|
218
274
|
}
|
|
219
275
|
|
|
220
276
|
function contractIssue(field: string, message: string, recommendation: string): RunStateContractValidationIssue {
|
|
@@ -214,7 +214,6 @@ export function containsTemplatePlaceholder(value: string): boolean {
|
|
|
214
214
|
export function isDerivedEvidenceRef(value: string): boolean {
|
|
215
215
|
const normalized = normalizePortablePath(value).toLowerCase();
|
|
216
216
|
return normalized.includes('acceptance-coverage-')
|
|
217
|
-
|| normalized.endsWith('sync-back-proposal.md')
|
|
218
217
|
|| normalized.includes('/cache/')
|
|
219
218
|
|| normalized.includes('/profile')
|
|
220
219
|
|| normalized.endsWith('run-index.json')
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import test from 'node:test';
|
|
2
2
|
import assert from 'node:assert/strict';
|
|
3
|
-
import { mkdtemp, rm } from 'node:fs/promises';
|
|
3
|
+
import { mkdir, mkdtemp, rm, stat, writeFile } from 'node:fs/promises';
|
|
4
4
|
import { tmpdir } from 'node:os';
|
|
5
5
|
import path from 'node:path';
|
|
6
6
|
|
|
7
7
|
import { initProject } from '../config/init-project.js';
|
|
8
8
|
import { writeArtifact } from '../run-state/artifacts.js';
|
|
9
9
|
import { createRun } from '../run-state/run-state.js';
|
|
10
|
-
import { validTaskMarkdown, writeBranchDocs } from '../test-support/fixtures.js';
|
|
11
|
-
import {
|
|
10
|
+
import { validResultArtifact, validTaskMarkdown, writeBranchDocs } from '../test-support/fixtures.js';
|
|
11
|
+
import { getLegacyArtifactPath, getRunRelativeArtifactPath, toArtifactRootRelativePath } from '../runtime-paths.js';
|
|
12
12
|
import { parseSddResultMarkdown, validateSddResultArtifact } from './sdd-result.js';
|
|
13
13
|
import { renderSddResultArtifactTemplate } from './templates.js';
|
|
14
14
|
|
|
15
15
|
test('artifact path cannot escape artifacts directory', async () => {
|
|
16
16
|
const root = await mkdtemp(path.join(tmpdir(), 'sdd-runtime-'));
|
|
17
17
|
try {
|
|
18
|
-
assert.throws(() =>
|
|
18
|
+
assert.throws(() => getLegacyArtifactPath(root, 'run-1', '../outside.md'), /escapes artifacts directory/);
|
|
19
19
|
} finally {
|
|
20
20
|
await rm(root, { recursive: true, force: true });
|
|
21
21
|
}
|
|
@@ -48,8 +48,8 @@ test('validateSddResultArtifact catches missing, empty, and task mismatch artifa
|
|
|
48
48
|
const state = await createRun(root, { runId: 'run-1' });
|
|
49
49
|
const missing = await validateSddResultArtifact(root, state.runId, 'artifacts/missing.md', { expectedTask: 'T1', expectedAgent: 'reviewer' });
|
|
50
50
|
assert.equal(missing.valid, false);
|
|
51
|
-
assert.equal(missing.issues.some((issue) => issue.field === 'artifacts' && /Cannot read
|
|
52
|
-
assert.equal(missing.issues.some((issue) => /
|
|
51
|
+
assert.equal(missing.issues.some((issue) => issue.field === 'artifacts' && /Cannot read evidence/.test(issue.message)), true);
|
|
52
|
+
assert.equal(missing.issues.some((issue) => /stage evidence/.test(issue.recommendation)), true);
|
|
53
53
|
|
|
54
54
|
await writeArtifact(root, state.runId, 'empty.md', '');
|
|
55
55
|
const empty = await validateSddResultArtifact(root, state.runId, 'artifacts/empty.md');
|
|
@@ -76,6 +76,52 @@ artifacts:
|
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
78
|
|
|
79
|
+
test('validateSddResultArtifact accepts legacy run artifact directory for replay compatibility', async () => {
|
|
80
|
+
const root = await mkdtemp(path.join(tmpdir(), 'sdd-result-legacy-artifact-'));
|
|
81
|
+
try {
|
|
82
|
+
await initProject(root);
|
|
83
|
+
const state = await createRun(root, { runId: 'run-1' });
|
|
84
|
+
const legacyPath = getLegacyArtifactPath(root, state.runId, 'review-T1.md');
|
|
85
|
+
await mkdir(path.dirname(legacyPath), { recursive: true });
|
|
86
|
+
await writeFile(legacyPath, `# Review
|
|
87
|
+
|
|
88
|
+
\`\`\`sdd-result
|
|
89
|
+
contract: sdd-result-v1
|
|
90
|
+
version: 1.3.0
|
|
91
|
+
agent: reviewer
|
|
92
|
+
task: T1
|
|
93
|
+
status: PASS
|
|
94
|
+
artifacts:
|
|
95
|
+
- artifacts/review-T1.md
|
|
96
|
+
\`\`\`
|
|
97
|
+
`, 'utf8');
|
|
98
|
+
|
|
99
|
+
const report = await validateSddResultArtifact(root, state.runId, 'artifacts/review-T1.md', { expectedTask: 'T1', expectedAgent: 'reviewer' });
|
|
100
|
+
|
|
101
|
+
assert.equal(report.valid, true);
|
|
102
|
+
assert.equal(report.result?.task, 'T1');
|
|
103
|
+
} finally {
|
|
104
|
+
await rm(root, { recursive: true, force: true });
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
test('writeArtifact stores new payloads in branch evidence without creating legacy artifact dirs', async () => {
|
|
109
|
+
const root = await mkdtemp(path.join(tmpdir(), 'sdd-result-evidence-artifact-'));
|
|
110
|
+
try {
|
|
111
|
+
await initProject(root);
|
|
112
|
+
await writeBranchDocs(root, 'feature', validTaskMarkdown('T1', []));
|
|
113
|
+
const state = await createRun(root, { runId: 'run-1', branch: 'feature', taskId: 'T1' });
|
|
114
|
+
const written = await writeArtifact(root, state.runId, 'review-T1.md', validResultArtifact('reviewer', 'T1', 'PASS', 'artifacts/review-T1.md'));
|
|
115
|
+
const portablePath = written.absolutePath.replace(/\\/g, '/');
|
|
116
|
+
|
|
117
|
+
assert.equal(written.runRelativePath, 'artifacts/review-T1.md');
|
|
118
|
+
assert.match(portablePath, /\.sdd\/runs\/feature\/evidence\/artifacts\/review-T1-run-1-[a-f0-9]{12}\.md$/);
|
|
119
|
+
await assert.rejects(stat(path.join(root, '.sdd', 'runs', state.runId, 'artifacts')), /ENOENT/);
|
|
120
|
+
} finally {
|
|
121
|
+
await rm(root, { recursive: true, force: true });
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
|
|
79
125
|
test('renderSddResultArtifactTemplate renders self-referencing reviewer artifact', async () => {
|
|
80
126
|
const root = await mkdtemp(path.join(tmpdir(), 'sdd-artifact-template-review-'));
|
|
81
127
|
try {
|