sdd-agent-platform 0.3.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1374) hide show
  1. package/README.md +234 -239
  2. package/{dist/packages/core/src → node_modules/@sdd-agent-platform/core/dist}/ai-tools.d.ts +3 -2
  3. package/node_modules/@sdd-agent-platform/core/dist/ai-tools.js +464 -0
  4. package/node_modules/@sdd-agent-platform/core/dist/ai-tools.js.map +1 -0
  5. package/node_modules/@sdd-agent-platform/core/dist/artifacts/ingestion.d.ts +24 -0
  6. package/node_modules/@sdd-agent-platform/core/dist/artifacts/ingestion.js +181 -0
  7. package/node_modules/@sdd-agent-platform/core/dist/artifacts/ingestion.js.map +1 -0
  8. package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-evidence.d.ts +47 -0
  9. package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-evidence.js +241 -0
  10. package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-evidence.js.map +1 -0
  11. package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-result.d.ts +29 -0
  12. package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-result.js +198 -0
  13. package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-result.js.map +1 -0
  14. package/node_modules/@sdd-agent-platform/core/dist/artifacts/templates.d.ts +10 -0
  15. package/node_modules/@sdd-agent-platform/core/dist/artifacts/templates.js +79 -0
  16. package/node_modules/@sdd-agent-platform/core/dist/artifacts/templates.js.map +1 -0
  17. package/node_modules/@sdd-agent-platform/core/dist/artifacts.d.ts +4 -0
  18. package/node_modules/@sdd-agent-platform/core/dist/artifacts.js +5 -0
  19. package/node_modules/@sdd-agent-platform/core/dist/artifacts.js.map +1 -0
  20. package/node_modules/@sdd-agent-platform/core/dist/coding-facts/contracts.d.ts +71 -0
  21. package/node_modules/@sdd-agent-platform/core/dist/coding-facts/contracts.js +2 -0
  22. package/node_modules/@sdd-agent-platform/core/dist/coding-facts/contracts.js.map +1 -0
  23. package/node_modules/@sdd-agent-platform/core/dist/coding-facts.d.ts +1 -0
  24. package/node_modules/@sdd-agent-platform/core/dist/coding-facts.js +2 -0
  25. package/node_modules/@sdd-agent-platform/core/dist/coding-facts.js.map +1 -0
  26. package/node_modules/@sdd-agent-platform/core/dist/config/init-project.d.ts +31 -0
  27. package/node_modules/@sdd-agent-platform/core/dist/config/init-project.js +89 -0
  28. package/node_modules/@sdd-agent-platform/core/dist/config/init-project.js.map +1 -0
  29. package/node_modules/@sdd-agent-platform/core/dist/config/project-config.d.ts +49 -0
  30. package/node_modules/@sdd-agent-platform/core/dist/config/project-config.js +202 -0
  31. package/node_modules/@sdd-agent-platform/core/dist/config/project-config.js.map +1 -0
  32. package/node_modules/@sdd-agent-platform/core/dist/config/project-detection.d.ts +21 -0
  33. package/node_modules/@sdd-agent-platform/core/dist/config/project-detection.js +111 -0
  34. package/node_modules/@sdd-agent-platform/core/dist/config/project-detection.js.map +1 -0
  35. package/node_modules/@sdd-agent-platform/core/dist/config/project-status.d.ts +1 -0
  36. package/node_modules/@sdd-agent-platform/core/dist/config/project-status.js +2 -0
  37. package/node_modules/@sdd-agent-platform/core/dist/config/project-status.js.map +1 -0
  38. package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.d.ts +4 -0
  39. package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.js +441 -0
  40. package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.js.map +1 -0
  41. package/node_modules/@sdd-agent-platform/core/dist/context/budget.d.ts +10 -0
  42. package/node_modules/@sdd-agent-platform/core/dist/context/budget.js +20 -0
  43. package/node_modules/@sdd-agent-platform/core/dist/context/budget.js.map +1 -0
  44. package/node_modules/@sdd-agent-platform/core/dist/context/build-package.d.ts +46 -0
  45. package/node_modules/@sdd-agent-platform/core/dist/context/build-package.js +244 -0
  46. package/node_modules/@sdd-agent-platform/core/dist/context/build-package.js.map +1 -0
  47. package/node_modules/@sdd-agent-platform/core/dist/context/command-summary.d.ts +14 -0
  48. package/node_modules/@sdd-agent-platform/core/dist/context/command-summary.js +34 -0
  49. package/node_modules/@sdd-agent-platform/core/dist/context/command-summary.js.map +1 -0
  50. package/node_modules/@sdd-agent-platform/core/dist/context/evidence-summary.d.ts +50 -0
  51. package/node_modules/@sdd-agent-platform/core/dist/context/evidence-summary.js +86 -0
  52. package/node_modules/@sdd-agent-platform/core/dist/context/evidence-summary.js.map +1 -0
  53. package/node_modules/@sdd-agent-platform/core/dist/context/log-worker.d.ts +19 -0
  54. package/node_modules/@sdd-agent-platform/core/dist/context/log-worker.js +28 -0
  55. package/node_modules/@sdd-agent-platform/core/dist/context/log-worker.js.map +1 -0
  56. package/node_modules/@sdd-agent-platform/core/dist/context/source-refs.d.ts +9 -0
  57. package/node_modules/@sdd-agent-platform/core/dist/context/source-refs.js +30 -0
  58. package/node_modules/@sdd-agent-platform/core/dist/context/source-refs.js.map +1 -0
  59. package/node_modules/@sdd-agent-platform/core/dist/context-offload/contracts.d.ts +43 -0
  60. package/node_modules/@sdd-agent-platform/core/dist/context-offload/contracts.js +2 -0
  61. package/node_modules/@sdd-agent-platform/core/dist/context-offload/contracts.js.map +1 -0
  62. package/node_modules/@sdd-agent-platform/core/dist/context-offload/runtime.d.ts +36 -0
  63. package/node_modules/@sdd-agent-platform/core/dist/context-offload/runtime.js +142 -0
  64. package/node_modules/@sdd-agent-platform/core/dist/context-offload/runtime.js.map +1 -0
  65. package/node_modules/@sdd-agent-platform/core/dist/context-offload.d.ts +2 -0
  66. package/node_modules/@sdd-agent-platform/core/dist/context-offload.js +3 -0
  67. package/node_modules/@sdd-agent-platform/core/dist/context-offload.js.map +1 -0
  68. package/node_modules/@sdd-agent-platform/core/dist/context.d.ts +6 -0
  69. package/node_modules/@sdd-agent-platform/core/dist/context.js +7 -0
  70. package/node_modules/@sdd-agent-platform/core/dist/context.js.map +1 -0
  71. package/node_modules/@sdd-agent-platform/core/dist/contracts/issues.d.ts +7 -0
  72. package/node_modules/@sdd-agent-platform/core/dist/contracts/issues.js +7 -0
  73. package/node_modules/@sdd-agent-platform/core/dist/contracts/issues.js.map +1 -0
  74. package/node_modules/@sdd-agent-platform/core/dist/contracts.d.ts +110 -0
  75. package/node_modules/@sdd-agent-platform/core/dist/contracts.js +75 -0
  76. package/node_modules/@sdd-agent-platform/core/dist/contracts.js.map +1 -0
  77. package/node_modules/@sdd-agent-platform/core/dist/delegation/model.d.ts +21 -0
  78. package/node_modules/@sdd-agent-platform/core/dist/delegation/model.js +2 -0
  79. package/node_modules/@sdd-agent-platform/core/dist/delegation/model.js.map +1 -0
  80. package/node_modules/@sdd-agent-platform/core/dist/delegation/queue.d.ts +10 -0
  81. package/node_modules/@sdd-agent-platform/core/dist/delegation/queue.js +47 -0
  82. package/node_modules/@sdd-agent-platform/core/dist/delegation/queue.js.map +1 -0
  83. package/node_modules/@sdd-agent-platform/core/dist/delegation/run-state.d.ts +2 -0
  84. package/node_modules/@sdd-agent-platform/core/dist/delegation/run-state.js +13 -0
  85. package/node_modules/@sdd-agent-platform/core/dist/delegation/run-state.js.map +1 -0
  86. package/node_modules/@sdd-agent-platform/core/dist/delegation/state-machine.d.ts +30 -0
  87. package/node_modules/@sdd-agent-platform/core/dist/delegation/state-machine.js +56 -0
  88. package/node_modules/@sdd-agent-platform/core/dist/delegation/state-machine.js.map +1 -0
  89. package/node_modules/@sdd-agent-platform/core/dist/delegation/validation.d.ts +28 -0
  90. package/node_modules/@sdd-agent-platform/core/dist/delegation/validation.js +100 -0
  91. package/node_modules/@sdd-agent-platform/core/dist/delegation/validation.js.map +1 -0
  92. package/node_modules/@sdd-agent-platform/core/dist/delegation.d.ts +7 -0
  93. package/node_modules/@sdd-agent-platform/core/dist/delegation.js +6 -0
  94. package/node_modules/@sdd-agent-platform/core/dist/delegation.js.map +1 -0
  95. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/ai-entries.d.ts +2 -0
  96. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/ai-entries.js +26 -0
  97. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/ai-entries.js.map +1 -0
  98. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/document-chain.d.ts +2 -0
  99. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/document-chain.js +104 -0
  100. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/document-chain.js.map +1 -0
  101. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/local-run-index.d.ts +2 -0
  102. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/local-run-index.js +26 -0
  103. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/local-run-index.js.map +1 -0
  104. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/project.d.ts +11 -0
  105. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/project.js +78 -0
  106. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/project.js.map +1 -0
  107. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/registries.d.ts +11 -0
  108. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/registries.js +247 -0
  109. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/registries.js.map +1 -0
  110. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-evidence.d.ts +6 -0
  111. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-evidence.js +313 -0
  112. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-evidence.js.map +1 -0
  113. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-records.d.ts +4 -0
  114. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-records.js +68 -0
  115. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-records.js.map +1 -0
  116. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-trust.d.ts +3 -0
  117. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-trust.js +121 -0
  118. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-trust.js.map +1 -0
  119. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/runtime-contracts.d.ts +11 -0
  120. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/runtime-contracts.js +279 -0
  121. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/runtime-contracts.js.map +1 -0
  122. package/node_modules/@sdd-agent-platform/core/dist/doctor/doctor.d.ts +6 -0
  123. package/node_modules/@sdd-agent-platform/core/dist/doctor/doctor.js +292 -0
  124. package/node_modules/@sdd-agent-platform/core/dist/doctor/doctor.js.map +1 -0
  125. package/node_modules/@sdd-agent-platform/core/dist/doctor/model.d.ts +11 -0
  126. package/node_modules/@sdd-agent-platform/core/dist/doctor/model.js +2 -0
  127. package/node_modules/@sdd-agent-platform/core/dist/doctor/model.js.map +1 -0
  128. package/node_modules/@sdd-agent-platform/core/dist/doctor/render.d.ts +2 -0
  129. package/node_modules/@sdd-agent-platform/core/dist/doctor/render.js +44 -0
  130. package/node_modules/@sdd-agent-platform/core/dist/doctor/render.js.map +1 -0
  131. package/node_modules/@sdd-agent-platform/core/dist/doctor/summary.d.ts +2 -0
  132. package/node_modules/@sdd-agent-platform/core/dist/doctor/summary.js +10 -0
  133. package/node_modules/@sdd-agent-platform/core/dist/doctor/summary.js.map +1 -0
  134. package/node_modules/@sdd-agent-platform/core/dist/doctor.d.ts +2 -0
  135. package/node_modules/@sdd-agent-platform/core/dist/doctor.js +3 -0
  136. package/node_modules/@sdd-agent-platform/core/dist/doctor.js.map +1 -0
  137. package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.d.ts +23 -0
  138. package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.js +54 -0
  139. package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.js.map +1 -0
  140. package/node_modules/@sdd-agent-platform/core/dist/evidence-runtime/contracts.d.ts +44 -0
  141. package/node_modules/@sdd-agent-platform/core/dist/evidence-runtime/contracts.js +2 -0
  142. package/node_modules/@sdd-agent-platform/core/dist/evidence-runtime/contracts.js.map +1 -0
  143. package/node_modules/@sdd-agent-platform/core/dist/evidence-runtime.d.ts +1 -0
  144. package/node_modules/@sdd-agent-platform/core/dist/evidence-runtime.js +2 -0
  145. package/node_modules/@sdd-agent-platform/core/dist/evidence-runtime.js.map +1 -0
  146. package/node_modules/@sdd-agent-platform/core/dist/execution/agent-execution-records.d.ts +31 -0
  147. package/node_modules/@sdd-agent-platform/core/dist/execution/agent-execution-records.js +170 -0
  148. package/node_modules/@sdd-agent-platform/core/dist/execution/agent-execution-records.js.map +1 -0
  149. package/node_modules/@sdd-agent-platform/core/dist/execution/background-executor.d.ts +44 -0
  150. package/node_modules/@sdd-agent-platform/core/dist/execution/background-executor.js +249 -0
  151. package/node_modules/@sdd-agent-platform/core/dist/execution/background-executor.js.map +1 -0
  152. package/node_modules/@sdd-agent-platform/core/dist/execution/foreground-subagents.d.ts +55 -0
  153. package/node_modules/@sdd-agent-platform/core/dist/execution/foreground-subagents.js +363 -0
  154. package/node_modules/@sdd-agent-platform/core/dist/execution/foreground-subagents.js.map +1 -0
  155. package/node_modules/@sdd-agent-platform/core/dist/execution/host-invocation.d.ts +27 -0
  156. package/node_modules/@sdd-agent-platform/core/dist/execution/host-invocation.js +185 -0
  157. package/node_modules/@sdd-agent-platform/core/dist/execution/host-invocation.js.map +1 -0
  158. package/node_modules/@sdd-agent-platform/core/dist/execution/resident-worker.d.ts +100 -0
  159. package/node_modules/@sdd-agent-platform/core/dist/execution/resident-worker.js +327 -0
  160. package/node_modules/@sdd-agent-platform/core/dist/execution/resident-worker.js.map +1 -0
  161. package/node_modules/@sdd-agent-platform/core/dist/execution/stage-team-runtime.d.ts +112 -0
  162. package/node_modules/@sdd-agent-platform/core/dist/execution/stage-team-runtime.js +145 -0
  163. package/node_modules/@sdd-agent-platform/core/dist/execution/stage-team-runtime.js.map +1 -0
  164. package/node_modules/@sdd-agent-platform/core/dist/execution/wave-executor.d.ts +45 -0
  165. package/node_modules/@sdd-agent-platform/core/dist/execution/wave-executor.js +178 -0
  166. package/node_modules/@sdd-agent-platform/core/dist/execution/wave-executor.js.map +1 -0
  167. package/node_modules/@sdd-agent-platform/core/dist/execution.d.ts +5 -0
  168. package/node_modules/@sdd-agent-platform/core/dist/execution.js +6 -0
  169. package/node_modules/@sdd-agent-platform/core/dist/execution.js.map +1 -0
  170. package/node_modules/@sdd-agent-platform/core/dist/governance/policy.d.ts +53 -0
  171. package/node_modules/@sdd-agent-platform/core/dist/governance/policy.js +111 -0
  172. package/node_modules/@sdd-agent-platform/core/dist/governance/policy.js.map +1 -0
  173. package/node_modules/@sdd-agent-platform/core/dist/governance.d.ts +1 -0
  174. package/node_modules/@sdd-agent-platform/core/dist/governance.js +2 -0
  175. package/node_modules/@sdd-agent-platform/core/dist/governance.js.map +1 -0
  176. package/node_modules/@sdd-agent-platform/core/dist/index.d.ts +1 -0
  177. package/node_modules/@sdd-agent-platform/core/dist/index.js +2 -0
  178. package/node_modules/@sdd-agent-platform/core/dist/index.js.map +1 -0
  179. package/{dist/packages/core/src → node_modules/@sdd-agent-platform/core/dist}/instructions.d.ts +1 -1
  180. package/node_modules/@sdd-agent-platform/core/dist/instructions.js +147 -0
  181. package/node_modules/@sdd-agent-platform/core/dist/instructions.js.map +1 -0
  182. package/node_modules/@sdd-agent-platform/core/dist/lifecycle/decision-gate.d.ts +39 -0
  183. package/node_modules/@sdd-agent-platform/core/dist/lifecycle/decision-gate.js +319 -0
  184. package/node_modules/@sdd-agent-platform/core/dist/lifecycle/decision-gate.js.map +1 -0
  185. package/node_modules/@sdd-agent-platform/core/dist/lifecycle/rendering.d.ts +2 -0
  186. package/node_modules/@sdd-agent-platform/core/dist/lifecycle/rendering.js +27 -0
  187. package/node_modules/@sdd-agent-platform/core/dist/lifecycle/rendering.js.map +1 -0
  188. package/node_modules/@sdd-agent-platform/core/dist/lifecycle/risk-signals.d.ts +57 -0
  189. package/node_modules/@sdd-agent-platform/core/dist/lifecycle/risk-signals.js +80 -0
  190. package/node_modules/@sdd-agent-platform/core/dist/lifecycle/risk-signals.js.map +1 -0
  191. package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.d.ts +44 -0
  192. package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.js +207 -0
  193. package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.js.map +1 -0
  194. package/node_modules/@sdd-agent-platform/core/dist/lifecycle.d.ts +4 -0
  195. package/node_modules/@sdd-agent-platform/core/dist/lifecycle.js +5 -0
  196. package/node_modules/@sdd-agent-platform/core/dist/lifecycle.js.map +1 -0
  197. package/node_modules/@sdd-agent-platform/core/dist/orchestration/contracts.d.ts +45 -0
  198. package/node_modules/@sdd-agent-platform/core/dist/orchestration/contracts.js +2 -0
  199. package/node_modules/@sdd-agent-platform/core/dist/orchestration/contracts.js.map +1 -0
  200. package/node_modules/@sdd-agent-platform/core/dist/orchestration/index.d.ts +2 -0
  201. package/node_modules/@sdd-agent-platform/core/dist/orchestration/index.js +3 -0
  202. package/node_modules/@sdd-agent-platform/core/dist/orchestration/index.js.map +1 -0
  203. package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.d.ts +55 -0
  204. package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.js +314 -0
  205. package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.js.map +1 -0
  206. package/node_modules/@sdd-agent-platform/core/dist/path-safety.js.map +1 -0
  207. package/node_modules/@sdd-agent-platform/core/dist/planning/task-graph.d.ts +57 -0
  208. package/node_modules/@sdd-agent-platform/core/dist/planning/task-graph.js +157 -0
  209. package/node_modules/@sdd-agent-platform/core/dist/planning/task-graph.js.map +1 -0
  210. package/node_modules/@sdd-agent-platform/core/dist/planning/wave-plan.d.ts +37 -0
  211. package/node_modules/@sdd-agent-platform/core/dist/planning/wave-plan.js +119 -0
  212. package/node_modules/@sdd-agent-platform/core/dist/planning/wave-plan.js.map +1 -0
  213. package/node_modules/@sdd-agent-platform/core/dist/planning.d.ts +2 -0
  214. package/node_modules/@sdd-agent-platform/core/dist/planning.js +3 -0
  215. package/node_modules/@sdd-agent-platform/core/dist/planning.js.map +1 -0
  216. package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.d.ts +70 -0
  217. package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.js +267 -0
  218. package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.js.map +1 -0
  219. package/node_modules/@sdd-agent-platform/core/dist/registries/agent-registry.d.ts +22 -0
  220. package/node_modules/@sdd-agent-platform/core/dist/registries/agent-registry.js +121 -0
  221. package/node_modules/@sdd-agent-platform/core/dist/registries/agent-registry.js.map +1 -0
  222. package/node_modules/@sdd-agent-platform/core/dist/registries/agent-runtime-static.d.ts +61 -0
  223. package/node_modules/@sdd-agent-platform/core/dist/registries/agent-runtime-static.js +69 -0
  224. package/node_modules/@sdd-agent-platform/core/dist/registries/agent-runtime-static.js.map +1 -0
  225. package/node_modules/@sdd-agent-platform/core/dist/registries/capability-sources.d.ts +2 -0
  226. package/node_modules/@sdd-agent-platform/core/dist/registries/capability-sources.js +226 -0
  227. package/node_modules/@sdd-agent-platform/core/dist/registries/capability-sources.js.map +1 -0
  228. package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.d.ts +70 -0
  229. package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.js +220 -0
  230. package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.js.map +1 -0
  231. package/node_modules/@sdd-agent-platform/core/dist/registries/eval-learning-context.d.ts +64 -0
  232. package/node_modules/@sdd-agent-platform/core/dist/registries/eval-learning-context.js +161 -0
  233. package/node_modules/@sdd-agent-platform/core/dist/registries/eval-learning-context.js.map +1 -0
  234. package/node_modules/@sdd-agent-platform/core/dist/registries/query-status.d.ts +28 -0
  235. package/node_modules/@sdd-agent-platform/core/dist/registries/query-status.js +84 -0
  236. package/node_modules/@sdd-agent-platform/core/dist/registries/query-status.js.map +1 -0
  237. package/node_modules/@sdd-agent-platform/core/dist/registries/skill-capabilities.d.ts +22 -0
  238. package/node_modules/@sdd-agent-platform/core/dist/registries/skill-capabilities.js +16 -0
  239. package/node_modules/@sdd-agent-platform/core/dist/registries/skill-capabilities.js.map +1 -0
  240. package/node_modules/@sdd-agent-platform/core/dist/registries/tool-capabilities.d.ts +20 -0
  241. package/node_modules/@sdd-agent-platform/core/dist/registries/tool-capabilities.js +111 -0
  242. package/node_modules/@sdd-agent-platform/core/dist/registries/tool-capabilities.js.map +1 -0
  243. package/node_modules/@sdd-agent-platform/core/dist/registries/tool-plugins.d.ts +21 -0
  244. package/node_modules/@sdd-agent-platform/core/dist/registries/tool-plugins.js +107 -0
  245. package/node_modules/@sdd-agent-platform/core/dist/registries/tool-plugins.js.map +1 -0
  246. package/node_modules/@sdd-agent-platform/core/dist/registries/worker-adapters.d.ts +38 -0
  247. package/node_modules/@sdd-agent-platform/core/dist/registries/worker-adapters.js +99 -0
  248. package/node_modules/@sdd-agent-platform/core/dist/registries/worker-adapters.js.map +1 -0
  249. package/node_modules/@sdd-agent-platform/core/dist/registries/workflow-gates.d.ts +19 -0
  250. package/node_modules/@sdd-agent-platform/core/dist/registries/workflow-gates.js +89 -0
  251. package/node_modules/@sdd-agent-platform/core/dist/registries/workflow-gates.js.map +1 -0
  252. package/node_modules/@sdd-agent-platform/core/dist/registries.d.ts +14 -0
  253. package/node_modules/@sdd-agent-platform/core/dist/registries.js +13 -0
  254. package/node_modules/@sdd-agent-platform/core/dist/registries.js.map +1 -0
  255. package/node_modules/@sdd-agent-platform/core/dist/risk/consumer-diagnostics.d.ts +18 -0
  256. package/node_modules/@sdd-agent-platform/core/dist/risk/consumer-diagnostics.js +77 -0
  257. package/node_modules/@sdd-agent-platform/core/dist/risk/consumer-diagnostics.js.map +1 -0
  258. package/node_modules/@sdd-agent-platform/core/dist/risk/contracts.d.ts +57 -0
  259. package/node_modules/@sdd-agent-platform/core/dist/risk/contracts.js +2 -0
  260. package/node_modules/@sdd-agent-platform/core/dist/risk/contracts.js.map +1 -0
  261. package/node_modules/@sdd-agent-platform/core/dist/risk/kernel.d.ts +20 -0
  262. package/node_modules/@sdd-agent-platform/core/dist/risk/kernel.js +195 -0
  263. package/node_modules/@sdd-agent-platform/core/dist/risk/kernel.js.map +1 -0
  264. package/node_modules/@sdd-agent-platform/core/dist/risk/legacy-adapters.d.ts +33 -0
  265. package/node_modules/@sdd-agent-platform/core/dist/risk/legacy-adapters.js +215 -0
  266. package/node_modules/@sdd-agent-platform/core/dist/risk/legacy-adapters.js.map +1 -0
  267. package/node_modules/@sdd-agent-platform/core/dist/risk/workflow-gates.d.ts +24 -0
  268. package/node_modules/@sdd-agent-platform/core/dist/risk/workflow-gates.js +160 -0
  269. package/node_modules/@sdd-agent-platform/core/dist/risk/workflow-gates.js.map +1 -0
  270. package/node_modules/@sdd-agent-platform/core/dist/risk.d.ts +5 -0
  271. package/node_modules/@sdd-agent-platform/core/dist/risk.js +6 -0
  272. package/node_modules/@sdd-agent-platform/core/dist/risk.js.map +1 -0
  273. package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime-config.d.ts +4 -0
  274. package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime-config.js +278 -0
  275. package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime-config.js.map +1 -0
  276. package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime.d.ts +343 -0
  277. package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime.js +2 -0
  278. package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime.js.map +1 -0
  279. package/node_modules/@sdd-agent-platform/core/dist/router/profile-resolution.d.ts +18 -0
  280. package/node_modules/@sdd-agent-platform/core/dist/router/profile-resolution.js +127 -0
  281. package/node_modules/@sdd-agent-platform/core/dist/router/profile-resolution.js.map +1 -0
  282. package/node_modules/@sdd-agent-platform/core/dist/router/risk-policy.d.ts +6 -0
  283. package/node_modules/@sdd-agent-platform/core/dist/router/risk-policy.js +28 -0
  284. package/node_modules/@sdd-agent-platform/core/dist/router/risk-policy.js.map +1 -0
  285. package/node_modules/@sdd-agent-platform/core/dist/router/route-cache.d.ts +39 -0
  286. package/node_modules/@sdd-agent-platform/core/dist/router/route-cache.js +59 -0
  287. package/node_modules/@sdd-agent-platform/core/dist/router/route-cache.js.map +1 -0
  288. package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.d.ts +14 -0
  289. package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.js +318 -0
  290. package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.js.map +1 -0
  291. package/node_modules/@sdd-agent-platform/core/dist/router/route-sdd-task.d.ts +3 -0
  292. package/node_modules/@sdd-agent-platform/core/dist/router/route-sdd-task.js +4 -0
  293. package/node_modules/@sdd-agent-platform/core/dist/router/route-sdd-task.js.map +1 -0
  294. package/node_modules/@sdd-agent-platform/core/dist/router/routing-rules.d.ts +4 -0
  295. package/node_modules/@sdd-agent-platform/core/dist/router/routing-rules.js +68 -0
  296. package/node_modules/@sdd-agent-platform/core/dist/router/routing-rules.js.map +1 -0
  297. package/node_modules/@sdd-agent-platform/core/dist/router/routing.d.ts +18 -0
  298. package/node_modules/@sdd-agent-platform/core/dist/router/routing.js +169 -0
  299. package/node_modules/@sdd-agent-platform/core/dist/router/routing.js.map +1 -0
  300. package/node_modules/@sdd-agent-platform/core/dist/router/runtime-inspection.d.ts +7 -0
  301. package/node_modules/@sdd-agent-platform/core/dist/router/runtime-inspection.js +102 -0
  302. package/node_modules/@sdd-agent-platform/core/dist/router/runtime-inspection.js.map +1 -0
  303. package/node_modules/@sdd-agent-platform/core/dist/router/runtime-registry.d.ts +17 -0
  304. package/node_modules/@sdd-agent-platform/core/dist/router/runtime-registry.js +82 -0
  305. package/node_modules/@sdd-agent-platform/core/dist/router/runtime-registry.js.map +1 -0
  306. package/node_modules/@sdd-agent-platform/core/dist/router/runtime-validation.d.ts +26 -0
  307. package/node_modules/@sdd-agent-platform/core/dist/router/runtime-validation.js +235 -0
  308. package/node_modules/@sdd-agent-platform/core/dist/router/runtime-validation.js.map +1 -0
  309. package/node_modules/@sdd-agent-platform/core/dist/router/team-mode.d.ts +16 -0
  310. package/node_modules/@sdd-agent-platform/core/dist/router/team-mode.js +134 -0
  311. package/node_modules/@sdd-agent-platform/core/dist/router/team-mode.js.map +1 -0
  312. package/node_modules/@sdd-agent-platform/core/dist/router.d.ts +4 -0
  313. package/node_modules/@sdd-agent-platform/core/dist/router.js +5 -0
  314. package/node_modules/@sdd-agent-platform/core/dist/router.js.map +1 -0
  315. package/node_modules/@sdd-agent-platform/core/dist/run-state/artifacts.d.ts +6 -0
  316. package/node_modules/@sdd-agent-platform/core/dist/run-state/artifacts.js +113 -0
  317. package/node_modules/@sdd-agent-platform/core/dist/run-state/artifacts.js.map +1 -0
  318. package/node_modules/@sdd-agent-platform/core/dist/run-state/events.d.ts +3 -0
  319. package/node_modules/@sdd-agent-platform/core/dist/run-state/events.js +23 -0
  320. package/node_modules/@sdd-agent-platform/core/dist/run-state/events.js.map +1 -0
  321. package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.d.ts +102 -0
  322. package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.js +83 -0
  323. package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.js.map +1 -0
  324. package/node_modules/@sdd-agent-platform/core/dist/run-state/invocation-ledger.d.ts +18 -0
  325. package/node_modules/@sdd-agent-platform/core/dist/run-state/invocation-ledger.js +99 -0
  326. package/node_modules/@sdd-agent-platform/core/dist/run-state/invocation-ledger.js.map +1 -0
  327. package/node_modules/@sdd-agent-platform/core/dist/run-state/model.d.ts +203 -0
  328. package/node_modules/@sdd-agent-platform/core/dist/run-state/model.js +2 -0
  329. package/node_modules/@sdd-agent-platform/core/dist/run-state/model.js.map +1 -0
  330. package/node_modules/@sdd-agent-platform/core/dist/run-state/run-index.d.ts +97 -0
  331. package/node_modules/@sdd-agent-platform/core/dist/run-state/run-index.js +238 -0
  332. package/node_modules/@sdd-agent-platform/core/dist/run-state/run-index.js.map +1 -0
  333. package/node_modules/@sdd-agent-platform/core/dist/run-state/run-state.d.ts +20 -0
  334. package/node_modules/@sdd-agent-platform/core/dist/run-state/run-state.js +366 -0
  335. package/node_modules/@sdd-agent-platform/core/dist/run-state/run-state.js.map +1 -0
  336. package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.d.ts +62 -0
  337. package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.js +130 -0
  338. package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.js.map +1 -0
  339. package/node_modules/@sdd-agent-platform/core/dist/run-state.d.ts +8 -0
  340. package/node_modules/@sdd-agent-platform/core/dist/run-state.js +9 -0
  341. package/node_modules/@sdd-agent-platform/core/dist/run-state.js.map +1 -0
  342. package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/build.d.ts +2 -0
  343. package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/build.js +61 -0
  344. package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/build.js.map +1 -0
  345. package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/findings.d.ts +4 -0
  346. package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/findings.js +274 -0
  347. package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/findings.js.map +1 -0
  348. package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/model.d.ts +175 -0
  349. package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/model.js +2 -0
  350. package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/model.js.map +1 -0
  351. package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis.d.ts +3 -0
  352. package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis.js +4 -0
  353. package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis.js.map +1 -0
  354. package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.d.ts +35 -0
  355. package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.js +142 -0
  356. package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.js.map +1 -0
  357. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/context.d.ts +18 -0
  358. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/context.js +89 -0
  359. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/context.js.map +1 -0
  360. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.d.ts +4 -0
  361. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.js +189 -0
  362. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.js.map +1 -0
  363. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/run-binding.d.ts +6 -0
  364. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/run-binding.js +88 -0
  365. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/run-binding.js.map +1 -0
  366. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-inspection.d.ts +6 -0
  367. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-inspection.js +31 -0
  368. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-inspection.js.map +1 -0
  369. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.d.ts +98 -0
  370. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.js +538 -0
  371. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.js.map +1 -0
  372. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-rendering.d.ts +5 -0
  373. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-rendering.js +77 -0
  374. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-rendering.js.map +1 -0
  375. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs.d.ts +5 -0
  376. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs.js +6 -0
  377. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs.js.map +1 -0
  378. package/node_modules/@sdd-agent-platform/core/dist/stage-runtime/contracts.d.ts +37 -0
  379. package/node_modules/@sdd-agent-platform/core/dist/stage-runtime/contracts.js +2 -0
  380. package/node_modules/@sdd-agent-platform/core/dist/stage-runtime/contracts.js.map +1 -0
  381. package/node_modules/@sdd-agent-platform/core/dist/stage-runtime/runtime.d.ts +71 -0
  382. package/node_modules/@sdd-agent-platform/core/dist/stage-runtime/runtime.js +275 -0
  383. package/node_modules/@sdd-agent-platform/core/dist/stage-runtime/runtime.js.map +1 -0
  384. package/node_modules/@sdd-agent-platform/core/dist/stage-runtime.d.ts +2 -0
  385. package/node_modules/@sdd-agent-platform/core/dist/stage-runtime.js +3 -0
  386. package/node_modules/@sdd-agent-platform/core/dist/stage-runtime.js.map +1 -0
  387. package/node_modules/@sdd-agent-platform/core/dist/status/project-status.d.ts +166 -0
  388. package/node_modules/@sdd-agent-platform/core/dist/status/project-status.js +439 -0
  389. package/node_modules/@sdd-agent-platform/core/dist/status/project-status.js.map +1 -0
  390. package/node_modules/@sdd-agent-platform/core/dist/status.d.ts +2 -0
  391. package/node_modules/@sdd-agent-platform/core/dist/status.js +3 -0
  392. package/node_modules/@sdd-agent-platform/core/dist/status.js.map +1 -0
  393. package/node_modules/@sdd-agent-platform/core/dist/storage/json-io.d.ts +1 -0
  394. package/node_modules/@sdd-agent-platform/core/dist/storage/json-io.js +11 -0
  395. package/node_modules/@sdd-agent-platform/core/dist/storage/json-io.js.map +1 -0
  396. package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.d.ts +305 -0
  397. package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.js +859 -0
  398. package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.js.map +1 -0
  399. package/node_modules/@sdd-agent-platform/core/dist/subagents/contracts.d.ts +41 -0
  400. package/node_modules/@sdd-agent-platform/core/dist/subagents/contracts.js +2 -0
  401. package/node_modules/@sdd-agent-platform/core/dist/subagents/contracts.js.map +1 -0
  402. package/node_modules/@sdd-agent-platform/core/dist/subagents/runtime.d.ts +43 -0
  403. package/node_modules/@sdd-agent-platform/core/dist/subagents/runtime.js +262 -0
  404. package/node_modules/@sdd-agent-platform/core/dist/subagents/runtime.js.map +1 -0
  405. package/node_modules/@sdd-agent-platform/core/dist/subagents.d.ts +2 -0
  406. package/node_modules/@sdd-agent-platform/core/dist/subagents.js +3 -0
  407. package/node_modules/@sdd-agent-platform/core/dist/subagents.js.map +1 -0
  408. package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.d.ts +17 -0
  409. package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.js +243 -0
  410. package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.js.map +1 -0
  411. package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.d.ts +110 -0
  412. package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.js +497 -0
  413. package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.js.map +1 -0
  414. package/node_modules/@sdd-agent-platform/core/dist/sync-back.d.ts +2 -0
  415. package/node_modules/@sdd-agent-platform/core/dist/sync-back.js +3 -0
  416. package/node_modules/@sdd-agent-platform/core/dist/sync-back.js.map +1 -0
  417. package/node_modules/@sdd-agent-platform/core/dist/task-risk-profile.d.ts +33 -0
  418. package/node_modules/@sdd-agent-platform/core/dist/task-risk-profile.js +153 -0
  419. package/node_modules/@sdd-agent-platform/core/dist/task-risk-profile.js.map +1 -0
  420. package/node_modules/@sdd-agent-platform/core/dist/test-support/fixtures.d.ts +21 -0
  421. package/node_modules/@sdd-agent-platform/core/dist/test-support/fixtures.js +384 -0
  422. package/node_modules/@sdd-agent-platform/core/dist/test-support/fixtures.js.map +1 -0
  423. package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.d.ts +2 -0
  424. package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.js +69 -0
  425. package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.js.map +1 -0
  426. package/node_modules/@sdd-agent-platform/core/dist/test-support.d.ts +2 -0
  427. package/node_modules/@sdd-agent-platform/core/dist/test-support.js +3 -0
  428. package/node_modules/@sdd-agent-platform/core/dist/test-support.js.map +1 -0
  429. package/node_modules/@sdd-agent-platform/core/dist/tsconfig.tsbuildinfo +1 -0
  430. package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.d.ts +50 -0
  431. package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.js +546 -0
  432. package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.js.map +1 -0
  433. package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.d.ts +51 -0
  434. package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.js +129 -0
  435. package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.js.map +1 -0
  436. package/node_modules/@sdd-agent-platform/core/dist/verification/review-gate.d.ts +22 -0
  437. package/node_modules/@sdd-agent-platform/core/dist/verification/review-gate.js +53 -0
  438. package/node_modules/@sdd-agent-platform/core/dist/verification/review-gate.js.map +1 -0
  439. package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.d.ts +29 -0
  440. package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.js +425 -0
  441. package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.js.map +1 -0
  442. package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.d.ts +77 -0
  443. package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.js +877 -0
  444. package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.js.map +1 -0
  445. package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.d.ts +58 -0
  446. package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.js +428 -0
  447. package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.js.map +1 -0
  448. package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.d.ts +44 -0
  449. package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.js +299 -0
  450. package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.js.map +1 -0
  451. package/node_modules/@sdd-agent-platform/core/dist/verification.d.ts +8 -0
  452. package/node_modules/@sdd-agent-platform/core/dist/verification.js +8 -0
  453. package/node_modules/@sdd-agent-platform/core/dist/verification.js.map +1 -0
  454. package/node_modules/@sdd-agent-platform/core/dist/work-units/contracts.d.ts +24 -0
  455. package/node_modules/@sdd-agent-platform/core/dist/work-units/contracts.js +2 -0
  456. package/node_modules/@sdd-agent-platform/core/dist/work-units/contracts.js.map +1 -0
  457. package/node_modules/@sdd-agent-platform/core/dist/work-units/runtime.d.ts +21 -0
  458. package/node_modules/@sdd-agent-platform/core/dist/work-units/runtime.js +90 -0
  459. package/node_modules/@sdd-agent-platform/core/dist/work-units/runtime.js.map +1 -0
  460. package/node_modules/@sdd-agent-platform/core/dist/work-units.d.ts +2 -0
  461. package/node_modules/@sdd-agent-platform/core/dist/work-units.js +3 -0
  462. package/node_modules/@sdd-agent-platform/core/dist/work-units.js.map +1 -0
  463. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.d.ts +24 -0
  464. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.js +182 -0
  465. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.js.map +1 -0
  466. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.d.ts +4 -0
  467. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.js +130 -0
  468. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.js.map +1 -0
  469. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.d.ts +4 -0
  470. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.js +146 -0
  471. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.js.map +1 -0
  472. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/types.d.ts +89 -0
  473. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/types.js +2 -0
  474. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/types.js.map +1 -0
  475. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.d.ts +13 -0
  476. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.js +75 -0
  477. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.js.map +1 -0
  478. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/dependencies.d.ts +29 -0
  479. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/dependencies.js +78 -0
  480. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/dependencies.js.map +1 -0
  481. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.d.ts +38 -0
  482. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.js +122 -0
  483. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.js.map +1 -0
  484. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.d.ts +77 -0
  485. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.js +253 -0
  486. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.js.map +1 -0
  487. package/node_modules/@sdd-agent-platform/core/dist/workflow-state.d.ts +2 -0
  488. package/node_modules/@sdd-agent-platform/core/dist/workflow-state.js +3 -0
  489. package/node_modules/@sdd-agent-platform/core/dist/workflow-state.js.map +1 -0
  490. package/node_modules/@sdd-agent-platform/core/dist/worktree/isolation.d.ts +40 -0
  491. package/node_modules/@sdd-agent-platform/core/dist/worktree/isolation.js +89 -0
  492. package/node_modules/@sdd-agent-platform/core/dist/worktree/isolation.js.map +1 -0
  493. package/node_modules/@sdd-agent-platform/core/dist/worktree/lifecycle.d.ts +39 -0
  494. package/node_modules/@sdd-agent-platform/core/dist/worktree/lifecycle.js +221 -0
  495. package/node_modules/@sdd-agent-platform/core/dist/worktree/lifecycle.js.map +1 -0
  496. package/node_modules/@sdd-agent-platform/core/dist/worktree.d.ts +2 -0
  497. package/node_modules/@sdd-agent-platform/core/dist/worktree.js +3 -0
  498. package/node_modules/@sdd-agent-platform/core/dist/worktree.js.map +1 -0
  499. package/node_modules/@sdd-agent-platform/core/package.json +40 -0
  500. package/node_modules/@sdd-agent-platform/core/src/ai-tools.test.ts +138 -0
  501. package/node_modules/@sdd-agent-platform/core/src/ai-tools.ts +577 -0
  502. package/node_modules/@sdd-agent-platform/core/src/artifacts/ingestion.test.ts +189 -0
  503. package/node_modules/@sdd-agent-platform/core/src/artifacts/ingestion.ts +222 -0
  504. package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-evidence.test.ts +28 -0
  505. package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-evidence.ts +302 -0
  506. package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-result.test.ts +181 -0
  507. package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-result.ts +231 -0
  508. package/node_modules/@sdd-agent-platform/core/src/artifacts/templates.ts +99 -0
  509. package/node_modules/@sdd-agent-platform/core/src/artifacts.ts +4 -0
  510. package/node_modules/@sdd-agent-platform/core/src/coding-facts/contracts.ts +79 -0
  511. package/node_modules/@sdd-agent-platform/core/src/coding-facts.ts +1 -0
  512. package/node_modules/@sdd-agent-platform/core/src/config/init-project.test.ts +306 -0
  513. package/node_modules/@sdd-agent-platform/core/src/config/init-project.ts +120 -0
  514. package/node_modules/@sdd-agent-platform/core/src/config/project-config.ts +259 -0
  515. package/node_modules/@sdd-agent-platform/core/src/config/project-detection.ts +147 -0
  516. package/node_modules/@sdd-agent-platform/core/src/config/project-status.ts +1 -0
  517. package/node_modules/@sdd-agent-platform/core/src/config/starter-documents.ts +445 -0
  518. package/node_modules/@sdd-agent-platform/core/src/context/budget.ts +30 -0
  519. package/node_modules/@sdd-agent-platform/core/src/context/build-package.ts +317 -0
  520. package/node_modules/@sdd-agent-platform/core/src/context/command-summary.ts +45 -0
  521. package/node_modules/@sdd-agent-platform/core/src/context/context-build.test.ts +188 -0
  522. package/node_modules/@sdd-agent-platform/core/src/context/evidence-summary.ts +144 -0
  523. package/node_modules/@sdd-agent-platform/core/src/context/log-worker.ts +48 -0
  524. package/node_modules/@sdd-agent-platform/core/src/context/source-refs.ts +41 -0
  525. package/node_modules/@sdd-agent-platform/core/src/context-offload/contracts.ts +47 -0
  526. package/node_modules/@sdd-agent-platform/core/src/context-offload/runtime.test.ts +71 -0
  527. package/node_modules/@sdd-agent-platform/core/src/context-offload/runtime.ts +178 -0
  528. package/node_modules/@sdd-agent-platform/core/src/context-offload.ts +2 -0
  529. package/node_modules/@sdd-agent-platform/core/src/context.ts +6 -0
  530. package/node_modules/@sdd-agent-platform/core/src/contracts/issues.ts +13 -0
  531. package/node_modules/@sdd-agent-platform/core/src/contracts.test.ts +9 -0
  532. package/node_modules/@sdd-agent-platform/core/src/contracts.ts +116 -0
  533. package/node_modules/@sdd-agent-platform/core/src/delegation/delegation.test.ts +183 -0
  534. package/node_modules/@sdd-agent-platform/core/src/delegation/model.ts +23 -0
  535. package/node_modules/@sdd-agent-platform/core/src/delegation/queue.ts +58 -0
  536. package/node_modules/@sdd-agent-platform/core/src/delegation/run-state.ts +14 -0
  537. package/node_modules/@sdd-agent-platform/core/src/delegation/state-machine.ts +90 -0
  538. package/node_modules/@sdd-agent-platform/core/src/delegation/validation.ts +124 -0
  539. package/node_modules/@sdd-agent-platform/core/src/delegation.ts +26 -0
  540. package/node_modules/@sdd-agent-platform/core/src/doctor/checks/ai-entries.ts +28 -0
  541. package/node_modules/@sdd-agent-platform/core/src/doctor/checks/document-chain.ts +112 -0
  542. package/node_modules/@sdd-agent-platform/core/src/doctor/checks/local-run-index.ts +27 -0
  543. package/node_modules/@sdd-agent-platform/core/src/doctor/checks/project.ts +84 -0
  544. package/node_modules/@sdd-agent-platform/core/src/doctor/checks/registries.ts +252 -0
  545. package/node_modules/@sdd-agent-platform/core/src/doctor/checks/run-evidence.ts +330 -0
  546. package/node_modules/@sdd-agent-platform/core/src/doctor/checks/run-records.ts +79 -0
  547. package/node_modules/@sdd-agent-platform/core/src/doctor/checks/run-trust.ts +128 -0
  548. package/node_modules/@sdd-agent-platform/core/src/doctor/checks/runtime-contracts.ts +300 -0
  549. package/node_modules/@sdd-agent-platform/core/src/doctor/doctor.test.ts +657 -0
  550. package/node_modules/@sdd-agent-platform/core/src/doctor/doctor.ts +319 -0
  551. package/node_modules/@sdd-agent-platform/core/src/doctor/model.ts +13 -0
  552. package/node_modules/@sdd-agent-platform/core/src/doctor/summary.ts +11 -0
  553. package/node_modules/@sdd-agent-platform/core/src/doctor.ts +2 -0
  554. package/node_modules/@sdd-agent-platform/core/src/evidence/lookup.ts +80 -0
  555. package/node_modules/@sdd-agent-platform/core/src/evidence-runtime/contracts.ts +49 -0
  556. package/node_modules/@sdd-agent-platform/core/src/evidence-runtime.ts +1 -0
  557. package/node_modules/@sdd-agent-platform/core/src/execution/agent-execution-records.ts +195 -0
  558. package/node_modules/@sdd-agent-platform/core/src/execution/background-executor.test.ts +187 -0
  559. package/node_modules/@sdd-agent-platform/core/src/execution/background-executor.ts +305 -0
  560. package/node_modules/@sdd-agent-platform/core/src/execution/foreground-subagents.test.ts +97 -0
  561. package/node_modules/@sdd-agent-platform/core/src/execution/foreground-subagents.ts +453 -0
  562. package/node_modules/@sdd-agent-platform/core/src/execution/host-invocation.ts +225 -0
  563. package/node_modules/@sdd-agent-platform/core/src/execution/resident-worker.test.ts +132 -0
  564. package/node_modules/@sdd-agent-platform/core/src/execution/resident-worker.ts +436 -0
  565. package/node_modules/@sdd-agent-platform/core/src/execution/stage-team-runtime.test.ts +102 -0
  566. package/node_modules/@sdd-agent-platform/core/src/execution/stage-team-runtime.ts +271 -0
  567. package/node_modules/@sdd-agent-platform/core/src/execution/wave-executor.test.ts +111 -0
  568. package/node_modules/@sdd-agent-platform/core/src/execution/wave-executor.ts +231 -0
  569. package/node_modules/@sdd-agent-platform/core/src/execution.ts +5 -0
  570. package/node_modules/@sdd-agent-platform/core/src/governance/policy.test.ts +57 -0
  571. package/node_modules/@sdd-agent-platform/core/src/governance/policy.ts +175 -0
  572. package/node_modules/@sdd-agent-platform/core/src/governance.ts +1 -0
  573. package/node_modules/@sdd-agent-platform/core/src/index.test.ts +25 -0
  574. package/node_modules/@sdd-agent-platform/core/src/index.ts +1 -0
  575. package/node_modules/@sdd-agent-platform/core/src/instructions.test.ts +49 -0
  576. package/node_modules/@sdd-agent-platform/core/src/instructions.ts +165 -0
  577. package/node_modules/@sdd-agent-platform/core/src/lifecycle/decision-gate.test.ts +174 -0
  578. package/node_modules/@sdd-agent-platform/core/src/lifecycle/decision-gate.ts +373 -0
  579. package/node_modules/@sdd-agent-platform/core/src/lifecycle/rendering.ts +29 -0
  580. package/node_modules/@sdd-agent-platform/core/src/lifecycle/risk-signals.ts +146 -0
  581. package/node_modules/@sdd-agent-platform/core/src/lifecycle/ship.ts +263 -0
  582. package/node_modules/@sdd-agent-platform/core/src/lifecycle.ts +4 -0
  583. package/node_modules/@sdd-agent-platform/core/src/orchestration/contracts.ts +50 -0
  584. package/node_modules/@sdd-agent-platform/core/src/orchestration/index.ts +2 -0
  585. package/node_modules/@sdd-agent-platform/core/src/orchestration/runtime.ts +342 -0
  586. package/node_modules/@sdd-agent-platform/core/src/path-safety.test.ts +22 -0
  587. package/node_modules/@sdd-agent-platform/core/src/path-safety.ts +37 -0
  588. package/node_modules/@sdd-agent-platform/core/src/phase8-contracts.test.ts +243 -0
  589. package/node_modules/@sdd-agent-platform/core/src/phase8-projection-compat.test.ts +153 -0
  590. package/node_modules/@sdd-agent-platform/core/src/phase8-risk-kernel.test.ts +277 -0
  591. package/node_modules/@sdd-agent-platform/core/src/planning/task-graph.test.ts +88 -0
  592. package/node_modules/@sdd-agent-platform/core/src/planning/task-graph.ts +222 -0
  593. package/node_modules/@sdd-agent-platform/core/src/planning/wave-plan.test.ts +79 -0
  594. package/node_modules/@sdd-agent-platform/core/src/planning/wave-plan.ts +160 -0
  595. package/node_modules/@sdd-agent-platform/core/src/planning.ts +2 -0
  596. package/node_modules/@sdd-agent-platform/core/src/registries/agent-capability-catalog.ts +426 -0
  597. package/node_modules/@sdd-agent-platform/core/src/registries/agent-registry.ts +146 -0
  598. package/node_modules/@sdd-agent-platform/core/src/registries/agent-runtime-static.ts +142 -0
  599. package/node_modules/@sdd-agent-platform/core/src/registries/capability-sources.ts +253 -0
  600. package/node_modules/@sdd-agent-platform/core/src/registries/command-team-runtime.ts +309 -0
  601. package/node_modules/@sdd-agent-platform/core/src/registries/eval-learning-context.ts +246 -0
  602. package/node_modules/@sdd-agent-platform/core/src/registries/query-status.ts +119 -0
  603. package/node_modules/@sdd-agent-platform/core/src/registries/registries.test.ts +429 -0
  604. package/node_modules/@sdd-agent-platform/core/src/registries/skill-capabilities.ts +37 -0
  605. package/node_modules/@sdd-agent-platform/core/src/registries/tool-capabilities.ts +135 -0
  606. package/node_modules/@sdd-agent-platform/core/src/registries/tool-plugins.ts +132 -0
  607. package/node_modules/@sdd-agent-platform/core/src/registries/worker-adapters.ts +144 -0
  608. package/node_modules/@sdd-agent-platform/core/src/registries/workflow-gates.ts +111 -0
  609. package/node_modules/@sdd-agent-platform/core/src/registries.ts +42 -0
  610. package/node_modules/@sdd-agent-platform/core/src/risk/consumer-diagnostics.ts +97 -0
  611. package/node_modules/@sdd-agent-platform/core/src/risk/contracts.ts +63 -0
  612. package/node_modules/@sdd-agent-platform/core/src/risk/kernel.ts +233 -0
  613. package/node_modules/@sdd-agent-platform/core/src/risk/legacy-adapters.ts +266 -0
  614. package/node_modules/@sdd-agent-platform/core/src/risk/workflow-gates.ts +203 -0
  615. package/node_modules/@sdd-agent-platform/core/src/risk.ts +5 -0
  616. package/node_modules/@sdd-agent-platform/core/src/router/agent-runtime-config.ts +327 -0
  617. package/node_modules/@sdd-agent-platform/core/src/router/agent-runtime.ts +388 -0
  618. package/node_modules/@sdd-agent-platform/core/src/router/profile-resolution.ts +154 -0
  619. package/node_modules/@sdd-agent-platform/core/src/router/risk-policy.ts +33 -0
  620. package/node_modules/@sdd-agent-platform/core/src/router/route-cache.ts +100 -0
  621. package/node_modules/@sdd-agent-platform/core/src/router/route-projection.ts +357 -0
  622. package/node_modules/@sdd-agent-platform/core/src/router/route-sdd-task.test.ts +429 -0
  623. package/node_modules/@sdd-agent-platform/core/src/router/route-sdd-task.ts +3 -0
  624. package/node_modules/@sdd-agent-platform/core/src/router/routing-rules.ts +73 -0
  625. package/node_modules/@sdd-agent-platform/core/src/router/routing.ts +192 -0
  626. package/node_modules/@sdd-agent-platform/core/src/router/runtime-inspection.ts +124 -0
  627. package/node_modules/@sdd-agent-platform/core/src/router/runtime-registry.ts +123 -0
  628. package/node_modules/@sdd-agent-platform/core/src/router/runtime-validation.ts +277 -0
  629. package/node_modules/@sdd-agent-platform/core/src/router/team-mode.ts +170 -0
  630. package/node_modules/@sdd-agent-platform/core/src/router.ts +4 -0
  631. package/node_modules/@sdd-agent-platform/core/src/run-state/artifacts.ts +118 -0
  632. package/node_modules/@sdd-agent-platform/core/src/run-state/events.ts +27 -0
  633. package/node_modules/@sdd-agent-platform/core/src/run-state/inspect-run.ts +172 -0
  634. package/node_modules/@sdd-agent-platform/core/src/run-state/invocation-ledger.ts +109 -0
  635. package/node_modules/@sdd-agent-platform/core/src/run-state/model.ts +231 -0
  636. package/node_modules/@sdd-agent-platform/core/src/run-state/run-index.test.ts +52 -0
  637. package/node_modules/@sdd-agent-platform/core/src/run-state/run-index.ts +356 -0
  638. package/node_modules/@sdd-agent-platform/core/src/run-state/run-state.test.ts +70 -0
  639. package/node_modules/@sdd-agent-platform/core/src/run-state/run-state.ts +406 -0
  640. package/node_modules/@sdd-agent-platform/core/src/run-state/task-evidence.ts +206 -0
  641. package/node_modules/@sdd-agent-platform/core/src/run-state.ts +8 -0
  642. package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/build.ts +63 -0
  643. package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/findings.ts +296 -0
  644. package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/model.ts +152 -0
  645. package/node_modules/@sdd-agent-platform/core/src/runtime-analysis.test.ts +68 -0
  646. package/node_modules/@sdd-agent-platform/core/src/runtime-analysis.ts +3 -0
  647. package/node_modules/@sdd-agent-platform/core/src/runtime-paths.ts +176 -0
  648. package/node_modules/@sdd-agent-platform/core/src/sdd-docs/context.ts +111 -0
  649. package/node_modules/@sdd-agent-platform/core/src/sdd-docs/document-hashes.ts +207 -0
  650. package/node_modules/@sdd-agent-platform/core/src/sdd-docs/run-binding.ts +95 -0
  651. package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-inspection.ts +39 -0
  652. package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.test.ts +401 -0
  653. package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.ts +694 -0
  654. package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-rendering.ts +81 -0
  655. package/node_modules/@sdd-agent-platform/core/src/sdd-docs.ts +5 -0
  656. package/node_modules/@sdd-agent-platform/core/src/stage-runtime/contracts.ts +40 -0
  657. package/node_modules/@sdd-agent-platform/core/src/stage-runtime/runtime.test.ts +209 -0
  658. package/node_modules/@sdd-agent-platform/core/src/stage-runtime/runtime.ts +352 -0
  659. package/node_modules/@sdd-agent-platform/core/src/stage-runtime.ts +2 -0
  660. package/node_modules/@sdd-agent-platform/core/src/status/project-status.test.ts +288 -0
  661. package/node_modules/@sdd-agent-platform/core/src/status/project-status.ts +625 -0
  662. package/node_modules/@sdd-agent-platform/core/src/status.ts +2 -0
  663. package/node_modules/@sdd-agent-platform/core/src/storage/json-io.ts +10 -0
  664. package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.test.ts +489 -0
  665. package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.ts +1175 -0
  666. package/node_modules/@sdd-agent-platform/core/src/subagents/contracts.ts +45 -0
  667. package/node_modules/@sdd-agent-platform/core/src/subagents/runtime.test.ts +232 -0
  668. package/node_modules/@sdd-agent-platform/core/src/subagents/runtime.ts +307 -0
  669. package/node_modules/@sdd-agent-platform/core/src/subagents.ts +2 -0
  670. package/node_modules/@sdd-agent-platform/core/src/sync-back/apply.ts +270 -0
  671. package/node_modules/@sdd-agent-platform/core/src/sync-back/inspect.ts +655 -0
  672. package/node_modules/@sdd-agent-platform/core/src/sync-back/sync-back.test.ts +569 -0
  673. package/node_modules/@sdd-agent-platform/core/src/sync-back.ts +2 -0
  674. package/node_modules/@sdd-agent-platform/core/src/task-risk-profile.ts +193 -0
  675. package/node_modules/@sdd-agent-platform/core/src/test-support/fixtures.ts +398 -0
  676. package/node_modules/@sdd-agent-platform/core/src/test-support/run-state.ts +70 -0
  677. package/node_modules/@sdd-agent-platform/core/src/test-support.ts +2 -0
  678. package/node_modules/@sdd-agent-platform/core/src/verification/goal-verify.test.ts +335 -0
  679. package/node_modules/@sdd-agent-platform/core/src/verification/goal-verify.ts +648 -0
  680. package/node_modules/@sdd-agent-platform/core/src/verification/rendering.ts +181 -0
  681. package/node_modules/@sdd-agent-platform/core/src/verification/review-gate.test.ts +77 -0
  682. package/node_modules/@sdd-agent-platform/core/src/verification/review-gate.ts +77 -0
  683. package/node_modules/@sdd-agent-platform/core/src/verification/single-task-loop.test.ts +255 -0
  684. package/node_modules/@sdd-agent-platform/core/src/verification/single-task-loop.ts +494 -0
  685. package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.test.ts +439 -0
  686. package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.ts +1032 -0
  687. package/node_modules/@sdd-agent-platform/core/src/verification/validation-wave.test.ts +341 -0
  688. package/node_modules/@sdd-agent-platform/core/src/verification/validation-wave.ts +513 -0
  689. package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.test.ts +204 -0
  690. package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.ts +358 -0
  691. package/node_modules/@sdd-agent-platform/core/src/verification.ts +8 -0
  692. package/node_modules/@sdd-agent-platform/core/src/work-units/contracts.ts +26 -0
  693. package/node_modules/@sdd-agent-platform/core/src/work-units/runtime.test.ts +88 -0
  694. package/node_modules/@sdd-agent-platform/core/src/work-units/runtime.ts +112 -0
  695. package/node_modules/@sdd-agent-platform/core/src/work-units.ts +2 -0
  696. package/node_modules/@sdd-agent-platform/core/src/workflow-gate/evidence-packet.ts +196 -0
  697. package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.test.ts +171 -0
  698. package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.ts +143 -0
  699. package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.test.ts +137 -0
  700. package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.ts +155 -0
  701. package/node_modules/@sdd-agent-platform/core/src/workflow-gate/types.ts +114 -0
  702. package/node_modules/@sdd-agent-platform/core/src/workflow-state/affected-file-conflicts.ts +96 -0
  703. package/node_modules/@sdd-agent-platform/core/src/workflow-state/dependencies.test.ts +32 -0
  704. package/node_modules/@sdd-agent-platform/core/src/workflow-state/dependencies.ts +114 -0
  705. package/node_modules/@sdd-agent-platform/core/src/workflow-state/latest-eligible-run.ts +156 -0
  706. package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve.test.ts +464 -0
  707. package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve.ts +363 -0
  708. package/node_modules/@sdd-agent-platform/core/src/workflow-state.ts +2 -0
  709. package/node_modules/@sdd-agent-platform/core/src/worktree/isolation.ts +130 -0
  710. package/node_modules/@sdd-agent-platform/core/src/worktree/lifecycle.ts +269 -0
  711. package/node_modules/@sdd-agent-platform/core/src/worktree/worktree.test.ts +150 -0
  712. package/node_modules/@sdd-agent-platform/core/src/worktree.ts +2 -0
  713. package/node_modules/@sdd-agent-platform/core/tsconfig.json +15 -0
  714. package/package.json +67 -52
  715. package/packages/cli/dist/args.d.ts +23 -0
  716. package/packages/cli/dist/args.js +89 -0
  717. package/packages/cli/dist/args.js.map +1 -0
  718. package/packages/cli/dist/commands/ai-tools.d.ts +6 -0
  719. package/packages/cli/dist/commands/ai-tools.js +18 -0
  720. package/packages/cli/dist/commands/ai-tools.js.map +1 -0
  721. package/packages/cli/dist/commands/artifact.d.ts +6 -0
  722. package/packages/cli/dist/commands/artifact.js +168 -0
  723. package/packages/cli/dist/commands/artifact.js.map +1 -0
  724. package/packages/cli/dist/commands/context.d.ts +6 -0
  725. package/packages/cli/dist/commands/context.js +51 -0
  726. package/packages/cli/dist/commands/context.js.map +1 -0
  727. package/packages/cli/dist/commands/doctor.d.ts +6 -0
  728. package/packages/cli/dist/commands/doctor.js +29 -0
  729. package/packages/cli/dist/commands/doctor.js.map +1 -0
  730. package/packages/cli/dist/commands/execution.d.ts +6 -0
  731. package/packages/cli/dist/commands/execution.js +284 -0
  732. package/packages/cli/dist/commands/execution.js.map +1 -0
  733. package/packages/cli/dist/commands/governance.d.ts +6 -0
  734. package/packages/cli/dist/commands/governance.js +37 -0
  735. package/packages/cli/dist/commands/governance.js.map +1 -0
  736. package/packages/cli/dist/commands/init.d.ts +6 -0
  737. package/packages/cli/dist/commands/init.js +22 -0
  738. package/packages/cli/dist/commands/init.js.map +1 -0
  739. package/packages/cli/dist/commands/instructions.d.ts +6 -0
  740. package/packages/cli/dist/commands/instructions.js +15 -0
  741. package/packages/cli/dist/commands/instructions.js.map +1 -0
  742. package/packages/cli/dist/commands/lifecycle.d.ts +6 -0
  743. package/packages/cli/dist/commands/lifecycle.js +112 -0
  744. package/packages/cli/dist/commands/lifecycle.js.map +1 -0
  745. package/packages/cli/dist/commands/registry/contracts.d.ts +2 -0
  746. package/packages/cli/dist/commands/registry/contracts.js +62 -0
  747. package/packages/cli/dist/commands/registry/contracts.js.map +1 -0
  748. package/packages/cli/dist/commands/registry/core.d.ts +2 -0
  749. package/packages/cli/dist/commands/registry/core.js +75 -0
  750. package/packages/cli/dist/commands/registry/core.js.map +1 -0
  751. package/packages/cli/dist/commands/registry/platform.d.ts +2 -0
  752. package/packages/cli/dist/commands/registry/platform.js +123 -0
  753. package/packages/cli/dist/commands/registry/platform.js.map +1 -0
  754. package/packages/cli/dist/commands/registry/runtime.d.ts +2 -0
  755. package/packages/cli/dist/commands/registry/runtime.js +142 -0
  756. package/packages/cli/dist/commands/registry/runtime.js.map +1 -0
  757. package/packages/cli/dist/commands/registry/types.d.ts +5 -0
  758. package/packages/cli/dist/commands/registry/types.js +2 -0
  759. package/packages/cli/dist/commands/registry/types.js.map +1 -0
  760. package/packages/cli/dist/commands/registry.d.ts +3 -0
  761. package/packages/cli/dist/commands/registry.js +11 -0
  762. package/packages/cli/dist/commands/registry.js.map +1 -0
  763. package/packages/cli/dist/commands/run.d.ts +6 -0
  764. package/packages/cli/dist/commands/run.js +173 -0
  765. package/packages/cli/dist/commands/run.js.map +1 -0
  766. package/packages/cli/dist/commands/ship.d.ts +6 -0
  767. package/packages/cli/dist/commands/ship.js +33 -0
  768. package/packages/cli/dist/commands/ship.js.map +1 -0
  769. package/packages/cli/dist/commands/status.d.ts +6 -0
  770. package/packages/cli/dist/commands/status.js +25 -0
  771. package/packages/cli/dist/commands/status.js.map +1 -0
  772. package/packages/cli/dist/commands/sync-back.d.ts +6 -0
  773. package/packages/cli/dist/commands/sync-back.js +82 -0
  774. package/packages/cli/dist/commands/sync-back.js.map +1 -0
  775. package/packages/cli/dist/commands/tasks.d.ts +6 -0
  776. package/packages/cli/dist/commands/tasks.js +78 -0
  777. package/packages/cli/dist/commands/tasks.js.map +1 -0
  778. package/packages/cli/dist/commands/test.d.ts +6 -0
  779. package/packages/cli/dist/commands/test.js +195 -0
  780. package/packages/cli/dist/commands/test.js.map +1 -0
  781. package/packages/cli/dist/commands/verifies.d.ts +6 -0
  782. package/packages/cli/dist/commands/verifies.js +85 -0
  783. package/packages/cli/dist/commands/verifies.js.map +1 -0
  784. package/packages/cli/dist/commands/verify.d.ts +6 -0
  785. package/packages/cli/dist/commands/verify.js +134 -0
  786. package/packages/cli/dist/commands/verify.js.map +1 -0
  787. package/packages/cli/dist/dispatch.d.ts +7 -0
  788. package/packages/cli/dist/dispatch.js +121 -0
  789. package/packages/cli/dist/dispatch.js.map +1 -0
  790. package/packages/cli/dist/help.d.ts +4 -0
  791. package/packages/cli/dist/help.js +177 -0
  792. package/packages/cli/dist/help.js.map +1 -0
  793. package/packages/cli/dist/identity.d.ts +7 -0
  794. package/packages/cli/dist/identity.js +51 -0
  795. package/packages/cli/dist/identity.js.map +1 -0
  796. package/packages/cli/dist/main.js +17 -0
  797. package/packages/cli/dist/main.js.map +1 -0
  798. package/{dist/packages/cli/src → packages/cli/dist}/options.d.ts +2 -0
  799. package/{dist/packages/cli/src → packages/cli/dist}/options.js +6 -0
  800. package/packages/cli/dist/options.js.map +1 -0
  801. package/packages/cli/dist/renderers/artifacts.d.ts +5 -0
  802. package/packages/cli/dist/renderers/artifacts.js +43 -0
  803. package/packages/cli/dist/renderers/artifacts.js.map +1 -0
  804. package/packages/cli/dist/renderers/context.d.ts +4 -0
  805. package/packages/cli/dist/renderers/context.js +47 -0
  806. package/packages/cli/dist/renderers/context.js.map +1 -0
  807. package/packages/cli/dist/renderers/doctor.d.ts +5 -0
  808. package/packages/cli/dist/renderers/doctor.js +31 -0
  809. package/packages/cli/dist/renderers/doctor.js.map +1 -0
  810. package/packages/cli/dist/renderers/execution.d.ts +13 -0
  811. package/packages/cli/dist/renderers/execution.js +133 -0
  812. package/packages/cli/dist/renderers/execution.js.map +1 -0
  813. package/packages/cli/dist/renderers/governance.d.ts +3 -0
  814. package/packages/cli/dist/renderers/governance.js +23 -0
  815. package/packages/cli/dist/renderers/governance.js.map +1 -0
  816. package/packages/cli/dist/renderers/issues.d.ts +24 -0
  817. package/packages/cli/dist/renderers/issues.js +37 -0
  818. package/packages/cli/dist/renderers/issues.js.map +1 -0
  819. package/packages/cli/dist/renderers/json.d.ts +3 -0
  820. package/packages/cli/dist/renderers/json.js +10 -0
  821. package/packages/cli/dist/renderers/json.js.map +1 -0
  822. package/packages/cli/dist/renderers/lifecycle.d.ts +2 -0
  823. package/packages/cli/dist/renderers/lifecycle.js +30 -0
  824. package/packages/cli/dist/renderers/lifecycle.js.map +1 -0
  825. package/packages/cli/dist/renderers/planning.d.ts +4 -0
  826. package/packages/cli/dist/renderers/planning.js +66 -0
  827. package/packages/cli/dist/renderers/planning.js.map +1 -0
  828. package/packages/cli/dist/renderers/registry-contracts.d.ts +10 -0
  829. package/packages/cli/dist/renderers/registry-contracts.js +128 -0
  830. package/packages/cli/dist/renderers/registry-contracts.js.map +1 -0
  831. package/packages/cli/dist/renderers/registry-core.d.ts +8 -0
  832. package/packages/cli/dist/renderers/registry-core.js +93 -0
  833. package/packages/cli/dist/renderers/registry-core.js.map +1 -0
  834. package/packages/cli/dist/renderers/registry-platform.d.ts +12 -0
  835. package/packages/cli/dist/renderers/registry-platform.js +112 -0
  836. package/packages/cli/dist/renderers/registry-platform.js.map +1 -0
  837. package/packages/cli/dist/renderers/registry-runtime.d.ts +16 -0
  838. package/packages/cli/dist/renderers/registry-runtime.js +206 -0
  839. package/packages/cli/dist/renderers/registry-runtime.js.map +1 -0
  840. package/packages/cli/dist/renderers/registry-shared.d.ts +3 -0
  841. package/packages/cli/dist/renderers/registry-shared.js +15 -0
  842. package/packages/cli/dist/renderers/registry-shared.js.map +1 -0
  843. package/packages/cli/dist/renderers/registry.d.ts +5 -0
  844. package/packages/cli/dist/renderers/registry.js +6 -0
  845. package/packages/cli/dist/renderers/registry.js.map +1 -0
  846. package/packages/cli/dist/renderers/router.d.ts +2 -0
  847. package/packages/cli/dist/renderers/router.js +34 -0
  848. package/packages/cli/dist/renderers/router.js.map +1 -0
  849. package/packages/cli/dist/renderers/workflow.d.ts +19 -0
  850. package/packages/cli/dist/renderers/workflow.js +274 -0
  851. package/packages/cli/dist/renderers/workflow.js.map +1 -0
  852. package/packages/cli/dist/renderers/worktree.d.ts +5 -0
  853. package/packages/cli/dist/renderers/worktree.js +41 -0
  854. package/packages/cli/dist/renderers/worktree.js.map +1 -0
  855. package/packages/cli/dist/test-support/run-cli.d.ts +6 -0
  856. package/packages/cli/dist/test-support/run-cli.js +15 -0
  857. package/packages/cli/dist/test-support/run-cli.js.map +1 -0
  858. package/packages/cli/dist/tsconfig.tsbuildinfo +1 -0
  859. package/packages/cli/package.json +15 -0
  860. package/packages/core/dist/ai-tools.d.ts +68 -0
  861. package/packages/core/dist/ai-tools.js +464 -0
  862. package/packages/core/dist/ai-tools.js.map +1 -0
  863. package/packages/core/dist/artifacts/ingestion.d.ts +24 -0
  864. package/packages/core/dist/artifacts/ingestion.js +181 -0
  865. package/packages/core/dist/artifacts/ingestion.js.map +1 -0
  866. package/packages/core/dist/artifacts/sdd-evidence.d.ts +47 -0
  867. package/packages/core/dist/artifacts/sdd-evidence.js +241 -0
  868. package/packages/core/dist/artifacts/sdd-evidence.js.map +1 -0
  869. package/packages/core/dist/artifacts/sdd-result.d.ts +29 -0
  870. package/packages/core/dist/artifacts/sdd-result.js +198 -0
  871. package/packages/core/dist/artifacts/sdd-result.js.map +1 -0
  872. package/packages/core/dist/artifacts/templates.d.ts +10 -0
  873. package/packages/core/dist/artifacts/templates.js +79 -0
  874. package/packages/core/dist/artifacts/templates.js.map +1 -0
  875. package/packages/core/dist/artifacts.d.ts +4 -0
  876. package/packages/core/dist/artifacts.js +5 -0
  877. package/packages/core/dist/artifacts.js.map +1 -0
  878. package/packages/core/dist/coding-facts/contracts.d.ts +71 -0
  879. package/packages/core/dist/coding-facts/contracts.js +2 -0
  880. package/packages/core/dist/coding-facts/contracts.js.map +1 -0
  881. package/packages/core/dist/coding-facts.d.ts +1 -0
  882. package/packages/core/dist/coding-facts.js +2 -0
  883. package/packages/core/dist/coding-facts.js.map +1 -0
  884. package/packages/core/dist/config/init-project.d.ts +31 -0
  885. package/packages/core/dist/config/init-project.js +89 -0
  886. package/packages/core/dist/config/init-project.js.map +1 -0
  887. package/packages/core/dist/config/project-config.d.ts +49 -0
  888. package/packages/core/dist/config/project-config.js +202 -0
  889. package/packages/core/dist/config/project-config.js.map +1 -0
  890. package/packages/core/dist/config/project-detection.d.ts +21 -0
  891. package/packages/core/dist/config/project-detection.js +111 -0
  892. package/packages/core/dist/config/project-detection.js.map +1 -0
  893. package/packages/core/dist/config/project-status.d.ts +1 -0
  894. package/packages/core/dist/config/project-status.js +2 -0
  895. package/packages/core/dist/config/project-status.js.map +1 -0
  896. package/packages/core/dist/config/starter-documents.d.ts +4 -0
  897. package/packages/core/dist/config/starter-documents.js +441 -0
  898. package/packages/core/dist/config/starter-documents.js.map +1 -0
  899. package/packages/core/dist/context/budget.d.ts +10 -0
  900. package/packages/core/dist/context/budget.js +20 -0
  901. package/packages/core/dist/context/budget.js.map +1 -0
  902. package/packages/core/dist/context/build-package.d.ts +46 -0
  903. package/packages/core/dist/context/build-package.js +244 -0
  904. package/packages/core/dist/context/build-package.js.map +1 -0
  905. package/packages/core/dist/context/command-summary.d.ts +14 -0
  906. package/packages/core/dist/context/command-summary.js +34 -0
  907. package/packages/core/dist/context/command-summary.js.map +1 -0
  908. package/packages/core/dist/context/evidence-summary.d.ts +50 -0
  909. package/packages/core/dist/context/evidence-summary.js +86 -0
  910. package/packages/core/dist/context/evidence-summary.js.map +1 -0
  911. package/packages/core/dist/context/log-worker.d.ts +19 -0
  912. package/packages/core/dist/context/log-worker.js +28 -0
  913. package/packages/core/dist/context/log-worker.js.map +1 -0
  914. package/packages/core/dist/context/source-refs.d.ts +9 -0
  915. package/packages/core/dist/context/source-refs.js +30 -0
  916. package/packages/core/dist/context/source-refs.js.map +1 -0
  917. package/packages/core/dist/context-offload/contracts.d.ts +43 -0
  918. package/packages/core/dist/context-offload/contracts.js +2 -0
  919. package/packages/core/dist/context-offload/contracts.js.map +1 -0
  920. package/packages/core/dist/context-offload/runtime.d.ts +36 -0
  921. package/packages/core/dist/context-offload/runtime.js +142 -0
  922. package/packages/core/dist/context-offload/runtime.js.map +1 -0
  923. package/packages/core/dist/context-offload.d.ts +2 -0
  924. package/packages/core/dist/context-offload.js +3 -0
  925. package/packages/core/dist/context-offload.js.map +1 -0
  926. package/packages/core/dist/context.d.ts +6 -0
  927. package/packages/core/dist/context.js +7 -0
  928. package/packages/core/dist/context.js.map +1 -0
  929. package/packages/core/dist/contracts/issues.d.ts +7 -0
  930. package/packages/core/dist/contracts/issues.js +7 -0
  931. package/packages/core/dist/contracts/issues.js.map +1 -0
  932. package/packages/core/dist/contracts.d.ts +110 -0
  933. package/packages/core/dist/contracts.js +75 -0
  934. package/packages/core/dist/contracts.js.map +1 -0
  935. package/packages/core/dist/delegation/model.d.ts +21 -0
  936. package/packages/core/dist/delegation/model.js +2 -0
  937. package/packages/core/dist/delegation/model.js.map +1 -0
  938. package/packages/core/dist/delegation/queue.d.ts +10 -0
  939. package/packages/core/dist/delegation/queue.js +47 -0
  940. package/packages/core/dist/delegation/queue.js.map +1 -0
  941. package/packages/core/dist/delegation/run-state.d.ts +2 -0
  942. package/packages/core/dist/delegation/run-state.js +13 -0
  943. package/packages/core/dist/delegation/run-state.js.map +1 -0
  944. package/packages/core/dist/delegation/state-machine.d.ts +30 -0
  945. package/packages/core/dist/delegation/state-machine.js +56 -0
  946. package/packages/core/dist/delegation/state-machine.js.map +1 -0
  947. package/packages/core/dist/delegation/validation.d.ts +28 -0
  948. package/packages/core/dist/delegation/validation.js +100 -0
  949. package/packages/core/dist/delegation/validation.js.map +1 -0
  950. package/packages/core/dist/delegation.d.ts +7 -0
  951. package/packages/core/dist/delegation.js +6 -0
  952. package/packages/core/dist/delegation.js.map +1 -0
  953. package/packages/core/dist/doctor/checks/ai-entries.d.ts +2 -0
  954. package/packages/core/dist/doctor/checks/ai-entries.js +26 -0
  955. package/packages/core/dist/doctor/checks/ai-entries.js.map +1 -0
  956. package/packages/core/dist/doctor/checks/document-chain.d.ts +2 -0
  957. package/packages/core/dist/doctor/checks/document-chain.js +104 -0
  958. package/packages/core/dist/doctor/checks/document-chain.js.map +1 -0
  959. package/packages/core/dist/doctor/checks/local-run-index.d.ts +2 -0
  960. package/packages/core/dist/doctor/checks/local-run-index.js +26 -0
  961. package/packages/core/dist/doctor/checks/local-run-index.js.map +1 -0
  962. package/packages/core/dist/doctor/checks/project.d.ts +11 -0
  963. package/packages/core/dist/doctor/checks/project.js +78 -0
  964. package/packages/core/dist/doctor/checks/project.js.map +1 -0
  965. package/packages/core/dist/doctor/checks/registries.d.ts +11 -0
  966. package/packages/core/dist/doctor/checks/registries.js +247 -0
  967. package/packages/core/dist/doctor/checks/registries.js.map +1 -0
  968. package/packages/core/dist/doctor/checks/run-evidence.d.ts +6 -0
  969. package/packages/core/dist/doctor/checks/run-evidence.js +313 -0
  970. package/packages/core/dist/doctor/checks/run-evidence.js.map +1 -0
  971. package/packages/core/dist/doctor/checks/run-records.d.ts +4 -0
  972. package/packages/core/dist/doctor/checks/run-records.js +68 -0
  973. package/packages/core/dist/doctor/checks/run-records.js.map +1 -0
  974. package/packages/core/dist/doctor/checks/run-trust.d.ts +3 -0
  975. package/packages/core/dist/doctor/checks/run-trust.js +121 -0
  976. package/packages/core/dist/doctor/checks/run-trust.js.map +1 -0
  977. package/packages/core/dist/doctor/checks/runtime-contracts.d.ts +11 -0
  978. package/packages/core/dist/doctor/checks/runtime-contracts.js +279 -0
  979. package/packages/core/dist/doctor/checks/runtime-contracts.js.map +1 -0
  980. package/packages/core/dist/doctor/doctor.d.ts +6 -0
  981. package/packages/core/dist/doctor/doctor.js +292 -0
  982. package/packages/core/dist/doctor/doctor.js.map +1 -0
  983. package/packages/core/dist/doctor/model.d.ts +11 -0
  984. package/packages/core/dist/doctor/model.js +2 -0
  985. package/packages/core/dist/doctor/model.js.map +1 -0
  986. package/packages/core/dist/doctor/render.d.ts +2 -0
  987. package/packages/core/dist/doctor/render.js +44 -0
  988. package/packages/core/dist/doctor/render.js.map +1 -0
  989. package/packages/core/dist/doctor/summary.d.ts +2 -0
  990. package/packages/core/dist/doctor/summary.js +10 -0
  991. package/packages/core/dist/doctor/summary.js.map +1 -0
  992. package/packages/core/dist/doctor.d.ts +2 -0
  993. package/packages/core/dist/doctor.js +3 -0
  994. package/packages/core/dist/doctor.js.map +1 -0
  995. package/packages/core/dist/evidence/lookup.d.ts +23 -0
  996. package/packages/core/dist/evidence/lookup.js +54 -0
  997. package/packages/core/dist/evidence/lookup.js.map +1 -0
  998. package/packages/core/dist/evidence-runtime/contracts.d.ts +44 -0
  999. package/packages/core/dist/evidence-runtime/contracts.js +2 -0
  1000. package/packages/core/dist/evidence-runtime/contracts.js.map +1 -0
  1001. package/packages/core/dist/evidence-runtime.d.ts +1 -0
  1002. package/packages/core/dist/evidence-runtime.js +2 -0
  1003. package/packages/core/dist/evidence-runtime.js.map +1 -0
  1004. package/packages/core/dist/execution/agent-execution-records.d.ts +31 -0
  1005. package/packages/core/dist/execution/agent-execution-records.js +170 -0
  1006. package/packages/core/dist/execution/agent-execution-records.js.map +1 -0
  1007. package/packages/core/dist/execution/background-executor.d.ts +44 -0
  1008. package/packages/core/dist/execution/background-executor.js +249 -0
  1009. package/packages/core/dist/execution/background-executor.js.map +1 -0
  1010. package/packages/core/dist/execution/foreground-subagents.d.ts +55 -0
  1011. package/packages/core/dist/execution/foreground-subagents.js +363 -0
  1012. package/packages/core/dist/execution/foreground-subagents.js.map +1 -0
  1013. package/packages/core/dist/execution/host-invocation.d.ts +27 -0
  1014. package/packages/core/dist/execution/host-invocation.js +185 -0
  1015. package/packages/core/dist/execution/host-invocation.js.map +1 -0
  1016. package/packages/core/dist/execution/resident-worker.d.ts +100 -0
  1017. package/packages/core/dist/execution/resident-worker.js +327 -0
  1018. package/packages/core/dist/execution/resident-worker.js.map +1 -0
  1019. package/packages/core/dist/execution/stage-team-runtime.d.ts +112 -0
  1020. package/packages/core/dist/execution/stage-team-runtime.js +145 -0
  1021. package/packages/core/dist/execution/stage-team-runtime.js.map +1 -0
  1022. package/packages/core/dist/execution/wave-executor.d.ts +45 -0
  1023. package/packages/core/dist/execution/wave-executor.js +178 -0
  1024. package/packages/core/dist/execution/wave-executor.js.map +1 -0
  1025. package/packages/core/dist/execution.d.ts +5 -0
  1026. package/packages/core/dist/execution.js +6 -0
  1027. package/packages/core/dist/execution.js.map +1 -0
  1028. package/packages/core/dist/governance/policy.d.ts +53 -0
  1029. package/packages/core/dist/governance/policy.js +111 -0
  1030. package/packages/core/dist/governance/policy.js.map +1 -0
  1031. package/packages/core/dist/governance.d.ts +1 -0
  1032. package/packages/core/dist/governance.js +2 -0
  1033. package/packages/core/dist/governance.js.map +1 -0
  1034. package/packages/core/dist/index.d.ts +1 -0
  1035. package/packages/core/dist/index.js +2 -0
  1036. package/packages/core/dist/index.js.map +1 -0
  1037. package/packages/core/dist/instructions.d.ts +14 -0
  1038. package/packages/core/dist/instructions.js +147 -0
  1039. package/packages/core/dist/instructions.js.map +1 -0
  1040. package/packages/core/dist/lifecycle/decision-gate.d.ts +39 -0
  1041. package/packages/core/dist/lifecycle/decision-gate.js +319 -0
  1042. package/packages/core/dist/lifecycle/decision-gate.js.map +1 -0
  1043. package/packages/core/dist/lifecycle/rendering.d.ts +2 -0
  1044. package/packages/core/dist/lifecycle/rendering.js +27 -0
  1045. package/packages/core/dist/lifecycle/rendering.js.map +1 -0
  1046. package/packages/core/dist/lifecycle/risk-signals.d.ts +57 -0
  1047. package/packages/core/dist/lifecycle/risk-signals.js +80 -0
  1048. package/packages/core/dist/lifecycle/risk-signals.js.map +1 -0
  1049. package/packages/core/dist/lifecycle/ship.d.ts +44 -0
  1050. package/packages/core/dist/lifecycle/ship.js +207 -0
  1051. package/packages/core/dist/lifecycle/ship.js.map +1 -0
  1052. package/packages/core/dist/lifecycle.d.ts +4 -0
  1053. package/packages/core/dist/lifecycle.js +5 -0
  1054. package/packages/core/dist/lifecycle.js.map +1 -0
  1055. package/packages/core/dist/orchestration/contracts.d.ts +45 -0
  1056. package/packages/core/dist/orchestration/contracts.js +2 -0
  1057. package/packages/core/dist/orchestration/contracts.js.map +1 -0
  1058. package/packages/core/dist/orchestration/index.d.ts +2 -0
  1059. package/packages/core/dist/orchestration/index.js +3 -0
  1060. package/packages/core/dist/orchestration/index.js.map +1 -0
  1061. package/packages/core/dist/orchestration/runtime.d.ts +55 -0
  1062. package/packages/core/dist/orchestration/runtime.js +314 -0
  1063. package/packages/core/dist/orchestration/runtime.js.map +1 -0
  1064. package/packages/core/dist/path-safety.d.ts +4 -0
  1065. package/packages/core/dist/path-safety.js +35 -0
  1066. package/packages/core/dist/path-safety.js.map +1 -0
  1067. package/packages/core/dist/planning/task-graph.d.ts +57 -0
  1068. package/packages/core/dist/planning/task-graph.js +157 -0
  1069. package/packages/core/dist/planning/task-graph.js.map +1 -0
  1070. package/packages/core/dist/planning/wave-plan.d.ts +37 -0
  1071. package/packages/core/dist/planning/wave-plan.js +119 -0
  1072. package/packages/core/dist/planning/wave-plan.js.map +1 -0
  1073. package/packages/core/dist/planning.d.ts +2 -0
  1074. package/packages/core/dist/planning.js +3 -0
  1075. package/packages/core/dist/planning.js.map +1 -0
  1076. package/packages/core/dist/registries/agent-capability-catalog.d.ts +70 -0
  1077. package/packages/core/dist/registries/agent-capability-catalog.js +267 -0
  1078. package/packages/core/dist/registries/agent-capability-catalog.js.map +1 -0
  1079. package/packages/core/dist/registries/agent-registry.d.ts +22 -0
  1080. package/packages/core/dist/registries/agent-registry.js +121 -0
  1081. package/packages/core/dist/registries/agent-registry.js.map +1 -0
  1082. package/packages/core/dist/registries/agent-runtime-static.d.ts +61 -0
  1083. package/packages/core/dist/registries/agent-runtime-static.js +69 -0
  1084. package/packages/core/dist/registries/agent-runtime-static.js.map +1 -0
  1085. package/packages/core/dist/registries/capability-sources.d.ts +2 -0
  1086. package/packages/core/dist/registries/capability-sources.js +226 -0
  1087. package/packages/core/dist/registries/capability-sources.js.map +1 -0
  1088. package/packages/core/dist/registries/command-team-runtime.d.ts +70 -0
  1089. package/packages/core/dist/registries/command-team-runtime.js +220 -0
  1090. package/packages/core/dist/registries/command-team-runtime.js.map +1 -0
  1091. package/packages/core/dist/registries/eval-learning-context.d.ts +64 -0
  1092. package/packages/core/dist/registries/eval-learning-context.js +161 -0
  1093. package/packages/core/dist/registries/eval-learning-context.js.map +1 -0
  1094. package/packages/core/dist/registries/query-status.d.ts +28 -0
  1095. package/packages/core/dist/registries/query-status.js +84 -0
  1096. package/packages/core/dist/registries/query-status.js.map +1 -0
  1097. package/packages/core/dist/registries/skill-capabilities.d.ts +22 -0
  1098. package/packages/core/dist/registries/skill-capabilities.js +16 -0
  1099. package/packages/core/dist/registries/skill-capabilities.js.map +1 -0
  1100. package/packages/core/dist/registries/tool-capabilities.d.ts +20 -0
  1101. package/packages/core/dist/registries/tool-capabilities.js +111 -0
  1102. package/packages/core/dist/registries/tool-capabilities.js.map +1 -0
  1103. package/packages/core/dist/registries/tool-plugins.d.ts +21 -0
  1104. package/packages/core/dist/registries/tool-plugins.js +107 -0
  1105. package/packages/core/dist/registries/tool-plugins.js.map +1 -0
  1106. package/packages/core/dist/registries/worker-adapters.d.ts +38 -0
  1107. package/packages/core/dist/registries/worker-adapters.js +99 -0
  1108. package/packages/core/dist/registries/worker-adapters.js.map +1 -0
  1109. package/packages/core/dist/registries/workflow-gates.d.ts +19 -0
  1110. package/packages/core/dist/registries/workflow-gates.js +89 -0
  1111. package/packages/core/dist/registries/workflow-gates.js.map +1 -0
  1112. package/packages/core/dist/registries.d.ts +14 -0
  1113. package/packages/core/dist/registries.js +13 -0
  1114. package/packages/core/dist/registries.js.map +1 -0
  1115. package/packages/core/dist/risk/consumer-diagnostics.d.ts +18 -0
  1116. package/packages/core/dist/risk/consumer-diagnostics.js +77 -0
  1117. package/packages/core/dist/risk/consumer-diagnostics.js.map +1 -0
  1118. package/packages/core/dist/risk/contracts.d.ts +57 -0
  1119. package/packages/core/dist/risk/contracts.js +2 -0
  1120. package/packages/core/dist/risk/contracts.js.map +1 -0
  1121. package/packages/core/dist/risk/kernel.d.ts +20 -0
  1122. package/packages/core/dist/risk/kernel.js +195 -0
  1123. package/packages/core/dist/risk/kernel.js.map +1 -0
  1124. package/packages/core/dist/risk/legacy-adapters.d.ts +33 -0
  1125. package/packages/core/dist/risk/legacy-adapters.js +215 -0
  1126. package/packages/core/dist/risk/legacy-adapters.js.map +1 -0
  1127. package/packages/core/dist/risk/workflow-gates.d.ts +24 -0
  1128. package/packages/core/dist/risk/workflow-gates.js +160 -0
  1129. package/packages/core/dist/risk/workflow-gates.js.map +1 -0
  1130. package/packages/core/dist/risk.d.ts +5 -0
  1131. package/packages/core/dist/risk.js +6 -0
  1132. package/packages/core/dist/risk.js.map +1 -0
  1133. package/packages/core/dist/router/agent-runtime-config.d.ts +4 -0
  1134. package/packages/core/dist/router/agent-runtime-config.js +278 -0
  1135. package/packages/core/dist/router/agent-runtime-config.js.map +1 -0
  1136. package/packages/core/dist/router/agent-runtime.d.ts +343 -0
  1137. package/packages/core/dist/router/agent-runtime.js +2 -0
  1138. package/packages/core/dist/router/agent-runtime.js.map +1 -0
  1139. package/packages/core/dist/router/profile-resolution.d.ts +18 -0
  1140. package/packages/core/dist/router/profile-resolution.js +127 -0
  1141. package/packages/core/dist/router/profile-resolution.js.map +1 -0
  1142. package/packages/core/dist/router/risk-policy.d.ts +6 -0
  1143. package/packages/core/dist/router/risk-policy.js +28 -0
  1144. package/packages/core/dist/router/risk-policy.js.map +1 -0
  1145. package/packages/core/dist/router/route-cache.d.ts +39 -0
  1146. package/packages/core/dist/router/route-cache.js +59 -0
  1147. package/packages/core/dist/router/route-cache.js.map +1 -0
  1148. package/packages/core/dist/router/route-projection.d.ts +14 -0
  1149. package/packages/core/dist/router/route-projection.js +318 -0
  1150. package/packages/core/dist/router/route-projection.js.map +1 -0
  1151. package/packages/core/dist/router/route-sdd-task.d.ts +3 -0
  1152. package/packages/core/dist/router/route-sdd-task.js +4 -0
  1153. package/packages/core/dist/router/route-sdd-task.js.map +1 -0
  1154. package/packages/core/dist/router/routing-rules.d.ts +4 -0
  1155. package/packages/core/dist/router/routing-rules.js +68 -0
  1156. package/packages/core/dist/router/routing-rules.js.map +1 -0
  1157. package/packages/core/dist/router/routing.d.ts +18 -0
  1158. package/packages/core/dist/router/routing.js +169 -0
  1159. package/packages/core/dist/router/routing.js.map +1 -0
  1160. package/packages/core/dist/router/runtime-inspection.d.ts +7 -0
  1161. package/packages/core/dist/router/runtime-inspection.js +102 -0
  1162. package/packages/core/dist/router/runtime-inspection.js.map +1 -0
  1163. package/packages/core/dist/router/runtime-registry.d.ts +17 -0
  1164. package/packages/core/dist/router/runtime-registry.js +82 -0
  1165. package/packages/core/dist/router/runtime-registry.js.map +1 -0
  1166. package/packages/core/dist/router/runtime-validation.d.ts +26 -0
  1167. package/packages/core/dist/router/runtime-validation.js +235 -0
  1168. package/packages/core/dist/router/runtime-validation.js.map +1 -0
  1169. package/packages/core/dist/router/team-mode.d.ts +16 -0
  1170. package/packages/core/dist/router/team-mode.js +134 -0
  1171. package/packages/core/dist/router/team-mode.js.map +1 -0
  1172. package/packages/core/dist/router.d.ts +4 -0
  1173. package/packages/core/dist/router.js +5 -0
  1174. package/packages/core/dist/router.js.map +1 -0
  1175. package/packages/core/dist/run-state/artifacts.d.ts +6 -0
  1176. package/packages/core/dist/run-state/artifacts.js +113 -0
  1177. package/packages/core/dist/run-state/artifacts.js.map +1 -0
  1178. package/packages/core/dist/run-state/events.d.ts +3 -0
  1179. package/packages/core/dist/run-state/events.js +23 -0
  1180. package/packages/core/dist/run-state/events.js.map +1 -0
  1181. package/packages/core/dist/run-state/inspect-run.d.ts +102 -0
  1182. package/packages/core/dist/run-state/inspect-run.js +83 -0
  1183. package/packages/core/dist/run-state/inspect-run.js.map +1 -0
  1184. package/packages/core/dist/run-state/invocation-ledger.d.ts +18 -0
  1185. package/packages/core/dist/run-state/invocation-ledger.js +99 -0
  1186. package/packages/core/dist/run-state/invocation-ledger.js.map +1 -0
  1187. package/packages/core/dist/run-state/model.d.ts +203 -0
  1188. package/packages/core/dist/run-state/model.js +2 -0
  1189. package/packages/core/dist/run-state/model.js.map +1 -0
  1190. package/packages/core/dist/run-state/run-index.d.ts +97 -0
  1191. package/packages/core/dist/run-state/run-index.js +238 -0
  1192. package/packages/core/dist/run-state/run-index.js.map +1 -0
  1193. package/packages/core/dist/run-state/run-state.d.ts +20 -0
  1194. package/packages/core/dist/run-state/run-state.js +366 -0
  1195. package/packages/core/dist/run-state/run-state.js.map +1 -0
  1196. package/packages/core/dist/run-state/task-evidence.d.ts +62 -0
  1197. package/packages/core/dist/run-state/task-evidence.js +130 -0
  1198. package/packages/core/dist/run-state/task-evidence.js.map +1 -0
  1199. package/packages/core/dist/run-state.d.ts +8 -0
  1200. package/packages/core/dist/run-state.js +9 -0
  1201. package/packages/core/dist/run-state.js.map +1 -0
  1202. package/packages/core/dist/runtime-analysis/build.d.ts +2 -0
  1203. package/packages/core/dist/runtime-analysis/build.js +61 -0
  1204. package/packages/core/dist/runtime-analysis/build.js.map +1 -0
  1205. package/packages/core/dist/runtime-analysis/findings.d.ts +4 -0
  1206. package/packages/core/dist/runtime-analysis/findings.js +274 -0
  1207. package/packages/core/dist/runtime-analysis/findings.js.map +1 -0
  1208. package/packages/core/dist/runtime-analysis/model.d.ts +175 -0
  1209. package/packages/core/dist/runtime-analysis/model.js +2 -0
  1210. package/packages/core/dist/runtime-analysis/model.js.map +1 -0
  1211. package/packages/core/dist/runtime-analysis.d.ts +3 -0
  1212. package/packages/core/dist/runtime-analysis.js +4 -0
  1213. package/packages/core/dist/runtime-analysis.js.map +1 -0
  1214. package/packages/core/dist/runtime-paths.d.ts +35 -0
  1215. package/packages/core/dist/runtime-paths.js +142 -0
  1216. package/packages/core/dist/runtime-paths.js.map +1 -0
  1217. package/packages/core/dist/sdd-docs/context.d.ts +18 -0
  1218. package/packages/core/dist/sdd-docs/context.js +89 -0
  1219. package/packages/core/dist/sdd-docs/context.js.map +1 -0
  1220. package/packages/core/dist/sdd-docs/document-hashes.d.ts +4 -0
  1221. package/packages/core/dist/sdd-docs/document-hashes.js +189 -0
  1222. package/packages/core/dist/sdd-docs/document-hashes.js.map +1 -0
  1223. package/packages/core/dist/sdd-docs/run-binding.d.ts +6 -0
  1224. package/packages/core/dist/sdd-docs/run-binding.js +88 -0
  1225. package/packages/core/dist/sdd-docs/run-binding.js.map +1 -0
  1226. package/packages/core/dist/sdd-docs/task-inspection.d.ts +6 -0
  1227. package/packages/core/dist/sdd-docs/task-inspection.js +31 -0
  1228. package/packages/core/dist/sdd-docs/task-inspection.js.map +1 -0
  1229. package/packages/core/dist/sdd-docs/task-parser.d.ts +98 -0
  1230. package/packages/core/dist/sdd-docs/task-parser.js +538 -0
  1231. package/packages/core/dist/sdd-docs/task-parser.js.map +1 -0
  1232. package/packages/core/dist/sdd-docs/task-rendering.d.ts +5 -0
  1233. package/packages/core/dist/sdd-docs/task-rendering.js +77 -0
  1234. package/packages/core/dist/sdd-docs/task-rendering.js.map +1 -0
  1235. package/packages/core/dist/sdd-docs.d.ts +5 -0
  1236. package/packages/core/dist/sdd-docs.js +6 -0
  1237. package/packages/core/dist/sdd-docs.js.map +1 -0
  1238. package/packages/core/dist/stage-runtime/contracts.d.ts +37 -0
  1239. package/packages/core/dist/stage-runtime/contracts.js +2 -0
  1240. package/packages/core/dist/stage-runtime/contracts.js.map +1 -0
  1241. package/packages/core/dist/stage-runtime/runtime.d.ts +71 -0
  1242. package/packages/core/dist/stage-runtime/runtime.js +275 -0
  1243. package/packages/core/dist/stage-runtime/runtime.js.map +1 -0
  1244. package/packages/core/dist/stage-runtime.d.ts +2 -0
  1245. package/packages/core/dist/stage-runtime.js +3 -0
  1246. package/packages/core/dist/stage-runtime.js.map +1 -0
  1247. package/packages/core/dist/status/project-status.d.ts +166 -0
  1248. package/packages/core/dist/status/project-status.js +439 -0
  1249. package/packages/core/dist/status/project-status.js.map +1 -0
  1250. package/packages/core/dist/status.d.ts +2 -0
  1251. package/packages/core/dist/status.js +3 -0
  1252. package/packages/core/dist/status.js.map +1 -0
  1253. package/packages/core/dist/storage/json-io.d.ts +1 -0
  1254. package/packages/core/dist/storage/json-io.js +11 -0
  1255. package/packages/core/dist/storage/json-io.js.map +1 -0
  1256. package/packages/core/dist/storage/runtime-store.d.ts +305 -0
  1257. package/packages/core/dist/storage/runtime-store.js +859 -0
  1258. package/packages/core/dist/storage/runtime-store.js.map +1 -0
  1259. package/packages/core/dist/subagents/contracts.d.ts +41 -0
  1260. package/packages/core/dist/subagents/contracts.js +2 -0
  1261. package/packages/core/dist/subagents/contracts.js.map +1 -0
  1262. package/packages/core/dist/subagents/runtime.d.ts +43 -0
  1263. package/packages/core/dist/subagents/runtime.js +262 -0
  1264. package/packages/core/dist/subagents/runtime.js.map +1 -0
  1265. package/packages/core/dist/subagents.d.ts +2 -0
  1266. package/packages/core/dist/subagents.js +3 -0
  1267. package/packages/core/dist/subagents.js.map +1 -0
  1268. package/packages/core/dist/sync-back/apply.d.ts +17 -0
  1269. package/packages/core/dist/sync-back/apply.js +243 -0
  1270. package/packages/core/dist/sync-back/apply.js.map +1 -0
  1271. package/packages/core/dist/sync-back/inspect.d.ts +110 -0
  1272. package/packages/core/dist/sync-back/inspect.js +497 -0
  1273. package/packages/core/dist/sync-back/inspect.js.map +1 -0
  1274. package/packages/core/dist/sync-back.d.ts +2 -0
  1275. package/packages/core/dist/sync-back.js +3 -0
  1276. package/packages/core/dist/sync-back.js.map +1 -0
  1277. package/packages/core/dist/task-risk-profile.d.ts +33 -0
  1278. package/packages/core/dist/task-risk-profile.js +153 -0
  1279. package/packages/core/dist/task-risk-profile.js.map +1 -0
  1280. package/packages/core/dist/test-support/fixtures.d.ts +21 -0
  1281. package/packages/core/dist/test-support/fixtures.js +384 -0
  1282. package/packages/core/dist/test-support/fixtures.js.map +1 -0
  1283. package/packages/core/dist/test-support/run-state.d.ts +2 -0
  1284. package/packages/core/dist/test-support/run-state.js +69 -0
  1285. package/packages/core/dist/test-support/run-state.js.map +1 -0
  1286. package/packages/core/dist/test-support.d.ts +2 -0
  1287. package/packages/core/dist/test-support.js +3 -0
  1288. package/packages/core/dist/test-support.js.map +1 -0
  1289. package/packages/core/dist/tsconfig.tsbuildinfo +1 -0
  1290. package/packages/core/dist/verification/goal-verify.d.ts +50 -0
  1291. package/packages/core/dist/verification/goal-verify.js +546 -0
  1292. package/packages/core/dist/verification/goal-verify.js.map +1 -0
  1293. package/packages/core/dist/verification/rendering.d.ts +51 -0
  1294. package/packages/core/dist/verification/rendering.js +129 -0
  1295. package/packages/core/dist/verification/rendering.js.map +1 -0
  1296. package/packages/core/dist/verification/review-gate.d.ts +22 -0
  1297. package/packages/core/dist/verification/review-gate.js +53 -0
  1298. package/packages/core/dist/verification/review-gate.js.map +1 -0
  1299. package/packages/core/dist/verification/single-task-loop.d.ts +29 -0
  1300. package/packages/core/dist/verification/single-task-loop.js +425 -0
  1301. package/packages/core/dist/verification/single-task-loop.js.map +1 -0
  1302. package/packages/core/dist/verification/test-runtime.d.ts +77 -0
  1303. package/packages/core/dist/verification/test-runtime.js +877 -0
  1304. package/packages/core/dist/verification/test-runtime.js.map +1 -0
  1305. package/packages/core/dist/verification/validation-wave.d.ts +58 -0
  1306. package/packages/core/dist/verification/validation-wave.js +428 -0
  1307. package/packages/core/dist/verification/validation-wave.js.map +1 -0
  1308. package/packages/core/dist/verification/verify-contract.d.ts +44 -0
  1309. package/packages/core/dist/verification/verify-contract.js +299 -0
  1310. package/packages/core/dist/verification/verify-contract.js.map +1 -0
  1311. package/packages/core/dist/verification.d.ts +8 -0
  1312. package/packages/core/dist/verification.js +8 -0
  1313. package/packages/core/dist/verification.js.map +1 -0
  1314. package/packages/core/dist/work-units/contracts.d.ts +24 -0
  1315. package/packages/core/dist/work-units/contracts.js +2 -0
  1316. package/packages/core/dist/work-units/contracts.js.map +1 -0
  1317. package/packages/core/dist/work-units/runtime.d.ts +21 -0
  1318. package/packages/core/dist/work-units/runtime.js +90 -0
  1319. package/packages/core/dist/work-units/runtime.js.map +1 -0
  1320. package/packages/core/dist/work-units.d.ts +2 -0
  1321. package/packages/core/dist/work-units.js +3 -0
  1322. package/packages/core/dist/work-units.js.map +1 -0
  1323. package/packages/core/dist/workflow-gate/evidence-packet.d.ts +24 -0
  1324. package/packages/core/dist/workflow-gate/evidence-packet.js +182 -0
  1325. package/packages/core/dist/workflow-gate/evidence-packet.js.map +1 -0
  1326. package/packages/core/dist/workflow-gate/hard-checks.d.ts +4 -0
  1327. package/packages/core/dist/workflow-gate/hard-checks.js +130 -0
  1328. package/packages/core/dist/workflow-gate/hard-checks.js.map +1 -0
  1329. package/packages/core/dist/workflow-gate/policy.d.ts +4 -0
  1330. package/packages/core/dist/workflow-gate/policy.js +146 -0
  1331. package/packages/core/dist/workflow-gate/policy.js.map +1 -0
  1332. package/packages/core/dist/workflow-gate/types.d.ts +89 -0
  1333. package/packages/core/dist/workflow-gate/types.js +2 -0
  1334. package/packages/core/dist/workflow-gate/types.js.map +1 -0
  1335. package/packages/core/dist/workflow-state/affected-file-conflicts.d.ts +13 -0
  1336. package/packages/core/dist/workflow-state/affected-file-conflicts.js +75 -0
  1337. package/packages/core/dist/workflow-state/affected-file-conflicts.js.map +1 -0
  1338. package/packages/core/dist/workflow-state/dependencies.d.ts +29 -0
  1339. package/packages/core/dist/workflow-state/dependencies.js +78 -0
  1340. package/packages/core/dist/workflow-state/dependencies.js.map +1 -0
  1341. package/packages/core/dist/workflow-state/latest-eligible-run.d.ts +38 -0
  1342. package/packages/core/dist/workflow-state/latest-eligible-run.js +122 -0
  1343. package/packages/core/dist/workflow-state/latest-eligible-run.js.map +1 -0
  1344. package/packages/core/dist/workflow-state/resolve.d.ts +77 -0
  1345. package/packages/core/dist/workflow-state/resolve.js +253 -0
  1346. package/packages/core/dist/workflow-state/resolve.js.map +1 -0
  1347. package/packages/core/dist/workflow-state.d.ts +2 -0
  1348. package/packages/core/dist/workflow-state.js +3 -0
  1349. package/packages/core/dist/workflow-state.js.map +1 -0
  1350. package/packages/core/dist/worktree/isolation.d.ts +40 -0
  1351. package/packages/core/dist/worktree/isolation.js +89 -0
  1352. package/packages/core/dist/worktree/isolation.js.map +1 -0
  1353. package/packages/core/dist/worktree/lifecycle.d.ts +39 -0
  1354. package/packages/core/dist/worktree/lifecycle.js +221 -0
  1355. package/packages/core/dist/worktree/lifecycle.js.map +1 -0
  1356. package/packages/core/dist/worktree.d.ts +2 -0
  1357. package/packages/core/dist/worktree.js +3 -0
  1358. package/packages/core/dist/worktree.js.map +1 -0
  1359. package/packages/core/package.json +40 -0
  1360. package/tsconfig.build.json +4 -3
  1361. package/dist/packages/cli/src/main.js +0 -2522
  1362. package/dist/packages/cli/src/main.js.map +0 -1
  1363. package/dist/packages/cli/src/options.js.map +0 -1
  1364. package/dist/packages/core/src/ai-tools.js +0 -315
  1365. package/dist/packages/core/src/ai-tools.js.map +0 -1
  1366. package/dist/packages/core/src/index.d.ts +0 -1986
  1367. package/dist/packages/core/src/index.js +0 -9722
  1368. package/dist/packages/core/src/index.js.map +0 -1
  1369. package/dist/packages/core/src/instructions.js +0 -118
  1370. package/dist/packages/core/src/instructions.js.map +0 -1
  1371. package/dist/packages/core/src/path-safety.js.map +0 -1
  1372. /package/{dist/packages/core/src → node_modules/@sdd-agent-platform/core/dist}/path-safety.d.ts +0 -0
  1373. /package/{dist/packages/core/src → node_modules/@sdd-agent-platform/core/dist}/path-safety.js +0 -0
  1374. /package/{dist/packages/cli/src → packages/cli/dist}/main.d.ts +0 -0
