specdojo 0.8.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) hide show
  1. package/.github/agents/specdojo-orchestrator.md +4 -1
  2. package/CHANGELOG.md +77 -0
  3. package/dist/catalog/catalog.js +16 -14
  4. package/dist/commands/agent.js +5 -3
  5. package/dist/commands/build.js +69 -10
  6. package/dist/commands/git.js +206 -0
  7. package/dist/commands/init.js +4 -2
  8. package/dist/commands/orchestrator.js +5 -77
  9. package/dist/commands/where.js +25 -0
  10. package/dist/dashboard/dashboard.js +5 -3
  11. package/dist/dashboard/routines.js +4 -7
  12. package/dist/dashboard/shared.js +2 -2
  13. package/dist/dashboard/timeline.js +14 -14
  14. package/dist/deliverable/trash.js +2 -1
  15. package/dist/docs/index-command.js +2 -2
  16. package/dist/docs/yaml-business-tables.js +243 -0
  17. package/dist/docs/yaml-interface-tables.js +106 -0
  18. package/dist/docs/yaml-pages-command.js +5 -3
  19. package/dist/docs/yaml-pages.js +146 -3
  20. package/dist/docs/yaml-table-shared.js +70 -0
  21. package/dist/docs/yaml-tables.js +39 -0
  22. package/dist/exec/agent-config.js +9 -0
  23. package/dist/exec/agent-protected-config.js +2 -0
  24. package/dist/exec/commands.js +31 -18
  25. package/dist/exec/events.js +34 -14
  26. package/dist/exec/evidence.js +13 -3
  27. package/dist/exec/opencode-permissions.js +117 -0
  28. package/dist/exec/parent-validation.js +56 -3
  29. package/dist/exec/plans-core.js +21 -2
  30. package/dist/exec/plans-generation.js +6 -7
  31. package/dist/exec/post-integration.js +162 -0
  32. package/dist/exec/queue-command.js +166 -0
  33. package/dist/exec/queue.js +285 -0
  34. package/dist/exec/register-foreign-wait.js +82 -0
  35. package/dist/exec/repo-integration-sync.js +17 -5
  36. package/dist/exec/repo-trace.js +2 -1
  37. package/dist/exec/reporter.js +2 -2
  38. package/dist/exec/results.js +24 -4
  39. package/dist/exec/review-kata.js +4 -1
  40. package/dist/exec/run/agent-pipeline.js +3 -2
  41. package/dist/exec/run/agent.js +12 -6
  42. package/dist/exec/run/change-scope.js +365 -0
  43. package/dist/exec/run/deferred-cleanup.js +31 -0
  44. package/dist/exec/run/in-place.js +5 -2
  45. package/dist/exec/run/job-lock.js +66 -0
  46. package/dist/exec/run/job-sequence.js +137 -0
  47. package/dist/exec/run/job.js +56 -19
  48. package/dist/exec/run/lifecycle-commands.js +1 -1
  49. package/dist/exec/run/lock.js +22 -1
  50. package/dist/exec/run/register-command.js +8 -5
  51. package/dist/exec/run/register-mode.js +68 -8
  52. package/dist/exec/run/register-resume.js +68 -14
  53. package/dist/exec/run/register-state.js +13 -8
  54. package/dist/exec/run/register-worktree.js +140 -125
  55. package/dist/exec/run/schedule-mode.js +75 -14
  56. package/dist/exec/run/schedule-prepare.js +3 -0
  57. package/dist/exec/run/schedule-task.js +88 -38
  58. package/dist/exec/run/shared.js +5 -0
  59. package/dist/exec/schedule/schedule.js +116 -4
  60. package/dist/exec/shared.js +2 -2
  61. package/dist/exec/smoke.js +190 -0
  62. package/dist/exec/strategy.js +13 -3
  63. package/dist/exec/task-repos.js +19 -4
  64. package/dist/exec/task-view.js +6 -4
  65. package/dist/exec/trial-commands.js +5 -2
  66. package/dist/exec/trial-core.js +6 -1
  67. package/dist/exec/validation-metrics.js +181 -0
  68. package/dist/exec/worktree-cleanup-lock.js +26 -0
  69. package/dist/exec/worktree-command.js +12 -2
  70. package/dist/exec/worktree-ops-commit.js +2 -2
  71. package/dist/exec/worktree.js +13 -2
  72. package/dist/grade/command-apply.js +3 -3
  73. package/dist/grade/command-inspect.js +5 -3
  74. package/dist/grade/command-plan.js +1 -1
  75. package/dist/grade/command-run.js +5 -1
  76. package/dist/grade/run.js +64 -8
  77. package/dist/job/definition.js +84 -8
  78. package/dist/job/job.js +79 -23
  79. package/dist/register/authoring-sources.js +22 -16
  80. package/dist/register/maintenance-commands.js +2 -2
  81. package/dist/register/register.js +31 -7
  82. package/dist/register/renumber.js +1 -3
  83. package/dist/routine/definition.js +9 -0
  84. package/dist/routine/routine.js +137 -43
  85. package/dist/routine/status.js +62 -0
  86. package/dist/schedule/schedule.js +38 -39
  87. package/dist/shared/agent-types.js +5 -0
  88. package/dist/shared/cross-process-lock.js +9 -1
  89. package/dist/shared/dist-freshness.js +8 -2
  90. package/dist/shared/git-environment.js +2 -1
  91. package/dist/shared/git.js +44 -1
  92. package/dist/shared/lefthook-scaffold.js +3 -0
  93. package/dist/shared/local-config.js +244 -0
  94. package/dist/shared/specdojo-config.js +34 -20
  95. package/dist/shared/specdojo-gitignore.js +1 -0
  96. package/dist/shared/text.js +17 -1
  97. package/dist/shared/where-alias.js +13 -0
  98. package/dist/specdojo.js +4 -0
  99. package/docs/ja/specdojo/defaults/pm-review-viewpoints.yaml +2 -0
  100. package/docs/ja/specdojo/guides/exec-config-guide.md +23 -4
  101. package/docs/ja/specdojo/guides/exec-operation-guide.md +44 -1
  102. package/docs/ja/specdojo/guides/job-sequence-guide.md +77 -0
  103. package/docs/ja/specdojo/guides/orchestrator-operation-guide.md +1 -1
  104. package/docs/ja/specdojo/guides/quick-start-guide.md +3 -3
  105. package/docs/ja/specdojo/guides/register-operation-guide.md +1 -1
  106. package/docs/ja/specdojo/guides/routine-operation-guide.md +11 -6
  107. package/docs/ja/specdojo/guides/schedule-design-guide.md +20 -17
  108. package/docs/ja/specdojo/guides/waza-guide.md +12 -8
  109. package/docs/ja/specdojo/recipes/bac-recipe.md +66 -49
  110. package/docs/ja/specdojo/recipes/bes-recipe.md +90 -54
  111. package/docs/ja/specdojo/recipes/bps-recipe.md +88 -139
  112. package/docs/ja/specdojo/recipes/br-recipe.md +40 -47
  113. package/docs/ja/specdojo/recipes/cdfd-overview-recipe.md +97 -109
  114. package/docs/ja/specdojo/recipes/cdfd-recipe.md +85 -146
  115. package/docs/ja/specdojo/recipes/cdfd-uc-recipe.md +91 -110
  116. package/docs/ja/specdojo/recipes/cnd-recipe.md +79 -69
  117. package/docs/ja/specdojo/recipes/cpd-recipe.md +78 -64
  118. package/docs/ja/specdojo/recipes/cxd-recipe.md +92 -75
  119. package/docs/ja/specdojo/recipes/ifd-recipe.md +79 -68
  120. package/docs/ja/specdojo/recipes/ifx-cmd-recipe.md +78 -105
  121. package/docs/ja/specdojo/recipes/ifx-index-recipe.md +105 -71
  122. package/docs/ja/specdojo/recipes/pm-communication-plan-recipe.md +60 -49
  123. package/docs/ja/specdojo/recipes/pm-members-recipe.md +50 -51
  124. package/docs/ja/specdojo/recipes/pm-organization-recipe.md +59 -51
  125. package/docs/ja/specdojo/recipes/pm-plan-recipe.md +69 -56
  126. package/docs/ja/specdojo/recipes/pm-quality-management-plan-recipe.md +37 -56
  127. package/docs/ja/specdojo/recipes/pm-raci-recipe.md +39 -53
  128. package/docs/ja/specdojo/recipes/pm-roles-recipe.md +52 -79
  129. package/docs/ja/specdojo/recipes/prj-assumptions-constraints-dependencies-recipe.md +64 -93
  130. package/docs/ja/specdojo/recipes/prj-charter-recipe.md +71 -106
  131. package/docs/ja/specdojo/recipes/prj-comparison-of-alternatives-recipe.md +78 -157
  132. package/docs/ja/specdojo/recipes/prj-issues-and-approach-recipe.md +62 -111
  133. package/docs/ja/specdojo/recipes/prj-scope-recipe.md +67 -123
  134. package/docs/ja/specdojo/recipes/prj-stakeholder-register-recipe.md +60 -96
  135. package/docs/ja/specdojo/recipes/prj-success-criteria-and-acceptance-criteria-recipe.md +61 -105
  136. package/docs/ja/specdojo/recipes/stsd-recipe.md +79 -109
  137. package/docs/ja/specdojo/recipes/sysd-critical-flows-recipe.md +78 -55
  138. package/docs/ja/specdojo/recipes/sysd-cross-cutting-policy-recipe.md +82 -73
  139. package/docs/ja/specdojo/recipes/sysd-index-recipe.md +78 -59
  140. package/docs/ja/specdojo/recipes/tsd-recipe.md +149 -129
  141. package/docs/ja/specdojo/references/command-reference.md +258 -118
  142. package/docs/ja/specdojo/references/deliverables-reference.md +21 -12
  143. package/docs/ja/specdojo/references/specdojo-config-reference.md +47 -10
  144. package/docs/ja/specdojo/rulebooks/atc-index-rulebook.md +101 -257
  145. package/docs/ja/specdojo/rulebooks/atc-rulebook.md +102 -228
  146. package/docs/ja/specdojo/rulebooks/bac-rulebook.md +19 -28
  147. package/docs/ja/specdojo/rulebooks/bdd-rulebook.md +16 -67
  148. package/docs/ja/specdojo/rulebooks/bds-rulebook.md +30 -51
  149. package/docs/ja/specdojo/rulebooks/bes-index-rulebook.md +41 -61
  150. package/docs/ja/specdojo/rulebooks/bes-rulebook.md +22 -50
  151. package/docs/ja/specdojo/rulebooks/bps-rulebook.md +24 -56
  152. package/docs/ja/specdojo/rulebooks/br-rulebook.md +13 -38
  153. package/docs/ja/specdojo/rulebooks/ccd-mermaid-rulebook.md +41 -76
  154. package/docs/ja/specdojo/rulebooks/cdfd-d2-rulebook.md +18 -93
  155. package/docs/ja/specdojo/rulebooks/cdfd-mermaid-rulebook.md +18 -52
  156. package/docs/ja/specdojo/rulebooks/cdfd-overview-rulebook.md +109 -147
  157. package/docs/ja/specdojo/rulebooks/cdfd-rulebook.md +80 -108
  158. package/docs/ja/specdojo/rulebooks/cdfd-uc-rulebook.md +21 -46
  159. package/docs/ja/specdojo/rulebooks/cdr-rulebook.md +144 -0
  160. package/docs/ja/specdojo/rulebooks/cdsd-rulebook.md +27 -48
  161. package/docs/ja/specdojo/rulebooks/cdt-rulebook.md +37 -50
  162. package/docs/ja/specdojo/rulebooks/clis-rulebook.md +52 -69
  163. package/docs/ja/specdojo/rulebooks/cnd-mermaid-rulebook.md +33 -86
  164. package/docs/ja/specdojo/rulebooks/cnd-rulebook.md +16 -32
  165. package/docs/ja/specdojo/rulebooks/cop-index-rulebook.md +45 -131
  166. package/docs/ja/specdojo/rulebooks/cop-rulebook.md +69 -275
  167. package/docs/ja/specdojo/rulebooks/cpd-mermaid-rulebook.md +20 -112
  168. package/docs/ja/specdojo/rulebooks/cpd-rulebook.md +23 -56
  169. package/docs/ja/specdojo/rulebooks/cxd-mermaid-rulebook.md +12 -145
  170. package/docs/ja/specdojo/rulebooks/cxd-rulebook.md +39 -47
  171. package/docs/ja/specdojo/rulebooks/dct-index-rulebook.md +37 -56
  172. package/docs/ja/specdojo/rulebooks/dct-rulebook.md +118 -175
  173. package/docs/ja/specdojo/rulebooks/dec-rulebook.md +5 -14
  174. package/docs/ja/specdojo/rulebooks/dmd-index-rulebook.md +22 -66
  175. package/docs/ja/specdojo/rulebooks/dmd-rulebook.md +36 -94
  176. package/docs/ja/specdojo/rulebooks/dss-rulebook.md +59 -81
  177. package/docs/ja/specdojo/rulebooks/etc-index-rulebook.md +31 -131
  178. package/docs/ja/specdojo/rulebooks/etc-rulebook.md +50 -104
  179. package/docs/ja/specdojo/rulebooks/gl-rulebook.md +51 -61
  180. package/docs/ja/specdojo/rulebooks/ifd-mermaid-rulebook.md +38 -45
  181. package/docs/ja/specdojo/rulebooks/ifx-api-rulebook.md +14 -20
  182. package/docs/ja/specdojo/rulebooks/ifx-cmd-rulebook.md +26 -38
  183. package/docs/ja/specdojo/rulebooks/ifx-file-rulebook.md +26 -107
  184. package/docs/ja/specdojo/rulebooks/ifx-index-rulebook.md +42 -49
  185. package/docs/ja/specdojo/rulebooks/ifx-msg-rulebook.md +14 -22
  186. package/docs/ja/specdojo/rulebooks/imp-business-rulebook.md +21 -44
  187. package/docs/ja/specdojo/rulebooks/imp-data-rulebook.md +41 -64
  188. package/docs/ja/specdojo/rulebooks/imp-interface-rulebook.md +14 -38
  189. package/docs/ja/specdojo/rulebooks/imp-operations-rulebook.md +34 -61
  190. package/docs/ja/specdojo/rulebooks/imp-test-rulebook.md +27 -50
  191. package/docs/ja/specdojo/rulebooks/itc-index-rulebook.md +70 -199
  192. package/docs/ja/specdojo/rulebooks/itc-rulebook.md +65 -153
  193. package/docs/ja/specdojo/rulebooks/mip-index-rulebook.md +74 -150
  194. package/docs/ja/specdojo/rulebooks/mm-rulebook.md +11 -23
  195. package/docs/ja/specdojo/rulebooks/mtp-rulebook.md +99 -176
  196. package/docs/ja/specdojo/rulebooks/nfr-availability-rulebook.md +35 -61
  197. package/docs/ja/specdojo/rulebooks/nfr-index-rulebook.md +75 -117
  198. package/docs/ja/specdojo/rulebooks/nfr-integrity-rulebook.md +31 -60
  199. package/docs/ja/specdojo/rulebooks/nfr-maintainability-rulebook.md +26 -81
  200. package/docs/ja/specdojo/rulebooks/nfr-operations-rulebook.md +32 -70
  201. package/docs/ja/specdojo/rulebooks/nfr-performance-rulebook.md +45 -87
  202. package/docs/ja/specdojo/rulebooks/nfr-reliability-rulebook.md +48 -101
  203. package/docs/ja/specdojo/rulebooks/nfr-security-safety-rulebook.md +44 -80
  204. package/docs/ja/specdojo/rulebooks/nfr-usability-rulebook.md +59 -127
  205. package/docs/ja/specdojo/rulebooks/opd-index-rulebook.md +31 -50
  206. package/docs/ja/specdojo/rulebooks/opd-rulebook.md +42 -109
  207. package/docs/ja/specdojo/rulebooks/opr-index-rulebook.md +29 -42
  208. package/docs/ja/specdojo/rulebooks/opr-rulebook.md +29 -87
  209. package/docs/ja/specdojo/rulebooks/otp-index-rulebook.md +62 -84
  210. package/docs/ja/specdojo/rulebooks/otp-rulebook.md +11 -61
  211. package/docs/ja/specdojo/rulebooks/pjr-rulebook.md +91 -106
  212. package/docs/ja/specdojo/rulebooks/pm-change-request-log-rulebook.md +25 -34
  213. package/docs/ja/specdojo/rulebooks/pm-communication-plan-rulebook.md +30 -53
  214. package/docs/ja/specdojo/rulebooks/pm-issue-log-rulebook.md +23 -35
  215. package/docs/ja/specdojo/rulebooks/pm-members-rulebook.md +27 -45
  216. package/docs/ja/specdojo/rulebooks/pm-organization-rulebook.md +37 -45
  217. package/docs/ja/specdojo/rulebooks/pm-plan-rulebook.md +45 -46
  218. package/docs/ja/specdojo/rulebooks/pm-quality-management-plan-rulebook.md +37 -48
  219. package/docs/ja/specdojo/rulebooks/pm-raci-rulebook.md +25 -29
  220. package/docs/ja/specdojo/rulebooks/pm-risk-register-rulebook.md +28 -35
  221. package/docs/ja/specdojo/rulebooks/pm-roles-rulebook.md +36 -41
  222. package/docs/ja/specdojo/rulebooks/pr-rulebook.md +5 -18
  223. package/docs/ja/specdojo/rulebooks/prj-assumptions-constraints-dependencies-rulebook.md +16 -37
  224. package/docs/ja/specdojo/rulebooks/prj-charter-rulebook.md +23 -97
  225. package/docs/ja/specdojo/rulebooks/prj-comparison-of-alternatives-rulebook.md +39 -57
  226. package/docs/ja/specdojo/rulebooks/prj-issues-and-approach-rulebook.md +43 -116
  227. package/docs/ja/specdojo/rulebooks/prj-scope-rulebook.md +16 -51
  228. package/docs/ja/specdojo/rulebooks/prj-stakeholder-register-rulebook.md +47 -92
  229. package/docs/ja/specdojo/rulebooks/prj-success-criteria-and-acceptance-criteria-rulebook.md +25 -84
  230. package/docs/ja/specdojo/rulebooks/sac-rulebook.md +44 -107
  231. package/docs/ja/specdojo/rulebooks/sf-index-rulebook.md +39 -49
  232. package/docs/ja/specdojo/rulebooks/sf-rulebook.md +42 -49
  233. package/docs/ja/specdojo/rulebooks/sld-rulebook.md +64 -89
  234. package/docs/ja/specdojo/rulebooks/stc-index-rulebook.md +90 -189
  235. package/docs/ja/specdojo/rulebooks/stc-rulebook.md +45 -105
  236. package/docs/ja/specdojo/rulebooks/stsd-mermaid-rulebook.md +6 -12
  237. package/docs/ja/specdojo/rulebooks/stsd-rulebook.md +49 -68
  238. package/docs/ja/specdojo/rulebooks/sysd-critical-flows-rulebook.md +51 -60
  239. package/docs/ja/specdojo/rulebooks/sysd-cross-cutting-policy-rulebook.md +46 -50
  240. package/docs/ja/specdojo/rulebooks/sysd-index-rulebook.md +39 -64
  241. package/docs/ja/specdojo/rulebooks/sysd-rulebook.md +47 -60
  242. package/docs/ja/specdojo/rulebooks/trc-requirements-to-specs-rulebook.md +69 -70
  243. package/docs/ja/specdojo/rulebooks/trc-requirements-to-tests-rulebook.md +65 -72
  244. package/docs/ja/specdojo/rulebooks/tsd-index-rulebook.md +35 -46
  245. package/docs/ja/specdojo/rulebooks/tsd-rulebook.md +49 -66
  246. package/docs/ja/specdojo/rulebooks/tsp-index-rulebook.md +64 -139
  247. package/docs/ja/specdojo/rulebooks/uis-rulebook.md +41 -108
  248. package/docs/ja/specdojo/rulebooks/utc-index-rulebook.md +49 -144
  249. package/docs/ja/specdojo/rulebooks/utc-rulebook.md +67 -155
  250. package/docs/ja/specdojo/samples/bds-sample.md +58 -71
  251. package/docs/ja/specdojo/samples/bes-index-sample.md +20 -37
  252. package/docs/ja/specdojo/samples/bes-sample.md +43 -53
  253. package/docs/ja/specdojo/samples/bps-sample.md +42 -54
  254. package/docs/ja/specdojo/samples/br-sample.md +40 -52
  255. package/docs/ja/specdojo/samples/ccd-sample.md +0 -1
  256. package/docs/ja/specdojo/samples/cdr-sample.md +78 -0
  257. package/docs/ja/specdojo/samples/cdsd-sample.md +47 -63
  258. package/docs/ja/specdojo/samples/clis-sample.md +70 -77
  259. package/docs/ja/specdojo/samples/dec-sample.md +2 -3
  260. package/docs/ja/specdojo/samples/ifx-api-sample.yaml +0 -2
  261. package/docs/ja/specdojo/samples/ifx-msg-sample.yaml +0 -2
  262. package/docs/ja/specdojo/samples/job-sequence.yaml +67 -0
  263. package/docs/ja/specdojo/samples/mip-index-sample.md +98 -20
  264. package/docs/ja/specdojo/samples/pm-communication-plan-sample.md +26 -19
  265. package/docs/ja/specdojo/samples/pm-organization-sample.md +39 -50
  266. package/docs/ja/specdojo/samples/pm-plan-sample.md +61 -67
  267. package/docs/ja/specdojo/samples/pm-quality-management-plan-sample.md +31 -45
  268. package/docs/ja/specdojo/samples/pm-raci-sample.md +31 -37
  269. package/docs/ja/specdojo/samples/prj-assumptions-constraints-dependencies-sample.md +32 -48
  270. package/docs/ja/specdojo/samples/prj-charter-sample.md +42 -59
  271. package/docs/ja/specdojo/samples/prj-comparison-of-alternatives-sample.md +55 -61
  272. package/docs/ja/specdojo/samples/prj-success-criteria-and-acceptance-criteria-sample.md +30 -33
  273. package/docs/ja/specdojo/samples/sf-index-sample.md +13 -55
  274. package/docs/ja/specdojo/samples/sf-sample.md +73 -85
  275. package/docs/ja/specdojo/samples/sld-sample.md +60 -79
  276. package/docs/ja/specdojo/samples/uis-sample.md +98 -121
  277. package/docs/ja/specdojo/standards/job-definition-standard.md +24 -9
  278. package/docs/ja/specdojo/templates/cdr-template.md +58 -0
  279. package/docs/specdojo/schemas/v1/exec-common.schema.yaml +2 -1
  280. package/docs/specdojo/schemas/v1/exec-defaults.schema.yaml +42 -5
  281. package/docs/specdojo/schemas/v1/exec-evidence.schema.yaml +35 -0
  282. package/docs/specdojo/schemas/v1/job-run.schema.yaml +23 -0
  283. package/docs/specdojo/schemas/v1/job.schema.yaml +63 -2
  284. package/docs/specdojo/schemas/v1/sch-strategy.schema.yaml +2 -2
  285. package/package.json +9 -6
  286. package/templates/antigravity/orchestrator.md +4 -1
  287. package/templates/claude/agents/specdojo-orchestrator.md +4 -1
  288. package/templates/codex/agents/specdojo-orchestrator.toml +4 -1
  289. package/templates/codex/orchestrator.md +4 -1
  290. package/templates/init-exec-defaults.yaml +13 -0
  291. package/templates/lefthook/tools/specdojo-pre-commit.mjs +8 -0
  292. package/templates/opencode/agents/specdojo-orchestrator.md +5 -2
