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
|
@@ -26,7 +26,7 @@ export interface SubagentDispatch {
|
|
|
26
26
|
mode: SubagentDispatchMode;
|
|
27
27
|
status: SubagentDispatchStatus;
|
|
28
28
|
blocking: boolean;
|
|
29
|
-
requiredBefore: 'handoff' | '
|
|
29
|
+
requiredBefore: 'handoff' | 'ship' | 'never';
|
|
30
30
|
contextRef: RuntimeRef;
|
|
31
31
|
createdAt: string;
|
|
32
32
|
updatedAt: string;
|
|
@@ -90,7 +90,7 @@ test('subagent projections can be written read and inspected', async () => {
|
|
|
90
90
|
assert.equal(fresh.status, 'fresh');
|
|
91
91
|
assert.equal(fresh.completed, 1);
|
|
92
92
|
assert.match(fresh.reasons[0], /non-authoritative/);
|
|
93
|
-
assert.match(fresh.reasons[0], /main workflow still owns approvals,
|
|
93
|
+
assert.match(fresh.reasons[0], /main workflow still owns approvals, truth-alignment, and ship/);
|
|
94
94
|
} finally {
|
|
95
95
|
await rm(root, { recursive: true, force: true });
|
|
96
96
|
}
|
|
@@ -145,7 +145,7 @@ test('subagent inspection ignores dispatches from archived runs', async () => {
|
|
|
145
145
|
assert.equal(inspected.dispatches, 0);
|
|
146
146
|
assert.equal(inspected.failed, 0);
|
|
147
147
|
assert.equal(inspected.blockingOpen, 0);
|
|
148
|
-
assert.match(inspected.reasons[0], /Main workflow still owns lifecycle gates, approvals,
|
|
148
|
+
assert.match(inspected.reasons[0], /Main workflow still owns lifecycle gates, approvals, truth-alignment, and ship/);
|
|
149
149
|
} finally {
|
|
150
150
|
await rm(root, { recursive: true, force: true });
|
|
151
151
|
}
|
|
@@ -169,7 +169,7 @@ test('subagent inspection lets a newer successful rerun supersede an older faile
|
|
|
169
169
|
assert.equal(inspected.blockingOpen, 0);
|
|
170
170
|
assert.equal(inspected.completed, 1);
|
|
171
171
|
assert.match(inspected.reasons[0], /non-authoritative/);
|
|
172
|
-
assert.match(inspected.reasons[0], /Main workflow still owns approvals,
|
|
172
|
+
assert.match(inspected.reasons[0], /Main workflow still owns approvals, truth-alignment, and ship/);
|
|
173
173
|
} finally {
|
|
174
174
|
await rm(root, { recursive: true, force: true });
|
|
175
175
|
}
|
|
@@ -230,11 +230,11 @@ function timestamp(value: string): number {
|
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
function subagentDispatchReasons(status: SubagentDispatchDiagnosticStatus, blockingOpen: number, failed: number, stale: number, archived: number, superseded: number): string[] {
|
|
233
|
-
const recoveryHint = 'Archive failed exploratory runs with sdd run archive <run_id> --reason <text>, or rerun the subagent worker to supersede the failed dispatch; subagent evidence still cannot approve high-risk execution,
|
|
233
|
+
const recoveryHint = 'Archive failed exploratory runs with sdd run archive <run_id> --reason <text>, or rerun the subagent worker to supersede the failed dispatch; subagent evidence still cannot approve high-risk execution, truth-alignment, or ship.';
|
|
234
234
|
if (status === 'missing') {
|
|
235
235
|
return archived > 0 || superseded > 0
|
|
236
|
-
? [`No active subagent dispatch projections block the main workflow; ignored archived=${archived} superseded=${superseded}. Main workflow still owns lifecycle gates, approvals,
|
|
237
|
-
: ['No subagent dispatch projections recorded; main workflow remains unblocked and still owns lifecycle gates, approvals,
|
|
236
|
+
? [`No active subagent dispatch projections block the main workflow; ignored archived=${archived} superseded=${superseded}. Main workflow still owns lifecycle gates, approvals, truth-alignment, and ship.`]
|
|
237
|
+
: ['No subagent dispatch projections recorded; main workflow remains unblocked and still owns lifecycle gates, approvals, truth-alignment, and ship.'];
|
|
238
238
|
}
|
|
239
239
|
if (status === 'blocked') {
|
|
240
240
|
return [`${blockingOpen} blocking subagent dispatch(es) are incomplete. Complete, rerun, or archive stale exploratory runs before doctor/ship; do not use partial subagent evidence as approval.`];
|
|
@@ -249,8 +249,8 @@ function subagentDispatchReasons(status: SubagentDispatchDiagnosticStatus, block
|
|
|
249
249
|
return [`Subagent dispatch projection producer is incompatible with ${SUBAGENT_RUNTIME_PRODUCER_VERSION}; refresh the subagent projection before relying on its diagnostic evidence.`];
|
|
250
250
|
}
|
|
251
251
|
return archived > 0 || superseded > 0
|
|
252
|
-
? [`Subagent dispatch projections are fresh and non-authoritative; ignored archived=${archived} superseded=${superseded}. Main workflow still owns approvals,
|
|
253
|
-
: ['Subagent dispatch projections are fresh and non-authoritative; main workflow still owns approvals,
|
|
252
|
+
? [`Subagent dispatch projections are fresh and non-authoritative; ignored archived=${archived} superseded=${superseded}. Main workflow still owns approvals, truth-alignment, and ship.`]
|
|
253
|
+
: ['Subagent dispatch projections are fresh and non-authoritative; main workflow still owns approvals, truth-alignment, and ship.'];
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
function normalizeSubagentRelativePath(relativePath: string): string | null {
|
|
@@ -280,8 +280,8 @@ function safeAllowedWritePattern(pattern: string): boolean {
|
|
|
280
280
|
|| pattern === '**/*.spec.ts'
|
|
281
281
|
|| /(^|\/)\*\*\/\*\.(test|spec)\.ts$/.test(pattern)
|
|
282
282
|
|| /(^|\*)\.(test|spec)\.ts$/.test(pattern)
|
|
283
|
-
||
|
|
284
|
-
||
|
|
283
|
+
|| /^runs\/[^/]+\/(spec|plan|tasks|verifies|do|test|goal-verify|ship)\/[^/]+\.md$/.test(pattern)
|
|
284
|
+
|| /^runs\/[^/]+\/(spec|plan|tasks|verifies|do|test|goal-verify|ship)\/\*\.md$/.test(pattern);
|
|
285
285
|
}
|
|
286
286
|
|
|
287
287
|
function matchesWritePattern(relativePath: string, pattern: string): boolean {
|
|
@@ -34,7 +34,7 @@ export function phase63ProjectRuntimeConfig(): string {
|
|
|
34
34
|
forbidden_authority:
|
|
35
35
|
- lifecycle gate authority
|
|
36
36
|
- stage completion decision
|
|
37
|
-
-
|
|
37
|
+
- truth-alignment approval
|
|
38
38
|
- ship readiness pass
|
|
39
39
|
- permission escalation
|
|
40
40
|
allowed_use: declarative taxonomy and capability mapping only
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { writeArtifact } from '../run-state/artifacts.js';
|
|
2
1
|
import { readRunState, writeRunState } from '../run-state/run-state.js';
|
|
3
2
|
import { inspectSddTask } from '../sdd-docs/task-inspection.js';
|
|
4
3
|
import { parseSddBranch } from '../sdd-docs/task-parser.js';
|
|
5
|
-
import { hashTestDocument } from './fixtures.js';
|
|
6
4
|
|
|
7
5
|
export async function bindTestRunState(root: string, runId: string, branch: string, taskId: string): Promise<void> {
|
|
8
6
|
const state = await readRunState(root, runId);
|
|
@@ -22,6 +20,7 @@ export async function bindTestRunState(root: string, runId: string, branch: stri
|
|
|
22
20
|
specContractHash: model.documents.specContractHash ?? null,
|
|
23
21
|
planContractHash: model.documents.planContractHash ?? null,
|
|
24
22
|
tasksContractHash: model.documents.tasksContractHash ?? null,
|
|
23
|
+
taskContractHash: task?.contractHash ?? null,
|
|
25
24
|
planBasedOnSpecHash: model.documents.planBasedOnSpecHash ?? null,
|
|
26
25
|
tasksBasedOnPlanHash: model.documents.tasksBasedOnPlanHash ?? null,
|
|
27
26
|
planBasedOnSpecContractHash: model.documents.planBasedOnSpecContractHash ?? null,
|
|
@@ -30,41 +29,28 @@ export async function bindTestRunState(root: string, runId: string, branch: stri
|
|
|
30
29
|
});
|
|
31
30
|
}
|
|
32
31
|
|
|
33
|
-
export async function
|
|
32
|
+
export async function markTestRunReadyForShip(root: string, runId: string, taskId: string): Promise<void> {
|
|
34
33
|
const state = await readRunState(root, runId);
|
|
35
|
-
const
|
|
36
|
-
await writeArtifact(root, runId, 'sync-back-proposal.md', proposal);
|
|
34
|
+
const evidence = [`artifacts/validation-${taskId}.md`];
|
|
37
35
|
await writeRunState(root, {
|
|
38
36
|
...state,
|
|
39
37
|
status: 'completed',
|
|
40
38
|
tasks: {
|
|
41
39
|
...state.tasks,
|
|
42
40
|
[taskId]: {
|
|
41
|
+
...state.tasks[taskId],
|
|
43
42
|
status: 'implemented_verified',
|
|
44
43
|
implementationStatus: 'implemented',
|
|
45
44
|
verificationStatus: 'pass',
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
requiresVerifyBeforeNext: true,
|
|
49
|
-
gaps: [],
|
|
50
|
-
artifacts: ['artifacts/sync-back-proposal.md']
|
|
45
|
+
validationStatus: 'pass',
|
|
46
|
+
artifacts: [...(state.tasks[taskId]?.artifacts ?? []), ...evidence]
|
|
51
47
|
}
|
|
52
48
|
},
|
|
53
49
|
validation: {
|
|
54
50
|
status: 'pass',
|
|
55
51
|
commands: ['npm test'],
|
|
56
|
-
evidence
|
|
57
|
-
}
|
|
58
|
-
syncBack: {
|
|
59
|
-
mode: 'proposal',
|
|
60
|
-
proposalPath: 'artifacts/sync-back-proposal.md',
|
|
61
|
-
proposalDigest: hashTestDocument(proposal),
|
|
62
|
-
sourceVerifyStatus: 'PASS',
|
|
63
|
-
status: 'proposed'
|
|
64
|
-
},
|
|
65
|
-
artifacts: [
|
|
66
|
-
...state.artifacts,
|
|
67
|
-
{ path: 'artifacts/sync-back-proposal.md', kind: 'sync_back_proposal', task: taskId, agent: null, createdAt: new Date().toISOString() }
|
|
68
|
-
]
|
|
52
|
+
evidence
|
|
53
|
+
}
|
|
69
54
|
});
|
|
70
55
|
}
|
|
56
|
+
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
|
|
4
|
+
import type { TruthAlignmentProjection } from './stage-collaboration.js';
|
|
5
|
+
import { buildTruthReconciliationDecision, truthDriftClassForAlignment } from './truth-reconciliation.js';
|
|
6
|
+
import { workflowNextIntent } from './workflow-state/resolve.js';
|
|
7
|
+
|
|
8
|
+
test('truth reconciliation preserves accepted evidence for documentation catch-up', () => {
|
|
9
|
+
const decision = buildTruthReconciliationDecision({
|
|
10
|
+
truthAlignment: truthAlignment({
|
|
11
|
+
ownerStage: 'tasks',
|
|
12
|
+
semanticImpact: 'none',
|
|
13
|
+
invalidatesStages: ['tasks'],
|
|
14
|
+
staleRefs: [{ kind: 'document', ref: 'specs/master/tasks.md', hash: 'old-tasks-hash' }]
|
|
15
|
+
}),
|
|
16
|
+
nextIntent: workflowNextIntent('tasks', 'reconcile_truth', 'sdd tasks close --branch master --compact-json', 'Reconcile task document truth.', null, { targetRuntimeStage: 'tasks', resumeMode: 'reconcile' })
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
assert.equal(decision.changeKind, 'documentation_catchup');
|
|
20
|
+
assert.equal(decision.ownerStage, 'tasks');
|
|
21
|
+
assert.deepEqual(decision.minimalFrontier, ['tasks']);
|
|
22
|
+
assert.deepEqual(decision.preservesEvidenceRefs.map((ref) => ref.ref), ['.sdd/runs/master/goal-verify/goal-verification-v1.md', '.sdd/runs/master/do/implementation-v1.md']);
|
|
23
|
+
assert.deepEqual(decision.supersedesEvidenceRefs, []);
|
|
24
|
+
assert.equal(decision.nextIntent.canonicalCommand.includes('sync-back'), false);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test('truth reconciliation supersedes accepted evidence for material implementation mismatch', () => {
|
|
28
|
+
const decision = buildTruthReconciliationDecision({
|
|
29
|
+
truthAlignment: truthAlignment({
|
|
30
|
+
ownerStage: 'do',
|
|
31
|
+
semanticImpact: 'material',
|
|
32
|
+
invalidatesStages: ['do'],
|
|
33
|
+
staleRefs: [{ kind: 'artifact', ref: '.sdd/runs/master/do/implementation-v1.md', hash: 'old-implementation-hash' }]
|
|
34
|
+
}),
|
|
35
|
+
nextIntent: workflowNextIntent('do', 'reconcile_truth', 'sdd do task <task_id> --branch master', 'Reconcile implementation truth.', null, { targetRuntimeStage: 'do', resumeMode: 'reconcile' })
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
assert.equal(decision.changeKind, 'implementation_mismatch');
|
|
39
|
+
assert.equal(decision.ownerStage, 'do');
|
|
40
|
+
assert.deepEqual(decision.minimalFrontier, ['do', 'test', 'goal-verify', 'ship']);
|
|
41
|
+
assert.deepEqual(decision.preservesEvidenceRefs, []);
|
|
42
|
+
assert.deepEqual(decision.supersedesEvidenceRefs.map((ref) => ref.ref), ['.sdd/runs/master/goal-verify/goal-verification-v1.md', '.sdd/runs/master/do/implementation-v1.md']);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test('truth drift taxonomy routes validation and gate mismatches to runtime owner stages', () => {
|
|
46
|
+
assert.equal(truthDriftClassForAlignment({ status: 'drift_detected', ownerStage: 'test', semanticImpact: 'bounded', invalidatesStages: [] }), 'validation_mismatch');
|
|
47
|
+
assert.equal(truthDriftClassForAlignment({ status: 'drift_detected', ownerStage: 'goal-verify', semanticImpact: 'bounded', invalidatesStages: [] }), 'gate_policy_mismatch');
|
|
48
|
+
assert.equal(truthDriftClassForAlignment({ status: 'drift_detected', ownerStage: null, semanticImpact: 'material', invalidatesStages: ['ship'] }), 'gate_policy_mismatch');
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
function truthAlignment(input: Pick<TruthAlignmentProjection, 'ownerStage' | 'semanticImpact' | 'invalidatesStages' | 'staleRefs'>): TruthAlignmentProjection {
|
|
52
|
+
return {
|
|
53
|
+
contract: 'sdd-truth-alignment-v1',
|
|
54
|
+
branch: 'master',
|
|
55
|
+
sourceStage: 'goal-verify',
|
|
56
|
+
declaredTruthRefs: [
|
|
57
|
+
{ kind: 'document', ref: 'specs/master/spec.md', hash: 'spec-hash' },
|
|
58
|
+
{ kind: 'document', ref: 'specs/master/tasks.md', hash: 'tasks-hash' }
|
|
59
|
+
],
|
|
60
|
+
acceptedRealityRefs: [
|
|
61
|
+
{ kind: 'artifact', ref: '.sdd/runs/master/goal-verify/goal-verification-v1.md', hash: 'goal-hash' },
|
|
62
|
+
{ kind: 'artifact', ref: '.sdd/runs/master/do/implementation-v1.md', hash: 'implementation-hash' }
|
|
63
|
+
],
|
|
64
|
+
status: 'drift_detected',
|
|
65
|
+
ownerStage: input.ownerStage,
|
|
66
|
+
semanticImpact: input.semanticImpact,
|
|
67
|
+
staleRefs: input.staleRefs,
|
|
68
|
+
invalidatesStages: input.invalidatesStages,
|
|
69
|
+
reasons: ['truth drift requires reconciliation'],
|
|
70
|
+
createdAt: '2026-06-01T00:00:00.000Z'
|
|
71
|
+
};
|
|
72
|
+
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import type { RuntimeProjectionEnvelope, RuntimeRef, SddStage } from './contracts.js';
|
|
2
|
+
import { TRUTH_RECONCILIATION_PROJECTION_TYPE, runtimeProjectionStableHash } from './runtime-projection-p0.js';
|
|
3
|
+
import { listRuntimeProjections, recordRuntimeProjectionEnvelope, type RuntimeProjectionEnvelopeWriteResult } from './storage/runtime-store.js';
|
|
4
|
+
import type { TruthAlignmentProjection } from './stage-collaboration.js';
|
|
5
|
+
import type { WorkflowNextIntent } from './workflow-state/resolve.js';
|
|
6
|
+
|
|
7
|
+
export const TRUTH_RECONCILIATION_CONTRACT = 'sdd-truth-reconciliation-v1' as const;
|
|
8
|
+
export const TRUTH_RECONCILIATION_PRODUCER_VERSION = 'phase9.21-truth-reconciliation-v1' as const;
|
|
9
|
+
|
|
10
|
+
export type TruthDriftClass = 'documentation_catchup' | 'clarification' | 'acceptance_change' | 'scope_change' | 'implementation_mismatch' | 'validation_mismatch' | 'gate_policy_mismatch';
|
|
11
|
+
export type SemanticImpact = 'none' | 'bounded' | 'material';
|
|
12
|
+
export type TruthReconciliationOwnerStage = SddStage;
|
|
13
|
+
|
|
14
|
+
export interface TruthReconciliationDecision {
|
|
15
|
+
contract: typeof TRUTH_RECONCILIATION_CONTRACT;
|
|
16
|
+
branch: string;
|
|
17
|
+
ownerStage: TruthReconciliationOwnerStage;
|
|
18
|
+
changedRef: RuntimeRef;
|
|
19
|
+
oldHash: string;
|
|
20
|
+
newHash: string;
|
|
21
|
+
changeKind: TruthDriftClass;
|
|
22
|
+
semanticImpact: SemanticImpact;
|
|
23
|
+
preservesEvidenceRefs: RuntimeRef[];
|
|
24
|
+
supersedesEvidenceRefs: RuntimeRef[];
|
|
25
|
+
invalidatesStages: SddStage[];
|
|
26
|
+
minimalFrontier: SddStage[];
|
|
27
|
+
nextIntent: WorkflowNextIntent;
|
|
28
|
+
reasons: string[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const TRUTH_DRIFT_OWNER_STAGE: Record<TruthDriftClass, SddStage> = {
|
|
32
|
+
documentation_catchup: 'spec',
|
|
33
|
+
clarification: 'spec',
|
|
34
|
+
acceptance_change: 'tasks',
|
|
35
|
+
scope_change: 'spec',
|
|
36
|
+
implementation_mismatch: 'do',
|
|
37
|
+
validation_mismatch: 'test',
|
|
38
|
+
gate_policy_mismatch: 'goal-verify'
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const STAGE_ORDER: readonly SddStage[] = ['spec', 'plan', 'tasks', 'verifies', 'do', 'test', 'goal-verify', 'ship'];
|
|
42
|
+
const DOCUMENT_OWNER_STAGES = new Set<SddStage>(['spec', 'plan', 'tasks', 'verifies']);
|
|
43
|
+
|
|
44
|
+
export function truthReconciliationScopeKey(input: Pick<TruthReconciliationDecision, 'branch' | 'changedRef'>): string {
|
|
45
|
+
return [input.branch, input.changedRef.ref, 'truth-reconciliation'].join(':');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function buildTruthReconciliationDecision(input: { truthAlignment: TruthAlignmentProjection; nextIntent: WorkflowNextIntent; changedRef?: RuntimeRef; oldHash?: string; newHash?: string; changeKind?: TruthDriftClass }): TruthReconciliationDecision {
|
|
49
|
+
const changeKind = input.changeKind ?? truthDriftClassForAlignment(input.truthAlignment);
|
|
50
|
+
const ownerStage = truthReconciliationOwnerStage(changeKind, input.truthAlignment.ownerStage);
|
|
51
|
+
const changedRef = input.changedRef ?? firstRef(input.truthAlignment.staleRefs) ?? firstRef(input.truthAlignment.declaredTruthRefs) ?? { kind: 'projection', ref: `phase9_12_truth_alignment:${input.truthAlignment.branch}` };
|
|
52
|
+
const oldHash = input.oldHash ?? changedRef.hash ?? 'unknown';
|
|
53
|
+
const newHash = input.newHash ?? 'unknown';
|
|
54
|
+
const invalidatesStages = uniqueStages(input.truthAlignment.invalidatesStages);
|
|
55
|
+
const minimalFrontier = minimalReworkFrontier({ ownerStage, semanticImpact: input.truthAlignment.semanticImpact, invalidatesStages });
|
|
56
|
+
const preservesEvidenceRefs = input.truthAlignment.semanticImpact === 'material' ? [] : uniqueRuntimeRefs(input.truthAlignment.acceptedRealityRefs);
|
|
57
|
+
const supersedesEvidenceRefs = input.truthAlignment.semanticImpact === 'material' ? uniqueRuntimeRefs(input.truthAlignment.acceptedRealityRefs) : [];
|
|
58
|
+
return {
|
|
59
|
+
contract: TRUTH_RECONCILIATION_CONTRACT,
|
|
60
|
+
branch: input.truthAlignment.branch,
|
|
61
|
+
ownerStage,
|
|
62
|
+
changedRef,
|
|
63
|
+
oldHash,
|
|
64
|
+
newHash,
|
|
65
|
+
changeKind,
|
|
66
|
+
semanticImpact: input.truthAlignment.semanticImpact,
|
|
67
|
+
preservesEvidenceRefs,
|
|
68
|
+
supersedesEvidenceRefs,
|
|
69
|
+
invalidatesStages,
|
|
70
|
+
minimalFrontier,
|
|
71
|
+
nextIntent: input.nextIntent,
|
|
72
|
+
reasons: reconciliationReasons(input.truthAlignment, changeKind, ownerStage, minimalFrontier, preservesEvidenceRefs, supersedesEvidenceRefs)
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export async function recordTruthReconciliationDecision(projectRoot: string, decision: TruthReconciliationDecision, generatedAt?: string): Promise<RuntimeProjectionEnvelopeWriteResult<TruthReconciliationDecision>> {
|
|
77
|
+
return recordRuntimeProjectionEnvelope(projectRoot, {
|
|
78
|
+
projectionType: TRUTH_RECONCILIATION_PROJECTION_TYPE,
|
|
79
|
+
scopeKey: truthReconciliationScopeKey(decision),
|
|
80
|
+
inputHash: runtimeProjectionStableHash(decision),
|
|
81
|
+
producer: 'phase9.21-truth-reconciliation-runtime',
|
|
82
|
+
producerVersion: TRUTH_RECONCILIATION_PRODUCER_VERSION,
|
|
83
|
+
generatedAt,
|
|
84
|
+
payload: decision
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export async function readTruthReconciliationProjection(projectRoot: string, branch: string): Promise<RuntimeProjectionEnvelope<TruthReconciliationDecision> | null> {
|
|
89
|
+
const projections = await listRuntimeProjections(projectRoot, [TRUTH_RECONCILIATION_PROJECTION_TYPE]);
|
|
90
|
+
return projections
|
|
91
|
+
.map((projection) => projection.payload as RuntimeProjectionEnvelope<TruthReconciliationDecision>)
|
|
92
|
+
.filter((envelope) => envelope?.projectionType === TRUTH_RECONCILIATION_PROJECTION_TYPE && envelope.payload?.branch === branch)
|
|
93
|
+
.sort((left, right) => right.generatedAt.localeCompare(left.generatedAt))[0] ?? null;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function truthDriftClassForAlignment(alignment: Pick<TruthAlignmentProjection, 'status' | 'ownerStage' | 'semanticImpact' | 'invalidatesStages'>): TruthDriftClass {
|
|
97
|
+
if (alignment.ownerStage === 'do' || alignment.invalidatesStages.includes('do')) {
|
|
98
|
+
return 'implementation_mismatch';
|
|
99
|
+
}
|
|
100
|
+
if (alignment.ownerStage === 'test' || alignment.invalidatesStages.includes('test')) {
|
|
101
|
+
return 'validation_mismatch';
|
|
102
|
+
}
|
|
103
|
+
if (alignment.ownerStage === 'goal-verify' || alignment.ownerStage === 'ship' || alignment.invalidatesStages.includes('goal-verify') || alignment.invalidatesStages.includes('ship')) {
|
|
104
|
+
return 'gate_policy_mismatch';
|
|
105
|
+
}
|
|
106
|
+
if (alignment.ownerStage === 'tasks' || alignment.ownerStage === 'verifies') {
|
|
107
|
+
return alignment.semanticImpact === 'none' ? 'documentation_catchup' : 'acceptance_change';
|
|
108
|
+
}
|
|
109
|
+
if (alignment.semanticImpact === 'none') {
|
|
110
|
+
return 'documentation_catchup';
|
|
111
|
+
}
|
|
112
|
+
if (alignment.semanticImpact === 'bounded') {
|
|
113
|
+
return 'clarification';
|
|
114
|
+
}
|
|
115
|
+
return 'scope_change';
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function truthReconciliationOwnerStage(changeKind: TruthDriftClass, alignmentOwnerStage: SddStage | null): SddStage {
|
|
119
|
+
if (changeKind === 'documentation_catchup' && alignmentOwnerStage && DOCUMENT_OWNER_STAGES.has(alignmentOwnerStage)) {
|
|
120
|
+
return alignmentOwnerStage;
|
|
121
|
+
}
|
|
122
|
+
if (changeKind === 'clarification' && alignmentOwnerStage && DOCUMENT_OWNER_STAGES.has(alignmentOwnerStage)) {
|
|
123
|
+
return alignmentOwnerStage;
|
|
124
|
+
}
|
|
125
|
+
return TRUTH_DRIFT_OWNER_STAGE[changeKind];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function minimalReworkFrontier(input: { ownerStage: SddStage; semanticImpact: SemanticImpact; invalidatesStages: SddStage[] }): SddStage[] {
|
|
129
|
+
if (input.semanticImpact === 'none') {
|
|
130
|
+
return [input.ownerStage];
|
|
131
|
+
}
|
|
132
|
+
if (input.semanticImpact === 'bounded') {
|
|
133
|
+
return orderedUniqueStages([input.ownerStage, ...input.invalidatesStages]);
|
|
134
|
+
}
|
|
135
|
+
return orderedUniqueStages([input.ownerStage, ...input.invalidatesStages, ...downstreamStages(input.ownerStage)]);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function reconciliationReasons(alignment: TruthAlignmentProjection, changeKind: TruthDriftClass, ownerStage: SddStage, minimalFrontier: SddStage[], preservesEvidenceRefs: RuntimeRef[], supersedesEvidenceRefs: RuntimeRef[]): string[] {
|
|
139
|
+
return [
|
|
140
|
+
...alignment.reasons,
|
|
141
|
+
`Truth drift ${changeKind} routes to ${ownerStage}-manager; stage remains the lifecycle boundary, not an actor.`,
|
|
142
|
+
`Minimal rework frontier: ${minimalFrontier.join(' -> ')}.`,
|
|
143
|
+
preservesEvidenceRefs.length > 0 ? `Preserves ${preservesEvidenceRefs.length} accepted evidence ref(s).` : 'No accepted evidence refs are preserved by this reconciliation decision.',
|
|
144
|
+
supersedesEvidenceRefs.length > 0 ? `Supersedes ${supersedesEvidenceRefs.length} accepted reality ref(s); new do/test evidence must be append-only.` : 'No accepted reality refs are superseded.'
|
|
145
|
+
];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function downstreamStages(stage: SddStage): SddStage[] {
|
|
149
|
+
const index = STAGE_ORDER.indexOf(stage);
|
|
150
|
+
return index < 0 ? [] : [...STAGE_ORDER.slice(index + 1)];
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function orderedUniqueStages(stages: SddStage[]): SddStage[] {
|
|
154
|
+
const set = new Set(stages);
|
|
155
|
+
return STAGE_ORDER.filter((stage) => set.has(stage));
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function uniqueStages(stages: SddStage[]): SddStage[] {
|
|
159
|
+
return orderedUniqueStages(stages);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function uniqueRuntimeRefs(refs: RuntimeRef[]): RuntimeRef[] {
|
|
163
|
+
const seen = new Set<string>();
|
|
164
|
+
const result: RuntimeRef[] = [];
|
|
165
|
+
for (const ref of refs) {
|
|
166
|
+
const key = `${ref.kind}:${ref.ref}:${ref.hash ?? ''}`;
|
|
167
|
+
if (!seen.has(key)) {
|
|
168
|
+
seen.add(key);
|
|
169
|
+
result.push(ref);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return result;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function firstRef(refs: RuntimeRef[]): RuntimeRef | null {
|
|
176
|
+
return refs[0] ?? null;
|
|
177
|
+
}
|
|
@@ -2,7 +2,7 @@ import test from 'node:test';
|
|
|
2
2
|
import assert from 'node:assert/strict';
|
|
3
3
|
import { execFile } from 'node:child_process';
|
|
4
4
|
import { DatabaseSync } from 'node:sqlite';
|
|
5
|
-
import { mkdtemp, readFile, rm
|
|
5
|
+
import { mkdtemp, readFile, rm } from 'node:fs/promises';
|
|
6
6
|
import { tmpdir } from 'node:os';
|
|
7
7
|
import path from 'node:path';
|
|
8
8
|
import { promisify } from 'node:util';
|
|
@@ -17,11 +17,8 @@ import { readArtifact, writeArtifact } from '../run-state/artifacts.js';
|
|
|
17
17
|
import { appendEvent, readRunEvents } from '../run-state/events.js';
|
|
18
18
|
import { listInvocationLedgerEntries } from '../run-state/invocation-ledger.js';
|
|
19
19
|
import { inspectRun } from '../run-state/inspect-run.js';
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import { applySyncBack } from '../sync-back/apply.js';
|
|
23
|
-
import { inspectSyncBack } from '../sync-back/inspect.js';
|
|
24
|
-
import { hashTestDocument, validResultArtifact, validTaskMarkdown, validTrustEvidence, writeBranchDocs } from '../test-support/fixtures.js';
|
|
20
|
+
import { createRun, readRunState, writeRunState } from '../run-state/run-state.js';
|
|
21
|
+
import { validResultArtifact, validTaskMarkdown, validTrustEvidence, writeBranchDocs } from '../test-support/fixtures.js';
|
|
25
22
|
import { bindTestRunState } from '../test-support/run-state.js';
|
|
26
23
|
import { getRuntimeStorePath } from '../runtime-paths.js';
|
|
27
24
|
import { runGoalVerify } from './goal-verify.js';
|
|
@@ -194,7 +191,7 @@ test('runGoalVerify fails closed for cross-partition admitted evidence', async (
|
|
|
194
191
|
});
|
|
195
192
|
|
|
196
193
|
|
|
197
|
-
test('runGoalVerify maps validation evidence to acceptance
|
|
194
|
+
test('runGoalVerify maps validation evidence to acceptance coverage without legacy sync-back artifacts', async () => {
|
|
198
195
|
const root = await mkdtemp(path.join(tmpdir(), 'sdd-verify-pass-'));
|
|
199
196
|
try {
|
|
200
197
|
await initProject(root);
|
|
@@ -206,6 +203,7 @@ test('runGoalVerify maps validation evidence to acceptance and writes sync-back
|
|
|
206
203
|
await bindTestRunState(root, state.runId, 'feature', 'T1');
|
|
207
204
|
await writeArtifact(root, state.runId, 'review-T1.md', validResultArtifact('reviewer', 'T1', 'PASS', 'artifacts/review-T1.md'));
|
|
208
205
|
await writeArtifact(root, state.runId, 'validation-T1.md', `${validResultArtifact('validator', 'T1', 'PASS', 'artifacts/validation-T1.md')}${validTrustEvidence('T1', 'AC-1', 'artifacts/validation-T1.md')}`);
|
|
206
|
+
const tasksBeforeGoalVerify = await readFile(path.join(root, 'specs', 'feature', 'tasks.md'), 'utf8');
|
|
209
207
|
|
|
210
208
|
const result = await runGoalVerify(root, {
|
|
211
209
|
runId: state.runId,
|
|
@@ -216,9 +214,10 @@ test('runGoalVerify maps validation evidence to acceptance and writes sync-back
|
|
|
216
214
|
});
|
|
217
215
|
const restored = await readRunState(root, state.runId);
|
|
218
216
|
const coverage = await readArtifact(root, state.runId, 'acceptance-coverage-T1.md');
|
|
219
|
-
const proposal = await readArtifact(root, state.runId, 'sync-back-proposal.md');
|
|
220
217
|
const events = stringifyEvents(await readRunEvents(root, state.runId));
|
|
221
|
-
const
|
|
218
|
+
const tasksAfterGoalVerify = await readFile(path.join(root, 'specs', 'feature', 'tasks.md'), 'utf8');
|
|
219
|
+
const inspection = await inspectRun(root, state.runId);
|
|
220
|
+
const status = await getProjectStatus(root, { branch: 'feature' });
|
|
222
221
|
|
|
223
222
|
assert.equal(result.status, 'PASS');
|
|
224
223
|
assert.equal(result.standardStatus, 'PASS');
|
|
@@ -228,42 +227,20 @@ test('runGoalVerify maps validation evidence to acceptance and writes sync-back
|
|
|
228
227
|
assert.deepEqual(result.acceptanceCoverage.map((item) => item.acceptance), ['AC-1']);
|
|
229
228
|
assert.match(coverage, /Acceptance Mapping/);
|
|
230
229
|
assert.match(coverage, /AC-1/);
|
|
231
|
-
assert.match(proposal, /status: verified/);
|
|
232
|
-
assert.equal(restored.syncBack.proposalDigest, hashTestDocument(proposal));
|
|
233
|
-
assert.equal(restored.syncBack.sourceVerifyStatus, 'PASS');
|
|
234
230
|
assert.match(events, /Phase 1.9 goal-level verify PASS/);
|
|
235
|
-
assert.
|
|
236
|
-
|
|
237
|
-
const runs = await listRuns(root);
|
|
238
|
-
const inspection = await inspectRun(root, state.runId);
|
|
239
|
-
const status = await getProjectStatus(root, { branch: 'feature' });
|
|
240
|
-
const syncBack = await inspectSyncBack(root, { runId: state.runId, branch: 'feature', taskId: 'T1' });
|
|
231
|
+
assert.equal(tasksAfterGoalVerify, tasksBeforeGoalVerify);
|
|
232
|
+
await assert.rejects(readArtifact(root, state.runId, 'sync-back-proposal.md'));
|
|
241
233
|
|
|
242
|
-
assert.equal(runs[0].runId, state.runId);
|
|
243
|
-
assert.equal(runs[0].validationStatus, 'pass');
|
|
244
|
-
assert.equal(runs[0].syncBackStatus, 'proposed');
|
|
245
234
|
assert.equal(inspection.summary.runId, state.runId);
|
|
246
235
|
assert.equal(inspection.validation.status, 'pass');
|
|
247
|
-
assert.equal(inspection.syncBack.status, 'proposed');
|
|
248
236
|
assert.equal(inspection.eventCount > 0, true);
|
|
249
237
|
assert.equal(inspection.recentEvents.length > 0, true);
|
|
250
238
|
assert.equal(inspection.taskRunEvidence.version, 'phase-5.3-task-run-evidence-v1');
|
|
251
239
|
assert.equal(inspection.taskRunEvidence.runId, state.runId);
|
|
252
240
|
assert.equal(inspection.taskRunEvidence.validation.status, 'pass');
|
|
253
|
-
assert.equal(inspection.taskRunEvidence.syncBackProposal, 'artifacts/sync-back-proposal.md');
|
|
254
|
-
assert.equal(inspection.invocationLedger.some((entry) => entry.kind === 'artifact_hash' && entry.ref === 'artifacts/sync-back-proposal.md'), true);
|
|
255
|
-
assert.equal(inspection.taskRunEvidence.invocationLedger.some((entry) => entry.kind === 'artifact_hash' && entry.ref === 'artifacts/sync-back-proposal.md'), true);
|
|
256
241
|
assert.equal(status.latestRun?.runId, state.runId);
|
|
257
242
|
assert.equal(status.tasks.pending, 1);
|
|
258
|
-
assert.equal(status.recommendedNextCommand, 'sdd ship --branch feature --
|
|
259
|
-
assert.equal(syncBack.status, 'ready');
|
|
260
|
-
assert.equal(syncBack.markdownStatus, 'pending');
|
|
261
|
-
assert.match(syncBack.proposal ?? '', /status: verified/);
|
|
262
|
-
assert.equal(syncBack.proposalDigest, restored.syncBack.proposalDigest);
|
|
263
|
-
assert.equal(syncBack.proposalDigestValid, true);
|
|
264
|
-
assert.equal(syncBack.applyPolicy.mode, 'confirm');
|
|
265
|
-
assert.equal(syncBack.applyPolicy.requiresApproval, true);
|
|
266
|
-
assert.equal(syncBack.applyPolicy.reasons.some((reason) => /source-boundary|CLI\/core source boundary/.test(reason)), true);
|
|
243
|
+
assert.equal(status.recommendedNextCommand, 'sdd ship close --branch feature --compact-json');
|
|
267
244
|
|
|
268
245
|
const ledgerBeforeRerun = await listInvocationLedgerEntries(root, state.runId);
|
|
269
246
|
await runGoalVerify(root, {
|
|
@@ -276,59 +253,8 @@ test('runGoalVerify maps validation evidence to acceptance and writes sync-back
|
|
|
276
253
|
const ledgerAfterRerun = await listInvocationLedgerEntries(root, state.runId);
|
|
277
254
|
assert.equal(ledgerAfterRerun.filter((entry) => entry.kind === 'artifact_hash').length, ledgerBeforeRerun.filter((entry) => entry.kind === 'artifact_hash').length);
|
|
278
255
|
assert.equal(ledgerAfterRerun.filter((entry) => entry.kind === 'command' && entry.status === 'declared').length, ledgerBeforeRerun.filter((entry) => entry.kind === 'command' && entry.status === 'declared').length);
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
const tasksAfterSyncBack = await readFile(path.join(root, 'specs', 'feature', 'tasks.md'), 'utf8');
|
|
282
|
-
const appliedState = await readRunState(root, state.runId);
|
|
283
|
-
const appliedEvents = await readRunEvents(root, state.runId);
|
|
284
|
-
|
|
285
|
-
assert.equal(applied.applied, true);
|
|
286
|
-
assert.match(tasksAfterSyncBack, /status: completed/);
|
|
287
|
-
assert.match(tasksAfterSyncBack, /Sync-back applied from run `run-1`/);
|
|
288
|
-
assert.match(tasksAfterSyncBack, /sync-back-proposal\.md/);
|
|
289
|
-
assert.equal(appliedState.syncBack.status, 'applied');
|
|
290
|
-
assert.equal(appliedEvents.some((event) => event.event === 'sync_back_applied'), true);
|
|
291
|
-
|
|
292
|
-
const postApplyIndex = await queryLocalRunIndex(root, { runId: state.runId });
|
|
293
|
-
const postApplyDoctor = await doctor(root, { latestOnly: true });
|
|
294
|
-
const postApplyStatus = await getProjectStatus(root, { branch: 'feature' });
|
|
295
|
-
|
|
296
|
-
assert.equal(postApplyIndex.runs[0]?.syncBackStatus, 'applied');
|
|
297
|
-
assert.equal(appliedState.documentSnapshot.tasksHash, postApplyStatus.documents.tasksHash);
|
|
298
|
-
assert.deepEqual(postApplyStatus.latestRunStaleReasons, []);
|
|
299
|
-
assert.equal(postApplyDoctor.checks.some((check) => check.check === 'local_run_index' && check.level === 'WARN'), false);
|
|
300
|
-
|
|
301
|
-
const repeated = await applySyncBack(root, { runId: state.runId, branch: 'feature', taskId: 'T1' });
|
|
302
|
-
const repeatedTasks = await readFile(path.join(root, 'specs', 'feature', 'tasks.md'), 'utf8');
|
|
303
|
-
|
|
304
|
-
assert.equal(repeated.applied, false);
|
|
305
|
-
assert.equal(repeatedTasks.match(/Sync-back applied from run `run-1`/g)?.length, 1);
|
|
306
|
-
|
|
307
|
-
const reverified = await runGoalVerify(root, {
|
|
308
|
-
runId: state.runId,
|
|
309
|
-
branch: 'feature',
|
|
310
|
-
taskId: 'T1',
|
|
311
|
-
reviewArtifact: 'artifacts/review-T1.md',
|
|
312
|
-
validationArtifact: 'artifacts/validation-T1.md'
|
|
313
|
-
});
|
|
314
|
-
const reverifiedState = await readRunState(root, state.runId);
|
|
315
|
-
const reverifiedProposal = await readArtifact(root, state.runId, 'sync-back-proposal.md');
|
|
316
|
-
assert.equal(reverified.status, 'PASS');
|
|
317
|
-
assert.equal(reverifiedState.syncBack.status, 'applied');
|
|
318
|
-
assert.equal(reverifiedState.syncBack.proposalDigest, hashTestDocument(reverifiedProposal));
|
|
319
|
-
|
|
320
|
-
await writeRunState(root, { ...appliedState, documentSnapshot: restored.documentSnapshot });
|
|
321
|
-
const legacyAppliedStatus = await getProjectStatus(root, { branch: 'feature' });
|
|
322
|
-
assert.deepEqual(legacyAppliedStatus.latestRunStaleReasons, []);
|
|
323
|
-
|
|
324
|
-
await writeFile(path.join(root, 'specs', 'feature', 'tasks.md'), `${repeatedTasks}\n<!-- external edit after apply -->\n`, 'utf8');
|
|
325
|
-
const externalEditTime = new Date(Date.now() + 5000);
|
|
326
|
-
await utimes(path.join(root, 'specs', 'feature', 'tasks.md'), externalEditTime, externalEditTime);
|
|
327
|
-
const externallyChangedStatus = await getProjectStatus(root, { branch: 'feature' });
|
|
328
|
-
assert.equal(
|
|
329
|
-
externallyChangedStatus.latestRunStaleReasons.some((reason) => reason.includes('Run snapshot for tasks.md')),
|
|
330
|
-
true
|
|
331
|
-
);
|
|
256
|
+
assert.equal(await readFile(path.join(root, 'specs', 'feature', 'tasks.md'), 'utf8'), tasksBeforeGoalVerify);
|
|
257
|
+
await assert.rejects(readArtifact(root, state.runId, 'sync-back-proposal.md'));
|
|
332
258
|
} finally {
|
|
333
259
|
await rm(root, { recursive: true, force: true });
|
|
334
260
|
}
|