sdd-agent-platform 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -39
- package/node_modules/@sdd-agent-platform/core/dist/ai-tools.js +72 -71
- package/node_modules/@sdd-agent-platform/core/dist/ai-tools.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/ingestion.js +64 -9
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/ingestion.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-evidence.js +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-evidence.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-result.js +26 -17
- package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-result.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/init-project.d.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/dist/config/init-project.js +13 -9
- package/node_modules/@sdd-agent-platform/core/dist/config/init-project.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/project-config.d.ts +3 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/project-config.js +7 -3
- package/node_modules/@sdd-agent-platform/core/dist/config/project-config.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.d.ts +4 -4
- package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.js +16 -20
- package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context/build-package.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context/build-package.js +1 -7
- package/node_modules/@sdd-agent-platform/core/dist/context/build-package.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context/evidence-summary.js +26 -8
- package/node_modules/@sdd-agent-platform/core/dist/context/evidence-summary.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context/log-worker.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/context/log-worker.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/context-offload/contracts.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/contracts.d.ts +4 -1
- package/node_modules/@sdd-agent-platform/core/dist/contracts.js +3 -0
- package/node_modules/@sdd-agent-platform/core/dist/contracts.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/delegation/model.d.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/dist/delegation/validation.d.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/dist/delegation/validation.js +7 -4
- package/node_modules/@sdd-agent-platform/core/dist/delegation/validation.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/document-chain.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/document-chain.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/project.js +8 -8
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/project.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/registries.js +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/registries.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-evidence.js +7 -7
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-evidence.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-trust.js +0 -24
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-trust.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/runtime-contracts.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/runtime-contracts.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/doctor.js +277 -3
- package/node_modules/@sdd-agent-platform/core/dist/doctor/doctor.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.d.ts +23 -0
- package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.js +61 -0
- package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/evidence-runtime/contracts.d.ts +11 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/agent-execution-records.js +15 -8
- package/node_modules/@sdd-agent-platform/core/dist/execution/agent-execution-records.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/background-executor.js +4 -4
- package/node_modules/@sdd-agent-platform/core/dist/execution/background-executor.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/foreground-subagents.js +3 -3
- package/node_modules/@sdd-agent-platform/core/dist/execution/foreground-subagents.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/host-invocation.js +5 -4
- package/node_modules/@sdd-agent-platform/core/dist/execution/host-invocation.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/resident-worker.js +16 -7
- package/node_modules/@sdd-agent-platform/core/dist/execution/resident-worker.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/execution/stage-team-runtime.d.ts +112 -0
- package/node_modules/@sdd-agent-platform/core/dist/execution/stage-team-runtime.js +145 -0
- package/node_modules/@sdd-agent-platform/core/dist/execution/stage-team-runtime.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/governance/policy.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/governance/policy.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/governance/policy.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/instructions.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/instructions.js +59 -66
- package/node_modules/@sdd-agent-platform/core/dist/instructions.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/decision-gate.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/decision-gate.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.d.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.js +55 -19
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/orchestration/contracts.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.d.ts +12 -2
- package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.js +62 -21
- package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.d.ts +20 -2
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.js +218 -18
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-registry.js +17 -17
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-registry.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-runtime-static.d.ts +10 -0
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-runtime-static.js +32 -2
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-runtime-static.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/capability-sources.d.ts +2 -17
- package/node_modules/@sdd-agent-platform/core/dist/registries/capability-sources.js +222 -10
- package/node_modules/@sdd-agent-platform/core/dist/registries/capability-sources.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.js +9 -9
- package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/eval-learning-context.js +4 -4
- package/node_modules/@sdd-agent-platform/core/dist/registries/eval-learning-context.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/query-status.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/registries/query-status.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/tool-capabilities.js +3 -3
- package/node_modules/@sdd-agent-platform/core/dist/registries/tool-capabilities.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/tool-plugins.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/registries/tool-plugins.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/worker-adapters.js +11 -11
- package/node_modules/@sdd-agent-platform/core/dist/registries/worker-adapters.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/workflow-gates.js +12 -12
- package/node_modules/@sdd-agent-platform/core/dist/registries/workflow-gates.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/risk/contracts.d.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/risk/kernel.js +4 -4
- package/node_modules/@sdd-agent-platform/core/dist/risk/kernel.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/risk/legacy-adapters.js +4 -7
- package/node_modules/@sdd-agent-platform/core/dist/risk/legacy-adapters.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/risk/workflow-gates.d.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/risk/workflow-gates.js +19 -17
- package/node_modules/@sdd-agent-platform/core/dist/risk/workflow-gates.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime-config.js +28 -13
- package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime-config.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime.d.ts +61 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.d.ts +3 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.js +192 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/routing.js +73 -17
- package/node_modules/@sdd-agent-platform/core/dist/router/routing.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-import.d.ts +28 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-import.js +373 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-import.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-inspection.js +11 -4
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-inspection.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-validation.js +31 -3
- package/node_modules/@sdd-agent-platform/core/dist/router/runtime-validation.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/stage-route-binding.d.ts +37 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/stage-route-binding.js +235 -0
- package/node_modules/@sdd-agent-platform/core/dist/router/stage-route-binding.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/router.d.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/router.js +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/router.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/artifacts.d.ts +16 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/artifacts.js +168 -18
- package/node_modules/@sdd-agent-platform/core/dist/run-state/artifacts.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/events.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/run-state/events.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.d.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.js +22 -54
- package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/invocation-ledger.js +2 -2
- package/node_modules/@sdd-agent-platform/core/dist/run-state/invocation-ledger.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/model.d.ts +53 -9
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-index.d.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-index.js +1 -3
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-index.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-state.js +51 -34
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-state.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.d.ts +65 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.js +169 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/timing.d.ts +8 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/timing.js +131 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/timing.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state.d.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state.js +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/build.js +0 -3
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/build.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/findings.js +5 -44
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/findings.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/model.d.ts +1 -17
- package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.d.ts +20 -0
- package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.js +109 -14
- package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/runtime-projection-p0.d.ts +64 -0
- package/node_modules/@sdd-agent-platform/core/dist/runtime-projection-p0.js +200 -0
- package/node_modules/@sdd-agent-platform/core/dist/runtime-projection-p0.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/context.js +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/context.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.d.ts +6 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.js +276 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/run-binding.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/run-binding.js +15 -4
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/run-binding.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.d.ts +21 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.js +139 -38
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/stage-artifacts.d.ts +55 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-artifacts.js +322 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-artifacts.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration-contracts.d.ts +55 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration-contracts.js +241 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration-contracts.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration.d.ts +888 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration.js +3870 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/stage-runtime/runtime.js +8 -1
- package/node_modules/@sdd-agent-platform/core/dist/stage-runtime/runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/status/project-status.d.ts +105 -1
- package/node_modules/@sdd-agent-platform/core/dist/status/project-status.js +343 -8
- package/node_modules/@sdd-agent-platform/core/dist/status/project-status.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.d.ts +348 -3
- package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.js +1017 -8
- package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/subagents/contracts.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/subagents/runtime.js +7 -7
- package/node_modules/@sdd-agent-platform/core/dist/subagents/runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/test-support/fixtures.js +21 -0
- package/node_modules/@sdd-agent-platform/core/dist/test-support/fixtures.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.js +19 -20
- package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/truth-reconciliation.d.ts +44 -0
- package/node_modules/@sdd-agent-platform/core/dist/truth-reconciliation.js +138 -0
- package/node_modules/@sdd-agent-platform/core/dist/truth-reconciliation.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.d.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.js +44 -37
- package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.d.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.js +19 -49
- package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/review-gate.d.ts +22 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/review-gate.js +53 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/review-gate.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.d.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.js +213 -111
- package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.d.ts +28 -3
- package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.js +546 -125
- package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-cache.d.ts +26 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-cache.js +73 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-cache.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.d.ts +76 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.js +450 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.d.ts +3 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.js +105 -30
- package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification.d.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification.js +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/work-units/contracts.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.d.ts +24 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.js +395 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.d.ts +4 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.js +164 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.d.ts +4 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.js +182 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/types.d.ts +88 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/types.js +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/types.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.js +17 -3
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/dependencies.d.ts +8 -4
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/dependencies.js +25 -11
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/dependencies.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.d.ts +37 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.js +188 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/migration-recovery.d.ts +40 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/migration-recovery.js +110 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/migration-recovery.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/repair-contract.d.ts +12 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/repair-contract.js +63 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/repair-contract.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve-task-run.d.ts +21 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve-task-run.js +95 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve-task-run.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.d.ts +80 -3
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.js +674 -41
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/runtime-projections.d.ts +228 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/runtime-projections.js +452 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/runtime-projections.js.map +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state.d.ts +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state.js +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/package.json +3 -3
- package/node_modules/@sdd-agent-platform/core/src/ai-tools.test.ts +49 -1
- package/node_modules/@sdd-agent-platform/core/src/ai-tools.ts +72 -71
- package/node_modules/@sdd-agent-platform/core/src/artifacts/ingestion.test.ts +38 -0
- package/node_modules/@sdd-agent-platform/core/src/artifacts/ingestion.ts +65 -9
- package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-evidence.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-result.test.ts +52 -6
- package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-result.ts +26 -17
- package/node_modules/@sdd-agent-platform/core/src/config/init-project.test.ts +44 -29
- package/node_modules/@sdd-agent-platform/core/src/config/init-project.ts +15 -11
- package/node_modules/@sdd-agent-platform/core/src/config/project-config.ts +10 -4
- package/node_modules/@sdd-agent-platform/core/src/config/starter-documents.ts +17 -20
- package/node_modules/@sdd-agent-platform/core/src/context/build-package.ts +2 -8
- package/node_modules/@sdd-agent-platform/core/src/context/context-build.test.ts +3 -2
- package/node_modules/@sdd-agent-platform/core/src/context/evidence-summary.ts +27 -8
- package/node_modules/@sdd-agent-platform/core/src/context/log-worker.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/context-offload/contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/contracts.ts +4 -1
- package/node_modules/@sdd-agent-platform/core/src/delegation/model.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/src/delegation/validation.ts +8 -5
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/document-chain.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/project.ts +8 -8
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/registries.ts +0 -1
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/run-evidence.ts +7 -7
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/run-trust.ts +0 -21
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/runtime-contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/doctor/doctor.test.ts +217 -7
- package/node_modules/@sdd-agent-platform/core/src/doctor/doctor.ts +301 -3
- package/node_modules/@sdd-agent-platform/core/src/evidence/lookup.ts +88 -0
- package/node_modules/@sdd-agent-platform/core/src/evidence-runtime/contracts.ts +12 -1
- package/node_modules/@sdd-agent-platform/core/src/execution/agent-execution-records.ts +16 -11
- package/node_modules/@sdd-agent-platform/core/src/execution/background-executor.test.ts +57 -2
- package/node_modules/@sdd-agent-platform/core/src/execution/background-executor.ts +4 -4
- package/node_modules/@sdd-agent-platform/core/src/execution/foreground-subagents.test.ts +11 -2
- package/node_modules/@sdd-agent-platform/core/src/execution/foreground-subagents.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/src/execution/host-invocation.ts +5 -4
- package/node_modules/@sdd-agent-platform/core/src/execution/resident-worker.test.ts +17 -1
- package/node_modules/@sdd-agent-platform/core/src/execution/resident-worker.ts +16 -7
- package/node_modules/@sdd-agent-platform/core/src/execution/stage-team-runtime.test.ts +102 -0
- package/node_modules/@sdd-agent-platform/core/src/execution/stage-team-runtime.ts +271 -0
- package/node_modules/@sdd-agent-platform/core/src/execution/wave-executor.test.ts +14 -0
- package/node_modules/@sdd-agent-platform/core/src/governance/policy.test.ts +10 -0
- package/node_modules/@sdd-agent-platform/core/src/governance/policy.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/instructions.test.ts +34 -13
- package/node_modules/@sdd-agent-platform/core/src/instructions.ts +60 -67
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/decision-gate.test.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/decision-gate.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/ship.test.ts +47 -0
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/ship.ts +58 -19
- package/node_modules/@sdd-agent-platform/core/src/orchestration/contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/orchestration/runtime.ts +74 -22
- package/node_modules/@sdd-agent-platform/core/src/phase8-contracts.test.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/src/phase8-risk-kernel.test.ts +8 -3
- package/node_modules/@sdd-agent-platform/core/src/planning/task-graph.test.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/planning/wave-plan.test.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-capability-catalog.ts +319 -20
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-registry.ts +17 -17
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-runtime-static.ts +42 -2
- package/node_modules/@sdd-agent-platform/core/src/registries/capability-sources.ts +238 -15
- package/node_modules/@sdd-agent-platform/core/src/registries/command-team-runtime.ts +10 -10
- package/node_modules/@sdd-agent-platform/core/src/registries/eval-learning-context.ts +4 -4
- package/node_modules/@sdd-agent-platform/core/src/registries/query-status.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/registries/registries.test.ts +45 -4
- package/node_modules/@sdd-agent-platform/core/src/registries/tool-capabilities.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/src/registries/tool-plugins.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/registries/worker-adapters.ts +11 -11
- package/node_modules/@sdd-agent-platform/core/src/registries/workflow-gates.ts +12 -12
- package/node_modules/@sdd-agent-platform/core/src/risk/contracts.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/risk/kernel.ts +4 -4
- package/node_modules/@sdd-agent-platform/core/src/risk/legacy-adapters.ts +4 -7
- package/node_modules/@sdd-agent-platform/core/src/risk/workflow-gates.ts +20 -18
- package/node_modules/@sdd-agent-platform/core/src/router/agent-runtime-config.ts +32 -13
- package/node_modules/@sdd-agent-platform/core/src/router/agent-runtime.ts +68 -1
- package/node_modules/@sdd-agent-platform/core/src/router/route-projection.ts +212 -1
- package/node_modules/@sdd-agent-platform/core/src/router/route-sdd-task.test.ts +391 -6
- package/node_modules/@sdd-agent-platform/core/src/router/routing.ts +78 -17
- package/node_modules/@sdd-agent-platform/core/src/router/runtime-import.ts +453 -0
- package/node_modules/@sdd-agent-platform/core/src/router/runtime-inspection.ts +11 -4
- package/node_modules/@sdd-agent-platform/core/src/router/runtime-validation.ts +32 -3
- package/node_modules/@sdd-agent-platform/core/src/router/stage-route-binding.ts +279 -0
- package/node_modules/@sdd-agent-platform/core/src/router.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/run-state/artifacts.ts +173 -18
- package/node_modules/@sdd-agent-platform/core/src/run-state/events.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/run-state/inspect-run.ts +24 -59
- package/node_modules/@sdd-agent-platform/core/src/run-state/invocation-ledger.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/run-state/model.ts +59 -9
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-index.ts +1 -5
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-state.test.ts +53 -2
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-state.ts +55 -41
- package/node_modules/@sdd-agent-platform/core/src/run-state/task-evidence.ts +252 -0
- package/node_modules/@sdd-agent-platform/core/src/run-state/timing.ts +146 -0
- package/node_modules/@sdd-agent-platform/core/src/run-state.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/build.ts +0 -3
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/findings.ts +6 -46
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/model.ts +1 -13
- package/node_modules/@sdd-agent-platform/core/src/runtime-analysis.test.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/src/runtime-paths.ts +131 -14
- package/node_modules/@sdd-agent-platform/core/src/runtime-projection-p0.test.ts +96 -0
- package/node_modules/@sdd-agent-platform/core/src/runtime-projection-p0.ts +292 -0
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/context.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/document-hashes.ts +306 -0
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/run-binding.ts +15 -4
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.test.ts +261 -0
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.ts +169 -41
- package/node_modules/@sdd-agent-platform/core/src/stage-artifacts.ts +450 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-collaboration-contracts.ts +322 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-collaboration.test.ts +2903 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-collaboration.ts +5831 -0
- package/node_modules/@sdd-agent-platform/core/src/stage-runtime/runtime.test.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/stage-runtime/runtime.ts +9 -1
- package/node_modules/@sdd-agent-platform/core/src/status/project-status.test.ts +239 -16
- package/node_modules/@sdd-agent-platform/core/src/status/project-status.ts +497 -8
- package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.test.ts +560 -4
- package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.ts +1510 -9
- package/node_modules/@sdd-agent-platform/core/src/subagents/contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/subagents/runtime.test.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/src/subagents/runtime.ts +7 -7
- package/node_modules/@sdd-agent-platform/core/src/test-support/fixtures.ts +21 -0
- package/node_modules/@sdd-agent-platform/core/src/test-support/run-state.ts +20 -20
- package/node_modules/@sdd-agent-platform/core/src/truth-reconciliation.test.ts +72 -0
- package/node_modules/@sdd-agent-platform/core/src/truth-reconciliation.ts +177 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/goal-verify.test.ts +13 -87
- package/node_modules/@sdd-agent-platform/core/src/verification/goal-verify.ts +46 -42
- package/node_modules/@sdd-agent-platform/core/src/verification/rendering.ts +18 -52
- package/node_modules/@sdd-agent-platform/core/src/verification/review-gate.test.ts +84 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/review-gate.ts +77 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/single-task-loop.test.ts +138 -64
- package/node_modules/@sdd-agent-platform/core/src/verification/single-task-loop.ts +226 -116
- package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.test.ts +148 -48
- package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.ts +619 -136
- package/node_modules/@sdd-agent-platform/core/src/verification/validation-cache.ts +106 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/validation-wave.test.ts +383 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/validation-wave.ts +556 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.test.ts +131 -8
- package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.ts +117 -30
- package/node_modules/@sdd-agent-platform/core/src/verification.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/work-units/contracts.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/evidence-packet.ts +425 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.test.ts +507 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.ts +182 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.test.ts +174 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.ts +194 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/types.ts +115 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/affected-file-conflicts.ts +19 -4
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/dependencies.test.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/dependencies.ts +33 -11
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/latest-eligible-run.ts +224 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/migration-recovery.ts +158 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/repair-contract.ts +77 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve-task-run.ts +114 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve.test.ts +851 -9
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve.ts +862 -45
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/runtime-projections.ts +712 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state.ts +1 -0
- package/package.json +1 -1
- package/packages/cli/dist/args.js +2 -2
- package/packages/cli/dist/args.js.map +1 -1
- package/packages/cli/dist/commands/ai-tools.js +13 -2
- package/packages/cli/dist/commands/ai-tools.js.map +1 -1
- package/packages/cli/dist/commands/context.js +1 -1
- package/packages/cli/dist/commands/context.js.map +1 -1
- package/packages/cli/dist/commands/execution.js +49 -1
- package/packages/cli/dist/commands/execution.js.map +1 -1
- package/packages/cli/dist/commands/governance.js +1 -1
- package/packages/cli/dist/commands/governance.js.map +1 -1
- package/packages/cli/dist/commands/init.js +6 -1
- package/packages/cli/dist/commands/init.js.map +1 -1
- package/packages/cli/dist/commands/lifecycle.js +15 -2
- package/packages/cli/dist/commands/lifecycle.js.map +1 -1
- package/packages/cli/dist/commands/registry/runtime.js +48 -2
- package/packages/cli/dist/commands/registry/runtime.js.map +1 -1
- package/packages/cli/dist/commands/run.js +52 -2
- package/packages/cli/dist/commands/run.js.map +1 -1
- package/packages/cli/dist/commands/stage-close.d.ts +6 -0
- package/packages/cli/dist/commands/stage-close.js +295 -0
- package/packages/cli/dist/commands/stage-close.js.map +1 -0
- package/packages/cli/dist/commands/status.js +70 -4
- package/packages/cli/dist/commands/status.js.map +1 -1
- package/packages/cli/dist/commands/tasks.js +4 -4
- package/packages/cli/dist/commands/tasks.js.map +1 -1
- package/packages/cli/dist/commands/test.js +272 -5
- package/packages/cli/dist/commands/test.js.map +1 -1
- package/packages/cli/dist/commands/verifies.js +9 -5
- package/packages/cli/dist/commands/verifies.js.map +1 -1
- package/packages/cli/dist/commands/verify.js +257 -20
- package/packages/cli/dist/commands/verify.js.map +1 -1
- package/packages/cli/dist/dispatch.js +4 -9
- package/packages/cli/dist/dispatch.js.map +1 -1
- package/packages/cli/dist/help.js +42 -27
- package/packages/cli/dist/help.js.map +1 -1
- package/packages/cli/dist/renderers/doctor.js +1 -1
- package/packages/cli/dist/renderers/doctor.js.map +1 -1
- package/packages/cli/dist/renderers/execution.js +1 -1
- package/packages/cli/dist/renderers/execution.js.map +1 -1
- package/packages/cli/dist/renderers/json.d.ts +1 -0
- package/packages/cli/dist/renderers/json.js +3 -0
- package/packages/cli/dist/renderers/json.js.map +1 -1
- package/packages/cli/dist/renderers/registry-runtime.d.ts +2 -1
- package/packages/cli/dist/renderers/registry-runtime.js +27 -2
- package/packages/cli/dist/renderers/registry-runtime.js.map +1 -1
- package/packages/cli/dist/renderers/router.js +5 -3
- package/packages/cli/dist/renderers/router.js.map +1 -1
- package/packages/cli/dist/renderers/workflow.d.ts +0 -4
- package/packages/cli/dist/renderers/workflow.js +46 -84
- package/packages/cli/dist/renderers/workflow.js.map +1 -1
- package/packages/cli/dist/skill-import-args.d.ts +10 -0
- package/packages/cli/dist/skill-import-args.js +47 -0
- package/packages/cli/dist/skill-import-args.js.map +1 -0
- package/packages/cli/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/cli/package.json +2 -2
- package/packages/core/dist/ai-tools.js +72 -71
- package/packages/core/dist/ai-tools.js.map +1 -1
- package/packages/core/dist/artifacts/ingestion.js +64 -9
- package/packages/core/dist/artifacts/ingestion.js.map +1 -1
- package/packages/core/dist/artifacts/sdd-evidence.js +0 -1
- package/packages/core/dist/artifacts/sdd-evidence.js.map +1 -1
- package/packages/core/dist/artifacts/sdd-result.js +26 -17
- package/packages/core/dist/artifacts/sdd-result.js.map +1 -1
- package/packages/core/dist/config/init-project.d.ts +3 -0
- package/packages/core/dist/config/init-project.js +13 -9
- package/packages/core/dist/config/init-project.js.map +1 -1
- package/packages/core/dist/config/project-config.d.ts +3 -1
- package/packages/core/dist/config/project-config.js +7 -3
- package/packages/core/dist/config/project-config.js.map +1 -1
- package/packages/core/dist/config/starter-documents.d.ts +4 -4
- package/packages/core/dist/config/starter-documents.js +16 -20
- package/packages/core/dist/config/starter-documents.js.map +1 -1
- package/packages/core/dist/context/build-package.d.ts +1 -1
- package/packages/core/dist/context/build-package.js +1 -7
- package/packages/core/dist/context/build-package.js.map +1 -1
- package/packages/core/dist/context/evidence-summary.js +26 -8
- package/packages/core/dist/context/evidence-summary.js.map +1 -1
- package/packages/core/dist/context/log-worker.js +2 -2
- package/packages/core/dist/context/log-worker.js.map +1 -1
- package/packages/core/dist/context-offload/contracts.d.ts +1 -1
- package/packages/core/dist/contracts.d.ts +4 -1
- package/packages/core/dist/contracts.js +3 -0
- package/packages/core/dist/contracts.js.map +1 -1
- package/packages/core/dist/delegation/model.d.ts +3 -0
- package/packages/core/dist/delegation/validation.d.ts +3 -0
- package/packages/core/dist/delegation/validation.js +7 -4
- package/packages/core/dist/delegation/validation.js.map +1 -1
- package/packages/core/dist/doctor/checks/document-chain.js +1 -1
- package/packages/core/dist/doctor/checks/document-chain.js.map +1 -1
- package/packages/core/dist/doctor/checks/project.js +8 -8
- package/packages/core/dist/doctor/checks/project.js.map +1 -1
- package/packages/core/dist/doctor/checks/registries.js +0 -1
- package/packages/core/dist/doctor/checks/registries.js.map +1 -1
- package/packages/core/dist/doctor/checks/run-evidence.js +7 -7
- package/packages/core/dist/doctor/checks/run-evidence.js.map +1 -1
- package/packages/core/dist/doctor/checks/run-trust.js +0 -24
- package/packages/core/dist/doctor/checks/run-trust.js.map +1 -1
- package/packages/core/dist/doctor/checks/runtime-contracts.js +1 -1
- package/packages/core/dist/doctor/checks/runtime-contracts.js.map +1 -1
- package/packages/core/dist/doctor/doctor.js +277 -3
- package/packages/core/dist/doctor/doctor.js.map +1 -1
- package/packages/core/dist/evidence/lookup.d.ts +23 -0
- package/packages/core/dist/evidence/lookup.js +61 -0
- package/packages/core/dist/evidence/lookup.js.map +1 -0
- package/packages/core/dist/evidence-runtime/contracts.d.ts +11 -1
- package/packages/core/dist/execution/agent-execution-records.js +15 -8
- package/packages/core/dist/execution/agent-execution-records.js.map +1 -1
- package/packages/core/dist/execution/background-executor.js +4 -4
- package/packages/core/dist/execution/background-executor.js.map +1 -1
- package/packages/core/dist/execution/foreground-subagents.js +3 -3
- package/packages/core/dist/execution/foreground-subagents.js.map +1 -1
- package/packages/core/dist/execution/host-invocation.js +5 -4
- package/packages/core/dist/execution/host-invocation.js.map +1 -1
- package/packages/core/dist/execution/resident-worker.js +16 -7
- package/packages/core/dist/execution/resident-worker.js.map +1 -1
- package/packages/core/dist/execution/stage-team-runtime.d.ts +112 -0
- package/packages/core/dist/execution/stage-team-runtime.js +145 -0
- package/packages/core/dist/execution/stage-team-runtime.js.map +1 -0
- package/packages/core/dist/governance/policy.d.ts +1 -1
- package/packages/core/dist/governance/policy.js +1 -1
- package/packages/core/dist/governance/policy.js.map +1 -1
- package/packages/core/dist/instructions.d.ts +1 -1
- package/packages/core/dist/instructions.js +59 -66
- package/packages/core/dist/instructions.js.map +1 -1
- package/packages/core/dist/lifecycle/decision-gate.js +1 -1
- package/packages/core/dist/lifecycle/decision-gate.js.map +1 -1
- package/packages/core/dist/lifecycle/ship.d.ts +3 -0
- package/packages/core/dist/lifecycle/ship.js +55 -19
- package/packages/core/dist/lifecycle/ship.js.map +1 -1
- package/packages/core/dist/orchestration/contracts.d.ts +1 -1
- package/packages/core/dist/orchestration/runtime.d.ts +12 -2
- package/packages/core/dist/orchestration/runtime.js +62 -21
- package/packages/core/dist/orchestration/runtime.js.map +1 -1
- package/packages/core/dist/registries/agent-capability-catalog.d.ts +20 -2
- package/packages/core/dist/registries/agent-capability-catalog.js +218 -18
- package/packages/core/dist/registries/agent-capability-catalog.js.map +1 -1
- package/packages/core/dist/registries/agent-registry.js +17 -17
- package/packages/core/dist/registries/agent-registry.js.map +1 -1
- package/packages/core/dist/registries/agent-runtime-static.d.ts +10 -0
- package/packages/core/dist/registries/agent-runtime-static.js +32 -2
- package/packages/core/dist/registries/agent-runtime-static.js.map +1 -1
- package/packages/core/dist/registries/capability-sources.d.ts +2 -17
- package/packages/core/dist/registries/capability-sources.js +222 -10
- package/packages/core/dist/registries/capability-sources.js.map +1 -1
- package/packages/core/dist/registries/command-team-runtime.d.ts +1 -1
- package/packages/core/dist/registries/command-team-runtime.js +9 -9
- package/packages/core/dist/registries/command-team-runtime.js.map +1 -1
- package/packages/core/dist/registries/eval-learning-context.js +4 -4
- package/packages/core/dist/registries/eval-learning-context.js.map +1 -1
- package/packages/core/dist/registries/query-status.js +2 -2
- package/packages/core/dist/registries/query-status.js.map +1 -1
- package/packages/core/dist/registries/tool-capabilities.js +3 -3
- package/packages/core/dist/registries/tool-capabilities.js.map +1 -1
- package/packages/core/dist/registries/tool-plugins.js +2 -2
- package/packages/core/dist/registries/tool-plugins.js.map +1 -1
- package/packages/core/dist/registries/worker-adapters.js +11 -11
- package/packages/core/dist/registries/worker-adapters.js.map +1 -1
- package/packages/core/dist/registries/workflow-gates.js +12 -12
- package/packages/core/dist/registries/workflow-gates.js.map +1 -1
- package/packages/core/dist/risk/contracts.d.ts +2 -2
- package/packages/core/dist/risk/kernel.js +4 -4
- package/packages/core/dist/risk/kernel.js.map +1 -1
- package/packages/core/dist/risk/legacy-adapters.js +4 -7
- package/packages/core/dist/risk/legacy-adapters.js.map +1 -1
- package/packages/core/dist/risk/workflow-gates.d.ts +2 -2
- package/packages/core/dist/risk/workflow-gates.js +19 -17
- package/packages/core/dist/risk/workflow-gates.js.map +1 -1
- package/packages/core/dist/router/agent-runtime-config.js +28 -13
- package/packages/core/dist/router/agent-runtime-config.js.map +1 -1
- package/packages/core/dist/router/agent-runtime.d.ts +61 -1
- package/packages/core/dist/router/route-projection.d.ts +3 -1
- package/packages/core/dist/router/route-projection.js +192 -1
- package/packages/core/dist/router/route-projection.js.map +1 -1
- package/packages/core/dist/router/routing.js +73 -17
- package/packages/core/dist/router/routing.js.map +1 -1
- package/packages/core/dist/router/runtime-import.d.ts +28 -0
- package/packages/core/dist/router/runtime-import.js +373 -0
- package/packages/core/dist/router/runtime-import.js.map +1 -0
- package/packages/core/dist/router/runtime-inspection.js +11 -4
- package/packages/core/dist/router/runtime-inspection.js.map +1 -1
- package/packages/core/dist/router/runtime-validation.js +31 -3
- package/packages/core/dist/router/runtime-validation.js.map +1 -1
- package/packages/core/dist/router/stage-route-binding.d.ts +37 -0
- package/packages/core/dist/router/stage-route-binding.js +235 -0
- package/packages/core/dist/router/stage-route-binding.js.map +1 -0
- package/packages/core/dist/router.d.ts +2 -0
- package/packages/core/dist/router.js +2 -0
- package/packages/core/dist/router.js.map +1 -1
- package/packages/core/dist/run-state/artifacts.d.ts +16 -0
- package/packages/core/dist/run-state/artifacts.js +168 -18
- package/packages/core/dist/run-state/artifacts.js.map +1 -1
- package/packages/core/dist/run-state/events.js +2 -2
- package/packages/core/dist/run-state/events.js.map +1 -1
- package/packages/core/dist/run-state/inspect-run.d.ts +3 -3
- package/packages/core/dist/run-state/inspect-run.js +22 -54
- package/packages/core/dist/run-state/inspect-run.js.map +1 -1
- package/packages/core/dist/run-state/invocation-ledger.js +2 -2
- package/packages/core/dist/run-state/invocation-ledger.js.map +1 -1
- package/packages/core/dist/run-state/model.d.ts +53 -9
- package/packages/core/dist/run-state/run-index.d.ts +0 -2
- package/packages/core/dist/run-state/run-index.js +1 -3
- package/packages/core/dist/run-state/run-index.js.map +1 -1
- package/packages/core/dist/run-state/run-state.js +51 -34
- package/packages/core/dist/run-state/run-state.js.map +1 -1
- package/packages/core/dist/run-state/task-evidence.d.ts +65 -0
- package/packages/core/dist/run-state/task-evidence.js +169 -0
- package/packages/core/dist/run-state/task-evidence.js.map +1 -0
- package/packages/core/dist/run-state/timing.d.ts +8 -0
- package/packages/core/dist/run-state/timing.js +131 -0
- package/packages/core/dist/run-state/timing.js.map +1 -0
- package/packages/core/dist/run-state.d.ts +2 -0
- package/packages/core/dist/run-state.js +2 -0
- package/packages/core/dist/run-state.js.map +1 -1
- package/packages/core/dist/runtime-analysis/build.js +0 -3
- package/packages/core/dist/runtime-analysis/build.js.map +1 -1
- package/packages/core/dist/runtime-analysis/findings.js +5 -44
- package/packages/core/dist/runtime-analysis/findings.js.map +1 -1
- package/packages/core/dist/runtime-analysis/model.d.ts +1 -17
- package/packages/core/dist/runtime-paths.d.ts +20 -0
- package/packages/core/dist/runtime-paths.js +109 -14
- package/packages/core/dist/runtime-paths.js.map +1 -1
- package/packages/core/dist/runtime-projection-p0.d.ts +64 -0
- package/packages/core/dist/runtime-projection-p0.js +200 -0
- package/packages/core/dist/runtime-projection-p0.js.map +1 -0
- package/packages/core/dist/sdd-docs/context.js +1 -1
- package/packages/core/dist/sdd-docs/context.js.map +1 -1
- package/packages/core/dist/sdd-docs/document-hashes.d.ts +6 -0
- package/packages/core/dist/sdd-docs/document-hashes.js +276 -0
- package/packages/core/dist/sdd-docs/document-hashes.js.map +1 -0
- package/packages/core/dist/sdd-docs/run-binding.d.ts +1 -1
- package/packages/core/dist/sdd-docs/run-binding.js +15 -4
- package/packages/core/dist/sdd-docs/run-binding.js.map +1 -1
- package/packages/core/dist/sdd-docs/task-parser.d.ts +21 -0
- package/packages/core/dist/sdd-docs/task-parser.js +139 -38
- package/packages/core/dist/sdd-docs/task-parser.js.map +1 -1
- package/packages/core/dist/stage-artifacts.d.ts +55 -0
- package/packages/core/dist/stage-artifacts.js +322 -0
- package/packages/core/dist/stage-artifacts.js.map +1 -0
- package/packages/core/dist/stage-collaboration-contracts.d.ts +55 -0
- package/packages/core/dist/stage-collaboration-contracts.js +241 -0
- package/packages/core/dist/stage-collaboration-contracts.js.map +1 -0
- package/packages/core/dist/stage-collaboration.d.ts +888 -0
- package/packages/core/dist/stage-collaboration.js +3870 -0
- package/packages/core/dist/stage-collaboration.js.map +1 -0
- package/packages/core/dist/stage-runtime/runtime.js +8 -1
- package/packages/core/dist/stage-runtime/runtime.js.map +1 -1
- package/packages/core/dist/status/project-status.d.ts +105 -1
- package/packages/core/dist/status/project-status.js +343 -8
- package/packages/core/dist/status/project-status.js.map +1 -1
- package/packages/core/dist/storage/runtime-store.d.ts +348 -3
- package/packages/core/dist/storage/runtime-store.js +1017 -8
- package/packages/core/dist/storage/runtime-store.js.map +1 -1
- package/packages/core/dist/subagents/contracts.d.ts +1 -1
- package/packages/core/dist/subagents/runtime.js +7 -7
- package/packages/core/dist/subagents/runtime.js.map +1 -1
- package/packages/core/dist/test-support/fixtures.js +21 -0
- package/packages/core/dist/test-support/fixtures.js.map +1 -1
- package/packages/core/dist/test-support/run-state.d.ts +1 -1
- package/packages/core/dist/test-support/run-state.js +19 -20
- package/packages/core/dist/test-support/run-state.js.map +1 -1
- package/packages/core/dist/truth-reconciliation.d.ts +44 -0
- package/packages/core/dist/truth-reconciliation.js +138 -0
- package/packages/core/dist/truth-reconciliation.js.map +1 -0
- package/packages/core/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/core/dist/verification/goal-verify.d.ts +0 -1
- package/packages/core/dist/verification/goal-verify.js +44 -37
- package/packages/core/dist/verification/goal-verify.js.map +1 -1
- package/packages/core/dist/verification/rendering.d.ts +0 -2
- package/packages/core/dist/verification/rendering.js +19 -49
- package/packages/core/dist/verification/rendering.js.map +1 -1
- package/packages/core/dist/verification/review-gate.d.ts +22 -0
- package/packages/core/dist/verification/review-gate.js +53 -0
- package/packages/core/dist/verification/review-gate.js.map +1 -0
- package/packages/core/dist/verification/single-task-loop.d.ts +0 -1
- package/packages/core/dist/verification/single-task-loop.js +213 -111
- package/packages/core/dist/verification/single-task-loop.js.map +1 -1
- package/packages/core/dist/verification/test-runtime.d.ts +28 -3
- package/packages/core/dist/verification/test-runtime.js +546 -125
- package/packages/core/dist/verification/test-runtime.js.map +1 -1
- package/packages/core/dist/verification/validation-cache.d.ts +26 -0
- package/packages/core/dist/verification/validation-cache.js +73 -0
- package/packages/core/dist/verification/validation-cache.js.map +1 -0
- package/packages/core/dist/verification/validation-wave.d.ts +76 -0
- package/packages/core/dist/verification/validation-wave.js +450 -0
- package/packages/core/dist/verification/validation-wave.js.map +1 -0
- package/packages/core/dist/verification/verify-contract.d.ts +3 -1
- package/packages/core/dist/verification/verify-contract.js +105 -30
- package/packages/core/dist/verification/verify-contract.js.map +1 -1
- package/packages/core/dist/verification.d.ts +2 -0
- package/packages/core/dist/verification.js +2 -0
- package/packages/core/dist/verification.js.map +1 -1
- package/packages/core/dist/work-units/contracts.d.ts +1 -1
- package/packages/core/dist/workflow-gate/evidence-packet.d.ts +24 -0
- package/packages/core/dist/workflow-gate/evidence-packet.js +395 -0
- package/packages/core/dist/workflow-gate/evidence-packet.js.map +1 -0
- package/packages/core/dist/workflow-gate/hard-checks.d.ts +4 -0
- package/packages/core/dist/workflow-gate/hard-checks.js +164 -0
- package/packages/core/dist/workflow-gate/hard-checks.js.map +1 -0
- package/packages/core/dist/workflow-gate/policy.d.ts +4 -0
- package/packages/core/dist/workflow-gate/policy.js +182 -0
- package/packages/core/dist/workflow-gate/policy.js.map +1 -0
- package/packages/core/dist/workflow-gate/types.d.ts +88 -0
- package/packages/core/dist/workflow-gate/types.js +2 -0
- package/packages/core/dist/workflow-gate/types.js.map +1 -0
- package/packages/core/dist/workflow-state/affected-file-conflicts.d.ts +1 -1
- package/packages/core/dist/workflow-state/affected-file-conflicts.js +17 -3
- package/packages/core/dist/workflow-state/affected-file-conflicts.js.map +1 -1
- package/packages/core/dist/workflow-state/dependencies.d.ts +8 -4
- package/packages/core/dist/workflow-state/dependencies.js +25 -11
- package/packages/core/dist/workflow-state/dependencies.js.map +1 -1
- package/packages/core/dist/workflow-state/latest-eligible-run.d.ts +37 -0
- package/packages/core/dist/workflow-state/latest-eligible-run.js +188 -0
- package/packages/core/dist/workflow-state/latest-eligible-run.js.map +1 -0
- package/packages/core/dist/workflow-state/migration-recovery.d.ts +40 -0
- package/packages/core/dist/workflow-state/migration-recovery.js +110 -0
- package/packages/core/dist/workflow-state/migration-recovery.js.map +1 -0
- package/packages/core/dist/workflow-state/repair-contract.d.ts +12 -0
- package/packages/core/dist/workflow-state/repair-contract.js +63 -0
- package/packages/core/dist/workflow-state/repair-contract.js.map +1 -0
- package/packages/core/dist/workflow-state/resolve-task-run.d.ts +21 -0
- package/packages/core/dist/workflow-state/resolve-task-run.js +95 -0
- package/packages/core/dist/workflow-state/resolve-task-run.js.map +1 -0
- package/packages/core/dist/workflow-state/resolve.d.ts +80 -3
- package/packages/core/dist/workflow-state/resolve.js +674 -41
- package/packages/core/dist/workflow-state/resolve.js.map +1 -1
- package/packages/core/dist/workflow-state/runtime-projections.d.ts +228 -0
- package/packages/core/dist/workflow-state/runtime-projections.js +452 -0
- package/packages/core/dist/workflow-state/runtime-projections.js.map +1 -0
- package/packages/core/dist/workflow-state.d.ts +1 -0
- package/packages/core/dist/workflow-state.js +1 -0
- package/packages/core/dist/workflow-state.js.map +1 -1
- package/packages/core/package.json +3 -3
- package/node_modules/@sdd-agent-platform/core/dist/doctor/render.d.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/dist/doctor/render.js +0 -44
- package/node_modules/@sdd-agent-platform/core/dist/doctor/render.js.map +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.d.ts +0 -17
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.js +0 -221
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.js.map +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.d.ts +0 -91
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.js +0 -395
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.js.map +0 -1
- package/node_modules/@sdd-agent-platform/core/dist/sync-back.d.ts +0 -2
- package/node_modules/@sdd-agent-platform/core/dist/sync-back.js +0 -3
- package/node_modules/@sdd-agent-platform/core/dist/sync-back.js.map +0 -1
- package/node_modules/@sdd-agent-platform/core/src/sync-back/apply.ts +0 -248
- package/node_modules/@sdd-agent-platform/core/src/sync-back/inspect.ts +0 -522
- package/node_modules/@sdd-agent-platform/core/src/sync-back/sync-back.test.ts +0 -446
- package/node_modules/@sdd-agent-platform/core/src/sync-back.ts +0 -2
- package/packages/cli/dist/commands/artifact.d.ts +0 -6
- package/packages/cli/dist/commands/artifact.js +0 -168
- package/packages/cli/dist/commands/artifact.js.map +0 -1
- package/packages/cli/dist/commands/sync-back.d.ts +0 -6
- package/packages/cli/dist/commands/sync-back.js +0 -82
- package/packages/cli/dist/commands/sync-back.js.map +0 -1
- package/packages/cli/dist/renderers/artifacts.d.ts +0 -5
- package/packages/cli/dist/renderers/artifacts.js +0 -43
- package/packages/cli/dist/renderers/artifacts.js.map +0 -1
- package/packages/core/dist/doctor/render.d.ts +0 -2
- package/packages/core/dist/doctor/render.js +0 -44
- package/packages/core/dist/doctor/render.js.map +0 -1
- package/packages/core/dist/sync-back/apply.d.ts +0 -17
- package/packages/core/dist/sync-back/apply.js +0 -221
- package/packages/core/dist/sync-back/apply.js.map +0 -1
- package/packages/core/dist/sync-back/inspect.d.ts +0 -91
- package/packages/core/dist/sync-back/inspect.js +0 -395
- package/packages/core/dist/sync-back/inspect.js.map +0 -1
- package/packages/core/dist/sync-back.d.ts +0 -2
- package/packages/core/dist/sync-back.js +0 -3
- package/packages/core/dist/sync-back.js.map +0 -1
|
@@ -123,12 +123,36 @@ function validateAgentSkillTeamRuntimeInspection(inspection: AgentSkillTeamRunti
|
|
|
123
123
|
if (!source.attribution.trim()) {
|
|
124
124
|
issues.push(contractIssue(`${source.id}.attribution`, 'Capability source has no attribution.', 'Declare attribution before external material can enter the runtime registry.'));
|
|
125
125
|
}
|
|
126
|
-
if (source.
|
|
127
|
-
issues.push(contractIssue(`${source.id}.
|
|
126
|
+
if (source.permissionModel.length === 0) {
|
|
127
|
+
issues.push(contractIssue(`${source.id}.permissionModel`, 'Capability source has no permission model.', 'Declare how host/tool permissions are bounded before routing this source.'));
|
|
128
128
|
}
|
|
129
|
-
if (source.
|
|
129
|
+
if (source.provenanceRequirements.length === 0) {
|
|
130
|
+
issues.push(contractIssue(`${source.id}.provenanceRequirements`, 'Capability source has no provenance requirements.', 'Declare source, session, artifact, or tool provenance before external output can be cited.'));
|
|
131
|
+
}
|
|
132
|
+
if (source.hostCompatibility.length === 0) {
|
|
133
|
+
issues.push(contractIssue(`${source.id}.hostCompatibility`, 'Capability source has no host compatibility declaration.', 'Declare supported, future_adapter, or unsupported host compatibility.'));
|
|
134
|
+
}
|
|
135
|
+
if (source.allowedEvidenceTypes.length === 0) {
|
|
136
|
+
issues.push(contractIssue(`${source.id}.allowedEvidenceTypes`, 'Capability source has no allowed evidence type.', 'Declare whether output is none, candidate evidence, command output, browser snapshot, design context, execution record, or external reference.'));
|
|
137
|
+
}
|
|
138
|
+
if (source.forbiddenAuthority.length === 0 || !sourceForbidsRuntimeAuthority(source)) {
|
|
139
|
+
issues.push(contractIssue(`${source.id}.forbiddenAuthority`, 'Capability source does not forbid runtime authority.', 'External sources must forbid lifecycle, completion, truth-alignment, ship, and permission authority.'));
|
|
140
|
+
}
|
|
141
|
+
if (!source.quarantineRequired && source.quarantineStatus !== 'not_required') {
|
|
142
|
+
issues.push(contractIssue(`${source.id}.quarantineStatus`, 'Non-quarantined source has a quarantine status.', 'Use not_required unless quarantine is required.'));
|
|
143
|
+
}
|
|
144
|
+
if (source.quarantineRequired && source.quarantineStatus === 'not_required') {
|
|
145
|
+
issues.push(contractIssue(`${source.id}.quarantineStatus`, 'Quarantined source is missing active quarantine status.', 'Use required, quarantined, or denied for external sources that require quarantine.'));
|
|
146
|
+
}
|
|
147
|
+
if ((source.quarantineRequired || source.quarantineStatus === 'quarantined' || source.quarantineStatus === 'denied') && source.reuseDecision === 'reuse_direct') {
|
|
148
|
+
issues.push(contractIssue(`${source.id}.reuseDecision`, 'Quarantined source cannot be reused directly.', 'Use adapt_via_host_adapter, borrow_mechanism, or avoid until quarantine evidence promotes the source.'));
|
|
149
|
+
}
|
|
150
|
+
if ((source.quarantineRequired || source.quarantineStatus === 'quarantined') && sourceDeclaresUnsafeAuthority(source)) {
|
|
130
151
|
issues.push(contractIssue(`${source.id}.allowedUse`, 'Quarantined source requests prompt import, direct execution, or lifecycle authority.', 'Keep external material declarative and route only through validated profiles, capabilities, and adapter mappings.'));
|
|
131
152
|
}
|
|
153
|
+
if (source.quarantineStatus === 'denied' && source.reuseDecision !== 'avoid') {
|
|
154
|
+
issues.push(contractIssue(`${source.id}.reuseDecision`, 'Denied capability source is still routable.', 'Set reuse_decision to avoid for denied or unsupported sources.'));
|
|
155
|
+
}
|
|
132
156
|
}
|
|
133
157
|
for (const capability of inspection.skillCapabilities) {
|
|
134
158
|
const registrySource = inspectionRegistrySource(inspection, 'skill_capability', capability.id);
|
|
@@ -226,6 +250,11 @@ function sourceDeclaresUnsafeAuthority(source: CapabilitySourceCatalogEntry): bo
|
|
|
226
250
|
return /prompt\s*(body|import)|direct\s+execution|execute\s+(third[- ]party|external)|run\s+(agent\s+)?pack|lifecycle\s+authority|completion\s+authority|unscoped\s+write|permission\s+escalation/i.test([source.allowedUse, source.rationale].join('\n'));
|
|
227
251
|
}
|
|
228
252
|
|
|
253
|
+
function sourceForbidsRuntimeAuthority(source: CapabilitySourceCatalogEntry): boolean {
|
|
254
|
+
const forbidden = source.forbiddenAuthority.join('\n').toLowerCase();
|
|
255
|
+
return ['lifecycle', 'stage completion', 'truth-alignment', 'ship', 'permission'].every((term) => forbidden.includes(term));
|
|
256
|
+
}
|
|
257
|
+
|
|
229
258
|
function builtInProfileAliasTarget(value: string): AgentProfileId | null {
|
|
230
259
|
const normalized = normalizeAgentToken(value);
|
|
231
260
|
if (normalized === 'scout') {
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import type { RuntimeRef, SddStage } from '../contracts.js';
|
|
2
|
+
import { readLifecycleRiskDecisionProjection } from '../risk/kernel.js';
|
|
3
|
+
import { resolveSddContext } from '../sdd-docs/context.js';
|
|
4
|
+
import { parseSddBranch, type SddTask, type SddTaskModel } from '../sdd-docs/task-parser.js';
|
|
5
|
+
import { STAGE_ROUTE_BINDING_PRODUCER_VERSION, STAGE_ROUTE_BINDING_PROJECTION_TYPE, runtimeProjectionStableHash } from '../runtime-projection-p0.js';
|
|
6
|
+
import { recordRuntimeProjectionEnvelope, type RuntimeProjectionEnvelopeWriteResult } from '../storage/runtime-store.js';
|
|
7
|
+
|
|
8
|
+
export const STAGE_ROUTE_BINDING_CONTRACT_VERSION = 'sdd-stage-route-binding-v1' as const;
|
|
9
|
+
|
|
10
|
+
export type StageRouteEntry = 'sdd:plan' | 'sdd:tasks' | 'sdd:do' | 'sdd:test' | 'sdd:ship';
|
|
11
|
+
export type SddCommandBundle = 'plan' | 'tasks' | 'do' | 'test' | 'ship';
|
|
12
|
+
export type StageRouteBindingStatus = 'bound' | 'ambiguous' | 'not_found' | 'stale_upstream' | 'boundary_expanding' | 'blocked';
|
|
13
|
+
export type StageRouteTargetKind = 'task' | 'stage' | 'gate' | 'evidence_set' | 'ship_scope';
|
|
14
|
+
export type StageRouteBindingNextAction = 'enter_stage' | 'run_internal_stage' | 'ask_clarification' | 'route_to_lifecycle_decision' | 'runtime_repair_required' | 'blocked';
|
|
15
|
+
|
|
16
|
+
export interface StageRouteBinding {
|
|
17
|
+
contract: typeof STAGE_ROUTE_BINDING_CONTRACT_VERSION;
|
|
18
|
+
branch: string;
|
|
19
|
+
entry: StageRouteEntry;
|
|
20
|
+
bundle: SddCommandBundle;
|
|
21
|
+
targetRuntimeStage: SddStage;
|
|
22
|
+
userText: string;
|
|
23
|
+
status: StageRouteBindingStatus;
|
|
24
|
+
targetKind: StageRouteTargetKind | null;
|
|
25
|
+
targetId: string | null;
|
|
26
|
+
matchedRefs: RuntimeRef[];
|
|
27
|
+
activeLifecycleDecisionRef: string | null;
|
|
28
|
+
nextAction: StageRouteBindingNextAction;
|
|
29
|
+
reasons: string[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
interface TaskMatchCandidate {
|
|
33
|
+
task: SddTask;
|
|
34
|
+
score: number;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export async function bindStageRoute(projectRoot: string, input: { entry: StageRouteEntry; branch?: string; userText?: string }): Promise<StageRouteBinding> {
|
|
38
|
+
const context = await resolveSddContext(projectRoot, { branch: input.branch, branchSource: input.branch ? 'cli_option' : undefined });
|
|
39
|
+
const model = await parseSddBranch(projectRoot, context.partition);
|
|
40
|
+
return bindStageRouteForModel(projectRoot, {
|
|
41
|
+
branch: context.partition,
|
|
42
|
+
model,
|
|
43
|
+
entry: input.entry,
|
|
44
|
+
userText: input.userText ?? ''
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export async function bindStageRouteForModel(projectRoot: string, input: { branch: string; model: SddTaskModel; entry: StageRouteEntry; userText?: string }): Promise<StageRouteBinding> {
|
|
49
|
+
const userText = (input.userText ?? '').trim();
|
|
50
|
+
const activeLifecycleDecisionRef = (await readLifecycleRiskDecisionProjection(projectRoot, { branch: input.branch }))?.id ?? null;
|
|
51
|
+
if (input.entry === 'sdd:do') {
|
|
52
|
+
return bindDoTask(input.branch, input.model, userText, activeLifecycleDecisionRef);
|
|
53
|
+
}
|
|
54
|
+
return bindBundleStage(input.branch, input.entry, userText, activeLifecycleDecisionRef);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function stageRouteBindingScopeKey(binding: Pick<StageRouteBinding, 'branch' | 'entry' | 'userText'>): string {
|
|
58
|
+
return [binding.branch, binding.entry, runtimeProjectionStableHash(binding.userText || '<empty>').slice(0, 16)].join(':');
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export async function recordStageRouteBindingProjection(projectRoot: string, binding: StageRouteBinding): Promise<RuntimeProjectionEnvelopeWriteResult<StageRouteBinding>> {
|
|
62
|
+
return recordRuntimeProjectionEnvelope(projectRoot, {
|
|
63
|
+
projectionType: STAGE_ROUTE_BINDING_PROJECTION_TYPE,
|
|
64
|
+
scopeKey: stageRouteBindingScopeKey(binding),
|
|
65
|
+
inputHash: runtimeProjectionStableHash(binding),
|
|
66
|
+
producer: 'phase9.18-stage-route-binding-runtime',
|
|
67
|
+
producerVersion: STAGE_ROUTE_BINDING_PRODUCER_VERSION,
|
|
68
|
+
payload: binding
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function bindDoTask(branch: string, model: SddTaskModel, userText: string, activeLifecycleDecisionRef: string | null): StageRouteBinding {
|
|
73
|
+
const staleReason = doStageStaleReason(model);
|
|
74
|
+
if (staleReason) {
|
|
75
|
+
return binding({
|
|
76
|
+
branch,
|
|
77
|
+
entry: 'sdd:do',
|
|
78
|
+
targetRuntimeStage: 'do',
|
|
79
|
+
userText,
|
|
80
|
+
status: 'stale_upstream',
|
|
81
|
+
targetKind: 'task',
|
|
82
|
+
targetId: null,
|
|
83
|
+
matchedRefs: [],
|
|
84
|
+
activeLifecycleDecisionRef,
|
|
85
|
+
nextAction: 'runtime_repair_required',
|
|
86
|
+
reasons: [staleReason]
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const matches = matchTasks(model.tasks, userText);
|
|
91
|
+
if (matches.length === 0) {
|
|
92
|
+
const looksLikeId = looksLikeTaskId(userText);
|
|
93
|
+
return binding({
|
|
94
|
+
branch,
|
|
95
|
+
entry: 'sdd:do',
|
|
96
|
+
targetRuntimeStage: 'do',
|
|
97
|
+
userText,
|
|
98
|
+
status: looksLikeId ? 'not_found' : 'boundary_expanding',
|
|
99
|
+
targetKind: 'task',
|
|
100
|
+
targetId: null,
|
|
101
|
+
matchedRefs: [],
|
|
102
|
+
activeLifecycleDecisionRef,
|
|
103
|
+
nextAction: looksLikeId ? 'ask_clarification' : 'route_to_lifecycle_decision',
|
|
104
|
+
reasons: looksLikeId
|
|
105
|
+
? [`Task ${userText || '<empty>'} was not found in the accepted task set.`]
|
|
106
|
+
: [`No accepted task boundary matched "${userText}"; run /sdd or /sdd:spec if this is new scope, risk, or acceptance.`]
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const topScore = matches[0].score;
|
|
111
|
+
const tied = matches.filter((candidate) => candidate.score === topScore);
|
|
112
|
+
if (tied.length > 1) {
|
|
113
|
+
return binding({
|
|
114
|
+
branch,
|
|
115
|
+
entry: 'sdd:do',
|
|
116
|
+
targetRuntimeStage: 'do',
|
|
117
|
+
userText,
|
|
118
|
+
status: 'ambiguous',
|
|
119
|
+
targetKind: 'task',
|
|
120
|
+
targetId: null,
|
|
121
|
+
matchedRefs: tied.map((candidate) => taskRuntimeRef(candidate.task)),
|
|
122
|
+
activeLifecycleDecisionRef,
|
|
123
|
+
nextAction: 'ask_clarification',
|
|
124
|
+
reasons: [`Ambiguous task text "${userText}" matched ${tied.map((candidate) => candidate.task.id).join(', ')}; specify a task id or more precise title.`]
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const task = matches[0].task;
|
|
129
|
+
return binding({
|
|
130
|
+
branch,
|
|
131
|
+
entry: 'sdd:do',
|
|
132
|
+
targetRuntimeStage: 'do',
|
|
133
|
+
userText,
|
|
134
|
+
status: 'bound',
|
|
135
|
+
targetKind: 'task',
|
|
136
|
+
targetId: task.id,
|
|
137
|
+
matchedRefs: [taskRuntimeRef(task)],
|
|
138
|
+
activeLifecycleDecisionRef,
|
|
139
|
+
nextAction: 'enter_stage',
|
|
140
|
+
reasons: [`Bound "${userText}" to task ${task.id}.`]
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function bindBundleStage(branch: string, entry: Exclude<StageRouteEntry, 'sdd:do'>, userText: string, activeLifecycleDecisionRef: string | null): StageRouteBinding {
|
|
145
|
+
const targetRuntimeStage = bundleTargetRuntimeStage(entry, userText);
|
|
146
|
+
return binding({
|
|
147
|
+
branch,
|
|
148
|
+
entry,
|
|
149
|
+
targetRuntimeStage,
|
|
150
|
+
userText,
|
|
151
|
+
status: 'bound',
|
|
152
|
+
targetKind: entry === 'sdd:ship' ? 'ship_scope' : 'stage',
|
|
153
|
+
targetId: targetRuntimeStage,
|
|
154
|
+
matchedRefs: [{ kind: entry === 'sdd:ship' ? 'projection' : 'command', ref: `${entry}:${targetRuntimeStage}` }],
|
|
155
|
+
activeLifecycleDecisionRef,
|
|
156
|
+
nextAction: targetRuntimeStage === bundleForEntry(entry) ? 'enter_stage' : 'run_internal_stage',
|
|
157
|
+
reasons: [`Bound ${entry} to runtime stage ${targetRuntimeStage}.`]
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function binding(input: Omit<StageRouteBinding, 'contract' | 'bundle'>): StageRouteBinding {
|
|
162
|
+
return {
|
|
163
|
+
contract: STAGE_ROUTE_BINDING_CONTRACT_VERSION,
|
|
164
|
+
bundle: bundleForEntry(input.entry),
|
|
165
|
+
...input
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function bundleForEntry(entry: StageRouteEntry): SddCommandBundle {
|
|
170
|
+
if (entry === 'sdd:plan') return 'plan';
|
|
171
|
+
if (entry === 'sdd:tasks') return 'tasks';
|
|
172
|
+
if (entry === 'sdd:do') return 'do';
|
|
173
|
+
if (entry === 'sdd:test') return 'test';
|
|
174
|
+
return 'ship';
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function bundleTargetRuntimeStage(entry: Exclude<StageRouteEntry, 'sdd:do'>, userText: string): SddStage {
|
|
178
|
+
const normalized = normalizeSearchText(userText);
|
|
179
|
+
if (entry === 'sdd:plan') return 'plan';
|
|
180
|
+
if (entry === 'sdd:tasks') return normalized.includes('verif') || normalized.includes('verify') ? 'verifies' : 'tasks';
|
|
181
|
+
if (entry === 'sdd:test') return normalized.includes('goalverify') || normalized.includes('goal') ? 'goal-verify' : 'test';
|
|
182
|
+
return 'ship';
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function doStageStaleReason(model: SddTaskModel): string | null {
|
|
186
|
+
if (model.documents.tasksStale) {
|
|
187
|
+
return 'Tasks document is stale; return to the tasks bundle before executing do-stage binding.';
|
|
188
|
+
}
|
|
189
|
+
if (model.documents.verifyStale) {
|
|
190
|
+
return 'Verify document is stale; return to the tasks/verifies bundle before executing do-stage binding.';
|
|
191
|
+
}
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function matchTasks(tasks: SddTask[], userText: string): TaskMatchCandidate[] {
|
|
196
|
+
const query = normalizeSearchText(userText);
|
|
197
|
+
if (!query) {
|
|
198
|
+
return [];
|
|
199
|
+
}
|
|
200
|
+
return tasks
|
|
201
|
+
.map((task) => ({ task, score: scoreTask(task, userText, query) }))
|
|
202
|
+
.filter((candidate) => candidate.score >= 40)
|
|
203
|
+
.sort((left, right) => right.score - left.score || left.task.id.localeCompare(right.task.id));
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function scoreTask(task: SddTask, rawQuery: string, normalizedQuery: string): number {
|
|
207
|
+
const normalizedId = normalizeSearchText(task.id);
|
|
208
|
+
if (normalizedId === normalizedQuery) {
|
|
209
|
+
return 1000;
|
|
210
|
+
}
|
|
211
|
+
if (normalizedId.includes(normalizedQuery) && normalizedQuery.length >= 2) {
|
|
212
|
+
return 700;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
let score = 0;
|
|
216
|
+
score = Math.max(score, scoreTextField(task.title ?? '', rawQuery, normalizedQuery, 600, 360, 80));
|
|
217
|
+
score = Math.max(score, scoreTextField(task.acceptance.join(' '), rawQuery, normalizedQuery, 260, 180, 35));
|
|
218
|
+
score = Math.max(score, scoreTextField(task.boundary ?? '', rawQuery, normalizedQuery, 180, 120, 24));
|
|
219
|
+
score = Math.max(score, scoreTextField(task.affectedFiles.join(' '), rawQuery, normalizedQuery, 120, 80, 12));
|
|
220
|
+
return score;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function scoreTextField(value: string, rawQuery: string, normalizedQuery: string, exactScore: number, containsScore: number, tokenWeight: number): number {
|
|
224
|
+
const normalizedValue = normalizeSearchText(value);
|
|
225
|
+
if (!normalizedValue) {
|
|
226
|
+
return 0;
|
|
227
|
+
}
|
|
228
|
+
if (normalizedValue === normalizedQuery) {
|
|
229
|
+
return exactScore;
|
|
230
|
+
}
|
|
231
|
+
if ((normalizedValue.includes(normalizedQuery) || normalizedQuery.includes(normalizedValue)) && Math.min(normalizedValue.length, normalizedQuery.length) >= 2) {
|
|
232
|
+
return containsScore;
|
|
233
|
+
}
|
|
234
|
+
const queryTokens = searchTokens(rawQuery);
|
|
235
|
+
const valueTokens = searchTokens(value);
|
|
236
|
+
let overlap = 0;
|
|
237
|
+
for (const token of queryTokens) {
|
|
238
|
+
if (valueTokens.has(token)) {
|
|
239
|
+
overlap += 1;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return overlap * tokenWeight;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function normalizeSearchText(value: string): string {
|
|
246
|
+
return value.toLocaleLowerCase().normalize('NFKC').replace(/[\s\p{P}\p{S}_-]+/gu, '');
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const LOW_SIGNAL_SEARCH_TOKENS = new Set(['system', 'systems', 'feature', 'features', '功能', '系统', '模块', '服务', '任务', '实现', '完成', '边界']);
|
|
250
|
+
|
|
251
|
+
function searchTokens(value: string): Set<string> {
|
|
252
|
+
const tokens = new Set<string>();
|
|
253
|
+
const normalized = value.toLocaleLowerCase().normalize('NFKC');
|
|
254
|
+
for (const match of normalized.matchAll(/[a-z0-9]+/g)) {
|
|
255
|
+
addSearchToken(tokens, match[0]);
|
|
256
|
+
}
|
|
257
|
+
for (const match of normalized.matchAll(/\p{Script=Han}+/gu)) {
|
|
258
|
+
const text = match[0];
|
|
259
|
+
addSearchToken(tokens, text);
|
|
260
|
+
for (let index = 0; index < text.length - 1; index += 1) {
|
|
261
|
+
addSearchToken(tokens, text.slice(index, index + 2));
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
return tokens;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function addSearchToken(tokens: Set<string>, token: string): void {
|
|
268
|
+
if (token.length >= 2 && !LOW_SIGNAL_SEARCH_TOKENS.has(token)) {
|
|
269
|
+
tokens.add(token);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
function looksLikeTaskId(value: string): boolean {
|
|
274
|
+
return /^[a-z][a-z0-9._-]*-?\d+$/i.test(value.trim());
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
function taskRuntimeRef(task: SddTask): RuntimeRef {
|
|
278
|
+
return { kind: 'task', ref: `task:${task.id}` };
|
|
279
|
+
}
|
|
@@ -2,3 +2,5 @@ export * from './router/agent-runtime-config.js';
|
|
|
2
2
|
export * from './router/agent-runtime.js';
|
|
3
3
|
export * from './router/route-cache.js';
|
|
4
4
|
export * from './router/route-sdd-task.js';
|
|
5
|
+
export * from './router/stage-route-binding.js';
|
|
6
|
+
export * from './router/runtime-import.js';
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
2
|
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
-
import {
|
|
5
|
-
import { readRuntimeRunState, recordRuntimeEvidenceAttachment, runtimeScopedId, withRuntimeStore } from '../storage/runtime-store.js';
|
|
6
|
-
import {
|
|
4
|
+
import { getBranchStageEvidencePathFromRef, getEvidenceAttachmentPath, getLegacyArtifactPath, getRunRelativeArtifactPath, getRuntimeStorePath, isBranchStageEvidenceRef, normalizeArtifactRootRelativePath, normalizeBranchStageEvidenceRef, toBranchStageEvidenceRef } from '../runtime-paths.js';
|
|
5
|
+
import { readRuntimeRunState, recordRuntimeArtifactPayload, recordRuntimeEvidenceAttachment, resolveRuntimeArtifactPayload, runtimeScopedId, withRuntimeStore, type RuntimeArtifactPayloadRecord } from '../storage/runtime-store.js';
|
|
6
|
+
import type { SddStage } from '../contracts.js';
|
|
7
7
|
import { appendArtifactHashLedgerEntry } from './invocation-ledger.js';
|
|
8
8
|
|
|
9
9
|
export async function writeArtifact(projectRoot: string, runId: string, artifactRootRelativePath: string, content: string): Promise<{ absolutePath: string; runRelativePath: string }> {
|
|
10
10
|
const normalized = normalizeArtifactRootRelativePath(artifactRootRelativePath);
|
|
11
11
|
const runRelativePath = getRunRelativeArtifactPath(normalized);
|
|
12
|
-
const
|
|
13
|
-
const
|
|
12
|
+
const runScope = await resolveRunScope(projectRoot, runId);
|
|
13
|
+
const contentHash = hashDocumentContent(content);
|
|
14
|
+
const physicalPayloadPath = uniquePhysicalPayloadPath(runRelativePath, runId, contentHash);
|
|
15
|
+
const absolutePath = getEvidenceAttachmentPath(projectRoot, runScope.branchSlug, physicalPayloadPath);
|
|
14
16
|
await mkdir(path.dirname(absolutePath), { recursive: true });
|
|
15
17
|
await writeFile(absolutePath, content, 'utf8');
|
|
16
18
|
await appendArtifactHashLedgerEntry(projectRoot, {
|
|
@@ -19,27 +21,177 @@ export async function writeArtifact(projectRoot: string, runId: string, artifact
|
|
|
19
21
|
content,
|
|
20
22
|
status: 'written'
|
|
21
23
|
});
|
|
22
|
-
await recordRuntimeArtifact(projectRoot, { runId, path: runRelativePath, content, status: 'written' });
|
|
24
|
+
await recordRuntimeArtifact(projectRoot, { runId, path: runRelativePath, content, status: 'written', taskId: runScope.taskId });
|
|
25
|
+
await recordRuntimeArtifactPayload(projectRoot, {
|
|
26
|
+
payloadId: runtimeScopedId(runId, runRelativePath, contentHash),
|
|
27
|
+
runId,
|
|
28
|
+
sourceRunId: runId,
|
|
29
|
+
branchSlug: runScope.branchSlug,
|
|
30
|
+
taskId: runScope.taskId,
|
|
31
|
+
logicalRef: runRelativePath,
|
|
32
|
+
physicalPayloadPath,
|
|
33
|
+
artifactRole: artifactKind(runRelativePath),
|
|
34
|
+
digest: contentHash,
|
|
35
|
+
status: 'active',
|
|
36
|
+
payload: { logicalRef: runRelativePath, physicalPayloadPath, artifactPath: runRelativePath, status: 'written' }
|
|
37
|
+
});
|
|
23
38
|
await recordRuntimeEvidenceAttachment(projectRoot, {
|
|
24
|
-
branchSlug,
|
|
39
|
+
branchSlug: runScope.branchSlug,
|
|
25
40
|
runId,
|
|
41
|
+
taskId: runScope.taskId,
|
|
26
42
|
kind: artifactKind(runRelativePath),
|
|
43
|
+
relativePath: physicalPayloadPath,
|
|
44
|
+
contentHash,
|
|
45
|
+
bytes: Buffer.byteLength(content, 'utf8'),
|
|
46
|
+
payload: { logicalRef: runRelativePath, physicalPayloadPath, status: 'written' }
|
|
47
|
+
});
|
|
48
|
+
return { absolutePath, runRelativePath };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export async function recordStageEvidenceArtifact(projectRoot: string, runId: string, stageEvidenceRef: string, content: string, options: { taskId?: string | null; artifactRole?: string } = {}): Promise<{ absolutePath: string; runRelativePath: string }> {
|
|
52
|
+
const runRelativePath = normalizeBranchStageEvidenceRef(stageEvidenceRef);
|
|
53
|
+
const runScope = await resolveRunScope(projectRoot, runId);
|
|
54
|
+
const taskId = options.taskId ?? runScope.taskId;
|
|
55
|
+
const contentHash = hashDocumentContent(content);
|
|
56
|
+
const absolutePath = getBranchStageEvidencePathFromRef(projectRoot, runRelativePath);
|
|
57
|
+
await mkdir(path.dirname(absolutePath), { recursive: true });
|
|
58
|
+
await writeFile(absolutePath, content, 'utf8');
|
|
59
|
+
await appendArtifactHashLedgerEntry(projectRoot, {
|
|
60
|
+
runId,
|
|
61
|
+
taskId,
|
|
62
|
+
branch: runScope.branchSlug,
|
|
63
|
+
artifactPath: runRelativePath,
|
|
64
|
+
content,
|
|
65
|
+
status: 'written'
|
|
66
|
+
});
|
|
67
|
+
await recordRuntimeArtifact(projectRoot, { runId, path: runRelativePath, content, status: 'written', taskId });
|
|
68
|
+
await recordRuntimeArtifactPayload(projectRoot, {
|
|
69
|
+
payloadId: runtimeScopedId(runId, runRelativePath, contentHash),
|
|
70
|
+
runId,
|
|
71
|
+
sourceRunId: runId,
|
|
72
|
+
branchSlug: runScope.branchSlug,
|
|
73
|
+
taskId,
|
|
74
|
+
logicalRef: runRelativePath,
|
|
75
|
+
physicalPayloadPath: runRelativePath,
|
|
76
|
+
artifactRole: options.artifactRole ?? artifactKind(runRelativePath),
|
|
77
|
+
digest: contentHash,
|
|
78
|
+
status: 'active',
|
|
79
|
+
payload: { logicalRef: runRelativePath, physicalPayloadPath: runRelativePath, storage: 'stage-evidence', status: 'written' }
|
|
80
|
+
});
|
|
81
|
+
await recordRuntimeEvidenceAttachment(projectRoot, {
|
|
82
|
+
branchSlug: runScope.branchSlug,
|
|
83
|
+
runId,
|
|
84
|
+
taskId,
|
|
85
|
+
kind: options.artifactRole ?? artifactKind(runRelativePath),
|
|
27
86
|
relativePath: runRelativePath,
|
|
28
|
-
contentHash
|
|
87
|
+
contentHash,
|
|
29
88
|
bytes: Buffer.byteLength(content, 'utf8'),
|
|
30
|
-
payload: {
|
|
89
|
+
payload: { logicalRef: runRelativePath, physicalPayloadPath: runRelativePath, storage: 'stage-evidence', status: 'written' }
|
|
31
90
|
});
|
|
32
91
|
return { absolutePath, runRelativePath };
|
|
33
92
|
}
|
|
34
93
|
|
|
94
|
+
export async function recordRuntimeOnlyArtifact(projectRoot: string, runId: string, artifactRootRelativePath: string, content: string, options: { logicalRef?: string; branch?: string | null; taskId?: string | null; artifactRole?: string } = {}): Promise<{ absolutePath: string; runRelativePath: string }> {
|
|
95
|
+
const normalized = normalizeArtifactRootRelativePath(artifactRootRelativePath);
|
|
96
|
+
const runRelativePath = options.logicalRef ?? getRunRelativeArtifactPath(normalized);
|
|
97
|
+
const runScope = await resolveRunScope(projectRoot, runId);
|
|
98
|
+
const branchSlug = options.branch ?? runScope.branchSlug;
|
|
99
|
+
const taskId = options.taskId ?? runScope.taskId;
|
|
100
|
+
const contentHash = hashDocumentContent(content);
|
|
101
|
+
const physicalPayloadPath = `runtime.sqlite:${runId}:${runRelativePath}`;
|
|
102
|
+
await appendArtifactHashLedgerEntry(projectRoot, {
|
|
103
|
+
runId,
|
|
104
|
+
taskId,
|
|
105
|
+
branch: branchSlug,
|
|
106
|
+
artifactPath: runRelativePath,
|
|
107
|
+
content,
|
|
108
|
+
status: 'recorded'
|
|
109
|
+
});
|
|
110
|
+
await recordRuntimeArtifact(projectRoot, { runId, path: runRelativePath, content, status: 'recorded', taskId });
|
|
111
|
+
await recordRuntimeArtifactPayload(projectRoot, {
|
|
112
|
+
payloadId: runtimeScopedId(runId, runRelativePath, contentHash),
|
|
113
|
+
runId,
|
|
114
|
+
sourceRunId: runId,
|
|
115
|
+
branchSlug,
|
|
116
|
+
taskId,
|
|
117
|
+
logicalRef: runRelativePath,
|
|
118
|
+
physicalPayloadPath,
|
|
119
|
+
artifactRole: options.artifactRole ?? artifactKind(runRelativePath),
|
|
120
|
+
digest: contentHash,
|
|
121
|
+
status: 'active',
|
|
122
|
+
payload: { logicalRef: runRelativePath, physicalPayloadPath, storage: 'runtime.sqlite', content }
|
|
123
|
+
});
|
|
124
|
+
await recordRuntimeEvidenceAttachment(projectRoot, {
|
|
125
|
+
branchSlug,
|
|
126
|
+
runId,
|
|
127
|
+
taskId,
|
|
128
|
+
kind: options.artifactRole ?? artifactKind(runRelativePath),
|
|
129
|
+
relativePath: physicalPayloadPath,
|
|
130
|
+
contentHash,
|
|
131
|
+
bytes: Buffer.byteLength(content, 'utf8'),
|
|
132
|
+
payload: { logicalRef: runRelativePath, physicalPayloadPath, storage: 'runtime.sqlite' }
|
|
133
|
+
});
|
|
134
|
+
return { absolutePath: `${getRuntimeStorePath(projectRoot)}#${runRelativePath}`, runRelativePath };
|
|
135
|
+
}
|
|
136
|
+
|
|
35
137
|
export async function readArtifact(projectRoot: string, runId: string, artifactRootRelativePath: string): Promise<string> {
|
|
36
138
|
const normalized = normalizeArtifactRootRelativePath(artifactRootRelativePath);
|
|
37
139
|
const runRelativePath = getRunRelativeArtifactPath(normalized);
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
140
|
+
const runScope = await resolveRunScope(projectRoot, runId);
|
|
141
|
+
const payload = await resolveRuntimeArtifactPayload(projectRoot, runId, runRelativePath)
|
|
142
|
+
?? await resolveRuntimeArtifactPayload(projectRoot, runId, runtimeStageEvidenceRef(runScope.branchSlug, normalized));
|
|
143
|
+
const payloadContent = runtimePayloadContent(payload);
|
|
144
|
+
if (payloadContent !== null) {
|
|
145
|
+
return payloadContent;
|
|
146
|
+
}
|
|
147
|
+
if (payload) {
|
|
148
|
+
if (isBranchStageEvidenceRef(payload.physicalPayloadPath)) {
|
|
149
|
+
return readFile(getBranchStageEvidencePathFromRef(projectRoot, payload.physicalPayloadPath), 'utf8');
|
|
150
|
+
}
|
|
151
|
+
return readFile(getEvidenceAttachmentPath(projectRoot, runScope.branchSlug, payload.physicalPayloadPath), 'utf8');
|
|
152
|
+
}
|
|
153
|
+
const stageEvidenceRef = runtimeStageEvidenceRef(runScope.branchSlug, normalized);
|
|
154
|
+
try {
|
|
155
|
+
return await readFile(getBranchStageEvidencePathFromRef(projectRoot, stageEvidenceRef), 'utf8');
|
|
156
|
+
} catch {
|
|
157
|
+
try {
|
|
158
|
+
return await readFile(getEvidenceAttachmentPath(projectRoot, runScope.branchSlug, runRelativePath), 'utf8');
|
|
159
|
+
} catch {
|
|
160
|
+
return readFile(getLegacyArtifactPath(projectRoot, runId, normalized), 'utf8');
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function runtimePayloadContent(payload: RuntimeArtifactPayloadRecord | null): string | null {
|
|
166
|
+
if (!payload || !payload.payload || typeof payload.payload !== 'object' || Array.isArray(payload.payload)) {
|
|
167
|
+
return null;
|
|
41
168
|
}
|
|
42
|
-
|
|
169
|
+
const content = (payload.payload as { content?: unknown }).content;
|
|
170
|
+
return typeof content === 'string' ? content : null;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function runtimeStageEvidenceRef(branch: string, artifactRootRelativePath: string): string {
|
|
174
|
+
const fileName = path.posix.basename(artifactRootRelativePath.replace(/\\/g, '/'));
|
|
175
|
+
return toBranchStageEvidenceRef(branch, runtimeStageForArtifact(fileName), fileName);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function runtimeStageForArtifact(fileName: string): SddStage {
|
|
179
|
+
if (fileName.startsWith('acceptance-coverage-')) {
|
|
180
|
+
return 'goal-verify';
|
|
181
|
+
}
|
|
182
|
+
if (fileName.startsWith('test-') || fileName.startsWith('validation-')) {
|
|
183
|
+
return 'test';
|
|
184
|
+
}
|
|
185
|
+
if (fileName.startsWith('ship-') || fileName.startsWith('release-')) {
|
|
186
|
+
return 'ship';
|
|
187
|
+
}
|
|
188
|
+
return 'do';
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function uniquePhysicalPayloadPath(logicalRef: string, runId: string, digest: string): string {
|
|
192
|
+
const parsed = path.posix.parse(logicalRef.replace(/\\/g, '/'));
|
|
193
|
+
const suffix = `${runId}-${digest.slice(0, 12)}`;
|
|
194
|
+
return path.posix.join(parsed.dir, `${parsed.name}-${suffix}${parsed.ext}`);
|
|
43
195
|
}
|
|
44
196
|
|
|
45
197
|
export function artifactKind(artifactPath: string): string {
|
|
@@ -53,15 +205,15 @@ export function artifactKind(artifactPath: string): string {
|
|
|
53
205
|
if (fileName.startsWith('debug-')) {
|
|
54
206
|
return 'debug';
|
|
55
207
|
}
|
|
208
|
+
if (fileName.startsWith('test-validation-')) {
|
|
209
|
+
return 'test-validation';
|
|
210
|
+
}
|
|
56
211
|
if (fileName.startsWith('validation-')) {
|
|
57
212
|
return 'validation';
|
|
58
213
|
}
|
|
59
214
|
if (fileName.startsWith('gap-report-')) {
|
|
60
215
|
return 'gap-report';
|
|
61
216
|
}
|
|
62
|
-
if (fileName === 'sync-back-proposal.md') {
|
|
63
|
-
return 'sync-back-proposal';
|
|
64
|
-
}
|
|
65
217
|
return 'artifact';
|
|
66
218
|
}
|
|
67
219
|
|
|
@@ -75,9 +227,12 @@ async function recordRuntimeArtifact(projectRoot: string, input: { runId: string
|
|
|
75
227
|
});
|
|
76
228
|
}
|
|
77
229
|
|
|
78
|
-
async function
|
|
230
|
+
async function resolveRunScope(projectRoot: string, runId: string): Promise<{ branchSlug: string; taskId: string | null }> {
|
|
79
231
|
const state = await readRuntimeRunState(projectRoot, runId);
|
|
80
|
-
return
|
|
232
|
+
return {
|
|
233
|
+
branchSlug: state?.gitBranch ?? state?.partition ?? 'unscoped',
|
|
234
|
+
taskId: state?.taskId ?? state?.currentTask ?? null
|
|
235
|
+
};
|
|
81
236
|
}
|
|
82
237
|
|
|
83
238
|
function hashDocumentContent(raw: string): string {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { EVENT_LOG_CONTRACT } from '../contracts.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getLegacyRunDir } from '../runtime-paths.js';
|
|
5
5
|
|
|
6
6
|
import { importLegacyRunEventsIfNeeded, readRuntimeRunEvents, recordRuntimeEvent } from '../storage/runtime-store.js';
|
|
7
7
|
import type { RuntimeEvent } from './model.js';
|
|
@@ -21,7 +21,7 @@ export async function readRunEvents(projectRoot: string, runId: string): Promise
|
|
|
21
21
|
if (storedEvents.length > 0) {
|
|
22
22
|
return storedEvents;
|
|
23
23
|
}
|
|
24
|
-
const eventPath = path.join(
|
|
24
|
+
const eventPath = path.join(getLegacyRunDir(projectRoot, runId), 'events.jsonl');
|
|
25
25
|
await importLegacyRunEventsIfNeeded(projectRoot, runId, eventPath);
|
|
26
26
|
return readRuntimeRunEvents(projectRoot, runId);
|
|
27
27
|
}
|