sdd-agent-platform 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -28
- package/node_modules/@sdd-agent-platform/core/dist/ai-tools.js +67 -69
- package/node_modules/@sdd-agent-platform/core/dist/ai-tools.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/ingestion.js +64 -9
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/ingestion.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-evidence.js +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-evidence.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-result.js +26 -17
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-result.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/init-project.d.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/dist/config/init-project.js +12 -9
- package/node_modules/@sdd-agent-platform/core/dist/config/init-project.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/project-config.d.ts +3 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/project-config.js +7 -3
- package/node_modules/@sdd-agent-platform/core/dist/config/project-config.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.d.ts +4 -4
- package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.js +12 -25
- package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context/build-package.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context/build-package.js +1 -7
- package/node_modules/@sdd-agent-platform/core/dist/context/build-package.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context/evidence-summary.js +26 -8
- package/node_modules/@sdd-agent-platform/core/dist/context/evidence-summary.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context/log-worker.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/context/log-worker.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context-offload/contracts.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/contracts.d.ts +2 -1
- package/node_modules/@sdd-agent-platform/core/dist/contracts.js +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/contracts.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/delegation/model.d.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/dist/delegation/validation.d.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/dist/delegation/validation.js +7 -4
- package/node_modules/@sdd-agent-platform/core/dist/delegation/validation.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/document-chain.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/document-chain.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/project.js +8 -8
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/project.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/registries.js +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/registries.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-evidence.js +4 -4
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-evidence.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-trust.js +0 -24
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-trust.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/runtime-contracts.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/runtime-contracts.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/doctor.js +178 -58
- package/node_modules/@sdd-agent-platform/core/dist/doctor/doctor.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.js +14 -7
- package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/evidence-runtime/contracts.d.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/background-executor.js +4 -4
- package/node_modules/@sdd-agent-platform/core/dist/execution/background-executor.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/foreground-subagents.js +3 -3
- package/node_modules/@sdd-agent-platform/core/dist/execution/foreground-subagents.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/host-invocation.js +5 -4
- package/node_modules/@sdd-agent-platform/core/dist/execution/host-invocation.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/resident-worker.js +3 -2
- package/node_modules/@sdd-agent-platform/core/dist/execution/resident-worker.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/stage-team-runtime.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/execution/stage-team-runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/governance/policy.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/governance/policy.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/governance/policy.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/instructions.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/instructions.js +54 -61
- package/node_modules/@sdd-agent-platform/core/dist/instructions.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/decision-gate.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/decision-gate.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.d.ts +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.js +24 -8
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/orchestration/contracts.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.d.ts +12 -2
- package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.js +62 -21
- package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.d.ts +5 -2
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.js +69 -27
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-registry.js +15 -15
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-registry.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-runtime-static.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-runtime-static.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/capability-sources.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.js +9 -9
- package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/eval-learning-context.js +4 -4
- package/node_modules/@sdd-agent-platform/core/dist/registries/eval-learning-context.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/query-status.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/registries/query-status.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/tool-capabilities.js +3 -3
- package/node_modules/@sdd-agent-platform/core/dist/registries/tool-capabilities.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/tool-plugins.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/registries/tool-plugins.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/worker-adapters.js +11 -11
- package/node_modules/@sdd-agent-platform/core/dist/registries/worker-adapters.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/workflow-gates.js +12 -12
- package/node_modules/@sdd-agent-platform/core/dist/registries/workflow-gates.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/risk/contracts.d.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/risk/kernel.js +4 -4
- package/node_modules/@sdd-agent-platform/core/dist/risk/kernel.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/risk/legacy-adapters.js +4 -7
- package/node_modules/@sdd-agent-platform/core/dist/risk/legacy-adapters.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/risk/workflow-gates.d.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/risk/workflow-gates.js +19 -17
- package/node_modules/@sdd-agent-platform/core/dist/risk/workflow-gates.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime-config.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime-config.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime.d.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/routing.js +45 -15
- package/node_modules/@sdd-agent-platform/core/dist/router/routing.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-import.d.ts +28 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-import.js +373 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-import.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-validation.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-validation.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/stage-route-binding.d.ts +37 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/stage-route-binding.js +235 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/stage-route-binding.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/router.d.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/router.js +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/router.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/artifacts.d.ts +16 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/artifacts.js +126 -9
- package/node_modules/@sdd-agent-platform/core/dist/run-state/artifacts.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.d.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.js +7 -5
- package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/model.d.ts +28 -8
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-index.d.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-index.js +1 -3
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-index.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-state.js +37 -27
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-state.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.d.ts +5 -2
- package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.js +53 -14
- package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/timing.d.ts +8 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/timing.js +131 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/timing.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state.d.ts +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state.js +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/build.js +0 -3
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/build.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/findings.js +5 -44
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/findings.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/model.d.ts +1 -17
- package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.d.ts +10 -0
- package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.js +65 -0
- package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/runtime-projection-p0.d.ts +64 -0
- package/node_modules/@sdd-agent-platform/core/dist/runtime-projection-p0.js +200 -0
- package/node_modules/@sdd-agent-platform/core/dist/runtime-projection-p0.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.d.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.js +97 -10
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/run-binding.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/run-binding.js +8 -6
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/run-binding.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.d.ts +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.js +55 -34
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/stage-artifacts.d.ts +55 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-artifacts.js +322 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-artifacts.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration-contracts.d.ts +55 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration-contracts.js +241 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration-contracts.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration.d.ts +888 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration.js +3870 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-runtime/runtime.js +8 -1
- package/node_modules/@sdd-agent-platform/core/dist/stage-runtime/runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/status/project-status.d.ts +44 -1
- package/node_modules/@sdd-agent-platform/core/dist/status/project-status.js +170 -23
- package/node_modules/@sdd-agent-platform/core/dist/status/project-status.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.d.ts +170 -18
- package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.js +544 -32
- package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/subagents/contracts.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/subagents/runtime.js +7 -7
- package/node_modules/@sdd-agent-platform/core/dist/subagents/runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/test-support/fixtures.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.js +8 -23
- package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/truth-reconciliation.d.ts +44 -0
- package/node_modules/@sdd-agent-platform/core/dist/truth-reconciliation.js +138 -0
- package/node_modules/@sdd-agent-platform/core/dist/truth-reconciliation.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.d.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.js +28 -53
- package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.d.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.js +10 -50
- package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.d.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.js +159 -150
- package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.d.ts +12 -2
- package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.js +238 -103
- package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-cache.d.ts +26 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-cache.js +73 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-cache.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.d.ts +18 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.js +27 -5
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.js +9 -32
- package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/work-units/contracts.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.js +228 -15
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.js +49 -15
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.js +42 -6
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/types.d.ts +4 -5
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.d.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.js +1 -2
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/dependencies.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.d.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.js +72 -6
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/migration-recovery.d.ts +40 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/migration-recovery.js +110 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/migration-recovery.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/repair-contract.d.ts +12 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/repair-contract.js +63 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/repair-contract.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve-task-run.d.ts +21 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve-task-run.js +95 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve-task-run.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.d.ts +55 -5
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.js +538 -34
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/runtime-projections.d.ts +228 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/runtime-projections.js +452 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/runtime-projections.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/package.json +3 -3
- package/node_modules/@sdd-agent-platform/core/src/ai-tools.test.ts +49 -1
- package/node_modules/@sdd-agent-platform/core/src/ai-tools.ts +67 -69
- package/node_modules/@sdd-agent-platform/core/src/artifacts/ingestion.test.ts +38 -0
- package/node_modules/@sdd-agent-platform/core/src/artifacts/ingestion.ts +65 -9
- package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-evidence.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-result.test.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-result.ts +26 -17
- package/node_modules/@sdd-agent-platform/core/src/config/init-project.test.ts +43 -31
- package/node_modules/@sdd-agent-platform/core/src/config/init-project.ts +14 -11
- package/node_modules/@sdd-agent-platform/core/src/config/project-config.ts +10 -4
- package/node_modules/@sdd-agent-platform/core/src/config/starter-documents.ts +12 -25
- package/node_modules/@sdd-agent-platform/core/src/context/build-package.ts +2 -8
- package/node_modules/@sdd-agent-platform/core/src/context/context-build.test.ts +3 -2
- package/node_modules/@sdd-agent-platform/core/src/context/evidence-summary.ts +27 -8
- package/node_modules/@sdd-agent-platform/core/src/context/log-worker.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/context-offload/contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/contracts.ts +2 -1
- package/node_modules/@sdd-agent-platform/core/src/delegation/model.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/src/delegation/validation.ts +8 -5
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/document-chain.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/project.ts +8 -8
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/registries.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/run-evidence.ts +4 -4
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/run-trust.ts +0 -21
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/runtime-contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/doctor/doctor.test.ts +143 -45
- package/node_modules/@sdd-agent-platform/core/src/doctor/doctor.ts +193 -58
- package/node_modules/@sdd-agent-platform/core/src/evidence/lookup.ts +15 -7
- package/node_modules/@sdd-agent-platform/core/src/evidence-runtime/contracts.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/src/execution/background-executor.test.ts +50 -2
- package/node_modules/@sdd-agent-platform/core/src/execution/background-executor.ts +4 -4
- package/node_modules/@sdd-agent-platform/core/src/execution/foreground-subagents.test.ts +11 -2
- package/node_modules/@sdd-agent-platform/core/src/execution/foreground-subagents.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/src/execution/host-invocation.ts +5 -4
- package/node_modules/@sdd-agent-platform/core/src/execution/resident-worker.test.ts +12 -1
- package/node_modules/@sdd-agent-platform/core/src/execution/resident-worker.ts +3 -2
- package/node_modules/@sdd-agent-platform/core/src/execution/stage-team-runtime.test.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/execution/stage-team-runtime.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/execution/wave-executor.test.ts +10 -0
- package/node_modules/@sdd-agent-platform/core/src/governance/policy.test.ts +8 -0
- package/node_modules/@sdd-agent-platform/core/src/governance/policy.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/instructions.test.ts +33 -18
- package/node_modules/@sdd-agent-platform/core/src/instructions.ts +55 -62
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/decision-gate.test.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/decision-gate.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/ship.test.ts +47 -0
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/ship.ts +25 -8
- package/node_modules/@sdd-agent-platform/core/src/orchestration/contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/orchestration/runtime.ts +74 -22
- package/node_modules/@sdd-agent-platform/core/src/phase8-contracts.test.ts +2 -3
- package/node_modules/@sdd-agent-platform/core/src/phase8-risk-kernel.test.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-capability-catalog.ts +82 -35
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-registry.ts +15 -15
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-runtime-static.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/registries/capability-sources.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/registries/command-team-runtime.ts +10 -10
- package/node_modules/@sdd-agent-platform/core/src/registries/eval-learning-context.ts +4 -4
- package/node_modules/@sdd-agent-platform/core/src/registries/query-status.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/registries/registries.test.ts +18 -2
- package/node_modules/@sdd-agent-platform/core/src/registries/tool-capabilities.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/src/registries/tool-plugins.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/registries/worker-adapters.ts +11 -11
- package/node_modules/@sdd-agent-platform/core/src/registries/workflow-gates.ts +12 -12
- package/node_modules/@sdd-agent-platform/core/src/risk/contracts.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/risk/kernel.ts +4 -4
- package/node_modules/@sdd-agent-platform/core/src/risk/legacy-adapters.ts +4 -7
- package/node_modules/@sdd-agent-platform/core/src/risk/workflow-gates.ts +20 -18
- package/node_modules/@sdd-agent-platform/core/src/router/agent-runtime-config.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/router/agent-runtime.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/router/route-projection.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/router/route-sdd-task.test.ts +241 -4
- package/node_modules/@sdd-agent-platform/core/src/router/routing.ts +47 -15
- package/node_modules/@sdd-agent-platform/core/src/router/runtime-import.ts +453 -0
- package/node_modules/@sdd-agent-platform/core/src/router/runtime-validation.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/router/stage-route-binding.ts +279 -0
- package/node_modules/@sdd-agent-platform/core/src/router.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/run-state/artifacts.ts +132 -10
- package/node_modules/@sdd-agent-platform/core/src/run-state/inspect-run.ts +7 -7
- package/node_modules/@sdd-agent-platform/core/src/run-state/model.ts +31 -8
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-index.ts +1 -5
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-state.test.ts +50 -2
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-state.ts +39 -29
- package/node_modules/@sdd-agent-platform/core/src/run-state/task-evidence.ts +62 -16
- package/node_modules/@sdd-agent-platform/core/src/run-state/timing.ts +146 -0
- package/node_modules/@sdd-agent-platform/core/src/run-state.ts +1 -0
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/build.ts +0 -3
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/findings.ts +6 -46
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/model.ts +1 -13
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis.test.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/src/runtime-paths.ts +77 -0
- package/node_modules/@sdd-agent-platform/core/src/runtime-projection-p0.test.ts +96 -0
- package/node_modules/@sdd-agent-platform/core/src/runtime-projection-p0.ts +292 -0
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/document-hashes.ts +109 -10
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/run-binding.ts +8 -6
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.test.ts +123 -1
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.ts +58 -43
- package/node_modules/@sdd-agent-platform/core/src/stage-artifacts.ts +450 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-collaboration-contracts.ts +322 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-collaboration.test.ts +2903 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-collaboration.ts +5831 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-runtime/runtime.test.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/stage-runtime/runtime.ts +9 -1
- package/node_modules/@sdd-agent-platform/core/src/status/project-status.test.ts +239 -16
- package/node_modules/@sdd-agent-platform/core/src/status/project-status.ts +249 -23
- package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.test.ts +196 -4
- package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.ts +860 -54
- package/node_modules/@sdd-agent-platform/core/src/subagents/contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/subagents/runtime.test.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/src/subagents/runtime.ts +7 -7
- package/node_modules/@sdd-agent-platform/core/src/test-support/fixtures.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/test-support/run-state.ts +9 -23
- package/node_modules/@sdd-agent-platform/core/src/truth-reconciliation.test.ts +72 -0
- package/node_modules/@sdd-agent-platform/core/src/truth-reconciliation.ts +177 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/goal-verify.test.ts +13 -87
- package/node_modules/@sdd-agent-platform/core/src/verification/goal-verify.ts +27 -56
- package/node_modules/@sdd-agent-platform/core/src/verification/rendering.ts +10 -54
- package/node_modules/@sdd-agent-platform/core/src/verification/review-gate.test.ts +8 -1
- package/node_modules/@sdd-agent-platform/core/src/verification/single-task-loop.test.ts +93 -79
- package/node_modules/@sdd-agent-platform/core/src/verification/single-task-loop.ts +166 -154
- package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.test.ts +100 -47
- package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.ts +265 -107
- package/node_modules/@sdd-agent-platform/core/src/verification/validation-cache.ts +106 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/validation-wave.test.ts +47 -5
- package/node_modules/@sdd-agent-platform/core/src/verification/validation-wave.ts +48 -5
- package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.test.ts +15 -31
- package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.ts +9 -33
- package/node_modules/@sdd-agent-platform/core/src/work-units/contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/evidence-packet.ts +246 -17
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.test.ts +339 -3
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.ts +53 -14
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.test.ts +45 -8
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.ts +45 -6
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/types.ts +6 -5
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/affected-file-conflicts.ts +1 -3
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/dependencies.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/latest-eligible-run.ts +75 -7
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/migration-recovery.ts +158 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/repair-contract.ts +77 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve-task-run.ts +114 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve.test.ts +518 -25
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve.ts +670 -41
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/runtime-projections.ts +712 -0
- package/package.json +1 -1
- package/packages/cli/dist/args.js +2 -2
- package/packages/cli/dist/args.js.map +1 -1
- package/packages/cli/dist/commands/ai-tools.js +13 -2
- package/packages/cli/dist/commands/ai-tools.js.map +1 -1
- package/packages/cli/dist/commands/context.js +1 -1
- package/packages/cli/dist/commands/context.js.map +1 -1
- package/packages/cli/dist/commands/execution.js +49 -1
- package/packages/cli/dist/commands/execution.js.map +1 -1
- package/packages/cli/dist/commands/governance.js +1 -1
- package/packages/cli/dist/commands/governance.js.map +1 -1
- package/packages/cli/dist/commands/init.js +6 -1
- package/packages/cli/dist/commands/init.js.map +1 -1
- package/packages/cli/dist/commands/lifecycle.js +15 -2
- package/packages/cli/dist/commands/lifecycle.js.map +1 -1
- package/packages/cli/dist/commands/registry/runtime.js +48 -2
- package/packages/cli/dist/commands/registry/runtime.js.map +1 -1
- package/packages/cli/dist/commands/run.js +52 -2
- package/packages/cli/dist/commands/run.js.map +1 -1
- package/packages/cli/dist/commands/stage-close.d.ts +6 -0
- package/packages/cli/dist/commands/stage-close.js +295 -0
- package/packages/cli/dist/commands/stage-close.js.map +1 -0
- package/packages/cli/dist/commands/status.js +68 -2
- package/packages/cli/dist/commands/status.js.map +1 -1
- package/packages/cli/dist/commands/test.js +180 -2
- package/packages/cli/dist/commands/test.js.map +1 -1
- package/packages/cli/dist/commands/verifies.js +7 -5
- package/packages/cli/dist/commands/verifies.js.map +1 -1
- package/packages/cli/dist/commands/verify.js +222 -26
- package/packages/cli/dist/commands/verify.js.map +1 -1
- package/packages/cli/dist/dispatch.js +4 -9
- package/packages/cli/dist/dispatch.js.map +1 -1
- package/packages/cli/dist/help.js +27 -26
- package/packages/cli/dist/help.js.map +1 -1
- package/packages/cli/dist/renderers/doctor.js +1 -1
- package/packages/cli/dist/renderers/doctor.js.map +1 -1
- package/packages/cli/dist/renderers/execution.js +1 -1
- package/packages/cli/dist/renderers/execution.js.map +1 -1
- package/packages/cli/dist/renderers/json.d.ts +1 -0
- package/packages/cli/dist/renderers/json.js +3 -0
- package/packages/cli/dist/renderers/json.js.map +1 -1
- package/packages/cli/dist/renderers/registry-runtime.d.ts +2 -1
- package/packages/cli/dist/renderers/registry-runtime.js +20 -0
- package/packages/cli/dist/renderers/registry-runtime.js.map +1 -1
- package/packages/cli/dist/renderers/router.js +1 -1
- package/packages/cli/dist/renderers/router.js.map +1 -1
- package/packages/cli/dist/renderers/workflow.d.ts +0 -4
- package/packages/cli/dist/renderers/workflow.js +30 -89
- package/packages/cli/dist/renderers/workflow.js.map +1 -1
- package/packages/cli/dist/skill-import-args.d.ts +10 -0
- package/packages/cli/dist/skill-import-args.js +47 -0
- package/packages/cli/dist/skill-import-args.js.map +1 -0
- package/packages/cli/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/cli/package.json +2 -2
- package/packages/core/dist/ai-tools.js +67 -69
- package/packages/core/dist/ai-tools.js.map +1 -1
- package/packages/core/dist/artifacts/ingestion.js +64 -9
- package/packages/core/dist/artifacts/ingestion.js.map +1 -1
- package/packages/core/dist/artifacts/sdd-evidence.js +0 -1
- package/packages/core/dist/artifacts/sdd-evidence.js.map +1 -1
- package/packages/core/dist/artifacts/sdd-result.js +26 -17
- package/packages/core/dist/artifacts/sdd-result.js.map +1 -1
- package/packages/core/dist/config/init-project.d.ts +3 -0
- package/packages/core/dist/config/init-project.js +12 -9
- package/packages/core/dist/config/init-project.js.map +1 -1
- package/packages/core/dist/config/project-config.d.ts +3 -1
- package/packages/core/dist/config/project-config.js +7 -3
- package/packages/core/dist/config/project-config.js.map +1 -1
- package/packages/core/dist/config/starter-documents.d.ts +4 -4
- package/packages/core/dist/config/starter-documents.js +12 -25
- package/packages/core/dist/config/starter-documents.js.map +1 -1
- package/packages/core/dist/context/build-package.d.ts +1 -1
- package/packages/core/dist/context/build-package.js +1 -7
- package/packages/core/dist/context/build-package.js.map +1 -1
- package/packages/core/dist/context/evidence-summary.js +26 -8
- package/packages/core/dist/context/evidence-summary.js.map +1 -1
- package/packages/core/dist/context/log-worker.js +2 -2
- package/packages/core/dist/context/log-worker.js.map +1 -1
- package/packages/core/dist/context-offload/contracts.d.ts +1 -1
- package/packages/core/dist/contracts.d.ts +2 -1
- package/packages/core/dist/contracts.js +1 -0
- package/packages/core/dist/contracts.js.map +1 -1
- package/packages/core/dist/delegation/model.d.ts +3 -0
- package/packages/core/dist/delegation/validation.d.ts +3 -0
- package/packages/core/dist/delegation/validation.js +7 -4
- package/packages/core/dist/delegation/validation.js.map +1 -1
- package/packages/core/dist/doctor/checks/document-chain.js +1 -1
- package/packages/core/dist/doctor/checks/document-chain.js.map +1 -1
- package/packages/core/dist/doctor/checks/project.js +8 -8
- package/packages/core/dist/doctor/checks/project.js.map +1 -1
- package/packages/core/dist/doctor/checks/registries.js +0 -1
- package/packages/core/dist/doctor/checks/registries.js.map +1 -1
- package/packages/core/dist/doctor/checks/run-evidence.js +4 -4
- package/packages/core/dist/doctor/checks/run-evidence.js.map +1 -1
- package/packages/core/dist/doctor/checks/run-trust.js +0 -24
- package/packages/core/dist/doctor/checks/run-trust.js.map +1 -1
- package/packages/core/dist/doctor/checks/runtime-contracts.js +1 -1
- package/packages/core/dist/doctor/checks/runtime-contracts.js.map +1 -1
- package/packages/core/dist/doctor/doctor.js +178 -58
- package/packages/core/dist/doctor/doctor.js.map +1 -1
- package/packages/core/dist/evidence/lookup.js +14 -7
- package/packages/core/dist/evidence/lookup.js.map +1 -1
- package/packages/core/dist/evidence-runtime/contracts.d.ts +0 -1
- package/packages/core/dist/execution/background-executor.js +4 -4
- package/packages/core/dist/execution/background-executor.js.map +1 -1
- package/packages/core/dist/execution/foreground-subagents.js +3 -3
- package/packages/core/dist/execution/foreground-subagents.js.map +1 -1
- package/packages/core/dist/execution/host-invocation.js +5 -4
- package/packages/core/dist/execution/host-invocation.js.map +1 -1
- package/packages/core/dist/execution/resident-worker.js +3 -2
- package/packages/core/dist/execution/resident-worker.js.map +1 -1
- package/packages/core/dist/execution/stage-team-runtime.js +2 -2
- package/packages/core/dist/execution/stage-team-runtime.js.map +1 -1
- package/packages/core/dist/governance/policy.d.ts +1 -1
- package/packages/core/dist/governance/policy.js +1 -1
- package/packages/core/dist/governance/policy.js.map +1 -1
- package/packages/core/dist/instructions.d.ts +1 -1
- package/packages/core/dist/instructions.js +54 -61
- package/packages/core/dist/instructions.js.map +1 -1
- package/packages/core/dist/lifecycle/decision-gate.js +1 -1
- package/packages/core/dist/lifecycle/decision-gate.js.map +1 -1
- package/packages/core/dist/lifecycle/ship.d.ts +1 -0
- package/packages/core/dist/lifecycle/ship.js +24 -8
- package/packages/core/dist/lifecycle/ship.js.map +1 -1
- package/packages/core/dist/orchestration/contracts.d.ts +1 -1
- package/packages/core/dist/orchestration/runtime.d.ts +12 -2
- package/packages/core/dist/orchestration/runtime.js +62 -21
- package/packages/core/dist/orchestration/runtime.js.map +1 -1
- package/packages/core/dist/registries/agent-capability-catalog.d.ts +5 -2
- package/packages/core/dist/registries/agent-capability-catalog.js +69 -27
- package/packages/core/dist/registries/agent-capability-catalog.js.map +1 -1
- package/packages/core/dist/registries/agent-registry.js +15 -15
- package/packages/core/dist/registries/agent-registry.js.map +1 -1
- package/packages/core/dist/registries/agent-runtime-static.js +1 -1
- package/packages/core/dist/registries/agent-runtime-static.js.map +1 -1
- package/packages/core/dist/registries/capability-sources.js +1 -1
- package/packages/core/dist/registries/command-team-runtime.d.ts +1 -1
- package/packages/core/dist/registries/command-team-runtime.js +9 -9
- package/packages/core/dist/registries/command-team-runtime.js.map +1 -1
- package/packages/core/dist/registries/eval-learning-context.js +4 -4
- package/packages/core/dist/registries/eval-learning-context.js.map +1 -1
- package/packages/core/dist/registries/query-status.js +2 -2
- package/packages/core/dist/registries/query-status.js.map +1 -1
- package/packages/core/dist/registries/tool-capabilities.js +3 -3
- package/packages/core/dist/registries/tool-capabilities.js.map +1 -1
- package/packages/core/dist/registries/tool-plugins.js +2 -2
- package/packages/core/dist/registries/tool-plugins.js.map +1 -1
- package/packages/core/dist/registries/worker-adapters.js +11 -11
- package/packages/core/dist/registries/worker-adapters.js.map +1 -1
- package/packages/core/dist/registries/workflow-gates.js +12 -12
- package/packages/core/dist/registries/workflow-gates.js.map +1 -1
- package/packages/core/dist/risk/contracts.d.ts +2 -2
- package/packages/core/dist/risk/kernel.js +4 -4
- package/packages/core/dist/risk/kernel.js.map +1 -1
- package/packages/core/dist/risk/legacy-adapters.js +4 -7
- package/packages/core/dist/risk/legacy-adapters.js.map +1 -1
- package/packages/core/dist/risk/workflow-gates.d.ts +2 -2
- package/packages/core/dist/risk/workflow-gates.js +19 -17
- package/packages/core/dist/risk/workflow-gates.js.map +1 -1
- package/packages/core/dist/router/agent-runtime-config.js +1 -1
- package/packages/core/dist/router/agent-runtime-config.js.map +1 -1
- package/packages/core/dist/router/agent-runtime.d.ts +2 -0
- package/packages/core/dist/router/route-projection.js +1 -1
- package/packages/core/dist/router/route-projection.js.map +1 -1
- package/packages/core/dist/router/routing.js +45 -15
- package/packages/core/dist/router/routing.js.map +1 -1
- package/packages/core/dist/router/runtime-import.d.ts +28 -0
- package/packages/core/dist/router/runtime-import.js +373 -0
- package/packages/core/dist/router/runtime-import.js.map +1 -0
- package/packages/core/dist/router/runtime-validation.js +2 -2
- package/packages/core/dist/router/runtime-validation.js.map +1 -1
- package/packages/core/dist/router/stage-route-binding.d.ts +37 -0
- package/packages/core/dist/router/stage-route-binding.js +235 -0
- package/packages/core/dist/router/stage-route-binding.js.map +1 -0
- package/packages/core/dist/router.d.ts +2 -0
- package/packages/core/dist/router.js +2 -0
- package/packages/core/dist/router.js.map +1 -1
- package/packages/core/dist/run-state/artifacts.d.ts +16 -0
- package/packages/core/dist/run-state/artifacts.js +126 -9
- package/packages/core/dist/run-state/artifacts.js.map +1 -1
- package/packages/core/dist/run-state/inspect-run.d.ts +0 -2
- package/packages/core/dist/run-state/inspect-run.js +7 -5
- package/packages/core/dist/run-state/inspect-run.js.map +1 -1
- package/packages/core/dist/run-state/model.d.ts +28 -8
- package/packages/core/dist/run-state/run-index.d.ts +0 -2
- package/packages/core/dist/run-state/run-index.js +1 -3
- package/packages/core/dist/run-state/run-index.js.map +1 -1
- package/packages/core/dist/run-state/run-state.js +37 -27
- package/packages/core/dist/run-state/run-state.js.map +1 -1
- package/packages/core/dist/run-state/task-evidence.d.ts +5 -2
- package/packages/core/dist/run-state/task-evidence.js +53 -14
- package/packages/core/dist/run-state/task-evidence.js.map +1 -1
- package/packages/core/dist/run-state/timing.d.ts +8 -0
- package/packages/core/dist/run-state/timing.js +131 -0
- package/packages/core/dist/run-state/timing.js.map +1 -0
- package/packages/core/dist/run-state.d.ts +1 -0
- package/packages/core/dist/run-state.js +1 -0
- package/packages/core/dist/run-state.js.map +1 -1
- package/packages/core/dist/runtime-analysis/build.js +0 -3
- package/packages/core/dist/runtime-analysis/build.js.map +1 -1
- package/packages/core/dist/runtime-analysis/findings.js +5 -44
- package/packages/core/dist/runtime-analysis/findings.js.map +1 -1
- package/packages/core/dist/runtime-analysis/model.d.ts +1 -17
- package/packages/core/dist/runtime-paths.d.ts +10 -0
- package/packages/core/dist/runtime-paths.js +65 -0
- package/packages/core/dist/runtime-paths.js.map +1 -1
- package/packages/core/dist/runtime-projection-p0.d.ts +64 -0
- package/packages/core/dist/runtime-projection-p0.js +200 -0
- package/packages/core/dist/runtime-projection-p0.js.map +1 -0
- package/packages/core/dist/sdd-docs/document-hashes.d.ts +2 -0
- package/packages/core/dist/sdd-docs/document-hashes.js +97 -10
- package/packages/core/dist/sdd-docs/document-hashes.js.map +1 -1
- package/packages/core/dist/sdd-docs/run-binding.d.ts +1 -1
- package/packages/core/dist/sdd-docs/run-binding.js +8 -6
- package/packages/core/dist/sdd-docs/run-binding.js.map +1 -1
- package/packages/core/dist/sdd-docs/task-parser.d.ts +1 -0
- package/packages/core/dist/sdd-docs/task-parser.js +55 -34
- package/packages/core/dist/sdd-docs/task-parser.js.map +1 -1
- package/packages/core/dist/stage-artifacts.d.ts +55 -0
- package/packages/core/dist/stage-artifacts.js +322 -0
- package/packages/core/dist/stage-artifacts.js.map +1 -0
- package/packages/core/dist/stage-collaboration-contracts.d.ts +55 -0
- package/packages/core/dist/stage-collaboration-contracts.js +241 -0
- package/packages/core/dist/stage-collaboration-contracts.js.map +1 -0
- package/packages/core/dist/stage-collaboration.d.ts +888 -0
- package/packages/core/dist/stage-collaboration.js +3870 -0
- package/packages/core/dist/stage-collaboration.js.map +1 -0
- package/packages/core/dist/stage-runtime/runtime.js +8 -1
- package/packages/core/dist/stage-runtime/runtime.js.map +1 -1
- package/packages/core/dist/status/project-status.d.ts +44 -1
- package/packages/core/dist/status/project-status.js +170 -23
- package/packages/core/dist/status/project-status.js.map +1 -1
- package/packages/core/dist/storage/runtime-store.d.ts +170 -18
- package/packages/core/dist/storage/runtime-store.js +544 -32
- package/packages/core/dist/storage/runtime-store.js.map +1 -1
- package/packages/core/dist/subagents/contracts.d.ts +1 -1
- package/packages/core/dist/subagents/runtime.js +7 -7
- package/packages/core/dist/subagents/runtime.js.map +1 -1
- package/packages/core/dist/test-support/fixtures.js +1 -1
- package/packages/core/dist/test-support/run-state.d.ts +1 -1
- package/packages/core/dist/test-support/run-state.js +8 -23
- package/packages/core/dist/test-support/run-state.js.map +1 -1
- package/packages/core/dist/truth-reconciliation.d.ts +44 -0
- package/packages/core/dist/truth-reconciliation.js +138 -0
- package/packages/core/dist/truth-reconciliation.js.map +1 -0
- package/packages/core/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/core/dist/verification/goal-verify.d.ts +0 -1
- package/packages/core/dist/verification/goal-verify.js +28 -53
- package/packages/core/dist/verification/goal-verify.js.map +1 -1
- package/packages/core/dist/verification/rendering.d.ts +0 -2
- package/packages/core/dist/verification/rendering.js +10 -50
- package/packages/core/dist/verification/rendering.js.map +1 -1
- package/packages/core/dist/verification/single-task-loop.d.ts +0 -1
- package/packages/core/dist/verification/single-task-loop.js +159 -150
- package/packages/core/dist/verification/single-task-loop.js.map +1 -1
- package/packages/core/dist/verification/test-runtime.d.ts +12 -2
- package/packages/core/dist/verification/test-runtime.js +238 -103
- package/packages/core/dist/verification/test-runtime.js.map +1 -1
- package/packages/core/dist/verification/validation-cache.d.ts +26 -0
- package/packages/core/dist/verification/validation-cache.js +73 -0
- package/packages/core/dist/verification/validation-cache.js.map +1 -0
- package/packages/core/dist/verification/validation-wave.d.ts +18 -0
- package/packages/core/dist/verification/validation-wave.js +27 -5
- package/packages/core/dist/verification/validation-wave.js.map +1 -1
- package/packages/core/dist/verification/verify-contract.d.ts +1 -1
- package/packages/core/dist/verification/verify-contract.js +9 -32
- package/packages/core/dist/verification/verify-contract.js.map +1 -1
- package/packages/core/dist/work-units/contracts.d.ts +1 -1
- package/packages/core/dist/workflow-gate/evidence-packet.js +228 -15
- package/packages/core/dist/workflow-gate/evidence-packet.js.map +1 -1
- package/packages/core/dist/workflow-gate/hard-checks.js +49 -15
- package/packages/core/dist/workflow-gate/hard-checks.js.map +1 -1
- package/packages/core/dist/workflow-gate/policy.js +42 -6
- package/packages/core/dist/workflow-gate/policy.js.map +1 -1
- package/packages/core/dist/workflow-gate/types.d.ts +4 -5
- package/packages/core/dist/workflow-state/affected-file-conflicts.d.ts +0 -1
- package/packages/core/dist/workflow-state/affected-file-conflicts.js +1 -2
- package/packages/core/dist/workflow-state/affected-file-conflicts.js.map +1 -1
- package/packages/core/dist/workflow-state/dependencies.js +1 -1
- package/packages/core/dist/workflow-state/latest-eligible-run.d.ts +0 -1
- package/packages/core/dist/workflow-state/latest-eligible-run.js +72 -6
- package/packages/core/dist/workflow-state/latest-eligible-run.js.map +1 -1
- package/packages/core/dist/workflow-state/migration-recovery.d.ts +40 -0
- package/packages/core/dist/workflow-state/migration-recovery.js +110 -0
- package/packages/core/dist/workflow-state/migration-recovery.js.map +1 -0
- package/packages/core/dist/workflow-state/repair-contract.d.ts +12 -0
- package/packages/core/dist/workflow-state/repair-contract.js +63 -0
- package/packages/core/dist/workflow-state/repair-contract.js.map +1 -0
- package/packages/core/dist/workflow-state/resolve-task-run.d.ts +21 -0
- package/packages/core/dist/workflow-state/resolve-task-run.js +95 -0
- package/packages/core/dist/workflow-state/resolve-task-run.js.map +1 -0
- package/packages/core/dist/workflow-state/resolve.d.ts +55 -5
- package/packages/core/dist/workflow-state/resolve.js +538 -34
- package/packages/core/dist/workflow-state/resolve.js.map +1 -1
- package/packages/core/dist/workflow-state/runtime-projections.d.ts +228 -0
- package/packages/core/dist/workflow-state/runtime-projections.js +452 -0
- package/packages/core/dist/workflow-state/runtime-projections.js.map +1 -0
- package/packages/core/package.json +3 -3
- package/node_modules/@sdd-agent-platform/core/dist/doctor/render.d.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/dist/doctor/render.js +0 -44
- package/node_modules/@sdd-agent-platform/core/dist/doctor/render.js.map +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.d.ts +0 -17
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.js +0 -243
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.js.map +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.d.ts +0 -110
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.js +0 -497
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.js.map +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/sync-back.d.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/dist/sync-back.js +0 -3
- package/node_modules/@sdd-agent-platform/core/dist/sync-back.js.map +0 -1
- package/node_modules/@sdd-agent-platform/core/src/sync-back/apply.ts +0 -270
- package/node_modules/@sdd-agent-platform/core/src/sync-back/inspect.ts +0 -655
- package/node_modules/@sdd-agent-platform/core/src/sync-back/sync-back.test.ts +0 -569
- package/node_modules/@sdd-agent-platform/core/src/sync-back.ts +0 -2
- package/packages/cli/dist/commands/artifact.d.ts +0 -6
- package/packages/cli/dist/commands/artifact.js +0 -168
- package/packages/cli/dist/commands/artifact.js.map +0 -1
- package/packages/cli/dist/commands/sync-back.d.ts +0 -6
- package/packages/cli/dist/commands/sync-back.js +0 -82
- package/packages/cli/dist/commands/sync-back.js.map +0 -1
- package/packages/cli/dist/renderers/artifacts.d.ts +0 -5
- package/packages/cli/dist/renderers/artifacts.js +0 -43
- package/packages/cli/dist/renderers/artifacts.js.map +0 -1
- package/packages/core/dist/doctor/render.d.ts +0 -2
- package/packages/core/dist/doctor/render.js +0 -44
- package/packages/core/dist/doctor/render.js.map +0 -1
- package/packages/core/dist/sync-back/apply.d.ts +0 -17
- package/packages/core/dist/sync-back/apply.js +0 -243
- package/packages/core/dist/sync-back/apply.js.map +0 -1
- package/packages/core/dist/sync-back/inspect.d.ts +0 -110
- package/packages/core/dist/sync-back/inspect.js +0 -497
- package/packages/core/dist/sync-back/inspect.js.map +0 -1
- package/packages/core/dist/sync-back.d.ts +0 -2
- package/packages/core/dist/sync-back.js +0 -3
- package/packages/core/dist/sync-back.js.map +0 -1
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { ingestArtifactResult, inspectArtifactResultIngestions } from '@sdd-agent-platform/core/artifacts';
|
|
2
|
-
import { validateSddResultArtifact } from '@sdd-agent-platform/core/artifacts';
|
|
3
|
-
import { renderSddResultArtifactTemplate } from '@sdd-agent-platform/core/artifacts';
|
|
4
|
-
import { readRunState, writeArtifact } from '@sdd-agent-platform/core/run-state';
|
|
5
|
-
import { toArtifactRootRelativePath } from '@sdd-agent-platform/core/runtime-paths';
|
|
6
|
-
import { readBranchOption, readSddResultStatus } from '../args.js';
|
|
7
|
-
import { hasHelpFlag, hasPreflightFlag, readOption } from '../options.js';
|
|
8
|
-
import { renderArtifactIngestionInspection, renderArtifactIngestionResult, renderArtifactValidationReport } from '../renderers/artifacts.js';
|
|
9
|
-
import { renderTextOrJson } from '../renderers/json.js';
|
|
10
|
-
export async function handleArtifactCommand(projectRoot, command, subcommand, rest) {
|
|
11
|
-
if (command !== 'artifact') {
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
if (hasHelpFlag([subcommand, ...rest].filter((item) => Boolean(item)))) {
|
|
15
|
-
return {
|
|
16
|
-
exitCode: 0,
|
|
17
|
-
output: artifactUsage(subcommand)
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
if (subcommand === 'template') {
|
|
21
|
-
const artifactPath = rest.find((item) => !item.startsWith('--'));
|
|
22
|
-
const taskId = readOption(rest, '--task');
|
|
23
|
-
const agent = readOption(rest, '--agent');
|
|
24
|
-
if (!artifactPath || !taskId || !agent) {
|
|
25
|
-
return {
|
|
26
|
-
exitCode: 2,
|
|
27
|
-
error: artifactUsage('template')
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
if (hasPreflightFlag(rest)) {
|
|
31
|
-
return {
|
|
32
|
-
exitCode: 0,
|
|
33
|
-
output: artifactPreflightOutput('artifact template', artifactPath, rest)
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
const runId = readOption(rest, '--run');
|
|
37
|
-
const branch = readBranchOption(rest);
|
|
38
|
-
if (runId) {
|
|
39
|
-
const scopeError = await artifactTemplateScopeError(projectRoot, runId, taskId, branch);
|
|
40
|
-
if (scopeError) {
|
|
41
|
-
return {
|
|
42
|
-
exitCode: 2,
|
|
43
|
-
error: scopeError
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
const template = await renderSddResultArtifactTemplate(projectRoot, {
|
|
48
|
-
artifactPath,
|
|
49
|
-
taskId,
|
|
50
|
-
agent,
|
|
51
|
-
branch,
|
|
52
|
-
runId: runId ?? undefined,
|
|
53
|
-
status: readSddResultStatus(rest, '--status') ?? 'PASS'
|
|
54
|
-
});
|
|
55
|
-
if (rest.includes('--write')) {
|
|
56
|
-
if (!runId) {
|
|
57
|
-
return {
|
|
58
|
-
exitCode: 2,
|
|
59
|
-
error: 'Usage: sdd artifact template <artifacts/path.md> --task <task_id> --agent <agent> --run <run_id> --write'
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
const written = await writeArtifact(projectRoot, runId, toArtifactRootRelativePath(artifactPath), template);
|
|
63
|
-
return {
|
|
64
|
-
exitCode: 0,
|
|
65
|
-
output: `Artifact template written: ${written.runRelativePath}\nphysical_path=${written.absolutePath}`
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
return {
|
|
69
|
-
exitCode: 0,
|
|
70
|
-
output: template
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
if (subcommand === 'validate') {
|
|
74
|
-
const runId = rest[0];
|
|
75
|
-
const artifactPath = rest[1];
|
|
76
|
-
if (!runId || !artifactPath) {
|
|
77
|
-
return {
|
|
78
|
-
exitCode: 2,
|
|
79
|
-
error: artifactUsage('validate')
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
const expectedTask = readOption(rest, '--task') ?? undefined;
|
|
83
|
-
const expectedAgent = readOption(rest, '--agent') ?? undefined;
|
|
84
|
-
const report = await validateSddResultArtifact(projectRoot, runId, artifactPath, {
|
|
85
|
-
expectedTask,
|
|
86
|
-
expectedAgent
|
|
87
|
-
});
|
|
88
|
-
return {
|
|
89
|
-
exitCode: report.valid ? 0 : 1,
|
|
90
|
-
output: renderTextOrJson(rest, report, (value) => renderArtifactValidationReport(artifactPath, value, expectedTask, expectedAgent))
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
if (subcommand === 'ingest') {
|
|
94
|
-
const runId = rest[0];
|
|
95
|
-
const delegationId = rest[1];
|
|
96
|
-
const artifactPath = rest[2];
|
|
97
|
-
if (!runId || !delegationId || !artifactPath) {
|
|
98
|
-
return {
|
|
99
|
-
exitCode: 2,
|
|
100
|
-
error: artifactUsage('ingest')
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
if (hasPreflightFlag(rest)) {
|
|
104
|
-
return {
|
|
105
|
-
exitCode: 0,
|
|
106
|
-
output: artifactPreflightOutput('artifact ingest', artifactPath, rest)
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
const result = await ingestArtifactResult(projectRoot, runId, { delegationId, artifactPath });
|
|
110
|
-
return {
|
|
111
|
-
exitCode: result.valid ? 0 : 1,
|
|
112
|
-
output: rest.includes('--json') ? JSON.stringify(result, null, 2) : renderArtifactIngestionResult(result)
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
if (subcommand === 'ingestions') {
|
|
116
|
-
const runId = rest[0];
|
|
117
|
-
if (!runId) {
|
|
118
|
-
return {
|
|
119
|
-
exitCode: 2,
|
|
120
|
-
error: artifactUsage('ingestions')
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
const inspection = await inspectArtifactResultIngestions(projectRoot, runId);
|
|
124
|
-
return {
|
|
125
|
-
exitCode: inspection.valid ? 0 : 1,
|
|
126
|
-
output: rest.includes('--json') ? JSON.stringify(inspection, null, 2) : renderArtifactIngestionInspection(inspection)
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
return null;
|
|
130
|
-
}
|
|
131
|
-
function artifactUsage(subcommand) {
|
|
132
|
-
if (subcommand === 'template') {
|
|
133
|
-
return 'Usage: sdd artifact template <artifacts/path.md> --task <task_id> --agent <agent> [--run <run_id> --write] [--branch <branch>] [--status <status>] [--preflight]';
|
|
134
|
-
}
|
|
135
|
-
if (subcommand === 'validate') {
|
|
136
|
-
return 'Usage: sdd artifact validate <run_id> <artifacts/path.md> [--task <task_id>] [--agent <agent>] [--json|--compact-json]';
|
|
137
|
-
}
|
|
138
|
-
if (subcommand === 'ingest') {
|
|
139
|
-
return 'Usage: sdd artifact ingest <run_id> <delegation_id> <artifacts/path.md> [--preflight] [--json]';
|
|
140
|
-
}
|
|
141
|
-
if (subcommand === 'ingestions') {
|
|
142
|
-
return 'Usage: sdd artifact ingestions <run_id> [--json]';
|
|
143
|
-
}
|
|
144
|
-
return 'Usage: sdd artifact template|validate|ingest|ingestions [options]';
|
|
145
|
-
}
|
|
146
|
-
async function artifactTemplateScopeError(projectRoot, runId, taskId, branch) {
|
|
147
|
-
const state = await readRunState(projectRoot, runId);
|
|
148
|
-
if (!state.partition && !state.gitBranch) {
|
|
149
|
-
return `Run ${runId} is unscoped; create it with sdd run create --branch <branch> --task <task_id> before writing artifacts.`;
|
|
150
|
-
}
|
|
151
|
-
if (!state.taskId) {
|
|
152
|
-
return `Run ${runId} has no scoped task; create it with sdd run create --branch <branch> --task <task_id> before writing artifacts.`;
|
|
153
|
-
}
|
|
154
|
-
if (state.taskId !== taskId) {
|
|
155
|
-
return `Run ${runId} is scoped to task ${state.taskId}, not ${taskId}.`;
|
|
156
|
-
}
|
|
157
|
-
if (branch && branch !== state.partition && branch !== state.gitBranch) {
|
|
158
|
-
return `Run ${runId} is scoped to branch ${state.gitBranch ?? state.partition}, not ${branch}.`;
|
|
159
|
-
}
|
|
160
|
-
return null;
|
|
161
|
-
}
|
|
162
|
-
function artifactPreflightOutput(commandName, artifactPath, args) {
|
|
163
|
-
if (args.includes('--json') || args.includes('--compact-json')) {
|
|
164
|
-
return renderTextOrJson(args, { contract: 'sdd-command-preflight-v1', command: commandName, artifactPath, sideEffects: 'none', status: 'PASS' }, (value) => JSON.stringify(value, null, 2));
|
|
165
|
-
}
|
|
166
|
-
return `SDD command preflight PASS\ncommand=${commandName}\nartifact=${artifactPath}\nside_effects=none`;
|
|
167
|
-
}
|
|
168
|
-
//# sourceMappingURL=artifact.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"artifact.js","sourceRoot":"","sources":["../../src/commands/artifact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,+BAA+B,EAAE,MAAM,oCAAoC,CAAC;AAC3G,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,+BAA+B,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,iCAAiC,EAAE,6BAA6B,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAC7I,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAQxD,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,WAAmB,EAAE,OAA2B,EAAE,UAA8B,EAAE,IAAc;IAC1I,IAAI,OAAO,KAAK,U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AE,CAAC,CAAC,CAAC,CAAC;IAC9L,CAAC;IACD,OAAO,uCAAuC,WAAW,cAAc,YAAY,qBAAqB,CAAC;AAC3G,CAAC"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { applySyncBack } from '@sdd-agent-platform/core/sync-back';
|
|
2
|
-
import { inspectSyncBack } from '@sdd-agent-platform/core/sync-back';
|
|
3
|
-
import { readBranchOption, readOptionalPositionalArgument } from '../args.js';
|
|
4
|
-
import { hasHelpFlag, hasPreflightFlag, readOption } from '../options.js';
|
|
5
|
-
import { jsonOutput, wantsJson } from '../renderers/json.js';
|
|
6
|
-
import { renderSyncBackApplyResult, renderSyncBackInspection } from '../renderers/workflow.js';
|
|
7
|
-
export async function handleSyncBackCommand(projectRoot, command, subcommand, rest) {
|
|
8
|
-
if (command !== 'sync-back') {
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
if (hasHelpFlag([subcommand, ...rest].filter((item) => Boolean(item)))) {
|
|
12
|
-
return {
|
|
13
|
-
exitCode: 0,
|
|
14
|
-
output: syncBackUsage(subcommand)
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
if (subcommand === 'inspect') {
|
|
18
|
-
const runId = readOptionalPositionalArgument(rest);
|
|
19
|
-
const taskId = readOption(rest, '--task') ?? undefined;
|
|
20
|
-
if (!runId && !taskId) {
|
|
21
|
-
return {
|
|
22
|
-
exitCode: 2,
|
|
23
|
-
error: syncBackUsage('inspect')
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
const result = await inspectSyncBack(projectRoot, {
|
|
27
|
-
runId,
|
|
28
|
-
branch: readBranchOption(rest),
|
|
29
|
-
taskId
|
|
30
|
-
});
|
|
31
|
-
const json = wantsJson(rest);
|
|
32
|
-
return {
|
|
33
|
-
exitCode: 0,
|
|
34
|
-
output: json ? jsonOutput(result, rest) : renderSyncBackInspection(result)
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
if (subcommand === 'apply') {
|
|
38
|
-
const runId = readOptionalPositionalArgument(rest);
|
|
39
|
-
const taskId = readOption(rest, '--task') ?? undefined;
|
|
40
|
-
if (!runId && !taskId) {
|
|
41
|
-
return {
|
|
42
|
-
exitCode: 2,
|
|
43
|
-
error: syncBackUsage('apply')
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
if (hasPreflightFlag(rest)) {
|
|
47
|
-
return {
|
|
48
|
-
exitCode: 0,
|
|
49
|
-
output: syncBackPreflightOutput(runId, taskId, rest)
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
const result = await applySyncBack(projectRoot, {
|
|
53
|
-
runId,
|
|
54
|
-
branch: readBranchOption(rest),
|
|
55
|
-
taskId,
|
|
56
|
-
approved: rest.includes('--approved'),
|
|
57
|
-
refreshVerify: rest.includes('--refresh-verify')
|
|
58
|
-
});
|
|
59
|
-
const json = wantsJson(rest);
|
|
60
|
-
return {
|
|
61
|
-
exitCode: 0,
|
|
62
|
-
output: json ? jsonOutput(result, rest) : renderSyncBackApplyResult(result)
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
function syncBackUsage(subcommand) {
|
|
68
|
-
if (subcommand === 'apply') {
|
|
69
|
-
return 'Usage: sdd sync-back apply [<run_id>] [--branch <branch>] --task <task_id> [--approved] [--refresh-verify] [--preflight] [--json|--compact-json]';
|
|
70
|
-
}
|
|
71
|
-
if (subcommand === 'inspect') {
|
|
72
|
-
return 'Usage: sdd sync-back inspect [<run_id>] [--branch <branch>] --task <task_id> [--json|--compact-json]';
|
|
73
|
-
}
|
|
74
|
-
return 'Usage: sdd sync-back inspect|apply [<run_id>] [--branch <branch>] --task <task_id> [--approved] [--refresh-verify] [--preflight] [--json|--compact-json]';
|
|
75
|
-
}
|
|
76
|
-
function syncBackPreflightOutput(runId, taskId, args) {
|
|
77
|
-
if (wantsJson(args)) {
|
|
78
|
-
return jsonOutput({ contract: 'sdd-command-preflight-v1', command: 'sync-back apply', runId: runId ?? null, taskId: taskId ?? null, sideEffects: 'none', status: 'PASS' }, args);
|
|
79
|
-
}
|
|
80
|
-
return `SDD command preflight PASS\ncommand=sync-back apply\nrun=${runId ?? 'latest'}\ntask=${taskId ?? 'none'}\nside_effects=none`;
|
|
81
|
-
}
|
|
82
|
-
//# sourceMappingURL=sync-back.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sync-back.js","sourceRoot":"","sources":["../../src/commands/sync-back.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,8BAA8B,EAAE,MAAM,YAAY,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAQ/F,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,WAAmB,EAAE,OAA2B,EAAE,UAA8B,EAAE,IAAc;IAC1I,IAAI,OAAO,KAAK,WAAW,EAAE,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,WAAW,CAAC,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACvF,OAAO;YACL,QAAQ,EAAE,CAAC;YACX,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC;SAClC,CAAC;IACJ,CAAC;IAGD,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,MAAM,KAAK,GAAG,8BAA8B,CAAC,IAAI,CAAC,CAAC;QACnD,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;YAC9B,MAAM;YACN,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC;YACrC,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC;SACjD,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;QAC7B,OAAO;YACL,QAAQ,EAAE,CAAC;YACX,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,yBAAyB,CAAC,MAAM,CAAC;SAC5E,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AACD,SAAS,aAAa,CAAC,UAA8B;IACnD,IAAI,UAAU,KAAK,OAAO,EAAE,CAAC;QAC3B,OAAO,kJAAkJ,CAAC;IAC5J,CAAC;IACD,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,sGAAsG,CAAC;IAChH,CAAC;IACD,OAAO,0JAA0J,CAAC;AACpK,CAAC;AAED,SAAS,uBAAuB,CAAC,KAAyB,EAAE,MAA0B,EAAE,IAAc;IACpG,IAAI,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QACpB,OAAO,UAAU,CAAC,EAAE,QAAQ,EAAE,0BAA0B,EAAE,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,IAAI,IAAI,EAAE,MAAM,EAAE,MAAM,IAAI,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,CAAC;IACnL,CAAC;IACD,OAAO,4DAA4D,KAAK,IAAI,QAAQ,UAAU,MAAM,IAAI,MAAM,qBAAqB,CAAC;AACtI,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ArtifactResultIngestionInspection, ArtifactResultIngestionResult } from '@sdd-agent-platform/core/artifacts';
|
|
2
|
-
import type { validateSddResultArtifact } from '@sdd-agent-platform/core/artifacts';
|
|
3
|
-
export declare function renderArtifactIngestionResult(result: ArtifactResultIngestionResult): string;
|
|
4
|
-
export declare function renderArtifactIngestionInspection(inspection: ArtifactResultIngestionInspection): string;
|
|
5
|
-
export declare function renderArtifactValidationReport(artifactPath: string, report: Awaited<ReturnType<typeof validateSddResultArtifact>>, expectedTask?: string, expectedAgent?: string): string;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { renderIssues } from './issues.js';
|
|
2
|
-
export function renderArtifactIngestionResult(result) {
|
|
3
|
-
const lines = [`Artifact ingestion ${result.record.status}: ${result.record.artifactPath}`];
|
|
4
|
-
lines.push(`delegation=${result.record.delegationId} duplicate=${result.duplicate} result=${result.record.resultStatus ?? 'n/a'} terminal=${result.record.delegationStatus ?? 'n/a'}`);
|
|
5
|
-
if (result.record.issues.length > 0) {
|
|
6
|
-
lines.push('issues');
|
|
7
|
-
for (const issue of result.record.issues) {
|
|
8
|
-
lines.push(`- ${issue.field}: ${issue.message}`);
|
|
9
|
-
lines.push(` recommendation: ${issue.recommendation}`);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
if (result.record.gaps.length > 0) {
|
|
13
|
-
lines.push('gaps');
|
|
14
|
-
for (const gap of result.record.gaps) {
|
|
15
|
-
lines.push(`- [${gap.severity}] ${gap.type} ${gap.field}: ${gap.message}`);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return lines.join('\n');
|
|
19
|
-
}
|
|
20
|
-
export function renderArtifactIngestionInspection(inspection) {
|
|
21
|
-
const lines = [`Artifact ingestions ${inspection.valid ? 'valid' : 'invalid'} for ${inspection.runId}`];
|
|
22
|
-
lines.push(`records=${inspection.records.length}`);
|
|
23
|
-
for (const record of inspection.records) {
|
|
24
|
-
lines.push(`- ${record.delegationId} ${record.status} artifact=${record.artifactPath} result=${record.resultStatus ?? 'n/a'} delegation=${record.delegationStatus ?? 'n/a'}`);
|
|
25
|
-
}
|
|
26
|
-
renderIssues(lines, inspection.issues);
|
|
27
|
-
return lines.join('\n');
|
|
28
|
-
}
|
|
29
|
-
export function renderArtifactValidationReport(artifactPath, report, expectedTask, expectedAgent) {
|
|
30
|
-
if (report.valid) {
|
|
31
|
-
return `Artifact valid: ${artifactPath}`;
|
|
32
|
-
}
|
|
33
|
-
const lines = [`Artifact invalid: ${artifactPath}`];
|
|
34
|
-
for (const issue of report.issues) {
|
|
35
|
-
lines.push(`- ${issue.field}: ${issue.message}`);
|
|
36
|
-
lines.push(` recommendation: ${issue.recommendation}`);
|
|
37
|
-
}
|
|
38
|
-
if (expectedTask && expectedAgent) {
|
|
39
|
-
lines.push(`next sdd artifact template ${artifactPath} --task ${expectedTask} --agent ${expectedAgent} --run <run_id> --write`);
|
|
40
|
-
}
|
|
41
|
-
return lines.join('\n');
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=artifacts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../src/renderers/artifacts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,UAAU,6BAA6B,CAAC,MAAqC;IACjF,MAAM,KAAK,GAAG,CAAC,sBAAsB,MAAM,CAAC,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;IAC5F,KAAK,CAAC,IAAI,CAAC,cAAc,MAAM,CAAC,MAAM,CAAC,YAAY,cAAc,MAAM,CAAC,SAAS,WAAW,MAAM,CAAC,MAAM,CAAC,YAAY,IAAI,KAAK,aAAa,MAAM,CAAC,MAAM,CAAC,gBAAgB,IAAI,KAAK,EAAE,CAAC,CAAC;IACvL,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrB,KAAK,MAAM,KAAK,IAAI,MAAM,CAA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U,CAAC,MAAM,CAAC,CAAC;IACvC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,8BAA8B,CAAC,YAAoB,EAAE,MAA6D,EAAE,YAAqB,EAAE,aAAsB;IAC/K,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,OAAO,mBAAmB,YAAY,EAAE,CAAC;IAC3C,CAAC;IACD,MAAM,KAAK,GAAG,CAAC,qBAAqB,YAAY,EAAE,CAAC,CAAC;IACpD,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAClC,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QACjD,KAAK,CAAC,IAAI,CAAC,qBAAqB,KAAK,CAAC,cAAc,EAAE,CAAC,CAAC;IAC1D,CAAC;IACD,IAAI,YAAY,IAAI,aAAa,EAAE,CAAC;QAClC,KAAK,CAAC,IAAI,CAAC,8BAA8B,YAAY,WAAW,YAAY,YAAY,aAAa,yBAAyB,CAAC,CAAC;IAClI,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
export function renderDoctorReport(report) {
|
|
2
|
-
const failures = report.checks.filter((check) => check.level === 'FAIL');
|
|
3
|
-
const warnings = report.checks.filter((check) => check.level === 'WARN');
|
|
4
|
-
const passes = report.checks.filter((check) => check.level === 'PASS');
|
|
5
|
-
const lines = ['SDD doctor', 'decision'];
|
|
6
|
-
lines.push(`- status=${report.status}`);
|
|
7
|
-
lines.push(`- checks pass=${passes.length} warn=${warnings.length} fail=${failures.length}`);
|
|
8
|
-
lines.push('evidence');
|
|
9
|
-
const visibleChecks = [...failures, ...warnings, ...passes.slice(0, failures.length === 0 && warnings.length === 0 ? 5 : 2)];
|
|
10
|
-
if (visibleChecks.length === 0) {
|
|
11
|
-
lines.push('- no checks reported');
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
for (const check of visibleChecks) {
|
|
15
|
-
const action = check.action ? ` action=${check.action}` : '';
|
|
16
|
-
lines.push(`- [${check.level}] ${check.check}: ${check.message}${action}`);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
const hiddenPasses = passes.length - visibleChecks.filter((check) => check.level === 'PASS').length;
|
|
20
|
-
if (hiddenPasses > 0) {
|
|
21
|
-
lines.push(`- ${hiddenPasses} passing check(s) hidden; use --json for full details`);
|
|
22
|
-
}
|
|
23
|
-
lines.push('gaps');
|
|
24
|
-
if (failures.length === 0 && warnings.length === 0) {
|
|
25
|
-
lines.push('- none');
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
for (const check of [...failures, ...warnings]) {
|
|
29
|
-
lines.push(`- [${check.level}] ${check.check}: ${check.action ?? check.message}`);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
lines.push('next');
|
|
33
|
-
if (failures[0]?.action) {
|
|
34
|
-
lines.push(`- ${failures[0].action}`);
|
|
35
|
-
}
|
|
36
|
-
else if (warnings[0]?.action) {
|
|
37
|
-
lines.push(`- ${warnings[0].action}`);
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
lines.push('- sdd status');
|
|
41
|
-
}
|
|
42
|
-
return lines.join('\n');
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=render.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/doctor/render.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CAAC,MAAoB;IACrD,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC;IACzE,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAA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AAC;AAC1B,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { SyncBackInspection } from './inspect.js';
|
|
2
|
-
export interface SyncBackApplyResult {
|
|
3
|
-
runId: string;
|
|
4
|
-
taskId: string;
|
|
5
|
-
applied: boolean;
|
|
6
|
-
tasksPath: string;
|
|
7
|
-
inspection: SyncBackInspection;
|
|
8
|
-
message: string;
|
|
9
|
-
verifyRefreshed: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare function applySyncBack(projectRoot: string, options: {
|
|
12
|
-
runId?: string;
|
|
13
|
-
branch?: string;
|
|
14
|
-
taskId?: string;
|
|
15
|
-
approved?: boolean;
|
|
16
|
-
refreshVerify?: boolean;
|
|
17
|
-
}): Promise<SyncBackApplyResult>;
|
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
import { readFile, writeFile } from 'node:fs/promises';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { appendEvent } from '../run-state/events.js';
|
|
4
|
-
import { readRunState, writeRunState } from '../run-state/run-state.js';
|
|
5
|
-
import { rebuildLocalRunIndex } from '../run-state/run-index.js';
|
|
6
|
-
import { parseSddBranch } from '../sdd-docs/task-parser.js';
|
|
7
|
-
import { inspectSyncBack } from './inspect.js';
|
|
8
|
-
import { writeVerifyContract } from '../verification/verify-contract.js';
|
|
9
|
-
import { readRuntimeSyncBackDecision, recordRuntimeSyncBackDecision, runtimeScopedId } from '../storage/runtime-store.js';
|
|
10
|
-
export async function applySyncBack(projectRoot, options) {
|
|
11
|
-
let inspection = await inspectSyncBack(projectRoot, options);
|
|
12
|
-
let verifyRefreshed = false;
|
|
13
|
-
if (options.refreshVerify === true && inspection.staleVerifyRecoveryCommand) {
|
|
14
|
-
await writeVerifyContract(projectRoot, { branch: inspection.branch, branchSource: 'cli_option', force: true });
|
|
15
|
-
verifyRefreshed = true;
|
|
16
|
-
inspection = await inspectSyncBack(projectRoot, { ...options, runId: inspection.runId, taskId: inspection.taskId ?? options.taskId });
|
|
17
|
-
}
|
|
18
|
-
if (!inspection.taskId) {
|
|
19
|
-
throw new Error('Cannot apply sync-back without a task id.');
|
|
20
|
-
}
|
|
21
|
-
if (inspection.status === 'blocked') {
|
|
22
|
-
throw new Error(`Cannot apply sync-back for ${inspection.runId}: ${inspection.reasons.join(' ')}`);
|
|
23
|
-
}
|
|
24
|
-
if (!inspection.markdownTask) {
|
|
25
|
-
throw new Error(`Cannot apply sync-back for ${inspection.runId}: target task is missing.`);
|
|
26
|
-
}
|
|
27
|
-
if (inspection.status === 'applied') {
|
|
28
|
-
const appliedTaskId = inspection.taskId;
|
|
29
|
-
const appliedMarkdownTask = inspection.markdownTask;
|
|
30
|
-
if (options.refreshVerify === true && inspection.staleVerifyRecoveryCommand) {
|
|
31
|
-
await writeVerifyContract(projectRoot, { branch: inspection.branch, branchSource: 'cli_option', force: true });
|
|
32
|
-
verifyRefreshed = true;
|
|
33
|
-
inspection = await inspectSyncBack(projectRoot, { ...options, runId: inspection.runId, taskId: appliedTaskId });
|
|
34
|
-
}
|
|
35
|
-
return {
|
|
36
|
-
runId: inspection.runId,
|
|
37
|
-
taskId: appliedTaskId,
|
|
38
|
-
applied: false,
|
|
39
|
-
tasksPath: appliedMarkdownTask.source.filePath,
|
|
40
|
-
inspection,
|
|
41
|
-
message: `Sync-back for ${inspection.runId}/${appliedTaskId} was already applied.`,
|
|
42
|
-
verifyRefreshed
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
if (inspection.applyPolicy.requiresApproval && options.approved !== true) {
|
|
46
|
-
throw new Error(`Cannot apply sync-back for ${inspection.runId}: ${inspection.applyPolicy.reasons.join(' ')} Re-run with --approved after human confirmation.`);
|
|
47
|
-
}
|
|
48
|
-
const state = await readRunState(projectRoot, inspection.runId);
|
|
49
|
-
const tasksPath = inspection.markdownTask.source.filePath;
|
|
50
|
-
const rawTasks = await readFile(tasksPath, 'utf8');
|
|
51
|
-
const note = syncBackImplementationNote(state, inspection);
|
|
52
|
-
const nextTasks = applySyncBackToTasksMarkdown(rawTasks, inspection.markdownTask, note);
|
|
53
|
-
await writeFile(tasksPath, nextTasks, 'utf8');
|
|
54
|
-
const appliedModel = await parseSddBranch(projectRoot, inspection.branch);
|
|
55
|
-
await writeRunState(projectRoot, {
|
|
56
|
-
...state,
|
|
57
|
-
documentSnapshot: documentSnapshotFromModel(appliedModel),
|
|
58
|
-
syncBack: {
|
|
59
|
-
...state.syncBack,
|
|
60
|
-
status: 'applied'
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
const existingDecision = await readRuntimeSyncBackDecision(projectRoot, state.runId, inspection.taskId);
|
|
64
|
-
const decisionTime = new Date().toISOString();
|
|
65
|
-
await recordRuntimeSyncBackDecision(projectRoot, {
|
|
66
|
-
decisionId: existingDecision?.decisionId ?? runtimeScopedId(state.runId, inspection.taskId, 'sync-back'),
|
|
67
|
-
runId: state.runId,
|
|
68
|
-
branch: inspection.branch,
|
|
69
|
-
taskId: inspection.taskId,
|
|
70
|
-
status: 'applied',
|
|
71
|
-
proposalPath: inspection.proposalPath,
|
|
72
|
-
proposalDigest: inspection.proposalDigest,
|
|
73
|
-
proposalPayloadId: existingDecision?.proposalPayloadId ?? null,
|
|
74
|
-
reasons: [],
|
|
75
|
-
createdAt: existingDecision?.createdAt ?? decisionTime,
|
|
76
|
-
updatedAt: decisionTime,
|
|
77
|
-
payload: { previousStatus: existingDecision?.status ?? state.syncBack.status, tasksPath: path.relative(projectRoot, tasksPath) }
|
|
78
|
-
});
|
|
79
|
-
await appendEvent(projectRoot, state.runId, {
|
|
80
|
-
event: 'sync_back_applied',
|
|
81
|
-
runId: state.runId,
|
|
82
|
-
summary: `Sync-back applied for ${inspection.taskId}`,
|
|
83
|
-
data: {
|
|
84
|
-
task: inspection.taskId,
|
|
85
|
-
branch: inspection.branch,
|
|
86
|
-
tasksPath: path.relative(projectRoot, tasksPath),
|
|
87
|
-
proposal: inspection.proposalPath
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
if (options.refreshVerify === true) {
|
|
91
|
-
await writeVerifyContract(projectRoot, { branch: inspection.branch, branchSource: 'cli_option', force: true });
|
|
92
|
-
verifyRefreshed = true;
|
|
93
|
-
}
|
|
94
|
-
await rebuildLocalRunIndex(projectRoot);
|
|
95
|
-
const appliedInspection = await inspectSyncBack(projectRoot, { ...options, runId: inspection.runId, taskId: inspection.taskId });
|
|
96
|
-
return {
|
|
97
|
-
runId: state.runId,
|
|
98
|
-
taskId: inspection.taskId,
|
|
99
|
-
applied: true,
|
|
100
|
-
tasksPath,
|
|
101
|
-
inspection: appliedInspection,
|
|
102
|
-
message: `Sync-back applied for ${state.runId}/${inspection.taskId}.`,
|
|
103
|
-
verifyRefreshed
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
function documentSnapshotFromModel(model) {
|
|
107
|
-
return {
|
|
108
|
-
specHash: model.documents.specHash ?? null,
|
|
109
|
-
planHash: model.documents.planHash ?? null,
|
|
110
|
-
tasksHash: model.documents.tasksHash ?? null,
|
|
111
|
-
specContractHash: model.documents.specContractHash ?? null,
|
|
112
|
-
planContractHash: model.documents.planContractHash ?? null,
|
|
113
|
-
tasksContractHash: model.documents.tasksContractHash ?? null,
|
|
114
|
-
planBasedOnSpecHash: model.documents.planBasedOnSpecHash ?? null,
|
|
115
|
-
tasksBasedOnPlanHash: model.documents.tasksBasedOnPlanHash ?? null,
|
|
116
|
-
planBasedOnSpecContractHash: model.documents.planBasedOnSpecContractHash ?? null,
|
|
117
|
-
tasksBasedOnPlanContractHash: model.documents.tasksBasedOnPlanContractHash ?? null
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
function applySyncBackToTasksMarkdown(raw, task, note) {
|
|
121
|
-
const range = locateTaskBlockRange(raw, task);
|
|
122
|
-
const block = raw.slice(range.start, range.end);
|
|
123
|
-
const nextBlock = setTaskBlockStatus(block, 'completed');
|
|
124
|
-
const sectionEnd = nextTaskStart(raw, range.end);
|
|
125
|
-
const section = raw.slice(range.end, sectionEnd);
|
|
126
|
-
const nextSection = appendSyncBackImplementationNote(section, note);
|
|
127
|
-
return `${raw.slice(0, range.start)}${nextBlock}${nextSection}${raw.slice(sectionEnd)}`;
|
|
128
|
-
}
|
|
129
|
-
function locateTaskBlockRange(raw, task) {
|
|
130
|
-
const matches = Array.from(raw.matchAll(/^\s*```sdd-task\s*\r?\n([\s\S]*?)\r?^\s*```\s*$/gm));
|
|
131
|
-
const matching = matches.filter((match) => {
|
|
132
|
-
const metadata = parseSimpleYamlBlock(match[1] ?? '');
|
|
133
|
-
const id = scalarValue(metadata.id);
|
|
134
|
-
const start = match.index ?? 0;
|
|
135
|
-
return id === task.id && lineNumberAt(raw, start) === task.source.lineStart;
|
|
136
|
-
});
|
|
137
|
-
const fallback = matches.filter((match) => scalarValue(parseSimpleYamlBlock(match[1] ?? '').id) === task.id);
|
|
138
|
-
const selected = matching.length === 1 ? matching[0] : fallback.length === 1 ? fallback[0] : null;
|
|
139
|
-
if (!selected || selected.index === undefined) {
|
|
140
|
-
throw new Error(`Cannot locate a unique sdd-task block for ${task.id}.`);
|
|
141
|
-
}
|
|
142
|
-
return {
|
|
143
|
-
start: selected.index,
|
|
144
|
-
end: selected.index + selected[0].length
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
function setTaskBlockStatus(block, status) {
|
|
148
|
-
if (/^\s*status:\s*[^\r\n]*$/m.test(block)) {
|
|
149
|
-
return block.replace(/^(\s*status:\s*)[^\r\n]*$/m, `$1${status}`);
|
|
150
|
-
}
|
|
151
|
-
const eol = block.includes('\r\n') ? '\r\n' : '\n';
|
|
152
|
-
if (/^\s*id:\s*[^\r\n]*$/m.test(block)) {
|
|
153
|
-
return block.replace(/^(\s*id:\s*[^\r\n]*)$/m, `$1${eol}status: ${status}`);
|
|
154
|
-
}
|
|
155
|
-
throw new Error('Cannot update task status because the sdd-task block has no id line.');
|
|
156
|
-
}
|
|
157
|
-
function appendSyncBackImplementationNote(section, note) {
|
|
158
|
-
const runMatch = note.match(/run `([^`]+)`/);
|
|
159
|
-
if (runMatch && section.includes(`run \`${runMatch[1]}\``)) {
|
|
160
|
-
return section;
|
|
161
|
-
}
|
|
162
|
-
const heading = section.match(/^####\s+Implementation Notes\s*$/im);
|
|
163
|
-
if (!heading || heading.index === undefined) {
|
|
164
|
-
const separator = section.length === 0 || section.endsWith('\n') ? '' : '\n';
|
|
165
|
-
return `${section}${separator}\n#### Implementation Notes\n\n${note}\n`;
|
|
166
|
-
}
|
|
167
|
-
const contentStart = heading.index + heading[0].length;
|
|
168
|
-
const remainder = section.slice(contentStart);
|
|
169
|
-
const nextHeadingOffset = remainder.search(/\n####\s+|\n###\s+/);
|
|
170
|
-
const insertAt = nextHeadingOffset < 0 ? section.length : contentStart + nextHeadingOffset;
|
|
171
|
-
const before = section.slice(0, insertAt).trimEnd();
|
|
172
|
-
const after = section.slice(insertAt);
|
|
173
|
-
return `${before}\n${note}${after}`;
|
|
174
|
-
}
|
|
175
|
-
function syncBackImplementationNote(state, inspection) {
|
|
176
|
-
const artifacts = inspection.artifacts.length > 0
|
|
177
|
-
? inspection.artifacts.map((artifact) => `\`${artifact}\``).join(', ')
|
|
178
|
-
: 'none';
|
|
179
|
-
return `- Sync-back applied from run \`${state.runId}\` (${state.updatedAt}); proposal: \`${inspection.proposalPath ?? 'none'}\`; artifacts: ${artifacts}.`;
|
|
180
|
-
}
|
|
181
|
-
function parseSimpleYamlBlock(raw) {
|
|
182
|
-
const result = {};
|
|
183
|
-
const lines = raw.split(/\r?\n/);
|
|
184
|
-
let currentListKey = null;
|
|
185
|
-
for (const line of lines) {
|
|
186
|
-
const trimmed = line.trim();
|
|
187
|
-
if (!trimmed || trimmed.startsWith('#')) {
|
|
188
|
-
continue;
|
|
189
|
-
}
|
|
190
|
-
if (currentListKey && /^-\s+/.test(trimmed)) {
|
|
191
|
-
const current = result[currentListKey];
|
|
192
|
-
const items = Array.isArray(current) ? current : [];
|
|
193
|
-
items.push(unquoteSimpleYamlValue(trimmed.slice(2).trim()));
|
|
194
|
-
result[currentListKey] = items;
|
|
195
|
-
continue;
|
|
196
|
-
}
|
|
197
|
-
const scalarMatch = trimmed.match(/^([A-Za-z0-9_-]+):\s*(.*)$/);
|
|
198
|
-
if (!scalarMatch) {
|
|
199
|
-
currentListKey = null;
|
|
200
|
-
continue;
|
|
201
|
-
}
|
|
202
|
-
const key = scalarMatch[1];
|
|
203
|
-
const value = scalarMatch[2].trim();
|
|
204
|
-
if (value === '') {
|
|
205
|
-
result[key] = [];
|
|
206
|
-
currentListKey = key;
|
|
207
|
-
}
|
|
208
|
-
else if (value === '[]') {
|
|
209
|
-
result[key] = [];
|
|
210
|
-
currentListKey = null;
|
|
211
|
-
}
|
|
212
|
-
else if (value.startsWith('[') && value.endsWith(']')) {
|
|
213
|
-
result[key] = value.slice(1, -1).split(',').map((item) => unquoteSimpleYamlValue(item.trim())).filter(Boolean);
|
|
214
|
-
currentListKey = null;
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
result[key] = unquoteSimpleYamlValue(value);
|
|
218
|
-
currentListKey = null;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
return result;
|
|
222
|
-
}
|
|
223
|
-
function unquoteSimpleYamlValue(value) {
|
|
224
|
-
if (value.length >= 2) {
|
|
225
|
-
const first = value[0];
|
|
226
|
-
const last = value[value.length - 1];
|
|
227
|
-
if ((first === '"' && last === '"') || (first === "'" && last === "'")) {
|
|
228
|
-
return value.slice(1, -1);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
return value;
|
|
232
|
-
}
|
|
233
|
-
function scalarValue(value) {
|
|
234
|
-
return typeof value === 'string' && value.length > 0 ? value : null;
|
|
235
|
-
}
|
|
236
|
-
function lineNumberAt(raw, offset) {
|
|
237
|
-
return raw.slice(0, offset).split(/\r?\n/).length;
|
|
238
|
-
}
|
|
239
|
-
function nextTaskStart(raw, offset, limit = raw.length) {
|
|
240
|
-
const next = raw.slice(offset, limit).search(/^\s*###\s+/m);
|
|
241
|
-
return next < 0 ? limit : offset + next;
|
|
242
|
-
}
|
|
243
|
-
//# sourceMappingURL=apply.js.map
|