specdojo 0.1.0 → 0.2.0

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 (531) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +82 -38
  3. package/dist/agent-response.js +27 -0
  4. package/dist/agent.js +124 -0
  5. package/dist/build-command.js +149 -0
  6. package/dist/build-if-stale.js +35 -0
  7. package/dist/catalog-build.js +1079 -0
  8. package/dist/catalog-generate.js +226 -0
  9. package/dist/catalog-paths.js +31 -0
  10. package/dist/catalog-plan-generate.js +301 -0
  11. package/dist/catalog-plan-prompt.js +73 -0
  12. package/dist/catalog-plan.js +471 -0
  13. package/dist/catalog-scaffold.js +255 -0
  14. package/dist/catalog-types.js +4 -0
  15. package/dist/catalog.js +606 -0
  16. package/dist/dashboard.js +980 -0
  17. package/dist/deliverable-trash.js +148 -0
  18. package/dist/deliverable.js +97 -0
  19. package/dist/dist-freshness.js +150 -0
  20. package/dist/doc-index.js +424 -0
  21. package/dist/exec-agent-config.js +172 -0
  22. package/dist/exec-agent-git-state.js +136 -0
  23. package/dist/exec-agent-protected-config.js +276 -0
  24. package/dist/exec-events.js +250 -112
  25. package/dist/exec-evidence.js +317 -0
  26. package/dist/exec-format.js +45 -0
  27. package/dist/exec-limit.js +202 -0
  28. package/dist/exec-parent-validation.js +169 -0
  29. package/dist/exec-pipeline-state.js +160 -0
  30. package/dist/exec-plans.js +1016 -0
  31. package/dist/exec-project.js +25 -11
  32. package/dist/exec-protection-handoff.js +169 -0
  33. package/dist/exec-provider-scaffold.js +99 -0
  34. package/dist/exec-register-resume.js +196 -0
  35. package/dist/exec-register.js +281 -0
  36. package/dist/exec-reporter.js +329 -0
  37. package/dist/exec-results.js +510 -0
  38. package/dist/exec-run-lock.js +149 -0
  39. package/dist/exec-run.js +4953 -0
  40. package/dist/exec-schedule-calendar.js +86 -9
  41. package/dist/exec-schedule-cpm.js +30 -12
  42. package/dist/exec-schedule-gantt-chart-render.js +428 -0
  43. package/dist/exec-schedule-gantt-chart-scope.js +111 -0
  44. package/dist/exec-schedule-gantt-chart.js +2 -0
  45. package/dist/exec-schedule-hash.js +34 -25
  46. package/dist/exec-schedule-index.js +200 -67
  47. package/dist/exec-schedule-initial.js +100 -0
  48. package/dist/exec-schedule-progress.js +51 -26
  49. package/dist/exec-schedule-ready.js +71 -27
  50. package/dist/exec-schedule.js +171 -93
  51. package/dist/exec-shared.js +146 -25
  52. package/dist/exec-strategy.js +547 -0
  53. package/dist/exec-task-view.js +64 -0
  54. package/dist/exec-trial.js +895 -0
  55. package/dist/exec-worktree-command.js +426 -0
  56. package/dist/exec-worktree-ops.js +847 -0
  57. package/dist/exec-worktree.js +359 -0
  58. package/dist/exec.js +744 -192
  59. package/dist/frontmatter-namespace.js +48 -0
  60. package/dist/git-environment.js +23 -0
  61. package/dist/grade-result.js +137 -0
  62. package/dist/grade.js +2456 -0
  63. package/dist/index-command.js +103 -0
  64. package/dist/job.js +1081 -0
  65. package/dist/kata-command.js +303 -0
  66. package/dist/kata.js +187 -0
  67. package/dist/package-paths.js +15 -0
  68. package/dist/practice-id.js +24 -0
  69. package/dist/register-date.js +122 -0
  70. package/dist/register-events.js +363 -0
  71. package/dist/register-history.js +323 -0
  72. package/dist/register-item.js +455 -0
  73. package/dist/register-migrate-timestamps.js +176 -0
  74. package/dist/register.js +2199 -0
  75. package/dist/review-plan.js +199 -0
  76. package/dist/review-types.js +1 -0
  77. package/dist/role-types.js +1 -0
  78. package/dist/routine.js +814 -0
  79. package/dist/schedule-approach.js +252 -0
  80. package/dist/schedule-build.js +552 -0
  81. package/dist/schedule-phase-sets.js +73 -0
  82. package/dist/schedule-strategy-generate.js +812 -0
  83. package/dist/schedule-strategy-profiles.js +276 -0
  84. package/dist/schedule.js +420 -0
  85. package/dist/spawn-self.js +28 -0
  86. package/dist/specdojo-config.js +133 -39
  87. package/dist/specdojo.js +55 -7
  88. package/dist/template-frontmatter.js +89 -0
  89. package/dist/template-resolution.js +92 -0
  90. package/dist/timeline-build.js +334 -0
  91. package/dist/timeline.js +107 -0
  92. package/dist/watch.js +313 -0
  93. package/dist/yaml-pages-command.js +28 -0
  94. package/dist/yaml-pages.js +180 -0
  95. package/dist/yaml-schema-modeline.js +49 -0
  96. package/docs/ja/specdojo/defaults/pm-review-viewpoints.yaml +600 -0
  97. package/docs/ja/specdojo/exec-templates/xep-bootstrap-template.md +120 -0
  98. package/docs/ja/specdojo/exec-templates/xep-common-conventions-template.md +37 -0
  99. package/docs/ja/specdojo/exec-templates/xep-cross-deliverable-dedup-template.md +51 -0
  100. package/docs/ja/specdojo/exec-templates/xep-freeform-template.md +74 -0
  101. package/docs/ja/specdojo/exec-templates/xep-fully-guided-template.md +109 -0
  102. package/docs/ja/specdojo/exec-templates/xep-job-template.md +43 -0
  103. package/docs/ja/specdojo/exec-templates/xep-recipe-guided-template.md +82 -0
  104. package/docs/ja/specdojo/exec-templates/xep-recipe-maintenance-template.md +86 -0
  105. package/docs/ja/specdojo/exec-templates/xep-register-investigate-template.md +42 -0
  106. package/docs/ja/specdojo/exec-templates/xep-register-template.md +49 -0
  107. package/docs/ja/specdojo/exec-templates/xep-retrofit-template.md +98 -0
  108. package/docs/ja/specdojo/exec-templates/xep-rulebook-maintenance-template.md +86 -0
  109. package/docs/ja/specdojo/exec-templates/xep-sample-maintenance-template.md +86 -0
  110. package/docs/ja/specdojo/exec-templates/xep-template-maintenance-template.md +86 -0
  111. package/docs/ja/specdojo/exec-templates/xep-template.md +66 -0
  112. package/docs/ja/specdojo/exec-templates/xer-cross-deliverable-dedup-template.md +31 -0
  113. package/docs/ja/specdojo/exec-templates/xer-human-bootstrap-finalize-template.md +40 -0
  114. package/docs/ja/specdojo/exec-templates/xer-human-finalize-template.md +30 -0
  115. package/docs/ja/specdojo/exec-templates/xer-template.md +19 -0
  116. package/docs/ja/specdojo/exec-templates/xrp-freeform-template.md +70 -0
  117. package/docs/ja/specdojo/exec-templates/xrp-fully-guided-template.md +97 -0
  118. package/docs/ja/specdojo/exec-templates/xrp-recipe-guided-template.md +76 -0
  119. package/docs/ja/specdojo/exec-templates/xrp-recipe-maintenance-template.md +73 -0
  120. package/docs/ja/specdojo/exec-templates/xrp-retrofit-template.md +74 -0
  121. package/docs/ja/specdojo/exec-templates/xrp-rulebook-maintenance-template.md +74 -0
  122. package/docs/ja/specdojo/exec-templates/xrp-sample-maintenance-template.md +73 -0
  123. package/docs/ja/specdojo/exec-templates/xrp-template-maintenance-template.md +73 -0
  124. package/docs/ja/specdojo/exec-templates/xrp-template.md +67 -0
  125. package/docs/ja/specdojo/exec-templates/xrp-viewpoint-detail-template.md +7 -0
  126. package/docs/ja/specdojo/exec-templates/xrr-template.md +21 -0
  127. package/docs/ja/specdojo/exec-templates/xrr-viewpoint-detail-template.md +7 -0
  128. package/docs/ja/specdojo/guides/branch-workflow-guide.md +354 -0
  129. package/docs/ja/specdojo/guides/docs-editing-guide.md +327 -0
  130. package/docs/ja/specdojo/guides/docs-structure-guide.md +519 -0
  131. package/docs/ja/specdojo/guides/exec-config-guide.md +589 -0
  132. package/docs/ja/specdojo/guides/exec-operation-guide.md +440 -0
  133. package/docs/ja/specdojo/guides/exec-worktree-guide.md +318 -0
  134. package/docs/ja/specdojo/guides/kata-guide.md +89 -0
  135. package/docs/ja/specdojo/guides/orchestrator-operation-guide.md +127 -0
  136. package/docs/ja/specdojo/guides/plan-result-lifecycle-guide.md +228 -0
  137. package/docs/ja/specdojo/guides/practice-system-composition-guide.md +111 -0
  138. package/docs/ja/specdojo/guides/quick-start-guide.md +473 -0
  139. package/docs/ja/specdojo/guides/register-operation-guide.md +418 -0
  140. package/docs/ja/specdojo/guides/review-guide.md +428 -0
  141. package/docs/ja/specdojo/guides/routine-operation-guide.md +282 -0
  142. package/docs/ja/specdojo/guides/ryu-guide.md +230 -0
  143. package/docs/ja/specdojo/guides/schedule-design-guide.md +429 -0
  144. package/docs/ja/specdojo/guides/schedule-operation-guide.md +151 -0
  145. package/docs/ja/specdojo/guides/specdojo-overview-guide.md +257 -0
  146. package/docs/ja/specdojo/guides/timeline-design-guide.md +160 -0
  147. package/docs/ja/specdojo/guides/track-design-guide.md +215 -0
  148. package/docs/ja/specdojo/guides/use-case-guide.md +133 -0
  149. package/docs/ja/specdojo/guides/waza-guide.md +224 -0
  150. package/docs/ja/specdojo/index.md +33 -0
  151. package/docs/ja/specdojo/philosophy/needs-to-implementation-philosophy.md +212 -0
  152. package/docs/ja/specdojo/philosophy/specdojo-philosophy.md +242 -0
  153. package/docs/ja/specdojo/recipes/cdfd-overview-recipe.md +198 -0
  154. package/docs/ja/specdojo/recipes/cdfd-recipe.md +218 -0
  155. package/docs/ja/specdojo/recipes/cdfd-uc-recipe.md +198 -0
  156. package/docs/ja/specdojo/recipes/exec-human-finalize-recipe.md +100 -0
  157. package/docs/ja/specdojo/recipes/ifx-cmd-recipe.md +148 -0
  158. package/docs/ja/specdojo/recipes/pm-communication-plan-recipe.md +97 -0
  159. package/docs/ja/specdojo/recipes/pm-members-recipe.md +149 -0
  160. package/docs/ja/specdojo/recipes/pm-organization-recipe.md +96 -0
  161. package/docs/ja/specdojo/recipes/pm-plan-recipe.md +98 -0
  162. package/docs/ja/specdojo/recipes/pm-quality-management-plan-recipe.md +97 -0
  163. package/docs/ja/specdojo/recipes/pm-raci-recipe.md +96 -0
  164. package/docs/ja/specdojo/recipes/pm-roles-recipe.md +136 -0
  165. package/docs/ja/specdojo/recipes/prj-assumptions-constraints-dependencies-recipe.md +162 -0
  166. package/docs/ja/specdojo/recipes/prj-charter-recipe.md +187 -0
  167. package/docs/ja/specdojo/recipes/prj-comparison-of-alternatives-recipe.md +235 -0
  168. package/docs/ja/specdojo/recipes/prj-issues-and-approach-recipe.md +205 -0
  169. package/docs/ja/specdojo/recipes/prj-overview-recipe.md +289 -0
  170. package/docs/ja/specdojo/recipes/prj-scope-recipe.md +201 -0
  171. package/docs/ja/specdojo/recipes/prj-stakeholder-register-recipe.md +168 -0
  172. package/docs/ja/specdojo/recipes/prj-success-criteria-and-acceptance-criteria-recipe.md +179 -0
  173. package/docs/ja/specdojo/recipes/stsd-recipe.md +138 -0
  174. package/docs/ja/specdojo/references/command-reference.md +718 -0
  175. package/docs/ja/specdojo/references/deliverables-reference.md +407 -0
  176. package/docs/ja/specdojo/references/directory-layout-reference.md +280 -0
  177. package/docs/ja/specdojo/references/specdojo-config-reference.md +133 -0
  178. package/docs/ja/specdojo/rulebooks/atc-index-rulebook.md +372 -0
  179. package/docs/ja/specdojo/rulebooks/atc-rulebook.md +302 -0
  180. package/docs/ja/specdojo/rulebooks/bac-rulebook.md +331 -0
  181. package/docs/ja/specdojo/rulebooks/bdd-rulebook.md +134 -0
  182. package/docs/ja/specdojo/rulebooks/bds-rulebook.md +207 -0
  183. package/docs/ja/specdojo/rulebooks/bes-index-rulebook.md +102 -0
  184. package/docs/ja/specdojo/rulebooks/bes-rulebook.md +131 -0
  185. package/docs/ja/specdojo/rulebooks/bps-rulebook.md +269 -0
  186. package/docs/ja/specdojo/rulebooks/br-rulebook.md +187 -0
  187. package/docs/ja/specdojo/rulebooks/ccd-mermaid-rulebook.md +279 -0
  188. package/docs/ja/specdojo/rulebooks/cdfd-mermaid-rulebook.md +219 -0
  189. package/docs/ja/specdojo/rulebooks/cdfd-overview-rulebook.md +233 -0
  190. package/docs/ja/specdojo/rulebooks/cdfd-rulebook.md +182 -0
  191. package/docs/ja/specdojo/rulebooks/cdfd-uc-rulebook.md +171 -0
  192. package/docs/ja/specdojo/rulebooks/cdsd-rulebook.md +105 -0
  193. package/docs/ja/specdojo/rulebooks/cld-rulebook.md +195 -0
  194. package/docs/ja/specdojo/rulebooks/cnd-mermaid-rulebook.md +285 -0
  195. package/docs/ja/specdojo/rulebooks/cnd-rulebook.md +292 -0
  196. package/docs/ja/specdojo/rulebooks/cop-index-rulebook.md +171 -0
  197. package/docs/ja/specdojo/rulebooks/cop-rulebook.md +325 -0
  198. package/docs/ja/specdojo/rulebooks/cpd-mermaid-rulebook.md +266 -0
  199. package/docs/ja/specdojo/rulebooks/cpd-rulebook.md +294 -0
  200. package/docs/ja/specdojo/rulebooks/cstd-rulebook.md +21 -0
  201. package/docs/ja/specdojo/rulebooks/cxd-mermaid-rulebook.md +401 -0
  202. package/docs/ja/specdojo/rulebooks/cxd-rulebook.md +311 -0
  203. package/docs/ja/specdojo/rulebooks/dct-index-rulebook.md +158 -0
  204. package/docs/ja/specdojo/rulebooks/dct-rulebook.md +287 -0
  205. package/docs/ja/specdojo/rulebooks/dec-rulebook.md +62 -0
  206. package/docs/ja/specdojo/rulebooks/dmd-index-rulebook.md +100 -0
  207. package/docs/ja/specdojo/rulebooks/dmd-rulebook.md +298 -0
  208. package/docs/ja/specdojo/rulebooks/etc-index-rulebook.md +379 -0
  209. package/docs/ja/specdojo/rulebooks/etc-rulebook.md +310 -0
  210. package/docs/ja/specdojo/rulebooks/gl-rulebook.md +86 -0
  211. package/docs/ja/specdojo/rulebooks/ifd-mermaid-rulebook.md +297 -0
  212. package/docs/ja/specdojo/rulebooks/ifx-api-rulebook.md +79 -0
  213. package/docs/ja/specdojo/rulebooks/ifx-cmd-rulebook.md +213 -0
  214. package/docs/ja/specdojo/rulebooks/ifx-file-rulebook.md +311 -0
  215. package/docs/ja/specdojo/rulebooks/ifx-index-rulebook.md +94 -0
  216. package/docs/ja/specdojo/rulebooks/ifx-msg-rulebook.md +81 -0
  217. package/docs/ja/specdojo/rulebooks/imp-business-rulebook.md +117 -0
  218. package/docs/ja/specdojo/rulebooks/imp-data-rulebook.md +118 -0
  219. package/docs/ja/specdojo/rulebooks/imp-interface-rulebook.md +116 -0
  220. package/docs/ja/specdojo/rulebooks/imp-operations-rulebook.md +116 -0
  221. package/docs/ja/specdojo/rulebooks/imp-test-rulebook.md +116 -0
  222. package/docs/ja/specdojo/rulebooks/itc-index-rulebook.md +421 -0
  223. package/docs/ja/specdojo/rulebooks/itc-rulebook.md +307 -0
  224. package/docs/ja/specdojo/rulebooks/mip-index-rulebook.md +312 -0
  225. package/docs/ja/specdojo/rulebooks/mm-rulebook.md +63 -0
  226. package/docs/ja/specdojo/rulebooks/mtp-rulebook.md +353 -0
  227. package/docs/ja/specdojo/rulebooks/nfr-availability-rulebook.md +184 -0
  228. package/docs/ja/specdojo/rulebooks/nfr-index-rulebook.md +179 -0
  229. package/docs/ja/specdojo/rulebooks/nfr-integrity-rulebook.md +184 -0
  230. package/docs/ja/specdojo/rulebooks/nfr-maintainability-rulebook.md +183 -0
  231. package/docs/ja/specdojo/rulebooks/nfr-operations-rulebook.md +185 -0
  232. package/docs/ja/specdojo/rulebooks/nfr-performance-rulebook.md +185 -0
  233. package/docs/ja/specdojo/rulebooks/nfr-reliability-rulebook.md +186 -0
  234. package/docs/ja/specdojo/rulebooks/nfr-security-safety-rulebook.md +186 -0
  235. package/docs/ja/specdojo/rulebooks/nfr-usability-rulebook.md +184 -0
  236. package/docs/ja/specdojo/rulebooks/ntp-rulebook.md +61 -0
  237. package/docs/ja/specdojo/rulebooks/opd-index-rulebook.md +84 -0
  238. package/docs/ja/specdojo/rulebooks/opd-rulebook.md +357 -0
  239. package/docs/ja/specdojo/rulebooks/opr-index-rulebook.md +80 -0
  240. package/docs/ja/specdojo/rulebooks/opr-rulebook.md +484 -0
  241. package/docs/ja/specdojo/rulebooks/otp-index-rulebook.md +120 -0
  242. package/docs/ja/specdojo/rulebooks/otp-rulebook.md +293 -0
  243. package/docs/ja/specdojo/rulebooks/pjr-rulebook.md +211 -0
  244. package/docs/ja/specdojo/rulebooks/pm-change-request-log-rulebook.md +94 -0
  245. package/docs/ja/specdojo/rulebooks/pm-communication-plan-rulebook.md +116 -0
  246. package/docs/ja/specdojo/rulebooks/pm-issue-log-rulebook.md +93 -0
  247. package/docs/ja/specdojo/rulebooks/pm-members-rulebook.md +190 -0
  248. package/docs/ja/specdojo/rulebooks/pm-organization-rulebook.md +108 -0
  249. package/docs/ja/specdojo/rulebooks/pm-plan-rulebook.md +122 -0
  250. package/docs/ja/specdojo/rulebooks/pm-quality-management-plan-rulebook.md +117 -0
  251. package/docs/ja/specdojo/rulebooks/pm-raci-rulebook.md +116 -0
  252. package/docs/ja/specdojo/rulebooks/pm-risk-register-rulebook.md +93 -0
  253. package/docs/ja/specdojo/rulebooks/pm-roles-rulebook.md +146 -0
  254. package/docs/ja/specdojo/rulebooks/pr-rulebook.md +65 -0
  255. package/docs/ja/specdojo/rulebooks/prj-assumptions-constraints-dependencies-rulebook.md +178 -0
  256. package/docs/ja/specdojo/rulebooks/prj-charter-rulebook.md +232 -0
  257. package/docs/ja/specdojo/rulebooks/prj-comparison-of-alternatives-rulebook.md +235 -0
  258. package/docs/ja/specdojo/rulebooks/prj-issues-and-approach-rulebook.md +242 -0
  259. package/docs/ja/specdojo/rulebooks/prj-overview-rulebook.md +187 -0
  260. package/docs/ja/specdojo/rulebooks/prj-scope-rulebook.md +201 -0
  261. package/docs/ja/specdojo/rulebooks/prj-stakeholder-register-rulebook.md +165 -0
  262. package/docs/ja/specdojo/rulebooks/prj-success-criteria-and-acceptance-criteria-rulebook.md +165 -0
  263. package/docs/ja/specdojo/rulebooks/sac-rulebook.md +202 -0
  264. package/docs/ja/specdojo/rulebooks/sch-rulebook.md +139 -0
  265. package/docs/ja/specdojo/rulebooks/sf-index-rulebook.md +63 -0
  266. package/docs/ja/specdojo/rulebooks/sf-rulebook.md +93 -0
  267. package/docs/ja/specdojo/rulebooks/sld-rulebook.md +93 -0
  268. package/docs/ja/specdojo/rulebooks/stc-index-rulebook.md +329 -0
  269. package/docs/ja/specdojo/rulebooks/stc-rulebook.md +297 -0
  270. package/docs/ja/specdojo/rulebooks/stsd-mermaid-rulebook.md +132 -0
  271. package/docs/ja/specdojo/rulebooks/stsd-rulebook.md +215 -0
  272. package/docs/ja/specdojo/rulebooks/sysd-critical-flows-rulebook.md +376 -0
  273. package/docs/ja/specdojo/rulebooks/sysd-cross-cutting-policy-rulebook.md +313 -0
  274. package/docs/ja/specdojo/rulebooks/sysd-index-rulebook.md +246 -0
  275. package/docs/ja/specdojo/rulebooks/sysd-rulebook.md +119 -0
  276. package/docs/ja/specdojo/rulebooks/tml-rulebook.md +188 -0
  277. package/docs/ja/specdojo/rulebooks/trc-requirements-to-specs-rulebook.md +114 -0
  278. package/docs/ja/specdojo/rulebooks/trc-requirements-to-tests-rulebook.md +117 -0
  279. package/docs/ja/specdojo/rulebooks/tsd-index-rulebook.md +101 -0
  280. package/docs/ja/specdojo/rulebooks/tsd-rulebook.md +103 -0
  281. package/docs/ja/specdojo/rulebooks/tsp-index-rulebook.md +396 -0
  282. package/docs/ja/specdojo/rulebooks/uis-rulebook.md +207 -0
  283. package/docs/ja/specdojo/rulebooks/utc-index-rulebook.md +387 -0
  284. package/docs/ja/specdojo/rulebooks/utc-rulebook.md +303 -0
  285. package/docs/ja/specdojo/samples/atc-index-sample.md +38 -0
  286. package/docs/ja/specdojo/samples/atc-sample.md +41 -0
  287. package/docs/ja/specdojo/samples/bac-sample.md +38 -0
  288. package/docs/ja/specdojo/samples/bdd-sample.yaml +71 -0
  289. package/docs/ja/specdojo/samples/bds-sample.md +38 -0
  290. package/docs/ja/specdojo/samples/bes-index-sample.md +38 -0
  291. package/docs/ja/specdojo/samples/bes-sample.md +38 -0
  292. package/docs/ja/specdojo/samples/bps-sample.md +38 -0
  293. package/docs/ja/specdojo/samples/br-sample.md +40 -0
  294. package/docs/ja/specdojo/samples/ccd-sample.md +38 -0
  295. package/docs/ja/specdojo/samples/cdfd-overview-sample.md +284 -0
  296. package/docs/ja/specdojo/samples/cdfd-sample.md +229 -0
  297. package/docs/ja/specdojo/samples/cdfd-uc-sample.md +146 -0
  298. package/docs/ja/specdojo/samples/cdsd-sample.md +38 -0
  299. package/docs/ja/specdojo/samples/cld-sample.md +38 -0
  300. package/docs/ja/specdojo/samples/cnd-sample.md +38 -0
  301. package/docs/ja/specdojo/samples/cop-index-sample.md +38 -0
  302. package/docs/ja/specdojo/samples/cop-sample.md +38 -0
  303. package/docs/ja/specdojo/samples/cpd-sample.md +38 -0
  304. package/docs/ja/specdojo/samples/cstd-sample.md +11 -0
  305. package/docs/ja/specdojo/samples/cxd-sample.md +38 -0
  306. package/docs/ja/specdojo/samples/dct-index-sample.yaml +39 -0
  307. package/docs/ja/specdojo/samples/dct-sample.yaml +91 -0
  308. package/docs/ja/specdojo/samples/dec-sample.md +39 -0
  309. package/docs/ja/specdojo/samples/dmd-index-sample.md +50 -0
  310. package/docs/ja/specdojo/samples/dmd-sample.md +74 -0
  311. package/docs/ja/specdojo/samples/etc-index-sample.md +38 -0
  312. package/docs/ja/specdojo/samples/etc-sample.md +38 -0
  313. package/docs/ja/specdojo/samples/gl-sample.yaml +37 -0
  314. package/docs/ja/specdojo/samples/ifd-sample.md +38 -0
  315. package/docs/ja/specdojo/samples/ifx-api-sample.yaml +102 -0
  316. package/docs/ja/specdojo/samples/ifx-cmd-sample.yaml +107 -0
  317. package/docs/ja/specdojo/samples/ifx-file-sample.md +38 -0
  318. package/docs/ja/specdojo/samples/ifx-msg-sample.yaml +89 -0
  319. package/docs/ja/specdojo/samples/imp-business-sample.md +66 -0
  320. package/docs/ja/specdojo/samples/imp-data-sample.md +60 -0
  321. package/docs/ja/specdojo/samples/imp-interface-sample.md +60 -0
  322. package/docs/ja/specdojo/samples/imp-operations-sample.md +60 -0
  323. package/docs/ja/specdojo/samples/imp-test-sample.md +60 -0
  324. package/docs/ja/specdojo/samples/itc-index-sample.md +38 -0
  325. package/docs/ja/specdojo/samples/itc-sample.md +38 -0
  326. package/docs/ja/specdojo/samples/mip-index-sample.md +38 -0
  327. package/docs/ja/specdojo/samples/mm-sample.md +35 -0
  328. package/docs/ja/specdojo/samples/mtp-sample.md +38 -0
  329. package/docs/ja/specdojo/samples/nfr-availability-sample.md +38 -0
  330. package/docs/ja/specdojo/samples/nfr-index-sample.md +38 -0
  331. package/docs/ja/specdojo/samples/nfr-integrity-sample.md +38 -0
  332. package/docs/ja/specdojo/samples/nfr-maintainability-sample.md +38 -0
  333. package/docs/ja/specdojo/samples/nfr-operations-sample.md +38 -0
  334. package/docs/ja/specdojo/samples/nfr-performance-sample.md +38 -0
  335. package/docs/ja/specdojo/samples/nfr-reliability-sample.md +38 -0
  336. package/docs/ja/specdojo/samples/nfr-security-safety-sample.md +38 -0
  337. package/docs/ja/specdojo/samples/nfr-usability-sample.md +38 -0
  338. package/docs/ja/specdojo/samples/ntp-sample.md +38 -0
  339. package/docs/ja/specdojo/samples/opd-access-control-sample.md +29 -0
  340. package/docs/ja/specdojo/samples/opd-incident-management-sample.md +31 -0
  341. package/docs/ja/specdojo/samples/opd-index-sample.md +41 -0
  342. package/docs/ja/specdojo/samples/opd-monitoring-sample.md +32 -0
  343. package/docs/ja/specdojo/samples/opd-sample.md +38 -0
  344. package/docs/ja/specdojo/samples/opr-access-control-sample.md +24 -0
  345. package/docs/ja/specdojo/samples/opr-backup-restore-sample.md +27 -0
  346. package/docs/ja/specdojo/samples/opr-batch-sample.md +23 -0
  347. package/docs/ja/specdojo/samples/opr-change-sample.md +24 -0
  348. package/docs/ja/specdojo/samples/opr-incident-sample.md +38 -0
  349. package/docs/ja/specdojo/samples/opr-index-sample.md +43 -0
  350. package/docs/ja/specdojo/samples/opr-monitoring-sample.md +27 -0
  351. package/docs/ja/specdojo/samples/opr-sample.md +38 -0
  352. package/docs/ja/specdojo/samples/opr-support-sample.md +23 -0
  353. package/docs/ja/specdojo/samples/otp-index-sample.md +66 -0
  354. package/docs/ja/specdojo/samples/otp-sample.md +68 -0
  355. package/docs/ja/specdojo/samples/pm-change-request-log-sample.md +47 -0
  356. package/docs/ja/specdojo/samples/pm-communication-plan-sample.md +46 -0
  357. package/docs/ja/specdojo/samples/pm-issue-log-sample.md +45 -0
  358. package/docs/ja/specdojo/samples/pm-members-sample.yaml +103 -0
  359. package/docs/ja/specdojo/samples/pm-organization-sample.md +46 -0
  360. package/docs/ja/specdojo/samples/pm-plan-sample.md +57 -0
  361. package/docs/ja/specdojo/samples/pm-quality-management-plan-sample.md +52 -0
  362. package/docs/ja/specdojo/samples/pm-raci-sample.md +57 -0
  363. package/docs/ja/specdojo/samples/pm-risk-register-sample.md +43 -0
  364. package/docs/ja/specdojo/samples/pm-roles-sample.yaml +41 -0
  365. package/docs/ja/specdojo/samples/pr-sample.md +39 -0
  366. package/docs/ja/specdojo/samples/prj-assumptions-constraints-dependencies-sample.md +57 -0
  367. package/docs/ja/specdojo/samples/prj-charter-sample.md +121 -0
  368. package/docs/ja/specdojo/samples/prj-comparison-of-alternatives-sample.md +105 -0
  369. package/docs/ja/specdojo/samples/prj-issues-and-approach-sample.md +78 -0
  370. package/docs/ja/specdojo/samples/prj-overview-sample.md +95 -0
  371. package/docs/ja/specdojo/samples/prj-scope-sample.md +71 -0
  372. package/docs/ja/specdojo/samples/prj-stakeholder-register-sample.md +60 -0
  373. package/docs/ja/specdojo/samples/prj-success-criteria-and-acceptance-criteria-sample.md +62 -0
  374. package/docs/ja/specdojo/samples/sac-sample.md +38 -0
  375. package/docs/ja/specdojo/samples/sf-index-sample.md +38 -0
  376. package/docs/ja/specdojo/samples/sf-sample.md +38 -0
  377. package/docs/ja/specdojo/samples/sld-sample.md +38 -0
  378. package/docs/ja/specdojo/samples/stc-index-sample.md +38 -0
  379. package/docs/ja/specdojo/samples/stc-sample.md +38 -0
  380. package/docs/ja/specdojo/samples/stsd-sample.md +58 -0
  381. package/docs/ja/specdojo/samples/sysd-critical-flows-sample.md +38 -0
  382. package/docs/ja/specdojo/samples/sysd-cross-cutting-policy-sample.md +38 -0
  383. package/docs/ja/specdojo/samples/sysd-index-sample.md +38 -0
  384. package/docs/ja/specdojo/samples/trc-requirements-to-specs-sample.md +56 -0
  385. package/docs/ja/specdojo/samples/trc-requirements-to-tests-sample.md +56 -0
  386. package/docs/ja/specdojo/samples/tsd-index-sample.md +29 -0
  387. package/docs/ja/specdojo/samples/tsd-sample.md +38 -0
  388. package/docs/ja/specdojo/samples/tsp-index-sample.md +38 -0
  389. package/docs/ja/specdojo/samples/uis-sample.md +38 -0
  390. package/docs/ja/specdojo/samples/utc-index-sample.md +38 -0
  391. package/docs/ja/specdojo/samples/utc-sample.md +38 -0
  392. package/docs/ja/specdojo/schemas/v1/guide-content.schema.yaml +20 -0
  393. package/docs/ja/specdojo/schemas/v1/philosophy-content.schema.yaml +21 -0
  394. package/docs/ja/specdojo/schemas/v1/reference-content.schema.yaml +21 -0
  395. package/docs/ja/specdojo/standards/document-metadata-standard.md +323 -0
  396. package/docs/ja/specdojo/standards/exec-human-finalize-standard.md +75 -0
  397. package/docs/ja/specdojo/standards/git-branching-standard.md +227 -0
  398. package/docs/ja/specdojo/standards/guide-authoring-standard.md +124 -0
  399. package/docs/ja/specdojo/standards/id-and-file-naming-standard.md +929 -0
  400. package/docs/ja/specdojo/standards/job-definition-standard.md +148 -0
  401. package/docs/ja/specdojo/standards/people-and-organization-definition-standard.md +431 -0
  402. package/docs/ja/specdojo/standards/philosophy-authoring-standard.md +113 -0
  403. package/docs/ja/specdojo/standards/recipe-authoring-standard.md +143 -0
  404. package/docs/ja/specdojo/standards/reference-authoring-standard.md +99 -0
  405. package/docs/ja/specdojo/standards/rulebook-authoring-standard.md +140 -0
  406. package/docs/ja/specdojo/standards/sample-authoring-standard.md +151 -0
  407. package/docs/ja/specdojo/standards/standard-authoring-standard.md +108 -0
  408. package/docs/ja/specdojo/standards/template-authoring-standard.md +101 -0
  409. package/docs/ja/specdojo/standards/test-document-scope-standard.md +176 -0
  410. package/docs/ja/specdojo/templates/cdfd-overview-template.md +199 -0
  411. package/docs/ja/specdojo/templates/cdfd-template.md +173 -0
  412. package/docs/ja/specdojo/templates/cdfd-uc-template.md +148 -0
  413. package/docs/ja/specdojo/templates/dct-architecture-template.yaml +136 -0
  414. package/docs/ja/specdojo/templates/dct-business-acceptance-criteria-template.yaml +34 -0
  415. package/docs/ja/specdojo/templates/dct-business-model-bes-template.yaml +75 -0
  416. package/docs/ja/specdojo/templates/dct-business-model-bps-template.yaml +49 -0
  417. package/docs/ja/specdojo/templates/dct-business-model-br-template.yaml +50 -0
  418. package/docs/ja/specdojo/templates/dct-data-flow-template.yaml +40 -0
  419. package/docs/ja/specdojo/templates/dct-data-model-bdd-template.yaml +46 -0
  420. package/docs/ja/specdojo/templates/dct-data-model-ccd-template.yaml +46 -0
  421. package/docs/ja/specdojo/templates/dct-data-model-cdsd-template.yaml +41 -0
  422. package/docs/ja/specdojo/templates/dct-data-model-cld-template.yaml +38 -0
  423. package/docs/ja/specdojo/templates/dct-data-model-sld-template.yaml +38 -0
  424. package/docs/ja/specdojo/templates/dct-data-model-stsd-template.yaml +46 -0
  425. package/docs/ja/specdojo/templates/dct-external-interface-specs-template.yaml +114 -0
  426. package/docs/ja/specdojo/templates/dct-glossary-template.yaml +35 -0
  427. package/docs/ja/specdojo/templates/dct-impact-analysis-template.yaml +138 -0
  428. package/docs/ja/specdojo/templates/dct-index-template.md +40 -0
  429. package/docs/ja/specdojo/templates/dct-migration-planning-template.yaml +148 -0
  430. package/docs/ja/specdojo/templates/dct-non-functional-requirements-template.yaml +222 -0
  431. package/docs/ja/specdojo/templates/dct-operations-template.yaml +108 -0
  432. package/docs/ja/specdojo/templates/dct-project-definition-template.yaml +210 -0
  433. package/docs/ja/specdojo/templates/dct-project-management-template.yaml +423 -0
  434. package/docs/ja/specdojo/templates/dct-system-acceptance-criteria-template.yaml +37 -0
  435. package/docs/ja/specdojo/templates/dct-system-design-template.yaml +82 -0
  436. package/docs/ja/specdojo/templates/dct-system-functions-template.yaml +58 -0
  437. package/docs/ja/specdojo/templates/dct-test-specs-template.yaml +261 -0
  438. package/docs/ja/specdojo/templates/dct-user-interface-model-template.yaml +60 -0
  439. package/docs/ja/specdojo/templates/ifx-cmd-template.yaml +88 -0
  440. package/docs/ja/specdojo/templates/opr-template.md +85 -0
  441. package/docs/ja/specdojo/templates/pjr-change-request-template.md +60 -0
  442. package/docs/ja/specdojo/templates/pjr-decision-template.md +61 -0
  443. package/docs/ja/specdojo/templates/pjr-index-template.md +49 -0
  444. package/docs/ja/specdojo/templates/pjr-issue-template.md +50 -0
  445. package/docs/ja/specdojo/templates/pjr-note-template.md +35 -0
  446. package/docs/ja/specdojo/templates/pjr-question-template.md +53 -0
  447. package/docs/ja/specdojo/templates/pjr-risk-template.md +49 -0
  448. package/docs/ja/specdojo/templates/pjr-todo-template.md +41 -0
  449. package/docs/ja/specdojo/templates/pjr-views-by-owner-template.md +22 -0
  450. package/docs/ja/specdojo/templates/pjr-views-by-priority-template.md +22 -0
  451. package/docs/ja/specdojo/templates/pjr-views-by-status-template.md +22 -0
  452. package/docs/ja/specdojo/templates/pm-change-request-log-template.md +20 -0
  453. package/docs/ja/specdojo/templates/pm-communication-plan-template.md +46 -0
  454. package/docs/ja/specdojo/templates/pm-decision-log-template.md +20 -0
  455. package/docs/ja/specdojo/templates/pm-issue-log-template.md +20 -0
  456. package/docs/ja/specdojo/templates/pm-members-template.yaml +105 -0
  457. package/docs/ja/specdojo/templates/pm-organization-template.md +44 -0
  458. package/docs/ja/specdojo/templates/pm-plan-template.md +52 -0
  459. package/docs/ja/specdojo/templates/pm-quality-management-plan-template.md +46 -0
  460. package/docs/ja/specdojo/templates/pm-raci-template.md +51 -0
  461. package/docs/ja/specdojo/templates/pm-risk-register-template.md +20 -0
  462. package/docs/ja/specdojo/templates/pm-roles-template.yaml +53 -0
  463. package/docs/ja/specdojo/templates/prj-assumptions-constraints-dependencies-template.md +59 -0
  464. package/docs/ja/specdojo/templates/prj-charter-template.md +116 -0
  465. package/docs/ja/specdojo/templates/prj-comparison-of-alternatives-template.md +116 -0
  466. package/docs/ja/specdojo/templates/prj-issues-and-approach-template.md +89 -0
  467. package/docs/ja/specdojo/templates/prj-overview-template.md +85 -0
  468. package/docs/ja/specdojo/templates/prj-scope-template.md +75 -0
  469. package/docs/ja/specdojo/templates/prj-stakeholder-register-template.md +64 -0
  470. package/docs/ja/specdojo/templates/prj-success-criteria-and-acceptance-criteria-template.md +60 -0
  471. package/docs/ja/specdojo/templates/stsd-template.md +57 -0
  472. package/docs/specdojo/schemas/v1/bdd.schema.yaml +230 -0
  473. package/docs/specdojo/schemas/v1/common-frontmatter.schema.yaml +77 -0
  474. package/docs/specdojo/schemas/v1/dct-index.schema.yaml +85 -0
  475. package/docs/specdojo/schemas/v1/dct-plan.schema.yaml +324 -0
  476. package/docs/specdojo/schemas/v1/dct.schema.yaml +368 -0
  477. package/docs/specdojo/schemas/v1/deliverable-frontmatter.schema.yaml +91 -0
  478. package/docs/specdojo/schemas/v1/esil.schema.yaml +142 -0
  479. package/docs/specdojo/schemas/v1/exec-common.schema.yaml +101 -0
  480. package/docs/specdojo/schemas/v1/exec-defaults.schema.yaml +272 -0
  481. package/docs/specdojo/schemas/v1/exec-evidence.schema.yaml +162 -0
  482. package/docs/specdojo/schemas/v1/exec-plan-frontmatter.schema.yaml +126 -0
  483. package/docs/specdojo/schemas/v1/exec-reporter-output.schema.yaml +151 -0
  484. package/docs/specdojo/schemas/v1/exec-result-frontmatter.schema.yaml +144 -0
  485. package/docs/specdojo/schemas/v1/grade-done-criteria.schema.yaml +79 -0
  486. package/docs/specdojo/schemas/v1/grade-pipeline-state.schema.yaml +60 -0
  487. package/docs/specdojo/schemas/v1/grade-result.schema.yaml +118 -0
  488. package/docs/specdojo/schemas/v1/guide-frontmatter.schema.yaml +19 -0
  489. package/docs/specdojo/schemas/v1/ifx-cmd.schema.yaml +293 -0
  490. package/docs/specdojo/schemas/v1/job-run.schema.yaml +90 -0
  491. package/docs/specdojo/schemas/v1/job.schema.yaml +198 -0
  492. package/docs/specdojo/schemas/v1/philosophy-frontmatter.schema.yaml +19 -0
  493. package/docs/specdojo/schemas/v1/pipeline-state.schema.yaml +56 -0
  494. package/docs/specdojo/schemas/v1/pm-members.schema.yaml +252 -0
  495. package/docs/specdojo/schemas/v1/pm-review-viewpoints.schema.yaml +387 -0
  496. package/docs/specdojo/schemas/v1/pm-roles.schema.yaml +106 -0
  497. package/docs/specdojo/schemas/v1/recipe-frontmatter.schema.yaml +27 -0
  498. package/docs/specdojo/schemas/v1/reference-frontmatter.schema.yaml +18 -0
  499. package/docs/specdojo/schemas/v1/register-events.schema.yaml +106 -0
  500. package/docs/specdojo/schemas/v1/register-item-frontmatter.schema.yaml +204 -0
  501. package/docs/specdojo/schemas/v1/routine-run.schema.yaml +36 -0
  502. package/docs/specdojo/schemas/v1/routine.schema.yaml +87 -0
  503. package/docs/specdojo/schemas/v1/rulebook-frontmatter.schema.yaml +61 -0
  504. package/docs/specdojo/schemas/v1/sch-common.schema.yaml +258 -0
  505. package/docs/specdojo/schemas/v1/sch-defaults.schema.yaml +48 -0
  506. package/docs/specdojo/schemas/v1/sch-milestones.schema.yaml +64 -0
  507. package/docs/specdojo/schemas/v1/sch-strategy.schema.yaml +772 -0
  508. package/docs/specdojo/schemas/v1/sch-track.schema.yaml +66 -0
  509. package/docs/specdojo/schemas/v1/standard-frontmatter.schema.yaml +18 -0
  510. package/docs/specdojo/schemas/v1/tml-index.schema.yaml +103 -0
  511. package/package.json +120 -24
  512. package/templates/claude/README.md +46 -0
  513. package/templates/claude/agents/claude-expert-review-executor.md +14 -0
  514. package/templates/claude/agents/claude-review-executor.md +14 -0
  515. package/templates/claude/settings.edit.json +6 -0
  516. package/templates/claude/settings.report.json +6 -0
  517. package/templates/claude/settings.review.json +7 -0
  518. package/templates/codex/README.md +61 -0
  519. package/templates/codex/agents/codex-executor.toml +12 -0
  520. package/templates/codex/agents/codex-expert-executor.toml +12 -0
  521. package/templates/codex/agents/codex-expert-review-executor.toml +10 -0
  522. package/templates/codex/agents/codex-review-executor.toml +10 -0
  523. package/templates/copilot/README.md +41 -0
  524. package/templates/copilot/exec-defaults-snippet.yaml +28 -0
  525. package/templates/copilot/pm-members-snippet.yaml +44 -0
  526. package/templates/opencode/README.md +41 -0
  527. package/templates/opencode/agents/opencode-executor.md +59 -0
  528. package/templates/opencode/agents/opencode-reporter.md +26 -0
  529. package/templates/opencode/agents/opencode-review-executor.md +48 -0
  530. package/dist/exec-schedule-timeline-render.js +0 -201
  531. package/dist/exec-schedule-timeline.js +0 -2
