sdd-agent-platform 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (722) hide show
  1. package/README.md +30 -28
  2. package/node_modules/@sdd-agent-platform/core/dist/ai-tools.js +67 -69
  3. package/node_modules/@sdd-agent-platform/core/dist/ai-tools.js.map +1 -1
  4. package/node_modules/@sdd-agent-platform/core/dist/artifacts/ingestion.js +64 -9
  5. package/node_modules/@sdd-agent-platform/core/dist/artifacts/ingestion.js.map +1 -1
  6. package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-evidence.js +0 -1
  7. package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-evidence.js.map +1 -1
  8. package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-result.js +26 -17
  9. package/node_modules/@sdd-agent-platform/core/dist/artifacts/sdd-result.js.map +1 -1
  10. package/node_modules/@sdd-agent-platform/core/dist/config/init-project.d.ts +3 -0
  11. package/node_modules/@sdd-agent-platform/core/dist/config/init-project.js +12 -9
  12. package/node_modules/@sdd-agent-platform/core/dist/config/init-project.js.map +1 -1
  13. package/node_modules/@sdd-agent-platform/core/dist/config/project-config.d.ts +3 -1
  14. package/node_modules/@sdd-agent-platform/core/dist/config/project-config.js +7 -3
  15. package/node_modules/@sdd-agent-platform/core/dist/config/project-config.js.map +1 -1
  16. package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.d.ts +4 -4
  17. package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.js +12 -25
  18. package/node_modules/@sdd-agent-platform/core/dist/config/starter-documents.js.map +1 -1
  19. package/node_modules/@sdd-agent-platform/core/dist/context/build-package.d.ts +1 -1
  20. package/node_modules/@sdd-agent-platform/core/dist/context/build-package.js +1 -7
  21. package/node_modules/@sdd-agent-platform/core/dist/context/build-package.js.map +1 -1
  22. package/node_modules/@sdd-agent-platform/core/dist/context/evidence-summary.js +26 -8
  23. package/node_modules/@sdd-agent-platform/core/dist/context/evidence-summary.js.map +1 -1
  24. package/node_modules/@sdd-agent-platform/core/dist/context/log-worker.js +2 -2
  25. package/node_modules/@sdd-agent-platform/core/dist/context/log-worker.js.map +1 -1
  26. package/node_modules/@sdd-agent-platform/core/dist/context-offload/contracts.d.ts +1 -1
  27. package/node_modules/@sdd-agent-platform/core/dist/contracts.d.ts +2 -1
  28. package/node_modules/@sdd-agent-platform/core/dist/contracts.js +1 -0
  29. package/node_modules/@sdd-agent-platform/core/dist/contracts.js.map +1 -1
  30. package/node_modules/@sdd-agent-platform/core/dist/delegation/model.d.ts +3 -0
  31. package/node_modules/@sdd-agent-platform/core/dist/delegation/validation.d.ts +3 -0
  32. package/node_modules/@sdd-agent-platform/core/dist/delegation/validation.js +7 -4
  33. package/node_modules/@sdd-agent-platform/core/dist/delegation/validation.js.map +1 -1
  34. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/document-chain.js +1 -1
  35. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/document-chain.js.map +1 -1
  36. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/project.js +8 -8
  37. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/project.js.map +1 -1
  38. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/registries.js +0 -1
  39. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/registries.js.map +1 -1
  40. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-evidence.js +4 -4
  41. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-evidence.js.map +1 -1
  42. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-trust.js +0 -24
  43. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/run-trust.js.map +1 -1
  44. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/runtime-contracts.js +1 -1
  45. package/node_modules/@sdd-agent-platform/core/dist/doctor/checks/runtime-contracts.js.map +1 -1
  46. package/node_modules/@sdd-agent-platform/core/dist/doctor/doctor.js +178 -58
  47. package/node_modules/@sdd-agent-platform/core/dist/doctor/doctor.js.map +1 -1
  48. package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.js +14 -7
  49. package/node_modules/@sdd-agent-platform/core/dist/evidence/lookup.js.map +1 -1
  50. package/node_modules/@sdd-agent-platform/core/dist/evidence-runtime/contracts.d.ts +0 -1
  51. package/node_modules/@sdd-agent-platform/core/dist/execution/background-executor.js +4 -4
  52. package/node_modules/@sdd-agent-platform/core/dist/execution/background-executor.js.map +1 -1
  53. package/node_modules/@sdd-agent-platform/core/dist/execution/foreground-subagents.js +3 -3
  54. package/node_modules/@sdd-agent-platform/core/dist/execution/foreground-subagents.js.map +1 -1
  55. package/node_modules/@sdd-agent-platform/core/dist/execution/host-invocation.js +5 -4
  56. package/node_modules/@sdd-agent-platform/core/dist/execution/host-invocation.js.map +1 -1
  57. package/node_modules/@sdd-agent-platform/core/dist/execution/resident-worker.js +3 -2
  58. package/node_modules/@sdd-agent-platform/core/dist/execution/resident-worker.js.map +1 -1
  59. package/node_modules/@sdd-agent-platform/core/dist/execution/stage-team-runtime.js +2 -2
  60. package/node_modules/@sdd-agent-platform/core/dist/execution/stage-team-runtime.js.map +1 -1
  61. package/node_modules/@sdd-agent-platform/core/dist/governance/policy.d.ts +1 -1
  62. package/node_modules/@sdd-agent-platform/core/dist/governance/policy.js +1 -1
  63. package/node_modules/@sdd-agent-platform/core/dist/governance/policy.js.map +1 -1
  64. package/node_modules/@sdd-agent-platform/core/dist/instructions.d.ts +1 -1
  65. package/node_modules/@sdd-agent-platform/core/dist/instructions.js +54 -61
  66. package/node_modules/@sdd-agent-platform/core/dist/instructions.js.map +1 -1
  67. package/node_modules/@sdd-agent-platform/core/dist/lifecycle/decision-gate.js +1 -1
  68. package/node_modules/@sdd-agent-platform/core/dist/lifecycle/decision-gate.js.map +1 -1
  69. package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.d.ts +1 -0
  70. package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.js +24 -8
  71. package/node_modules/@sdd-agent-platform/core/dist/lifecycle/ship.js.map +1 -1
  72. package/node_modules/@sdd-agent-platform/core/dist/orchestration/contracts.d.ts +1 -1
  73. package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.d.ts +12 -2
  74. package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.js +62 -21
  75. package/node_modules/@sdd-agent-platform/core/dist/orchestration/runtime.js.map +1 -1
  76. package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.d.ts +5 -2
  77. package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.js +69 -27
  78. package/node_modules/@sdd-agent-platform/core/dist/registries/agent-capability-catalog.js.map +1 -1
  79. package/node_modules/@sdd-agent-platform/core/dist/registries/agent-registry.js +15 -15
  80. package/node_modules/@sdd-agent-platform/core/dist/registries/agent-registry.js.map +1 -1
  81. package/node_modules/@sdd-agent-platform/core/dist/registries/agent-runtime-static.js +1 -1
  82. package/node_modules/@sdd-agent-platform/core/dist/registries/agent-runtime-static.js.map +1 -1
  83. package/node_modules/@sdd-agent-platform/core/dist/registries/capability-sources.js +1 -1
  84. package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.d.ts +1 -1
  85. package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.js +9 -9
  86. package/node_modules/@sdd-agent-platform/core/dist/registries/command-team-runtime.js.map +1 -1
  87. package/node_modules/@sdd-agent-platform/core/dist/registries/eval-learning-context.js +4 -4
  88. package/node_modules/@sdd-agent-platform/core/dist/registries/eval-learning-context.js.map +1 -1
  89. package/node_modules/@sdd-agent-platform/core/dist/registries/query-status.js +2 -2
  90. package/node_modules/@sdd-agent-platform/core/dist/registries/query-status.js.map +1 -1
  91. package/node_modules/@sdd-agent-platform/core/dist/registries/tool-capabilities.js +3 -3
  92. package/node_modules/@sdd-agent-platform/core/dist/registries/tool-capabilities.js.map +1 -1
  93. package/node_modules/@sdd-agent-platform/core/dist/registries/tool-plugins.js +2 -2
  94. package/node_modules/@sdd-agent-platform/core/dist/registries/tool-plugins.js.map +1 -1
  95. package/node_modules/@sdd-agent-platform/core/dist/registries/worker-adapters.js +11 -11
  96. package/node_modules/@sdd-agent-platform/core/dist/registries/worker-adapters.js.map +1 -1
  97. package/node_modules/@sdd-agent-platform/core/dist/registries/workflow-gates.js +12 -12
  98. package/node_modules/@sdd-agent-platform/core/dist/registries/workflow-gates.js.map +1 -1
  99. package/node_modules/@sdd-agent-platform/core/dist/risk/contracts.d.ts +2 -2
  100. package/node_modules/@sdd-agent-platform/core/dist/risk/kernel.js +4 -4
  101. package/node_modules/@sdd-agent-platform/core/dist/risk/kernel.js.map +1 -1
  102. package/node_modules/@sdd-agent-platform/core/dist/risk/legacy-adapters.js +4 -7
  103. package/node_modules/@sdd-agent-platform/core/dist/risk/legacy-adapters.js.map +1 -1
  104. package/node_modules/@sdd-agent-platform/core/dist/risk/workflow-gates.d.ts +2 -2
  105. package/node_modules/@sdd-agent-platform/core/dist/risk/workflow-gates.js +19 -17
  106. package/node_modules/@sdd-agent-platform/core/dist/risk/workflow-gates.js.map +1 -1
  107. package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime-config.js +1 -1
  108. package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime-config.js.map +1 -1
  109. package/node_modules/@sdd-agent-platform/core/dist/router/agent-runtime.d.ts +2 -0
  110. package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.js +1 -1
  111. package/node_modules/@sdd-agent-platform/core/dist/router/route-projection.js.map +1 -1
  112. package/node_modules/@sdd-agent-platform/core/dist/router/routing.js +45 -15
  113. package/node_modules/@sdd-agent-platform/core/dist/router/routing.js.map +1 -1
  114. package/node_modules/@sdd-agent-platform/core/dist/router/runtime-import.d.ts +28 -0
  115. package/node_modules/@sdd-agent-platform/core/dist/router/runtime-import.js +373 -0
  116. package/node_modules/@sdd-agent-platform/core/dist/router/runtime-import.js.map +1 -0
  117. package/node_modules/@sdd-agent-platform/core/dist/router/runtime-validation.js +2 -2
  118. package/node_modules/@sdd-agent-platform/core/dist/router/runtime-validation.js.map +1 -1
  119. package/node_modules/@sdd-agent-platform/core/dist/router/stage-route-binding.d.ts +37 -0
  120. package/node_modules/@sdd-agent-platform/core/dist/router/stage-route-binding.js +235 -0
  121. package/node_modules/@sdd-agent-platform/core/dist/router/stage-route-binding.js.map +1 -0
  122. package/node_modules/@sdd-agent-platform/core/dist/router.d.ts +2 -0
  123. package/node_modules/@sdd-agent-platform/core/dist/router.js +2 -0
  124. package/node_modules/@sdd-agent-platform/core/dist/router.js.map +1 -1
  125. package/node_modules/@sdd-agent-platform/core/dist/run-state/artifacts.d.ts +16 -0
  126. package/node_modules/@sdd-agent-platform/core/dist/run-state/artifacts.js +126 -9
  127. package/node_modules/@sdd-agent-platform/core/dist/run-state/artifacts.js.map +1 -1
  128. package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.d.ts +0 -2
  129. package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.js +7 -5
  130. package/node_modules/@sdd-agent-platform/core/dist/run-state/inspect-run.js.map +1 -1
  131. package/node_modules/@sdd-agent-platform/core/dist/run-state/model.d.ts +28 -8
  132. package/node_modules/@sdd-agent-platform/core/dist/run-state/run-index.d.ts +0 -2
  133. package/node_modules/@sdd-agent-platform/core/dist/run-state/run-index.js +1 -3
  134. package/node_modules/@sdd-agent-platform/core/dist/run-state/run-index.js.map +1 -1
  135. package/node_modules/@sdd-agent-platform/core/dist/run-state/run-state.js +37 -27
  136. package/node_modules/@sdd-agent-platform/core/dist/run-state/run-state.js.map +1 -1
  137. package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.d.ts +5 -2
  138. package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.js +53 -14
  139. package/node_modules/@sdd-agent-platform/core/dist/run-state/task-evidence.js.map +1 -1
  140. package/node_modules/@sdd-agent-platform/core/dist/run-state/timing.d.ts +8 -0
  141. package/node_modules/@sdd-agent-platform/core/dist/run-state/timing.js +131 -0
  142. package/node_modules/@sdd-agent-platform/core/dist/run-state/timing.js.map +1 -0
  143. package/node_modules/@sdd-agent-platform/core/dist/run-state.d.ts +1 -0
  144. package/node_modules/@sdd-agent-platform/core/dist/run-state.js +1 -0
  145. package/node_modules/@sdd-agent-platform/core/dist/run-state.js.map +1 -1
  146. package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/build.js +0 -3
  147. package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/build.js.map +1 -1
  148. package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/findings.js +5 -44
  149. package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/findings.js.map +1 -1
  150. package/node_modules/@sdd-agent-platform/core/dist/runtime-analysis/model.d.ts +1 -17
  151. package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.d.ts +10 -0
  152. package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.js +65 -0
  153. package/node_modules/@sdd-agent-platform/core/dist/runtime-paths.js.map +1 -1
  154. package/node_modules/@sdd-agent-platform/core/dist/runtime-projection-p0.d.ts +64 -0
  155. package/node_modules/@sdd-agent-platform/core/dist/runtime-projection-p0.js +200 -0
  156. package/node_modules/@sdd-agent-platform/core/dist/runtime-projection-p0.js.map +1 -0
  157. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.d.ts +2 -0
  158. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.js +97 -10
  159. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/document-hashes.js.map +1 -1
  160. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/run-binding.d.ts +1 -1
  161. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/run-binding.js +8 -6
  162. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/run-binding.js.map +1 -1
  163. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.d.ts +1 -0
  164. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.js +55 -34
  165. package/node_modules/@sdd-agent-platform/core/dist/sdd-docs/task-parser.js.map +1 -1
  166. package/node_modules/@sdd-agent-platform/core/dist/stage-artifacts.d.ts +55 -0
  167. package/node_modules/@sdd-agent-platform/core/dist/stage-artifacts.js +322 -0
  168. package/node_modules/@sdd-agent-platform/core/dist/stage-artifacts.js.map +1 -0
  169. package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration-contracts.d.ts +55 -0
  170. package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration-contracts.js +241 -0
  171. package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration-contracts.js.map +1 -0
  172. package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration.d.ts +888 -0
  173. package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration.js +3870 -0
  174. package/node_modules/@sdd-agent-platform/core/dist/stage-collaboration.js.map +1 -0
  175. package/node_modules/@sdd-agent-platform/core/dist/stage-runtime/runtime.js +8 -1
  176. package/node_modules/@sdd-agent-platform/core/dist/stage-runtime/runtime.js.map +1 -1
  177. package/node_modules/@sdd-agent-platform/core/dist/status/project-status.d.ts +44 -1
  178. package/node_modules/@sdd-agent-platform/core/dist/status/project-status.js +170 -23
  179. package/node_modules/@sdd-agent-platform/core/dist/status/project-status.js.map +1 -1
  180. package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.d.ts +170 -18
  181. package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.js +544 -32
  182. package/node_modules/@sdd-agent-platform/core/dist/storage/runtime-store.js.map +1 -1
  183. package/node_modules/@sdd-agent-platform/core/dist/subagents/contracts.d.ts +1 -1
  184. package/node_modules/@sdd-agent-platform/core/dist/subagents/runtime.js +7 -7
  185. package/node_modules/@sdd-agent-platform/core/dist/subagents/runtime.js.map +1 -1
  186. package/node_modules/@sdd-agent-platform/core/dist/test-support/fixtures.js +1 -1
  187. package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.d.ts +1 -1
  188. package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.js +8 -23
  189. package/node_modules/@sdd-agent-platform/core/dist/test-support/run-state.js.map +1 -1
  190. package/node_modules/@sdd-agent-platform/core/dist/truth-reconciliation.d.ts +44 -0
  191. package/node_modules/@sdd-agent-platform/core/dist/truth-reconciliation.js +138 -0
  192. package/node_modules/@sdd-agent-platform/core/dist/truth-reconciliation.js.map +1 -0
  193. package/node_modules/@sdd-agent-platform/core/dist/tsconfig.tsbuildinfo +1 -1
  194. package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.d.ts +0 -1
  195. package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.js +28 -53
  196. package/node_modules/@sdd-agent-platform/core/dist/verification/goal-verify.js.map +1 -1
  197. package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.d.ts +0 -2
  198. package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.js +10 -50
  199. package/node_modules/@sdd-agent-platform/core/dist/verification/rendering.js.map +1 -1
  200. package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.d.ts +0 -1
  201. package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.js +159 -150
  202. package/node_modules/@sdd-agent-platform/core/dist/verification/single-task-loop.js.map +1 -1
  203. package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.d.ts +12 -2
  204. package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.js +238 -103
  205. package/node_modules/@sdd-agent-platform/core/dist/verification/test-runtime.js.map +1 -1
  206. package/node_modules/@sdd-agent-platform/core/dist/verification/validation-cache.d.ts +26 -0
  207. package/node_modules/@sdd-agent-platform/core/dist/verification/validation-cache.js +73 -0
  208. package/node_modules/@sdd-agent-platform/core/dist/verification/validation-cache.js.map +1 -0
  209. package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.d.ts +18 -0
  210. package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.js +27 -5
  211. package/node_modules/@sdd-agent-platform/core/dist/verification/validation-wave.js.map +1 -1
  212. package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.d.ts +1 -1
  213. package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.js +9 -32
  214. package/node_modules/@sdd-agent-platform/core/dist/verification/verify-contract.js.map +1 -1
  215. package/node_modules/@sdd-agent-platform/core/dist/work-units/contracts.d.ts +1 -1
  216. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.js +228 -15
  217. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/evidence-packet.js.map +1 -1
  218. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.js +49 -15
  219. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/hard-checks.js.map +1 -1
  220. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.js +42 -6
  221. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/policy.js.map +1 -1
  222. package/node_modules/@sdd-agent-platform/core/dist/workflow-gate/types.d.ts +4 -5
  223. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.d.ts +0 -1
  224. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.js +1 -2
  225. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/affected-file-conflicts.js.map +1 -1
  226. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/dependencies.js +1 -1
  227. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.d.ts +0 -1
  228. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.js +72 -6
  229. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/latest-eligible-run.js.map +1 -1
  230. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/migration-recovery.d.ts +40 -0
  231. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/migration-recovery.js +110 -0
  232. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/migration-recovery.js.map +1 -0
  233. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/repair-contract.d.ts +12 -0
  234. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/repair-contract.js +63 -0
  235. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/repair-contract.js.map +1 -0
  236. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve-task-run.d.ts +21 -0
  237. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve-task-run.js +95 -0
  238. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve-task-run.js.map +1 -0
  239. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.d.ts +55 -5
  240. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.js +538 -34
  241. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/resolve.js.map +1 -1
  242. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/runtime-projections.d.ts +228 -0
  243. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/runtime-projections.js +452 -0
  244. package/node_modules/@sdd-agent-platform/core/dist/workflow-state/runtime-projections.js.map +1 -0
  245. package/node_modules/@sdd-agent-platform/core/package.json +3 -3
  246. package/node_modules/@sdd-agent-platform/core/src/ai-tools.test.ts +49 -1
  247. package/node_modules/@sdd-agent-platform/core/src/ai-tools.ts +67 -69
  248. package/node_modules/@sdd-agent-platform/core/src/artifacts/ingestion.test.ts +38 -0
  249. package/node_modules/@sdd-agent-platform/core/src/artifacts/ingestion.ts +65 -9
  250. package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-evidence.ts +0 -1
  251. package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-result.test.ts +2 -2
  252. package/node_modules/@sdd-agent-platform/core/src/artifacts/sdd-result.ts +26 -17
  253. package/node_modules/@sdd-agent-platform/core/src/config/init-project.test.ts +43 -31
  254. package/node_modules/@sdd-agent-platform/core/src/config/init-project.ts +14 -11
  255. package/node_modules/@sdd-agent-platform/core/src/config/project-config.ts +10 -4
  256. package/node_modules/@sdd-agent-platform/core/src/config/starter-documents.ts +12 -25
  257. package/node_modules/@sdd-agent-platform/core/src/context/build-package.ts +2 -8
  258. package/node_modules/@sdd-agent-platform/core/src/context/context-build.test.ts +3 -2
  259. package/node_modules/@sdd-agent-platform/core/src/context/evidence-summary.ts +27 -8
  260. package/node_modules/@sdd-agent-platform/core/src/context/log-worker.ts +2 -2
  261. package/node_modules/@sdd-agent-platform/core/src/context-offload/contracts.ts +1 -1
  262. package/node_modules/@sdd-agent-platform/core/src/contracts.ts +2 -1
  263. package/node_modules/@sdd-agent-platform/core/src/delegation/model.ts +3 -0
  264. package/node_modules/@sdd-agent-platform/core/src/delegation/validation.ts +8 -5
  265. package/node_modules/@sdd-agent-platform/core/src/doctor/checks/document-chain.ts +1 -1
  266. package/node_modules/@sdd-agent-platform/core/src/doctor/checks/project.ts +8 -8
  267. package/node_modules/@sdd-agent-platform/core/src/doctor/checks/registries.ts +0 -1
  268. package/node_modules/@sdd-agent-platform/core/src/doctor/checks/run-evidence.ts +4 -4
  269. package/node_modules/@sdd-agent-platform/core/src/doctor/checks/run-trust.ts +0 -21
  270. package/node_modules/@sdd-agent-platform/core/src/doctor/checks/runtime-contracts.ts +1 -1
  271. package/node_modules/@sdd-agent-platform/core/src/doctor/doctor.test.ts +143 -45
  272. package/node_modules/@sdd-agent-platform/core/src/doctor/doctor.ts +193 -58
  273. package/node_modules/@sdd-agent-platform/core/src/evidence/lookup.ts +15 -7
  274. package/node_modules/@sdd-agent-platform/core/src/evidence-runtime/contracts.ts +0 -1
  275. package/node_modules/@sdd-agent-platform/core/src/execution/background-executor.test.ts +50 -2
  276. package/node_modules/@sdd-agent-platform/core/src/execution/background-executor.ts +4 -4
  277. package/node_modules/@sdd-agent-platform/core/src/execution/foreground-subagents.test.ts +11 -2
  278. package/node_modules/@sdd-agent-platform/core/src/execution/foreground-subagents.ts +3 -3
  279. package/node_modules/@sdd-agent-platform/core/src/execution/host-invocation.ts +5 -4
  280. package/node_modules/@sdd-agent-platform/core/src/execution/resident-worker.test.ts +12 -1
  281. package/node_modules/@sdd-agent-platform/core/src/execution/resident-worker.ts +3 -2
  282. package/node_modules/@sdd-agent-platform/core/src/execution/stage-team-runtime.test.ts +1 -1
  283. package/node_modules/@sdd-agent-platform/core/src/execution/stage-team-runtime.ts +2 -2
  284. package/node_modules/@sdd-agent-platform/core/src/execution/wave-executor.test.ts +10 -0
  285. package/node_modules/@sdd-agent-platform/core/src/governance/policy.test.ts +8 -0
  286. package/node_modules/@sdd-agent-platform/core/src/governance/policy.ts +2 -2
  287. package/node_modules/@sdd-agent-platform/core/src/instructions.test.ts +33 -18
  288. package/node_modules/@sdd-agent-platform/core/src/instructions.ts +55 -62
  289. package/node_modules/@sdd-agent-platform/core/src/lifecycle/decision-gate.test.ts +1 -1
  290. package/node_modules/@sdd-agent-platform/core/src/lifecycle/decision-gate.ts +1 -1
  291. package/node_modules/@sdd-agent-platform/core/src/lifecycle/ship.test.ts +47 -0
  292. package/node_modules/@sdd-agent-platform/core/src/lifecycle/ship.ts +25 -8
  293. package/node_modules/@sdd-agent-platform/core/src/orchestration/contracts.ts +1 -1
  294. package/node_modules/@sdd-agent-platform/core/src/orchestration/runtime.ts +74 -22
  295. package/node_modules/@sdd-agent-platform/core/src/phase8-contracts.test.ts +2 -3
  296. package/node_modules/@sdd-agent-platform/core/src/phase8-risk-kernel.test.ts +3 -3
  297. package/node_modules/@sdd-agent-platform/core/src/registries/agent-capability-catalog.ts +82 -35
  298. package/node_modules/@sdd-agent-platform/core/src/registries/agent-registry.ts +15 -15
  299. package/node_modules/@sdd-agent-platform/core/src/registries/agent-runtime-static.ts +1 -1
  300. package/node_modules/@sdd-agent-platform/core/src/registries/capability-sources.ts +1 -1
  301. package/node_modules/@sdd-agent-platform/core/src/registries/command-team-runtime.ts +10 -10
  302. package/node_modules/@sdd-agent-platform/core/src/registries/eval-learning-context.ts +4 -4
  303. package/node_modules/@sdd-agent-platform/core/src/registries/query-status.ts +2 -2
  304. package/node_modules/@sdd-agent-platform/core/src/registries/registries.test.ts +18 -2
  305. package/node_modules/@sdd-agent-platform/core/src/registries/tool-capabilities.ts +3 -3
  306. package/node_modules/@sdd-agent-platform/core/src/registries/tool-plugins.ts +2 -2
  307. package/node_modules/@sdd-agent-platform/core/src/registries/worker-adapters.ts +11 -11
  308. package/node_modules/@sdd-agent-platform/core/src/registries/workflow-gates.ts +12 -12
  309. package/node_modules/@sdd-agent-platform/core/src/risk/contracts.ts +2 -2
  310. package/node_modules/@sdd-agent-platform/core/src/risk/kernel.ts +4 -4
  311. package/node_modules/@sdd-agent-platform/core/src/risk/legacy-adapters.ts +4 -7
  312. package/node_modules/@sdd-agent-platform/core/src/risk/workflow-gates.ts +20 -18
  313. package/node_modules/@sdd-agent-platform/core/src/router/agent-runtime-config.ts +1 -1
  314. package/node_modules/@sdd-agent-platform/core/src/router/agent-runtime.ts +2 -0
  315. package/node_modules/@sdd-agent-platform/core/src/router/route-projection.ts +1 -1
  316. package/node_modules/@sdd-agent-platform/core/src/router/route-sdd-task.test.ts +241 -4
  317. package/node_modules/@sdd-agent-platform/core/src/router/routing.ts +47 -15
  318. package/node_modules/@sdd-agent-platform/core/src/router/runtime-import.ts +453 -0
  319. package/node_modules/@sdd-agent-platform/core/src/router/runtime-validation.ts +2 -2
  320. package/node_modules/@sdd-agent-platform/core/src/router/stage-route-binding.ts +279 -0
  321. package/node_modules/@sdd-agent-platform/core/src/router.ts +2 -0
  322. package/node_modules/@sdd-agent-platform/core/src/run-state/artifacts.ts +132 -10
  323. package/node_modules/@sdd-agent-platform/core/src/run-state/inspect-run.ts +7 -7
  324. package/node_modules/@sdd-agent-platform/core/src/run-state/model.ts +31 -8
  325. package/node_modules/@sdd-agent-platform/core/src/run-state/run-index.ts +1 -5
  326. package/node_modules/@sdd-agent-platform/core/src/run-state/run-state.test.ts +50 -2
  327. package/node_modules/@sdd-agent-platform/core/src/run-state/run-state.ts +39 -29
  328. package/node_modules/@sdd-agent-platform/core/src/run-state/task-evidence.ts +62 -16
  329. package/node_modules/@sdd-agent-platform/core/src/run-state/timing.ts +146 -0
  330. package/node_modules/@sdd-agent-platform/core/src/run-state.ts +1 -0
  331. package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/build.ts +0 -3
  332. package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/findings.ts +6 -46
  333. package/node_modules/@sdd-agent-platform/core/src/runtime-analysis/model.ts +1 -13
  334. package/node_modules/@sdd-agent-platform/core/src/runtime-analysis.test.ts +0 -2
  335. package/node_modules/@sdd-agent-platform/core/src/runtime-paths.ts +77 -0
  336. package/node_modules/@sdd-agent-platform/core/src/runtime-projection-p0.test.ts +96 -0
  337. package/node_modules/@sdd-agent-platform/core/src/runtime-projection-p0.ts +292 -0
  338. package/node_modules/@sdd-agent-platform/core/src/sdd-docs/document-hashes.ts +109 -10
  339. package/node_modules/@sdd-agent-platform/core/src/sdd-docs/run-binding.ts +8 -6
  340. package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.test.ts +123 -1
  341. package/node_modules/@sdd-agent-platform/core/src/sdd-docs/task-parser.ts +58 -43
  342. package/node_modules/@sdd-agent-platform/core/src/stage-artifacts.ts +450 -0
  343. package/node_modules/@sdd-agent-platform/core/src/stage-collaboration-contracts.ts +322 -0
  344. package/node_modules/@sdd-agent-platform/core/src/stage-collaboration.test.ts +2903 -0
  345. package/node_modules/@sdd-agent-platform/core/src/stage-collaboration.ts +5831 -0
  346. package/node_modules/@sdd-agent-platform/core/src/stage-runtime/runtime.test.ts +1 -1
  347. package/node_modules/@sdd-agent-platform/core/src/stage-runtime/runtime.ts +9 -1
  348. package/node_modules/@sdd-agent-platform/core/src/status/project-status.test.ts +239 -16
  349. package/node_modules/@sdd-agent-platform/core/src/status/project-status.ts +249 -23
  350. package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.test.ts +196 -4
  351. package/node_modules/@sdd-agent-platform/core/src/storage/runtime-store.ts +860 -54
  352. package/node_modules/@sdd-agent-platform/core/src/subagents/contracts.ts +1 -1
  353. package/node_modules/@sdd-agent-platform/core/src/subagents/runtime.test.ts +3 -3
  354. package/node_modules/@sdd-agent-platform/core/src/subagents/runtime.ts +7 -7
  355. package/node_modules/@sdd-agent-platform/core/src/test-support/fixtures.ts +1 -1
  356. package/node_modules/@sdd-agent-platform/core/src/test-support/run-state.ts +9 -23
  357. package/node_modules/@sdd-agent-platform/core/src/truth-reconciliation.test.ts +72 -0
  358. package/node_modules/@sdd-agent-platform/core/src/truth-reconciliation.ts +177 -0
  359. package/node_modules/@sdd-agent-platform/core/src/verification/goal-verify.test.ts +13 -87
  360. package/node_modules/@sdd-agent-platform/core/src/verification/goal-verify.ts +27 -56
  361. package/node_modules/@sdd-agent-platform/core/src/verification/rendering.ts +10 -54
  362. package/node_modules/@sdd-agent-platform/core/src/verification/review-gate.test.ts +8 -1
  363. package/node_modules/@sdd-agent-platform/core/src/verification/single-task-loop.test.ts +93 -79
  364. package/node_modules/@sdd-agent-platform/core/src/verification/single-task-loop.ts +166 -154
  365. package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.test.ts +100 -47
  366. package/node_modules/@sdd-agent-platform/core/src/verification/test-runtime.ts +265 -107
  367. package/node_modules/@sdd-agent-platform/core/src/verification/validation-cache.ts +106 -0
  368. package/node_modules/@sdd-agent-platform/core/src/verification/validation-wave.test.ts +47 -5
  369. package/node_modules/@sdd-agent-platform/core/src/verification/validation-wave.ts +48 -5
  370. package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.test.ts +15 -31
  371. package/node_modules/@sdd-agent-platform/core/src/verification/verify-contract.ts +9 -33
  372. package/node_modules/@sdd-agent-platform/core/src/work-units/contracts.ts +1 -1
  373. package/node_modules/@sdd-agent-platform/core/src/workflow-gate/evidence-packet.ts +246 -17
  374. package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.test.ts +339 -3
  375. package/node_modules/@sdd-agent-platform/core/src/workflow-gate/hard-checks.ts +53 -14
  376. package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.test.ts +45 -8
  377. package/node_modules/@sdd-agent-platform/core/src/workflow-gate/policy.ts +45 -6
  378. package/node_modules/@sdd-agent-platform/core/src/workflow-gate/types.ts +6 -5
  379. package/node_modules/@sdd-agent-platform/core/src/workflow-state/affected-file-conflicts.ts +1 -3
  380. package/node_modules/@sdd-agent-platform/core/src/workflow-state/dependencies.ts +1 -1
  381. package/node_modules/@sdd-agent-platform/core/src/workflow-state/latest-eligible-run.ts +75 -7
  382. package/node_modules/@sdd-agent-platform/core/src/workflow-state/migration-recovery.ts +158 -0
  383. package/node_modules/@sdd-agent-platform/core/src/workflow-state/repair-contract.ts +77 -0
  384. package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve-task-run.ts +114 -0
  385. package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve.test.ts +518 -25
  386. package/node_modules/@sdd-agent-platform/core/src/workflow-state/resolve.ts +670 -41
  387. package/node_modules/@sdd-agent-platform/core/src/workflow-state/runtime-projections.ts +712 -0
  388. package/package.json +1 -1
  389. package/packages/cli/dist/args.js +2 -2
  390. package/packages/cli/dist/args.js.map +1 -1
  391. package/packages/cli/dist/commands/ai-tools.js +13 -2
  392. package/packages/cli/dist/commands/ai-tools.js.map +1 -1
  393. package/packages/cli/dist/commands/context.js +1 -1
  394. package/packages/cli/dist/commands/context.js.map +1 -1
  395. package/packages/cli/dist/commands/execution.js +49 -1
  396. package/packages/cli/dist/commands/execution.js.map +1 -1
  397. package/packages/cli/dist/commands/governance.js +1 -1
  398. package/packages/cli/dist/commands/governance.js.map +1 -1
  399. package/packages/cli/dist/commands/init.js +6 -1
  400. package/packages/cli/dist/commands/init.js.map +1 -1
  401. package/packages/cli/dist/commands/lifecycle.js +15 -2
  402. package/packages/cli/dist/commands/lifecycle.js.map +1 -1
  403. package/packages/cli/dist/commands/registry/runtime.js +48 -2
  404. package/packages/cli/dist/commands/registry/runtime.js.map +1 -1
  405. package/packages/cli/dist/commands/run.js +52 -2
  406. package/packages/cli/dist/commands/run.js.map +1 -1
  407. package/packages/cli/dist/commands/stage-close.d.ts +6 -0
  408. package/packages/cli/dist/commands/stage-close.js +295 -0
  409. package/packages/cli/dist/commands/stage-close.js.map +1 -0
  410. package/packages/cli/dist/commands/status.js +68 -2
  411. package/packages/cli/dist/commands/status.js.map +1 -1
  412. package/packages/cli/dist/commands/test.js +180 -2
  413. package/packages/cli/dist/commands/test.js.map +1 -1
  414. package/packages/cli/dist/commands/verifies.js +7 -5
  415. package/packages/cli/dist/commands/verifies.js.map +1 -1
  416. package/packages/cli/dist/commands/verify.js +222 -26
  417. package/packages/cli/dist/commands/verify.js.map +1 -1
  418. package/packages/cli/dist/dispatch.js +4 -9
  419. package/packages/cli/dist/dispatch.js.map +1 -1
  420. package/packages/cli/dist/help.js +27 -26
  421. package/packages/cli/dist/help.js.map +1 -1
  422. package/packages/cli/dist/renderers/doctor.js +1 -1
  423. package/packages/cli/dist/renderers/doctor.js.map +1 -1
  424. package/packages/cli/dist/renderers/execution.js +1 -1
  425. package/packages/cli/dist/renderers/execution.js.map +1 -1
  426. package/packages/cli/dist/renderers/json.d.ts +1 -0
  427. package/packages/cli/dist/renderers/json.js +3 -0
  428. package/packages/cli/dist/renderers/json.js.map +1 -1
  429. package/packages/cli/dist/renderers/registry-runtime.d.ts +2 -1
  430. package/packages/cli/dist/renderers/registry-runtime.js +20 -0
  431. package/packages/cli/dist/renderers/registry-runtime.js.map +1 -1
  432. package/packages/cli/dist/renderers/router.js +1 -1
  433. package/packages/cli/dist/renderers/router.js.map +1 -1
  434. package/packages/cli/dist/renderers/workflow.d.ts +0 -4
  435. package/packages/cli/dist/renderers/workflow.js +30 -89
  436. package/packages/cli/dist/renderers/workflow.js.map +1 -1
  437. package/packages/cli/dist/skill-import-args.d.ts +10 -0
  438. package/packages/cli/dist/skill-import-args.js +47 -0
  439. package/packages/cli/dist/skill-import-args.js.map +1 -0
  440. package/packages/cli/dist/tsconfig.tsbuildinfo +1 -1
  441. package/packages/cli/package.json +2 -2
  442. package/packages/core/dist/ai-tools.js +67 -69
  443. package/packages/core/dist/ai-tools.js.map +1 -1
  444. package/packages/core/dist/artifacts/ingestion.js +64 -9
  445. package/packages/core/dist/artifacts/ingestion.js.map +1 -1
  446. package/packages/core/dist/artifacts/sdd-evidence.js +0 -1
  447. package/packages/core/dist/artifacts/sdd-evidence.js.map +1 -1
  448. package/packages/core/dist/artifacts/sdd-result.js +26 -17
  449. package/packages/core/dist/artifacts/sdd-result.js.map +1 -1
  450. package/packages/core/dist/config/init-project.d.ts +3 -0
  451. package/packages/core/dist/config/init-project.js +12 -9
  452. package/packages/core/dist/config/init-project.js.map +1 -1
  453. package/packages/core/dist/config/project-config.d.ts +3 -1
  454. package/packages/core/dist/config/project-config.js +7 -3
  455. package/packages/core/dist/config/project-config.js.map +1 -1
  456. package/packages/core/dist/config/starter-documents.d.ts +4 -4
  457. package/packages/core/dist/config/starter-documents.js +12 -25
  458. package/packages/core/dist/config/starter-documents.js.map +1 -1
  459. package/packages/core/dist/context/build-package.d.ts +1 -1
  460. package/packages/core/dist/context/build-package.js +1 -7
  461. package/packages/core/dist/context/build-package.js.map +1 -1
  462. package/packages/core/dist/context/evidence-summary.js +26 -8
  463. package/packages/core/dist/context/evidence-summary.js.map +1 -1
  464. package/packages/core/dist/context/log-worker.js +2 -2
  465. package/packages/core/dist/context/log-worker.js.map +1 -1
  466. package/packages/core/dist/context-offload/contracts.d.ts +1 -1
  467. package/packages/core/dist/contracts.d.ts +2 -1
  468. package/packages/core/dist/contracts.js +1 -0
  469. package/packages/core/dist/contracts.js.map +1 -1
  470. package/packages/core/dist/delegation/model.d.ts +3 -0
  471. package/packages/core/dist/delegation/validation.d.ts +3 -0
  472. package/packages/core/dist/delegation/validation.js +7 -4
  473. package/packages/core/dist/delegation/validation.js.map +1 -1
  474. package/packages/core/dist/doctor/checks/document-chain.js +1 -1
  475. package/packages/core/dist/doctor/checks/document-chain.js.map +1 -1
  476. package/packages/core/dist/doctor/checks/project.js +8 -8
  477. package/packages/core/dist/doctor/checks/project.js.map +1 -1
  478. package/packages/core/dist/doctor/checks/registries.js +0 -1
  479. package/packages/core/dist/doctor/checks/registries.js.map +1 -1
  480. package/packages/core/dist/doctor/checks/run-evidence.js +4 -4
  481. package/packages/core/dist/doctor/checks/run-evidence.js.map +1 -1
  482. package/packages/core/dist/doctor/checks/run-trust.js +0 -24
  483. package/packages/core/dist/doctor/checks/run-trust.js.map +1 -1
  484. package/packages/core/dist/doctor/checks/runtime-contracts.js +1 -1
  485. package/packages/core/dist/doctor/checks/runtime-contracts.js.map +1 -1
  486. package/packages/core/dist/doctor/doctor.js +178 -58
  487. package/packages/core/dist/doctor/doctor.js.map +1 -1
  488. package/packages/core/dist/evidence/lookup.js +14 -7
  489. package/packages/core/dist/evidence/lookup.js.map +1 -1
  490. package/packages/core/dist/evidence-runtime/contracts.d.ts +0 -1
  491. package/packages/core/dist/execution/background-executor.js +4 -4
  492. package/packages/core/dist/execution/background-executor.js.map +1 -1
  493. package/packages/core/dist/execution/foreground-subagents.js +3 -3
  494. package/packages/core/dist/execution/foreground-subagents.js.map +1 -1
  495. package/packages/core/dist/execution/host-invocation.js +5 -4
  496. package/packages/core/dist/execution/host-invocation.js.map +1 -1
  497. package/packages/core/dist/execution/resident-worker.js +3 -2
  498. package/packages/core/dist/execution/resident-worker.js.map +1 -1
  499. package/packages/core/dist/execution/stage-team-runtime.js +2 -2
  500. package/packages/core/dist/execution/stage-team-runtime.js.map +1 -1
  501. package/packages/core/dist/governance/policy.d.ts +1 -1
  502. package/packages/core/dist/governance/policy.js +1 -1
  503. package/packages/core/dist/governance/policy.js.map +1 -1
  504. package/packages/core/dist/instructions.d.ts +1 -1
  505. package/packages/core/dist/instructions.js +54 -61
  506. package/packages/core/dist/instructions.js.map +1 -1
  507. package/packages/core/dist/lifecycle/decision-gate.js +1 -1
  508. package/packages/core/dist/lifecycle/decision-gate.js.map +1 -1
  509. package/packages/core/dist/lifecycle/ship.d.ts +1 -0
  510. package/packages/core/dist/lifecycle/ship.js +24 -8
  511. package/packages/core/dist/lifecycle/ship.js.map +1 -1
  512. package/packages/core/dist/orchestration/contracts.d.ts +1 -1
  513. package/packages/core/dist/orchestration/runtime.d.ts +12 -2
  514. package/packages/core/dist/orchestration/runtime.js +62 -21
  515. package/packages/core/dist/orchestration/runtime.js.map +1 -1
  516. package/packages/core/dist/registries/agent-capability-catalog.d.ts +5 -2
  517. package/packages/core/dist/registries/agent-capability-catalog.js +69 -27
  518. package/packages/core/dist/registries/agent-capability-catalog.js.map +1 -1
  519. package/packages/core/dist/registries/agent-registry.js +15 -15
  520. package/packages/core/dist/registries/agent-registry.js.map +1 -1
  521. package/packages/core/dist/registries/agent-runtime-static.js +1 -1
  522. package/packages/core/dist/registries/agent-runtime-static.js.map +1 -1
  523. package/packages/core/dist/registries/capability-sources.js +1 -1
  524. package/packages/core/dist/registries/command-team-runtime.d.ts +1 -1
  525. package/packages/core/dist/registries/command-team-runtime.js +9 -9
  526. package/packages/core/dist/registries/command-team-runtime.js.map +1 -1
  527. package/packages/core/dist/registries/eval-learning-context.js +4 -4
  528. package/packages/core/dist/registries/eval-learning-context.js.map +1 -1
  529. package/packages/core/dist/registries/query-status.js +2 -2
  530. package/packages/core/dist/registries/query-status.js.map +1 -1
  531. package/packages/core/dist/registries/tool-capabilities.js +3 -3
  532. package/packages/core/dist/registries/tool-capabilities.js.map +1 -1
  533. package/packages/core/dist/registries/tool-plugins.js +2 -2
  534. package/packages/core/dist/registries/tool-plugins.js.map +1 -1
  535. package/packages/core/dist/registries/worker-adapters.js +11 -11
  536. package/packages/core/dist/registries/worker-adapters.js.map +1 -1
  537. package/packages/core/dist/registries/workflow-gates.js +12 -12
  538. package/packages/core/dist/registries/workflow-gates.js.map +1 -1
  539. package/packages/core/dist/risk/contracts.d.ts +2 -2
  540. package/packages/core/dist/risk/kernel.js +4 -4
  541. package/packages/core/dist/risk/kernel.js.map +1 -1
  542. package/packages/core/dist/risk/legacy-adapters.js +4 -7
  543. package/packages/core/dist/risk/legacy-adapters.js.map +1 -1
  544. package/packages/core/dist/risk/workflow-gates.d.ts +2 -2
  545. package/packages/core/dist/risk/workflow-gates.js +19 -17
  546. package/packages/core/dist/risk/workflow-gates.js.map +1 -1
  547. package/packages/core/dist/router/agent-runtime-config.js +1 -1
  548. package/packages/core/dist/router/agent-runtime-config.js.map +1 -1
  549. package/packages/core/dist/router/agent-runtime.d.ts +2 -0
  550. package/packages/core/dist/router/route-projection.js +1 -1
  551. package/packages/core/dist/router/route-projection.js.map +1 -1
  552. package/packages/core/dist/router/routing.js +45 -15
  553. package/packages/core/dist/router/routing.js.map +1 -1
  554. package/packages/core/dist/router/runtime-import.d.ts +28 -0
  555. package/packages/core/dist/router/runtime-import.js +373 -0
  556. package/packages/core/dist/router/runtime-import.js.map +1 -0
  557. package/packages/core/dist/router/runtime-validation.js +2 -2
  558. package/packages/core/dist/router/runtime-validation.js.map +1 -1
  559. package/packages/core/dist/router/stage-route-binding.d.ts +37 -0
  560. package/packages/core/dist/router/stage-route-binding.js +235 -0
  561. package/packages/core/dist/router/stage-route-binding.js.map +1 -0
  562. package/packages/core/dist/router.d.ts +2 -0
  563. package/packages/core/dist/router.js +2 -0
  564. package/packages/core/dist/router.js.map +1 -1
  565. package/packages/core/dist/run-state/artifacts.d.ts +16 -0
  566. package/packages/core/dist/run-state/artifacts.js +126 -9
  567. package/packages/core/dist/run-state/artifacts.js.map +1 -1
  568. package/packages/core/dist/run-state/inspect-run.d.ts +0 -2
  569. package/packages/core/dist/run-state/inspect-run.js +7 -5
  570. package/packages/core/dist/run-state/inspect-run.js.map +1 -1
  571. package/packages/core/dist/run-state/model.d.ts +28 -8
  572. package/packages/core/dist/run-state/run-index.d.ts +0 -2
  573. package/packages/core/dist/run-state/run-index.js +1 -3
  574. package/packages/core/dist/run-state/run-index.js.map +1 -1
  575. package/packages/core/dist/run-state/run-state.js +37 -27
  576. package/packages/core/dist/run-state/run-state.js.map +1 -1
  577. package/packages/core/dist/run-state/task-evidence.d.ts +5 -2
  578. package/packages/core/dist/run-state/task-evidence.js +53 -14
  579. package/packages/core/dist/run-state/task-evidence.js.map +1 -1
  580. package/packages/core/dist/run-state/timing.d.ts +8 -0
  581. package/packages/core/dist/run-state/timing.js +131 -0
  582. package/packages/core/dist/run-state/timing.js.map +1 -0
  583. package/packages/core/dist/run-state.d.ts +1 -0
  584. package/packages/core/dist/run-state.js +1 -0
  585. package/packages/core/dist/run-state.js.map +1 -1
  586. package/packages/core/dist/runtime-analysis/build.js +0 -3
  587. package/packages/core/dist/runtime-analysis/build.js.map +1 -1
  588. package/packages/core/dist/runtime-analysis/findings.js +5 -44
  589. package/packages/core/dist/runtime-analysis/findings.js.map +1 -1
  590. package/packages/core/dist/runtime-analysis/model.d.ts +1 -17
  591. package/packages/core/dist/runtime-paths.d.ts +10 -0
  592. package/packages/core/dist/runtime-paths.js +65 -0
  593. package/packages/core/dist/runtime-paths.js.map +1 -1
  594. package/packages/core/dist/runtime-projection-p0.d.ts +64 -0
  595. package/packages/core/dist/runtime-projection-p0.js +200 -0
  596. package/packages/core/dist/runtime-projection-p0.js.map +1 -0
  597. package/packages/core/dist/sdd-docs/document-hashes.d.ts +2 -0
  598. package/packages/core/dist/sdd-docs/document-hashes.js +97 -10
  599. package/packages/core/dist/sdd-docs/document-hashes.js.map +1 -1
  600. package/packages/core/dist/sdd-docs/run-binding.d.ts +1 -1
  601. package/packages/core/dist/sdd-docs/run-binding.js +8 -6
  602. package/packages/core/dist/sdd-docs/run-binding.js.map +1 -1
  603. package/packages/core/dist/sdd-docs/task-parser.d.ts +1 -0
  604. package/packages/core/dist/sdd-docs/task-parser.js +55 -34
  605. package/packages/core/dist/sdd-docs/task-parser.js.map +1 -1
  606. package/packages/core/dist/stage-artifacts.d.ts +55 -0
  607. package/packages/core/dist/stage-artifacts.js +322 -0
  608. package/packages/core/dist/stage-artifacts.js.map +1 -0
  609. package/packages/core/dist/stage-collaboration-contracts.d.ts +55 -0
  610. package/packages/core/dist/stage-collaboration-contracts.js +241 -0
  611. package/packages/core/dist/stage-collaboration-contracts.js.map +1 -0
  612. package/packages/core/dist/stage-collaboration.d.ts +888 -0
  613. package/packages/core/dist/stage-collaboration.js +3870 -0
  614. package/packages/core/dist/stage-collaboration.js.map +1 -0
  615. package/packages/core/dist/stage-runtime/runtime.js +8 -1
  616. package/packages/core/dist/stage-runtime/runtime.js.map +1 -1
  617. package/packages/core/dist/status/project-status.d.ts +44 -1
  618. package/packages/core/dist/status/project-status.js +170 -23
  619. package/packages/core/dist/status/project-status.js.map +1 -1
  620. package/packages/core/dist/storage/runtime-store.d.ts +170 -18
  621. package/packages/core/dist/storage/runtime-store.js +544 -32
  622. package/packages/core/dist/storage/runtime-store.js.map +1 -1
  623. package/packages/core/dist/subagents/contracts.d.ts +1 -1
  624. package/packages/core/dist/subagents/runtime.js +7 -7
  625. package/packages/core/dist/subagents/runtime.js.map +1 -1
  626. package/packages/core/dist/test-support/fixtures.js +1 -1
  627. package/packages/core/dist/test-support/run-state.d.ts +1 -1
  628. package/packages/core/dist/test-support/run-state.js +8 -23
  629. package/packages/core/dist/test-support/run-state.js.map +1 -1
  630. package/packages/core/dist/truth-reconciliation.d.ts +44 -0
  631. package/packages/core/dist/truth-reconciliation.js +138 -0
  632. package/packages/core/dist/truth-reconciliation.js.map +1 -0
  633. package/packages/core/dist/tsconfig.tsbuildinfo +1 -1
  634. package/packages/core/dist/verification/goal-verify.d.ts +0 -1
  635. package/packages/core/dist/verification/goal-verify.js +28 -53
  636. package/packages/core/dist/verification/goal-verify.js.map +1 -1
  637. package/packages/core/dist/verification/rendering.d.ts +0 -2
  638. package/packages/core/dist/verification/rendering.js +10 -50
  639. package/packages/core/dist/verification/rendering.js.map +1 -1
  640. package/packages/core/dist/verification/single-task-loop.d.ts +0 -1
  641. package/packages/core/dist/verification/single-task-loop.js +159 -150
  642. package/packages/core/dist/verification/single-task-loop.js.map +1 -1
  643. package/packages/core/dist/verification/test-runtime.d.ts +12 -2
  644. package/packages/core/dist/verification/test-runtime.js +238 -103
  645. package/packages/core/dist/verification/test-runtime.js.map +1 -1
  646. package/packages/core/dist/verification/validation-cache.d.ts +26 -0
  647. package/packages/core/dist/verification/validation-cache.js +73 -0
  648. package/packages/core/dist/verification/validation-cache.js.map +1 -0
  649. package/packages/core/dist/verification/validation-wave.d.ts +18 -0
  650. package/packages/core/dist/verification/validation-wave.js +27 -5
  651. package/packages/core/dist/verification/validation-wave.js.map +1 -1
  652. package/packages/core/dist/verification/verify-contract.d.ts +1 -1
  653. package/packages/core/dist/verification/verify-contract.js +9 -32
  654. package/packages/core/dist/verification/verify-contract.js.map +1 -1
  655. package/packages/core/dist/work-units/contracts.d.ts +1 -1
  656. package/packages/core/dist/workflow-gate/evidence-packet.js +228 -15
  657. package/packages/core/dist/workflow-gate/evidence-packet.js.map +1 -1
  658. package/packages/core/dist/workflow-gate/hard-checks.js +49 -15
  659. package/packages/core/dist/workflow-gate/hard-checks.js.map +1 -1
  660. package/packages/core/dist/workflow-gate/policy.js +42 -6
  661. package/packages/core/dist/workflow-gate/policy.js.map +1 -1
  662. package/packages/core/dist/workflow-gate/types.d.ts +4 -5
  663. package/packages/core/dist/workflow-state/affected-file-conflicts.d.ts +0 -1
  664. package/packages/core/dist/workflow-state/affected-file-conflicts.js +1 -2
  665. package/packages/core/dist/workflow-state/affected-file-conflicts.js.map +1 -1
  666. package/packages/core/dist/workflow-state/dependencies.js +1 -1
  667. package/packages/core/dist/workflow-state/latest-eligible-run.d.ts +0 -1
  668. package/packages/core/dist/workflow-state/latest-eligible-run.js +72 -6
  669. package/packages/core/dist/workflow-state/latest-eligible-run.js.map +1 -1
  670. package/packages/core/dist/workflow-state/migration-recovery.d.ts +40 -0
  671. package/packages/core/dist/workflow-state/migration-recovery.js +110 -0
  672. package/packages/core/dist/workflow-state/migration-recovery.js.map +1 -0
  673. package/packages/core/dist/workflow-state/repair-contract.d.ts +12 -0
  674. package/packages/core/dist/workflow-state/repair-contract.js +63 -0
  675. package/packages/core/dist/workflow-state/repair-contract.js.map +1 -0
  676. package/packages/core/dist/workflow-state/resolve-task-run.d.ts +21 -0
  677. package/packages/core/dist/workflow-state/resolve-task-run.js +95 -0
  678. package/packages/core/dist/workflow-state/resolve-task-run.js.map +1 -0
  679. package/packages/core/dist/workflow-state/resolve.d.ts +55 -5
  680. package/packages/core/dist/workflow-state/resolve.js +538 -34
  681. package/packages/core/dist/workflow-state/resolve.js.map +1 -1
  682. package/packages/core/dist/workflow-state/runtime-projections.d.ts +228 -0
  683. package/packages/core/dist/workflow-state/runtime-projections.js +452 -0
  684. package/packages/core/dist/workflow-state/runtime-projections.js.map +1 -0
  685. package/packages/core/package.json +3 -3
  686. package/node_modules/@sdd-agent-platform/core/dist/doctor/render.d.ts +0 -2
  687. package/node_modules/@sdd-agent-platform/core/dist/doctor/render.js +0 -44
  688. package/node_modules/@sdd-agent-platform/core/dist/doctor/render.js.map +0 -1
  689. package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.d.ts +0 -17
  690. package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.js +0 -243
  691. package/node_modules/@sdd-agent-platform/core/dist/sync-back/apply.js.map +0 -1
  692. package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.d.ts +0 -110
  693. package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.js +0 -497
  694. package/node_modules/@sdd-agent-platform/core/dist/sync-back/inspect.js.map +0 -1
  695. package/node_modules/@sdd-agent-platform/core/dist/sync-back.d.ts +0 -2
  696. package/node_modules/@sdd-agent-platform/core/dist/sync-back.js +0 -3
  697. package/node_modules/@sdd-agent-platform/core/dist/sync-back.js.map +0 -1
  698. package/node_modules/@sdd-agent-platform/core/src/sync-back/apply.ts +0 -270
  699. package/node_modules/@sdd-agent-platform/core/src/sync-back/inspect.ts +0 -655
  700. package/node_modules/@sdd-agent-platform/core/src/sync-back/sync-back.test.ts +0 -569
  701. package/node_modules/@sdd-agent-platform/core/src/sync-back.ts +0 -2
  702. package/packages/cli/dist/commands/artifact.d.ts +0 -6
  703. package/packages/cli/dist/commands/artifact.js +0 -168
  704. package/packages/cli/dist/commands/artifact.js.map +0 -1
  705. package/packages/cli/dist/commands/sync-back.d.ts +0 -6
  706. package/packages/cli/dist/commands/sync-back.js +0 -82
  707. package/packages/cli/dist/commands/sync-back.js.map +0 -1
  708. package/packages/cli/dist/renderers/artifacts.d.ts +0 -5
  709. package/packages/cli/dist/renderers/artifacts.js +0 -43
  710. package/packages/cli/dist/renderers/artifacts.js.map +0 -1
  711. package/packages/core/dist/doctor/render.d.ts +0 -2
  712. package/packages/core/dist/doctor/render.js +0 -44
  713. package/packages/core/dist/doctor/render.js.map +0 -1
  714. package/packages/core/dist/sync-back/apply.d.ts +0 -17
  715. package/packages/core/dist/sync-back/apply.js +0 -243
  716. package/packages/core/dist/sync-back/apply.js.map +0 -1
  717. package/packages/core/dist/sync-back/inspect.d.ts +0 -110
  718. package/packages/core/dist/sync-back/inspect.js +0 -497
  719. package/packages/core/dist/sync-back/inspect.js.map +0 -1
  720. package/packages/core/dist/sync-back.d.ts +0 -2
  721. package/packages/core/dist/sync-back.js +0 -3
  722. package/packages/core/dist/sync-back.js.map +0 -1
