sdd-agent-platform 0.4.0 → 0.4.1
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 +18 -23
- package/node_modules/@sdd-agent-platform/core/dist/ai-tools.js +31 -28
- package/node_modules/@sdd-agent-platform/core/dist/ai-tools.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/init-project.js +3 -2
- package/node_modules/@sdd-agent-platform/core/dist/config/init-project.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.d.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.js +14 -5
- package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/contracts.d.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/contracts.js +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/contracts.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-evidence.js +3 -3
- 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/doctor.js +155 -1
- 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 +54 -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 -0
- 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/resident-worker.js +14 -6
- 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/instructions.js +36 -36
- package/node_modules/@sdd-agent-platform/core/dist/instructions.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.d.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.js +37 -17
- package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.d.ts +16 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.js +174 -16
- 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 +2 -2
- 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 +31 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/agent-runtime-static.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/registries/capability-sources.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/workflow-gates.js +5 -5
- package/node_modules/@sdd-agent-platform/core/dist/registries/workflow-gates.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime-config.js +27 -12
- 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 +59 -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 +191 -0
- 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 +32 -6
- package/node_modules/@sdd-agent-platform/core/dist/router/routing.js.map +1 -1
- 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/run-state/artifacts.js +48 -15
- 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 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.js +15 -49
- 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 +25 -1
- package/node_modules/@sdd-agent-platform/core/dist/run-state/run-state.js +21 -14
- 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 +62 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.js +130 -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.d.ts +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state.js +1 -0
- package/node_modules/@sdd-agent-platform/core/dist/run-state.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.d.ts +10 -0
- package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.js +44 -14
- package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.js.map +1 -1
- 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 +4 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.js +189 -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.js +12 -3
- 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 +20 -0
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.js +101 -21
- package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/status/project-status.d.ts +62 -1
- package/node_modules/@sdd-agent-platform/core/dist/status/project-status.js +192 -4
- 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 +195 -2
- package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.js +499 -2
- package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.js +23 -1
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.d.ts +19 -0
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.js +114 -12
- package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.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.js +16 -2
- package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.js.map +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.js +34 -2
- 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.js +15 -5
- 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.js +102 -9
- 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 +16 -1
- package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.js +355 -69
- 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-wave.d.ts +58 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.js +428 -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 +2 -0
- package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.js +116 -18
- 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/workflow-gate/evidence-packet.d.ts +24 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.js +182 -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 +130 -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 +146 -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 +89 -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 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.js +16 -1
- 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 +38 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.js +122 -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/resolve.d.ts +27 -0
- package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.js +166 -37
- 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.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 +1 -1
- package/node_modules/@sdd-agent-platform/core/src/ai-tools.ts +31 -28
- package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-result.test.ts +50 -4
- package/node_modules/@sdd-agent-platform/core/src/config/init-project.test.ts +13 -10
- package/node_modules/@sdd-agent-platform/core/src/config/init-project.ts +3 -2
- package/node_modules/@sdd-agent-platform/core/src/config/starter-documents.ts +15 -5
- package/node_modules/@sdd-agent-platform/core/src/contracts.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/doctor/checks/run-evidence.ts +3 -3
- package/node_modules/@sdd-agent-platform/core/src/doctor/doctor.test.ts +117 -5
- package/node_modules/@sdd-agent-platform/core/src/doctor/doctor.ts +164 -1
- package/node_modules/@sdd-agent-platform/core/src/evidence/lookup.ts +80 -0
- package/node_modules/@sdd-agent-platform/core/src/evidence-runtime/contracts.ts +12 -0
- 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 +7 -0
- package/node_modules/@sdd-agent-platform/core/src/execution/resident-worker.test.ts +5 -0
- package/node_modules/@sdd-agent-platform/core/src/execution/resident-worker.ts +14 -6
- 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 +4 -0
- package/node_modules/@sdd-agent-platform/core/src/governance/policy.test.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/instructions.test.ts +11 -5
- package/node_modules/@sdd-agent-platform/core/src/instructions.ts +36 -36
- package/node_modules/@sdd-agent-platform/core/src/lifecycle/ship.ts +39 -17
- package/node_modules/@sdd-agent-platform/core/src/phase8-contracts.test.ts +3 -2
- package/node_modules/@sdd-agent-platform/core/src/phase8-risk-kernel.test.ts +5 -0
- 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 +269 -17
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-registry.ts +2 -2
- package/node_modules/@sdd-agent-platform/core/src/registries/agent-runtime-static.ts +41 -1
- package/node_modules/@sdd-agent-platform/core/src/registries/capability-sources.ts +238 -15
- package/node_modules/@sdd-agent-platform/core/src/registries/registries.test.ts +27 -2
- package/node_modules/@sdd-agent-platform/core/src/registries/workflow-gates.ts +5 -5
- package/node_modules/@sdd-agent-platform/core/src/router/agent-runtime-config.ts +31 -12
- package/node_modules/@sdd-agent-platform/core/src/router/agent-runtime.ts +66 -1
- package/node_modules/@sdd-agent-platform/core/src/router/route-projection.ts +211 -0
- package/node_modules/@sdd-agent-platform/core/src/router/route-sdd-task.test.ts +151 -3
- package/node_modules/@sdd-agent-platform/core/src/router/routing.ts +35 -6
- 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/run-state/artifacts.ts +48 -15
- 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 +17 -52
- 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 +28 -1
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-state.test.ts +3 -0
- package/node_modules/@sdd-agent-platform/core/src/run-state/run-state.ts +22 -18
- package/node_modules/@sdd-agent-platform/core/src/run-state/task-evidence.ts +206 -0
- package/node_modules/@sdd-agent-platform/core/src/run-state.ts +1 -0
- package/node_modules/@sdd-agent-platform/core/src/runtime-paths.ts +54 -14
- 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 +207 -0
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/run-binding.ts +12 -3
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.test.ts +139 -0
- package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.ts +137 -24
- package/node_modules/@sdd-agent-platform/core/src/status/project-status.ts +268 -5
- package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.test.ts +368 -4
- package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.ts +697 -2
- package/node_modules/@sdd-agent-platform/core/src/sync-back/apply.ts +23 -1
- package/node_modules/@sdd-agent-platform/core/src/sync-back/inspect.ts +145 -12
- package/node_modules/@sdd-agent-platform/core/src/sync-back/sync-back.test.ts +132 -9
- 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 +16 -2
- package/node_modules/@sdd-agent-platform/core/src/verification/goal-verify.test.ts +1 -1
- package/node_modules/@sdd-agent-platform/core/src/verification/goal-verify.ts +38 -5
- package/node_modules/@sdd-agent-platform/core/src/verification/rendering.ts +15 -5
- package/node_modules/@sdd-agent-platform/core/src/verification/review-gate.test.ts +77 -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 +64 -4
- package/node_modules/@sdd-agent-platform/core/src/verification/single-task-loop.ts +110 -12
- package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.test.ts +72 -25
- package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.ts +402 -77
- package/node_modules/@sdd-agent-platform/core/src/verification/validation-wave.test.ts +341 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/validation-wave.ts +513 -0
- package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.test.ts +144 -5
- package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.ts +129 -18
- package/node_modules/@sdd-agent-platform/core/src/verification.ts +2 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/evidence-packet.ts +196 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.test.ts +171 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.ts +143 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.test.ts +137 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.ts +155 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-gate/types.ts +114 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/affected-file-conflicts.ts +18 -1
- 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 +156 -0
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve.test.ts +351 -2
- package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve.ts +227 -39
- package/node_modules/@sdd-agent-platform/core/src/workflow-state.ts +1 -0
- package/package.json +1 -1
- package/packages/cli/dist/commands/status.js +2 -2
- package/packages/cli/dist/commands/status.js.map +1 -1
- package/packages/cli/dist/commands/sync-back.js +1 -1
- package/packages/cli/dist/commands/sync-back.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 +94 -5
- package/packages/cli/dist/commands/test.js.map +1 -1
- package/packages/cli/dist/commands/verifies.js +5 -3
- package/packages/cli/dist/commands/verifies.js.map +1 -1
- package/packages/cli/dist/commands/verify.js +48 -7
- package/packages/cli/dist/commands/verify.js.map +1 -1
- package/packages/cli/dist/help.js +32 -18
- package/packages/cli/dist/help.js.map +1 -1
- package/packages/cli/dist/renderers/artifacts.js +1 -1
- package/packages/cli/dist/renderers/artifacts.js.map +1 -1
- package/packages/cli/dist/renderers/registry-runtime.js +7 -2
- package/packages/cli/dist/renderers/registry-runtime.js.map +1 -1
- package/packages/cli/dist/renderers/router.js +4 -2
- package/packages/cli/dist/renderers/router.js.map +1 -1
- package/packages/cli/dist/renderers/workflow.js +33 -12
- package/packages/cli/dist/renderers/workflow.js.map +1 -1
- package/packages/cli/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/cli/package.json +2 -2
- package/packages/core/dist/ai-tools.js +31 -28
- package/packages/core/dist/ai-tools.js.map +1 -1
- package/packages/core/dist/config/init-project.js +3 -2
- package/packages/core/dist/config/init-project.js.map +1 -1
- package/packages/core/dist/config/starter-documents.d.ts +1 -1
- package/packages/core/dist/config/starter-documents.js +14 -5
- package/packages/core/dist/config/starter-documents.js.map +1 -1
- package/packages/core/dist/contracts.d.ts +2 -0
- package/packages/core/dist/contracts.js +2 -0
- package/packages/core/dist/contracts.js.map +1 -1
- package/packages/core/dist/doctor/checks/run-evidence.js +3 -3
- package/packages/core/dist/doctor/checks/run-evidence.js.map +1 -1
- package/packages/core/dist/doctor/doctor.js +155 -1
- 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 +54 -0
- package/packages/core/dist/evidence/lookup.js.map +1 -0
- package/packages/core/dist/evidence-runtime/contracts.d.ts +11 -0
- 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/resident-worker.js +14 -6
- 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/instructions.js +36 -36
- package/packages/core/dist/instructions.js.map +1 -1
- package/packages/core/dist/lifecycle/ship.d.ts +2 -0
- package/packages/core/dist/lifecycle/ship.js +37 -17
- package/packages/core/dist/lifecycle/ship.js.map +1 -1
- package/packages/core/dist/registries/agent-capability-catalog.d.ts +16 -1
- package/packages/core/dist/registries/agent-capability-catalog.js +174 -16
- package/packages/core/dist/registries/agent-capability-catalog.js.map +1 -1
- package/packages/core/dist/registries/agent-registry.js +2 -2
- 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 +31 -1
- 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/workflow-gates.js +5 -5
- package/packages/core/dist/registries/workflow-gates.js.map +1 -1
- package/packages/core/dist/router/agent-runtime-config.js +27 -12
- package/packages/core/dist/router/agent-runtime-config.js.map +1 -1
- package/packages/core/dist/router/agent-runtime.d.ts +59 -1
- package/packages/core/dist/router/route-projection.d.ts +3 -1
- package/packages/core/dist/router/route-projection.js +191 -0
- package/packages/core/dist/router/route-projection.js.map +1 -1
- package/packages/core/dist/router/routing.js +32 -6
- package/packages/core/dist/router/routing.js.map +1 -1
- 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/run-state/artifacts.js +48 -15
- 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 -1
- package/packages/core/dist/run-state/inspect-run.js +15 -49
- 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 +25 -1
- package/packages/core/dist/run-state/run-state.js +21 -14
- package/packages/core/dist/run-state/run-state.js.map +1 -1
- package/packages/core/dist/run-state/task-evidence.d.ts +62 -0
- package/packages/core/dist/run-state/task-evidence.js +130 -0
- package/packages/core/dist/run-state/task-evidence.js.map +1 -0
- package/packages/core/dist/run-state.d.ts +1 -0
- package/packages/core/dist/run-state.js +1 -0
- package/packages/core/dist/run-state.js.map +1 -1
- package/packages/core/dist/runtime-paths.d.ts +10 -0
- package/packages/core/dist/runtime-paths.js +44 -14
- package/packages/core/dist/runtime-paths.js.map +1 -1
- 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 +4 -0
- package/packages/core/dist/sdd-docs/document-hashes.js +189 -0
- package/packages/core/dist/sdd-docs/document-hashes.js.map +1 -0
- package/packages/core/dist/sdd-docs/run-binding.js +12 -3
- package/packages/core/dist/sdd-docs/run-binding.js.map +1 -1
- package/packages/core/dist/sdd-docs/task-parser.d.ts +20 -0
- package/packages/core/dist/sdd-docs/task-parser.js +101 -21
- package/packages/core/dist/sdd-docs/task-parser.js.map +1 -1
- package/packages/core/dist/status/project-status.d.ts +62 -1
- package/packages/core/dist/status/project-status.js +192 -4
- package/packages/core/dist/status/project-status.js.map +1 -1
- package/packages/core/dist/storage/runtime-store.d.ts +195 -2
- package/packages/core/dist/storage/runtime-store.js +499 -2
- package/packages/core/dist/storage/runtime-store.js.map +1 -1
- package/packages/core/dist/sync-back/apply.js +23 -1
- package/packages/core/dist/sync-back/apply.js.map +1 -1
- package/packages/core/dist/sync-back/inspect.d.ts +19 -0
- package/packages/core/dist/sync-back/inspect.js +114 -12
- package/packages/core/dist/sync-back/inspect.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.js +16 -2
- package/packages/core/dist/test-support/run-state.js.map +1 -1
- package/packages/core/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/core/dist/verification/goal-verify.js +34 -2
- package/packages/core/dist/verification/goal-verify.js.map +1 -1
- package/packages/core/dist/verification/rendering.js +15 -5
- 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.js +102 -9
- package/packages/core/dist/verification/single-task-loop.js.map +1 -1
- package/packages/core/dist/verification/test-runtime.d.ts +16 -1
- package/packages/core/dist/verification/test-runtime.js +355 -69
- package/packages/core/dist/verification/test-runtime.js.map +1 -1
- package/packages/core/dist/verification/validation-wave.d.ts +58 -0
- package/packages/core/dist/verification/validation-wave.js +428 -0
- package/packages/core/dist/verification/validation-wave.js.map +1 -0
- package/packages/core/dist/verification/verify-contract.d.ts +2 -0
- package/packages/core/dist/verification/verify-contract.js +116 -18
- 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/workflow-gate/evidence-packet.d.ts +24 -0
- package/packages/core/dist/workflow-gate/evidence-packet.js +182 -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 +130 -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 +146 -0
- package/packages/core/dist/workflow-gate/policy.js.map +1 -0
- package/packages/core/dist/workflow-gate/types.d.ts +89 -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 -0
- package/packages/core/dist/workflow-state/affected-file-conflicts.js +16 -1
- 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 +38 -0
- package/packages/core/dist/workflow-state/latest-eligible-run.js +122 -0
- package/packages/core/dist/workflow-state/latest-eligible-run.js.map +1 -0
- package/packages/core/dist/workflow-state/resolve.d.ts +27 -0
- package/packages/core/dist/workflow-state/resolve.js +166 -37
- package/packages/core/dist/workflow-state/resolve.js.map +1 -1
- 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 +1 -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, sync-back, 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', 'sync-back', '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') {
|
|
@@ -1,16 +1,17 @@
|
|
|
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 { exists } from '../storage/json-io.js';
|
|
4
|
+
import { getEvidenceAttachmentPath, getLegacyArtifactPath, getRunRelativeArtifactPath, normalizeArtifactRootRelativePath } from '../runtime-paths.js';
|
|
5
|
+
import { readRuntimeRunState, recordRuntimeArtifactPayload, recordRuntimeEvidenceAttachment, resolveRuntimeArtifactPayload, runtimeScopedId, withRuntimeStore } from '../storage/runtime-store.js';
|
|
7
6
|
import { appendArtifactHashLedgerEntry } from './invocation-ledger.js';
|
|
8
7
|
|
|
9
8
|
export async function writeArtifact(projectRoot: string, runId: string, artifactRootRelativePath: string, content: string): Promise<{ absolutePath: string; runRelativePath: string }> {
|
|
10
9
|
const normalized = normalizeArtifactRootRelativePath(artifactRootRelativePath);
|
|
11
10
|
const runRelativePath = getRunRelativeArtifactPath(normalized);
|
|
12
|
-
const
|
|
13
|
-
const
|
|
11
|
+
const runScope = await resolveRunScope(projectRoot, runId);
|
|
12
|
+
const contentHash = hashDocumentContent(content);
|
|
13
|
+
const physicalPayloadPath = uniquePhysicalPayloadPath(runRelativePath, runId, contentHash);
|
|
14
|
+
const absolutePath = getEvidenceAttachmentPath(projectRoot, runScope.branchSlug, physicalPayloadPath);
|
|
14
15
|
await mkdir(path.dirname(absolutePath), { recursive: true });
|
|
15
16
|
await writeFile(absolutePath, content, 'utf8');
|
|
16
17
|
await appendArtifactHashLedgerEntry(projectRoot, {
|
|
@@ -19,15 +20,29 @@ export async function writeArtifact(projectRoot: string, runId: string, artifact
|
|
|
19
20
|
content,
|
|
20
21
|
status: 'written'
|
|
21
22
|
});
|
|
22
|
-
await recordRuntimeArtifact(projectRoot, { runId, path: runRelativePath, content, status: 'written' });
|
|
23
|
+
await recordRuntimeArtifact(projectRoot, { runId, path: runRelativePath, content, status: 'written', taskId: runScope.taskId });
|
|
24
|
+
await recordRuntimeArtifactPayload(projectRoot, {
|
|
25
|
+
payloadId: runtimeScopedId(runId, runRelativePath, contentHash),
|
|
26
|
+
runId,
|
|
27
|
+
sourceRunId: runId,
|
|
28
|
+
branchSlug: runScope.branchSlug,
|
|
29
|
+
taskId: runScope.taskId,
|
|
30
|
+
logicalRef: runRelativePath,
|
|
31
|
+
physicalPayloadPath,
|
|
32
|
+
artifactRole: artifactKind(runRelativePath),
|
|
33
|
+
digest: contentHash,
|
|
34
|
+
status: 'active',
|
|
35
|
+
payload: { logicalRef: runRelativePath, physicalPayloadPath, artifactPath: runRelativePath, status: 'written' }
|
|
36
|
+
});
|
|
23
37
|
await recordRuntimeEvidenceAttachment(projectRoot, {
|
|
24
|
-
branchSlug,
|
|
38
|
+
branchSlug: runScope.branchSlug,
|
|
25
39
|
runId,
|
|
40
|
+
taskId: runScope.taskId,
|
|
26
41
|
kind: artifactKind(runRelativePath),
|
|
27
|
-
relativePath:
|
|
28
|
-
contentHash
|
|
42
|
+
relativePath: physicalPayloadPath,
|
|
43
|
+
contentHash,
|
|
29
44
|
bytes: Buffer.byteLength(content, 'utf8'),
|
|
30
|
-
payload: {
|
|
45
|
+
payload: { logicalRef: runRelativePath, physicalPayloadPath, status: 'written' }
|
|
31
46
|
});
|
|
32
47
|
return { absolutePath, runRelativePath };
|
|
33
48
|
}
|
|
@@ -35,11 +50,23 @@ export async function writeArtifact(projectRoot: string, runId: string, artifact
|
|
|
35
50
|
export async function readArtifact(projectRoot: string, runId: string, artifactRootRelativePath: string): Promise<string> {
|
|
36
51
|
const normalized = normalizeArtifactRootRelativePath(artifactRootRelativePath);
|
|
37
52
|
const runRelativePath = getRunRelativeArtifactPath(normalized);
|
|
38
|
-
const
|
|
39
|
-
|
|
53
|
+
const payload = await resolveRuntimeArtifactPayload(projectRoot, runId, runRelativePath);
|
|
54
|
+
const runScope = await resolveRunScope(projectRoot, runId);
|
|
55
|
+
const evidencePath = getEvidenceAttachmentPath(projectRoot, runScope.branchSlug, payload?.physicalPayloadPath ?? runRelativePath);
|
|
56
|
+
if (payload) {
|
|
40
57
|
return readFile(evidencePath, 'utf8');
|
|
41
58
|
}
|
|
42
|
-
|
|
59
|
+
try {
|
|
60
|
+
return await readFile(evidencePath, 'utf8');
|
|
61
|
+
} catch {
|
|
62
|
+
return readFile(getLegacyArtifactPath(projectRoot, runId, normalized), 'utf8');
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function uniquePhysicalPayloadPath(logicalRef: string, runId: string, digest: string): string {
|
|
67
|
+
const parsed = path.posix.parse(logicalRef.replace(/\\/g, '/'));
|
|
68
|
+
const suffix = `${runId}-${digest.slice(0, 12)}`;
|
|
69
|
+
return path.posix.join(parsed.dir, `${parsed.name}-${suffix}${parsed.ext}`);
|
|
43
70
|
}
|
|
44
71
|
|
|
45
72
|
export function artifactKind(artifactPath: string): string {
|
|
@@ -53,6 +80,9 @@ export function artifactKind(artifactPath: string): string {
|
|
|
53
80
|
if (fileName.startsWith('debug-')) {
|
|
54
81
|
return 'debug';
|
|
55
82
|
}
|
|
83
|
+
if (fileName.startsWith('test-validation-')) {
|
|
84
|
+
return 'test-validation';
|
|
85
|
+
}
|
|
56
86
|
if (fileName.startsWith('validation-')) {
|
|
57
87
|
return 'validation';
|
|
58
88
|
}
|
|
@@ -75,9 +105,12 @@ async function recordRuntimeArtifact(projectRoot: string, input: { runId: string
|
|
|
75
105
|
});
|
|
76
106
|
}
|
|
77
107
|
|
|
78
|
-
async function
|
|
108
|
+
async function resolveRunScope(projectRoot: string, runId: string): Promise<{ branchSlug: string; taskId: string | null }> {
|
|
79
109
|
const state = await readRuntimeRunState(projectRoot, runId);
|
|
80
|
-
return
|
|
110
|
+
return {
|
|
111
|
+
branchSlug: state?.gitBranch ?? state?.partition ?? 'unscoped',
|
|
112
|
+
taskId: state?.taskId ?? state?.currentTask ?? null
|
|
113
|
+
};
|
|
81
114
|
}
|
|
82
115
|
|
|
83
116
|
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
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { readdir, readFile } from 'node:fs/promises';
|
|
2
|
-
import path from 'node:path';
|
|
3
1
|
import { TASK_RUN_EVIDENCE_CONTRACT_VERSION } from '../contracts.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { listAgentExecutionRecords as listRuntimeBackedAgentExecutionRecords, listTeamSessionRecords as listRuntimeBackedTeamSessionRecords } from '../execution/agent-execution-records.js';
|
|
3
|
+
import { listResidentWorkerRuntimeRecords as listRuntimeBackedResidentWorkerRuntimeRecords } from '../execution/resident-worker.js';
|
|
6
4
|
import type { ArtifactIndexEntry, InvocationLedgerEntry, RunState, RunStateArtifactIngestionRecord, RunStateWorktreeLifecycleRecord, RunStatus, RunSummary, RuntimeEvent } from './model.js';
|
|
7
5
|
import { readRunEvents } from './events.js';
|
|
8
6
|
import { listInvocationLedgerEntries } from './invocation-ledger.js';
|
|
9
7
|
import { readRunState, summarizeRunState } from './run-state.js';
|
|
8
|
+
import { readTaskEvidenceView, type TaskEvidenceView } from './task-evidence.js';
|
|
10
9
|
|
|
11
10
|
export interface TaskRunEvidenceGap {
|
|
12
11
|
type: string;
|
|
@@ -26,7 +25,7 @@ export interface AgentExecutionRecordView {
|
|
|
26
25
|
artifacts: string[];
|
|
27
26
|
toolPermission: { profile?: string } | null;
|
|
28
27
|
routeId: string;
|
|
29
|
-
routeDecision: { recommendedProfile?: string };
|
|
28
|
+
routeDecision: { recommendedProfile?: string | null };
|
|
30
29
|
createdAt: string;
|
|
31
30
|
[key: string]: unknown;
|
|
32
31
|
}
|
|
@@ -84,6 +83,7 @@ export interface RunInspection {
|
|
|
84
83
|
syncBack: RunState['syncBack'];
|
|
85
84
|
tasks: Record<string, unknown>;
|
|
86
85
|
taskRunEvidence: TaskRunEvidenceContract;
|
|
86
|
+
taskEvidenceView: TaskEvidenceView | null;
|
|
87
87
|
agentExecutions: AgentExecutionRecordView[];
|
|
88
88
|
invocationLedger: InvocationLedgerEntry[];
|
|
89
89
|
teamSessions: TeamSessionRecordView[];
|
|
@@ -94,11 +94,15 @@ export async function inspectRun(projectRoot: string, runId: string): Promise<Ru
|
|
|
94
94
|
const state = await readRunState(projectRoot, runId);
|
|
95
95
|
const [events, agentExecutions, teamSessions, workerRuntimes, invocationLedger] = await Promise.all([
|
|
96
96
|
readRunEvents(projectRoot, runId),
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
listRuntimeBackedAgentExecutionRecords(projectRoot, runId),
|
|
98
|
+
listRuntimeBackedTeamSessionRecords(projectRoot, runId),
|
|
99
|
+
listRuntimeBackedResidentWorkerRuntimeRecords(projectRoot, runId),
|
|
100
100
|
listInvocationLedgerEntries(projectRoot, runId)
|
|
101
101
|
]);
|
|
102
|
+
const agentExecutionViews = agentExecutions.map((record) => ({ ...record }) as AgentExecutionRecordView);
|
|
103
|
+
const teamSessionViews = teamSessions.map((record) => ({ ...record }) as TeamSessionRecordView);
|
|
104
|
+
const workerRuntimeViews = workerRuntimes.map((record) => ({ ...record }) as ResidentWorkerRuntimeRecordView);
|
|
105
|
+
const taskEvidenceView = state.partition && state.taskId ? await readTaskEvidenceView(projectRoot, { branch: state.partition, taskId: state.taskId }) : null;
|
|
102
106
|
return {
|
|
103
107
|
summary: summarizeRunState(state),
|
|
104
108
|
state,
|
|
@@ -110,55 +114,16 @@ export async function inspectRun(projectRoot: string, runId: string): Promise<Ru
|
|
|
110
114
|
worktrees: Object.values(state.worktrees ?? {}),
|
|
111
115
|
validation: state.validation,
|
|
112
116
|
syncBack: state.syncBack,
|
|
113
|
-
taskRunEvidence: buildTaskRunEvidence(state, events,
|
|
117
|
+
taskRunEvidence: buildTaskRunEvidence(state, events, agentExecutionViews, teamSessionViews, workerRuntimeViews, invocationLedger),
|
|
118
|
+
taskEvidenceView,
|
|
114
119
|
tasks: state.tasks,
|
|
115
|
-
agentExecutions,
|
|
116
|
-
teamSessions,
|
|
117
|
-
workerRuntimes,
|
|
120
|
+
agentExecutions: agentExecutionViews,
|
|
121
|
+
teamSessions: teamSessionViews,
|
|
122
|
+
workerRuntimes: workerRuntimeViews,
|
|
118
123
|
invocationLedger
|
|
119
124
|
};
|
|
120
125
|
}
|
|
121
126
|
|
|
122
|
-
async function listAgentExecutionRecords(projectRoot: string, runId: string): Promise<AgentExecutionRecordView[]> {
|
|
123
|
-
const recordsDir = getAgentExecutionsDir(projectRoot, runId);
|
|
124
|
-
if (!await exists(recordsDir)) {
|
|
125
|
-
return [];
|
|
126
|
-
}
|
|
127
|
-
const records = await readJsonRecords<AgentExecutionRecordView>(recordsDir);
|
|
128
|
-
return records.sort((left, right) => left.createdAt.localeCompare(right.createdAt) || left.executionId.localeCompare(right.executionId));
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
async function listTeamSessionRecords(projectRoot: string, runId: string): Promise<TeamSessionRecordView[]> {
|
|
132
|
-
const recordsDir = getTeamSessionsDir(projectRoot, runId);
|
|
133
|
-
if (!await exists(recordsDir)) {
|
|
134
|
-
return [];
|
|
135
|
-
}
|
|
136
|
-
const records = await readJsonRecords<TeamSessionRecordView>(recordsDir);
|
|
137
|
-
return records.sort((left, right) => left.createdAt.localeCompare(right.createdAt) || left.teamId.localeCompare(right.teamId));
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
async function listResidentWorkerRuntimeRecords(projectRoot: string, runId: string): Promise<ResidentWorkerRuntimeRecordView[]> {
|
|
141
|
-
const recordsDir = getWorkerRuntimesDir(projectRoot, runId);
|
|
142
|
-
if (!await exists(recordsDir)) {
|
|
143
|
-
return [];
|
|
144
|
-
}
|
|
145
|
-
const records = await readJsonRecords<ResidentWorkerRuntimeRecordView>(recordsDir);
|
|
146
|
-
return records.sort((left, right) => left.updatedAt.localeCompare(right.updatedAt) || left.runtimeId.localeCompare(right.runtimeId));
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
async function readJsonRecords<T>(recordsDir: string): Promise<T[]> {
|
|
150
|
-
const entries = await readdir(recordsDir, { withFileTypes: true });
|
|
151
|
-
const records: T[] = [];
|
|
152
|
-
for (const entry of entries.filter((candidate) => candidate.isFile() && candidate.name.endsWith('.json'))) {
|
|
153
|
-
try {
|
|
154
|
-
const raw = await readFile(path.join(recordsDir, entry.name), 'utf8');
|
|
155
|
-
records.push(JSON.parse(raw) as T);
|
|
156
|
-
} catch {
|
|
157
|
-
continue;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
return records;
|
|
161
|
-
}
|
|
162
127
|
|
|
163
128
|
function buildTaskRunEvidence(state: RunState, events: RuntimeEvent[], agentExecutions: AgentExecutionRecordView[] = [], teamSessions: TeamSessionRecordView[] = [], workerRuntimes: ResidentWorkerRuntimeRecordView[] = [], invocationLedger: InvocationLedgerEntry[] = []): TaskRunEvidenceContract {
|
|
164
129
|
return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
2
|
import { readFile } from 'node:fs/promises';
|
|
3
3
|
import { INVOCATION_LEDGER_CONTRACT_VERSION } from '../contracts.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getLegacyInvocationLedgerPath } from '../runtime-paths.js';
|
|
5
5
|
import { exists } from '../storage/json-io.js';
|
|
6
6
|
import { RuntimeStoreError, legacyImportId, readRuntimeActivities, recordLegacyImportFailure, recordRuntimeActivity, withRuntimeStore } from '../storage/runtime-store.js';
|
|
7
7
|
import type { InvocationLedgerEntry } from './model.js';
|
|
@@ -24,7 +24,7 @@ export async function listInvocationLedgerEntries(projectRoot: string, runId: st
|
|
|
24
24
|
if (entries.length > 0) {
|
|
25
25
|
return entries;
|
|
26
26
|
}
|
|
27
|
-
const ledgerPath =
|
|
27
|
+
const ledgerPath = getLegacyInvocationLedgerPath(projectRoot, runId);
|
|
28
28
|
await importLegacyInvocationLedgerIfNeeded(projectRoot, runId, ledgerPath);
|
|
29
29
|
return readRuntimeActivities(projectRoot, runId);
|
|
30
30
|
}
|
|
@@ -25,8 +25,13 @@ export interface RunDocumentSnapshot {
|
|
|
25
25
|
specHash: string | null;
|
|
26
26
|
planHash: string | null;
|
|
27
27
|
tasksHash: string | null;
|
|
28
|
+
specContractHash: string | null;
|
|
29
|
+
planContractHash: string | null;
|
|
30
|
+
tasksContractHash: string | null;
|
|
28
31
|
planBasedOnSpecHash: string | null;
|
|
29
32
|
tasksBasedOnPlanHash: string | null;
|
|
33
|
+
planBasedOnSpecContractHash: string | null;
|
|
34
|
+
tasksBasedOnPlanContractHash: string | null;
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
export interface RunStateContractValidationIssue {
|
|
@@ -117,6 +122,28 @@ export interface RunStateWorktreeLifecycleRecord {
|
|
|
117
122
|
dirty: boolean;
|
|
118
123
|
}
|
|
119
124
|
|
|
125
|
+
export type RunTaskImplementationStatus = 'not_started' | 'running' | 'implemented' | 'blocked' | 'failed';
|
|
126
|
+
|
|
127
|
+
export type RunTaskVerificationStatus = 'not_run' | 'pending_batch' | 'ready_for_validation' | 'running' | 'pass' | 'pass_with_gaps' | 'blocked' | 'failed';
|
|
128
|
+
|
|
129
|
+
export interface RunStateTaskRuntime {
|
|
130
|
+
status: string;
|
|
131
|
+
implementationStatus?: RunTaskImplementationStatus;
|
|
132
|
+
verificationStatus?: RunTaskVerificationStatus;
|
|
133
|
+
validationBatch?: string | null;
|
|
134
|
+
validationTiming?: 'task_end' | 'batch_end' | 'wave_end';
|
|
135
|
+
requiresVerifyBeforeNext?: boolean;
|
|
136
|
+
gaps?: unknown[];
|
|
137
|
+
artifacts?: string[];
|
|
138
|
+
testStatus?: string;
|
|
139
|
+
validationStatus?: string;
|
|
140
|
+
verifyStatus?: string;
|
|
141
|
+
workflowGateStatus?: string;
|
|
142
|
+
workflowGateDecisionId?: string;
|
|
143
|
+
evidence?: string[];
|
|
144
|
+
acceptanceCoverage?: unknown[];
|
|
145
|
+
}
|
|
146
|
+
|
|
120
147
|
export interface RunState {
|
|
121
148
|
contract: typeof RUN_STATE_CONTRACT;
|
|
122
149
|
runtimeVersion: typeof RUNTIME_VERSION;
|
|
@@ -136,7 +163,7 @@ export interface RunState {
|
|
|
136
163
|
eventLogPath: string;
|
|
137
164
|
artifactRoot: string;
|
|
138
165
|
lifecycleDecision: RunStateLifecycleDecisionRecord | null;
|
|
139
|
-
tasks: Record<string,
|
|
166
|
+
tasks: Record<string, RunStateTaskRuntime>;
|
|
140
167
|
agents: Record<string, unknown>;
|
|
141
168
|
delegations: Record<string, RunStateDelegationRecord>;
|
|
142
169
|
artifacts: ArtifactIndexEntry[];
|
|
@@ -8,6 +8,8 @@ import { initProject } from '../config/init-project.js';
|
|
|
8
8
|
import { readRunEvents } from './events.js';
|
|
9
9
|
import { createRun, listRuns, readRunState, writeRunState } from './run-state.js';
|
|
10
10
|
import { validTaskMarkdown, writeBranchDocs } from '../test-support/fixtures.js';
|
|
11
|
+
import { getRunDir } from '../runtime-paths.js';
|
|
12
|
+
import { exists } from '../storage/json-io.js';
|
|
11
13
|
|
|
12
14
|
test('createRun writes state and append-only events', async () => {
|
|
13
15
|
const root = await mkdtemp(path.join(tmpdir(), 'sdd-runtime-'));
|
|
@@ -21,6 +23,7 @@ test('createRun writes state and append-only events', async () => {
|
|
|
21
23
|
const events = await readRunEvents(root, state.runId);
|
|
22
24
|
assert.equal(events.some((event) => event.event === 'run_started'), true);
|
|
23
25
|
assert.equal(events.some((event) => event.event === 'lifecycle_decision_recorded'), true);
|
|
26
|
+
assert.equal(await exists(getRunDir(root, state.runId)), false);
|
|
24
27
|
} finally {
|
|
25
28
|
await rm(root, { recursive: true, force: true });
|
|
26
29
|
}
|
|
@@ -2,13 +2,10 @@ import { createHash } from 'node:crypto';
|
|
|
2
2
|
import { mkdir, readdir, readFile } from 'node:fs/promises';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import {
|
|
5
|
-
getAgentExecutionsDir,
|
|
6
5
|
getEvidenceDir,
|
|
6
|
+
getLegacyRunDir,
|
|
7
7
|
getProjectConfigPath,
|
|
8
|
-
|
|
9
|
-
getRunsDir,
|
|
10
|
-
getTeamSessionsDir,
|
|
11
|
-
getWorkerRuntimesDir
|
|
8
|
+
getRunsDir
|
|
12
9
|
} from '../runtime-paths.js';
|
|
13
10
|
import { exists } from '../storage/json-io.js';
|
|
14
11
|
import { RuntimeStoreError, legacyImportId, listRuntimeRunStates, readRuntimeRunState, recordLegacyImportFailure, runtimeScopedId, upsertRuntimeRunState, withRuntimeStore } from '../storage/runtime-store.js';
|
|
@@ -26,7 +23,7 @@ export async function readRunState(projectRoot: string, runId: string): Promise<
|
|
|
26
23
|
if (storedState) {
|
|
27
24
|
return normalizeRunState(storedState);
|
|
28
25
|
}
|
|
29
|
-
const statePath = path.join(
|
|
26
|
+
const statePath = path.join(getLegacyRunDir(projectRoot, runId), 'state.json');
|
|
30
27
|
const legacyState = await importLegacyRunStateIfNeeded(projectRoot, runId, statePath);
|
|
31
28
|
if (legacyState) {
|
|
32
29
|
return legacyState;
|
|
@@ -94,14 +91,6 @@ export async function createRun(projectRoot: string, options: CreateRunOptions =
|
|
|
94
91
|
await mkdir(getRunsDir(projectRoot), { recursive: true });
|
|
95
92
|
const runId = options.runId ?? await createUniqueRunId(projectRoot);
|
|
96
93
|
|
|
97
|
-
const agentExecutionsDir = getAgentExecutionsDir(projectRoot, runId);
|
|
98
|
-
const teamSessionsDir = getTeamSessionsDir(projectRoot, runId);
|
|
99
|
-
const workerRuntimesDir = getWorkerRuntimesDir(projectRoot, runId);
|
|
100
|
-
await Promise.all([
|
|
101
|
-
mkdir(agentExecutionsDir, { recursive: true }),
|
|
102
|
-
mkdir(teamSessionsDir, { recursive: true }),
|
|
103
|
-
mkdir(workerRuntimesDir, { recursive: true })
|
|
104
|
-
]);
|
|
105
94
|
|
|
106
95
|
const now = new Date().toISOString();
|
|
107
96
|
const state: RunState = {
|
|
@@ -175,7 +164,7 @@ export async function createUniqueRunId(projectRoot: string): Promise<string> {
|
|
|
175
164
|
for (let sequence = 1; sequence <= 999; sequence += 1) {
|
|
176
165
|
const runId = `${base}-${String(sequence).padStart(3, '0')}`;
|
|
177
166
|
const storedState = await readRuntimeRunState(projectRoot, runId);
|
|
178
|
-
if (!storedState && !await exists(
|
|
167
|
+
if (!storedState && !await exists(getLegacyRunDir(projectRoot, runId))) {
|
|
179
168
|
return runId;
|
|
180
169
|
}
|
|
181
170
|
}
|
|
@@ -261,8 +250,13 @@ export function normalizeRunDocumentSnapshot(snapshot: unknown): RunDocumentSnap
|
|
|
261
250
|
specHash: stringOrNull(snapshot.specHash),
|
|
262
251
|
planHash: stringOrNull(snapshot.planHash),
|
|
263
252
|
tasksHash: stringOrNull(snapshot.tasksHash),
|
|
253
|
+
specContractHash: stringOrNull(snapshot.specContractHash),
|
|
254
|
+
planContractHash: stringOrNull(snapshot.planContractHash),
|
|
255
|
+
tasksContractHash: stringOrNull(snapshot.tasksContractHash),
|
|
264
256
|
planBasedOnSpecHash: stringOrNull(snapshot.planBasedOnSpecHash),
|
|
265
|
-
tasksBasedOnPlanHash: stringOrNull(snapshot.tasksBasedOnPlanHash)
|
|
257
|
+
tasksBasedOnPlanHash: stringOrNull(snapshot.tasksBasedOnPlanHash),
|
|
258
|
+
planBasedOnSpecContractHash: stringOrNull(snapshot.planBasedOnSpecContractHash),
|
|
259
|
+
tasksBasedOnPlanContractHash: stringOrNull(snapshot.tasksBasedOnPlanContractHash)
|
|
266
260
|
};
|
|
267
261
|
}
|
|
268
262
|
|
|
@@ -271,8 +265,13 @@ export function emptyRunDocumentSnapshot(): RunDocumentSnapshot {
|
|
|
271
265
|
specHash: null,
|
|
272
266
|
planHash: null,
|
|
273
267
|
tasksHash: null,
|
|
268
|
+
specContractHash: null,
|
|
269
|
+
planContractHash: null,
|
|
270
|
+
tasksContractHash: null,
|
|
274
271
|
planBasedOnSpecHash: null,
|
|
275
|
-
tasksBasedOnPlanHash: null
|
|
272
|
+
tasksBasedOnPlanHash: null,
|
|
273
|
+
planBasedOnSpecContractHash: null,
|
|
274
|
+
tasksBasedOnPlanContractHash: null
|
|
276
275
|
};
|
|
277
276
|
}
|
|
278
277
|
|
|
@@ -324,8 +323,13 @@ async function resolveCreateRunScope(projectRoot: string, branch: string, taskId
|
|
|
324
323
|
specHash: model.documents.specHash ?? null,
|
|
325
324
|
planHash: model.documents.planHash ?? null,
|
|
326
325
|
tasksHash: model.documents.tasksHash ?? null,
|
|
326
|
+
specContractHash: model.documents.specContractHash ?? null,
|
|
327
|
+
planContractHash: model.documents.planContractHash ?? null,
|
|
328
|
+
tasksContractHash: model.documents.tasksContractHash ?? null,
|
|
327
329
|
planBasedOnSpecHash: model.documents.planBasedOnSpecHash ?? null,
|
|
328
|
-
tasksBasedOnPlanHash: model.documents.tasksBasedOnPlanHash ?? null
|
|
330
|
+
tasksBasedOnPlanHash: model.documents.tasksBasedOnPlanHash ?? null,
|
|
331
|
+
planBasedOnSpecContractHash: model.documents.planBasedOnSpecContractHash ?? null,
|
|
332
|
+
tasksBasedOnPlanContractHash: model.documents.tasksBasedOnPlanContractHash ?? null
|
|
329
333
|
}
|
|
330
334
|
};
|
|
331
335
|
}
|