@@ -0,0 +1,552 @@
1
+ import { existsSync } from "node:fs";
2
+ import { resolve } from "node:path";
3
+ import { readYaml } from "./exec-shared.js";
4
+ import { expandPhaseSetSelection, normalizePhaseSetSelection, taskIterationSuffix, } from "./schedule-phase-sets.js";
5
+ // --- Helpers ---
6
+ function collectDeliverables(sections, includeKinds, catalogId, selectedLocalIds, catalogLocalIds, topLevelGroup, out) {
7
+ for (const section of sections) {
8
+ // Lock the top-level group name on the first call; preserve it for nested calls.
9
+ const effectiveGroup = topLevelGroup ?? section.name ?? null;
10
+ if (section.groups) {
11
+ collectDeliverables(section.groups, includeKinds, catalogId, selectedLocalIds, catalogLocalIds, effectiveGroup, out);
12
+ }
13
+ if (!section.deliverables)
14
+ continue;
15
+ for (const item of section.deliverables) {
16
+ catalogLocalIds.add(item.local_id);
17
+ if (!includeKinds.includes(item.kind))
18
+ continue;
19
+ if (selectedLocalIds && !selectedLocalIds.has(item.local_id))
20
+ continue;
21
+ if (!item.path)
22
+ continue;
23
+ out.push({
24
+ local_id: item.local_id,
25
+ path: item.path,
26
+ depends_on: item.depends_on ?? [],
27
+ catalogId,
28
+ groupName: effectiveGroup,
29
+ });
30
+ }
31
+ }
32
+ }
33
+ function validateRuleCoverage(label, rules, deliverables, errors) {
34
+ const scopedLocalIds = new Set(deliverables.map((deliverable) => deliverable.local_id));
35
+ const coveredLocalIds = new Set();
36
+ for (const rule of rules) {
37
+ for (const localId of rule.local_ids) {
38
+ if (!scopedLocalIds.has(localId)) {
39
+ errors.push(`${label}: local_id '${localId}' is not in the selected scope`);
40
+ }
41
+ if (coveredLocalIds.has(localId)) {
42
+ errors.push(`${label}: local_id '${localId}' is covered more than once`);
43
+ }
44
+ coveredLocalIds.add(localId);
45
+ }
46
+ }
47
+ for (const localId of scopedLocalIds) {
48
+ if (coveredLocalIds.has(localId))
49
+ continue;
50
+ errors.push(label === "owner_rules"
51
+ ? `No owner_rule found for local_id: ${localId}`
52
+ : `No approach_rule found for local_id: ${localId}`);
53
+ }
54
+ }
55
+ function getOwner(localId, rules) {
56
+ for (const rule of rules) {
57
+ if (rule.local_ids.includes(localId))
58
+ return rule.owner;
59
+ }
60
+ return null;
61
+ }
62
+ function resolveGateScope(scope, sorted) {
63
+ const result = new Set();
64
+ for (const catalogId of scope.catalogs ?? []) {
65
+ for (const d of sorted) {
66
+ if (d.catalogId === catalogId)
67
+ result.add(d.local_id);
68
+ }
69
+ }
70
+ for (const g of scope.groups ?? []) {
71
+ for (const d of sorted) {
72
+ if (d.catalogId === g.catalog_id && d.groupName === g.name)
73
+ result.add(d.local_id);
74
+ }
75
+ }
76
+ for (const localId of scope.local_ids ?? []) {
77
+ result.add(localId);
78
+ }
79
+ return [...result];
80
+ }
81
+ function buildTaskId(track, localId, phaseSuffix, cycle, iteration) {
82
+ return `T-${track.toUpperCase()}-${localId}-${phaseSuffix}${taskIterationSuffix(cycle, iteration)}`;
83
+ }
84
+ function buildCrossDeliverableTaskId(track, passId, phaseSuffix) {
85
+ return `T-${track.toUpperCase()}-${passId}-${phaseSuffix}`;
86
+ }
87
+ function topoSort(deliverables, crossDeps) {
88
+ const byId = new Map(deliverables.map((d) => [d.local_id, d]));
89
+ const extraDeps = new Map();
90
+ for (const cd of crossDeps) {
91
+ if (!byId.has(cd.dependent) || !byId.has(cd.requires))
92
+ continue;
93
+ if (!extraDeps.has(cd.dependent))
94
+ extraDeps.set(cd.dependent, new Set());
95
+ extraDeps.get(cd.dependent).add(cd.requires);
96
+ }
97
+ const visited = new Set();
98
+ const inStack = new Set();
99
+ const sorted = [];
100
+ function visit(id) {
101
+ if (visited.has(id))
102
+ return;
103
+ if (inStack.has(id))
104
+ throw new Error(`Circular dependency detected involving: ${id}`);
105
+ inStack.add(id);
106
+ const d = byId.get(id);
107
+ if (d) {
108
+ for (const dep of d.depends_on) {
109
+ if (byId.has(dep))
110
+ visit(dep);
111
+ }
112
+ for (const dep of extraDeps.get(id) ?? [])
113
+ visit(dep);
114
+ }
115
+ inStack.delete(id);
116
+ visited.add(id);
117
+ if (d)
118
+ sorted.push(d);
119
+ }
120
+ for (const d of deliverables)
121
+ visit(d.local_id);
122
+ return sorted;
123
+ }
124
+ // --- Main export ---
125
+ function validateAgentAssignment(label, assignment, roster, errors) {
126
+ if (!roster) {
127
+ errors.push(`${label}: agent assignment requires a configured pm-members.yaml`);
128
+ return;
129
+ }
130
+ for (const [stageRole, nickname] of [
131
+ ["executor", assignment.executor],
132
+ ["reporter", assignment.reporter],
133
+ ]) {
134
+ if (!nickname)
135
+ continue;
136
+ const members = roster.members.filter((member) => member.type === "agent" && member.nickname === nickname);
137
+ if (members.length !== 1) {
138
+ errors.push(`${label}.agent.${stageRole}: nickname '${nickname}' was not found uniquely in pm-members.yaml`);
139
+ continue;
140
+ }
141
+ if (members[0].stage_role !== stageRole) {
142
+ errors.push(`${label}.agent.${stageRole}: nickname '${nickname}' must have stage_role: ${stageRole}`);
143
+ }
144
+ }
145
+ }
146
+ export function buildScheduleTrack(strategyPath, baseDir, roster) {
147
+ const errors = [];
148
+ const warnings = [];
149
+ const strategy = readYaml(strategyPath);
150
+ if (!strategy?.scope || !strategy?.phase_sets || !strategy?.owner_rules) {
151
+ throw new Error(`${strategyPath}: missing required fields (scope, phase_sets, or owner_rules)`);
152
+ }
153
+ const track = String(strategy.track ?? "");
154
+ // 生成する track には strategy の status を引き継ぐ。
155
+ const status = String(strategy.status ?? "draft");
156
+ const projectId = String(strategy.id ?? "").split(":")[0] ?? "unknown";
157
+ const startDate = strategy.settings?.start_date ?? null;
158
+ if (roster !== undefined) {
159
+ for (const [phaseSet, phases] of Object.entries(strategy.phase_sets)) {
160
+ for (const phase of phases) {
161
+ if (phase.agent) {
162
+ validateAgentAssignment(`phase_sets.${phaseSet}.${phase.id}`, phase.agent, roster, errors);
163
+ }
164
+ }
165
+ }
166
+ for (const [ruleIndex, rule] of strategy.owner_rules.entries()) {
167
+ for (const override of rule.phase_overrides ?? []) {
168
+ if (override.agent) {
169
+ validateAgentAssignment(`owner_rules.${ruleIndex}.phase_overrides.${override.phase}`, override.agent, roster, errors);
170
+ }
171
+ }
172
+ }
173
+ for (const pass of strategy.cross_deliverable_passes ?? []) {
174
+ if (pass.agent) {
175
+ validateAgentAssignment(`cross_deliverable_passes.${pass.id}`, pass.agent, roster, errors);
176
+ }
177
+ }
178
+ }
179
+ // Load deliverables from catalogs
180
+ const allDeliverables = [];
181
+ for (const ref of strategy.scope.catalogs) {
182
+ // Paths start with '/' and are relative to repo root (baseDir)
183
+ const catalogPath = resolve(baseDir, ref.path.replace(/^\//, ""));
184
+ if (!existsSync(catalogPath)) {
185
+ errors.push(`Catalog not found: ${catalogPath}`);
186
+ continue;
187
+ }
188
+ const doc = readYaml(catalogPath);
189
+ if (!doc?.groups) {
190
+ errors.push(`${catalogPath}: missing groups field`);
191
+ continue;
192
+ }
193
+ if (ref.local_ids && ref.local_ids.length === 0) {
194
+ errors.push(`scope.catalogs '${ref.id}': local_ids must contain at least one local_id`);
195
+ continue;
196
+ }
197
+ const selectedLocalIds = ref.local_ids ? new Set(ref.local_ids) : null;
198
+ if (selectedLocalIds && selectedLocalIds.size !== ref.local_ids.length) {
199
+ errors.push(`scope.catalogs '${ref.id}': local_ids must not contain duplicates`);
200
+ }
201
+ const catalogLocalIds = new Set();
202
+ collectDeliverables(doc.groups, strategy.scope.include_kinds, ref.id, selectedLocalIds, catalogLocalIds, null, allDeliverables);
203
+ for (const localId of selectedLocalIds ?? []) {
204
+ if (!catalogLocalIds.has(localId)) {
205
+ errors.push(`scope.catalogs '${ref.id}': local_id '${localId}' was not found in the catalog`);
206
+ }
207
+ }
208
+ }
209
+ const hasDeliverableSelection = strategy.scope.catalogs.some((catalog) => catalog.local_ids !== undefined);
210
+ if (hasDeliverableSelection) {
211
+ validateRuleCoverage("owner_rules", strategy.owner_rules, allDeliverables, errors);
212
+ if (strategy.approach_rules) {
213
+ validateRuleCoverage("approach_rules", strategy.approach_rules, allDeliverables, errors);
214
+ }
215
+ }
216
+ if (errors.length > 0)
217
+ return { projectId, track, status, startDate, tasks: [], milestones: [], errors, warnings };
218
+ // Topological sort
219
+ const crossDeps = strategy.cross_domain_dependencies ?? [];
220
+ let sorted;
221
+ try {
222
+ sorted = topoSort(allDeliverables, crossDeps);
223
+ }
224
+ catch (err) {
225
+ errors.push(err instanceof Error ? err.message : String(err));
226
+ return { projectId, track, status, startDate, tasks: [], milestones: [], errors, warnings };
227
+ }
228
+ const fallbackPhaseSets = strategy.default_phase_set
229
+ ? [strategy.default_phase_set]
230
+ : Object.keys(strategy.phase_sets);
231
+ let defaultPhaseSets;
232
+ try {
233
+ defaultPhaseSets = normalizePhaseSetSelection(strategy.default_phase_sets, fallbackPhaseSets);
234
+ }
235
+ catch (err) {
236
+ errors.push(err instanceof Error ? err.message : String(err));
237
+ return { projectId, track, status, startDate, tasks: [], milestones: [], errors, warnings };
238
+ }
239
+ // Completed deliverables: generate a single 000 task instead of full phase expansion
240
+ const completedLocalIds = new Set((strategy.initial_state?.completed_deliverables ?? [])
241
+ .filter((c) => c.completed_through === undefined)
242
+ .map((c) => c.local_id));
243
+ // Map local_id → finalize task ID for dependency resolution
244
+ const finalizeTaskId = new Map();
245
+ const boundaries = new Map();
246
+ const gateScopes = (strategy.phase_gates ?? []).map((gate) => ({
247
+ gate,
248
+ localIds: new Set(resolveGateScope(gate.scope, sorted)),
249
+ }));
250
+ function resolveDependencyTaskId(dependent, required) {
251
+ const boundary = boundaries.get(required)?.byCycle.get(1);
252
+ if (!boundary)
253
+ return finalizeTaskId.get(required);
254
+ const commonGateBoundaries = gateScopes
255
+ .filter(({ localIds }) => localIds.has(dependent) && localIds.has(required))
256
+ .map(({ gate }) => {
257
+ let match = null;
258
+ for (let i = 0; i < boundary.phaseSets.length; i++) {
259
+ const phaseSet = boundary.phaseSets[i];
260
+ if (gate.after_phase_sets.includes(phaseSet.phaseSet)) {
261
+ match = { index: i, taskId: phaseSet.lastTaskId };
262
+ }
263
+ }
264
+ return match;
265
+ })
266
+ .filter((match) => match !== null)
267
+ .sort((a, b) => a.index - b.index);
268
+ return (commonGateBoundaries[0]?.taskId ?? boundary.lastPreFinalizeId ?? finalizeTaskId.get(required));
269
+ }
270
+ // Use a Map to allow post-generation patching for phase gates
271
+ const taskMap = new Map();
272
+ for (const d of sorted) {
273
+ // Completed deliverables: single 000 task (no phase expansion, no Gantt bar)
274
+ if (completedLocalIds.has(d.local_id)) {
275
+ const owner = getOwner(d.local_id, strategy.owner_rules) ?? "PM";
276
+ const firstDeps = new Set();
277
+ for (const dep of d.depends_on) {
278
+ // Use the same earliest-shared-gate-boundary resolution as normal tasks
279
+ // (resolveDependencyTaskId), not the dependency's absolute final task.
280
+ // Otherwise a completed deliverable that depends on a still-in-progress
281
+ // deliverable can point at a task gated behind a track-wide phase gate
282
+ // (e.g. review-pass), which in turn depends on deliverables that now
283
+ // depend on this completed deliverable's 000 task — a cycle.
284
+ const depId = resolveDependencyTaskId(d.local_id, dep);
285
+ if (depId)
286
+ firstDeps.add(depId);
287
+ }
288
+ for (const cd of crossDeps) {
289
+ if (cd.dependent !== d.local_id)
290
+ continue;
291
+ const depId = resolveDependencyTaskId(d.local_id, cd.requires);
292
+ if (depId)
293
+ firstDeps.add(depId);
294
+ }
295
+ const taskId = buildTaskId(track, d.local_id, "000");
296
+ taskMap.set(taskId, {
297
+ local_id: d.local_id,
298
+ phase_suffix: "000",
299
+ name: "完了済み",
300
+ duration_days: 0.001,
301
+ depends_on: [...firstDeps],
302
+ owner,
303
+ tags: ["initial-complete"],
304
+ });
305
+ finalizeTaskId.set(d.local_id, taskId);
306
+ boundaries.set(d.local_id, {
307
+ cycles: 1,
308
+ byCycle: new Map([[1, { lastPreFinalizeId: null, phaseSets: [] }]]),
309
+ });
310
+ continue;
311
+ }
312
+ const ownerRule = strategy.owner_rules.find((r) => r.local_ids.includes(d.local_id));
313
+ let selection;
314
+ try {
315
+ selection = ownerRule?.phase_sets
316
+ ? normalizePhaseSetSelection(ownerRule.phase_sets, [])
317
+ : ownerRule?.phase_set
318
+ ? normalizePhaseSetSelection([ownerRule.phase_set], [])
319
+ : defaultPhaseSets;
320
+ }
321
+ catch (err) {
322
+ errors.push(`${d.local_id}: ${err instanceof Error ? err.message : String(err)}`);
323
+ continue;
324
+ }
325
+ const expandedPhases = expandPhaseSetSelection(selection, strategy.phase_sets);
326
+ if (expandedPhases.length === 0) {
327
+ warnings.push(`No phases resolved for '${d.local_id}' (phase_sets: ${selection.sequence.map((ref) => ref.phaseSet).join(", ")}) — skipping`);
328
+ continue;
329
+ }
330
+ const owner = getOwner(d.local_id, strategy.owner_rules);
331
+ if (!owner) {
332
+ errors.push(`No owner_rule found for local_id: ${d.local_id}`);
333
+ continue;
334
+ }
335
+ const lastPhaseSetIndex = selection.sequence.length - 1;
336
+ // Keep dependencies inside the earliest phase gate shared by both deliverables.
337
+ // Otherwise a pre-gate task could wait on a post-gate task and create a cycle.
338
+ // Completed deliverables have no expanded boundary, so fall back to their 000 task.
339
+ const firstDeps = new Set();
340
+ for (const dep of d.depends_on) {
341
+ const depId = resolveDependencyTaskId(d.local_id, dep);
342
+ if (depId)
343
+ firstDeps.add(depId);
344
+ }
345
+ for (const cd of crossDeps) {
346
+ if (cd.dependent !== d.local_id)
347
+ continue;
348
+ const depId = resolveDependencyTaskId(d.local_id, cd.requires);
349
+ if (depId)
350
+ firstDeps.add(depId);
351
+ }
352
+ let prevId = null;
353
+ const byCycle = new Map();
354
+ for (let i = 0; i < expandedPhases.length; i++) {
355
+ const expanded = expandedPhases[i];
356
+ const phase = expanded.phase;
357
+ const taskId = buildTaskId(track, d.local_id, phase.task_suffix, expanded.cycle, expanded.iteration);
358
+ if (taskMap.has(taskId)) {
359
+ errors.push(`Duplicate generated task ID '${taskId}'. Use iterations instead of repeating the same phase_set reference.`);
360
+ continue;
361
+ }
362
+ const overrideAgent = (ownerRule?.phase_overrides ?? []).find((override) => override.phase === phase.id && override.agent !== undefined)?.agent;
363
+ const effectiveAgent = overrideAgent ?? phase.agent;
364
+ taskMap.set(taskId, {
365
+ local_id: d.local_id,
366
+ phase_suffix: phase.task_suffix,
367
+ phase_set: expanded.phaseSet,
368
+ phase_id: phase.id,
369
+ ...(expanded.cycle !== undefined ? { cycle: expanded.cycle } : {}),
370
+ ...(expanded.iteration !== undefined ? { iteration: expanded.iteration } : {}),
371
+ name: phase.name,
372
+ duration_days: phase.duration_days,
373
+ depends_on: i === 0 ? [...firstDeps] : [prevId],
374
+ owner,
375
+ ...(effectiveAgent ? { agent: effectiveAgent } : {}),
376
+ ...(phase.description ? { description: phase.description } : {}),
377
+ });
378
+ const boundary = byCycle.get(expanded.cycleNumber) ?? {
379
+ lastPreFinalizeId: null,
380
+ phaseSets: [],
381
+ };
382
+ const phaseSetBoundary = boundary.phaseSets[expanded.phaseSetIndex];
383
+ if (phaseSetBoundary) {
384
+ phaseSetBoundary.lastTaskId = taskId;
385
+ }
386
+ else {
387
+ boundary.phaseSets[expanded.phaseSetIndex] = {
388
+ phaseSet: expanded.phaseSet,
389
+ firstTaskId: taskId,
390
+ lastTaskId: taskId,
391
+ nextTaskId: null,
392
+ };
393
+ }
394
+ if (expanded.phaseSetIndex < lastPhaseSetIndex) {
395
+ boundary.lastPreFinalizeId = taskId;
396
+ }
397
+ byCycle.set(expanded.cycleNumber, boundary);
398
+ prevId = taskId;
399
+ }
400
+ for (const boundary of byCycle.values()) {
401
+ for (let i = 0; i < boundary.phaseSets.length - 1; i++) {
402
+ boundary.phaseSets[i].nextTaskId = boundary.phaseSets[i + 1].firstTaskId;
403
+ }
404
+ }
405
+ if (prevId)
406
+ finalizeTaskId.set(d.local_id, prevId);
407
+ boundaries.set(d.local_id, { cycles: selection.cycles, byCycle });
408
+ }
409
+ if (errors.length > 0)
410
+ return { projectId, track, status, startDate, tasks: [], milestones: [], errors, warnings };
411
+ // Process phase gates and block the phase_set immediately following each configured boundary.
412
+ const milestones = [];
413
+ for (const gate of strategy.phase_gates ?? []) {
414
+ const scopedLocalIds = resolveGateScope(gate.scope, sorted);
415
+ if (scopedLocalIds.length === 0) {
416
+ warnings.push(`phase_gate ${gate.id}: no deliverables found in scope`);
417
+ continue;
418
+ }
419
+ const maxCycles = Math.max(...scopedLocalIds.map((id) => boundaries.get(id)?.cycles ?? 1));
420
+ for (let cycleNumber = 1; cycleNumber <= maxCycles; cycleNumber++) {
421
+ const gateId = maxCycles > 1 ? `${gate.id}-C${String(cycleNumber).padStart(2, "0")}` : gate.id;
422
+ const gateDeps = scopedLocalIds
423
+ .map((id) => {
424
+ const phaseSets = boundaries.get(id)?.byCycle.get(cycleNumber)?.phaseSets ?? [];
425
+ return phaseSets
426
+ .filter((boundary) => gate.after_phase_sets.includes(boundary.phaseSet))
427
+ .at(-1)?.lastTaskId;
428
+ })
429
+ .filter((id) => id !== null && id !== undefined);
430
+ if (gateDeps.length === 0) {
431
+ warnings.push(`phase_gate ${gateId}: no matching phase_set tasks found in scope`);
432
+ continue;
433
+ }
434
+ milestones.push({
435
+ id: gateId,
436
+ name: maxCycles > 1 ? `${gate.name} (cycle ${cycleNumber})` : gate.name,
437
+ ...(gate.artifact_name !== undefined ? { artifact_name: gate.artifact_name } : {}),
438
+ depends_on: gateDeps,
439
+ owner: gate.owner,
440
+ });
441
+ for (const localId of scopedLocalIds) {
442
+ const phaseSets = boundaries.get(localId)?.byCycle.get(cycleNumber)?.phaseSets ?? [];
443
+ const nextTaskId = phaseSets
444
+ .filter((boundary) => gate.after_phase_sets.includes(boundary.phaseSet))
445
+ .at(-1)?.nextTaskId;
446
+ if (!nextTaskId)
447
+ continue;
448
+ const task = taskMap.get(nextTaskId);
449
+ if (!task || task.depends_on.includes(gateId))
450
+ continue;
451
+ task.depends_on.push(gateId);
452
+ }
453
+ }
454
+ }
455
+ // Generate each cross-deliverable pass once, after its completion gate, and make the
456
+ // first scoped task in before_phase_set wait for it. The target list is carried into
457
+ // sch-track so exec plan/result and commit scope can use the same explicit boundary.
458
+ for (const pass of strategy.cross_deliverable_passes ?? []) {
459
+ const scopedLocalIds = resolveGateScope(pass.scope, sorted);
460
+ if (scopedLocalIds.length < 2) {
461
+ errors.push(`cross_deliverable_pass ${pass.id}: scope must resolve to at least two deliverables`);
462
+ continue;
463
+ }
464
+ if (!milestones.some((milestone) => milestone.id === pass.after_gate)) {
465
+ errors.push(`cross_deliverable_pass ${pass.id}: after_gate not generated: ${pass.after_gate}`);
466
+ continue;
467
+ }
468
+ const taskId = buildCrossDeliverableTaskId(track, pass.id, pass.task_suffix);
469
+ if (taskMap.has(taskId)) {
470
+ errors.push(`Duplicate generated task ID '${taskId}'.`);
471
+ continue;
472
+ }
473
+ const blockedTaskIds = [];
474
+ for (const localId of scopedLocalIds) {
475
+ if (completedLocalIds.has(localId))
476
+ continue;
477
+ const boundary = boundaries.get(localId)?.byCycle.get(1);
478
+ const beforeTaskId = boundary?.phaseSets.find((phaseSet) => phaseSet.phaseSet === pass.before_phase_set)?.firstTaskId;
479
+ if (!beforeTaskId) {
480
+ errors.push(`cross_deliverable_pass ${pass.id}: ${localId} has no ${pass.before_phase_set} task`);
481
+ continue;
482
+ }
483
+ blockedTaskIds.push(beforeTaskId);
484
+ }
485
+ const expectedBlockedCount = scopedLocalIds.filter((localId) => !completedLocalIds.has(localId)).length;
486
+ if (blockedTaskIds.length !== expectedBlockedCount)
487
+ continue;
488
+ taskMap.set(taskId, {
489
+ id: taskId,
490
+ target_local_ids: scopedLocalIds,
491
+ phase_suffix: pass.task_suffix,
492
+ phase_set: "cross-deliverable-pass",
493
+ phase_id: pass.id,
494
+ name: pass.name,
495
+ duration_days: pass.duration_days,
496
+ depends_on: [pass.after_gate],
497
+ owner: pass.owner,
498
+ ...(pass.agent ? { agent: pass.agent } : {}),
499
+ tags: ["cross-deliverable"],
500
+ ...(pass.artifact_name !== undefined ? { artifact_name: pass.artifact_name } : {}),
501
+ ...(pass.description ? { description: pass.description } : {}),
502
+ });
503
+ for (const blockedTaskId of blockedTaskIds) {
504
+ const task = taskMap.get(blockedTaskId);
505
+ if (task && !task.depends_on.includes(taskId))
506
+ task.depends_on.push(taskId);
507
+ }
508
+ }
509
+ if (errors.length > 0)
510
+ return { projectId, track, status, startDate, tasks: [], milestones: [], errors, warnings };
511
+ const tasks = [...taskMap.values()];
512
+ // Build per-group milestones from group_milestones config
513
+ for (const gm of strategy.group_milestones ?? []) {
514
+ const groupDeliverables = sorted.filter((d) => {
515
+ if (d.catalogId !== gm.catalog_id)
516
+ return false;
517
+ return gm.group !== undefined ? d.groupName === gm.group : true;
518
+ });
519
+ if (groupDeliverables.length === 0) {
520
+ warnings.push(`group_milestones: no work deliverables for catalog_id=${gm.catalog_id} group=${gm.group ?? "(unnamed)"}`);
521
+ continue;
522
+ }
523
+ // Leaf deliverables within the group: not required by any sibling in the same group
524
+ const groupIds = new Set(groupDeliverables.map((d) => d.local_id));
525
+ const dependedUponWithinGroup = new Set();
526
+ for (const d of groupDeliverables) {
527
+ for (const dep of d.depends_on) {
528
+ if (groupIds.has(dep))
529
+ dependedUponWithinGroup.add(dep);
530
+ }
531
+ }
532
+ const leafFinalizeIds = groupDeliverables
533
+ .filter((d) => !dependedUponWithinGroup.has(d.local_id))
534
+ .map((d) => finalizeTaskId.get(d.local_id))
535
+ .filter((id) => id !== undefined);
536
+ if (leafFinalizeIds.length === 0) {
537
+ warnings.push(`group_milestones: no finalize tasks for catalog_id=${gm.catalog_id} group=${gm.group ?? "(unnamed)"}`);
538
+ continue;
539
+ }
540
+ const mc = gm.milestone;
541
+ milestones.push({
542
+ id: mc.id,
543
+ name: mc.name,
544
+ ...(mc.artifact_name !== undefined ? { artifact_name: mc.artifact_name } : {}),
545
+ depends_on: leafFinalizeIds,
546
+ owner: mc.owner,
547
+ ...(mc.date_hint !== undefined ? { date_hint: mc.date_hint } : {}),
548
+ ...(mc.tags !== undefined ? { tags: mc.tags } : {}),
549
+ });
550
+ }
551
+ return { projectId, track, status, startDate, tasks, milestones, errors, warnings };
552
+ }
@@ -0,0 +1,73 @@
1
+ function positiveInteger(value, field) {
2
+ if (typeof value !== "number" || !Number.isInteger(value) || value < 1) {
3
+ throw new Error(`${field} must be an integer greater than or equal to 1`);
4
+ }
5
+ return value;
6
+ }
7
+ function normalizeReference(reference) {
8
+ if (typeof reference === "string") {
9
+ if (!reference.trim())
10
+ throw new Error("phase_set must be a non-empty string");
11
+ return { phaseSet: reference, iterations: 1 };
12
+ }
13
+ if (!reference || typeof reference !== "object" || !reference.phase_set?.trim()) {
14
+ throw new Error("phase_set reference must define phase_set");
15
+ }
16
+ return {
17
+ phaseSet: reference.phase_set,
18
+ iterations: reference.iterations === undefined ? 1 : positiveInteger(reference.iterations, "iterations"),
19
+ };
20
+ }
21
+ export function normalizePhaseSetSelection(selection, fallbackPhaseSets) {
22
+ const resolved = selection ?? fallbackPhaseSets;
23
+ const cycles = Array.isArray(resolved)
24
+ ? 1
25
+ : resolved.cycles === undefined
26
+ ? 1
27
+ : positiveInteger(resolved.cycles, "cycles");
28
+ const sequence = Array.isArray(resolved) ? resolved : resolved.sequence;
29
+ if (!Array.isArray(sequence) || sequence.length === 0) {
30
+ throw new Error("phase_sets sequence must contain at least one phase_set");
31
+ }
32
+ return { cycles, sequence: sequence.map(normalizeReference) };
33
+ }
34
+ export function phaseSetNames(selection) {
35
+ return selection.sequence.map((reference) => reference.phaseSet);
36
+ }
37
+ export function expandPhaseSetSelection(selection, phaseSets) {
38
+ const expanded = [];
39
+ for (let cycleNumber = 1; cycleNumber <= selection.cycles; cycleNumber++) {
40
+ for (let phaseSetIndex = 0; phaseSetIndex < selection.sequence.length; phaseSetIndex++) {
41
+ const reference = selection.sequence[phaseSetIndex];
42
+ const phases = phaseSets[reference.phaseSet] ?? [];
43
+ for (let iterationNumber = 1; iterationNumber <= reference.iterations; iterationNumber++) {
44
+ for (const phase of phases) {
45
+ expanded.push({
46
+ phase,
47
+ phaseSet: reference.phaseSet,
48
+ phaseSetIndex,
49
+ cycleNumber,
50
+ iterationNumber,
51
+ ...(selection.cycles > 1 ? { cycle: cycleNumber } : {}),
52
+ ...(reference.iterations > 1 ? { iteration: iterationNumber } : {}),
53
+ });
54
+ }
55
+ }
56
+ }
57
+ }
58
+ return expanded;
59
+ }
60
+ export function taskIterationSuffix(cycle, iteration) {
61
+ const parts = [];
62
+ if (cycle !== undefined)
63
+ parts.push(`C${String(cycle).padStart(2, "0")}`);
64
+ if (iteration !== undefined)
65
+ parts.push(`I${String(iteration).padStart(2, "0")}`);
66
+ return parts.length > 0 ? `-${parts.join("-")}` : "";
67
+ }
68
+ export function extractPhaseSuffix(taskId) {
69
+ return taskId.match(/-(\d{3})(?:-C\d+)?(?:-I\d+)?$/)?.[1];
70
+ }
71
+ export function extractLocalId(taskId) {
72
+ return taskId.match(/^T-[^-]+-(.+)-\d{3}(?:-C\d+)?(?:-I\d+)?$/)?.[1];
73
+ }