@@ -0,0 +1,182 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { readFile } from 'node:fs/promises';
3
+ import { WORKFLOW_GATE_RUNTIME_CONTRACT_VERSION } from '../contracts.js';
4
+ import { listRuntimeArtifactPayloads, listRuntimeDurableGaps, listRuntimeFanInEvidenceSets, listRuntimeLlmAdvisorAssessments, listRuntimeSyncBackDecisions, recordRuntimeWorkflowGateDecision, runtimeScopedId } from '../storage/runtime-store.js';
5
+ import { getEvidenceAttachmentPath } from '../runtime-paths.js';
6
+ import { readAllRunStates } from '../run-state/run-state.js';
7
+ import { affectedFileConflictsForSelectedRuns } from '../workflow-state/affected-file-conflicts.js';
8
+ import { resolveWorkflowState } from '../workflow-state/resolve.js';
9
+ import { evaluateWorkflowGateHardChecks } from './hard-checks.js';
10
+ import { synthesizeWorkflowGateDecision } from './policy.js';
11
+ export async function buildWorkflowGateEvidencePacket(projectRoot, input) {
12
+ const workflow = await resolveWorkflowState(projectRoot, { branch: input.branch, branchSource: input.branch ? 'cli_option' : undefined, taskId: input.taskId ?? null });
13
+ const taskId = input.taskId ?? workflow.latestRun?.taskId ?? workflow.model.tasks[0]?.id ?? null;
14
+ const selection = taskId ? workflow.latestEligibleRunsByTask.find((candidate) => candidate.taskId === taskId) ?? null : null;
15
+ const runId = input.runId ?? selection?.selected?.runId ?? workflow.latestRun?.runId ?? null;
16
+ const scopedTaskIds = sortedUnique(input.taskIds ?? (taskId ? [taskId] : []));
17
+ const scopedLatestEligibleSelections = scopedTaskIds.length > 0
18
+ ? scopedTaskIds.map((scopedTaskId) => workflow.latestEligibleRunsByTask.find((candidate) => candidate.taskId === scopedTaskId) ?? emptyLatestEligibleSelection(workflow.branch, scopedTaskId))
19
+ : (selection ? [selection] : []);
20
+ const scopedRunIds = sortedUnique(input.runIds ?? scopedLatestEligibleSelections.flatMap((candidate) => candidate.selected ? [candidate.selected.runId] : []));
21
+ const workflowScope = {
22
+ waveRunId: input.waveRunId ?? null,
23
+ taskIds: scopedTaskIds,
24
+ runIds: scopedRunIds.length > 0 ? scopedRunIds : sortedUnique(runId ? [runId] : []),
25
+ evidenceRefs: sortedUnique(input.evidenceRefs ?? [])
26
+ };
27
+ const scopedTasks = workflowScope.taskIds.length > 0
28
+ ? workflow.model.tasks.filter((candidate) => workflowScope.taskIds.includes(candidate.id))
29
+ : workflow.model.tasks.filter((candidate) => candidate.id === taskId);
30
+ const runtimeInputs = await loadRuntimeGateInputs(projectRoot, workflow.branch, workflowScope.taskIds, workflowScope.runIds);
31
+ const scopedAffectedFileConflicts = await loadScopedAffectedFileConflicts(projectRoot, workflow.affectedFileConflicts, workflowScope.runIds);
32
+ const packetBase = {
33
+ packetId: runtimeScopedId(WORKFLOW_GATE_RUNTIME_CONTRACT_VERSION, workflow.branch, taskId ?? 'none', runId ?? 'none', input.decisionKind),
34
+ generatedAt: new Date().toISOString(),
35
+ decisionKind: input.decisionKind,
36
+ partition: workflow.branch,
37
+ taskId,
38
+ runId,
39
+ documents: workflow.documents,
40
+ latestEligibleSelection: selection,
41
+ latestEligibleSelections: scopedLatestEligibleSelections,
42
+ workflowScope,
43
+ runtimeHealth: runtimeInputs.runtimeHealth,
44
+ durableGaps: runtimeInputs.durableGaps,
45
+ dependencyBlockers: workflow.dependencyBlockers,
46
+ affectedFileConflicts: scopedAffectedFileConflicts,
47
+ syncBackDecision: runtimeInputs.syncBackDecisions[0] ?? null,
48
+ syncBackDecisions: runtimeInputs.syncBackDecisions,
49
+ fanInEvidenceSets: runtimeInputs.fanInEvidenceSets,
50
+ advisorAssessments: runtimeInputs.advisorAssessments,
51
+ canonicalEvidenceRefs: sortedUnique([...workflowScope.evidenceRefs, ...runtimeInputs.payloads.filter((payload) => payload.status === 'active').map((payload) => payload.logicalRef)]),
52
+ requiredArtifactRefs: sortedUnique(scopedTasks.flatMap((task) => task.requiredArtifacts)),
53
+ artifactPayloadHealth: await inspectArtifactPayloadHealth(projectRoot, runtimeInputs.payloads.filter((payload) => payload.status === 'active'))
54
+ };
55
+ return {
56
+ ...packetBase,
57
+ hardChecks: evaluateWorkflowGateHardChecks(packetBase)
58
+ };
59
+ }
60
+ function emptyLatestEligibleSelection(partition, taskId) {
61
+ return {
62
+ partition,
63
+ taskId,
64
+ selected: null,
65
+ candidates: [],
66
+ rejected: []
67
+ };
68
+ }
69
+ async function loadScopedAffectedFileConflicts(projectRoot, fallback, runIds) {
70
+ if (runIds.length === 0) {
71
+ return fallback;
72
+ }
73
+ const states = await readAllRunStates(projectRoot);
74
+ const selectedRuns = states.filter((state) => runIds.includes(state.runId));
75
+ return affectedFileConflictsForSelectedRuns(states, selectedRuns);
76
+ }
77
+ async function loadRuntimeGateInputs(projectRoot, partition, taskIds, runIds) {
78
+ try {
79
+ const runtimeScopes = scopedRuntimeQueries(taskIds, runIds);
80
+ const [durableGapResults, syncBackDecisionResults, fanInEvidenceSetResults, advisorAssessmentResults, payloadResults] = await Promise.all([
81
+ Promise.all(runtimeScopes.map((scope) => listRuntimeDurableGaps(projectRoot, { partition, taskId: scope.taskId, runId: scope.runId, status: 'open_terminal' }))),
82
+ Promise.all(runIds.map((scopedRunId) => listRuntimeSyncBackDecisions(projectRoot, scopedRunId))),
83
+ Promise.all(runtimeScopes.map((scope) => listRuntimeFanInEvidenceSets(projectRoot, { partition, taskId: scope.taskId, runId: scope.runId }))),
84
+ Promise.all(runtimeScopes.map((scope) => listRuntimeLlmAdvisorAssessments(projectRoot, { partition, taskId: scope.taskId, runId: scope.runId }))),
85
+ Promise.all(runIds.map((scopedRunId) => listRuntimeArtifactPayloads(projectRoot, { runId: scopedRunId })))
86
+ ]);
87
+ return {
88
+ runtimeHealth: { status: 'ok', issues: [] },
89
+ durableGaps: uniqueBy(durableGapResults.flat(), (gap) => gap.gapId),
90
+ syncBackDecisions: uniqueBy(syncBackDecisionResults.flat(), (decision) => decision.decisionId),
91
+ fanInEvidenceSets: uniqueBy(fanInEvidenceSetResults.flat(), (evidenceSet) => evidenceSet.fanInId),
92
+ advisorAssessments: uniqueBy(advisorAssessmentResults.flat(), (assessment) => assessment.assessmentId),
93
+ payloads: uniqueBy(payloadResults.flat(), (payload) => payload.payloadId)
94
+ };
95
+ }
96
+ catch (error) {
97
+ return {
98
+ runtimeHealth: { status: 'unavailable', issues: [messageFromError(error)] },
99
+ durableGaps: [],
100
+ syncBackDecisions: [],
101
+ fanInEvidenceSets: [],
102
+ advisorAssessments: [],
103
+ payloads: []
104
+ };
105
+ }
106
+ }
107
+ function scopedRuntimeQueries(taskIds, runIds) {
108
+ if (taskIds.length === 0 && runIds.length === 0) {
109
+ return [{ taskId: null, runId: null }];
110
+ }
111
+ if (taskIds.length === 0) {
112
+ return runIds.map((scopedRunId) => ({ taskId: null, runId: scopedRunId }));
113
+ }
114
+ if (runIds.length === 0) {
115
+ return taskIds.map((scopedTaskId) => ({ taskId: scopedTaskId, runId: null }));
116
+ }
117
+ return uniqueBy([
118
+ ...taskIds.flatMap((scopedTaskId) => runIds.map((scopedRunId) => ({ taskId: scopedTaskId, runId: scopedRunId }))),
119
+ ...taskIds.map((scopedTaskId) => ({ taskId: scopedTaskId, runId: null })),
120
+ ...runIds.map((scopedRunId) => ({ taskId: null, runId: scopedRunId }))
121
+ ], (scope) => `${scope.taskId ?? 'none'}:${scope.runId ?? 'none'}`);
122
+ }
123
+ function uniqueBy(items, keyOf) {
124
+ const seen = new Set();
125
+ return items.filter((item) => {
126
+ const key = keyOf(item);
127
+ if (seen.has(key)) {
128
+ return false;
129
+ }
130
+ seen.add(key);
131
+ return true;
132
+ });
133
+ }
134
+ async function inspectArtifactPayloadHealth(projectRoot, payloads) {
135
+ return Promise.all(payloads.map(async (payload) => {
136
+ try {
137
+ const raw = await readFile(getEvidenceAttachmentPath(projectRoot, payload.branchSlug, payload.physicalPayloadPath), 'utf8');
138
+ const actualDigest = hashDocumentContent(raw);
139
+ return {
140
+ payloadId: payload.payloadId,
141
+ logicalRef: payload.logicalRef,
142
+ physicalPayloadPath: payload.physicalPayloadPath,
143
+ expectedDigest: payload.digest,
144
+ actualDigest,
145
+ status: actualDigest === payload.digest ? 'ok' : 'digest_drift'
146
+ };
147
+ }
148
+ catch {
149
+ return {
150
+ payloadId: payload.payloadId,
151
+ logicalRef: payload.logicalRef,
152
+ physicalPayloadPath: payload.physicalPayloadPath,
153
+ expectedDigest: payload.digest,
154
+ actualDigest: null,
155
+ status: 'missing'
156
+ };
157
+ }
158
+ }));
159
+ }
160
+ function hashDocumentContent(raw) {
161
+ return createHash('sha256').update(raw.replace(/\r\n/g, '\n'), 'utf8').digest('hex');
162
+ }
163
+ export async function evaluateAndRecordWorkflowGateDecision(projectRoot, input) {
164
+ const packet = await buildWorkflowGateEvidencePacket(projectRoot, input);
165
+ const decision = synthesizeWorkflowGateDecision(packet);
166
+ try {
167
+ await recordRuntimeWorkflowGateDecision(projectRoot, decision);
168
+ }
169
+ catch (error) {
170
+ if (packet.runtimeHealth.status === 'ok') {
171
+ throw error;
172
+ }
173
+ }
174
+ return { packet, decision };
175
+ }
176
+ function sortedUnique(values) {
177
+ return [...new Set(values.filter(Boolean))].sort();
178
+ }
179
+ function messageFromError(error) {
180
+ return error instanceof Error ? error.message : String(error);
181
+ }
182
+ //# sourceMappingURL=evidence-packet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evidence-packet.js","sourceRoot":"","sources":["../../src/workflow-gate/evidence-packet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,sCAAsC,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,2BAA2B,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,gCAAgC,EAAE,4BAA4B,EAAE,iCAAiC,EAAE,eAAe,EAAqC,MAAM,6BAA6B,CAAC;AACvR,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,oCAAoC,EAAE,MAAM,8CAA8C,CAAC;AACpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAG7D,MAAM,CAAC,KAAK,UAAU,+BAA+B,CAAC,WAAmB,EAAE,KAAmN;IAC5R,MAAM,QAAQ,GAAG,MAAM,oBAAoB,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC,CAAC;IACxK,MAAM,M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AC;IACH,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AAC9B,CAAC;AACD,SAAS,YAAY,CAAC,MAAgB;IACpC,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACrD,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"}
@@ -0,0 +1,4 @@
1
+ import type { WorkflowGateEvidencePacket, WorkflowGateHardCheck } from './types.js';
2
+ type WorkflowGateHardCheckInput = Omit<WorkflowGateEvidencePacket, 'hardChecks'>;
3
+ export declare function evaluateWorkflowGateHardChecks(packet: WorkflowGateHardCheckInput): WorkflowGateHardCheck[];
4
+ export {};
@@ -0,0 +1,130 @@
1
+ export function evaluateWorkflowGateHardChecks(packet) {
2
+ return [
3
+ ...runtimeHealthChecks(packet),
4
+ ...documentChecks(packet),
5
+ ...latestEligibleChecks(packet),
6
+ ...dependencyChecks(packet),
7
+ ...affectedFileChecks(packet),
8
+ ...durableGapChecks(packet),
9
+ ...artifactChecks(packet),
10
+ ...syncBackChecks(packet),
11
+ ...authorityChecks(packet)
12
+ ];
13
+ }
14
+ function runtimeHealthChecks(packet) {
15
+ if (packet.runtimeHealth.status === 'ok') {
16
+ return [];
17
+ }
18
+ return [blocked('schema_health_unavailable', packet.partition, `Runtime store health is unavailable: ${packet.runtimeHealth.issues.join('; ') || 'unknown issue'}.`, 'Repair runtime.sqlite schema or rerun after runtime storage is available.', packet.runtimeHealth.issues)];
19
+ }
20
+ function documentChecks(packet) {
21
+ const checks = [];
22
+ const docs = packet.documents;
23
+ const missing = [
24
+ ['spec.md', docs.specExists],
25
+ ['plan.md', docs.planExists],
26
+ ['tasks.md', docs.tasksExists],
27
+ ['verify.md', docs.verifyExists]
28
+ ].filter(([, exists]) => !exists).map(([name]) => String(name));
29
+ if (missing.length > 0) {
30
+ checks.push(blocked('missing_documents', packet.partition, `Missing workflow documents: ${missing.join(', ')}.`, 'Run the missing SDD document stages before gate evaluation.', missing));
31
+ }
32
+ const stale = [
33
+ ['plan.md', docs.planStale],
34
+ ['tasks.md', docs.tasksStale],
35
+ ['verify.md', docs.verifyStale]
36
+ ].filter(([, value]) => value === true).map(([name]) => String(name));
37
+ if (stale.length > 0) {
38
+ checks.push(blocked('stale_documents', packet.partition, `Stale workflow documents: ${stale.join(', ')}.`, 'Refresh the stale stage contract before continuing.', stale));
39
+ }
40
+ if (docs.verifyExists && !docs.verifyBasedOnTasksContractHash) {
41
+ checks.push(blocked('contract_hash_mismatch', packet.partition, 'verify.md is missing based_on_tasks_contract_hash.', 'Regenerate verify.md from the frozen current tasks contract.', ['verify.md', 'tasks.md']));
42
+ }
43
+ else if (docs.verifyBasedOnTasksContractHash && docs.tasksContractHash && docs.verifyBasedOnTasksContractHash !== docs.tasksContractHash) {
44
+ checks.push(blocked('contract_hash_mismatch', packet.partition, 'verify.md is bound to an older tasks contract hash.', 'Regenerate verify.md from the frozen current tasks contract.', ['verify.md', 'tasks.md']));
45
+ }
46
+ return checks;
47
+ }
48
+ function latestEligibleChecks(packet) {
49
+ const scopedSelections = packet.latestEligibleSelections ?? [];
50
+ const selections = scopedSelections.length > 0 ? scopedSelections : (packet.latestEligibleSelection ? [packet.latestEligibleSelection] : []);
51
+ if (selections.length === 0) {
52
+ return [warning('latest_eligible_missing', packet.partition, 'No latest eligible selection is available.', 'Create a run or inspect task evidence before applying gate decisions.', [])];
53
+ }
54
+ return selections.flatMap((selection) => {
55
+ if (!selection.selected && selection.candidates.length > 0) {
56
+ return [blocked('run_rejected', packet.partition, `No default-eligible run for ${selection.taskId}; rejected candidates=${selection.rejected.length}.`, 'Inspect rejected latest-eligible candidates and resolve their reasons.', selection.rejected.map((candidate) => candidate.runId))];
57
+ }
58
+ if (!selection.selected) {
59
+ return [warning('latest_eligible_missing', packet.partition, `No run candidates found for ${selection.taskId}.`, 'Run implementation or validation before expecting gate PASS.', [])];
60
+ }
61
+ const selected = selection.selected;
62
+ if (selected.runStatus === 'blocked' || selected.runStatus === 'failed' || selected.runStatus === 'archived') {
63
+ return [blocked('blocked_failed_or_archived_run', packet.partition, `Selected run ${selected.runId} is ${selected.runStatus}.`, 'Use a non-blocked completed run before continuing.', [selected.runId])];
64
+ }
65
+ if (!selected.eligibleForDefaultApply || selected.compatibility === 'strict_stale' || selected.compatibility === 'incompatible') {
66
+ return [blocked('run_rejected', packet.partition, `Selected run ${selected.runId} is not eligible: ${selected.reasons.join('; ') || selected.compatibility}.`, 'Resolve run eligibility before continuing.', [selected.runId])];
67
+ }
68
+ if (selected.validationStatus === 'fail' || selected.validationStatus === 'blocked') {
69
+ return [blocked('validation_failure', packet.partition, `Selected run validation is ${selected.validationStatus}.`, 'Rerun validation and collect passing evidence.', [selected.runId])];
70
+ }
71
+ return [];
72
+ });
73
+ }
74
+ function dependencyChecks(packet) {
75
+ return packet.dependencyBlockers.map((blocker) => blocked('dependency_blocker', packet.partition, blocker.reason, `Inspect dependency ${blocker.dependencyId} before continuing.`, [blocker.taskId, blocker.dependencyId]));
76
+ }
77
+ function affectedFileChecks(packet) {
78
+ return packet.affectedFileConflicts.map((conflict) => blocked('affected_file_conflict', packet.partition, `Affected file ${conflict.file} is active in run ${conflict.runId}.`, 'Resolve active run conflict before applying changes.', [conflict.file, conflict.runId]));
79
+ }
80
+ function durableGapChecks(packet) {
81
+ return packet.durableGaps
82
+ .filter((gap) => gap.status === 'open' || gap.status === 'acknowledged')
83
+ .filter((gap) => gap.severity === 'blocking')
84
+ .map((gap) => blocked('durable_gap_blocking', packet.partition, gap.message, gap.recommendation ?? 'Resolve the blocking durable gap before continuing.', [gap.gapId, ...gap.evidenceRefs]));
85
+ }
86
+ function artifactChecks(packet) {
87
+ const available = new Set([...packet.canonicalEvidenceRefs, ...packet.fanInEvidenceSets.flatMap((set) => [...set.canonicalEvidenceRefs, ...set.evidenceRefs])]);
88
+ const checks = packet.requiredArtifactRefs
89
+ .filter((ref) => !available.has(ref))
90
+ .map((ref) => blocked('missing_required_artifact', packet.partition, `Required artifact ${ref} is missing from gate evidence.`, 'Collect required artifacts before gate PASS.', [ref]));
91
+ for (const payload of packet.artifactPayloadHealth) {
92
+ if (payload.status === 'missing') {
93
+ checks.push(blocked('missing_payload', packet.partition, `Artifact payload ${payload.logicalRef} is missing at ${payload.physicalPayloadPath}.`, 'Restore the immutable payload or regenerate current evidence before gate PASS.', [payload.payloadId, payload.logicalRef, payload.physicalPayloadPath]));
94
+ }
95
+ else if (payload.status === 'digest_drift') {
96
+ checks.push(blocked('digest_drift', packet.partition, `Artifact payload ${payload.logicalRef} digest drifted: expected ${payload.expectedDigest} actual ${payload.actualDigest}.`, 'Treat the payload as tampered or stale; regenerate accepted evidence before gate PASS.', [payload.payloadId, payload.logicalRef, payload.physicalPayloadPath]));
97
+ }
98
+ }
99
+ return checks;
100
+ }
101
+ function syncBackChecks(packet) {
102
+ const decisions = packet.syncBackDecisions.length > 0 ? packet.syncBackDecisions : (packet.syncBackDecision ? [packet.syncBackDecision] : []);
103
+ return decisions
104
+ .filter((decision) => decision.status === 'blocked' || decision.status === 'divergent')
105
+ .map((decision) => blocked('sync_back_divergence', packet.partition, `Sync-back decision ${decision.decisionId} is ${decision.status}.`, 'Inspect sync-back decision divergence before continuing.', [decision.decisionId]));
106
+ }
107
+ function authorityChecks(packet) {
108
+ const checks = [];
109
+ for (const fanIn of packet.fanInEvidenceSets) {
110
+ if (fanIn.gateInputOnly !== true) {
111
+ checks.push(blocked('authority_violation', packet.partition, `Fan-in evidence set ${fanIn.fanInId} is not gate-input-only.`, 'Regenerate fan-in evidence as non-final gate input.', [fanIn.fanInId]));
112
+ }
113
+ }
114
+ for (const advisor of packet.advisorAssessments) {
115
+ if (advisor.advisoryOnly !== true) {
116
+ checks.push(blocked('authority_violation', packet.partition, `Advisor assessment ${advisor.assessmentId} is not advisory-only.`, 'Discard or regenerate advisor assessment as advisory-only.', [advisor.assessmentId]));
117
+ }
118
+ }
119
+ return checks;
120
+ }
121
+ function blocked(code, scope, message, recovery, refs) {
122
+ return { code, severity: 'blocked', scope, message, recovery, refs: sortedUnique(refs) };
123
+ }
124
+ function warning(code, scope, message, recovery, refs) {
125
+ return { code, severity: 'warning', scope, message, recovery, refs: sortedUnique(refs) };
126
+ }
127
+ function sortedUnique(values) {
128
+ return [...new Set(values.filter(Boolean))].sort();
129
+ }
130
+ //# sourceMappingURL=hard-checks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hard-checks.js","sourceRoot":"","sources":["../../src/workflow-gate/hard-checks.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,8BAA8B,CAAC,MAAkC;IAC/E,OAAO;QACL,GAAG,mBAAmB,CAAC,MAAM,CAAC;QAC9B,GAAG,cAAc,CAAC,MAAM,CAAC;QACzB,GAAG,oBAAoB,CAAC,MAAM,CAAC;QAC/B,GAAG,gBAAgB,CAAC,MAAM,CAAC;QAC3B,GAAG,kBAAkB,CAAC,MAAM,CAAC;QAC7B,GAAG,gBAAgB,CAAC,MAAM,CAAC;QAC3B,GAAG,cAAc,CAAC,MAAM,CAAC;QACzB,GAAG,cAAc,CAAC,MAAM,CAAC;QACzB,GAAG,eAAe,CAAC,MAAM,CAAC;KAC3B,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB,CAAC,MAAkC;IAC7D,IAAI,MAAM,CAAC,aAAa,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;QACzC,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,CAAC,OAAO,CAAC,2BAA2B,EAAE,MAAM,CAAC,SAAS,EAAE,wCAAwC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,eAAe,GAAG,EAAE,2EAA2E,EAAE,MAAM,CAA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AQ,EAAE,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;AAC3F,CAAC;AAED,SAAS,YAAY,CAAC,MAAgB;IACpC,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACrD,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { WorkflowGateAdvisorSummary, WorkflowGateDecision, WorkflowGateEvidencePacket } from './types.js';
2
+ export declare function synthesizeWorkflowGateDecision(packet: WorkflowGateEvidencePacket): WorkflowGateDecision;
3
+ export declare function summarizeAdvisors(packet: WorkflowGateEvidencePacket): WorkflowGateAdvisorSummary;
4
+ export declare function inputHash(packet: WorkflowGateEvidencePacket): string;
@@ -0,0 +1,146 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { WORKFLOW_GATE_RUNTIME_CONTRACT_VERSION } from '../contracts.js';
3
+ export function synthesizeWorkflowGateDecision(packet) {
4
+ const hardBlocks = packet.hardChecks.filter((check) => check.severity === 'blocked');
5
+ const warnings = packet.hardChecks.filter((check) => check.severity === 'warning');
6
+ const advisorSummary = summarizeAdvisors(packet);
7
+ const status = decideStatus(hardBlocks, warnings, advisorSummary, packet);
8
+ const humanRequired = status === 'HUMAN_REQUIRED';
9
+ const allowedNextActions = allowedActions(status, packet);
10
+ const forbiddenNextActions = forbiddenActions(status, packet);
11
+ return {
12
+ decisionId: `gate-${inputHash(packet).slice(0, 16)}`,
13
+ inputHash: inputHash(packet),
14
+ generatedAt: new Date().toISOString(),
15
+ partition: packet.partition,
16
+ taskId: packet.taskId,
17
+ runId: packet.runId,
18
+ decisionKind: packet.decisionKind,
19
+ status,
20
+ decidedBy: 'runtime_policy',
21
+ hardBlocks,
22
+ warnings,
23
+ advisorSummary,
24
+ allowedNextActions,
25
+ forbiddenNextActions,
26
+ humanRequired,
27
+ reasons: decisionReasons(status, hardBlocks, warnings, advisorSummary),
28
+ evidenceRefs: sortedUnique([...packet.canonicalEvidenceRefs, ...packet.fanInEvidenceSets.flatMap((set) => [...set.evidenceRefs, ...set.canonicalEvidenceRefs])]),
29
+ payload: {
30
+ contract: WORKFLOW_GATE_RUNTIME_CONTRACT_VERSION,
31
+ packetId: packet.packetId,
32
+ workflowScope: packet.workflowScope
33
+ }
34
+ };
35
+ }
36
+ export function summarizeAdvisors(packet) {
37
+ const highConcernCount = packet.advisorAssessments.filter((assessment) => assessment.concern === 'high').length;
38
+ const mediumConcernCount = packet.advisorAssessments.filter((assessment) => assessment.concern === 'medium').length;
39
+ const invalidCount = packet.advisorAssessments.filter((assessment) => assessment.advisoryOnly !== true || assessment.validity === 'invalid').length;
40
+ const lowConfidenceCount = packet.advisorAssessments.filter((assessment) => assessment.confidence === 'low').length;
41
+ return {
42
+ status: invalidCount > 0 ? 'invalid' : highConcernCount > 0 ? 'high_concern' : mediumConcernCount > 0 || lowConfidenceCount > 0 ? 'medium_concern' : packet.advisorAssessments.length > 0 ? 'low_concern' : 'none',
43
+ highConcernCount,
44
+ mediumConcernCount,
45
+ invalidCount,
46
+ lowConfidenceCount,
47
+ summaries: packet.advisorAssessments.map((assessment) => assessment.summary).filter(Boolean).sort()
48
+ };
49
+ }
50
+ export function inputHash(packet) {
51
+ return createHash('sha256').update(stableJson({
52
+ decisionKind: packet.decisionKind,
53
+ partition: packet.partition,
54
+ taskId: packet.taskId,
55
+ runId: packet.runId,
56
+ documents: packet.documents,
57
+ selection: packet.latestEligibleSelection,
58
+ selections: packet.latestEligibleSelections,
59
+ workflowScope: packet.workflowScope,
60
+ runtimeHealth: packet.runtimeHealth,
61
+ durableGaps: packet.durableGaps,
62
+ dependencyBlockers: packet.dependencyBlockers,
63
+ affectedFileConflicts: packet.affectedFileConflicts,
64
+ syncBackDecision: packet.syncBackDecision,
65
+ syncBackDecisions: packet.syncBackDecisions,
66
+ fanInEvidenceSets: packet.fanInEvidenceSets,
67
+ advisorAssessments: packet.advisorAssessments,
68
+ canonicalEvidenceRefs: packet.canonicalEvidenceRefs,
69
+ requiredArtifactRefs: packet.requiredArtifactRefs,
70
+ artifactPayloadHealth: packet.artifactPayloadHealth,
71
+ hardChecks: packet.hardChecks
72
+ }), 'utf8').digest('hex');
73
+ }
74
+ function decideStatus(hardBlocks, warnings, advisorSummary, packet) {
75
+ if (hardBlocks.length > 0) {
76
+ return 'BLOCKED';
77
+ }
78
+ if (advisorSummary.status === 'invalid') {
79
+ return 'HUMAN_REQUIRED';
80
+ }
81
+ if (advisorSummary.status === 'high_concern') {
82
+ return 'HUMAN_REQUIRED';
83
+ }
84
+ if (warnings.length > 0 || advisorSummary.status === 'medium_concern') {
85
+ return 'WARN';
86
+ }
87
+ if (packet.decisionKind === 'stage_transition' && packet.advisorAssessments.length > 0 && packet.canonicalEvidenceRefs.length === 0) {
88
+ return 'ADVISORY_ONLY';
89
+ }
90
+ return 'PASS';
91
+ }
92
+ function allowedActions(status, packet) {
93
+ if (status === 'PASS') {
94
+ return packet.decisionKind === 'ship' ? ['ship'] : ['continue'];
95
+ }
96
+ if (status === 'WARN') {
97
+ return ['inspect-evidence'];
98
+ }
99
+ if (status === 'HUMAN_REQUIRED') {
100
+ return ['create-decision-card', 'inspect-evidence'];
101
+ }
102
+ if (status === 'ADVISORY_ONLY') {
103
+ return ['inspect-advisor-assessments'];
104
+ }
105
+ return ['inspect-blockers', 'recover'];
106
+ }
107
+ function forbiddenActions(status, packet) {
108
+ if (status === 'BLOCKED') {
109
+ return ['ship', 'sync-back-apply', 'mark-task-complete', 'stage-pass'];
110
+ }
111
+ if (status === 'HUMAN_REQUIRED') {
112
+ return ['satisfy-with-role-result', 'satisfy-with-subagent-output'];
113
+ }
114
+ if (status === 'ADVISORY_ONLY') {
115
+ return ['treat-advisor-as-pass'];
116
+ }
117
+ return status === 'WARN' ? ['ship', 'sync-back-apply', 'mark-task-complete', 'stage-pass'] : packet.decisionKind === 'ship' ? [] : ['skip-evidence-recording'];
118
+ }
119
+ function decisionReasons(status, hardBlocks, warnings, advisorSummary) {
120
+ if (hardBlocks.length > 0) {
121
+ return hardBlocks.map((check) => `${check.code}: ${check.message}`);
122
+ }
123
+ if (status === 'HUMAN_REQUIRED') {
124
+ return [`advisor=${advisorSummary.status}; human decision required because role/subagent outputs cannot satisfy this gate.`];
125
+ }
126
+ if (warnings.length > 0) {
127
+ return warnings.map((check) => `${check.code}: ${check.message}`);
128
+ }
129
+ if (advisorSummary.status === 'medium_concern' || advisorSummary.status === 'high_concern') {
130
+ return [`advisor=${advisorSummary.status}`];
131
+ }
132
+ return [`runtime_policy produced ${status}`];
133
+ }
134
+ function sortedUnique(values) {
135
+ return [...new Set(values.filter(Boolean))].sort();
136
+ }
137
+ function stableJson(value) {
138
+ if (Array.isArray(value)) {
139
+ return `[${value.map(stableJson).join(',')}]`;
140
+ }
141
+ if (value && typeof value === 'object') {
142
+ return `{${Object.entries(value).sort(([left], [right]) => left.localeCompare(right)).map(([key, item]) => `${JSON.stringify(key)}:${stableJson(item)}`).join(',')}}`;
143
+ }
144
+ return JSON.stringify(value);
145
+ }
146
+ //# sourceMappingURL=policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy.js","sourceRoot":"","sources":["../../src/workflow-gate/policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,sCAAsC,EAAE,MAAM,iBAAiB,CAAC;AAGzE,MAAM,UAAU,8BAA8B,CAAC,MAAkC;IAC/E,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC;IACrF,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC;IACnF,MAAM,cAAc,GAAG,iBAAiB,CAAC,MAAM,CA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AgB;IACpC,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACrD,CAAC;AAED,SAAS,UAAU,CAAC,KAAc;IAChC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IAChD,CAAC;IACD,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvC,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,KAAgC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IACnM,CAAC;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,89 @@
1
+ import type { FanInEvidenceSetRecord, LlmAdvisorAssessmentRecord } from '../execution/stage-team-runtime.js';
2
+ import type { RuntimeDurableGapRecord, RuntimeSyncBackDecisionRecord } from '../storage/runtime-store.js';
3
+ import type { LatestEligibleRunSelection } from '../workflow-state/latest-eligible-run.js';
4
+ import type { WorkflowDependencyBlocker } from '../workflow-state/dependencies.js';
5
+ import type { WorkflowAffectedFileConflict } from '../workflow-state/affected-file-conflicts.js';
6
+ import type { SddTaskModel } from '../sdd-docs/task-parser.js';
7
+ export type WorkflowGateStatus = 'PASS' | 'WARN' | 'BLOCKED' | 'HUMAN_REQUIRED' | 'ADVISORY_ONLY';
8
+ export type WorkflowGateHardCheckSeverity = 'info' | 'warning' | 'blocked';
9
+ export type WorkflowGateAdvisorSummaryStatus = 'none' | 'low_concern' | 'medium_concern' | 'high_concern' | 'invalid';
10
+ export type WorkflowGateDecisionKind = 'test' | 'validation_wave' | 'review_gate' | 'sync_back' | 'ship' | 'stage_transition';
11
+ export type WorkflowGateHardCheckCode = 'schema_health_unavailable' | 'missing_documents' | 'stale_documents' | 'contract_hash_mismatch' | 'run_rejected' | 'blocked_failed_or_archived_run' | 'latest_eligible_missing' | 'missing_payload' | 'digest_drift' | 'missing_required_artifact' | 'validation_failure' | 'dependency_blocker' | 'authority_violation' | 'sync_back_divergence' | 'affected_file_conflict' | 'durable_gap_blocking';
12
+ export interface WorkflowGateHardCheck {
13
+ code: WorkflowGateHardCheckCode;
14
+ severity: WorkflowGateHardCheckSeverity;
15
+ scope: string;
16
+ message: string;
17
+ recovery: string;
18
+ refs: string[];
19
+ }
20
+ export interface WorkflowGateArtifactPayloadHealth {
21
+ payloadId: string;
22
+ logicalRef: string;
23
+ physicalPayloadPath: string;
24
+ expectedDigest: string;
25
+ actualDigest: string | null;
26
+ status: 'ok' | 'missing' | 'digest_drift';
27
+ }
28
+ export interface WorkflowGateRuntimeHealth {
29
+ status: 'ok' | 'unavailable';
30
+ issues: string[];
31
+ }
32
+ export interface WorkflowGateScope {
33
+ waveRunId: string | null;
34
+ taskIds: string[];
35
+ runIds: string[];
36
+ evidenceRefs: string[];
37
+ }
38
+ export interface WorkflowGateEvidencePacket {
39
+ packetId: string;
40
+ generatedAt: string;
41
+ decisionKind: WorkflowGateDecisionKind;
42
+ partition: string;
43
+ taskId: string | null;
44
+ runId: string | null;
45
+ documents: SddTaskModel['documents'];
46
+ latestEligibleSelection: LatestEligibleRunSelection | null;
47
+ latestEligibleSelections: LatestEligibleRunSelection[];
48
+ workflowScope: WorkflowGateScope;
49
+ runtimeHealth: WorkflowGateRuntimeHealth;
50
+ durableGaps: RuntimeDurableGapRecord[];
51
+ dependencyBlockers: WorkflowDependencyBlocker[];
52
+ affectedFileConflicts: WorkflowAffectedFileConflict[];
53
+ syncBackDecision: RuntimeSyncBackDecisionRecord | null;
54
+ syncBackDecisions: RuntimeSyncBackDecisionRecord[];
55
+ fanInEvidenceSets: FanInEvidenceSetRecord[];
56
+ advisorAssessments: LlmAdvisorAssessmentRecord[];
57
+ canonicalEvidenceRefs: string[];
58
+ requiredArtifactRefs: string[];
59
+ artifactPayloadHealth: WorkflowGateArtifactPayloadHealth[];
60
+ hardChecks: WorkflowGateHardCheck[];
61
+ }
62
+ export interface WorkflowGateAdvisorSummary {
63
+ status: WorkflowGateAdvisorSummaryStatus;
64
+ highConcernCount: number;
65
+ mediumConcernCount: number;
66
+ invalidCount: number;
67
+ lowConfidenceCount: number;
68
+ summaries: string[];
69
+ }
70
+ export interface WorkflowGateDecision {
71
+ decisionId: string;
72
+ inputHash: string;
73
+ generatedAt: string;
74
+ partition: string;
75
+ taskId: string | null;
76
+ runId: string | null;
77
+ decisionKind: WorkflowGateDecisionKind;
78
+ status: WorkflowGateStatus;
79
+ decidedBy: 'runtime_policy';
80
+ hardBlocks: WorkflowGateHardCheck[];
81
+ warnings: WorkflowGateHardCheck[];
82
+ advisorSummary: WorkflowGateAdvisorSummary;
83
+ allowedNextActions: string[];
84
+ forbiddenNextActions: string[];
85
+ humanRequired: boolean;
86
+ reasons: string[];
87
+ evidenceRefs: string[];
88
+ payload: unknown;
89
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/workflow-gate/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import type { RunState } from '../run-state/model.js';
2
+ export interface WorkflowAffectedFileConflict {
3
+ file: string;
4
+ partition: string;
5
+ gitBranch: string | null;
6
+ taskId: string;
7
+ runId: string;
8
+ runStatus: RunState['status'];
9
+ syncBackStatus: RunState['syncBack']['status'];
10
+ updatedAt: string;
11
+ }
12
+ export declare function affectedFileConflictsForSelectedRun(states: RunState[], selected: RunState): WorkflowAffectedFileConflict[];
13
+ export declare function affectedFileConflictsForSelectedRuns(states: RunState[], selectedRuns: RunState[]): WorkflowAffectedFileConflict[];