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.
Files changed (801) hide show
  1. package/README.md +36 -39
  2. package/node_modules/@sdd-agent-platform/core/dist/ai-tools.js +72 -71
  3. package/node_modules/@sdd-agent-platform/core/dist/ai-tools.js.map +1 -1
  4. package/node_modules/@sdd-agent-platform/core/dist/artifacts/ingestion.js +64 -9
  5. package/node_modules/@sdd-agent-platform/core/dist/artifacts/ingestion.js.map +1 -1
  6. package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-evidence.js +0 -1
  7. package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-evidence.js.map +1 -1
  8. package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-result.js +26 -17
  9. package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-result.js.map +1 -1
  10. package/node_modules/@sdd-agent-platform/core/dist/config/init-project.d.ts +3 -0
  11. package/node_modules/@sdd-agent-platform/core/dist/config/init-project.js +13 -9
  12. package/node_modules/@sdd-agent-platform/core/dist/config/init-project.js.map +1 -1
  13. package/node_modules/@sdd-agent-platform/core/dist/config/project-config.d.ts +3 -1
  14. package/node_modules/@sdd-agent-platform/core/dist/config/project-config.js +7 -3
  15. package/node_modules/@sdd-agent-platform/core/dist/config/project-config.js.map +1 -1
  16. package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.d.ts +4 -4
  17. package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.js +16 -20
  18. package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.js.map +1 -1
  19. package/node_modules/@sdd-agent-platform/core/dist/context/build-package.d.ts +1 -1
  20. package/node_modules/@sdd-agent-platform/core/dist/context/build-package.js +1 -7
  21. package/node_modules/@sdd-agent-platform/core/dist/context/build-package.js.map +1 -1
  22. package/node_modules/@sdd-agent-platform/core/dist/context/evidence-summary.js +26 -8
  23. package/node_modules/@sdd-agent-platform/core/dist/context/evidence-summary.js.map +1 -1
  24. package/node_modules/@sdd-agent-platform/core/dist/context/log-worker.js +2 -2
  25. package/node_modules/@sdd-agent-platform/core/dist/context/log-worker.js.map +1 -1
  26. package/node_modules/@sdd-agent-platform/core/dist/context-offload/contracts.d.ts +1 -1
  27. package/node_modules/@sdd-agent-platform/core/dist/contracts.d.ts +4 -1
  28. package/node_modules/@sdd-agent-platform/core/dist/contracts.js +3 -0
  29. package/node_modules/@sdd-agent-platform/core/dist/contracts.js.map +1 -1
  30. package/node_modules/@sdd-agent-platform/core/dist/delegation/model.d.ts +3 -0
  31. package/node_modules/@sdd-agent-platform/core/dist/delegation/validation.d.ts +3 -0
  32. package/node_modules/@sdd-agent-platform/core/dist/delegation/validation.js +7 -4
  33. package/node_modules/@sdd-agent-platform/core/dist/delegation/validation.js.map +1 -1
  34. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/document-chain.js +1 -1
  35. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/document-chain.js.map +1 -1
  36. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/project.js +8 -8
  37. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/project.js.map +1 -1
  38. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/registries.js +0 -1
  39. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/registries.js.map +1 -1
  40. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-evidence.js +7 -7
  41. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-evidence.js.map +1 -1
  42. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-trust.js +0 -24
  43. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-trust.js.map +1 -1
  44. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/runtime-contracts.js +1 -1
  45. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/runtime-contracts.js.map +1 -1
  46. package/node_modules/@sdd-agent-platform/core/dist/doctor/doctor.js +277 -3
  47. package/node_modules/@sdd-agent-platform/core/dist/doctor/doctor.js.map +1 -1
  48. package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.d.ts +23 -0
  49. package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.js +61 -0
  50. package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.js.map +1 -0
  51. package/node_modules/@sdd-agent-platform/core/dist/evidence-runtime/contracts.d.ts +11 -1
  52. package/node_modules/@sdd-agent-platform/core/dist/execution/agent-execution-records.js +15 -8
  53. package/node_modules/@sdd-agent-platform/core/dist/execution/agent-execution-records.js.map +1 -1
  54. package/node_modules/@sdd-agent-platform/core/dist/execution/background-executor.js +4 -4
  55. package/node_modules/@sdd-agent-platform/core/dist/execution/background-executor.js.map +1 -1
  56. package/node_modules/@sdd-agent-platform/core/dist/execution/foreground-subagents.js +3 -3
  57. package/node_modules/@sdd-agent-platform/core/dist/execution/foreground-subagents.js.map +1 -1
  58. package/node_modules/@sdd-agent-platform/core/dist/execution/host-invocation.js +5 -4
  59. package/node_modules/@sdd-agent-platform/core/dist/execution/host-invocation.js.map +1 -1
  60. package/node_modules/@sdd-agent-platform/core/dist/execution/resident-worker.js +16 -7
  61. package/node_modules/@sdd-agent-platform/core/dist/execution/resident-worker.js.map +1 -1
  62. package/node_modules/@sdd-agent-platform/core/dist/execution/stage-team-runtime.d.ts +112 -0
  63. package/node_modules/@sdd-agent-platform/core/dist/execution/stage-team-runtime.js +145 -0
  64. package/node_modules/@sdd-agent-platform/core/dist/execution/stage-team-runtime.js.map +1 -0
  65. package/node_modules/@sdd-agent-platform/core/dist/governance/policy.d.ts +1 -1
  66. package/node_modules/@sdd-agent-platform/core/dist/governance/policy.js +1 -1
  67. package/node_modules/@sdd-agent-platform/core/dist/governance/policy.js.map +1 -1
  68. package/node_modules/@sdd-agent-platform/core/dist/instructions.d.ts +1 -1
  69. package/node_modules/@sdd-agent-platform/core/dist/instructions.js +59 -66
  70. package/node_modules/@sdd-agent-platform/core/dist/instructions.js.map +1 -1
  71. package/node_modules/@sdd-agent-platform/core/dist/lifecycle/decision-gate.js +1 -1
  72. package/node_modules/@sdd-agent-platform/core/dist/lifecycle/decision-gate.js.map +1 -1
  73. package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.d.ts +3 -0
  74. package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.js +55 -19
  75. package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.js.map +1 -1
  76. package/node_modules/@sdd-agent-platform/core/dist/orchestration/contracts.d.ts +1 -1
  77. package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.d.ts +12 -2
  78. package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.js +62 -21
  79. package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.js.map +1 -1
  80. package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.d.ts +20 -2
  81. package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.js +218 -18
  82. package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.js.map +1 -1
  83. package/node_modules/@sdd-agent-platform/core/dist/registries/agent-registry.js +17 -17
  84. package/node_modules/@sdd-agent-platform/core/dist/registries/agent-registry.js.map +1 -1
  85. package/node_modules/@sdd-agent-platform/core/dist/registries/agent-runtime-static.d.ts +10 -0
  86. package/node_modules/@sdd-agent-platform/core/dist/registries/agent-runtime-static.js +32 -2
  87. package/node_modules/@sdd-agent-platform/core/dist/registries/agent-runtime-static.js.map +1 -1
  88. package/node_modules/@sdd-agent-platform/core/dist/registries/capability-sources.d.ts +2 -17
  89. package/node_modules/@sdd-agent-platform/core/dist/registries/capability-sources.js +222 -10
  90. package/node_modules/@sdd-agent-platform/core/dist/registries/capability-sources.js.map +1 -1
  91. package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.d.ts +1 -1
  92. package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.js +9 -9
  93. package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.js.map +1 -1
  94. package/node_modules/@sdd-agent-platform/core/dist/registries/eval-learning-context.js +4 -4
  95. package/node_modules/@sdd-agent-platform/core/dist/registries/eval-learning-context.js.map +1 -1
  96. package/node_modules/@sdd-agent-platform/core/dist/registries/query-status.js +2 -2
  97. package/node_modules/@sdd-agent-platform/core/dist/registries/query-status.js.map +1 -1
  98. package/node_modules/@sdd-agent-platform/core/dist/registries/tool-capabilities.js +3 -3
  99. package/node_modules/@sdd-agent-platform/core/dist/registries/tool-capabilities.js.map +1 -1
  100. package/node_modules/@sdd-agent-platform/core/dist/registries/tool-plugins.js +2 -2
  101. package/node_modules/@sdd-agent-platform/core/dist/registries/tool-plugins.js.map +1 -1
  102. package/node_modules/@sdd-agent-platform/core/dist/registries/worker-adapters.js +11 -11
  103. package/node_modules/@sdd-agent-platform/core/dist/registries/worker-adapters.js.map +1 -1
  104. package/node_modules/@sdd-agent-platform/core/dist/registries/workflow-gates.js +12 -12
  105. package/node_modules/@sdd-agent-platform/core/dist/registries/workflow-gates.js.map +1 -1
  106. package/node_modules/@sdd-agent-platform/core/dist/risk/contracts.d.ts +2 -2
  107. package/node_modules/@sdd-agent-platform/core/dist/risk/kernel.js +4 -4
  108. package/node_modules/@sdd-agent-platform/core/dist/risk/kernel.js.map +1 -1
  109. package/node_modules/@sdd-agent-platform/core/dist/risk/legacy-adapters.js +4 -7
  110. package/node_modules/@sdd-agent-platform/core/dist/risk/legacy-adapters.js.map +1 -1
  111. package/node_modules/@sdd-agent-platform/core/dist/risk/workflow-gates.d.ts +2 -2
  112. package/node_modules/@sdd-agent-platform/core/dist/risk/workflow-gates.js +19 -17
  113. package/node_modules/@sdd-agent-platform/core/dist/risk/workflow-gates.js.map +1 -1
  114. package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime-config.js +28 -13
  115. package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime-config.js.map +1 -1
  116. package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime.d.ts +61 -1
  117. package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.d.ts +3 -1
  118. package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.js +192 -1
  119. package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.js.map +1 -1
  120. package/node_modules/@sdd-agent-platform/core/dist/router/routing.js +73 -17
  121. package/node_modules/@sdd-agent-platform/core/dist/router/routing.js.map +1 -1
  122. package/node_modules/@sdd-agent-platform/core/dist/router/runtime-import.d.ts +28 -0
  123. package/node_modules/@sdd-agent-platform/core/dist/router/runtime-import.js +373 -0
  124. package/node_modules/@sdd-agent-platform/core/dist/router/runtime-import.js.map +1 -0
  125. package/node_modules/@sdd-agent-platform/core/dist/router/runtime-inspection.js +11 -4
  126. package/node_modules/@sdd-agent-platform/core/dist/router/runtime-inspection.js.map +1 -1
  127. package/node_modules/@sdd-agent-platform/core/dist/router/runtime-validation.js +31 -3
  128. package/node_modules/@sdd-agent-platform/core/dist/router/runtime-validation.js.map +1 -1
  129. package/node_modules/@sdd-agent-platform/core/dist/router/stage-route-binding.d.ts +37 -0
  130. package/node_modules/@sdd-agent-platform/core/dist/router/stage-route-binding.js +235 -0
  131. package/node_modules/@sdd-agent-platform/core/dist/router/stage-route-binding.js.map +1 -0
  132. package/node_modules/@sdd-agent-platform/core/dist/router.d.ts +2 -0
  133. package/node_modules/@sdd-agent-platform/core/dist/router.js +2 -0
  134. package/node_modules/@sdd-agent-platform/core/dist/router.js.map +1 -1
  135. package/node_modules/@sdd-agent-platform/core/dist/run-state/artifacts.d.ts +16 -0
  136. package/node_modules/@sdd-agent-platform/core/dist/run-state/artifacts.js +168 -18
  137. package/node_modules/@sdd-agent-platform/core/dist/run-state/artifacts.js.map +1 -1
  138. package/node_modules/@sdd-agent-platform/core/dist/run-state/events.js +2 -2
  139. package/node_modules/@sdd-agent-platform/core/dist/run-state/events.js.map +1 -1
  140. package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.d.ts +3 -3
  141. package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.js +22 -54
  142. package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.js.map +1 -1
  143. package/node_modules/@sdd-agent-platform/core/dist/run-state/invocation-ledger.js +2 -2
  144. package/node_modules/@sdd-agent-platform/core/dist/run-state/invocation-ledger.js.map +1 -1
  145. package/node_modules/@sdd-agent-platform/core/dist/run-state/model.d.ts +53 -9
  146. package/node_modules/@sdd-agent-platform/core/dist/run-state/run-index.d.ts +0 -2
  147. package/node_modules/@sdd-agent-platform/core/dist/run-state/run-index.js +1 -3
  148. package/node_modules/@sdd-agent-platform/core/dist/run-state/run-index.js.map +1 -1
  149. package/node_modules/@sdd-agent-platform/core/dist/run-state/run-state.js +51 -34
  150. package/node_modules/@sdd-agent-platform/core/dist/run-state/run-state.js.map +1 -1
  151. package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.d.ts +65 -0
  152. package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.js +169 -0
  153. package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.js.map +1 -0
  154. package/node_modules/@sdd-agent-platform/core/dist/run-state/timing.d.ts +8 -0
  155. package/node_modules/@sdd-agent-platform/core/dist/run-state/timing.js +131 -0
  156. package/node_modules/@sdd-agent-platform/core/dist/run-state/timing.js.map +1 -0
  157. package/node_modules/@sdd-agent-platform/core/dist/run-state.d.ts +2 -0
  158. package/node_modules/@sdd-agent-platform/core/dist/run-state.js +2 -0
  159. package/node_modules/@sdd-agent-platform/core/dist/run-state.js.map +1 -1
  160. package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/build.js +0 -3
  161. package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/build.js.map +1 -1
  162. package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/findings.js +5 -44
  163. package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/findings.js.map +1 -1
  164. package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/model.d.ts +1 -17
  165. package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.d.ts +20 -0
  166. package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.js +109 -14
  167. package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.js.map +1 -1
  168. package/node_modules/@sdd-agent-platform/core/dist/runtime-projection-p0.d.ts +64 -0
  169. package/node_modules/@sdd-agent-platform/core/dist/runtime-projection-p0.js +200 -0
  170. package/node_modules/@sdd-agent-platform/core/dist/runtime-projection-p0.js.map +1 -0
  171. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/context.js +1 -1
  172. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/context.js.map +1 -1
  173. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.d.ts +6 -0
  174. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.js +276 -0
  175. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.js.map +1 -0
  176. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/run-binding.d.ts +1 -1
  177. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/run-binding.js +15 -4
  178. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/run-binding.js.map +1 -1
  179. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.d.ts +21 -0
  180. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.js +139 -38
  181. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.js.map +1 -1
  182. package/node_modules/@sdd-agent-platform/core/dist/stage-artifacts.d.ts +55 -0
  183. package/node_modules/@sdd-agent-platform/core/dist/stage-artifacts.js +322 -0
  184. package/node_modules/@sdd-agent-platform/core/dist/stage-artifacts.js.map +1 -0
  185. package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration-contracts.d.ts +55 -0
  186. package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration-contracts.js +241 -0
  187. package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration-contracts.js.map +1 -0
  188. package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration.d.ts +888 -0
  189. package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration.js +3870 -0
  190. package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration.js.map +1 -0
  191. package/node_modules/@sdd-agent-platform/core/dist/stage-runtime/runtime.js +8 -1
  192. package/node_modules/@sdd-agent-platform/core/dist/stage-runtime/runtime.js.map +1 -1
  193. package/node_modules/@sdd-agent-platform/core/dist/status/project-status.d.ts +105 -1
  194. package/node_modules/@sdd-agent-platform/core/dist/status/project-status.js +343 -8
  195. package/node_modules/@sdd-agent-platform/core/dist/status/project-status.js.map +1 -1
  196. package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.d.ts +348 -3
  197. package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.js +1017 -8
  198. package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.js.map +1 -1
  199. package/node_modules/@sdd-agent-platform/core/dist/subagents/contracts.d.ts +1 -1
  200. package/node_modules/@sdd-agent-platform/core/dist/subagents/runtime.js +7 -7
  201. package/node_modules/@sdd-agent-platform/core/dist/subagents/runtime.js.map +1 -1
  202. package/node_modules/@sdd-agent-platform/core/dist/test-support/fixtures.js +21 -0
  203. package/node_modules/@sdd-agent-platform/core/dist/test-support/fixtures.js.map +1 -1
  204. package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.d.ts +1 -1
  205. package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.js +19 -20
  206. package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.js.map +1 -1
  207. package/node_modules/@sdd-agent-platform/core/dist/truth-reconciliation.d.ts +44 -0
  208. package/node_modules/@sdd-agent-platform/core/dist/truth-reconciliation.js +138 -0
  209. package/node_modules/@sdd-agent-platform/core/dist/truth-reconciliation.js.map +1 -0
  210. package/node_modules/@sdd-agent-platform/core/dist/tsconfig.tsbuildinfo +1 -1
  211. package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.d.ts +0 -1
  212. package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.js +44 -37
  213. package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.js.map +1 -1
  214. package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.d.ts +0 -2
  215. package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.js +19 -49
  216. package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.js.map +1 -1
  217. package/node_modules/@sdd-agent-platform/core/dist/verification/review-gate.d.ts +22 -0
  218. package/node_modules/@sdd-agent-platform/core/dist/verification/review-gate.js +53 -0
  219. package/node_modules/@sdd-agent-platform/core/dist/verification/review-gate.js.map +1 -0
  220. package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.d.ts +0 -1
  221. package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.js +213 -111
  222. package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.js.map +1 -1
  223. package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.d.ts +28 -3
  224. package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.js +546 -125
  225. package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.js.map +1 -1
  226. package/node_modules/@sdd-agent-platform/core/dist/verification/validation-cache.d.ts +26 -0
  227. package/node_modules/@sdd-agent-platform/core/dist/verification/validation-cache.js +73 -0
  228. package/node_modules/@sdd-agent-platform/core/dist/verification/validation-cache.js.map +1 -0
  229. package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.d.ts +76 -0
  230. package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.js +450 -0
  231. package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.js.map +1 -0
  232. package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.d.ts +3 -1
  233. package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.js +105 -30
  234. package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.js.map +1 -1
  235. package/node_modules/@sdd-agent-platform/core/dist/verification.d.ts +2 -0
  236. package/node_modules/@sdd-agent-platform/core/dist/verification.js +2 -0
  237. package/node_modules/@sdd-agent-platform/core/dist/verification.js.map +1 -1
  238. package/node_modules/@sdd-agent-platform/core/dist/work-units/contracts.d.ts +1 -1
  239. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.d.ts +24 -0
  240. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.js +395 -0
  241. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.js.map +1 -0
  242. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.d.ts +4 -0
  243. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.js +164 -0
  244. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.js.map +1 -0
  245. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.d.ts +4 -0
  246. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.js +182 -0
  247. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.js.map +1 -0
  248. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/types.d.ts +88 -0
  249. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/types.js +2 -0
  250. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/types.js.map +1 -0
  251. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.d.ts +1 -1
  252. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.js +17 -3
  253. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.js.map +1 -1
  254. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/dependencies.d.ts +8 -4
  255. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/dependencies.js +25 -11
  256. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/dependencies.js.map +1 -1
  257. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.d.ts +37 -0
  258. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.js +188 -0
  259. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.js.map +1 -0
  260. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/migration-recovery.d.ts +40 -0
  261. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/migration-recovery.js +110 -0
  262. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/migration-recovery.js.map +1 -0
  263. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/repair-contract.d.ts +12 -0
  264. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/repair-contract.js +63 -0
  265. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/repair-contract.js.map +1 -0
  266. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve-task-run.d.ts +21 -0
  267. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve-task-run.js +95 -0
  268. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve-task-run.js.map +1 -0
  269. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.d.ts +80 -3
  270. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.js +674 -41
  271. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.js.map +1 -1
  272. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/runtime-projections.d.ts +228 -0
  273. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/runtime-projections.js +452 -0
  274. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/runtime-projections.js.map +1 -0
  275. package/node_modules/@sdd-agent-platform/core/dist/workflow-state.d.ts +1 -0
  276. package/node_modules/@sdd-agent-platform/core/dist/workflow-state.js +1 -0
  277. package/node_modules/@sdd-agent-platform/core/dist/workflow-state.js.map +1 -1
  278. package/node_modules/@sdd-agent-platform/core/package.json +3 -3
  279. package/node_modules/@sdd-agent-platform/core/src/ai-tools.test.ts +49 -1
  280. package/node_modules/@sdd-agent-platform/core/src/ai-tools.ts +72 -71
  281. package/node_modules/@sdd-agent-platform/core/src/artifacts/ingestion.test.ts +38 -0
  282. package/node_modules/@sdd-agent-platform/core/src/artifacts/ingestion.ts +65 -9
  283. package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-evidence.ts +0 -1
  284. package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-result.test.ts +52 -6
  285. package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-result.ts +26 -17
  286. package/node_modules/@sdd-agent-platform/core/src/config/init-project.test.ts +44 -29
  287. package/node_modules/@sdd-agent-platform/core/src/config/init-project.ts +15 -11
  288. package/node_modules/@sdd-agent-platform/core/src/config/project-config.ts +10 -4
  289. package/node_modules/@sdd-agent-platform/core/src/config/starter-documents.ts +17 -20
  290. package/node_modules/@sdd-agent-platform/core/src/context/build-package.ts +2 -8
  291. package/node_modules/@sdd-agent-platform/core/src/context/context-build.test.ts +3 -2
  292. package/node_modules/@sdd-agent-platform/core/src/context/evidence-summary.ts +27 -8
  293. package/node_modules/@sdd-agent-platform/core/src/context/log-worker.ts +2 -2
  294. package/node_modules/@sdd-agent-platform/core/src/context-offload/contracts.ts +1 -1
  295. package/node_modules/@sdd-agent-platform/core/src/contracts.ts +4 -1
  296. package/node_modules/@sdd-agent-platform/core/src/delegation/model.ts +3 -0
  297. package/node_modules/@sdd-agent-platform/core/src/delegation/validation.ts +8 -5
  298. package/node_modules/@sdd-agent-platform/core/src/doctor/checks/document-chain.ts +1 -1
  299. package/node_modules/@sdd-agent-platform/core/src/doctor/checks/project.ts +8 -8
  300. package/node_modules/@sdd-agent-platform/core/src/doctor/checks/registries.ts +0 -1
  301. package/node_modules/@sdd-agent-platform/core/src/doctor/checks/run-evidence.ts +7 -7
  302. package/node_modules/@sdd-agent-platform/core/src/doctor/checks/run-trust.ts +0 -21
  303. package/node_modules/@sdd-agent-platform/core/src/doctor/checks/runtime-contracts.ts +1 -1
  304. package/node_modules/@sdd-agent-platform/core/src/doctor/doctor.test.ts +217 -7
  305. package/node_modules/@sdd-agent-platform/core/src/doctor/doctor.ts +301 -3
  306. package/node_modules/@sdd-agent-platform/core/src/evidence/lookup.ts +88 -0
  307. package/node_modules/@sdd-agent-platform/core/src/evidence-runtime/contracts.ts +12 -1
  308. package/node_modules/@sdd-agent-platform/core/src/execution/agent-execution-records.ts +16 -11
  309. package/node_modules/@sdd-agent-platform/core/src/execution/background-executor.test.ts +57 -2
  310. package/node_modules/@sdd-agent-platform/core/src/execution/background-executor.ts +4 -4
  311. package/node_modules/@sdd-agent-platform/core/src/execution/foreground-subagents.test.ts +11 -2
  312. package/node_modules/@sdd-agent-platform/core/src/execution/foreground-subagents.ts +3 -3
  313. package/node_modules/@sdd-agent-platform/core/src/execution/host-invocation.ts +5 -4
  314. package/node_modules/@sdd-agent-platform/core/src/execution/resident-worker.test.ts +17 -1
  315. package/node_modules/@sdd-agent-platform/core/src/execution/resident-worker.ts +16 -7
  316. package/node_modules/@sdd-agent-platform/core/src/execution/stage-team-runtime.test.ts +102 -0
  317. package/node_modules/@sdd-agent-platform/core/src/execution/stage-team-runtime.ts +271 -0
  318. package/node_modules/@sdd-agent-platform/core/src/execution/wave-executor.test.ts +14 -0
  319. package/node_modules/@sdd-agent-platform/core/src/governance/policy.test.ts +10 -0
  320. package/node_modules/@sdd-agent-platform/core/src/governance/policy.ts +2 -2
  321. package/node_modules/@sdd-agent-platform/core/src/instructions.test.ts +34 -13
  322. package/node_modules/@sdd-agent-platform/core/src/instructions.ts +60 -67
  323. package/node_modules/@sdd-agent-platform/core/src/lifecycle/decision-gate.test.ts +1 -1
  324. package/node_modules/@sdd-agent-platform/core/src/lifecycle/decision-gate.ts +1 -1
  325. package/node_modules/@sdd-agent-platform/core/src/lifecycle/ship.test.ts +47 -0
  326. package/node_modules/@sdd-agent-platform/core/src/lifecycle/ship.ts +58 -19
  327. package/node_modules/@sdd-agent-platform/core/src/orchestration/contracts.ts +1 -1
  328. package/node_modules/@sdd-agent-platform/core/src/orchestration/runtime.ts +74 -22
  329. package/node_modules/@sdd-agent-platform/core/src/phase8-contracts.test.ts +3 -3
  330. package/node_modules/@sdd-agent-platform/core/src/phase8-risk-kernel.test.ts +8 -3
  331. package/node_modules/@sdd-agent-platform/core/src/planning/task-graph.test.ts +2 -0
  332. package/node_modules/@sdd-agent-platform/core/src/planning/wave-plan.test.ts +3 -0
  333. package/node_modules/@sdd-agent-platform/core/src/registries/agent-capability-catalog.ts +319 -20
  334. package/node_modules/@sdd-agent-platform/core/src/registries/agent-registry.ts +17 -17
  335. package/node_modules/@sdd-agent-platform/core/src/registries/agent-runtime-static.ts +42 -2
  336. package/node_modules/@sdd-agent-platform/core/src/registries/capability-sources.ts +238 -15
  337. package/node_modules/@sdd-agent-platform/core/src/registries/command-team-runtime.ts +10 -10
  338. package/node_modules/@sdd-agent-platform/core/src/registries/eval-learning-context.ts +4 -4
  339. package/node_modules/@sdd-agent-platform/core/src/registries/query-status.ts +2 -2
  340. package/node_modules/@sdd-agent-platform/core/src/registries/registries.test.ts +45 -4
  341. package/node_modules/@sdd-agent-platform/core/src/registries/tool-capabilities.ts +3 -3
  342. package/node_modules/@sdd-agent-platform/core/src/registries/tool-plugins.ts +2 -2
  343. package/node_modules/@sdd-agent-platform/core/src/registries/worker-adapters.ts +11 -11
  344. package/node_modules/@sdd-agent-platform/core/src/registries/workflow-gates.ts +12 -12
  345. package/node_modules/@sdd-agent-platform/core/src/risk/contracts.ts +2 -2
  346. package/node_modules/@sdd-agent-platform/core/src/risk/kernel.ts +4 -4
  347. package/node_modules/@sdd-agent-platform/core/src/risk/legacy-adapters.ts +4 -7
  348. package/node_modules/@sdd-agent-platform/core/src/risk/workflow-gates.ts +20 -18
  349. package/node_modules/@sdd-agent-platform/core/src/router/agent-runtime-config.ts +32 -13
  350. package/node_modules/@sdd-agent-platform/core/src/router/agent-runtime.ts +68 -1
  351. package/node_modules/@sdd-agent-platform/core/src/router/route-projection.ts +212 -1
  352. package/node_modules/@sdd-agent-platform/core/src/router/route-sdd-task.test.ts +391 -6
  353. package/node_modules/@sdd-agent-platform/core/src/router/routing.ts +78 -17
  354. package/node_modules/@sdd-agent-platform/core/src/router/runtime-import.ts +453 -0
  355. package/node_modules/@sdd-agent-platform/core/src/router/runtime-inspection.ts +11 -4
  356. package/node_modules/@sdd-agent-platform/core/src/router/runtime-validation.ts +32 -3
  357. package/node_modules/@sdd-agent-platform/core/src/router/stage-route-binding.ts +279 -0
  358. package/node_modules/@sdd-agent-platform/core/src/router.ts +2 -0
  359. package/node_modules/@sdd-agent-platform/core/src/run-state/artifacts.ts +173 -18
  360. package/node_modules/@sdd-agent-platform/core/src/run-state/events.ts +2 -2
  361. package/node_modules/@sdd-agent-platform/core/src/run-state/inspect-run.ts +24 -59
  362. package/node_modules/@sdd-agent-platform/core/src/run-state/invocation-ledger.ts +2 -2
  363. package/node_modules/@sdd-agent-platform/core/src/run-state/model.ts +59 -9
  364. package/node_modules/@sdd-agent-platform/core/src/run-state/run-index.ts +1 -5
  365. package/node_modules/@sdd-agent-platform/core/src/run-state/run-state.test.ts +53 -2
  366. package/node_modules/@sdd-agent-platform/core/src/run-state/run-state.ts +55 -41
  367. package/node_modules/@sdd-agent-platform/core/src/run-state/task-evidence.ts +252 -0
  368. package/node_modules/@sdd-agent-platform/core/src/run-state/timing.ts +146 -0
  369. package/node_modules/@sdd-agent-platform/core/src/run-state.ts +2 -0
  370. package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/build.ts +0 -3
  371. package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/findings.ts +6 -46
  372. package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/model.ts +1 -13
  373. package/node_modules/@sdd-agent-platform/core/src/runtime-analysis.test.ts +0 -2
  374. package/node_modules/@sdd-agent-platform/core/src/runtime-paths.ts +131 -14
  375. package/node_modules/@sdd-agent-platform/core/src/runtime-projection-p0.test.ts +96 -0
  376. package/node_modules/@sdd-agent-platform/core/src/runtime-projection-p0.ts +292 -0
  377. package/node_modules/@sdd-agent-platform/core/src/sdd-docs/context.ts +1 -1
  378. package/node_modules/@sdd-agent-platform/core/src/sdd-docs/document-hashes.ts +306 -0
  379. package/node_modules/@sdd-agent-platform/core/src/sdd-docs/run-binding.ts +15 -4
  380. package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.test.ts +261 -0
  381. package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.ts +169 -41
  382. package/node_modules/@sdd-agent-platform/core/src/stage-artifacts.ts +450 -0
  383. package/node_modules/@sdd-agent-platform/core/src/stage-collaboration-contracts.ts +322 -0
  384. package/node_modules/@sdd-agent-platform/core/src/stage-collaboration.test.ts +2903 -0
  385. package/node_modules/@sdd-agent-platform/core/src/stage-collaboration.ts +5831 -0
  386. package/node_modules/@sdd-agent-platform/core/src/stage-runtime/runtime.test.ts +1 -1
  387. package/node_modules/@sdd-agent-platform/core/src/stage-runtime/runtime.ts +9 -1
  388. package/node_modules/@sdd-agent-platform/core/src/status/project-status.test.ts +239 -16
  389. package/node_modules/@sdd-agent-platform/core/src/status/project-status.ts +497 -8
  390. package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.test.ts +560 -4
  391. package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.ts +1510 -9
  392. package/node_modules/@sdd-agent-platform/core/src/subagents/contracts.ts +1 -1
  393. package/node_modules/@sdd-agent-platform/core/src/subagents/runtime.test.ts +3 -3
  394. package/node_modules/@sdd-agent-platform/core/src/subagents/runtime.ts +7 -7
  395. package/node_modules/@sdd-agent-platform/core/src/test-support/fixtures.ts +21 -0
  396. package/node_modules/@sdd-agent-platform/core/src/test-support/run-state.ts +20 -20
  397. package/node_modules/@sdd-agent-platform/core/src/truth-reconciliation.test.ts +72 -0
  398. package/node_modules/@sdd-agent-platform/core/src/truth-reconciliation.ts +177 -0
  399. package/node_modules/@sdd-agent-platform/core/src/verification/goal-verify.test.ts +13 -87
  400. package/node_modules/@sdd-agent-platform/core/src/verification/goal-verify.ts +46 -42
  401. package/node_modules/@sdd-agent-platform/core/src/verification/rendering.ts +18 -52
  402. package/node_modules/@sdd-agent-platform/core/src/verification/review-gate.test.ts +84 -0
  403. package/node_modules/@sdd-agent-platform/core/src/verification/review-gate.ts +77 -0
  404. package/node_modules/@sdd-agent-platform/core/src/verification/single-task-loop.test.ts +138 -64
  405. package/node_modules/@sdd-agent-platform/core/src/verification/single-task-loop.ts +226 -116
  406. package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.test.ts +148 -48
  407. package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.ts +619 -136
  408. package/node_modules/@sdd-agent-platform/core/src/verification/validation-cache.ts +106 -0
  409. package/node_modules/@sdd-agent-platform/core/src/verification/validation-wave.test.ts +383 -0
  410. package/node_modules/@sdd-agent-platform/core/src/verification/validation-wave.ts +556 -0
  411. package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.test.ts +131 -8
  412. package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.ts +117 -30
  413. package/node_modules/@sdd-agent-platform/core/src/verification.ts +2 -0
  414. package/node_modules/@sdd-agent-platform/core/src/work-units/contracts.ts +1 -1
  415. package/node_modules/@sdd-agent-platform/core/src/workflow-gate/evidence-packet.ts +425 -0
  416. package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.test.ts +507 -0
  417. package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.ts +182 -0
  418. package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.test.ts +174 -0
  419. package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.ts +194 -0
  420. package/node_modules/@sdd-agent-platform/core/src/workflow-gate/types.ts +115 -0
  421. package/node_modules/@sdd-agent-platform/core/src/workflow-state/affected-file-conflicts.ts +19 -4
  422. package/node_modules/@sdd-agent-platform/core/src/workflow-state/dependencies.test.ts +1 -1
  423. package/node_modules/@sdd-agent-platform/core/src/workflow-state/dependencies.ts +33 -11
  424. package/node_modules/@sdd-agent-platform/core/src/workflow-state/latest-eligible-run.ts +224 -0
  425. package/node_modules/@sdd-agent-platform/core/src/workflow-state/migration-recovery.ts +158 -0
  426. package/node_modules/@sdd-agent-platform/core/src/workflow-state/repair-contract.ts +77 -0
  427. package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve-task-run.ts +114 -0
  428. package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve.test.ts +851 -9
  429. package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve.ts +862 -45
  430. package/node_modules/@sdd-agent-platform/core/src/workflow-state/runtime-projections.ts +712 -0
  431. package/node_modules/@sdd-agent-platform/core/src/workflow-state.ts +1 -0
  432. package/package.json +1 -1
  433. package/packages/cli/dist/args.js +2 -2
  434. package/packages/cli/dist/args.js.map +1 -1
  435. package/packages/cli/dist/commands/ai-tools.js +13 -2
  436. package/packages/cli/dist/commands/ai-tools.js.map +1 -1
  437. package/packages/cli/dist/commands/context.js +1 -1
  438. package/packages/cli/dist/commands/context.js.map +1 -1
  439. package/packages/cli/dist/commands/execution.js +49 -1
  440. package/packages/cli/dist/commands/execution.js.map +1 -1
  441. package/packages/cli/dist/commands/governance.js +1 -1
  442. package/packages/cli/dist/commands/governance.js.map +1 -1
  443. package/packages/cli/dist/commands/init.js +6 -1
  444. package/packages/cli/dist/commands/init.js.map +1 -1
  445. package/packages/cli/dist/commands/lifecycle.js +15 -2
  446. package/packages/cli/dist/commands/lifecycle.js.map +1 -1
  447. package/packages/cli/dist/commands/registry/runtime.js +48 -2
  448. package/packages/cli/dist/commands/registry/runtime.js.map +1 -1
  449. package/packages/cli/dist/commands/run.js +52 -2
  450. package/packages/cli/dist/commands/run.js.map +1 -1
  451. package/packages/cli/dist/commands/stage-close.d.ts +6 -0
  452. package/packages/cli/dist/commands/stage-close.js +295 -0
  453. package/packages/cli/dist/commands/stage-close.js.map +1 -0
  454. package/packages/cli/dist/commands/status.js +70 -4
  455. package/packages/cli/dist/commands/status.js.map +1 -1
  456. package/packages/cli/dist/commands/tasks.js +4 -4
  457. package/packages/cli/dist/commands/tasks.js.map +1 -1
  458. package/packages/cli/dist/commands/test.js +272 -5
  459. package/packages/cli/dist/commands/test.js.map +1 -1
  460. package/packages/cli/dist/commands/verifies.js +9 -5
  461. package/packages/cli/dist/commands/verifies.js.map +1 -1
  462. package/packages/cli/dist/commands/verify.js +257 -20
  463. package/packages/cli/dist/commands/verify.js.map +1 -1
  464. package/packages/cli/dist/dispatch.js +4 -9
  465. package/packages/cli/dist/dispatch.js.map +1 -1
  466. package/packages/cli/dist/help.js +42 -27
  467. package/packages/cli/dist/help.js.map +1 -1
  468. package/packages/cli/dist/renderers/doctor.js +1 -1
  469. package/packages/cli/dist/renderers/doctor.js.map +1 -1
  470. package/packages/cli/dist/renderers/execution.js +1 -1
  471. package/packages/cli/dist/renderers/execution.js.map +1 -1
  472. package/packages/cli/dist/renderers/json.d.ts +1 -0
  473. package/packages/cli/dist/renderers/json.js +3 -0
  474. package/packages/cli/dist/renderers/json.js.map +1 -1
  475. package/packages/cli/dist/renderers/registry-runtime.d.ts +2 -1
  476. package/packages/cli/dist/renderers/registry-runtime.js +27 -2
  477. package/packages/cli/dist/renderers/registry-runtime.js.map +1 -1
  478. package/packages/cli/dist/renderers/router.js +5 -3
  479. package/packages/cli/dist/renderers/router.js.map +1 -1
  480. package/packages/cli/dist/renderers/workflow.d.ts +0 -4
  481. package/packages/cli/dist/renderers/workflow.js +46 -84
  482. package/packages/cli/dist/renderers/workflow.js.map +1 -1
  483. package/packages/cli/dist/skill-import-args.d.ts +10 -0
  484. package/packages/cli/dist/skill-import-args.js +47 -0
  485. package/packages/cli/dist/skill-import-args.js.map +1 -0
  486. package/packages/cli/dist/tsconfig.tsbuildinfo +1 -1
  487. package/packages/cli/package.json +2 -2
  488. package/packages/core/dist/ai-tools.js +72 -71
  489. package/packages/core/dist/ai-tools.js.map +1 -1
  490. package/packages/core/dist/artifacts/ingestion.js +64 -9
  491. package/packages/core/dist/artifacts/ingestion.js.map +1 -1
  492. package/packages/core/dist/artifacts/sdd-evidence.js +0 -1
  493. package/packages/core/dist/artifacts/sdd-evidence.js.map +1 -1
  494. package/packages/core/dist/artifacts/sdd-result.js +26 -17
  495. package/packages/core/dist/artifacts/sdd-result.js.map +1 -1
  496. package/packages/core/dist/config/init-project.d.ts +3 -0
  497. package/packages/core/dist/config/init-project.js +13 -9
  498. package/packages/core/dist/config/init-project.js.map +1 -1
  499. package/packages/core/dist/config/project-config.d.ts +3 -1
  500. package/packages/core/dist/config/project-config.js +7 -3
  501. package/packages/core/dist/config/project-config.js.map +1 -1
  502. package/packages/core/dist/config/starter-documents.d.ts +4 -4
  503. package/packages/core/dist/config/starter-documents.js +16 -20
  504. package/packages/core/dist/config/starter-documents.js.map +1 -1
  505. package/packages/core/dist/context/build-package.d.ts +1 -1
  506. package/packages/core/dist/context/build-package.js +1 -7
  507. package/packages/core/dist/context/build-package.js.map +1 -1
  508. package/packages/core/dist/context/evidence-summary.js +26 -8
  509. package/packages/core/dist/context/evidence-summary.js.map +1 -1
  510. package/packages/core/dist/context/log-worker.js +2 -2
  511. package/packages/core/dist/context/log-worker.js.map +1 -1
  512. package/packages/core/dist/context-offload/contracts.d.ts +1 -1
  513. package/packages/core/dist/contracts.d.ts +4 -1
  514. package/packages/core/dist/contracts.js +3 -0
  515. package/packages/core/dist/contracts.js.map +1 -1
  516. package/packages/core/dist/delegation/model.d.ts +3 -0
  517. package/packages/core/dist/delegation/validation.d.ts +3 -0
  518. package/packages/core/dist/delegation/validation.js +7 -4
  519. package/packages/core/dist/delegation/validation.js.map +1 -1
  520. package/packages/core/dist/doctor/checks/document-chain.js +1 -1
  521. package/packages/core/dist/doctor/checks/document-chain.js.map +1 -1
  522. package/packages/core/dist/doctor/checks/project.js +8 -8
  523. package/packages/core/dist/doctor/checks/project.js.map +1 -1
  524. package/packages/core/dist/doctor/checks/registries.js +0 -1
  525. package/packages/core/dist/doctor/checks/registries.js.map +1 -1
  526. package/packages/core/dist/doctor/checks/run-evidence.js +7 -7
  527. package/packages/core/dist/doctor/checks/run-evidence.js.map +1 -1
  528. package/packages/core/dist/doctor/checks/run-trust.js +0 -24
  529. package/packages/core/dist/doctor/checks/run-trust.js.map +1 -1
  530. package/packages/core/dist/doctor/checks/runtime-contracts.js +1 -1
  531. package/packages/core/dist/doctor/checks/runtime-contracts.js.map +1 -1
  532. package/packages/core/dist/doctor/doctor.js +277 -3
  533. package/packages/core/dist/doctor/doctor.js.map +1 -1
  534. package/packages/core/dist/evidence/lookup.d.ts +23 -0
  535. package/packages/core/dist/evidence/lookup.js +61 -0
  536. package/packages/core/dist/evidence/lookup.js.map +1 -0
  537. package/packages/core/dist/evidence-runtime/contracts.d.ts +11 -1
  538. package/packages/core/dist/execution/agent-execution-records.js +15 -8
  539. package/packages/core/dist/execution/agent-execution-records.js.map +1 -1
  540. package/packages/core/dist/execution/background-executor.js +4 -4
  541. package/packages/core/dist/execution/background-executor.js.map +1 -1
  542. package/packages/core/dist/execution/foreground-subagents.js +3 -3
  543. package/packages/core/dist/execution/foreground-subagents.js.map +1 -1
  544. package/packages/core/dist/execution/host-invocation.js +5 -4
  545. package/packages/core/dist/execution/host-invocation.js.map +1 -1
  546. package/packages/core/dist/execution/resident-worker.js +16 -7
  547. package/packages/core/dist/execution/resident-worker.js.map +1 -1
  548. package/packages/core/dist/execution/stage-team-runtime.d.ts +112 -0
  549. package/packages/core/dist/execution/stage-team-runtime.js +145 -0
  550. package/packages/core/dist/execution/stage-team-runtime.js.map +1 -0
  551. package/packages/core/dist/governance/policy.d.ts +1 -1
  552. package/packages/core/dist/governance/policy.js +1 -1
  553. package/packages/core/dist/governance/policy.js.map +1 -1
  554. package/packages/core/dist/instructions.d.ts +1 -1
  555. package/packages/core/dist/instructions.js +59 -66
  556. package/packages/core/dist/instructions.js.map +1 -1
  557. package/packages/core/dist/lifecycle/decision-gate.js +1 -1
  558. package/packages/core/dist/lifecycle/decision-gate.js.map +1 -1
  559. package/packages/core/dist/lifecycle/ship.d.ts +3 -0
  560. package/packages/core/dist/lifecycle/ship.js +55 -19
  561. package/packages/core/dist/lifecycle/ship.js.map +1 -1
  562. package/packages/core/dist/orchestration/contracts.d.ts +1 -1
  563. package/packages/core/dist/orchestration/runtime.d.ts +12 -2
  564. package/packages/core/dist/orchestration/runtime.js +62 -21
  565. package/packages/core/dist/orchestration/runtime.js.map +1 -1
  566. package/packages/core/dist/registries/agent-capability-catalog.d.ts +20 -2
  567. package/packages/core/dist/registries/agent-capability-catalog.js +218 -18
  568. package/packages/core/dist/registries/agent-capability-catalog.js.map +1 -1
  569. package/packages/core/dist/registries/agent-registry.js +17 -17
  570. package/packages/core/dist/registries/agent-registry.js.map +1 -1
  571. package/packages/core/dist/registries/agent-runtime-static.d.ts +10 -0
  572. package/packages/core/dist/registries/agent-runtime-static.js +32 -2
  573. package/packages/core/dist/registries/agent-runtime-static.js.map +1 -1
  574. package/packages/core/dist/registries/capability-sources.d.ts +2 -17
  575. package/packages/core/dist/registries/capability-sources.js +222 -10
  576. package/packages/core/dist/registries/capability-sources.js.map +1 -1
  577. package/packages/core/dist/registries/command-team-runtime.d.ts +1 -1
  578. package/packages/core/dist/registries/command-team-runtime.js +9 -9
  579. package/packages/core/dist/registries/command-team-runtime.js.map +1 -1
  580. package/packages/core/dist/registries/eval-learning-context.js +4 -4
  581. package/packages/core/dist/registries/eval-learning-context.js.map +1 -1
  582. package/packages/core/dist/registries/query-status.js +2 -2
  583. package/packages/core/dist/registries/query-status.js.map +1 -1
  584. package/packages/core/dist/registries/tool-capabilities.js +3 -3
  585. package/packages/core/dist/registries/tool-capabilities.js.map +1 -1
  586. package/packages/core/dist/registries/tool-plugins.js +2 -2
  587. package/packages/core/dist/registries/tool-plugins.js.map +1 -1
  588. package/packages/core/dist/registries/worker-adapters.js +11 -11
  589. package/packages/core/dist/registries/worker-adapters.js.map +1 -1
  590. package/packages/core/dist/registries/workflow-gates.js +12 -12
  591. package/packages/core/dist/registries/workflow-gates.js.map +1 -1
  592. package/packages/core/dist/risk/contracts.d.ts +2 -2
  593. package/packages/core/dist/risk/kernel.js +4 -4
  594. package/packages/core/dist/risk/kernel.js.map +1 -1
  595. package/packages/core/dist/risk/legacy-adapters.js +4 -7
  596. package/packages/core/dist/risk/legacy-adapters.js.map +1 -1
  597. package/packages/core/dist/risk/workflow-gates.d.ts +2 -2
  598. package/packages/core/dist/risk/workflow-gates.js +19 -17
  599. package/packages/core/dist/risk/workflow-gates.js.map +1 -1
  600. package/packages/core/dist/router/agent-runtime-config.js +28 -13
  601. package/packages/core/dist/router/agent-runtime-config.js.map +1 -1
  602. package/packages/core/dist/router/agent-runtime.d.ts +61 -1
  603. package/packages/core/dist/router/route-projection.d.ts +3 -1
  604. package/packages/core/dist/router/route-projection.js +192 -1
  605. package/packages/core/dist/router/route-projection.js.map +1 -1
  606. package/packages/core/dist/router/routing.js +73 -17
  607. package/packages/core/dist/router/routing.js.map +1 -1
  608. package/packages/core/dist/router/runtime-import.d.ts +28 -0
  609. package/packages/core/dist/router/runtime-import.js +373 -0
  610. package/packages/core/dist/router/runtime-import.js.map +1 -0
  611. package/packages/core/dist/router/runtime-inspection.js +11 -4
  612. package/packages/core/dist/router/runtime-inspection.js.map +1 -1
  613. package/packages/core/dist/router/runtime-validation.js +31 -3
  614. package/packages/core/dist/router/runtime-validation.js.map +1 -1
  615. package/packages/core/dist/router/stage-route-binding.d.ts +37 -0
  616. package/packages/core/dist/router/stage-route-binding.js +235 -0
  617. package/packages/core/dist/router/stage-route-binding.js.map +1 -0
  618. package/packages/core/dist/router.d.ts +2 -0
  619. package/packages/core/dist/router.js +2 -0
  620. package/packages/core/dist/router.js.map +1 -1
  621. package/packages/core/dist/run-state/artifacts.d.ts +16 -0
  622. package/packages/core/dist/run-state/artifacts.js +168 -18
  623. package/packages/core/dist/run-state/artifacts.js.map +1 -1
  624. package/packages/core/dist/run-state/events.js +2 -2
  625. package/packages/core/dist/run-state/events.js.map +1 -1
  626. package/packages/core/dist/run-state/inspect-run.d.ts +3 -3
  627. package/packages/core/dist/run-state/inspect-run.js +22 -54
  628. package/packages/core/dist/run-state/inspect-run.js.map +1 -1
  629. package/packages/core/dist/run-state/invocation-ledger.js +2 -2
  630. package/packages/core/dist/run-state/invocation-ledger.js.map +1 -1
  631. package/packages/core/dist/run-state/model.d.ts +53 -9
  632. package/packages/core/dist/run-state/run-index.d.ts +0 -2
  633. package/packages/core/dist/run-state/run-index.js +1 -3
  634. package/packages/core/dist/run-state/run-index.js.map +1 -1
  635. package/packages/core/dist/run-state/run-state.js +51 -34
  636. package/packages/core/dist/run-state/run-state.js.map +1 -1
  637. package/packages/core/dist/run-state/task-evidence.d.ts +65 -0
  638. package/packages/core/dist/run-state/task-evidence.js +169 -0
  639. package/packages/core/dist/run-state/task-evidence.js.map +1 -0
  640. package/packages/core/dist/run-state/timing.d.ts +8 -0
  641. package/packages/core/dist/run-state/timing.js +131 -0
  642. package/packages/core/dist/run-state/timing.js.map +1 -0
  643. package/packages/core/dist/run-state.d.ts +2 -0
  644. package/packages/core/dist/run-state.js +2 -0
  645. package/packages/core/dist/run-state.js.map +1 -1
  646. package/packages/core/dist/runtime-analysis/build.js +0 -3
  647. package/packages/core/dist/runtime-analysis/build.js.map +1 -1
  648. package/packages/core/dist/runtime-analysis/findings.js +5 -44
  649. package/packages/core/dist/runtime-analysis/findings.js.map +1 -1
  650. package/packages/core/dist/runtime-analysis/model.d.ts +1 -17
  651. package/packages/core/dist/runtime-paths.d.ts +20 -0
  652. package/packages/core/dist/runtime-paths.js +109 -14
  653. package/packages/core/dist/runtime-paths.js.map +1 -1
  654. package/packages/core/dist/runtime-projection-p0.d.ts +64 -0
  655. package/packages/core/dist/runtime-projection-p0.js +200 -0
  656. package/packages/core/dist/runtime-projection-p0.js.map +1 -0
  657. package/packages/core/dist/sdd-docs/context.js +1 -1
  658. package/packages/core/dist/sdd-docs/context.js.map +1 -1
  659. package/packages/core/dist/sdd-docs/document-hashes.d.ts +6 -0
  660. package/packages/core/dist/sdd-docs/document-hashes.js +276 -0
  661. package/packages/core/dist/sdd-docs/document-hashes.js.map +1 -0
  662. package/packages/core/dist/sdd-docs/run-binding.d.ts +1 -1
  663. package/packages/core/dist/sdd-docs/run-binding.js +15 -4
  664. package/packages/core/dist/sdd-docs/run-binding.js.map +1 -1
  665. package/packages/core/dist/sdd-docs/task-parser.d.ts +21 -0
  666. package/packages/core/dist/sdd-docs/task-parser.js +139 -38
  667. package/packages/core/dist/sdd-docs/task-parser.js.map +1 -1
  668. package/packages/core/dist/stage-artifacts.d.ts +55 -0
  669. package/packages/core/dist/stage-artifacts.js +322 -0
  670. package/packages/core/dist/stage-artifacts.js.map +1 -0
  671. package/packages/core/dist/stage-collaboration-contracts.d.ts +55 -0
  672. package/packages/core/dist/stage-collaboration-contracts.js +241 -0
  673. package/packages/core/dist/stage-collaboration-contracts.js.map +1 -0
  674. package/packages/core/dist/stage-collaboration.d.ts +888 -0
  675. package/packages/core/dist/stage-collaboration.js +3870 -0
  676. package/packages/core/dist/stage-collaboration.js.map +1 -0
  677. package/packages/core/dist/stage-runtime/runtime.js +8 -1
  678. package/packages/core/dist/stage-runtime/runtime.js.map +1 -1
  679. package/packages/core/dist/status/project-status.d.ts +105 -1
  680. package/packages/core/dist/status/project-status.js +343 -8
  681. package/packages/core/dist/status/project-status.js.map +1 -1
  682. package/packages/core/dist/storage/runtime-store.d.ts +348 -3
  683. package/packages/core/dist/storage/runtime-store.js +1017 -8
  684. package/packages/core/dist/storage/runtime-store.js.map +1 -1
  685. package/packages/core/dist/subagents/contracts.d.ts +1 -1
  686. package/packages/core/dist/subagents/runtime.js +7 -7
  687. package/packages/core/dist/subagents/runtime.js.map +1 -1
  688. package/packages/core/dist/test-support/fixtures.js +21 -0
  689. package/packages/core/dist/test-support/fixtures.js.map +1 -1
  690. package/packages/core/dist/test-support/run-state.d.ts +1 -1
  691. package/packages/core/dist/test-support/run-state.js +19 -20
  692. package/packages/core/dist/test-support/run-state.js.map +1 -1
  693. package/packages/core/dist/truth-reconciliation.d.ts +44 -0
  694. package/packages/core/dist/truth-reconciliation.js +138 -0
  695. package/packages/core/dist/truth-reconciliation.js.map +1 -0
  696. package/packages/core/dist/tsconfig.tsbuildinfo +1 -1
  697. package/packages/core/dist/verification/goal-verify.d.ts +0 -1
  698. package/packages/core/dist/verification/goal-verify.js +44 -37
  699. package/packages/core/dist/verification/goal-verify.js.map +1 -1
  700. package/packages/core/dist/verification/rendering.d.ts +0 -2
  701. package/packages/core/dist/verification/rendering.js +19 -49
  702. package/packages/core/dist/verification/rendering.js.map +1 -1
  703. package/packages/core/dist/verification/review-gate.d.ts +22 -0
  704. package/packages/core/dist/verification/review-gate.js +53 -0
  705. package/packages/core/dist/verification/review-gate.js.map +1 -0
  706. package/packages/core/dist/verification/single-task-loop.d.ts +0 -1
  707. package/packages/core/dist/verification/single-task-loop.js +213 -111
  708. package/packages/core/dist/verification/single-task-loop.js.map +1 -1
  709. package/packages/core/dist/verification/test-runtime.d.ts +28 -3
  710. package/packages/core/dist/verification/test-runtime.js +546 -125
  711. package/packages/core/dist/verification/test-runtime.js.map +1 -1
  712. package/packages/core/dist/verification/validation-cache.d.ts +26 -0
  713. package/packages/core/dist/verification/validation-cache.js +73 -0
  714. package/packages/core/dist/verification/validation-cache.js.map +1 -0
  715. package/packages/core/dist/verification/validation-wave.d.ts +76 -0
  716. package/packages/core/dist/verification/validation-wave.js +450 -0
  717. package/packages/core/dist/verification/validation-wave.js.map +1 -0
  718. package/packages/core/dist/verification/verify-contract.d.ts +3 -1
  719. package/packages/core/dist/verification/verify-contract.js +105 -30
  720. package/packages/core/dist/verification/verify-contract.js.map +1 -1
  721. package/packages/core/dist/verification.d.ts +2 -0
  722. package/packages/core/dist/verification.js +2 -0
  723. package/packages/core/dist/verification.js.map +1 -1
  724. package/packages/core/dist/work-units/contracts.d.ts +1 -1
  725. package/packages/core/dist/workflow-gate/evidence-packet.d.ts +24 -0
  726. package/packages/core/dist/workflow-gate/evidence-packet.js +395 -0
  727. package/packages/core/dist/workflow-gate/evidence-packet.js.map +1 -0
  728. package/packages/core/dist/workflow-gate/hard-checks.d.ts +4 -0
  729. package/packages/core/dist/workflow-gate/hard-checks.js +164 -0
  730. package/packages/core/dist/workflow-gate/hard-checks.js.map +1 -0
  731. package/packages/core/dist/workflow-gate/policy.d.ts +4 -0
  732. package/packages/core/dist/workflow-gate/policy.js +182 -0
  733. package/packages/core/dist/workflow-gate/policy.js.map +1 -0
  734. package/packages/core/dist/workflow-gate/types.d.ts +88 -0
  735. package/packages/core/dist/workflow-gate/types.js +2 -0
  736. package/packages/core/dist/workflow-gate/types.js.map +1 -0
  737. package/packages/core/dist/workflow-state/affected-file-conflicts.d.ts +1 -1
  738. package/packages/core/dist/workflow-state/affected-file-conflicts.js +17 -3
  739. package/packages/core/dist/workflow-state/affected-file-conflicts.js.map +1 -1
  740. package/packages/core/dist/workflow-state/dependencies.d.ts +8 -4
  741. package/packages/core/dist/workflow-state/dependencies.js +25 -11
  742. package/packages/core/dist/workflow-state/dependencies.js.map +1 -1
  743. package/packages/core/dist/workflow-state/latest-eligible-run.d.ts +37 -0
  744. package/packages/core/dist/workflow-state/latest-eligible-run.js +188 -0
  745. package/packages/core/dist/workflow-state/latest-eligible-run.js.map +1 -0
  746. package/packages/core/dist/workflow-state/migration-recovery.d.ts +40 -0
  747. package/packages/core/dist/workflow-state/migration-recovery.js +110 -0
  748. package/packages/core/dist/workflow-state/migration-recovery.js.map +1 -0
  749. package/packages/core/dist/workflow-state/repair-contract.d.ts +12 -0
  750. package/packages/core/dist/workflow-state/repair-contract.js +63 -0
  751. package/packages/core/dist/workflow-state/repair-contract.js.map +1 -0
  752. package/packages/core/dist/workflow-state/resolve-task-run.d.ts +21 -0
  753. package/packages/core/dist/workflow-state/resolve-task-run.js +95 -0
  754. package/packages/core/dist/workflow-state/resolve-task-run.js.map +1 -0
  755. package/packages/core/dist/workflow-state/resolve.d.ts +80 -3
  756. package/packages/core/dist/workflow-state/resolve.js +674 -41
  757. package/packages/core/dist/workflow-state/resolve.js.map +1 -1
  758. package/packages/core/dist/workflow-state/runtime-projections.d.ts +228 -0
  759. package/packages/core/dist/workflow-state/runtime-projections.js +452 -0
  760. package/packages/core/dist/workflow-state/runtime-projections.js.map +1 -0
  761. package/packages/core/dist/workflow-state.d.ts +1 -0
  762. package/packages/core/dist/workflow-state.js +1 -0
  763. package/packages/core/dist/workflow-state.js.map +1 -1
  764. package/packages/core/package.json +3 -3
  765. package/node_modules/@sdd-agent-platform/core/dist/doctor/render.d.ts +0 -2
  766. package/node_modules/@sdd-agent-platform/core/dist/doctor/render.js +0 -44
  767. package/node_modules/@sdd-agent-platform/core/dist/doctor/render.js.map +0 -1
  768. package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.d.ts +0 -17
  769. package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.js +0 -221
  770. package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.js.map +0 -1
  771. package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.d.ts +0 -91
  772. package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.js +0 -395
  773. package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.js.map +0 -1
  774. package/node_modules/@sdd-agent-platform/core/dist/sync-back.d.ts +0 -2
  775. package/node_modules/@sdd-agent-platform/core/dist/sync-back.js +0 -3
  776. package/node_modules/@sdd-agent-platform/core/dist/sync-back.js.map +0 -1
  777. package/node_modules/@sdd-agent-platform/core/src/sync-back/apply.ts +0 -248
  778. package/node_modules/@sdd-agent-platform/core/src/sync-back/inspect.ts +0 -522
  779. package/node_modules/@sdd-agent-platform/core/src/sync-back/sync-back.test.ts +0 -446
  780. package/node_modules/@sdd-agent-platform/core/src/sync-back.ts +0 -2
  781. package/packages/cli/dist/commands/artifact.d.ts +0 -6
  782. package/packages/cli/dist/commands/artifact.js +0 -168
  783. package/packages/cli/dist/commands/artifact.js.map +0 -1
  784. package/packages/cli/dist/commands/sync-back.d.ts +0 -6
  785. package/packages/cli/dist/commands/sync-back.js +0 -82
  786. package/packages/cli/dist/commands/sync-back.js.map +0 -1
  787. package/packages/cli/dist/renderers/artifacts.d.ts +0 -5
  788. package/packages/cli/dist/renderers/artifacts.js +0 -43
  789. package/packages/cli/dist/renderers/artifacts.js.map +0 -1
  790. package/packages/core/dist/doctor/render.d.ts +0 -2
  791. package/packages/core/dist/doctor/render.js +0 -44
  792. package/packages/core/dist/doctor/render.js.map +0 -1
  793. package/packages/core/dist/sync-back/apply.d.ts +0 -17
  794. package/packages/core/dist/sync-back/apply.js +0 -221
  795. package/packages/core/dist/sync-back/apply.js.map +0 -1
  796. package/packages/core/dist/sync-back/inspect.d.ts +0 -91
  797. package/packages/core/dist/sync-back/inspect.js +0 -395
  798. package/packages/core/dist/sync-back/inspect.js.map +0 -1
  799. package/packages/core/dist/sync-back.d.ts +0 -2
  800. package/packages/core/dist/sync-back.js +0 -3
  801. package/packages/core/dist/sync-back.js.map +0 -1