@@ -3,6 +3,7 @@ import { constants as osConstants } from "node:os";
3
3
  import { resolve } from "node:path";
4
4
  import { agentExtraRootArguments, resolveProductRepos } from "../exec/task-repos.js";
5
5
  import { antigravitySessionArguments } from "../exec/antigravity-session.js";
6
+ import { OPENCODE_CONFIG_CONTENT_ENV, opencodeAgentNameFromArguments, opencodeExtraRootConfig, } from "../exec/opencode-permissions.js";
6
7
  import { loadConfig, resolveExternalProjects, specdojoRootDir, } from "../shared/specdojo-config.js";
7
8
  import { registerNightOrchestratorCommand } from "./night-orchestrator.js";
8
9
  const ORCHESTRATOR_EXECUTABLES = {
@@ -13,9 +14,6 @@ const ORCHESTRATOR_EXECUTABLES = {
13
14
  opencode: "opencode",
14
15
  };
15
16
  const ORCHESTRATOR_CONFIG_ROOT_ENV = "SPECDOJO_ORCHESTRATOR_CONFIG_ROOT";
16
- function isRecord(value) {
17
- return typeof value === "object" && value !== null && !Array.isArray(value);
18
- }
19
17
  function resolveOrchestratorProjectId(config, projectOption, env) {
20
18
  const projectId = projectOption?.trim() ||
21
19
  env.SPECDOJO_PROJECT?.trim() ||
@@ -30,81 +28,11 @@ function resolveOrchestratorProjectId(config, projectOption, env) {
30
28
  return projectId;
31
29
  }
32
30
  function opencodeAgentName(args) {
33
- let selected;
34
- for (let index = 0; index < args.length; index += 1) {
35
- const arg = args[index];
36
- if (arg === "--agent") {
37
- selected = args[index + 1];
38
- index += 1;
39
- }
40
- else if (arg.startsWith("--agent=")) {
41
- selected = arg.slice("--agent=".length);
42
- }
43
- }
44
- if (!selected?.trim()) {
31
+ const selected = opencodeAgentNameFromArguments(args);
32
+ if (!selected) {
45
33
  throw new Error("OpenCode orchestrator launch requires --agent <name> so repository permissions can be scoped to that agent.");
46
34
  }
47
- return selected.trim();
48
- }
49
- function inlineOpenCodeConfig(current, agentName, repoRoots) {
50
- let config = {};
51
- if (current?.trim()) {
52
- let parsed;
53
- try {
54
- parsed = JSON.parse(current);
55
- }
56
- catch (error) {
57
- const message = error instanceof Error ? error.message : String(error);
58
- throw new Error(`Invalid OPENCODE_CONFIG_CONTENT: ${message}`);
59
- }
60
- if (!isRecord(parsed)) {
61
- throw new Error("Invalid OPENCODE_CONFIG_CONTENT: top-level value must be an object");
62
- }
63
- config = parsed;
64
- }
65
- const agents = config.agent === undefined ? {} : config.agent;
66
- if (!isRecord(agents)) {
67
- throw new Error("Invalid OPENCODE_CONFIG_CONTENT: agent must be an object");
68
- }
69
- const selectedAgent = agents[agentName] === undefined ? {} : agents[agentName];
70
- if (!isRecord(selectedAgent)) {
71
- throw new Error(`Invalid OPENCODE_CONFIG_CONTENT: agent.${agentName} must be an object`);
72
- }
73
- const permission = selectedAgent.permission === undefined ? {} : selectedAgent.permission;
74
- if (!isRecord(permission)) {
75
- throw new Error(`Invalid OPENCODE_CONFIG_CONTENT: agent.${agentName}.permission must be an object`);
76
- }
77
- const externalDirectory = { "*": "deny" };
78
- const currentEdit = permission.edit;
79
- let edit = {};
80
- if (isRecord(currentEdit)) {
81
- edit = { ...currentEdit };
82
- }
83
- else if (typeof currentEdit === "string") {
84
- edit = { "*": currentEdit };
85
- }
86
- else if (currentEdit !== undefined) {
87
- throw new Error(`Invalid OPENCODE_CONFIG_CONTENT: agent.${agentName}.permission.edit must be a string or object`);
88
- }
89
- for (const repoRoot of repoRoots) {
90
- const pattern = `${resolve(repoRoot).replaceAll("\\", "/")}/**`;
91
- externalDirectory[pattern] = "allow";
92
- edit[pattern] = "allow";
93
- }
94
- return JSON.stringify({
95
- ...config,
96
- agent: {
97
- ...agents,
98
- [agentName]: {
99
- ...selectedAgent,
100
- permission: {
101
- ...permission,
102
- external_directory: externalDirectory,
103
- edit,
104
- },
105
- },
106
- },
107
- });
35
+ return selected;
108
36
  }
109
37
  export function buildOrchestratorLaunch(options) {
110
38
  const env = { ...(options.env ?? process.env) };
@@ -118,7 +46,7 @@ export function buildOrchestratorLaunch(options) {
118
46
  }));
119
47
  }
120
48
  else if (options.provider === "opencode" && options.repoRoots.length > 0) {
121
- env.OPENCODE_CONFIG_CONTENT = inlineOpenCodeConfig(env.OPENCODE_CONFIG_CONTENT, opencodeAgentName(args), options.repoRoots);
49
+ env[OPENCODE_CONFIG_CONTENT_ENV] = opencodeExtraRootConfig(env[OPENCODE_CONFIG_CONTENT_ENV], opencodeAgentName(args), options.repoRoots, options.cwd);
122
50
  }
123
51
  else {
124
52
  args.push(...agentExtraRootArguments(options.provider, options.repoRoots));
@@ -0,0 +1,25 @@
1
+ import { Argument } from "commander";
2
+ import { printCatalogPaths } from "../catalog/catalog.js";
3
+ import { printTimelinePaths } from "../dashboard/timeline.js";
4
+ import { printExecPaths } from "../exec/commands.js";
5
+ import { printJobPaths } from "../job/job.js";
6
+ import { printRoutinePaths } from "../routine/routine.js";
7
+ import { printSchedulePaths } from "../schedule/schedule.js";
8
+ const pathPrinters = {
9
+ exec: printExecPaths,
10
+ catalog: printCatalogPaths,
11
+ schedule: printSchedulePaths,
12
+ timeline: printTimelinePaths,
13
+ job: printJobPaths,
14
+ routine: printRoutinePaths,
15
+ };
16
+ export function registerWhereCommand(program) {
17
+ program
18
+ .command("where")
19
+ .description("Print resolved project paths and files for a kind")
20
+ .addArgument(new Argument("<kind>", "Kind of paths to display").choices(Object.keys(pathPrinters)))
21
+ .option("--project <projectId>", "Project id in specdojo.config.json")
22
+ .action((kind, opts) => {
23
+ pathPrinters[kind](opts);
24
+ });
25
+ }
@@ -899,10 +899,12 @@ function printCommandError(error) {
899
899
  process.exitCode = 1;
900
900
  }
901
901
  export function registerDashboardCommands(program) {
902
- const dash = program.command("dashboard").description("Per-project dashboard build commands");
902
+ const dash = program
903
+ .command("dashboard", { hidden: true })
904
+ .description("Per-project dashboard build commands");
903
905
  const bcmd = dash
904
- .command("build")
905
- .description("Generate per-project dashboard.md, epic Gantt chart SVG and catalog scaffold targets")
906
+ .command("build", { hidden: true })
907
+ .description("Internal compatibility entry for build --only dashboard")
906
908
  .option("--project <id>", "Project id in specdojo.config.json")
907
909
  .option("--dry-run", "Print generated content to stdout without writing", false);
908
910
  bcmd.action((opts) => {
@@ -3,7 +3,7 @@ import { join } from "node:path";
3
3
  import { load } from "../shared/yaml.js";
4
4
  import { readJson } from "../shared/fs.js";
5
5
  import { migrateRoutineStorage } from "../routine/storage.js";
6
- import { cronMatches, cronOccurrences, isRoutineDue, routineActionKindLabel, } from "../routine/definition.js";
6
+ import { cronMatches, isRoutineEntryDue, routineActionKindLabel, } from "../routine/definition.js";
7
7
  // routine ファイル(rtn-*.yaml)を読み、端末側の状態ファイルと突き合わせて
8
8
  // 最終実行・実行結果・due 状況を得る。CLI 出力(routine list)の転記に依存しない。
9
9
  export function aggregateRoutines(routinesPath, repoRoot) {
@@ -190,6 +190,7 @@ function readRoutineStateEntries(statePath) {
190
190
  last_run: typeof entry.last_run === "string" ? entry.last_run : undefined,
191
191
  last_result: typeof entry.last_result === "string" ? entry.last_result : undefined,
192
192
  last_scheduled_for: typeof entry.last_scheduled_for === "string" ? entry.last_scheduled_for : undefined,
193
+ busy_skip_count: typeof entry.busy_skip_count === "number" ? entry.busy_skip_count : undefined,
193
194
  };
194
195
  }
195
196
  }
@@ -238,12 +239,8 @@ function buildRoutineRow(result, doc, stateEntries, now) {
238
239
  export function computeRoutineDue(doc, stateEntry, enabled, now) {
239
240
  if (!enabled)
240
241
  return "disabled";
241
- if (doc.trigger) {
242
- const occurrences = cronOccurrences(doc, stateEntry?.last_scheduled_for, now);
243
- return occurrences.length > 0 ? "due" : "-";
244
- }
245
- if (doc.interval) {
246
- return isRoutineDue(doc, stateEntry?.last_run, now) ? "due" : "-";
242
+ if (doc.trigger || doc.interval) {
243
+ return isRoutineEntryDue(doc, stateEntry, now) ? "due" : "-";
247
244
  }
248
245
  return "-";
249
246
  }
@@ -1,4 +1,4 @@
1
- import { stripTerminalControlSequences } from "../shared/text.js";
1
+ import { escapeMarkdownTableCell, stripTerminalControlSequences } from "../shared/text.js";
2
2
  const MAX_DASHBOARD_CELL_LENGTH = 200;
3
3
  // dashboard の表へは event や subprocess 由来の文字列も入る。表へ埋める直前に
4
4
  // ターミナル制御シーケンスと改行類を除き、列区切りをエスケープして長さを制限する。
@@ -10,5 +10,5 @@ export function sanitizeDashboardCell(text) {
10
10
  const truncated = singleLine.length <= MAX_DASHBOARD_CELL_LENGTH
11
11
  ? singleLine
12
12
  : `${singleLine.slice(0, MAX_DASHBOARD_CELL_LENGTH)}…`;
13
- return truncated.replace(/\|/g, "\\|");
13
+ return escapeMarkdownTableCell(truncated);
14
14
  }
@@ -1,3 +1,4 @@
1
+ import { registerDeprecatedWhereAlias } from "../shared/where-alias.js";
1
2
  import { warnDeprecated } from "../shared/deprecation.js";
2
3
  import { existsSync, mkdirSync, writeFileSync } from "node:fs";
3
4
  import { join, resolve } from "node:path";
@@ -54,22 +55,21 @@ function buildTimelineJson(result) {
54
55
  })),
55
56
  }, null, 2) + "\n");
56
57
  }
