specdojo 0.4.7 → 0.5.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 (267) hide show
  1. package/.github/agents/specdojo-orchestrator.md +14 -9
  2. package/CHANGELOG.md +46 -0
  3. package/dist/commands/init.js +3 -0
  4. package/dist/commands/night-orchestrator.js +33 -4
  5. package/dist/dashboard/dashboard.js +5 -6
  6. package/dist/dashboard/timeline-build.js +5 -1
  7. package/dist/dashboard/timeline.js +6 -3
  8. package/dist/docs/yaml-pages.js +17 -17
  9. package/dist/exec/core.js +2 -0
  10. package/dist/exec/pipeline-state.js +5 -2
  11. package/dist/exec/plans-core.js +3 -2
  12. package/dist/exec/plans-generation.js +9 -5
  13. package/dist/exec/plans-grade-findings.js +16 -0
  14. package/dist/exec/plans-planning.js +43 -0
  15. package/dist/exec/plans-storage.js +5 -2
  16. package/dist/exec/register.js +16 -1
  17. package/dist/exec/repo-integration-sync.js +9 -0
  18. package/dist/exec/repo-integration.js +17 -2
  19. package/dist/exec/repo-trace.js +17 -4
  20. package/dist/exec/results.js +2 -0
  21. package/dist/exec/run/register-core.js +11 -0
  22. package/dist/exec/run/register-mode.js +19 -1
  23. package/dist/exec/run/register-resume.js +22 -0
  24. package/dist/exec/run/register-worktree.js +23 -0
  25. package/dist/exec/strategy.js +2 -0
  26. package/dist/exec/task-repos.js +18 -4
  27. package/dist/exec/worktree-ops-commit.js +7 -1
  28. package/dist/grade/apply.js +6 -2
  29. package/dist/grade/markdown.js +7 -2
  30. package/dist/grade/plan.js +6 -4
  31. package/dist/register/approach.js +19 -0
  32. package/dist/register/catalog-status.js +49 -0
  33. package/dist/register/core.js +3 -0
  34. package/dist/register/create-commands.js +34 -4
  35. package/dist/register/dependency.js +123 -0
  36. package/dist/register/derivation.js +2 -2
  37. package/dist/register/epic.js +42 -0
  38. package/dist/register/event-merge.js +5 -2
  39. package/dist/register/events.js +4 -0
  40. package/dist/register/external-project.js +4 -0
  41. package/dist/register/item.js +10 -0
  42. package/dist/register/maintenance-commands.js +7 -1
  43. package/dist/register/planning.js +37 -0
  44. package/dist/register/register.js +5 -1
  45. package/dist/register/renumber.js +12 -4
  46. package/dist/register/views.js +55 -4
  47. package/dist/schedule/schedule.js +3 -1
  48. package/dist/schedule/strategy-generate-scope.js +5 -1
  49. package/dist/schedule/strategy-generate.js +1 -0
  50. package/dist/schedule/strategy-profiles.js +1 -1
  51. package/dist/shared/agent-types.js +3 -0
  52. package/dist/shared/grade-result.js +23 -5
  53. package/dist/shared/markdownlint-config.js +38 -0
  54. package/dist/shared/markdownlint-scaffold.js +2 -9
  55. package/dist/shared/specdojo-config.js +10 -3
  56. package/dist/shared/specdojo-gitignore.js +4 -0
  57. package/docs/ja/specdojo/exec-templates/xep-catalog-planning-template.md +24 -0
  58. package/docs/ja/specdojo/exec-templates/xep-strategy-planning-template.md +24 -0
  59. package/docs/ja/specdojo/guides/docs-editing-guide.md +14 -1
  60. package/docs/ja/specdojo/guides/docs-structure-guide.md +10 -8
  61. package/docs/ja/specdojo/guides/exec-operation-guide.md +16 -15
  62. package/docs/ja/specdojo/guides/orchestrator-operation-guide.md +19 -1
  63. package/docs/ja/specdojo/guides/practice-system-composition-guide.md +2 -0
  64. package/docs/ja/specdojo/guides/quick-start-guide.md +37 -14
  65. package/docs/ja/specdojo/guides/register-operation-guide.md +44 -15
  66. package/docs/ja/specdojo/guides/specdojo-overview-guide.md +16 -16
  67. package/docs/ja/specdojo/guides/timeline-design-guide.md +37 -33
  68. package/docs/ja/specdojo/recipes/tsd-recipe.md +198 -0
  69. package/docs/ja/specdojo/references/command-reference.md +42 -4
  70. package/docs/ja/specdojo/references/specdojo-config-reference.md +20 -8
  71. package/docs/ja/specdojo/rulebooks/atc-index-rulebook.md +1 -0
  72. package/docs/ja/specdojo/rulebooks/atc-rulebook.md +1 -0
  73. package/docs/ja/specdojo/rulebooks/bac-rulebook.md +5 -4
  74. package/docs/ja/specdojo/rulebooks/bdd-rulebook.md +3 -2
  75. package/docs/ja/specdojo/rulebooks/bds-rulebook.md +4 -3
  76. package/docs/ja/specdojo/rulebooks/bes-index-rulebook.md +8 -7
  77. package/docs/ja/specdojo/rulebooks/bes-rulebook.md +4 -3
  78. package/docs/ja/specdojo/rulebooks/bps-rulebook.md +1 -0
  79. package/docs/ja/specdojo/rulebooks/br-rulebook.md +1 -0
  80. package/docs/ja/specdojo/rulebooks/ccd-mermaid-rulebook.md +1 -0
  81. package/docs/ja/specdojo/rulebooks/cdfd-mermaid-rulebook.md +1 -0
  82. package/docs/ja/specdojo/rulebooks/cdfd-overview-rulebook.md +1 -0
  83. package/docs/ja/specdojo/rulebooks/cdfd-rulebook.md +1 -0
  84. package/docs/ja/specdojo/rulebooks/cdfd-uc-rulebook.md +1 -0
  85. package/docs/ja/specdojo/rulebooks/cdsd-rulebook.md +3 -2
  86. package/docs/ja/specdojo/rulebooks/cld-rulebook.md +2 -1
  87. package/docs/ja/specdojo/rulebooks/cnd-mermaid-rulebook.md +1 -0
  88. package/docs/ja/specdojo/rulebooks/cnd-rulebook.md +1 -0
  89. package/docs/ja/specdojo/rulebooks/cop-index-rulebook.md +2 -1
  90. package/docs/ja/specdojo/rulebooks/cop-rulebook.md +3 -2
  91. package/docs/ja/specdojo/rulebooks/cpd-mermaid-rulebook.md +1 -0
  92. package/docs/ja/specdojo/rulebooks/cpd-rulebook.md +1 -0
  93. package/docs/ja/specdojo/rulebooks/cstd-rulebook.md +1 -0
  94. package/docs/ja/specdojo/rulebooks/cxd-mermaid-rulebook.md +1 -0
  95. package/docs/ja/specdojo/rulebooks/cxd-rulebook.md +1 -0
  96. package/docs/ja/specdojo/rulebooks/dct-index-rulebook.md +1 -0
  97. package/docs/ja/specdojo/rulebooks/dct-rulebook.md +1 -0
  98. package/docs/ja/specdojo/rulebooks/dec-rulebook.md +1 -0
  99. package/docs/ja/specdojo/rulebooks/dmd-index-rulebook.md +2 -1
  100. package/docs/ja/specdojo/rulebooks/dmd-rulebook.md +2 -1
  101. package/docs/ja/specdojo/rulebooks/etc-index-rulebook.md +1 -0
  102. package/docs/ja/specdojo/rulebooks/etc-rulebook.md +1 -0
  103. package/docs/ja/specdojo/rulebooks/gl-rulebook.md +9 -6
  104. package/docs/ja/specdojo/rulebooks/ifd-mermaid-rulebook.md +1 -0
  105. package/docs/ja/specdojo/rulebooks/ifx-api-rulebook.md +3 -1
  106. package/docs/ja/specdojo/rulebooks/ifx-cmd-rulebook.md +2 -1
  107. package/docs/ja/specdojo/rulebooks/ifx-file-rulebook.md +2 -1
  108. package/docs/ja/specdojo/rulebooks/ifx-index-rulebook.md +2 -0
  109. package/docs/ja/specdojo/rulebooks/ifx-msg-rulebook.md +4 -2
  110. package/docs/ja/specdojo/rulebooks/imp-business-rulebook.md +1 -0
  111. package/docs/ja/specdojo/rulebooks/imp-data-rulebook.md +1 -0
  112. package/docs/ja/specdojo/rulebooks/imp-interface-rulebook.md +1 -0
  113. package/docs/ja/specdojo/rulebooks/imp-operations-rulebook.md +1 -0
  114. package/docs/ja/specdojo/rulebooks/imp-test-rulebook.md +1 -0
  115. package/docs/ja/specdojo/rulebooks/itc-index-rulebook.md +1 -0
  116. package/docs/ja/specdojo/rulebooks/itc-rulebook.md +1 -0
  117. package/docs/ja/specdojo/rulebooks/mip-index-rulebook.md +2 -1
  118. package/docs/ja/specdojo/rulebooks/mm-rulebook.md +1 -0
  119. package/docs/ja/specdojo/rulebooks/mtp-rulebook.md +4 -3
  120. package/docs/ja/specdojo/rulebooks/nfr-availability-rulebook.md +9 -8
  121. package/docs/ja/specdojo/rulebooks/nfr-index-rulebook.md +10 -9
  122. package/docs/ja/specdojo/rulebooks/nfr-integrity-rulebook.md +9 -8
  123. package/docs/ja/specdojo/rulebooks/nfr-maintainability-rulebook.md +9 -8
  124. package/docs/ja/specdojo/rulebooks/nfr-operations-rulebook.md +9 -8
  125. package/docs/ja/specdojo/rulebooks/nfr-performance-rulebook.md +9 -8
  126. package/docs/ja/specdojo/rulebooks/nfr-reliability-rulebook.md +10 -9
  127. package/docs/ja/specdojo/rulebooks/nfr-security-safety-rulebook.md +9 -8
  128. package/docs/ja/specdojo/rulebooks/nfr-usability-rulebook.md +9 -8
  129. package/docs/ja/specdojo/rulebooks/ntp-rulebook.md +7 -6
  130. package/docs/ja/specdojo/rulebooks/opd-index-rulebook.md +1 -0
  131. package/docs/ja/specdojo/rulebooks/opd-rulebook.md +1 -0
  132. package/docs/ja/specdojo/rulebooks/opr-index-rulebook.md +1 -0
  133. package/docs/ja/specdojo/rulebooks/opr-rulebook.md +1 -0
  134. package/docs/ja/specdojo/rulebooks/otp-index-rulebook.md +2 -1
  135. package/docs/ja/specdojo/rulebooks/otp-rulebook.md +2 -1
  136. package/docs/ja/specdojo/rulebooks/pjr-rulebook.md +50 -36
  137. package/docs/ja/specdojo/rulebooks/pm-change-request-log-rulebook.md +1 -0
  138. package/docs/ja/specdojo/rulebooks/pm-communication-plan-rulebook.md +1 -0
  139. package/docs/ja/specdojo/rulebooks/pm-issue-log-rulebook.md +1 -0
  140. package/docs/ja/specdojo/rulebooks/pm-members-rulebook.md +1 -0
  141. package/docs/ja/specdojo/rulebooks/pm-organization-rulebook.md +1 -0
  142. package/docs/ja/specdojo/rulebooks/pm-plan-rulebook.md +1 -0
  143. package/docs/ja/specdojo/rulebooks/pm-quality-management-plan-rulebook.md +1 -0
  144. package/docs/ja/specdojo/rulebooks/pm-raci-rulebook.md +1 -0
  145. package/docs/ja/specdojo/rulebooks/pm-risk-register-rulebook.md +1 -0
  146. package/docs/ja/specdojo/rulebooks/pm-roles-rulebook.md +1 -0
  147. package/docs/ja/specdojo/rulebooks/pr-rulebook.md +1 -0
  148. package/docs/ja/specdojo/rulebooks/prj-assumptions-constraints-dependencies-rulebook.md +1 -0
  149. package/docs/ja/specdojo/rulebooks/prj-charter-rulebook.md +1 -0
  150. package/docs/ja/specdojo/rulebooks/prj-comparison-of-alternatives-rulebook.md +1 -0
  151. package/docs/ja/specdojo/rulebooks/prj-issues-and-approach-rulebook.md +1 -0
  152. package/docs/ja/specdojo/rulebooks/prj-overview-rulebook.md +1 -0
  153. package/docs/ja/specdojo/rulebooks/prj-scope-rulebook.md +1 -0
  154. package/docs/ja/specdojo/rulebooks/prj-stakeholder-register-rulebook.md +1 -0
  155. package/docs/ja/specdojo/rulebooks/prj-success-criteria-and-acceptance-criteria-rulebook.md +1 -0
  156. package/docs/ja/specdojo/rulebooks/sac-rulebook.md +3 -2
  157. package/docs/ja/specdojo/rulebooks/sch-rulebook.md +1 -0
  158. package/docs/ja/specdojo/rulebooks/sf-index-rulebook.md +7 -6
  159. package/docs/ja/specdojo/rulebooks/sf-rulebook.md +4 -3
  160. package/docs/ja/specdojo/rulebooks/sld-rulebook.md +2 -1
  161. package/docs/ja/specdojo/rulebooks/stc-index-rulebook.md +1 -0
  162. package/docs/ja/specdojo/rulebooks/stc-rulebook.md +1 -0
  163. package/docs/ja/specdojo/rulebooks/stsd-mermaid-rulebook.md +1 -0
  164. package/docs/ja/specdojo/rulebooks/stsd-rulebook.md +1 -0
  165. package/docs/ja/specdojo/rulebooks/sysd-critical-flows-rulebook.md +2 -1
  166. package/docs/ja/specdojo/rulebooks/sysd-cross-cutting-policy-rulebook.md +9 -8
  167. package/docs/ja/specdojo/rulebooks/sysd-index-rulebook.md +2 -1
  168. package/docs/ja/specdojo/rulebooks/sysd-rulebook.md +1 -0
  169. package/docs/ja/specdojo/rulebooks/tml-rulebook.md +1 -0
  170. package/docs/ja/specdojo/rulebooks/trc-requirements-to-specs-rulebook.md +1 -0
  171. package/docs/ja/specdojo/rulebooks/trc-requirements-to-tests-rulebook.md +1 -0
  172. package/docs/ja/specdojo/rulebooks/tsd-index-rulebook.md +80 -61
  173. package/docs/ja/specdojo/rulebooks/tsd-rulebook.md +111 -63
  174. package/docs/ja/specdojo/rulebooks/tsp-index-rulebook.md +1 -0
  175. package/docs/ja/specdojo/rulebooks/uis-rulebook.md +3 -2
  176. package/docs/ja/specdojo/rulebooks/utc-index-rulebook.md +1 -0
  177. package/docs/ja/specdojo/rulebooks/utc-rulebook.md +1 -0
  178. package/docs/ja/specdojo/samples/atc-index-sample.md +1 -1
  179. package/docs/ja/specdojo/samples/atc-sample.md +1 -1
  180. package/docs/ja/specdojo/samples/bac-sample.md +1 -1
  181. package/docs/ja/specdojo/samples/bdd-sample.yaml +1 -1
  182. package/docs/ja/specdojo/samples/bds-sample.md +1 -1
  183. package/docs/ja/specdojo/samples/bes-index-sample.md +1 -1
  184. package/docs/ja/specdojo/samples/bes-sample.md +1 -1
  185. package/docs/ja/specdojo/samples/ccd-sample.md +1 -1
  186. package/docs/ja/specdojo/samples/cdfd-sample.md +1 -1
  187. package/docs/ja/specdojo/samples/cdfd-uc-sample.md +1 -1
  188. package/docs/ja/specdojo/samples/cdsd-sample.md +1 -1
  189. package/docs/ja/specdojo/samples/cld-sample.md +1 -1
  190. package/docs/ja/specdojo/samples/cnd-sample.md +1 -1
  191. package/docs/ja/specdojo/samples/cop-index-sample.md +1 -1
  192. package/docs/ja/specdojo/samples/cop-sample.md +1 -1
  193. package/docs/ja/specdojo/samples/cpd-sample.md +1 -1
  194. package/docs/ja/specdojo/samples/cstd-sample.md +1 -1
  195. package/docs/ja/specdojo/samples/cxd-sample.md +1 -1
  196. package/docs/ja/specdojo/samples/dmd-index-sample.md +1 -1
  197. package/docs/ja/specdojo/samples/dmd-sample.md +1 -1
  198. package/docs/ja/specdojo/samples/etc-index-sample.md +1 -1
  199. package/docs/ja/specdojo/samples/etc-sample.md +1 -1
  200. package/docs/ja/specdojo/samples/gl-sample.yaml +2 -0
  201. package/docs/ja/specdojo/samples/ifd-sample.md +1 -1
  202. package/docs/ja/specdojo/samples/ifx-api-sample.yaml +1 -0
  203. package/docs/ja/specdojo/samples/ifx-cmd-sample.yaml +1 -1
  204. package/docs/ja/specdojo/samples/ifx-file-sample.md +1 -1
  205. package/docs/ja/specdojo/samples/ifx-index-sample.yaml +1 -0
  206. package/docs/ja/specdojo/samples/ifx-msg-sample.yaml +2 -1
  207. package/docs/ja/specdojo/samples/itc-index-sample.md +1 -1
  208. package/docs/ja/specdojo/samples/itc-sample.md +1 -1
  209. package/docs/ja/specdojo/samples/mtp-sample.md +1 -1
  210. package/docs/ja/specdojo/samples/nfr-availability-sample.md +1 -1
  211. package/docs/ja/specdojo/samples/nfr-index-sample.md +1 -1
  212. package/docs/ja/specdojo/samples/nfr-integrity-sample.md +1 -1
  213. package/docs/ja/specdojo/samples/nfr-maintainability-sample.md +1 -1
  214. package/docs/ja/specdojo/samples/nfr-operations-sample.md +1 -1
  215. package/docs/ja/specdojo/samples/nfr-performance-sample.md +1 -1
  216. package/docs/ja/specdojo/samples/nfr-reliability-sample.md +1 -1
  217. package/docs/ja/specdojo/samples/nfr-security-safety-sample.md +1 -1
  218. package/docs/ja/specdojo/samples/nfr-usability-sample.md +1 -1
  219. package/docs/ja/specdojo/samples/ntp-sample.md +1 -1
  220. package/docs/ja/specdojo/samples/opd-sample.md +1 -1
  221. package/docs/ja/specdojo/samples/opr-sample.md +1 -1
  222. package/docs/ja/specdojo/samples/otp-index-sample.md +1 -1
  223. package/docs/ja/specdojo/samples/otp-sample.md +1 -1
  224. package/docs/ja/specdojo/samples/prj-stakeholder-register-sample.md +1 -1
  225. package/docs/ja/specdojo/samples/sac-sample.md +1 -1
  226. package/docs/ja/specdojo/samples/sf-index-sample.md +1 -1
  227. package/docs/ja/specdojo/samples/sf-sample.md +1 -1
  228. package/docs/ja/specdojo/samples/sld-sample.md +1 -1
  229. package/docs/ja/specdojo/samples/stc-index-sample.md +1 -1
  230. package/docs/ja/specdojo/samples/stc-sample.md +1 -1
  231. package/docs/ja/specdojo/samples/stsd-sample.md +1 -1
  232. package/docs/ja/specdojo/samples/sysd-critical-flows-sample.md +1 -1
  233. package/docs/ja/specdojo/samples/sysd-cross-cutting-policy-sample.md +1 -1
  234. package/docs/ja/specdojo/samples/sysd-index-sample.md +1 -1
  235. package/docs/ja/specdojo/samples/tsd-index-sample.md +22 -16
  236. package/docs/ja/specdojo/samples/tsd-sample.md +241 -21
  237. package/docs/ja/specdojo/samples/tsp-index-sample.md +1 -1
  238. package/docs/ja/specdojo/samples/uis-sample.md +1 -1
  239. package/docs/ja/specdojo/samples/utc-index-sample.md +1 -1
  240. package/docs/ja/specdojo/samples/utc-sample.md +1 -1
  241. package/docs/ja/specdojo/standards/document-metadata-standard.md +28 -3
  242. package/docs/ja/specdojo/standards/id-and-file-naming-standard.md +2 -0
  243. package/docs/ja/specdojo/standards/rulebook-authoring-standard.md +16 -11
  244. package/docs/ja/specdojo/standards/sample-authoring-standard.md +1 -0
  245. package/docs/ja/specdojo/templates/ifx-cmd-template.yaml +1 -1
  246. package/docs/ja/specdojo/templates/pjr-dependent-items-template.md +22 -0
  247. package/docs/ja/specdojo/templates/pjr-epic-items-template.md +22 -0
  248. package/docs/ja/specdojo/templates/pjr-epic-template.md +44 -0
  249. package/docs/ja/specdojo/templates/pjr-index-template.md +4 -2
  250. package/docs/specdojo/schemas/v1/bdd.schema.yaml +1 -1
  251. package/docs/specdojo/schemas/v1/deliverable-frontmatter.schema.yaml +24 -16
  252. package/docs/specdojo/schemas/v1/exec-common.schema.yaml +4 -1
  253. package/docs/specdojo/schemas/v1/exec-plan-frontmatter.schema.yaml +1 -1
  254. package/docs/specdojo/schemas/v1/gl.schema.yaml +8 -0
  255. package/docs/specdojo/schemas/v1/ifx-cmd.schema.yaml +5 -1
  256. package/docs/specdojo/schemas/v1/pipeline-state.schema.yaml +2 -1
  257. package/docs/specdojo/schemas/v1/register-events.schema.yaml +18 -0
  258. package/docs/specdojo/schemas/v1/register-item-frontmatter.schema.yaml +40 -3
  259. package/docs/specdojo/schemas/v1/rulebook-frontmatter.schema.yaml +5 -0
  260. package/docs/specdojo/schemas/v1/specdojo-config.schema.yaml +5 -0
  261. package/package.json +2 -2
  262. package/templates/antigravity/orchestrator.md +14 -9
  263. package/templates/claude/agents/specdojo-orchestrator.md +14 -9
  264. package/templates/codex/agents/specdojo-orchestrator.toml +14 -9
  265. package/templates/codex/orchestrator.md +14 -9
  266. package/templates/copilot/README.md +2 -1
  267. package/templates/opencode/agents/specdojo-orchestrator.md +14 -9