@@ -1,15 +1,16 @@
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 { getArtifactPath, getEvidenceAttachmentPath, getRunRelativeArtifactPath, normalizeArtifactRootRelativePath } from '../runtime-paths.js';
5
- import { readRuntimeRunState, recordRuntimeEvidenceAttachment, runtimeScopedId, withRuntimeStore } from '../storage/runtime-store.js';
6
- import { exists } from '../storage/json-io.js';
4
+ import { getBranchStageEvidencePathFromRef, getEvidenceAttachmentPath, getLegacyArtifactPath, getRunRelativeArtifactPath, getRuntimeStorePath, isBranchStageEvidenceRef, normalizeArtifactRootRelativePath, normalizeBranchStageEvidenceRef, toBranchStageEvidenceRef } 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
  export async function writeArtifact(projectRoot, runId, artifactRootRelativePath, content) {
9
8
  const normalized = normalizeArtifactRootRelativePath(artifactRootRelativePath);
10
9
  const runRelativePath = getRunRelativeArtifactPath(normalized);
11
- const branchSlug = await resolveRunBranchSlug(projectRoot, runId);
12
- const absolutePath = getEvidenceAttachmentPath(projectRoot, branchSlug, runRelativePath);
10
+ const runScope = await resolveRunScope(projectRoot, runId);
11
+ const contentHash = hashDocumentContent(content);
12
+ const physicalPayloadPath = uniquePhysicalPayloadPath(runRelativePath, runId, contentHash);
13
+ const absolutePath = getEvidenceAttachmentPath(projectRoot, runScope.branchSlug, physicalPayloadPath);
13
14
  await mkdir(path.dirname(absolutePath), { recursive: true });
14
15
  await writeFile(absolutePath, content, 'utf8');
15
16
  await appendArtifactHashLedgerEntry(projectRoot, {
@@ -18,26 +19,172 @@ export async function writeArtifact(projectRoot, runId, artifactRootRelativePath
18
19
  content,
19
20
  status: 'written'
20
21
  });
21
- await recordRuntimeArtifact(projectRoot, { runId, path: runRelativePath, content, status: 'written' });
22
+ await recordRuntimeArtifact(projectRoot, { runId, path: runRelativePath, content, status: 'written', taskId: runScope.taskId });
23
+ await recordRuntimeArtifactPayload(projectRoot, {
24
+ payloadId: runtimeScopedId(runId, runRelativePath, contentHash),
25
+ runId,
26
+ sourceRunId: runId,
27
+ branchSlug: runScope.branchSlug,
28
+ taskId: runScope.taskId,
29
+ logicalRef: runRelativePath,
30
+ physicalPayloadPath,
31
+ artifactRole: artifactKind(runRelativePath),
32
+ digest: contentHash,
33
+ status: 'active',
34
+ payload: { logicalRef: runRelativePath, physicalPayloadPath, artifactPath: runRelativePath, status: 'written' }
35
+ });
22
36
  await recordRuntimeEvidenceAttachment(projectRoot, {
23
- branchSlug,
37
+ branchSlug: runScope.branchSlug,
24
38
  runId,
39
+ taskId: runScope.taskId,
25
40
  kind: artifactKind(runRelativePath),
41
+ relativePath: physicalPayloadPath,
42
+ contentHash,
43
+ bytes: Buffer.byteLength(content, 'utf8'),
44
+ payload: { logicalRef: runRelativePath, physicalPayloadPath, status: 'written' }
45
+ });
46
+ return { absolutePath, runRelativePath };
47
+ }
48
+ export async function recordStageEvidenceArtifact(projectRoot, runId, stageEvidenceRef, content, options = {}) {
49
+ const runRelativePath = normalizeBranchStageEvidenceRef(stageEvidenceRef);
50
+ const runScope = await resolveRunScope(projectRoot, runId);
51
+ const taskId = options.taskId ?? runScope.taskId;
52
+ const contentHash = hashDocumentContent(content);
53
+ const absolutePath = getBranchStageEvidencePathFromRef(projectRoot, runRelativePath);
54
+ await mkdir(path.dirname(absolutePath), { recursive: true });
55
+ await writeFile(absolutePath, content, 'utf8');
56
+ await appendArtifactHashLedgerEntry(projectRoot, {
57
+ runId,
58
+ taskId,
59
+ branch: runScope.branchSlug,
60
+ artifactPath: runRelativePath,
61
+ content,
62
+ status: 'written'
63
+ });
64
+ await recordRuntimeArtifact(projectRoot, { runId, path: runRelativePath, content, status: 'written', taskId });
65
+ await recordRuntimeArtifactPayload(projectRoot, {
66
+ payloadId: runtimeScopedId(runId, runRelativePath, contentHash),
67
+ runId,
68
+ sourceRunId: runId,
69
+ branchSlug: runScope.branchSlug,
70
+ taskId,
71
+ logicalRef: runRelativePath,
72
+ physicalPayloadPath: runRelativePath,
73
+ artifactRole: options.artifactRole ?? artifactKind(runRelativePath),
74
+ digest: contentHash,
75
+ status: 'active',
76
+ payload: { logicalRef: runRelativePath, physicalPayloadPath: runRelativePath, storage: 'stage-evidence', status: 'written' }
77
+ });
78
+ await recordRuntimeEvidenceAttachment(projectRoot, {
79
+ branchSlug: runScope.branchSlug,
80
+ runId,
81
+ taskId,
82
+ kind: options.artifactRole ?? artifactKind(runRelativePath),
26
83
  relativePath: runRelativePath,
27
- contentHash: hashDocumentContent(content),
84
+ contentHash,
28
85
  bytes: Buffer.byteLength(content, 'utf8'),
29
- payload: { artifactPath: runRelativePath, status: 'written' }
86
+ payload: { logicalRef: runRelativePath, physicalPayloadPath: runRelativePath, storage: 'stage-evidence', status: 'written' }
30
87
  });
31
88
  return { absolutePath, runRelativePath };
32
89
  }
90
+ export async function recordRuntimeOnlyArtifact(projectRoot, runId, artifactRootRelativePath, content, options = {}) {
91
+ const normalized = normalizeArtifactRootRelativePath(artifactRootRelativePath);
92
+ const runRelativePath = options.logicalRef ?? getRunRelativeArtifactPath(normalized);
93
+ const runScope = await resolveRunScope(projectRoot, runId);
94
+ const branchSlug = options.branch ?? runScope.branchSlug;
95
+ const taskId = options.taskId ?? runScope.taskId;
96
+ const contentHash = hashDocumentContent(content);
97
+ const physicalPayloadPath = `runtime.sqlite:${runId}:${runRelativePath}`;
98
+ await appendArtifactHashLedgerEntry(projectRoot, {
99
+ runId,
100
+ taskId,
101
+ branch: branchSlug,
102
+ artifactPath: runRelativePath,
103
+ content,
104
+ status: 'recorded'
105
+ });
106
+ await recordRuntimeArtifact(projectRoot, { runId, path: runRelativePath, content, status: 'recorded', taskId });
107
+ await recordRuntimeArtifactPayload(projectRoot, {
108
+ payloadId: runtimeScopedId(runId, runRelativePath, contentHash),
109
+ runId,
110
+ sourceRunId: runId,
111
+ branchSlug,
112
+ taskId,
113
+ logicalRef: runRelativePath,
114
+ physicalPayloadPath,
115
+ artifactRole: options.artifactRole ?? artifactKind(runRelativePath),
116
+ digest: contentHash,
117
+ status: 'active',
118
+ payload: { logicalRef: runRelativePath, physicalPayloadPath, storage: 'runtime.sqlite', content }
119
+ });
120
+ await recordRuntimeEvidenceAttachment(projectRoot, {
121
+ branchSlug,
122
+ runId,
123
+ taskId,
124
+ kind: options.artifactRole ?? artifactKind(runRelativePath),
125
+ relativePath: physicalPayloadPath,
126
+ contentHash,
127
+ bytes: Buffer.byteLength(content, 'utf8'),
128
+ payload: { logicalRef: runRelativePath, physicalPayloadPath, storage: 'runtime.sqlite' }
129
+ });
130
+ return { absolutePath: `${getRuntimeStorePath(projectRoot)}#${runRelativePath}`, runRelativePath };
131
+ }
33
132
  export async function readArtifact(projectRoot, runId, artifactRootRelativePath) {
34
133
  const normalized = normalizeArtifactRootRelativePath(artifactRootRelativePath);
35
134
  const runRelativePath = getRunRelativeArtifactPath(normalized);
36
- const evidencePath = getEvidenceAttachmentPath(projectRoot, await resolveRunBranchSlug(projectRoot, runId), runRelativePath);
37
- if (await exists(evidencePath)) {
38
- return readFile(evidencePath, 'utf8');
135
+ const runScope = await resolveRunScope(projectRoot, runId);
136
+ const payload = await resolveRuntimeArtifactPayload(projectRoot, runId, runRelativePath)
137
+ ?? await resolveRuntimeArtifactPayload(projectRoot, runId, runtimeStageEvidenceRef(runScope.branchSlug, normalized));
138
+ const payloadContent = runtimePayloadContent(payload);
139
+ if (payloadContent !== null) {
140
+ return payloadContent;
141
+ }
142
+ if (payload) {
143
+ if (isBranchStageEvidenceRef(payload.physicalPayloadPath)) {
144
+ return readFile(getBranchStageEvidencePathFromRef(projectRoot, payload.physicalPayloadPath), 'utf8');
145
+ }
146
+ return readFile(getEvidenceAttachmentPath(projectRoot, runScope.branchSlug, payload.physicalPayloadPath), 'utf8');
147
+ }
148
+ const stageEvidenceRef = runtimeStageEvidenceRef(runScope.branchSlug, normalized);
149
+ try {
150
+ return await readFile(getBranchStageEvidencePathFromRef(projectRoot, stageEvidenceRef), 'utf8');
39
151
  }
40
- return readFile(getArtifactPath(projectRoot, runId, normalized), 'utf8');
152
+ catch {
153
+ try {
154
+ return await readFile(getEvidenceAttachmentPath(projectRoot, runScope.branchSlug, runRelativePath), 'utf8');
155
+ }
156
+ catch {
157
+ return readFile(getLegacyArtifactPath(projectRoot, runId, normalized), 'utf8');
158
+ }
159
+ }
160
+ }
161
+ function runtimePayloadContent(payload) {
162
+ if (!payload || !payload.payload || typeof payload.payload !== 'object' || Array.isArray(payload.payload)) {
163
+ return null;
164
+ }
165
+ const content = payload.payload.content;
166
+ return typeof content === 'string' ? content : null;
167
+ }
168
+ function runtimeStageEvidenceRef(branch, artifactRootRelativePath) {
169
+ const fileName = path.posix.basename(artifactRootRelativePath.replace(/\\/g, '/'));
170
+ return toBranchStageEvidenceRef(branch, runtimeStageForArtifact(fileName), fileName);
171
+ }
172
+ function runtimeStageForArtifact(fileName) {
173
+ if (fileName.startsWith('acceptance-coverage-')) {
174
+ return 'goal-verify';
175
+ }
176
+ if (fileName.startsWith('test-') || fileName.startsWith('validation-')) {
177
+ return 'test';
178
+ }
179
+ if (fileName.startsWith('ship-') || fileName.startsWith('release-')) {
180
+ return 'ship';
181
+ }
182
+ return 'do';
183
+ }
184
+ function uniquePhysicalPayloadPath(logicalRef, runId, digest) {
185
+ const parsed = path.posix.parse(logicalRef.replace(/\\/g, '/'));
186
+ const suffix = `${runId}-${digest.slice(0, 12)}`;
187
+ return path.posix.join(parsed.dir, `${parsed.name}-${suffix}${parsed.ext}`);
41
188
  }
42
189
  export function artifactKind(artifactPath) {
43
190
  const fileName = path.posix.basename(artifactPath.replace(/\\/g, '/'));
@@ -50,15 +197,15 @@ export function artifactKind(artifactPath) {
50
197
  if (fileName.startsWith('debug-')) {
51
198
  return 'debug';
52
199
  }
200
+ if (fileName.startsWith('test-validation-')) {
201
+ return 'test-validation';
202
+ }
53
203
  if (fileName.startsWith('validation-')) {
54
204
  return 'validation';
55
205
  }
56
206
  if (fileName.startsWith('gap-report-')) {
57
207
  return 'gap-report';
58
208
  }
59
- if (fileName === 'sync-back-proposal.md') {
60
- return 'sync-back-proposal';
61
- }
62
209
  return 'artifact';
63
210
  }
64
211
  async function recordRuntimeArtifact(projectRoot, input) {
@@ -70,9 +217,12 @@ async function recordRuntimeArtifact(projectRoot, input) {
70
217
  .run(runtimeScopedId(input.runId, input.path, contentHash), input.runId, input.path, artifactKind(input.path), input.taskId ?? null, input.agent ?? null, contentHash, Buffer.byteLength(input.content, 'utf8'), input.status, now, payload);
71
218
  });
72
219
  }
73
- async function resolveRunBranchSlug(projectRoot, runId) {
220
+ async function resolveRunScope(projectRoot, runId) {
74
221
  const state = await readRuntimeRunState(projectRoot, runId);
75
- return state?.gitBranch ?? state?.partition ?? 'unscoped';
222
+ return {
223
+ branchSlug: state?.gitBranch ?? state?.partition ?? 'unscoped',
224
+ taskId: state?.taskId ?? state?.currentTask ?? null
225
+ };
76
226
  }
77
227
  function hashDocumentContent(raw) {
78
228
  return createHash('sha256').update(raw.replace(/\r\n/g, '\n'), 'utf8').digest('hex');
@@ -1 +1 @@
1
- {"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../src/run-state/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,iCAAiC,EAAE,MAAM,qBAAqB,CAAC;AAChJ,OAAO,EAAE,mBAAmB,EAAE,+BAA+B,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACtI,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAEvE,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,WAAmB,EAAE,KAAa,EAAE,wBAAgC,EAAE,OAAe;IACvH,MAAM,UAAU,GAAG,iCAAiC,CAAC,wBAAwB,CAAC,CAAC;IAC/E,MAAM,eAAe,GAAG,0BAA0B,CAAC,UAAU,CAAC,CAAC;IAC/D,MAAM,UAAU,GAAG,MAAM,oBAAoB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAClE,MAAM,YAAY,GAAG,yBAAyB,CAAC,WAAW,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC;IACzF,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7D,MAAM,SAAS,CAAC,YAAY,EAAE,OAAO,EAAE,MA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AM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACvF,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import path from 'node:path';
2
2
  import { EVENT_LOG_CONTRACT } from '../contracts.js';
3
- import { getRunDir } from '../runtime-paths.js';
3
+ import { getLegacyRunDir } from '../runtime-paths.js';
4
4
  import { importLegacyRunEventsIfNeeded, readRuntimeRunEvents, recordRuntimeEvent } from '../storage/runtime-store.js';
5
5
  export async function appendEvent(projectRoot, runId, event) {
6
6
  const nextEvent = {
@@ -16,7 +16,7 @@ export async function readRunEvents(projectRoot, runId) {
16
16
  if (storedEvents.length > 0) {
17
17
  return storedEvents;
18
18
  }
19
- const eventPath = path.join(getRunDir(projectRoot, runId), 'events.jsonl');
19
+ const eventPath = path.join(getLegacyRunDir(projectRoot, runId), 'events.jsonl');
20
20
  await importLegacyRunEventsIfNeeded(projectRoot, runId, eventPath);
21
21
  return readRuntimeRunEvents(projectRoot, runId);
22
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/run-state/events.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,6BAA6B,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAGtH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,WAAmB,EAAE,KAAa,EAAE,KAA8C;IAClH,MAAM,SAAS,GAAiB;QAC9B,QAAQ,EAAE,kBAAkB;QAC5B,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QAC9B,GAAG,KAAK;KACT,CAAC;IACF,MAAM,kBAAkB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IACjD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,CAAC,KA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E,CAAC;QAC5B,OAAO,YAAY,CAAC;IACtB,CAAC;IACD,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,cAAc,CAAC,CAAC;IACjF,MAAM,6BAA6B,CAAC,WAAW,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IACnE,OAAO,oBAAoB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { TASK_RUN_EVIDENCE_CONTRACT_VERSION } from '../contracts.js';
2
2
  import type { ArtifactIndexEntry, InvocationLedgerEntry, RunState, RunStateArtifactIngestionRecord, RunStateWorktreeLifecycleRecord, RunStatus, RunSummary, RuntimeEvent } from './model.js';
3
+ import { type TaskEvidenceView } from './task-evidence.js';
3
4
  export interface TaskRunEvidenceGap {
4
5
  type: string;
5
6
  severity: string;
@@ -20,7 +21,7 @@ export interface AgentExecutionRecordView {
20
21
  } | null;
21
22
  routeId: string;
22
23
  routeDecision: {
23
- recommendedProfile?: string;
24
+ recommendedProfile?: string | null;
24
25
  };
25
26
  createdAt: string;
26
27
  [key: string]: unknown;
@@ -73,7 +74,6 @@ export interface TaskRunEvidenceContract {
73
74
  artifacts: ArtifactIndexEntry[];
74
75
  validation: RunState['validation'];
75
76
  gaps: TaskRunEvidenceGap[];
76
- syncBackProposal: string | null;
77
77
  invocationLedger: InvocationLedgerEntry[];
78
78
  agentExecutions: AgentExecutionRecordView[];
79
79
  teamSessions: TeamSessionRecordView[];
@@ -89,9 +89,9 @@ export interface RunInspection {
89
89
  artifactIngestions: RunStateArtifactIngestionRecord[];
90
90
  worktrees: RunStateWorktreeLifecycleRecord[];
91
91
  validation: RunState['validation'];
92
- syncBack: RunState['syncBack'];
93
92
  tasks: Record<string, unknown>;
94
93
  taskRunEvidence: TaskRunEvidenceContract;
94
+ taskEvidenceView: TaskEvidenceView | null;
95
95
  agentExecutions: AgentExecutionRecordView[];
96
96
  invocationLedger: InvocationLedgerEntry[];
97
97
  teamSessions: TeamSessionRecordView[];
@@ -1,22 +1,29 @@
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 { getAgentExecutionsDir, getTeamSessionsDir, getWorkerRuntimesDir } from '../runtime-paths.js';
5
- import { exists } from '../storage/json-io.js';
2
+ import { listAgentExecutionRecords as listRuntimeBackedAgentExecutionRecords, listTeamSessionRecords as listRuntimeBackedTeamSessionRecords } from '../execution/agent-execution-records.js';
3
+ import { listResidentWorkerRuntimeRecords as listRuntimeBackedResidentWorkerRuntimeRecords } from '../execution/resident-worker.js';
4
+ import { listRuntimeTestRuns, listRuntimeTestSteps } from '../storage/runtime-store.js';
6
5
  import { readRunEvents } from './events.js';
7
6
  import { listInvocationLedgerEntries } from './invocation-ledger.js';
8
7
  import { readRunState, summarizeRunState } from './run-state.js';
8
+ import { readTaskEvidenceView } from './task-evidence.js';
9
+ import { buildRunDurationBreakdown } from './timing.js';
9
10
  export async function inspectRun(projectRoot, runId) {
10
11
  const state = await readRunState(projectRoot, runId);
11
- const [events, agentExecutions, teamSessions, workerRuntimes, invocationLedger] = await Promise.all([
12
+ const [events, agentExecutions, teamSessions, workerRuntimes, invocationLedger, testRuns, testSteps] = await Promise.all([
12
13
  readRunEvents(projectRoot, runId),
13
- listAgentExecutionRecords(projectRoot, runId),
14
- listTeamSessionRecords(projectRoot, runId),
15
- listResidentWorkerRuntimeRecords(projectRoot, runId),
16
- listInvocationLedgerEntries(projectRoot, runId)
14
+ listRuntimeBackedAgentExecutionRecords(projectRoot, runId),
15
+ listRuntimeBackedTeamSessionRecords(projectRoot, runId),
16
+ listRuntimeBackedResidentWorkerRuntimeRecords(projectRoot, runId),
17
+ listInvocationLedgerEntries(projectRoot, runId),
18
+ listRuntimeTestRuns(projectRoot, runId),
19
+ listRuntimeTestSteps(projectRoot, { runId })
17
20
  ]);
21
+ const agentExecutionViews = agentExecutions.map((record) => ({ ...record }));
22
+ const teamSessionViews = teamSessions.map((record) => ({ ...record }));
23
+ const workerRuntimeViews = workerRuntimes.map((record) => ({ ...record }));
24
+ const taskEvidenceView = state.partition && state.taskId ? await readTaskEvidenceView(projectRoot, { branch: state.partition, taskId: state.taskId }) : null;
18
25
  return {
19
- summary: summarizeRunState(state),
26
+ summary: { ...summarizeRunState(state), durationBreakdown: buildRunDurationBreakdown(state, { events, testRuns, testSteps }) },
20
27
  state,
21
28
  events,
22
29
  eventCount: events.length,
@@ -25,53 +32,15 @@ export async function inspectRun(projectRoot, runId) {
25
32
  artifactIngestions: Object.values(state.artifactIngestions ?? {}),
26
33
  worktrees: Object.values(state.worktrees ?? {}),
27
34
  validation: state.validation,
28
- syncBack: state.syncBack,
29
- taskRunEvidence: buildTaskRunEvidence(state, events, agentExecutions, teamSessions, workerRuntimes, invocationLedger),
35
+ taskRunEvidence: buildTaskRunEvidence(state, events, agentExecutionViews, teamSessionViews, workerRuntimeViews, invocationLedger),
36
+ taskEvidenceView,
30
37
  tasks: state.tasks,
31
- agentExecutions,
32
- teamSessions,
33
- workerRuntimes,
38
+ agentExecutions: agentExecutionViews,
39
+ teamSessions: teamSessionViews,
40
+ workerRuntimes: workerRuntimeViews,
34
41
  invocationLedger
35
42
  };
36
43
  }
37
- async function listAgentExecutionRecords(projectRoot, runId) {
38
- const recordsDir = getAgentExecutionsDir(projectRoot, runId);
39
- if (!await exists(recordsDir)) {
40
- return [];
41
- }
42
- const records = await readJsonRecords(recordsDir);
43
- return records.sort((left, right) => left.createdAt.localeCompare(right.createdAt) || left.executionId.localeCompare(right.executionId));
44
- }
45
- async function listTeamSessionRecords(projectRoot, runId) {
46
- const recordsDir = getTeamSessionsDir(projectRoot, runId);
47
- if (!await exists(recordsDir)) {
48
- return [];
49
- }
50
- const records = await readJsonRecords(recordsDir);
51
- return records.sort((left, right) => left.createdAt.localeCompare(right.createdAt) || left.teamId.localeCompare(right.teamId));
52
- }
53
- async function listResidentWorkerRuntimeRecords(projectRoot, runId) {
54
- const recordsDir = getWorkerRuntimesDir(projectRoot, runId);
55
- if (!await exists(recordsDir)) {
56
- return [];
57
- }
58
- const records = await readJsonRecords(recordsDir);
59
- return records.sort((left, right) => left.updatedAt.localeCompare(right.updatedAt) || left.runtimeId.localeCompare(right.runtimeId));
60
- }
61
- async function readJsonRecords(recordsDir) {
62
- const entries = await readdir(recordsDir, { withFileTypes: true });
63
- const records = [];
64
- for (const entry of entries.filter((candidate) => candidate.isFile() && candidate.name.endsWith('.json'))) {
65
- try {
66
- const raw = await readFile(path.join(recordsDir, entry.name), 'utf8');
67
- records.push(JSON.parse(raw));
68
- }
69
- catch {
70
- continue;
71
- }
72
- }
73
- return records;
74
- }
75
44
  function buildTaskRunEvidence(state, events, agentExecutions = [], teamSessions = [], workerRuntimes = [], invocationLedger = []) {
76
45
  return {
77
46
  version: TASK_RUN_EVIDENCE_CONTRACT_VERSION,
@@ -89,7 +58,6 @@ function buildTaskRunEvidence(state, events, agentExecutions = [], teamSessions
89
58
  artifacts: state.artifacts,
90
59
  validation: state.validation,
91
60
  gaps: Object.values(state.tasks).flatMap(extractTaskGaps),
92
- syncBackProposal: state.syncBack.proposalPath,
93
61
  agentExecutions,
94
62
  teamSessions,
95
63
  workerRuntimes,
@@ -1 +1 @@
1
- {"version":3,"file":"inspect-run.js","sourceRoot":"","sources":["../../src/run-state/inspect-run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,kCAAkC,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACtG,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,aA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C1E,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,IAAI,GAAI,SAAgC,CAAC,IAAI,CAAC;IACpD,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACtE,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAc;IAC1C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACxC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,GAAG,GAAG,KAAoC,CAAC;IACjD,OAAO,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,GAAG,CAAC,QAAQ,KAAK,QAAQ,IAAI,OAAO,GAAG,CAAC,KAAK,KAAK,QAAQ,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,IAAI,OAAO,GAAG,CAAC,cAAc,KAAK,QAAQ,CAAC;AACxL,CAAC"}
@@ -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 { getInvocationLedgerPath } from '../runtime-paths.js';
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
  export async function appendInvocationLedgerEntry(projectRoot, input) {
@@ -21,7 +21,7 @@ export async function listInvocationLedgerEntries(projectRoot, runId) {
21
21
  if (entries.length > 0) {
22
22
  return entries;
23
23
  }
24
- const ledgerPath = getInvocationLedgerPath(projectRoot, runId);
24
+ const ledgerPath = getLegacyInvocationLedgerPath(projectRoot, runId);
25
25
  await importLegacyInvocationLedgerIfNeeded(projectRoot, runId, ledgerPath);
26
26
  return readRuntimeActivities(projectRoot, runId);
27
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"invocation-ledger.js","sourceRoot":"","sources":["../../src/run-state/invocation-ledger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,kCAAkC,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAG3K,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,WAAmB,EAAE,KAAoF;IACzJ,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC3C,MAAM,KAAK,GAA0B;QACnC,QAAQ,EAAE,0BAA0B;QACpC,OAAO,EAAE,kCAAkC;QAC3C,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,IAAI,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;QACzH,SAAS;QACT,GAAG,KAAK;KACT,CAAC;IACF,MAAM,qBAAqB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAChD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,WAAmB,EAAE,KAAa;IAClF,MAAM,OAAO,GAAG,MAAM,qBAAqB,CAAC,WAAW,EAAE,KAAK,CAAC,C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5E,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC;AACzK,CAAC;AAID,SAAS,mBAAmB,CAAC,GAAW;IACtC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACvF,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAc;IACtC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC"}
@@ -11,8 +11,14 @@ export interface RunDocumentSnapshot {
11
11
  specHash: string | null;
12
12
  planHash: string | null;
13
13
  tasksHash: string | null;
14
+ specContractHash: string | null;
15
+ planContractHash: string | null;
16
+ tasksContractHash: string | null;
17
+ taskContractHash: string | null;
14
18
  planBasedOnSpecHash: string | null;
15
19
  tasksBasedOnPlanHash: string | null;
20
+ planBasedOnSpecContractHash: string | null;
21
+ tasksBasedOnPlanContractHash: string | null;
16
22
  }
17
23
  export interface RunStateContractValidationIssue {
18
24
  field: string;
@@ -66,6 +72,9 @@ export interface RunStateDelegationRecord {
66
72
  expectedArtifact: string;
67
73
  terminalEventRequired: boolean;
68
74
  terminalEventAt?: string | null;
75
+ attempt?: number;
76
+ retryOf?: string | null;
77
+ replayReason?: 'document_contract_refresh' | 'artifact_reingest' | 'validation_replay' | 'manual_retry' | 'runtime_recovery' | null;
69
78
  }
70
79
  export interface RunStateArtifactIngestionRecord {
71
80
  contract: typeof ARTIFACT_RESULT_INGESTION_CONTRACT_VERSION;
@@ -80,6 +89,9 @@ export interface RunStateArtifactIngestionRecord {
80
89
  ingestedAt: string;
81
90
  issues: RunStateContractValidationIssue[];
82
91
  gaps: RunStateTaskGap[];
92
+ contentDigest?: string;
93
+ retryOf?: string | null;
94
+ replayReason?: string | null;
83
95
  }
84
96
  export interface RunStateWorktreeLifecycleRecord {
85
97
  contract: 'phase-3.8-worktree-lifecycle-v1';
@@ -96,6 +108,25 @@ export interface RunStateWorktreeLifecycleRecord {
96
108
  keepReason: string | null;
97
109
  dirty: boolean;
98
110
  }
111
+ export type RunTaskImplementationStatus = 'not_started' | 'running' | 'implemented' | 'blocked' | 'failed';
112
+ export type RunTaskVerificationStatus = 'not_run' | 'pending_batch' | 'ready_for_validation' | 'running' | 'pass' | 'pass_with_gaps' | 'blocked' | 'failed';
113
+ export interface RunStateTaskRuntime {
114
+ status: string;
115
+ implementationStatus?: RunTaskImplementationStatus;
116
+ verificationStatus?: RunTaskVerificationStatus;
117
+ validationBatch?: string | null;
118
+ validationTiming?: 'task_end' | 'batch_end' | 'wave_end';
119
+ requiresVerifyBeforeNext?: boolean;
120
+ gaps?: unknown[];
121
+ artifacts?: string[];
122
+ testStatus?: string;
123
+ validationStatus?: string;
124
+ verifyStatus?: string;
125
+ workflowGateStatus?: string;
126
+ workflowGateDecisionId?: string;
127
+ evidence?: string[];
128
+ acceptanceCoverage?: unknown[];
129
+ }
99
130
  export interface RunState {
100
131
  contract: typeof RUN_STATE_CONTRACT;
101
132
  runtimeVersion: typeof RUNTIME_VERSION;
@@ -115,7 +146,7 @@ export interface RunState {
115
146
  eventLogPath: string;
116
147
  artifactRoot: string;
117
148
  lifecycleDecision: RunStateLifecycleDecisionRecord | null;
118
- tasks: Record<string, unknown>;
149
+ tasks: Record<string, RunStateTaskRuntime>;
119
150
  agents: Record<string, unknown>;
120
151
  delegations: Record<string, RunStateDelegationRecord>;
121
152
  artifacts: ArtifactIndexEntry[];
@@ -126,13 +157,26 @@ export interface RunState {
126
157
  commands: string[];
127
158
  evidence: string[];
128
159
  };
129
- syncBack: {
130
- mode: 'proposal';
131
- proposalPath: string | null;
132
- proposalDigest?: string | null;
133
- sourceVerifyStatus?: 'PASS' | 'PASS_WITH_GAPS' | 'FAIL' | 'BLOCKED' | 'completed' | 'blocked' | 'failed' | null;
134
- status: 'not_created' | 'proposed' | 'applied';
135
- };
160
+ }
161
+ export interface RunDurationContributor {
162
+ kind: 'validation' | 'waiting' | 'blocked' | 'queue_or_bind' | 'host_waiting' | 'unknown_gap';
163
+ durationMs: number;
164
+ startedAt: string;
165
+ endedAt: string;
166
+ reason: string;
167
+ refs: string[];
168
+ }
169
+ export interface RunDurationBreakdown {
170
+ elapsedDurationMs: number;
171
+ activeRuntimeDurationMs: number;
172
+ validationDurationMs: number;
173
+ waitingDurationMs: number;
174
+ blockedDurationMs: number;
175
+ queueOrBindDurationMs: number;
176
+ unknownGapDurationMs: number;
177
+ hostWaitingDurationMs: number;
178
+ slowReason: RunDurationContributor['kind'] | 'active_runtime' | 'none';
179
+ topContributors: RunDurationContributor[];
136
180
  }
137
181
  export interface RunSummary {
138
182
  runId: string;
@@ -147,9 +191,9 @@ export interface RunSummary {
147
191
  createdAt: string;
148
192
  updatedAt: string;
149
193
  validationStatus: RunState['validation']['status'];
150
- syncBackStatus: RunState['syncBack']['status'];
151
194
  taskIds: string[];
152
195
  artifactCount: number;
196
+ durationBreakdown: RunDurationBreakdown;
153
197
  }
154
198
  export interface RuntimeEvent {
155
199
  contract: typeof EVENT_LOG_CONTRACT;
@@ -52,7 +52,6 @@ export interface LocalRunIndexPartitionTaskEntry {
52
52
  runId: string;
53
53
  runStatus: RunStatus;
54
54
  validationStatus: RunState['validation']['status'];
55
- syncBackStatus: RunState['syncBack']['status'];
56
55
  affectedFiles: string[];
57
56
  updatedAt: string;
58
57
  }
@@ -63,7 +62,6 @@ export interface LocalRunIndexAffectedFileEntry {
63
62
  taskId: string;
64
63
  runId: string;
65
64
  runStatus: RunStatus;
66
- syncBackStatus: RunState['syncBack']['status'];
67
65
  updatedAt: string;
68
66
  }
69
67
  export interface LocalRunIndexQuery {