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
@@ -2,6 +2,7 @@ import { spawn } from 'node:child_process';
2
2
 
3
3
  import { SDD_RESULT_CONTRACT, SDD_RESULT_VERSION } from '../contracts.js';
4
4
  import { writeArtifact } from '../run-state/artifacts.js';
5
+ import { toEvidencePayloadFileName } from '../runtime-paths.js';
5
6
 
6
7
  export interface HostInvocationCommandOptions {
7
8
  command?: string;
@@ -41,7 +42,7 @@ export async function invokeClaudeCodeSubagentHost(input: HostInvocationInput):
41
42
  const args = resolveHostArgs(input.commandOptions?.args, prompt);
42
43
  const processResult = await runHostProcess(command, args, input.projectRoot, input.timeoutSeconds ?? 900);
43
44
  const artifactContent = buildHostArtifactContent(input, processResult.stdout, processResult.stderr, processResult.exitCode, processResult.signal, processResult.timedOut);
44
- const written = await writeArtifact(input.projectRoot, input.runId, toArtifactRootRelativePath(input.expectedArtifact), artifactContent);
45
+ await writeArtifact(input.projectRoot, input.runId, toEvidencePayloadFileName(input.expectedArtifact), artifactContent);
45
46
 
46
47
  return {
47
48
  command,
@@ -49,7 +50,7 @@ export async function invokeClaudeCodeSubagentHost(input: HostInvocationInput):
49
50
  exitCode: processResult.exitCode,
50
51
  signal: processResult.signal,
51
52
  timedOut: processResult.timedOut,
52
- artifactPath: written.runRelativePath,
53
+ artifactPath: input.expectedArtifact,
53
54
  stdoutBytes: Buffer.byteLength(processResult.stdout, 'utf8'),
54
55
  stderrBytes: Buffer.byteLength(processResult.stderr, 'utf8')
55
56
  };
@@ -68,8 +69,8 @@ Expected result artifact: ${input.expectedArtifact}
68
69
 
69
70
  Rules:
70
71
  - Work only on this one delegation.
71
- - Do not run sync-back, ship, or workflow transition commands.
72
- - Do not claim approval, sync-back readiness, ship readiness, lifecycle completion, or authoritative PASS unless backed by valid evidence policy.
72
+ - Do not run ship or workflow transition commands.
73
+ - Do not claim approval, truth-alignment readiness, ship readiness, lifecycle completion, or authoritative PASS unless backed by valid evidence policy.
73
74
  - Treat your summary as non-authoritative guidance for the parent main agent.
74
75
  - Do not bypass Claude Code permission prompts.
75
76
  - Never create, edit, delete, move, or rewrite production/source files.
@@ -12,6 +12,8 @@ import { inspectRun } from '../run-state/inspect-run.js';
12
12
  import { readRunState } from '../run-state/run-state.js';
13
13
  import { validResultArtifact, validTaskMarkdown, writeBranchDocs } from '../test-support/fixtures.js';
14
14
  import { writeVerifyContract } from '../verification/verify-contract.js';
15
+ import { evaluateLifecycleRiskDecisionForModel, recordLifecycleRiskDecisionProjection } from '../risk.js';
16
+ import { parseSddBranch } from '../sdd-docs/task-parser.js';
15
17
  import { runBackgroundExecutor } from './background-executor.js';
16
18
  import {
17
19
  claimResidentWorkerRuntime,
@@ -22,12 +24,18 @@ import {
22
24
  writeResidentWorkerRuntimeRecord
23
25
  } from './resident-worker.js';
24
26
 
27
+ async function seedLifecycleRiskDecision(root: string, branch: string): Promise<void> {
28
+ const model = await parseSddBranch(root, branch);
29
+ await recordLifecycleRiskDecisionProjection(root, evaluateLifecycleRiskDecisionForModel(branch, model));
30
+ }
31
+
25
32
  test('resident worker runtime claim persists run-bound runtime evidence', async () => {
26
33
  const root = await mkdtemp(path.join(tmpdir(), 'sdd-resident-worker-claim-'));
27
34
  try {
28
35
  await initProject(root);
29
36
  await writeBranchDocs(root, 'master', validTaskMarkdown('B1', []));
30
37
  await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
38
+ await seedLifecycleRiskDecision(root, 'master');
31
39
 
32
40
  const result = await claimResidentWorkerRuntime(root, { taskId: 'B1', runtimeId: 'R-B1-implementer-test', leaseSeconds: 60 });
33
41
  const runtime = await readResidentWorkerRuntimeRecord(root, result.runId, 'R-B1-implementer-test');
@@ -38,7 +46,7 @@ test('resident worker runtime claim persists run-bound runtime evidence', async
38
46
  assert.equal(result.status, 'claimed');
39
47
  assert.equal(result.delegationId, 'B-B1-implementer-001');
40
48
  assert.equal(runtime.runtimeId, 'R-B1-implementer-test');
41
- assert.equal(runtime.expectedArtifact, 'artifacts/implementer-B1.md');
49
+ assert.equal(runtime.expectedArtifact, '.sdd/runs/master/do/implementer-B1.md');
42
50
  assert.equal(list.runtimes.length, 1);
43
51
  assert.equal(list.activeRuntimes, 1);
44
52
  assert.equal(inspection.workerRuntimes.length, 1);
@@ -54,6 +62,7 @@ test('resident worker runtime heartbeat renews lease without completing task', a
54
62
  await initProject(root);
55
63
  await writeBranchDocs(root, 'master', validTaskMarkdown('B1', []));
56
64
  await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
65
+ await seedLifecycleRiskDecision(root, 'master');
57
66
 
58
67
  const claimed = await claimResidentWorkerRuntime(root, { taskId: 'B1', runtimeId: 'R-B1-heartbeat', leaseSeconds: 60 });
59
68
  const before = claimed.runtime?.leaseExpiresAt;
@@ -78,6 +87,7 @@ test('resident worker runtime stale lease is visible to status and doctor', asyn
78
87
  await initProject(root);
79
88
  await writeBranchDocs(root, 'master', validTaskMarkdown('B1', []));
80
89
  await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
90
+ await seedLifecycleRiskDecision(root, 'master');
81
91
 
82
92
  const claimed = await claimResidentWorkerRuntime(root, { taskId: 'B1', runtimeId: 'R-B1-stale', leaseSeconds: 60 });
83
93
  assert.ok(claimed.runtime);
@@ -109,6 +119,7 @@ test('resident worker runtime heartbeat does not reopen terminal delegations', a
109
119
  await initProject(root);
110
120
  await writeBranchDocs(root, 'master', validTaskMarkdown('B1', []));
111
121
  await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
122
+ await seedLifecycleRiskDecision(root, 'master');
112
123
 
113
124
  const claimed = await claimResidentWorkerRuntime(root, { taskId: 'B1', runtimeId: 'R-B1-terminal', leaseSeconds: 60 });
114
125
  await writeArtifact(root, claimed.runId, 'implementer-B1.md', validResultArtifact('implementer', 'B1', 'PASS', 'artifacts/implementer-B1.md'));
@@ -4,7 +4,7 @@ import { RESIDENT_WORKER_RUNTIME_CONTRACT_VERSION } from '../contracts.js';
4
4
  import { contractIssue, messageFromError, type ContractValidationIssue } from '../contracts/issues.js';
5
5
  import { listDelegationQueueItems } from '../delegation/queue.js';
6
6
  import { isDelegationTerminal } from '../delegation/validation.js';
7
- import { getLegacyWorkerRuntimeRecordPath, getLegacyWorkerRuntimesDir } from '../runtime-paths.js';
7
+ import { getLegacyWorkerRuntimeRecordPath, getLegacyWorkerRuntimesDir, toBranchStageEvidenceRef } from '../runtime-paths.js';
8
8
  import { appendEvent } from '../run-state/events.js';
9
9
  import { readRunState, writeRunState } from '../run-state/run-state.js';
10
10
  import { exists } from '../storage/json-io.js';
@@ -181,6 +181,7 @@ export async function claimResidentWorkerRuntime(projectRoot: string, options: R
181
181
  const state = await readRunState(projectRoot, backgroundResult.runId);
182
182
  const delegation = state.delegations[backgroundResult.delegationId];
183
183
  const now = new Date().toISOString();
184
+ const branch = state.gitBranch ?? state.partition ?? 'unscoped';
184
185
  const runtime: ResidentWorkerRuntimeRecord = {
185
186
  version: RESIDENT_WORKER_RUNTIME_CONTRACT_VERSION,
186
187
  runtimeId,
@@ -190,7 +191,7 @@ export async function claimResidentWorkerRuntime(projectRoot: string, options: R
190
191
  workerAdapterId,
191
192
  delegationId: backgroundResult.delegationId,
192
193
  queueItemId: backgroundResult.queueItemId,
193
- expectedArtifact: delegation?.expectedArtifact ?? `artifacts/${agent}-${options.taskId}.md`,
194
+ expectedArtifact: delegation?.expectedArtifact ?? toBranchStageEvidenceRef(branch, agent === 'validator' ? 'test' : 'do', `${agent}-${options.taskId}.md`),
194
195
  status: 'claimed',
195
196
  claimedAt: now,
196
197
  lastHeartbeatAt: null,
@@ -8,7 +8,7 @@ test('stage role results reject lifecycle transition authority fields', () => {
8
8
  const result = roleResult({ payload: { final_pass: true } });
9
9
 
10
10
  assert.throws(() => assertValidStageRoleResult(result), /final_pass/);
11
- assert.throws(() => assertValidStageRoleResult({ ...roleResult(), syncBackApproved: true }), /syncBackApproved/);
11
+ assert.throws(() => assertValidStageRoleResult({ ...roleResult(), truthAlignmentApproved: true }), /truthAlignmentApproved/);
12
12
  assert.doesNotThrow(() => assertValidStageRoleResult(roleResult()));
13
13
  });
14
14
 
@@ -119,8 +119,8 @@ const FORBIDDEN_LIFECYCLE_FIELDS = new Set([
119
119
  'stagePassed',
120
120
  'task_completed',
121
121
  'taskCompleted',
122
- 'sync_back_approved',
123
- 'syncBackApproved',
122
+ 'truth_alignment_approved',
123
+ 'truthAlignmentApproved',
124
124
  'ship_ready',
125
125
  'shipReady',
126
126
  'final_pass',
@@ -11,14 +11,22 @@ import { createRun, readRunState } from '../run-state/run-state.js';
11
11
  import { graphTaskMarkdown, validResultArtifact, writeBranchDocs } from '../test-support/fixtures.js';
12
12
  import { writeVerifyContract } from '../verification/verify-contract.js';
13
13
  import { bindTestRunState } from '../test-support/run-state.js';
14
+ import { evaluateLifecycleRiskDecisionForModel, recordLifecycleRiskDecisionProjection } from '../risk.js';
15
+ import { parseSddBranch } from '../sdd-docs/task-parser.js';
14
16
  import { inspectWaveExecutor, runWaveExecutor } from './wave-executor.js';
15
17
 
18
+ async function seedLifecycleRiskDecision(root: string, branch: string): Promise<void> {
19
+ const model = await parseSddBranch(root, branch);
20
+ await recordLifecycleRiskDecisionProjection(root, evaluateLifecycleRiskDecisionForModel(branch, model));
21
+ }
22
+
16
23
  test('wave executor completes planner-safe waves from supplied artifacts', async () => {
17
24
  const root = await mkdtemp(path.join(tmpdir(), 'sdd-wave-executor-complete-'));
18
25
  try {
19
26
  await initProject(root);
20
27
  await writeBranchDocs(root, 'master', `# Tasks\n\n${graphTaskMarkdown('WX1', [], ['src/a.ts'], [])}\n${graphTaskMarkdown('WX2', [], ['src/b.ts'], [])}`);
21
28
  await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
29
+ await seedLifecycleRiskDecision(root, 'master');
22
30
  const run = await createRun(root, { runId: 'run-1' });
23
31
  await bindTestRunState(root, run.runId, 'master', 'WX1');
24
32
  await writeArtifact(root, run.runId, 'implementer-WX1.md', validResultArtifact('implementer', 'WX1', 'PASS', 'artifacts/implementer-WX1.md'));
@@ -53,6 +61,7 @@ test('wave executor blocks manual and blocked planner gates before execution', a
53
61
  await initProject(root);
54
62
  await writeBranchDocs(root, 'master', `# Tasks\n\n${graphTaskMarkdown('DB1', [], ['db/schema.sql'], ['database'])}\n${graphTaskMarkdown('APP1', ['DB1'], ['src/app.ts'], [])}`);
55
63
  await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
64
+ await seedLifecycleRiskDecision(root, 'master');
56
65
 
57
66
  const result = await runWaveExecutor(root);
58
67
 
@@ -72,6 +81,7 @@ test('wave executor safe-continue finishes current safe wave but does not cross
72
81
  await initProject(root);
73
82
  await writeBranchDocs(root, 'master', `# Tasks\n\n${graphTaskMarkdown('WX1', [], ['src/a.ts'], [])}\n${graphTaskMarkdown('WX2', [], ['src/b.ts'], [])}\n${graphTaskMarkdown('WX3', ['WX1'], ['src/c.ts'], [])}`);
74
83
  await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
84
+ await seedLifecycleRiskDecision(root, 'master');
75
85
  const run = await createRun(root, { runId: 'run-1' });
76
86
  await bindTestRunState(root, run.runId, 'master', 'WX1');
77
87
  await writeArtifact(root, run.runId, 'implementer-WX2.md', validResultArtifact('implementer', 'WX2', 'PASS', 'artifacts/implementer-WX2.md'));
@@ -10,14 +10,22 @@ import { runBackgroundExecutor } from '../execution/background-executor.js';
10
10
  import { readRunEvents } from '../run-state/events.js';
11
11
  import { validTaskMarkdown, writeBranchDocs } from '../test-support/fixtures.js';
12
12
  import { writeVerifyContract } from '../verification/verify-contract.js';
13
+ import { evaluateLifecycleRiskDecisionForModel, recordLifecycleRiskDecisionProjection } from '../risk.js';
14
+ import { parseSddBranch } from '../sdd-docs/task-parser.js';
13
15
  import { evaluateGovernancePolicy, inspectGovernancePolicy } from './policy.js';
14
16
 
17
+ async function seedLifecycleRiskDecision(root: string, branch: string): Promise<void> {
18
+ const model = await parseSddBranch(root, branch);
19
+ await recordLifecycleRiskDecisionProjection(root, evaluateLifecycleRiskDecisionForModel(branch, model));
20
+ }
21
+
15
22
  test('governance policy explains confirmation and concurrency gates', async () => {
16
23
  const root = await mkdtemp(path.join(tmpdir(), 'sdd-governance-policy-'));
17
24
  try {
18
25
  await initProject(root);
19
26
  await writeBranchDocs(root, 'master', `# Tasks\n\n${validTaskMarkdown('G1', [])}\n${validTaskMarkdown('G2', [])}\n${validTaskMarkdown('G3', [])}\n${validTaskMarkdown('G4', [])}\n${validTaskMarkdown('G5', [])}`);
20
27
  await writeVerifyContract(root, { branch: 'master', branchSource: 'cli_option', force: true });
28
+ await seedLifecycleRiskDecision(root, 'master');
21
29
  const policy = await inspectGovernancePolicy(root);
22
30
  const risky = await evaluateGovernancePolicy(root, { operation: 'destructive_git' });
23
31
 
@@ -7,7 +7,7 @@ import { readFile } from 'node:fs/promises';
7
7
  import { listDelegationQueueItems } from '../delegation/queue.js';
8
8
  import { readAllRunStates } from '../run-state/run-state.js';
9
9
 
10
- export type GovernancePolicyOperation = 'background_executor' | 'wave_executor' | 'sync_back_apply' | 'destructive_git' | 'external_interaction' | 'cleanup';
10
+ export type GovernancePolicyOperation = 'background_executor' | 'wave_executor' | 'destructive_git' | 'external_interaction' | 'cleanup';
11
11
  export type GovernancePolicyDecisionStatus = 'allow' | 'block' | 'confirm';
12
12
 
13
13
  export interface GovernancePolicy {
@@ -69,7 +69,7 @@ const BUILT_IN_GOVERNANCE_POLICY: GovernancePolicy = {
69
69
  maxWaveExecutors: 1
70
70
  },
71
71
  manualConfirmation: {
72
- operations: ['sync_back_apply', 'destructive_git', 'external_interaction', 'cleanup'],
72
+ operations: ['destructive_git', 'external_interaction', 'cleanup'],
73
73
  workerAdapters: ['manual-handoff-worker'],
74
74
  riskTags: ['database', 'security', 'permission', 'external', 'destructive-git', 'data-loss']
75
75
  },
@@ -18,32 +18,47 @@ test('instructions API returns stable JSON contract payloads', () => {
18
18
  assert.equal(doctorPayload.requiredCommands.includes('sdd doctor fast --branch <branch>'), true);
19
19
  assert.equal(doctorPayload.forbiddenSideEffects.includes('background write'), true);
20
20
  assert.equal(doctorPayload.forbiddenSideEffects.includes('run deep historical scans unless explicitly requested'), true);
21
- assert.equal(overviewPayload.requiredCommands.includes('sdd test task <task_id> --branch <branch>'), true);
22
- assert.equal(overviewPayload.requiredCommands.includes('sdd test batch <batch_id> --branch <branch>'), true);
23
- assert.equal(overviewPayload.requiredCommands.includes('sdd test wave --branch <branch> --wave <n>'), true);
24
- assert.equal(overviewPayload.forbiddenSideEffects.includes('unapproved sync-back apply'), true);
21
+ assert.equal(overviewPayload.requiredCommands.includes('sdd test <validation_unit_id-or-validation_text> --branch <branch>'), true);
22
+ assert.equal(overviewPayload.requiredCommands.includes('sdd test task <task_id> --branch <branch>'), false);
23
+ assert.equal(overviewPayload.requiredCommands.includes('sdd test batch <batch_id> --branch <branch>'), false);
24
+ assert.equal(overviewPayload.requiredCommands.includes('sdd test wave --branch <branch> --wave <n>'), false);
25
+ assert.equal(overviewPayload.requiredCommands.includes('sdd test close --branch <branch> --target goal-verify --json'), true);
26
+ assert.equal(overviewPayload.requiredCommands.includes('sdd ship close --branch <branch> --json'), true);
27
+ assert.equal(overviewPayload.nextSteps.some((step) => /\/sdd:tasks/.test(step) && /\/sdd:test/.test(step)), true);
28
+ assert.doesNotMatch(JSON.stringify(overviewPayload), /sync-back|sync_back/);
25
29
  assert.match(overviewPayload.summary, /natural-language SDD intent/);
26
30
  assert.equal(overviewPayload.nextSteps.some((step) => /natural-language intent router/.test(step)), true);
27
31
  assert.equal(overviewPayload.nextSteps.some((step) => /ambiguous after status/.test(step)), true);
28
32
  assert.equal(initPayload.allowedSideEffects.includes('write managed generated AI entries'), true);
29
33
  assert.equal(initPayload.allowedSideEffects.includes('write specs/<branch>/spec.md'), false);
30
34
  assert.equal(initPayload.forbiddenSideEffects.some((item) => /legacy --scaffold-docs/.test(item)), true);
31
- assert.match(planPayload.summary, /deliverable technical solution document/);
32
- assert.equal(planPayload.nextSteps.some((step) => /PlantUML/.test(step)), true);
33
- assert.equal(planPayload.nextSteps.some((step) => /state-machine/.test(step) && /api_schema/.test(step)), true);
35
+ assert.match(planPayload.summary, /plan-stage evidence/);
36
+ assert.equal(planPayload.requiredCommands.includes('sdd plan close --branch <branch> --json'), true);
37
+ assert.equal(planPayload.forbiddenSideEffects.includes('runtime-authored Markdown artifacts'), true);
34
38
  assert.match(specPayload.summary, /workflow partition entry/);
35
39
  assert.equal(specPayload.forbiddenSideEffects.includes('design technical solution in spec.md'), true);
36
40
  assert.equal(specPayload.nextSteps.some((step) => /AC-1/.test(step) && /verification hints/.test(step)), true);
37
- assert.match(tasksPayload.summary, /task and verification contracts/);
38
- assert.equal(tasksPayload.forbiddenSideEffects.includes('turn tasks.md into project-management backlog'), true);
39
- assert.equal(tasksPayload.nextSteps.some((step) => /acceptance_refs/.test(step) && /plan_refs/.test(step)), true);
40
- assert.equal(doPayload.requiredCommands.includes('sdd artifact template artifacts/<agent>-<task_id>.md --task <task_id> --agent <agent> --run <run_id> --write'), true);
41
- assert.equal(doPayload.forbiddenSideEffects.includes('mark missing evidence as PASS'), true);
42
- assert.equal(doPayload.nextSteps.some((step) => /--run <run_id> --write/.test(step) && /do not manually create copies/.test(step)), true);
41
+ assert.match(tasksPayload.summary, /tasks -> verifies/);
42
+ assert.equal(tasksPayload.requiredCommands.includes('sdd tasks close --branch <branch> --json'), true);
43
+ assert.equal(tasksPayload.requiredCommands.includes('sdd tasks close --branch <branch> --target verifies --json'), true);
44
+ assert.equal(tasksPayload.requiredCommands.includes('sdd verifies close --branch <branch> --json'), false);
45
+ assert.equal(tasksPayload.forbiddenSideEffects.includes('write verify.md before tasks close produces a fresh verifies handoff'), true);
46
+ assert.equal(doPayload.requiredCommands.includes('write .sdd/runs/<branch>/do/implementation-vN.md'), true);
47
+ assert.equal(doPayload.allowedSideEffects.includes('write agent-authored .sdd/runs/<branch>/do/*.md evidence files'), true);
48
+ assert.equal(doPayload.forbiddenSideEffects.includes('runtime-authored Markdown artifacts'), true);
49
+ assert.equal(doPayload.nextSteps.some((step) => /runtime must read .*\.sdd\/runs\/<branch>\/do\/\*\.md/.test(step) && /write only SQLite/.test(step)), true);
50
+ assert.equal(doPayload.requiredCommands.includes('sdd do task <task_id-or-task-text> --branch <branch>'), true);
51
+ assert.equal(doPayload.nextSteps.some((step) => /task id and accepted task title\/text are equivalent/.test(step)), true);
43
52
  const testPayload = getSddInstructions('test');
44
- assert.equal(testPayload.requiredCommands.includes('sdd test batch <batch_id> --branch <branch>'), true);
45
- assert.equal(testPayload.requiredCommands.includes('sdd test wave --branch <branch> --wave <n>'), true);
46
- assert.equal(testPayload.nextSteps.some((step) => /batch_end or wave_end/.test(step)), true);
47
- assert.equal(verifyPayload.requiredCommands.includes('sdd artifact validate <run_id> <artifact> --task <task_id> --agent validator'), true);
48
- assert.equal(verifyPayload.forbiddenSideEffects.includes('unapproved sync-back apply'), true);
53
+ assert.equal(testPayload.requiredCommands.includes('sdd test close --branch <branch> --json'), true);
54
+ assert.equal(testPayload.requiredCommands.includes('sdd test close --branch <branch> --target goal-verify --json'), true);
55
+ assert.equal(testPayload.requiredCommands.includes('sdd test <validation_unit_id-or-validation_text> --branch <branch>'), true);
56
+ assert.equal(testPayload.requiredCommands.includes('sdd test task <task_id> --branch <branch>'), false);
57
+ assert.equal(testPayload.requiredCommands.includes('sdd goal-verify close --branch <branch> --json'), false);
58
+ assert.match(testPayload.summary, /test -> goal-verify/);
59
+ assert.match(testPayload.summary, /validation unit/);
60
+ assert.equal(testPayload.nextSteps.some((step) => /\.sdd\/runs\/<branch>\/test\/\*\.md/.test(step)), true);
61
+ assert.equal(testPayload.forbiddenSideEffects.includes('treat command success alone as semantic PASS'), true);
62
+ assert.equal(verifyPayload.requiredCommands.includes('sdd verify task <task_id> [--branch <branch>] [--run <run_id>]'), true);
63
+ assert.doesNotMatch(JSON.stringify(verifyPayload), /sync-back|sync_back/);
49
64
  });
@@ -2,7 +2,7 @@ import { SDD_VERSION } from './ai-tools.js';
2
2
 
3
3
  export const SDD_INSTRUCTIONS_CONTRACT = 'sdd-instructions-v1';
4
4
 
5
- export type InstructionAction = 'overview' | 'init' | 'doctor' | 'update' | 'spec' | 'plan' | 'tasks' | 'verifies' | 'test' | 'do' | 'verify' | 'sync-back' | 'ship' | 'run-task' | 'verify-task';
5
+ export type InstructionAction = 'overview' | 'init' | 'doctor' | 'update' | 'spec' | 'plan' | 'tasks' | 'verifies' | 'test' | 'do' | 'verify' | 'ship' | 'run-task' | 'verify-task';
6
6
 
7
7
  export interface SddInstructionPayload {
8
8
  contract: typeof SDD_INSTRUCTIONS_CONTRACT;
@@ -17,25 +17,25 @@ export interface SddInstructionPayload {
17
17
 
18
18
  const INSTRUCTION_PAYLOADS: Record<InstructionAction, Omit<SddInstructionPayload, 'contract' | 'version' | 'action'>> = {
19
19
  overview: {
20
- summary: 'Route natural-language SDD intent from branch/source status to task execution, agent evidence, strict verification-contract consumption, and release readiness while keeping CLI/core output as source of truth.',
21
- requiredCommands: ['sdd status', 'sdd lifecycle decide --from-text <text>', 'sdd doctor', 'sdd tasks inspect <task_id>', 'sdd do task <task_id>', 'sdd test task <task_id> --branch <branch>', 'sdd test batch <batch_id> --branch <branch>', 'sdd test wave --branch <branch> --wave <n>', 'sdd ship --branch <branch> --dry-run', 'sdd instructions ship --json'],
20
+ summary: 'Route natural-language SDD intent from branch/source status to task execution, agent evidence, strict verification-contract consumption, goal verification, truthAlignment, and release readiness while keeping CLI/core output as source of truth.',
21
+ requiredCommands: ['sdd status', 'sdd lifecycle decide --from-text <text>', 'sdd doctor', 'sdd tasks inspect <task_id>', 'sdd do task <task_id-or-task-text>', 'sdd test <validation_unit_id-or-validation_text> --branch <branch>', 'sdd test close --branch <branch> --target goal-verify --json', 'sdd ship close --branch <branch> --json', 'sdd instructions ship --json'],
22
22
  allowedSideEffects: ['read .sdd state', 'read specs documents', 'read generated AI entries'],
23
- forbiddenSideEffects: ['background write', 'worktree creation', 'auto commit', 'force push', 'unapproved sync-back apply', 'publish or push release artifacts without explicit human confirmation'],
23
+ forbiddenSideEffects: ['background write', 'worktree creation', 'auto commit', 'force push', 'publish or push release artifacts without explicit human confirmation'],
24
24
  nextSteps: [
25
25
  'Treat /sdd as a natural-language intent router, then run sdd status first to see branch/source context and the recommended next command; report only workflow state, blocker/current task, and next action unless the user asks for full detail.',
26
26
  'Dynamic routing comes from CLI/core output; follow the recommended next command and do not infer dynamic state from generated markdown.',
27
+ 'Use /sdd:tasks as the user-visible bundle for tasks -> verifies, and /sdd:test as the user-visible bundle for test -> goal-verify; do not invent separate slash entries for internal substages.',
27
28
  'If intent remains ambiguous after status, ask one clarifying question before spec/plan/tasks/do/test/ship work.',
28
- 'If status reports generated entry drift, missing config, compatibility drift, or legacy sync-back state, run sdd doctor and use diagnostic/recovery commands before normal do/test/ship.',
29
- 'If status recommends a pending task, run sdd tasks inspect <task_id> and execute only the approved task boundary; scout/implementer/reviewer/validator participation should be recorded as artifacts rather than hidden in the main chat.',
30
- 'For test, follow the task contract boundary: strict/task_end work uses sdd test task, batch_end work uses sdd test batch, and wave_end work uses sdd test wave; pass --run only for replay, CI, or old-run inspection.',
31
- 'After the selected test boundary returns PASS, proceed to a decision card if policy requires one, otherwise run `sdd ship --branch <branch> --dry-run`.',
32
- 'Use `sdd sync-back inspect|apply` only for explicit diagnostic, recovery, replay, or legacy compatibility work; do not add it as a normal happy-path step.'
29
+ 'If status reports generated entry drift, missing config, compatibility drift, or projection drift, run sdd doctor and follow its current-run repair or rebuild recommendation before normal do/test/ship.',
30
+ 'If status recommends a pending task, run sdd tasks inspect <task_id> and execute only the approved task boundary; scout/implementer/reviewer/validator participation should be recorded as stage evidence rather than hidden in the main chat.',
31
+ 'For test, bind user intent to an accepted verify.md validation unit with sdd test <validation_unit_id-or-validation_text>; use task/batch/wave subcommands only for explicit low-level diagnostics or narrowed overrides.',
32
+ 'After test closure is accepted, continue through /sdd:test with sdd test close --target goal-verify so runtime can record truthAlignment before ship readiness.'
33
33
  ]
34
34
  },
35
35
  init: {
36
36
  summary: 'Initialize .sdd project configuration and managed AI tool entries for the current repository; workflow partition documents are entered through the spec stage, not init.',
37
37
  requiredCommands: ['sdd init --ai claude-code', 'sdd status', 'sdd instructions spec --json', 'sdd doctor'],
38
- allowedSideEffects: ['write .sdd/project.yml', 'write .sdd/runs', 'write managed generated AI entries'],
38
+ allowedSideEffects: ['write .sdd/project.yml', 'initialize runtime.sqlite state', 'write managed generated AI entries'],
39
39
  forbiddenSideEffects: ['create workflow partition documents unless explicitly using the spec stage or legacy --scaffold-docs', 'overwrite foreign AI entry files', 'background write', 'auto commit'],
40
40
  nextSteps: ['Run sdd init --ai claude-code.', 'Run sdd status to inspect current Git branch partition state and the recommended next command.', 'Use the spec stage to create or refine specs/<partition>/spec.md; omitted --branch uses the current Git branch, explicit --branch uses the requested partition.', 'Run sdd doctor after initialization.']
41
41
  },
@@ -61,74 +61,67 @@ const INSTRUCTION_PAYLOADS: Record<InstructionAction, Omit<SddInstructionPayload
61
61
  nextSteps: ['Resolve the workflow partition: omit --branch to use the current Git branch, or pass --branch <name> only when intentionally writing another partition.', 'Clarify user intent, objective/customer value, actors, scenarios, scope, and non-goals.', 'Run sdd lifecycle decide --from-text <text> when changes mention state-machine, concurrency, database, SQL, security, API/schema, CI/build, or external unknown risk.', 'Write acceptance criteria with stable IDs such as AC-1 and verification hints.', 'Record assumptions/dependencies, risks/hard gates, open questions, and lifecycle reference.', 'If this is a requirement change after plan/tasks/run work exists, update spec.md and let status expose stale downstream hashes before continuing.', 'Stop before technical design or implementation when requirement gaps remain.']
62
62
  },
63
63
  plan: {
64
- summary: 'Refine specs/<partition>/plan.md as a deliverable technical solution document that bridges approved spec requirements into task-ready design and records based_on_spec_hash.',
65
- requiredCommands: ['sdd status', 'read specs/<partition>/spec.md', 'read specs/<partition>/plan.md', 'write specs/<partition>/plan.md'],
66
- allowedSideEffects: ['read project context', 'read spec document', 'write proposed or approved technical solution plan document'],
67
- forbiddenSideEffects: ['implement code', 'silently advance to tasks', 'bypass unresolved spec gaps'],
68
- nextSteps: ['Read the approved spec and acceptance criteria plus the current spec hash from sdd status.', 'Record based_on_spec_hash in plan.md so later spec-stage revisions can mark this plan stale.', 'Write plan.md as a technical solution document: background, goals/non-goals, current state, target design, architecture/component impact, interaction/sequence design, state/data design, API/schema design, concurrency/transaction/consistency design, key decisions, alternatives, risk control, rollout/rollback, validation matrix, and task breakdown rationale.', 'Use PlantUML diagrams when they clarify component impact, sequence/activity flow, state machines, or deployment/data relationships.', 'Apply risk-driven requirements: state-machine needs state design, concurrency needs sequence/activity and consistency design, database needs data/transaction/rollback design, api_schema needs interface/schema compatibility, security/sql needs risk control.', 'Stop with explicit plan gaps and tasks readiness.']
64
+ summary: 'Refine specs/<partition>/plan.md and .sdd/runs/<branch>/plan/*.md as agent-authored plan-stage evidence, then let runtime close validate refs/hashes/contracts into SQLite.',
65
+ requiredCommands: ['sdd status', 'read specs/<partition>/spec.md', 'write specs/<partition>/plan.md', 'write .sdd/runs/<branch>/plan/plan-review-vN.md', 'write .sdd/runs/<branch>/plan/plan-manager-vN.md', 'write .sdd/runs/<branch>/plan/plan-collaboration-contract-vN.md', 'sdd plan close --branch <branch> --json'],
66
+ allowedSideEffects: ['read project context', 'read spec document', 'write agent-authored plan-stage Markdown under specs/<branch>/ and .sdd/runs/<branch>/plan/'],
67
+ forbiddenSideEffects: ['runtime-authored Markdown artifacts', 'implement code', 'silently advance to tasks', 'bypass unresolved spec gaps'],
68
+ nextSteps: ['Read the approved spec and acceptance criteria plus the current normalized spec contract hash from sdd status.', 'Do not write based_on_* hash metadata into plan.md; accepted dependency edges belong to runtime close/accept projections.', 'Have planner/reviewer/plan-manager author plan-stage Markdown evidence under .sdd/runs/<branch>/plan/ including a StageCollaborationContract.', 'Run sdd plan close --branch <branch> --json; runtime must validate refs/frontmatter/contracts, compute hashes, and write only .sdd/runtime.sqlite.', 'Stop with explicit plan gaps and tasks readiness; do not let runtime create or repair Markdown.']
69
69
  },
70
70
  tasks: {
71
- summary: 'Refine specs/<partition>/tasks.md and specs/<partition>/verify.md as frozen task and verification contracts with implementation waves, validation waves, and review gate declarations.',
72
- requiredCommands: ['sdd status', 'read specs/<partition>/spec.md', 'read specs/<partition>/plan.md', 'sdd tasks format', 'write specs/<partition>/tasks.md', 'write specs/<partition>/verify.md', 'sdd tasks list', 'sdd tasks gaps', 'sdd verifies inspect --branch <branch>'],
73
- allowedSideEffects: ['read spec and plan documents', 'write proposed or approved task execution/evidence contract', 'write task-derived verify contract'],
74
- forbiddenSideEffects: ['implement code', 'execute dependency waves', 'run validation commands', 'silently advance to do', 'turn tasks.md into project-management backlog'],
75
- nextSteps: ['Read approved spec acceptance IDs, approved plan design sections, and the current plan hash from sdd status.', 'Record based_on_plan_hash in tasks.md so later plan/spec revisions can mark these tasks stale.', 'Run sdd tasks format to get the canonical block format.', 'Map every task to acceptance_refs and plan_refs where applicable.', 'Declare change_surface, implementation_wave, validation_batch, validation_timing, requires_verify_before_next, required artifacts, and review gates before freezing tasks.', 'Use validation_timing task_end and requires_verify_before_next true for strict/high-risk tasks; use batch_end or wave_end with validation_batch only when sequential accumulation is safe.', 'Have the verification-designer produce verify.md from the frozen task contract, then inspect it with sdd verifies inspect --branch <branch>.', 'Keep #### Boundary, #### Acceptance, #### Definition of Done, #### Evidence Expectations, and #### Implementation Notes as companion sections outside the ```sdd-task fenced block; keep only metadata inside the fence.', 'Frontend-only tasks must not declare Maven/Gradle backend build validation.', 'For risky tasks, include allowed_agents, required_artifacts, verification_availability, and autonomy.', 'Run sdd tasks list and sdd tasks gaps.', 'Stop before do task when task boundary, acceptance refs, plan refs, evidence requirements, validation batches/waves, or verify expectations are unclear.']
71
+ summary: 'Use /sdd:tasks as the user-visible bundle for tasks -> verifies: refine specs/<partition>/tasks.md and .sdd/runs/<branch>/tasks/*.md first, then continue through the same bundle when runtime handoff targets verifies.',
72
+ requiredCommands: ['sdd status', 'read specs/<partition>/spec.md', 'read specs/<partition>/plan.md', 'sdd tasks format', 'write specs/<partition>/tasks.md', 'write .sdd/runs/<branch>/tasks/tasks-review-vN.md', 'write .sdd/runs/<branch>/tasks/tasks-manager-vN.md', 'write .sdd/runs/<branch>/tasks/tasks-collaboration-contract-vN.md', 'sdd tasks close --branch <branch> --json', 'write specs/<partition>/verify.md', 'write .sdd/runs/<branch>/verifies/verifies-review-vN.md', 'write .sdd/runs/<branch>/verifies/verifies-manager-vN.md', 'write .sdd/runs/<branch>/verifies/verifies-collaboration-contract-vN.md', 'sdd tasks close --branch <branch> --target verifies --json'],
73
+ allowedSideEffects: ['read spec and plan documents', 'write agent-authored tasks-stage Markdown under specs/<branch>/ and .sdd/runs/<branch>/tasks/', 'write agent-authored verifies-stage Markdown under specs/<branch>/ and .sdd/runs/<branch>/verifies/ after a runtime handoff to verifies'],
74
+ forbiddenSideEffects: ['runtime-authored Markdown artifacts', 'write verify.md before tasks close produces a fresh verifies handoff', 'implement code', 'execute dependency waves', 'run validation commands', 'silently advance to do', 'turn tasks.md into project-management backlog'],
75
+ nextSteps: ['Read approved spec acceptance IDs, approved plan design sections, and the current normalized plan contract hash from sdd status.', 'Do not write based_on_* hash metadata into tasks.md; accepted dependency edges belong to runtime close/accept projections.', 'Run sdd tasks format to get the canonical block format.', 'Map every task to acceptance_refs and plan_refs where applicable.', 'Declare change_surface, implementation_wave, validation_batch, validation_timing, requires_verify_before_next, evidence expectations, and review gates before freezing tasks.', 'Have task-planner/reviewer/tasks-manager author .sdd/runs/<branch>/tasks/*.md evidence including a StageCollaborationContract.', 'Run sdd tasks close --branch <branch> --json; runtime must validate refs/frontmatter/contracts, compute hashes, and write only .sdd/runtime.sqlite.', 'If runtime/status targets verifies inside the tasks bundle, have verification-designer/reviewer/verifies-manager author specs/<branch>/verify.md plus .sdd/runs/<branch>/verifies/*.md evidence.', 'Continue with sdd tasks close --branch <branch> --target verifies --json; runtime must validate verifies refs/contracts and return the next legal route.']
76
76
  },
77
77
  verifies: {
78
- summary: 'Create or inspect specs/<partition>/verify.md as the task-derived verification contract before runtime evidence execution.',
79
- requiredCommands: ['sdd status', 'sdd tasks list --branch <branch>', 'sdd verifies inspect --branch <branch>', 'sdd verifies write --branch <branch>'],
80
- allowedSideEffects: ['read spec, plan, and tasks documents', 'write specs/<partition>/verify.md when explicitly using write'],
81
- forbiddenSideEffects: ['run validation commands', 'update runtime.sqlite run state', 'create sync-back proposal', 'modify source files', 'auto commit'],
82
- nextSteps: ['Run sdd status and confirm tasks.md is current.', 'Run sdd verifies inspect --branch <branch> to check whether verify.md exists and matches the current tasks hash.', 'Run sdd verifies write --branch <branch> to create verify.md, or add --force after reviewing task contract changes.', 'Use verify.md to guide validator evidence expectations; do not treat it as runtime evidence or as a replacement for `sdd test task|batch|wave`.']
78
+ summary: 'Diagnostic/internal action for verifies-stage closure; normal users enter it through /sdd:tasks with target=verifies.',
79
+ requiredCommands: ['sdd status', 'read specs/<partition>/tasks.md', 'write specs/<partition>/verify.md', 'write .sdd/runs/<branch>/verifies/verifies-review-vN.md', 'write .sdd/runs/<branch>/verifies/verifies-manager-vN.md', 'write .sdd/runs/<branch>/verifies/verifies-collaboration-contract-vN.md', 'sdd tasks close --branch <branch> --target verifies --json'],
80
+ allowedSideEffects: ['read spec, plan, and tasks documents', 'write agent-authored verifies-stage Markdown under specs/<branch>/ and .sdd/runs/<branch>/verifies/'],
81
+ forbiddenSideEffects: ['runtime-authored Markdown artifacts', 'run validation commands', 'modify source files', 'auto commit'],
82
+ nextSteps: ['Run sdd status and confirm tasks.md is current.', 'Have verification-designer/reviewer/verifies-manager author verify.md plus .sdd/runs/<branch>/verifies/*.md evidence including a StageCollaborationContract.', 'Continue through sdd tasks close --branch <branch> --target verifies --json; runtime must validate refs/frontmatter/hashes/contracts and write only .sdd/runtime.sqlite.', 'Keep direct verifies-stage entry as diagnostic/recovery only, not the normal Phase 9 happy path.', 'Use accepted verify.md to guide later test evidence expectations; do not treat it as runtime-authored evidence.']
83
83
  },
84
84
  test: {
85
- summary: 'Execute validation commands from the frozen tasks.md + verify.md contract boundary, capture command output, evaluate acceptance evidence coverage, and return one unified task, batch, or wave judgment without authoring verify.md.',
86
- requiredCommands: ['sdd status', 'sdd test task <task_id> --branch <branch>', 'sdd test batch <batch_id> --branch <branch>', 'sdd test wave --branch <branch> --wave <n>'],
87
- allowedSideEffects: ['run declared validation commands', 'write branch-scoped test evidence artifacts', 'update runtime.sqlite test run and validation wave records', 'write validator evidence artifact'],
88
- forbiddenSideEffects: ['modify source files outside the validation command effects', 'author or refresh verify.md', 'apply sync-back', 'auto commit', 'publish or push', 'treat command success alone as semantic PASS'],
89
- nextSteps: ['Run sdd status and resolve the task, batch, or wave boundary plus branch.', 'Confirm verify.md exists and is current for the selected branch; if it is missing or stale, return to /sdd:tasks or use explicit sdd verifies write recovery before executing tests.', 'Use sdd test task <task_id> --branch <branch> for strict/task_end tasks or deliberate narrowed overrides with --run, --command, --command-json, --command-file, or passthrough argv.', 'Use sdd test batch <batch_id> --branch <branch> or sdd test wave --branch <branch> --wave <n> for batch_end or wave_end tasks so accumulated implementation evidence is judged together.', 'Inspect the generated command logs, test index, validator artifacts, acceptance maps, and workflow gate decision.', 'If the selected test boundary returns PASS, proceed to a decision card if policy requires one, otherwise run `sdd ship --branch <branch> --dry-run`; if it returns FAIL or BLOCKED, fix the reported command/evidence gaps and rerun the same boundary.']
85
+ summary: 'Use /sdd:test as the user-visible bundle for test -> goal-verify: bind validation intent to an accepted verify.md validation unit, close test-stage evidence, then continue through the same bundle so runtime records truthAlignment before ship.',
86
+ requiredCommands: ['sdd status', 'sdd instructions test --json', 'sdd test <validation_unit_id-or-validation_text> --branch <branch>', 'write .sdd/runs/<branch>/test/test-execution-vN.md', 'write .sdd/runs/<branch>/test/test-review-vN.md', 'write .sdd/runs/<branch>/test/test-manager-vN.md', 'write .sdd/runs/<branch>/test/test-collaboration-contract-vN.md', 'sdd test close --branch <branch> --json', 'write .sdd/runs/<branch>/goal-verify/goal-verification-vN.md', 'sdd test close --branch <branch> --target goal-verify --json'],
87
+ allowedSideEffects: ['run declared validation-unit commands', 'write agent-authored .sdd/runs/<branch>/test/*.md evidence', 'write agent-authored .sdd/runs/<branch>/goal-verify/*.md evidence after a runtime handoff to goal-verify', 'update runtime.sqlite validation and closure projections'],
88
+ forbiddenSideEffects: ['runtime-authored Markdown artifacts', 'modify source files outside validation command effects', 'author or refresh verify.md', 'auto commit', 'publish or push', 'treat command success alone as semantic PASS'],
89
+ nextSteps: ['Run sdd status and resolve the verify.md validation-unit boundary plus branch.', 'Confirm accepted verify.md exists for the selected branch; if missing or stale, return through the /sdd:tasks bundle with target=verifies.', 'Run the declared validation unit through sdd test <validation_unit_id-or-validation_text>; PASS command output stays in runtime read models by default, while failure/blocker diagnostics may retain scoped payload refs.', 'Use sdd test task|batch|wave only for explicit low-level diagnostics, replay, or narrowed override flags.', 'Have test-runner/reviewer/test-manager author .sdd/runs/<branch>/test/*.md evidence including a StageCollaborationContract.', 'Run sdd test close --branch <branch> --json; runtime validates evidence refs/contracts and writes only .sdd/runtime.sqlite.', 'If runtime/status targets goal-verify inside the test bundle, have goal-verifier/reviewer author .sdd/runs/<branch>/goal-verify/*.md evidence.', 'Continue with sdd test close --branch <branch> --target goal-verify --json; runtime records truthAlignment before ship readiness.']
90
90
  },
91
91
  do: {
92
- summary: 'Execute one approved task boundary through the ingestion-aware SDD task workflow with explicit scout/implementer/reviewer/validator evidence handoff.',
93
- requiredCommands: ['sdd status', 'sdd instructions do --json', 'sdd tasks inspect <task_id>', 'sdd artifact template artifacts/<agent>-<task_id>.md --task <task_id> --agent <agent> --run <run_id> --write', 'sdd artifact validate <run_id> <artifact> --task <task_id> --agent <agent>', 'sdd do task <task_id>'],
94
- allowedSideEffects: ['write branch-scoped .sdd/runs evidence artifacts', 'update runtime.sqlite run state', 'modify files within selected task boundary'],
95
- forbiddenSideEffects: ['background write', 'worktree creation', 'auto commit', 'expand beyond selected task boundary without checkpoint', 'mark missing evidence as PASS'],
96
- nextSteps: ['Run sdd status and resolve exactly one task id from the user request or recommended next command.', 'Run sdd instructions do --json and sdd tasks inspect <task_id>.', 'Restate only the task Boundary, blocking gaps, and validation commands before implementation.', 'Use scout for bounded context only, implementer for selected-boundary edits, reviewer for review evidence, and validator for validation plus acceptance mapping.', 'Create or resolve the task run id, then write implement/review/validation result artifacts only with sdd artifact template artifacts/<agent>-<task_id>.md --task <task_id> --agent <agent> --run <run_id> --write; do not manually create copies under specs/<branch>/artifacts/ or specs/<branch>/evidence/artifacts/.', 'Pass run-relative artifacts/<file> paths to CLI flags, and keep source/test files in ## Evidence, not in sdd-result.artifacts.', 'Run sdd artifact validate before passing artifacts into sdd do task <task_id>.', 'Run or coordinate implementation only within the selected task boundary.', 'Run sdd do task <task_id> with explicit artifact paths when evidence is available.', 'Report run id, final status, blocking gaps, and next gate; if completed, follow sdd status recommended next command: continue sequential sdd do task, run sdd test task for strict/task_end work, or run sdd test batch / sdd test wave at the declared validation boundary.']
92
+ summary: 'Semantically bind /sdd:do or sdd do task input to one accepted task boundary, then run do-stage collaboration: implementer/reviewer/do-manager write .sdd/runs/<branch>/do/*.md evidence and runtime reconciles gate truth into SQLite.',
93
+ requiredCommands: ['sdd status', 'sdd instructions do --json', 'sdd tasks inspect <bound_task_id>', 'write/update source files within the bound task boundary', 'write .sdd/runs/<branch>/do/implementation-vN.md', 'write .sdd/runs/<branch>/do/code-review-vN.md', 'write .sdd/runs/<branch>/do/do-manager-vN.md', 'sdd do task <task_id-or-task-text> --branch <branch>'],
94
+ allowedSideEffects: ['modify files within selected task boundary', 'write agent-authored .sdd/runs/<branch>/do/*.md evidence files', 'update runtime.sqlite projections and run state'],
95
+ forbiddenSideEffects: ['runtime-authored Markdown artifacts', 'background write', 'worktree creation', 'auto commit', 'expand beyond selected task boundary without checkpoint', 'mark missing evidence as PASS'],
96
+ nextSteps: ['Run sdd status, then let CLI/core bind the user request or recommended next command to exactly one accepted task boundary; task id and accepted task title/text are equivalent when they bind to the same task.', 'If binding is ambiguous, missing, stale, or boundary-expanding, stop and follow the CLI nextAction instead of implementing.', 'Run sdd instructions do --json and sdd tasks inspect <bound_task_id>.', 'Restate only the bound task Boundary, blocking gaps, and validation commands before implementation.', 'Implement only within affected_files and capture changed file refs/hashes in .sdd/runs/<branch>/do/implementation-vN.md frontmatter.', 'Have code-reviewer write .sdd/runs/<branch>/do/code-review-vN.md against the implementation evidence hash, whether approved or blocked.', 'Have do-manager write .sdd/runs/<branch>/do/do-manager-vN.md as a closure request that references the reviewed implementation and review hash.', 'Run sdd do task <task_id-or-task-text> --branch <branch>; runtime must read .sdd/runs/<branch>/do/*.md, validate frontmatter/hash/review/manager closure, and write only SQLite projections/run state.', 'Report run id, final status, binding target, blocking gaps, accepted evidence refs, and next gate; for verification proceed to sdd test <validation_unit_id-or-validation_text> --branch <branch>.']
97
97
  },
98
98
  verify: {
99
- summary: 'Run compatibility/diagnostic task acceptance coverage from reviewer/validator artifacts, resolving the latest eligible run from partition + task id unless --run is explicit; `sdd test task|batch|wave` is the primary runtime gate.',
100
- requiredCommands: ['sdd status', 'sdd instructions verify --json', 'sdd artifact template artifacts/validation-<task_id>.md --task <task_id> --agent validator --run <run_id> --write', 'sdd artifact validate <run_id> <artifact> --task <task_id> --agent validator', 'sdd verify task <task_id> [--branch <branch>] [--run <run_id>]'],
101
- allowedSideEffects: ['write acceptance coverage artifact', 'update runtime.sqlite diagnostic verification state'],
102
- forbiddenSideEffects: ['auto commit', 'force push', 'auto-fix failures', 'create sync-back proposal as normal happy path', 'unapproved sync-back apply', 'mark completed with blocking validation gaps'],
103
- nextSteps: ['Run sdd status and resolve exactly one task id plus workflow partition from the recommended command or user request.', 'Omit --run by default so CLI resolves the latest eligible run for partition + task id; pass --run only for explicit replay, CI, or old-run inspection.', 'Ensure the validator artifact includes exact Acceptance text, preferably under ## Acceptance Mapping from sdd artifact template.', 'When a validator artifact must be created manually for a run, write it only with sdd artifact template artifacts/validation-<task_id>.md --task <task_id> --agent validator --run <run_id> --write; do not manually create copies under specs/<branch>/artifacts/ or specs/<branch>/evidence/artifacts/.', 'Pass run-relative artifacts/<file> paths to validate/verify CLI flags.', 'Run sdd artifact validate before compatibility verify.', 'Run sdd instructions verify --json and sdd verify task <task_id> --branch <branch> only for explicit low-level diagnostics.', 'For the primary lifecycle path, use `sdd test task|batch|wave`; after PASS proceed to a decision card if policy requires one or `sdd ship --branch <branch> --dry-run`.', 'Report PASS/BLOCKED status and unresolved blockers; avoid pasting full acceptance coverage unless requested.']
104
- },
105
- 'sync-back': {
106
- summary: 'Inspect or replay verified task completion write-back state for diagnostic, recovery, replay, and legacy compatibility use.',
107
- requiredCommands: ['sdd status', 'sdd instructions sync-back --json', 'sdd sync-back inspect [<run_id>] --branch <branch> --task <task_id>', 'sdd sync-back apply [<run_id>] --branch <branch> --task <task_id> [--approved]'],
108
- allowedSideEffects: ['read runtime.sqlite run state', 'read sync-back proposal artifact', 'read specs/<partition>/tasks.md', 'write specs/<partition>/tasks.md during apply', 'write specs/<partition>/verify.md only when explicit --refresh-verify is supplied', 'update run sync_back state only during apply'],
109
- forbiddenSideEffects: ['auto commit', 'force push', 'apply without inspect', 'apply confirm-required proposals without human approval', 'change source files outside tasks.md'],
110
- nextSteps: ['Run sdd status and resolve exactly one task id plus workflow partition from an explicit diagnostic, recovery, replay, CI, or old-run inspection request.', 'Run sdd sync-back inspect --branch <branch> --task <task_id> first; pass an explicit run id only for replay, CI, or old-run inspection.', 'Report the inspect target update before asking for approval: target tasks file, task id, markdown status transition, proposal path, evidence artifacts, apply_policy, and policy reasons.', 'If apply_policy=direct and status=ready, run sdd sync-back apply --branch <branch> --task <task_id> only for explicit recovery/replay; if approval_required=true, ask for explicit confirmation and then add --approved.', 'Explain that default apply writes the task block status to completed, appends the sync-back implementation note from the proposal/evidence, marks the run sync_back state applied, and rebuilds the local run index; --refresh-verify is an explicit recovery option after reviewed task-contract changes.', 'After apply, report the updated task id, tasks.md path, applied flag, and sync_back state.']
99
+ summary: 'Run low-level task acceptance coverage from runtime-selected reviewer/validator evidence; `sdd test <validation_unit_id-or-validation_text>` is the primary runtime gate.',
100
+ requiredCommands: ['sdd status', 'sdd instructions verify --json', 'sdd verify task <task_id> [--branch <branch>] [--run <run_id>]'],
101
+ allowedSideEffects: ['write acceptance coverage runtime evidence', 'update runtime.sqlite diagnostic verification state'],
102
+ forbiddenSideEffects: ['auto commit', 'force push', 'auto-fix failures', 'mark completed with blocking validation gaps'],
103
+ nextSteps: ['Run goal-level verify without --run for the latest eligible partition/task run, unless inspecting an explicit run.', 'Use sdd test <validation_unit_id-or-validation_text> for primary lifecycle judgment.']
111
104
  },
112
105
  ship: {
113
- summary: 'Run local release readiness and optionally write specs/<branch>/release.md without publishing, pushing, tagging, or changing external release state.',
114
- requiredCommands: ['sdd ship --branch <branch> --dry-run', 'sdd ship --branch <branch>', 'sdd statusline --branch <branch>', 'sdd doctor fast --branch <branch>', 'sdd update --check', 'npm run typecheck', 'npm test', 'npm run build', 'npm pack --dry-run --json', 'git status'],
115
- allowedSideEffects: ['read project status', 'read SDD documents and run evidence', 'write specs/<branch>/release.md when not using --dry-run', 'run local validation commands'],
116
- forbiddenSideEffects: ['npm publish', 'git push', 'git tag', 'create GitHub release', 'force push', 'auto commit', 'skip failed gates', 'treat historical doctor debt as a release blocker unless it affects current run evidence'],
117
- nextSteps: ['Run sdd ship --branch <branch> --dry-run to inspect PASS/BLOCKED readiness without writing release docs.', 'If readiness output is acceptable, run sdd ship --branch <branch> to write specs/<branch>/release.md.', 'Use sdd statusline --branch <branch> for compact runtime/test/team/token/evidence health.', 'Run current-run health checks with sdd doctor fast --branch <branch>; use sdd doctor deep only for explicit historical audit.', 'Run npm run typecheck, npm test, npm run build, and npm pack --dry-run --json when preparing a real package release.', 'Report PASS/BLOCKED by readiness check, including exact failed commands and unresolved manual confirmations.', 'Stop before npm publish, git push, git tag, or external release creation unless the user explicitly approves that separate action.']
106
+ summary: 'Close ship readiness through agent-authored .sdd/runs/<branch>/ship/*.md evidence; optional release.md is ship-agent authored, not runtime-authored.',
107
+ requiredCommands: ['sdd status', 'sdd instructions ship --json', 'write .sdd/runs/<branch>/ship/ship-readiness-vN.md', 'write .sdd/runs/<branch>/ship/release-review-vN.md', 'write .sdd/runs/<branch>/ship/ship-manager-vN.md', 'write .sdd/runs/<branch>/ship/ship-collaboration-contract-vN.md', 'sdd ship close --branch <branch> --json', 'npm run build', 'npm pack --dry-run --json', 'git status'],
108
+ allowedSideEffects: ['read project status', 'read SDD documents and run evidence', 'write agent-authored .sdd/runs/<branch>/ship/*.md evidence', 'write optional agent-authored specs/<branch>/release.md', 'run local validation commands', 'record runtime ship projections in .sdd/runtime.sqlite'],
109
+ forbiddenSideEffects: ['runtime-authored Markdown artifacts', 'npm publish', 'git push', 'git tag', 'create GitHub release', 'force push', 'auto commit', 'skip failed gates', 'treat historical doctor debt as a release blocker unless it affects current run evidence'],
110
+ nextSteps: ['Run sdd status and confirm goal-verify has recorded aligned truthAlignment or validated reconciliation truth.', 'Have ship-manager/release agent author .sdd/runs/<branch>/ship/*.md evidence including a StageCollaborationContract; write specs/<branch>/release.md only as an explicit ship-agent artifact if needed.', 'Run sdd ship close --branch <branch> --json; runtime validates readiness refs/contracts/truthAlignment and writes only .sdd/runtime.sqlite.', 'Run package/build dry-run gates when preparing a real release.', 'Report PASS/BLOCKED by runtime ship readiness and local package checks.', 'Stop before npm publish, git push, git tag, or external release creation unless the user explicitly approves that separate action.']
118
111
  },
119
112
  'run-task': {
120
- summary: 'Run the ingestion-aware task workflow using CLI/core runtime state and artifacts.',
121
- requiredCommands: ['sdd tasks inspect <task_id>', 'sdd do task <task_id>'],
122
- allowedSideEffects: ['write branch-scoped .sdd/runs evidence artifacts', 'update runtime.sqlite run state'],
123
- forbiddenSideEffects: ['background write', 'worktree creation', 'auto commit'],
124
- nextSteps: ['Inspect the task.', 'Run the task loop with explicit artifacts and validation evidence.']
113
+ summary: 'Compatibility entry for running one task through do-stage runtime closure.',
114
+ requiredCommands: ['sdd tasks inspect <task_id>', 'sdd do task <task_id> --branch <branch>'],
115
+ allowedSideEffects: ['write agent-authored .sdd/runs/<branch>/do/*.md evidence', 'update runtime.sqlite run state'],
116
+ forbiddenSideEffects: ['runtime-authored Markdown artifacts', 'background write', 'worktree creation', 'auto commit'],
117
+ nextSteps: ['Inspect the task.', 'Run do-stage closure through sdd do task with .sdd/runs/<branch>/do/*.md evidence.']
125
118
  },
126
119
  'verify-task': {
127
- summary: 'Verify task acceptance coverage using CLI/core verifier artifacts and partition-aware run resolution.',
120
+ summary: 'Verify task acceptance coverage using runtime-selected evidence and partition-aware run resolution.',
128
121
  requiredCommands: ['sdd verify task <task_id> [--branch <branch>] [--run <run_id>]'],
129
- allowedSideEffects: ['write acceptance coverage artifact', 'update .sdd run state'],
130
- forbiddenSideEffects: ['auto commit', 'force push', 'unapproved sync-back apply'],
131
- nextSteps: ['Run goal-level verify without --run for the latest eligible partition/task run, unless inspecting an explicit run.', 'Use sdd test task for primary lifecycle judgment; use sync-back only for explicit diagnostic/recovery/replay.']
122
+ allowedSideEffects: ['write acceptance coverage runtime evidence', 'update .sdd run state'],
123
+ forbiddenSideEffects: ['auto commit', 'force push'],
124
+ nextSteps: ['Run goal-level verify without --run for the latest eligible partition/task run, unless inspecting an explicit run.', 'Use sdd test task for primary lifecycle judgment.']
132
125
  }
133
126
  };
134
127
 
@@ -161,5 +154,5 @@ export function renderSddInstructions(payload: SddInstructionPayload): string {
161
154
  }
162
155
 
163
156
  function isInstructionAction(action: string): action is InstructionAction {
164
- return action === 'overview' || action === 'init' || action === 'doctor' || action === 'update' || action === 'spec' || action === 'plan' || action === 'tasks' || action === 'verifies' || action === 'test' || action === 'do' || action === 'verify' || action === 'sync-back' || action === 'ship' || action === 'run-task' || action === 'verify-task';
157
+ return action === 'overview' || action === 'init' || action === 'doctor' || action === 'update' || action === 'spec' || action === 'plan' || action === 'tasks' || action === 'verifies' || action === 'test' || action === 'do' || action === 'verify' || action === 'ship' || action === 'run-task' || action === 'verify-task';
165
158
  }
@@ -54,7 +54,7 @@ test('lifecycle hard gates force full profile for contract and state risks', ()
54
54
  assert.equal(result.record.decision.profile, 'full');
55
55
  assert.equal(result.record.decision.hard_gate_hits.includes('api_schema_contract'), true);
56
56
  assert.equal(result.record.decision.hard_gate_hits.includes('state_machine_concurrency_liveness'), true);
57
- assert.equal(result.record.decision.required_stages.includes('verify'), true);
57
+ assert.equal(result.record.decision.required_stages.includes('test'), true);
58
58
  });
59
59
 
60
60
  test('lifecycle database risk forces full hard gate and human checkpoint', () => {
@@ -322,7 +322,7 @@ function requiredStagesForProfile(profile: LifecycleProfile): string[] {
322
322
  return ['intent-or-mini-spec', 'task-boundary', 'implement', 'validation'];
323
323
  }
324
324
  if (profile === 'full') {
325
- return ['spec', 'plan', 'tasks', 'do', 'verify', 'sync-back-proposal'];
325
+ return ['spec', 'plan', 'tasks', 'verifies', 'do', 'test', 'goal-verify', 'ship'];
326
326
  }
327
327
  return ['research', 'options', 'decision', 'architecture-artifact', 'implementation-spec'];
328
328
  }