@@ -245,6 +245,10 @@ export function productMergeBlockers(product) {
245
245
  blockers.push(block(`uncommitted changes outside the commit scope: ` +
246
246
  leftover.map((path) => `${product.name}:${path}`).join(", ")));
247
247
  }
248
+ // Product-side review owns mergeability and the integration target's checkout.
249
+ // The exec worktree must still be clean before its project-side result is accepted.
250
+ if (product.integrationStrategy === "branch-only")
251
+ return blockers;
248
252
  const target = productIntegrationTarget(product);
249
253
  if (target === "HEAD" || !branchExists(product.repoRoot, target)) {
250
254
  blockers.push(block(`integration branch ${target === "HEAD" ? "(detached HEAD)" : target} is not a local ` +
@@ -419,7 +423,8 @@ function errorMessage(error) {
419
423
  *
420
424
  * 1. check every product that still has commits to integrate and the project (`checkProject`); if
421
425
  * any repository cannot be integrated, nothing is merged
422
- * 2. merge the products in declaration order, skipping those already merged (resume)
426
+ * 2. process products in declaration order: retain branch-only exec branches, otherwise merge,
427
+ * skipping those already merged (resume)
423
428
  * 3. run `beforeProjectMerge` (record and commit the project-side state) and `mergeProject`
424
429
  *
425
430
  * Each repository's state is passed to `record`. The project is recorded as merged before
@@ -436,7 +441,7 @@ export function integrateTaskRepositories(params) {
436
441
  const record = params.record ?? (() => undefined);
437
442
  const order = [...products.map((product) => product.name), PROJECT_REPO_NAME];
438
443
  const done = new Set();
439
- // 統合済み(merge 済み、または統合する変更が無い)のリポジトリ。
444
+ // 処理済み(merge 済み、変更なし、または branch-only の保持)のリポジトリ。
440
445
  const integratedLabels = () => order.filter((name) => done.has(name));
441
446
  const pendingNames = () => order.filter((name) => !done.has(name));
442
447
  const fail = (repo, cause) => {
@@ -450,6 +455,10 @@ export function integrateTaskRepositories(params) {
450
455
  };
451
456
  const states = new Map();
452
457
  for (const product of products) {
458
+ if (product.integrationStrategy === "branch-only") {
459
+ states.set(product.name, "pending");
460
+ continue;
461
+ }
453
462
  const state = productMergeState(product);
454
463
  states.set(product.name, state);
455
464
  if (state === "pending")
@@ -492,6 +501,12 @@ export function integrateTaskRepositories(params) {
492
501
  for (const product of products) {
493
502
  if (states.get(product.name) !== "pending")
494
503
  continue;
504
+ if (product.integrationStrategy === "branch-only") {
505
+ done.add(product.name);
506
+ record(product.name, { status: "branch-only", commit: null, merged_at: null });
507
+ process.stdout.write(` [integrate] ${product.name}: not merged; retained exec branch ${product.branch}\n`);
508
+ continue;
509
+ }
495
510
  let lockDir = "";
496
511
  let commit;
497
512
  try {
@@ -65,11 +65,12 @@ function pullRequestOf(repoRoot, commit) {
65
65
  /** Integration snapshot of one product repository, read from the Git state after integration. */
66
66
  export function productIntegrationTrace(product) {
67
67
  const integrationBranch = productIntegrationTarget(product);
68
- const state = productMergeState(product);
68
+ const state = product.integrationStrategy === "branch-only" ? "branch-only" : productMergeState(product);
69
69
  const commit = state === "merged" ? integrationCommitOf(product, integrationBranch) : null;
70
70
  return {
71
71
  repo: product.name,
72
72
  integrationBranch,
73
+ execBranch: product.branch,
73
74
  state,
74
75
  commit,
75
76
  pullRequest: commit ? pullRequestOf(product.repoRoot, commit) : null,
@@ -81,6 +82,8 @@ function traceRows(key, traces, recordedAt) {
81
82
  `\`${key}\``,
82
83
  `\`${trace.repo}\``,
83
84
  `\`${trace.integrationBranch}\``,
85
+ `\`${trace.execBranch}\``,
86
+ trace.state,
84
87
  trace.pullRequest ?? NOT_APPLICABLE,
85
88
  trace.commit
86
89
  ? `\`${trace.commit}\``
@@ -103,14 +106,24 @@ function renderTable(header, rows) {
103
106
  }
104
107
  /** Body of the trace section (without the heading). */
105
108
  export function renderResultTraceBody(params) {
106
- const table = renderTable(["trace key", "repository", "integration branch", "PR", "commit snapshot", "recorded at"], traceRows(params.traceKey, params.traces, params.recordedAt));
109
+ const table = renderTable([
110
+ "trace key",
111
+ "repository",
112
+ "integration branch",
113
+ "exec branch",
114
+ "state",
115
+ "PR",
116
+ "commit snapshot",
117
+ "recorded at",
118
+ ], traceRows(params.traceKey, params.traces, params.recordedAt));
107
119
  // PJR-9KST: result は利用側プロジェクトの markdownlint 設定で検査され、既定の MD013(80 文字)が
108
120
  // 効くことがある。説明文は文ごとに改行して短く保ち、行長を内容で決められない表だけ MD013 を外す。
109
121
  return [
110
- "runner がプロダクトリポジトリを統合した後に記録した、統合先の commit snapshot です。",
122
+ "runner がプロダクトリポジトリの処理後に記録した状態と、統合先の commit snapshot です。",
111
123
  "プロジェクトリポジトリの統合は、この result を含む merge commit で確認します。",
112
124
  `その merge commit には \`Refs: ${params.traceKey}\` を付けます。`,
113
- "PR が `not applicable` の行は、runner がローカルで統合し PR を経由していません。",
125
+ "`branch-only` の行は未統合です。exec branch を保持し、push と PR 作成はプロダクト側で行います。",
126
+ "PR が `not applicable` の行では、runner は PR を作成していません。",
114
127
  "",
115
128
  "<!-- markdownlint-disable MD013 -->",
116
129
  "",
@@ -774,6 +774,8 @@ export function parseResultTaskIdentity(resultContent) {
774
774
  "recipe-guided",
775
775
  "freeform",
776
776
  "bootstrap",
777
+ "catalog-planning",
778
+ "strategy-planning",
777
779
  "rulebook-authoring",
778
780
  "recipe-authoring",
779
781
  "sample-authoring",
@@ -1,3 +1,4 @@
1
+ import { registerDependencyBlockReason } from "../../register/dependency.js";
1
2
  import { existsSync, readFileSync } from "node:fs";
2
3
  import { basename } from "node:path";
3
4
  import { resolveMemberCommand, } from "../agent-config.js";
@@ -244,6 +245,16 @@ export function registerReporterManagedPaths(registerPaths) {
244
245
  export async function runSingleRegisterItem(context, opts, pjrId) {
245
246
  const { projectId, schedulePath, executionPath, repoRoot } = context;
246
247
  const { registerPaths, item } = resolveRegisterRunTarget(projectId, pjrId);
248
+ const dependencyReason = registerDependencyBlockReason(registerPaths, item);
249
+ if (dependencyReason)
250
+ return {
251
+ id: item.id,
252
+ title: item.title,
253
+ outcome: "skipped",
254
+ transition: "none",
255
+ commit: "skipped",
256
+ reason: dependencyReason,
257
+ };
247
258
  // 状態遷移の書き込み先(登録項目の正本)。commit 対象に必ず含める。
248
259
  const ticketPath = ticketPathFromItem(item, registerPaths.projectRegisterPath);
249
260
  requireRunnableRegisterItem(item);
@@ -1,3 +1,4 @@
1
+ import { registerDependencyBlockReason } from "../../register/dependency.js";
1
2
  import { join } from "node:path";
2
3
  import { loadExecDefaultsConfig, ProviderConcurrencyGate } from "../agent-config.js";
3
4
  import { activateResolvedProjectPaths, resolveProjectPaths } from "../project.js";
@@ -38,12 +39,29 @@ export async function runRegisterMode(opts) {
38
39
  limit: opts.registerLimit,
39
40
  })
40
41
  : undefined;
42
+ const registerPaths = resolveRegisterPaths({ project: projectId });
41
43
  const selectedIds = selectionFilter
42
- ? selectRegisterItems(loadRegisterItems(resolveRegisterPaths({ project: projectId })).map((view) => view.item), selectionFilter).map((item) => item.id)
44
+ ? selectRegisterItems(loadRegisterItems(registerPaths).map((view) => view.item), { ...selectionFilter, limit: undefined })
45
+ .filter((item) => {
46
+ const reason = registerDependencyBlockReason(registerPaths, item);
47
+ if (reason)
48
+ process.stdout.write(`Skipping ${item.id}: ${reason}\n`);
49
+ return !reason;
50
+ })
51
+ .slice(0, selectionFilter.limit)
52
+ .map((item) => item.id)
43
53
  : undefined;
44
54
  const { ids, duplicates } = selectedIds
45
55
  ? { ids: selectedIds, duplicates: [] }
46
56
  : parseRegisterIds(opts.register);
57
+ if (!selectionFilter) {
58
+ for (const id of ids) {
59
+ const target = resolveRegisterRunTarget(projectId, id);
60
+ const reason = registerDependencyBlockReason(target.registerPaths, target.item);
61
+ if (reason)
62
+ throw new Error(`Cannot run ${id}: ${reason}`);
63
+ }
64
+ }
47
65
  const executorSelection = parseRegisterExecutorSelection(opts.executorBy, ids);
48
66
  if (ids.length === 0) {
49
67
  process.stdout.write("No matching register items.\n");
@@ -1,3 +1,4 @@
1
+ import { registerDependencyBlockReason } from "../../register/dependency.js";
1
2
  import { existsSync, readFileSync } from "node:fs";
2
3
  import { resolve } from "node:path";
3
4
  import { qualifyTaskId } from "../shared.js";
@@ -147,6 +148,16 @@ export async function resumeRegisterIntegration(params) {
147
148
  export async function resumeSingleRegisterItemWorktree(context, opts, pjrId, lifecycleLock) {
148
149
  const { projectId, schedulePath, executionPath, repoRoot } = context;
149
150
  const { registerPaths, item } = resolveRegisterRunTarget(projectId, pjrId);
151
+ const dependencyReason = registerDependencyBlockReason(registerPaths, item);
152
+ if (dependencyReason)
153
+ return {
154
+ id: item.id,
155
+ title: item.title,
156
+ outcome: "skipped",
157
+ transition: "none",
158
+ commit: "skipped",
159
+ reason: dependencyReason,
160
+ };
150
161
  const ticketPath = ticketPathFromItem(item, registerPaths.projectRegisterPath);
151
162
  requireRunnableRegisterItem(item);
152
163
  // 再開できない場合は register の状態も worktree も変更せず、理由だけを返す。
@@ -227,6 +238,17 @@ export async function resumeSingleRegisterItemWorktree(context, opts, pjrId, lif
227
238
  // 実行中の状態が root からも見えるようにする(merge 前に解放する)。
228
239
  const begin = async (actor, transitionReason) => {
229
240
  const start = () => {
241
+ const current = resolveRegisterRunTarget(projectId, pjrId);
242
+ const reason = registerDependencyBlockReason(current.registerPaths, current.item);
243
+ if (reason)
244
+ return {
245
+ id: item.id,
246
+ title: item.title,
247
+ outcome: "skipped",
248
+ transition: "none",
249
+ commit: "skipped",
250
+ reason,
251
+ };
230
252
  if (!spawnRegisterTransition(projectId, ["start", "--id", item.id, "--by", actor, "--reason", transitionReason], worktree.path)) {
231
253
  return refuse(`register start failed: ${item.id}`);
232
254
  }
@@ -1,3 +1,4 @@
1
+ import { registerDependencyBlockReason } from "../../register/dependency.js";
1
2
  import { gradeCheckpointPaths } from "../grade-checkpoint.js";
2
3
  import { existsSync, readFileSync } from "node:fs";
3
4
  import { resolve } from "node:path";
@@ -394,6 +395,16 @@ export async function runSingleRegisterItemWorktree(context, opts, pjrId, lifecy
394
395
  const { projectId, schedulePath, executionPath, repoRoot, worktreeBase } = context;
395
396
  const wtContext = { repoRoot, schedulePath, executionPath };
396
397
  const { registerPaths, item } = resolveRegisterRunTarget(projectId, pjrId);
398
+ const dependencyReason = registerDependencyBlockReason(registerPaths, item);
399
+ if (dependencyReason)
400
+ return {
401
+ id: item.id,
402
+ title: item.title,
403
+ outcome: "skipped",
404
+ transition: "none",
405
+ commit: "skipped",
406
+ reason: dependencyReason,
407
+ };
397
408
  // 状態遷移の書き込み先(登録項目の正本)。commit 対象に必ず含める。
398
409
  const ticketPath = ticketPathFromItem(item, registerPaths.projectRegisterPath);
399
410
  requireRunnableRegisterItem(item);
@@ -425,6 +436,18 @@ export async function runSingleRegisterItemWorktree(context, opts, pjrId, lifecy
425
436
  const integrationBranchOverrides = integrationBranchOverrideRecord(opts.integrationBranch);
426
437
  // Phase 1: plan/result 生成 → register start → checkpoint → worktree 作成(root で直列化)。
427
438
  const setup = async () => {
439
+ // Recheck after acquiring the lifecycle lock: dependencies may change while waiting.
440
+ const current = resolveRegisterRunTarget(projectId, pjrId);
441
+ const reason = registerDependencyBlockReason(current.registerPaths, current.item);
442
+ if (reason)
443
+ return {
444
+ id: item.id,
445
+ title: item.title,
446
+ outcome: "skipped",
447
+ transition: "none",
448
+ commit: "skipped",
449
+ reason,
450
+ };
428
451
  // executor が成功した run の worktree を、全体再実行が破棄しないよう保護する。
429
452
  // discardStaleExecWorktree は worktree と exec ブランチを強制削除するため、未コミットの
430
453
  // executor 成果が失われる。この場合は何も壊さずに中断し、再開か明示的な破棄を促す。
@@ -8,6 +8,8 @@ function isApproach(value) {
8
8
  value === "recipe-guided" ||
9
9
  value === "freeform" ||
10
10
  value === "bootstrap" ||
11
+ value === "catalog-planning" ||
12
+ value === "strategy-planning" ||
11
13
  value === "rulebook-authoring" ||
12
14
  value === "recipe-authoring" ||
13
15
  value === "sample-authoring" ||
@@ -69,6 +69,7 @@ export function resolveProductRepos(rootDir, project, integrationBranches) {
69
69
  name: repo.name,
70
70
  repoRoot: resolveRepoRoot(rootDir, repo),
71
71
  ...(integrationBranch ? { integrationBranch } : {}),
72
+ ...(repo.integration_strategy ? { integrationStrategy: repo.integration_strategy } : {}),
72
73
  install: repo.setup?.install ?? true,
73
74
  build: repo.setup?.build ?? true,
74
75
  };
@@ -101,6 +102,7 @@ export function configuredProductCheckouts(schedulePath) {
101
102
  branch: productIntegrationTarget(product),
102
103
  created: false,
103
104
  ...(product.integrationBranch ? { integrationBranch: product.integrationBranch } : {}),
105
+ ...(product.integrationStrategy ? { integrationStrategy: product.integrationStrategy } : {}),
104
106
  }));
105
107
  }
106
108
  /**
@@ -193,6 +195,7 @@ function toProductWorktree(product, worktree) {
193
195
  branch: worktree.branch,
194
196
  created: worktree.created,
195
197
  ...(product.integrationBranch ? { integrationBranch: product.integrationBranch } : {}),
198
+ ...(product.integrationStrategy ? { integrationStrategy: product.integrationStrategy } : {}),
196
199
  };
197
200
  }
198
201
  /** Registered product worktrees of a task (repositories without one are omitted). */
@@ -282,7 +285,7 @@ export function productWorktreeRemovalBlockers(worktree) {
282
285
  if (dirty.length > 0) {
283
286
  blockers.push(`${product.name} has uncommitted changes: ${dirty.map((path) => `${product.name}:${path}`).join(", ")}`);
284
287
  }
285
- if (!isMergedIntoTarget(product)) {
288
+ if (product.integrationStrategy !== "branch-only" && !isMergedIntoTarget(product)) {
286
289
  blockers.push(`${product.name}: exec branch ${product.branch} is not merged into ${productIntegrationTarget(product)}`);
287
290
  }
288
291
  }
@@ -291,21 +294,22 @@ export function productWorktreeRemovalBlockers(worktree) {
291
294
  /** Remove product worktrees (and optionally their branches). Callers check blockers first. */
292
295
  export function removeProductWorktrees(params) {
293
296
  for (const product of params.worktree.repos ?? []) {
297
+ const deleteBranch = params.deleteBranch && product.integrationStrategy !== "branch-only";
294
298
  if (params.dryRun) {
295
299
  process.stdout.write(`[dry-run] git -C ${product.repoRoot} worktree remove --force ${product.path}\n`);
296
- if (params.deleteBranch) {
300
+ if (deleteBranch) {
297
301
  process.stdout.write(`[dry-run] git -C ${product.repoRoot} branch -d ${product.branch}\n`);
298
302
  }
299
303
  continue;
300
304
  }
301
305
  if (existsSync(product.path)) {
302
- // Guards (clean + merged) already ran; leftovers are ignored/regenerable files.
306
+ // Guards (clean, and merged unless branch-only) already ran.
303
307
  gitOutput(product.repoRoot, ["worktree", "remove", "--force", product.path]);
304
308
  }
305
309
  else {
306
310
  gitResult(product.repoRoot, ["worktree", "prune"]);
307
311
  }
308
- if (params.deleteBranch) {
312
+ if (deleteBranch) {
309
313
  // `-d` compares with the main checkout's HEAD, which may differ from integration_branch.
310
314
  // Use `-D` only for a branch verified to be merged into its integration target; otherwise
311
315
  // keep Git's safe `-d` so unintegrated product work is never deleted.
@@ -334,6 +338,16 @@ export function removeEmptyTaskDirectory(worktree) {
334
338
  * or cancelled lifecycle). Mirrors discardStaleExecWorktree for each product repository.
335
339
  */
336
340
  export function discardStaleProductWorktrees(products, taskId) {
341
+ // A retained branch is product-side review work, not abandoned scheduler residue.
342
+ // Check every product before removing anything, including a previous task's project worktree.
343
+ for (const product of products) {
344
+ if (product.integrationStrategy === "branch-only" &&
345
+ existsSync(product.repoRoot) &&
346
+ execBranchExists(product.repoRoot, taskId)) {
347
+ throw new Error(`${product.name}: retained exec branch exec/${worktreeNameFromTaskId(taskId)} already exists; ` +
348
+ `resume the existing run or finish product-side review and rename/remove the branch before a fresh run`);
349
+ }
350
+ }
337
351
  const discarded = [];
338
352
  for (const product of products) {
339
353
  if (!existsSync(product.repoRoot))
@@ -9,6 +9,7 @@ import { agentProtectedConfigPaths, agentProtectedConfigViolation, qualifiedRepo
9
9
  import { recordProtectedConfigBlockAcrossRepos } from "./protection-handoff.js";
10
10
  import { assertNoPendingProductChanges, productIntegrationTarget } from "./task-repos.js";
11
11
  import { specdojoPackageRootDir } from "../shared/package-paths.js";
12
+ import { DEFAULT_MARKDOWNLINT_CONFIG, hasMarkdownlintConfig, } from "../shared/markdownlint-config.js";
12
13
  import { repoRelative, stageCommitTargets, worktreeStatusPaths as statusPaths, } from "../shared/git.js";
13
14
  export { repoRelative, selectStageablePaths, stageCommitTargets, worktreeStatusPaths, } from "../shared/git.js";
14
15
  import { appendGitFailureLog, appendGitResultFailureLog, formatGitResultFailure, gitEnvironment, gitOutput, gitResult, summarizeGitHookFailure, worktreeNameFromTaskId, } from "./worktree.js";
@@ -442,7 +443,12 @@ export function assertResultMarkdownlint(context, worktree, taskId) {
442
443
  process.stdout.write(`result-markdownlint: markdownlint-cli not found; skipped pre-commit lint of ${resultRel}\n`);
443
444
  return;
444
445
  }
445
- const result = spawnSync(executable, [resultRel], {
446
+ // Only supply defaults when markdownlint-cli has no repository configuration.
447
+ // --disable is followed by -- so the result path is not consumed as a rule name.
448
+ const args = hasMarkdownlintConfig(worktree.path)
449
+ ? [resultRel]
450
+ : ["--disable", ...Object.keys(DEFAULT_MARKDOWNLINT_CONFIG), "--", resultRel];
451
+ const result = spawnSync(executable, args, {
446
452
  cwd: worktree.path,
447
453
  encoding: "utf8",
448
454
  env: gitEnvironment(),
@@ -5,7 +5,7 @@ import { dump } from "../shared/yaml.js";
5
5
  import { extractJsonText } from "../shared/agent-response.js";
6
6
  import { CRITERION_ID_RE, CRITERION_STATUSES, DONE_CRITERIA_SCHEMA, SEVERITY_LEVEL_CAP, agentViewpoints, correctViewpointLevels, isRecord, levelCapForFindings, parseMarkdown, preserveStoredFindingSeverities, sanitizeCommentText, } from "./core.js";
7
7
  import { applicableDoneCriteria, deterministicResults, gradePlanFilename } from "./plan.js";
8
- import { gradeContentHash, gradeResultPath, markdownDocumentId, readGradeResult, writeGradeResult, } from "./result.js";
8
+ import { gradeContentHash, gradeResultPathForDocument, markdownDocumentId, readGradeResult, writeGradeResult, } from "./result.js";
9
9
  import { gradeMarkdownDocument, resolveGradeReferenceId, scoreDocument, summarizeDoneCriteria, } from "./markdown.js";
10
10
  import { assertRubric, createGradeSourceContext, gradeSourceHashes, repoRelativePath, resolveSafeMarkdownPath, resolveSafeRepositoryPath, } from "./targets.js";
11
11
  import { specdojoRootDir } from "../shared/specdojo-config.js";
@@ -575,7 +575,11 @@ export function applyGradeSubmission(opts) {
575
575
  }
576
576
  if (opts.resultsDirectory) {
577
577
  const documentId = markdownDocumentId(current, rel);
578
- const resultPath = gradeResultPath(opts.resultsDirectory, documentId);
578
+ const resultPath = gradeResultPathForDocument({
579
+ documentPath: absolute,
580
+ project: opts.project,
581
+ resultsDirectory: opts.resultsDirectory,
582
+ });
579
583
  const previous = readGradeResult(resultPath);
580
584
  const document = parseMarkdown(current, rel);
581
585
  const agentResults = preserveStoredFindingSeverities(previous, input.viewpoints);
@@ -2,7 +2,7 @@ import { readFileSync, writeFileSync } from "node:fs";
2
2
  import { FINDING_RE, insertFindings, isRecord, legacyInlineContentHash, parseMarkdown, preservePreviousFindingSeverities, serializeMarkdown, withoutFindingComments, } from "./core.js";
3
3
  import { discoverGradeTargets } from "./target-discovery.js";
4
4
  import { applicableDoneCriteria, deterministicResults } from "./plan.js";
5
- import { gradeContentHash, gradeResultPath, markdownDocumentId, readGradeResultForDocument, resolveGradeResultsDirectory, validateGradeResult, writeGradeResult, } from "./result.js";
5
+ import { gradeContentHash, gradeResultPathForDocument, markdownDocumentId, readGradeResultForDocument, resolveGradeResultsDirectory, validateGradeResult, writeGradeResult, } from "./result.js";
6
6
  import { assertRubric, relativePathFromRoot, repoRelativePath, resolveSafeMarkdownPath, } from "./targets.js";
7
7
  import { specdojoRootDir } from "../shared/specdojo-config.js";
8
8
  export function scoreDocument(input, rubric, doc, target) {
@@ -265,7 +265,12 @@ export function migrateInlineGrades(opts) {
265
265
  findings,
266
266
  ...(isRecord(legacyGrade.done_criteria) ? { done_criteria: legacyGrade.done_criteria } : {}),
267
267
  };
268
- const resultPath = gradeResultPath(resultsDirectory, documentId);
268
+ const resultPath = gradeResultPathForDocument({
269
+ documentPath: absolute,
270
+ project: opts.project,
271
+ rootDir,
272
+ resultsDirectory,
273
+ });
269
274
  if (writeGradeResult(resultPath, result, opts.dryRun)) {
270
275
  changed.push(repoRelativePath(resultPath));
271
276
  }
@@ -4,7 +4,7 @@ import { specdojoRootDir } from "../shared/specdojo-config.js";
4
4
  import { basename, extname, join } from "node:path";
5
5
  import { dump } from "../shared/yaml.js";
6
6
  import { GRADE_PLAN_EMBEDDED_DOCUMENT_CHARACTER_LIMIT, agentViewpoints, gradedViewpoints, levelCapForFindings, parseMarkdown, } from "./core.js";
7
- import { gradeResultPath, readGradeResult, readGradeResultForDocument } from "./result.js";
7
+ import { gradeResultPathForDocument, readGradeResult } from "./result.js";
8
8
  import { assertRubric, loadKataReferences, parseGradeReferenceExample, repoRelativePath, resolveGradeReferencePathsFromCatalog, resolveSafeMarkdownPath, resolveSafeRepositoryPath, selectGradeReferenceExampleFromCatalog, } from "./targets.js";
9
9
  import { viewpointAppliesToDocument } from "../review/plan.js";
10
10
  export function deterministicResults(document, definitions, target) {
@@ -145,9 +145,11 @@ function renderGradePlanWithEmbedding(opts) {
145
145
  const metadata = document.data.specdojo;
146
146
  const viewpoints = agentViewpoints(opts.viewpoints, opts.target, metadata);
147
147
  const documentId = typeof metadata.id === "string" ? metadata.id : rel;
148
- const priorFindings = (opts.resultsDirectory
149
- ? readGradeResult(gradeResultPath(opts.resultsDirectory, documentId))
150
- : readGradeResultForDocument({ documentPath: rel, project: opts.projectId }))?.findings ?? [];
148
+ const priorFindings = readGradeResult(gradeResultPathForDocument({
149
+ documentPath: absolute,
150
+ project: opts.projectId,
151
+ resultsDirectory: opts.resultsDirectory,
152
+ }))?.findings ?? [];
151
153
  const taskHash = createHash("sha256").update(rel).digest("hex").slice(0, 12).toUpperCase();
152
154
  const taskId = `GRADE-${opts.target.toUpperCase()}-${taskHash}`;
153
155
  const references = (opts.references ?? []).map((reference) => repoRelativePath(resolveSafeRepositoryPath(reference, "reference")));
@@ -10,6 +10,7 @@ import { load } from "../shared/yaml.js";
10
10
  import { assertAuthorableKataId, authoredKataExists, authoringKind } from "../kata/authoring.js";
11
11
  import { CATALOG_LESS_APPROACHES, resolveRegisterDeliverableTarget } from "./deliverable-target.js";
12
12
  import { resolveAuthoringSources } from "./authoring-sources.js";
13
+ import { isPlanningApproach, validatePlanningTarget } from "./planning.js";
13
14
  const MAINTENANCE_TARGET_KIND = {
14
15
  "rulebook-maintenance": "rulebook",
15
16
  "recipe-maintenance": "recipe",
@@ -98,6 +99,17 @@ export function validateRegisterApproachTargets(opts) {
98
99
  return;
99
100
  if (targets.length === 0)
100
101
  return;
102
+ if (isPlanningApproach(approach)) {
103
+ validatePlanningTarget({
104
+ repoRoot: opts.repoRoot,
105
+ approach,
106
+ target: targets[0],
107
+ project: opts.project ??
108
+ loadConfig(opts.repoRoot).config?.projects[opts.projectId] ??
109
+ (opts.catalogPath ? { catalog_path: opts.catalogPath } : {}),
110
+ });
111
+ return;
112
+ }
101
113
  const entries = collectDocIndexEntries(resolve(opts.repoRoot, "docs"), opts.repoRoot);
102
114
  if (!approach) {
103
115
  for (const target of targets) {
@@ -131,6 +143,13 @@ export function validateRegisterApproachTargets(opts) {
131
143
  if (!indexedPath) {
132
144
  throw new Error(`Target document id is not resolvable via the document index: ${targetId}`);
133
145
  }
146
+ // sample は見本にする成果物の type を持つため、種類は ID の命名で判定する。
147
+ if (expectedKind === "sample") {
148
+ if (!targetId.endsWith("-sample")) {
149
+ throw new Error(`Approach "${approach}" requires a sample document target with an id ending in -sample: ${targetId}`);
150
+ }
151
+ return;
152
+ }
134
153
  const actualKind = targetDocumentType(resolvedIndexPath(opts.repoRoot, indexedPath));
135
154
  if (actualKind !== expectedKind) {
136
155
  throw new Error(`Approach "${approach}" requires a ${expectedKind} document target, but ${targetId} has type "${actualKind ?? "unknown"}"`);
@@ -0,0 +1,49 @@
1
+ import { loadRegisterItemDocs } from "./item.js";
2
+ import { planningTarget } from "./planning.js";
3
+ // No state is persisted: reopened tickets are reflected on the next build as well.
4
+ export function deriveTimelineCatalogStatus(tracks, items) {
5
+ const byDomain = new Map();
6
+ for (const item of items) {
7
+ if (item.type !== "todo" || item.approach !== "catalog-planning")
8
+ continue;
9
+ if (item.status === "rejected" || item.status === "deferred")
10
+ continue;
11
+ if (item.targets?.length !== 1)
12
+ continue;
13
+ const domain = planningTarget(item.approach, item.targets[0]);
14
+ const status = item.status === "done" ? "primary" : item.status === "open" ? "not_started" : "draft";
15
+ const values = byDomain.get(domain) ?? [];
16
+ values.push(status);
17
+ byDomain.set(domain, values);
18
+ }
19
+ const warnings = [];
20
+ return {
21
+ tracks: tracks.map((track) => {
22
+ if (!track.domains.some((domain) => byDomain.has(domain)))
23
+ return { ...track };
24
+ const statuses = track.domains.map((domain) => {
25
+ const values = byDomain.get(domain);
26
+ if (!values)
27
+ return track.catalog_status;
28
+ return values.includes("primary")
29
+ ? "primary"
30
+ : values.includes("draft")
31
+ ? "draft"
32
+ : "not_started";
33
+ });
34
+ const status = statuses.every((value) => value === "primary")
35
+ ? "primary"
36
+ : statuses.some((value) => value !== "not_started")
37
+ ? "draft"
38
+ : "not_started";
39
+ if (status !== track.catalog_status) {
40
+ warnings.push(`${track.track}: register-derived catalog_status is ${status}, but tml-index.yaml declares ${track.catalog_status}; using register-derived status (tml-index.yaml is unchanged)`);
41
+ }
42
+ return { ...track, catalog_status: status };
43
+ }),
44
+ warnings,
45
+ };
46
+ }
47
+ export function resolveTimelineCatalogStatus(tracks, registerPath) {
48
+ return deriveTimelineCatalogStatus(tracks, registerPath ? loadRegisterItemDocs(registerPath).map((doc) => doc.item) : []);
49
+ }
@@ -257,6 +257,7 @@ export function formatTableRow(item) {
257
257
  item.completed,
258
258
  item.conclusion,
259
259
  item.ticket,
260
+ item.dependsOn?.join(", ") || CELL_NONE,
260
261
  ]
261
262
  .map(toCell)
262
263
  .map(inlineCodeAnglePlaceholders);
@@ -367,6 +368,7 @@ export function buildRegisterItemContent(opts) {
367
368
  title: opts.fields.title,
368
369
  description: opts.fields.description,
369
370
  type: opts.fields.type,
371
+ ...(opts.fields.track ? { track: opts.fields.track } : {}),
370
372
  priority: opts.fields.priority,
371
373
  ...(opts.fields.difficulty ? { difficulty: opts.fields.difficulty } : {}),
372
374
  owner: opts.fields.owner,
@@ -381,5 +383,6 @@ export function buildRegisterItemContent(opts) {
381
383
  ...(opts.fields.targetRulebook ? { targetRulebook: opts.fields.targetRulebook } : {}),
382
384
  ...(opts.fields.sources ? { sources: opts.fields.sources } : {}),
383
385
  ...(opts.fields.derivedFrom ? { derivedFrom: opts.fields.derivedFrom } : {}),
386
+ ...(opts.fields.dependsOn ? { dependsOn: opts.fields.dependsOn } : {}),
384
387
  }));
385
388
  }