@@ -1,168 +0,0 @@
1
- import { ingestArtifactResult, inspectArtifactResultIngestions } from '@sdd-agent-platform/core/artifacts';
2
- import { validateSddResultArtifact } from '@sdd-agent-platform/core/artifacts';
3
- import { renderSddResultArtifactTemplate } from '@sdd-agent-platform/core/artifacts';
4
- import { readRunState, writeArtifact } from '@sdd-agent-platform/core/run-state';
5
- import { toArtifactRootRelativePath } from '@sdd-agent-platform/core/runtime-paths';
6
- import { readBranchOption, readSddResultStatus } from '../args.js';
7
- import { hasHelpFlag, hasPreflightFlag, readOption } from '../options.js';
8
- import { renderArtifactIngestionInspection, renderArtifactIngestionResult, renderArtifactValidationReport } from '../renderers/artifacts.js';
9
- import { renderTextOrJson } from '../renderers/json.js';
10
- export async function handleArtifactCommand(projectRoot, command, subcommand, rest) {
11
- if (command !== 'artifact') {
12
- return null;
13
- }
14
- if (hasHelpFlag([subcommand, ...rest].filter((item) => Boolean(item)))) {
15
- return {
16
- exitCode: 0,
17
- output: artifactUsage(subcommand)
18
- };
19
- }
20
- if (subcommand === 'template') {
21
- const artifactPath = rest.find((item) => !item.startsWith('--'));
22
- const taskId = readOption(rest, '--task');
23
- const agent = readOption(rest, '--agent');
24
- if (!artifactPath || !taskId || !agent) {
25
- return {
26
- exitCode: 2,
27
- error: artifactUsage('template')
28
- };
29
- }
30
- if (hasPreflightFlag(rest)) {
31
- return {
32
- exitCode: 0,
33
- output: artifactPreflightOutput('artifact template', artifactPath, rest)
34
- };
35
- }
36
- const runId = readOption(rest, '--run');
37
- const branch = readBranchOption(rest);
38
- if (runId) {
39
- const scopeError = await artifactTemplateScopeError(projectRoot, runId, taskId, branch);
40
- if (scopeError) {
41
- return {
42
- exitCode: 2,
43
- error: scopeError
44
- };
45
- }
46
- }
47
- const template = await renderSddResultArtifactTemplate(projectRoot, {
48
- artifactPath,
49
- taskId,
50
- agent,
51
- branch,
52
- runId: runId ?? undefined,
53
- status: readSddResultStatus(rest, '--status') ?? 'PASS'
54
- });
55
- if (rest.includes('--write')) {
56
- if (!runId) {
57
- return {
58
- exitCode: 2,
59
- error: 'Usage: sdd artifact template <artifacts/path.md> --task <task_id> --agent <agent> --run <run_id> --write'
60
- };
61
- }
62
- const written = await writeArtifact(projectRoot, runId, toArtifactRootRelativePath(artifactPath), template);
63
- return {
64
- exitCode: 0,
65
- output: `Artifact template written: ${written.runRelativePath}\nphysical_path=${written.absolutePath}`
66
- };
67
- }
68
- return {
69
- exitCode: 0,
70
- output: template
71
- };
72
- }
73
- if (subcommand === 'validate') {
74
- const runId = rest[0];
75
- const artifactPath = rest[1];
76
- if (!runId || !artifactPath) {
77
- return {
78
- exitCode: 2,
79
- error: artifactUsage('validate')
80
- };
81
- }
82
- const expectedTask = readOption(rest, '--task') ?? undefined;
83
- const expectedAgent = readOption(rest, '--agent') ?? undefined;
84
- const report = await validateSddResultArtifact(projectRoot, runId, artifactPath, {
85
- expectedTask,
86
- expectedAgent
87
- });
88
- return {
89
- exitCode: report.valid ? 0 : 1,
90
- output: renderTextOrJson(rest, report, (value) => renderArtifactValidationReport(artifactPath, value, expectedTask, expectedAgent))
91
- };
92
- }
93
- if (subcommand === 'ingest') {
94
- const runId = rest[0];
95
- const delegationId = rest[1];
96
- const artifactPath = rest[2];
97
- if (!runId || !delegationId || !artifactPath) {
98
- return {
99
- exitCode: 2,
100
- error: artifactUsage('ingest')
101
- };
102
- }
103
- if (hasPreflightFlag(rest)) {
104
- return {
105
- exitCode: 0,
106
- output: artifactPreflightOutput('artifact ingest', artifactPath, rest)
107
- };
108
- }
109
- const result = await ingestArtifactResult(projectRoot, runId, { delegationId, artifactPath });
110
- return {
111
- exitCode: result.valid ? 0 : 1,
112
- output: rest.includes('--json') ? JSON.stringify(result, null, 2) : renderArtifactIngestionResult(result)
113
- };
114
- }
115
- if (subcommand === 'ingestions') {
116
- const runId = rest[0];
117
- if (!runId) {
118
- return {
119
- exitCode: 2,
120
- error: artifactUsage('ingestions')
121
- };
122
- }
123
- const inspection = await inspectArtifactResultIngestions(projectRoot, runId);
124
- return {
125
- exitCode: inspection.valid ? 0 : 1,
126
- output: rest.includes('--json') ? JSON.stringify(inspection, null, 2) : renderArtifactIngestionInspection(inspection)
127
- };
128
- }
129
- return null;
130
- }
131
- function artifactUsage(subcommand) {
132
- if (subcommand === 'template') {
133
- return 'Usage: sdd artifact template <artifacts/path.md> --task <task_id> --agent <agent> [--run <run_id> --write] [--branch <branch>] [--status <status>] [--preflight]';
134
- }
135
- if (subcommand === 'validate') {
136
- return 'Usage: sdd artifact validate <run_id> <artifacts/path.md> [--task <task_id>] [--agent <agent>] [--json|--compact-json]';
137
- }
138
- if (subcommand === 'ingest') {
139
- return 'Usage: sdd artifact ingest <run_id> <delegation_id> <artifacts/path.md> [--preflight] [--json]';
140
- }
141
- if (subcommand === 'ingestions') {
142
- return 'Usage: sdd artifact ingestions <run_id> [--json]';
143
- }
144
- return 'Usage: sdd artifact template|validate|ingest|ingestions [options]';
145
- }
146
- async function artifactTemplateScopeError(projectRoot, runId, taskId, branch) {
147
- const state = await readRunState(projectRoot, runId);
148
- if (!state.partition && !state.gitBranch) {
149
- return `Run ${runId} is unscoped; create it with sdd run create --branch <branch> --task <task_id> before writing artifacts.`;
150
- }
151
- if (!state.taskId) {
152
- return `Run ${runId} has no scoped task; create it with sdd run create --branch <branch> --task <task_id> before writing artifacts.`;
153
- }
154
- if (state.taskId !== taskId) {
155
- return `Run ${runId} is scoped to task ${state.taskId}, not ${taskId}.`;
156
- }
157
- if (branch && branch !== state.partition && branch !== state.gitBranch) {
158
- return `Run ${runId} is scoped to branch ${state.gitBranch ?? state.partition}, not ${branch}.`;
159
- }
160
- return null;
161
- }
162
- function artifactPreflightOutput(commandName, artifactPath, args) {
163
- if (args.includes('--json') || args.includes('--compact-json')) {
164
- return renderTextOrJson(args, { contract: 'sdd-command-preflight-v1', command: commandName, artifactPath, sideEffects: 'none', status: 'PASS' }, (value) => JSON.stringify(value, null, 2));
165
- }
166
- return `SDD command preflight PASS\ncommand=${commandName}\nartifact=${artifactPath}\nside_effects=none`;
167
- }
168
- //# sourceMappingURL=artifact.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"artifact.js","sourceRoot":"","sources":["../../src/commands/artifact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,+BAA+B,EAAE,MAAM,oCAAoC,CAAC;AAC3G,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,+BAA+B,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EA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CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;QAC/D,OAAO,gBAAgB,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,0BAA0B,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC9L,CAAC;IACD,OAAO,uCAAuC,WAAW,cAAc,YAAY,qBAAqB,CAAC;AAC3G,CAAC"}
@@ -1,6 +0,0 @@
1
- export interface CliResult {
2
- exitCode: number;
3
- output?: string;
4
- error?: string;
5
- }
6
- export declare function handleSyncBackCommand(projectRoot: string, command: string | undefined, subcommand: string | undefined, rest: string[]): Promise<CliResult | null>;
@@ -1,82 +0,0 @@
1
- import { applySyncBack } from '@sdd-agent-platform/core/sync-back';
2
- import { inspectSyncBack } from '@sdd-agent-platform/core/sync-back';
3
- import { readBranchOption, readOptionalPositionalArgument } from '../args.js';
4
- import { hasHelpFlag, hasPreflightFlag, readOption } from '../options.js';
5
- import { jsonOutput, wantsJson } from '../renderers/json.js';
6
- import { renderSyncBackApplyResult, renderSyncBackInspection } from '../renderers/workflow.js';
7
- export async function handleSyncBackCommand(projectRoot, command, subcommand, rest) {
8
- if (command !== 'sync-back') {
9
- return null;
10
- }
11
- if (hasHelpFlag([subcommand, ...rest].filter((item) => Boolean(item)))) {
12
- return {
13
- exitCode: 0,
14
- output: syncBackUsage(subcommand)
15
- };
16
- }
17
- if (subcommand === 'inspect') {
18
- const runId = readOptionalPositionalArgument(rest);
19
- const taskId = readOption(rest, '--task') ?? undefined;
20
- if (!runId && !taskId) {
21
- return {
22
- exitCode: 2,
23
- error: syncBackUsage('inspect')
24
- };
25
- }
26
- const result = await inspectSyncBack(projectRoot, {
27
- runId,
28
- branch: readBranchOption(rest),
29
- taskId
30
- });
31
- const json = wantsJson(rest);
32
- return {
33
- exitCode: 0,
34
- output: json ? jsonOutput(result, rest) : renderSyncBackInspection(result)
35
- };
36
- }
37
- if (subcommand === 'apply') {
38
- const runId = readOptionalPositionalArgument(rest);
39
- const taskId = readOption(rest, '--task') ?? undefined;
40
- if (!runId && !taskId) {
41
- return {
42
- exitCode: 2,
43
- error: syncBackUsage('apply')
44
- };
45
- }
46
- if (hasPreflightFlag(rest)) {
47
- return {
48
- exitCode: 0,
49
- output: syncBackPreflightOutput(runId, taskId, rest)
50
- };
51
- }
52
- const result = await applySyncBack(projectRoot, {
53
- runId,
54
- branch: readBranchOption(rest),
55
- taskId,
56
- approved: rest.includes('--approved'),
57
- refreshVerify: rest.includes('--refresh-verify')
58
- });
59
- const json = wantsJson(rest);
60
- return {
61
- exitCode: 0,
62
- output: json ? jsonOutput(result, rest) : renderSyncBackApplyResult(result)
63
- };
64
- }
65
- return null;
66
- }
67
- function syncBackUsage(subcommand) {
68
- if (subcommand === 'apply') {
69
- return 'Usage: sdd sync-back apply [<run_id>] [--branch <branch>] --task <task_id> [--approved] [--refresh-verify] [--preflight] [--json|--compact-json]';
70
- }
71
- if (subcommand === 'inspect') {
72
- return 'Usage: sdd sync-back inspect [<run_id>] [--branch <branch>] --task <task_id> [--json|--compact-json]';
73
- }
74
- return 'Usage: sdd sync-back inspect|apply [<run_id>] [--branch <branch>] --task <task_id> [--approved] [--refresh-verify] [--preflight] [--json|--compact-json]';
75
- }
76
- function syncBackPreflightOutput(runId, taskId, args) {
77
- if (wantsJson(args)) {
78
- return jsonOutput({ contract: 'sdd-command-preflight-v1', command: 'sync-back apply', runId: runId ?? null, taskId: taskId ?? null, sideEffects: 'none', status: 'PASS' }, args);
79
- }
80
- return `SDD command preflight PASS\ncommand=sync-back apply\nrun=${runId ?? 'latest'}\ntask=${taskId ?? 'none'}\nside_effects=none`;
81
- }
82
- //# sourceMappingURL=sync-back.js.map
@@ -1 +0,0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,EAAE,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,yBAAyB,CAAC,MAAM,CAAC;SAC5E,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AACD,SAAS,aAAa,CAAC,UAA8B;IACnD,IAAI,UAAU,KAAK,OAAO,EAAE,CAAC;QAC3B,OAAO,kJAAkJ,CAAC;IAC5J,CAAC;IACD,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,sGAAsG,CAAC;IAChH,CAAC;IACD,OAAO,0JAA0J,CAAC;AACpK,CAAC;AAED,SAAS,uBAAuB,CAAC,KAAyB,EAAE,MAA0B,EAAE,IAAc;IACpG,IAAI,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QACpB,OAAO,UAAU,CAAC,EAAE,QAAQ,EAAE,0BAA0B,EAAE,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,IAAI,IAAI,EAAE,MAAM,EAAE,MAAM,IAAI,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,CAAC;IACnL,CAAC;IACD,OAAO,4DAA4D,KAAK,IAAI,QAAQ,UAAU,MAAM,IAAI,MAAM,qBAAqB,CAAC;AACtI,CAAC"}
@@ -1,5 +0,0 @@
1
- import type { ArtifactResultIngestionInspection, ArtifactResultIngestionResult } from '@sdd-agent-platform/core/artifacts';
2
- import type { validateSddResultArtifact } from '@sdd-agent-platform/core/artifacts';
3
- export declare function renderArtifactIngestionResult(result: ArtifactResultIngestionResult): string;
4
- export declare function renderArtifactIngestionInspection(inspection: ArtifactResultIngestionInspection): string;
5
- export declare function renderArtifactValidationReport(artifactPath: string, report: Awaited<ReturnType<typeof validateSddResultArtifact>>, expectedTask?: string, expectedAgent?: string): string;
@@ -1,43 +0,0 @@
1
- import { renderIssues } from './issues.js';
2
- export function renderArtifactIngestionResult(result) {
3
- const lines = [`Artifact ingestion ${result.record.status}: ${result.record.artifactPath}`];
4
- lines.push(`delegation=${result.record.delegationId} duplicate=${result.duplicate} result=${result.record.resultStatus ?? 'n/a'} terminal=${result.record.delegationStatus ?? 'n/a'}`);
5
- if (result.record.issues.length > 0) {
6
- lines.push('issues');
7
- for (const issue of result.record.issues) {
8
- lines.push(`- ${issue.field}: ${issue.message}`);
9
- lines.push(` recommendation: ${issue.recommendation}`);
10
- }
11
- }
12
- if (result.record.gaps.length > 0) {
13
- lines.push('gaps');
14
- for (const gap of result.record.gaps) {
15
- lines.push(`- [${gap.severity}] ${gap.type} ${gap.field}: ${gap.message}`);
16
- }
17
- }
18
- return lines.join('\n');
19
- }
20
- export function renderArtifactIngestionInspection(inspection) {
21
- const lines = [`Artifact ingestions ${inspection.valid ? 'valid' : 'invalid'} for ${inspection.runId}`];
22
- lines.push(`records=${inspection.records.length}`);
23
- for (const record of inspection.records) {
24
- lines.push(`- ${record.delegationId} ${record.status} artifact=${record.artifactPath} result=${record.resultStatus ?? 'n/a'} delegation=${record.delegationStatus ?? 'n/a'}`);
25
- }
26
- renderIssues(lines, inspection.issues);
27
- return lines.join('\n');
28
- }
29
- export function renderArtifactValidationReport(artifactPath, report, expectedTask, expectedAgent) {
30
- if (report.valid) {
31
- return `Artifact valid: ${artifactPath}`;
32
- }
33
- const lines = [`Artifact invalid: ${artifactPath}`];
34
- for (const issue of report.issues) {
35
- lines.push(`- ${issue.field}: ${issue.message}`);
36
- lines.push(` recommendation: ${issue.recommendation}`);
37
- }
38
- if (expectedTask && expectedAgent) {
39
- lines.push(`next sdd artifact template ${artifactPath} --task ${expectedTask} --agent ${expectedAgent} --run <run_id> --write`);
40
- }
41
- return lines.join('\n');
42
- }
43
- //# sourceMappingURL=artifacts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../src/renderers/artifacts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM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a,yBAAyB,CAAC,CAAC;IAClI,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { DoctorReport } from './model.js';
2
- export declare function renderDoctorReport(report: DoctorReport): string;
@@ -1,44 +0,0 @@
1
- export function renderDoctorReport(report) {
2
- const failures = report.checks.filter((check) => check.level === 'FAIL');
3
- const warnings = report.checks.filter((check) => check.level === 'WARN');
4
- const passes = report.checks.filter((check) => check.level === 'PASS');
5
- const lines = ['SDD doctor', 'decision'];
6
- lines.push(`- status=${report.status}`);
7
- lines.push(`- checks pass=${passes.length} warn=${warnings.length} fail=${failures.length}`);
8
- lines.push('evidence');
9
- const visibleChecks = [...failures, ...warnings, ...passes.slice(0, failures.length === 0 && warnings.length === 0 ? 5 : 2)];
10
- if (visibleChecks.length === 0) {
11
- lines.push('- no checks reported');
12
- }
13
- else {
14
- for (const check of visibleChecks) {
15
- const action = check.action ? ` action=${check.action}` : '';
16
- lines.push(`- [${check.level}] ${check.check}: ${check.message}${action}`);
17
- }
18
- }
19
- const hiddenPasses = passes.length - visibleChecks.filter((check) => check.level === 'PASS').length;
20
- if (hiddenPasses > 0) {
21
- lines.push(`- ${hiddenPasses} passing check(s) hidden; use --json for full details`);
22
- }
23
- lines.push('gaps');
24
- if (failures.length === 0 && warnings.length === 0) {
25
- lines.push('- none');
26
- }
27
- else {
28
- for (const check of [...failures, ...warnings]) {
29
- lines.push(`- [${check.level}] ${check.check}: ${check.action ?? check.message}`);
30
- }
31
- }
32
- lines.push('next');
33
- if (failures[0]?.action) {
34
- lines.push(`- ${failures[0].action}`);
35
- }
36
- else if (warnings[0]?.action) {
37
- lines.push(`- ${warnings[0].action}`);
38
- }
39
- else {
40
- lines.push('- sdd status');
41
- }
42
- return lines.join('\n');
43
- }
44
- //# sourceMappingURL=render.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/doctor/render.ts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AAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IACxC,CAAC;SAAM,CAAC;QACN,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -1,17 +0,0 @@
1
- import type { SyncBackInspection } from './inspect.js';
2
- export interface SyncBackApplyResult {
3
- runId: string;
4
- taskId: string;
5
- applied: boolean;
6
- tasksPath: string;
7
- inspection: SyncBackInspection;
8
- message: string;
9
- verifyRefreshed: boolean;
10
- }
11
- export declare function applySyncBack(projectRoot: string, options: {
12
- runId?: string;
13
- branch?: string;
14
- taskId?: string;
15
- approved?: boolean;
16
- refreshVerify?: boolean;
17
- }): Promise<SyncBackApplyResult>;
@@ -1,243 +0,0 @@
1
- import { readFile, writeFile } from 'node:fs/promises';
2
- import path from 'node:path';
3
- import { appendEvent } from '../run-state/events.js';
4
- import { readRunState, writeRunState } from '../run-state/run-state.js';
5
- import { rebuildLocalRunIndex } from '../run-state/run-index.js';
6
- import { parseSddBranch } from '../sdd-docs/task-parser.js';
7
- import { inspectSyncBack } from './inspect.js';
8
- import { writeVerifyContract } from '../verification/verify-contract.js';
9
- import { readRuntimeSyncBackDecision, recordRuntimeSyncBackDecision, runtimeScopedId } from '../storage/runtime-store.js';
10
- export async function applySyncBack(projectRoot, options) {
11
- let inspection = await inspectSyncBack(projectRoot, options);
12
- let verifyRefreshed = false;
13
- if (options.refreshVerify === true && inspection.staleVerifyRecoveryCommand) {
14
- await writeVerifyContract(projectRoot, { branch: inspection.branch, branchSource: 'cli_option', force: true });
15
- verifyRefreshed = true;
16
- inspection = await inspectSyncBack(projectRoot, { ...options, runId: inspection.runId, taskId: inspection.taskId ?? options.taskId });
17
- }
18
- if (!inspection.taskId) {
19
- throw new Error('Cannot apply sync-back without a task id.');
20
- }
21
- if (inspection.status === 'blocked') {
22
- throw new Error(`Cannot apply sync-back for ${inspection.runId}: ${inspection.reasons.join(' ')}`);
23
- }
24
- if (!inspection.markdownTask) {
25
- throw new Error(`Cannot apply sync-back for ${inspection.runId}: target task is missing.`);
26
- }
27
- if (inspection.status === 'applied') {
28
- const appliedTaskId = inspection.taskId;
29
- const appliedMarkdownTask = inspection.markdownTask;
30
- if (options.refreshVerify === true && inspection.staleVerifyRecoveryCommand) {
31
- await writeVerifyContract(projectRoot, { branch: inspection.branch, branchSource: 'cli_option', force: true });
32
- verifyRefreshed = true;
33
- inspection = await inspectSyncBack(projectRoot, { ...options, runId: inspection.runId, taskId: appliedTaskId });
34
- }
35
- return {
36
- runId: inspection.runId,
37
- taskId: appliedTaskId,
38
- applied: false,
39
- tasksPath: appliedMarkdownTask.source.filePath,
40
- inspection,
41
- message: `Sync-back for ${inspection.runId}/${appliedTaskId} was already applied.`,
42
- verifyRefreshed
43
- };
44
- }
45
- if (inspection.applyPolicy.requiresApproval && options.approved !== true) {
46
- throw new Error(`Cannot apply sync-back for ${inspection.runId}: ${inspection.applyPolicy.reasons.join(' ')} Re-run with --approved after human confirmation.`);
47
- }
48
- const state = await readRunState(projectRoot, inspection.runId);
49
- const tasksPath = inspection.markdownTask.source.filePath;
50
- const rawTasks = await readFile(tasksPath, 'utf8');
51
- const note = syncBackImplementationNote(state, inspection);
52
- const nextTasks = applySyncBackToTasksMarkdown(rawTasks, inspection.markdownTask, note);
53
- await writeFile(tasksPath, nextTasks, 'utf8');
54
- const appliedModel = await parseSddBranch(projectRoot, inspection.branch);
55
- await writeRunState(projectRoot, {
56
- ...state,
57
- documentSnapshot: documentSnapshotFromModel(appliedModel),
58
- syncBack: {
59
- ...state.syncBack,
60
- status: 'applied'
61
- }
62
- });
63
- const existingDecision = await readRuntimeSyncBackDecision(projectRoot, state.runId, inspection.taskId);
64
- const decisionTime = new Date().toISOString();
65
- await recordRuntimeSyncBackDecision(projectRoot, {
66
- decisionId: existingDecision?.decisionId ?? runtimeScopedId(state.runId, inspection.taskId, 'sync-back'),
67
- runId: state.runId,
68
- branch: inspection.branch,
69
- taskId: inspection.taskId,
70
- status: 'applied',
71
- proposalPath: inspection.proposalPath,
72
- proposalDigest: inspection.proposalDigest,
73
- proposalPayloadId: existingDecision?.proposalPayloadId ?? null,
74
- reasons: [],
75
- createdAt: existingDecision?.createdAt ?? decisionTime,
76
- updatedAt: decisionTime,
77
- payload: { previousStatus: existingDecision?.status ?? state.syncBack.status, tasksPath: path.relative(projectRoot, tasksPath) }
78
- });
79
- await appendEvent(projectRoot, state.runId, {
80
- event: 'sync_back_applied',
81
- runId: state.runId,
82
- summary: `Sync-back applied for ${inspection.taskId}`,
83
- data: {
84
- task: inspection.taskId,
85
- branch: inspection.branch,
86
- tasksPath: path.relative(projectRoot, tasksPath),
87
- proposal: inspection.proposalPath
88
- }
89
- });
90
- if (options.refreshVerify === true) {
91
- await writeVerifyContract(projectRoot, { branch: inspection.branch, branchSource: 'cli_option', force: true });
92
- verifyRefreshed = true;
93
- }
94
- await rebuildLocalRunIndex(projectRoot);
95
- const appliedInspection = await inspectSyncBack(projectRoot, { ...options, runId: inspection.runId, taskId: inspection.taskId });
96
- return {
97
- runId: state.runId,
98
- taskId: inspection.taskId,
99
- applied: true,
100
- tasksPath,
101
- inspection: appliedInspection,
102
- message: `Sync-back applied for ${state.runId}/${inspection.taskId}.`,
103
- verifyRefreshed
104
- };
105
- }
106
- function documentSnapshotFromModel(model) {
107
- return {
108
- specHash: model.documents.specHash ?? null,
109
- planHash: model.documents.planHash ?? null,
110
- tasksHash: model.documents.tasksHash ?? null,
111
- specContractHash: model.documents.specContractHash ?? null,
112
- planContractHash: model.documents.planContractHash ?? null,
113
- tasksContractHash: model.documents.tasksContractHash ?? null,
114
- planBasedOnSpecHash: model.documents.planBasedOnSpecHash ?? null,
115
- tasksBasedOnPlanHash: model.documents.tasksBasedOnPlanHash ?? null,
116
- planBasedOnSpecContractHash: model.documents.planBasedOnSpecContractHash ?? null,
117
- tasksBasedOnPlanContractHash: model.documents.tasksBasedOnPlanContractHash ?? null
118
- };
119
- }
120
- function applySyncBackToTasksMarkdown(raw, task, note) {
121
- const range = locateTaskBlockRange(raw, task);
122
- const block = raw.slice(range.start, range.end);
123
- const nextBlock = setTaskBlockStatus(block, 'completed');
124
- const sectionEnd = nextTaskStart(raw, range.end);
125
- const section = raw.slice(range.end, sectionEnd);
126
- const nextSection = appendSyncBackImplementationNote(section, note);
127
- return `${raw.slice(0, range.start)}${nextBlock}${nextSection}${raw.slice(sectionEnd)}`;
128
- }
129
- function locateTaskBlockRange(raw, task) {
130
- const matches = Array.from(raw.matchAll(/^\s*```sdd-task\s*\r?\n([\s\S]*?)\r?^\s*```\s*$/gm));
131
- const matching = matches.filter((match) => {
132
- const metadata = parseSimpleYamlBlock(match[1] ?? '');
133
- const id = scalarValue(metadata.id);
134
- const start = match.index ?? 0;
135
- return id === task.id && lineNumberAt(raw, start) === task.source.lineStart;
136
- });
137
- const fallback = matches.filter((match) => scalarValue(parseSimpleYamlBlock(match[1] ?? '').id) === task.id);
138
- const selected = matching.length === 1 ? matching[0] : fallback.length === 1 ? fallback[0] : null;
139
- if (!selected || selected.index === undefined) {
140
- throw new Error(`Cannot locate a unique sdd-task block for ${task.id}.`);
141
- }
142
- return {
143
- start: selected.index,
144
- end: selected.index + selected[0].length
145
- };
146
- }
147
- function setTaskBlockStatus(block, status) {
148
- if (/^\s*status:\s*[^\r\n]*$/m.test(block)) {
149
- return block.replace(/^(\s*status:\s*)[^\r\n]*$/m, `$1${status}`);
150
- }
151
- const eol = block.includes('\r\n') ? '\r\n' : '\n';
152
- if (/^\s*id:\s*[^\r\n]*$/m.test(block)) {
153
- return block.replace(/^(\s*id:\s*[^\r\n]*)$/m, `$1${eol}status: ${status}`);
154
- }
155
- throw new Error('Cannot update task status because the sdd-task block has no id line.');
156
- }
157
- function appendSyncBackImplementationNote(section, note) {
158
- const runMatch = note.match(/run `([^`]+)`/);
159
- if (runMatch && section.includes(`run \`${runMatch[1]}\``)) {
160
- return section;
161
- }
162
- const heading = section.match(/^####\s+Implementation Notes\s*$/im);
163
- if (!heading || heading.index === undefined) {
164
- const separator = section.length === 0 || section.endsWith('\n') ? '' : '\n';
165
- return `${section}${separator}\n#### Implementation Notes\n\n${note}\n`;
166
- }
167
- const contentStart = heading.index + heading[0].length;
168
- const remainder = section.slice(contentStart);
169
- const nextHeadingOffset = remainder.search(/\n####\s+|\n###\s+/);
170
- const insertAt = nextHeadingOffset < 0 ? section.length : contentStart + nextHeadingOffset;
171
- const before = section.slice(0, insertAt).trimEnd();
172
- const after = section.slice(insertAt);
173
- return `${before}\n${note}${after}`;
174
- }
175
- function syncBackImplementationNote(state, inspection) {
176
- const artifacts = inspection.artifacts.length > 0
177
- ? inspection.artifacts.map((artifact) => `\`${artifact}\``).join(', ')
178
- : 'none';
179
- return `- Sync-back applied from run \`${state.runId}\` (${state.updatedAt}); proposal: \`${inspection.proposalPath ?? 'none'}\`; artifacts: ${artifacts}.`;
180
- }
181
- function parseSimpleYamlBlock(raw) {
182
- const result = {};
183
- const lines = raw.split(/\r?\n/);
184
- let currentListKey = null;
185
- for (const line of lines) {
186
- const trimmed = line.trim();
187
- if (!trimmed || trimmed.startsWith('#')) {
188
- continue;
189
- }
190
- if (currentListKey && /^-\s+/.test(trimmed)) {
191
- const current = result[currentListKey];
192
- const items = Array.isArray(current) ? current : [];
193
- items.push(unquoteSimpleYamlValue(trimmed.slice(2).trim()));
194
- result[currentListKey] = items;
195
- continue;
196
- }
197
- const scalarMatch = trimmed.match(/^([A-Za-z0-9_-]+):\s*(.*)$/);
198
- if (!scalarMatch) {
199
- currentListKey = null;
200
- continue;
201
- }
202
- const key = scalarMatch[1];
203
- const value = scalarMatch[2].trim();
204
- if (value === '') {
205
- result[key] = [];
206
- currentListKey = key;
207
- }
208
- else if (value === '[]') {
209
- result[key] = [];
210
- currentListKey = null;
211
- }
212
- else if (value.startsWith('[') && value.endsWith(']')) {
213
- result[key] = value.slice(1, -1).split(',').map((item) => unquoteSimpleYamlValue(item.trim())).filter(Boolean);
214
- currentListKey = null;
215
- }
216
- else {
217
- result[key] = unquoteSimpleYamlValue(value);
218
- currentListKey = null;
219
- }
220
- }
221
- return result;
222
- }
223
- function unquoteSimpleYamlValue(value) {
224
- if (value.length >= 2) {
225
- const first = value[0];
226
- const last = value[value.length - 1];
227
- if ((first === '"' && last === '"') || (first === "'" && last === "'")) {
228
- return value.slice(1, -1);
229
- }
230
- }
231
- return value;
232
- }
233
- function scalarValue(value) {
234
- return typeof value === 'string' && value.length > 0 ? value : null;
235
- }
236
- function lineNumberAt(raw, offset) {
237
- return raw.slice(0, offset).split(/\r?\n/).length;
238
- }
239
- function nextTaskStart(raw, offset, limit = raw.length) {
240
- const next = raw.slice(offset, limit).search(/^\s*###\s+/m);
241
- return next < 0 ? limit : offset + next;
242
- }
243
- //# sourceMappingURL=apply.js.map