58
+ export function printTimelinePaths(opts) {
59
+ try {
60
+ const { timelinePath, catalogPath } = resolveTimelinePaths(opts);
61
+ process.stdout.write(`timeline-path: ${timelinePath}\n`);
62
+ process.stdout.write(`catalog-path: ${catalogPath ?? "(not configured)"}\n`);
63
+ const indexFile = join(timelinePath, "tml-index.yaml");
64
+ process.stdout.write(`tml-index: ${indexFile}${existsSync(indexFile) ? "" : " (does not exist)"}\n`);
65
+ }
66
+ catch (error) {
67
+ printCommandError(error);
68
+ }
69
+ }
57
70
  export function registerTimelineCommands(program) {
58
71
  const tml = program.command("timeline").description("Timeline build commands");
59
- const wcmd = tml.command("where").description("Print resolved timeline paths");
60
- addProjectOption(wcmd);
61
- wcmd.action((opts) => {
62
- try {
63
- const { timelinePath, catalogPath } = resolveTimelinePaths(opts);
64
- process.stdout.write(`timeline-path: ${timelinePath}\n`);
65
- process.stdout.write(`catalog-path: ${catalogPath ?? "(not configured)"}\n`);
66
- const indexFile = join(timelinePath, "tml-index.yaml");
67
- process.stdout.write(`tml-index: ${indexFile}${existsSync(indexFile) ? "" : " (does not exist)"}\n`);
68
- }
69
- catch (error) {
70
- printCommandError(error);
71
- }
72
- });
72
+ registerDeprecatedWhereAlias(tml, printTimelinePaths);
73
73
  const bcmd = tml
74
74
  .command("build")
75
75
  .description("Deprecated: derive track order and catalog targets from epics and legacy tml-index.yaml");
@@ -15,6 +15,7 @@ import { isDctCatalogFileName } from "../catalog/types.js";
15
15
  import { resolveBasePath, resolveDeliverablePath } from "../catalog/paths.js";
16
16
  import { readSpecdojoNamespace } from "../docs/frontmatter-namespace.js";
17
17
  import { gitOutput } from "../shared/git.js";
18
+ import { escapeRegExp } from "../shared/text.js";
18
19
  function findCatalogFiles(catalogDir) {
19
20
  return readdirSync(catalogDir).filter(isDctCatalogFileName).sort();
20
21
  }
@@ -68,7 +69,7 @@ function resolveTrashDestination(oldDocPath, projectId) {
68
69
  // re-serializing the whole document (which would drop comments/formatting).
69
70
  function rewriteCatalogPath(rawYaml, localId, newDocPath) {
70
71
  const lines = rawYaml.split("\n");
71
- const startRe = new RegExp(`^(\\s*)- local_id:\\s*${localId}\\s*$`);
72
+ const startRe = new RegExp(`^(\\s*)- local_id:\\s*${escapeRegExp(localId)}\\s*$`);
72
73
  let itemIndent = null;
73
74
  let startIndex = -1;
74
75
  for (let i = 0; i < lines.length; i++) {
@@ -10,8 +10,8 @@ function printCommandError(error) {
10
10
  export function registerIndexCommands(program) {
11
11
  const idx = program.command("index").description("Document ID index commands");
12
12
  idx
13
- .command("build")
14
- .description("Scan docs and build .specdojo/doc-index.json")
13
+ .command("build", { hidden: true })
14
+ .description("Internal compatibility entry for build --only index")
15
15
  .option("--root <path>", "Root directory to scan", "docs")
16
16
  .option("--output <path>", "Output path", ".specdojo/doc-index.json")
17
17
  .action((opts) => {
@@ -0,0 +1,243 @@
1
+ import { code, properties, records, recordTable, TableBody, valueText, } from "./yaml-table-shared.js";
2
+ export function renderBdd(doc) {
3
+ const body = new TableBody();
4
+ for (const entity of records(doc.entities)) {
5
+ body.section(valueText(entity.logical_name), [
6
+ properties(entity, [
7
+ ["physical_name", "物理名"],
8
+ ["description", "説明"],
9
+ ["key_fields", "キー項目"],
10
+ ["schema_ref", "正本スキーマ"],
11
+ ["type_ref", "正本型定義"],
12
+ ["glossary_term_id", "用語 ID"],
13
+ ["related_terms", "関連用語"],
14
+ ]),
15
+ recordTable(records(entity.fields), [
16
+ ["logical_name", "論理名"],
17
+ ["physical_name", "物理名"],
18
+ ["description", "業務上の意味"],
19
+ ["type", "型"],
20
+ ["unit", "単位"],
21
+ ["constraints", "制約"],
22
+ ["allowed_values", "許容値"],
23
+ ["allowed_values_detailed", "許容値と業務ラベル"],
24
+ ["example", "例"],
25
+ ["glossary_term_id", "用語 ID"],
26
+ ]),
27
+ ].join("\n\n"));
28
+ }
29
+ return body.render();
30
+ }
31
+ export function renderRoles(doc) {
32
+ const body = new TableBody();
33
+ body.section("採用ロール", recordTable(records(doc.roles), [
34
+ ["code", "ロールコード"],
35
+ ["name", "名称"],
36
+ ["project_note", "プロジェクトでの責務・補足"],
37
+ ]));
38
+ return body.render();
39
+ }
40
+ export function renderMembers(doc) {
41
+ const body = new TableBody();
42
+ body.section("メンバー", recordTable(records(doc.members), [
43
+ ["nickname", "実行主体 ID"],
44
+ ["display_name", "表示名"],
45
+ ["roles", "ロール"],
46
+ ["type", "種別"],
47
+ ["focus", "担当領域"],
48
+ ["note", "補足"],
49
+ ]));
50
+ if (Array.isArray(doc.rules))
51
+ body.section("運用ルール", recordTable(doc.rules.map((rule) => ({ rule })), [["rule", "ルール"]]));
52
+ return body.render();
53
+ }
54
+ export function renderTimeline(doc) {
55
+ const body = new TableBody();
56
+ body.section("計画の前提", properties(doc, [
57
+ ["planned_start_date", "予定開始日"],
58
+ ["notes", "注記"],
59
+ ]));
60
+ body.section("トラック順序", recordTable(records(doc.tracks), [
61
+ ["track", "トラック"],
62
+ ["domains", "ドメイン"],
63
+ ["catalog_status", "カタログ状態"],
64
+ ["catalog_duration_estimate_days", "カタログ整備の見積日数"],
65
+ ["order", "順序"],
66
+ ["parallel_group", "並行グループ"],
67
+ ["depends_on", "先行トラック"],
68
+ ["note", "補足"],
69
+ ]));
70
+ return body.render();
71
+ }
72
+ export function renderMilestones(doc) {
73
+ const body = new TableBody();
74
+ body.section("マイルストーン", recordTable(records(doc.milestones), [
75
+ ["id", "ID"],
76
+ ["name", "名称"],
77
+ ["artifact_name", "対象成果物"],
78
+ ["depends_on", "先行タスク"],
79
+ ["owner", "担当ロール"],
80
+ ["date_hint", "目安日"],
81
+ ["tags", "タグ"],
82
+ ["notes", "注記"],
83
+ ]));
84
+ if (Array.isArray(doc.tasks))
85
+ body.section("概要タスク", recordTable(records(doc.tasks), [
86
+ ["id", "ID"],
87
+ ["name", "名称"],
88
+ ["owner", "担当ロール"],
89
+ ["depends_on", "先行タスク"],
90
+ ]));
91
+ return body.render();
92
+ }
93
+ export function renderViewpoints(doc) {
94
+ const body = new TableBody();
95
+ if (typeof doc.extends === "string") {
96
+ body.section("共通定義の継承", `共通定義: [[${doc.extends}]]。以下の表はこの YAML が宣言する差分です。同じ ID・ロールは上書きし、新しい値は追加します。空の表は差分なしを表します。`);
97
+ }
98
+ for (const [key, title, columns] of [
99
+ [
100
+ "categories",
101
+ "分類",
102
+ [
103
+ ["id", "ID"],
104
+ ["name", "名称"],
105
+ ],
106
+ ],
107
+ [
108
+ "coverage_types",
109
+ "確認対象の分類",
110
+ [
111
+ ["id", "ID"],
112
+ ["name", "名称"],
113
+ ["description", "説明"],
114
+ ["applies_to", "適用先"],
115
+ ],
116
+ ],
117
+ [
118
+ "severity_levels",
119
+ "重大度",
120
+ [
121
+ ["id", "ID"],
122
+ ["description", "意味・扱い"],
123
+ ],
124
+ ],
125
+ [
126
+ "verdict_definitions",
127
+ "判定",
128
+ [
129
+ ["id", "ID"],
130
+ ["description", "意味・次の対応"],
131
+ ],
132
+ ],
133
+ [
134
+ "viewpoints",
135
+ "レビュー観点",
136
+ [
137
+ ["id", "ID"],
138
+ ["role", "ロール"],
139
+ ["category", "分類"],
140
+ ["title", "観点"],
141
+ ["check", "確認内容"],
142
+ ["evidence", "根拠"],
143
+ ["default_severity", "重大度"],
144
+ ["evaluation", "評価方法"],
145
+ ],
146
+ ],
147
+ [
148
+ "role_viewpoint_sets",
149
+ "ロール別観点",
150
+ [
151
+ ["role", "ロール"],
152
+ ["viewpoints", "観点 ID"],
153
+ ],
154
+ ],
155
+ ]) {
156
+ if (Array.isArray(doc[key]))
157
+ body.section(title, recordTable(records(doc[key]), columns.map(([field, label]) => [field, label])));
158
+ }
159
+ // 適用条件を省くと観点を誤用するため、指定された観点だけ補表で示す。
160
+ const scoped = records(doc.viewpoints).filter((item) => item.document_kinds || item.grade_targets || item.comparison_sources || item.coverage_types);
161
+ if (scoped.length)
162
+ body.section("観点の適用条件", recordTable(scoped, [
163
+ ["id", "観点 ID"],
164
+ ["coverage_types", "確認対象"],
165
+ ["grade_targets", "評価対象"],
166
+ ["comparison_sources", "比較元"],
167
+ ["document_kinds", "文書種別の条件"],
168
+ ]));
169
+ if (doc.disabled !== undefined)
170
+ body.section("無効化する共通定義", properties(doc.disabled));
171
+ if (doc.grade_rubric !== undefined)
172
+ body.section("採点基準", properties(doc.grade_rubric));
173
+ return body.render();
174
+ }
175
+ export function renderDctIndex(doc) {
176
+ const body = new TableBody();
177
+ body.section("カタログの設定", properties(doc, [
178
+ ["project_id", "プロジェクト"],
179
+ ["size", "規模"],
180
+ ]));
181
+ const visit = (groups, parent) => {
182
+ for (const group of groups) {
183
+ const name = [parent, valueText(group.name)].filter(Boolean).join(" / ");
184
+ if (Array.isArray(group.domains))
185
+ body.section(name, recordTable(records(group.domains), [
186
+ ["domain", "ドメイン"],
187
+ ["name", "名称"],
188
+ ["overview", "概要"],
189
+ ]));
190
+ visit(records(group.groups), name);
191
+ }
192
+ };
193
+ visit(records(doc.groups), "");
194
+ return body.render();
195
+ }
196
+ export function renderDct(doc) {
197
+ const body = new TableBody();
198
+ body.section("カタログの設定", properties(doc, [
199
+ ["project_id", "プロジェクト"],
200
+ ["domain", "ドメイン"],
201
+ ["base_path", "基準パス"],
202
+ ]));
203
+ const visit = (groups, parent) => {
204
+ for (const group of groups) {
205
+ const name = [parent, group.name ? valueText(group.name) : ""].filter(Boolean).join(" / ");
206
+ const items = records(group.deliverables);
207
+ if (items.length) {
208
+ body.section(name || "成果物", [
209
+ properties(group, [
210
+ ["base_path", "配置先(親からの相対パス)"],
211
+ ["note", "注記"],
212
+ ]),
213
+ recordTable(items, [
214
+ ["local_id", "成果物 ID"],
215
+ ["name", "名称"],
216
+ ["kind", "種別"],
217
+ ["depends_on", "根拠"],
218
+ ["overview", "概要"],
219
+ ]),
220
+ ...items
221
+ .filter((item) => item.done_criteria || item.path || item.brief)
222
+ .map((item) => [
223
+ `**${code(String(item.local_id))}**`,
224
+ properties(item, [
225
+ ["path", "パス"],
226
+ ["rulebook", "準拠ルール"],
227
+ ["brief", "作成指示"],
228
+ ["note", "注記"],
229
+ ]),
230
+ recordTable(records(item.done_criteria), [
231
+ ["text", "完了条件"],
232
+ ["roles", "確認ロール"],
233
+ ["viewpoint", "観点 ID"],
234
+ ]),
235
+ ].join("\n\n")),
236
+ ].join("\n\n"));
237
+ }
238
+ visit(records(group.groups), name);
239
+ }
240
+ };
241
+ visit(records(doc.groups), "");
242
+ return body.render();
243
+ }
@@ -0,0 +1,106 @@
1
+ import { isRecord, properties, records, recordTable, TableBody, table, valueText, code, } from "./yaml-table-shared.js";
2
+ export function renderCommand(doc) {
3
+ const body = new TableBody();
4
+ body.section("コマンド", properties(doc.command, [
5
+ ["executable", "実行ファイル"],
6
+ ["subcommands", "サブコマンド"],
7
+ ["purpose", "目的"],
8
+ ["reference", "仕様の参照先"],
9
+ ["version_constraint", "バージョン制約"],
10
+ ["shell", "シェル経由"],
11
+ ]));
12
+ if (Array.isArray(doc.arguments))
13
+ body.section("引数", recordTable(records(doc.arguments), [
14
+ ["name", "名称"],
15
+ ["kind", "種別"],
16
+ ["position", "位置"],
17
+ ["required", "必須"],
18
+ ["value_type", "値の型"],
19
+ ["value_source", "値の供給元"],
20
+ ["description", "説明"],
21
+ ["example", "例"],
22
+ ]));
23
+ const streams = isRecord(doc.streams) ? doc.streams : {};
24
+ body.section("標準入出力", table(["ストリーム", "モード", "形式", "文字コード", "契約"], Object.entries(streams).map(([name, stream]) => {
25
+ const item = isRecord(stream) ? stream : {};
26
+ return [name, ...[item.mode, item.format, item.encoding, item.description].map(valueText)];
27
+ })));
28
+ const files = isRecord(doc.files) ? doc.files : {};
29
+ for (const [key, title] of [
30
+ ["inputs", "入力ファイル"],
31
+ ["outputs", "出力ファイル"],
32
+ ]) {
33
+ if (Array.isArray(files[key]))
34
+ body.section(title, recordTable(records(files[key]), [
35
+ ["path", "パス"],
36
+ ["format", "形式"],
37
+ ["encoding", "文字コード"],
38
+ ["description", "契約"],
39
+ ]));
40
+ }
41
+ body.section("終了コード", recordTable(records(doc.exit_codes), [
42
+ ["code", "コード"],
43
+ ["meaning", "意味・判定条件"],
44
+ ["category", "分類"],
45
+ ["retryable", "再試行可否"],
46
+ ]));
47
+ for (const [key, title] of [
48
+ ["authentication", "認証"],
49
+ ["execution", "実行制御"],
50
+ ["error_handling", "異常時の扱い"],
51
+ ])
52
+ body.section(title, properties(doc[key]));
53
+ body.section("副作用", table(["内容"], [[valueText(doc.side_effects)]]));
54
+ return body.render();
55
+ }
56
+ // IFX-FILE には専用 schema がないため、ifx-file-rulebook と正本の契約単位に沿って示す。
57
+ export function renderFileInterface(doc) {
58
+ const body = new TableBody();
59
+ body.section("連携の概要", properties(doc, [
60
+ ["source", "連携元"],
61
+ ["target", "連携先"],
62
+ ["direction", "向き"],
63
+ ["format", "形式"],
64
+ ["timing", "タイミング"],
65
+ ]));
66
+ body.section("受け渡すファイル", recordTable(records(doc.files), [
67
+ ["name", "名称"],
68
+ ["location", "配置"],
69
+ ["description", "説明"],
70
+ ["writer", "書き手"],
71
+ ["reader", "読み手"],
72
+ ["format", "形式"],
73
+ ]));
74
+ for (const file of records(doc.files)) {
75
+ body.section(`ファイル契約: ${code(String(file.name))}`, properties(file, [
76
+ ["naming_rule", "命名規則"],
77
+ ["encoding", "文字コード"],
78
+ ["schema_ref", "正本の型"],
79
+ ["required_fields", "必須項目"],
80
+ ]));
81
+ }
82
+ for (const [key, title] of [
83
+ ["transport", "配送・書き込み"],
84
+ ["schema", "データ契約"],
85
+ ["error_handling", "異常時の扱い"],
86
+ ])
87
+ body.section(title, properties(doc[key]));
88
+ const verification = isRecord(doc.verification) ? doc.verification : {};
89
+ body.section("検証方法", properties(verification, [
90
+ ["procedure", "手順"],
91
+ ["file_checks", "ファイルごとの確認"],
92
+ ]));
93
+ body.section("検証ケース", recordTable(records(verification.cases), [
94
+ ["id", "ケース ID"],
95
+ ["viewpoint", "観点"],
96
+ ["expected", "期待結果"],
97
+ ]));
98
+ body.section("未決事項", recordTable(records(doc.open_decisions), [
99
+ ["id", "ID"],
100
+ ["topic", "論点"],
101
+ ["impact", "影響"],
102
+ ["owner", "担当"],
103
+ ["next_action", "次の対応"],
104
+ ]));
105
+ return body.render();
106
+ }
@@ -7,10 +7,12 @@ function printCommandError(error) {
7
7
  process.exitCode = 1;
8
8
  }
9
9
  export function registerYamlPagesCommands(program) {
10
- const cmd = program.command("yaml-pages").description("YAML display page commands");
10
+ const cmd = program
11
+ .command("yaml-pages", { hidden: true })
12
+ .description("YAML display page commands");
11
13
  cmd
12
- .command("build")
13
- .description("Generate generated/<name>.md display pages for indexed YAML files")
14
+ .command("build", { hidden: true })
15
+ .description("Internal compatibility entry for build --only yaml-pages")
14
16
  .option("--root <path>", "Root directory to scan", "docs")
15
17
  .action((opts) => {
16
18
  try {