specdojo 0.3.0 → 0.4.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 (245) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/README.md +77 -18
  3. package/dist/catalog/build-references.js +144 -0
  4. package/dist/catalog/build-render.js +32 -0
  5. package/dist/{catalog-build.js → catalog/build.js} +18 -295
  6. package/dist/{catalog.js → catalog/catalog.js} +11 -11
  7. package/dist/{catalog-generate.js → catalog/generate.js} +13 -16
  8. package/dist/catalog/paths.js +1 -0
  9. package/dist/{catalog-plan-generate.js → catalog/plan-generate.js} +5 -5
  10. package/dist/{catalog-plan.js → catalog/plan.js} +9 -9
  11. package/dist/{catalog-scaffold.js → catalog/scaffold.js} +6 -6
  12. package/dist/{agent.js → commands/agent.js} +11 -11
  13. package/dist/{build-command.js → commands/build.js} +2 -2
  14. package/dist/{init-command.js → commands/init.js} +103 -37
  15. package/dist/{orchestrator.js → commands/orchestrator.js} +2 -2
  16. package/dist/{watch.js → commands/watch.js} +3 -3
  17. package/dist/dashboard/dashboard-timeline.js +175 -0
  18. package/dist/{dashboard.js → dashboard/dashboard.js} +16 -549
  19. package/dist/dashboard/exec-records.js +105 -0
  20. package/dist/dashboard/routines.js +256 -0
  21. package/dist/dashboard/shared.js +14 -0
  22. package/dist/{timeline-build.js → dashboard/timeline-build.js} +2 -1
  23. package/dist/{timeline.js → dashboard/timeline.js} +1 -1
  24. package/dist/{deliverable.js → deliverable/deliverable.js} +5 -5
  25. package/dist/{deliverable-trash.js → deliverable/trash.js} +7 -7
  26. package/dist/{devcontainer-command.js → devcontainer/command.js} +5 -3
  27. package/dist/{devcontainer-scaffold.js → devcontainer/scaffold.js} +94 -2
  28. package/dist/{doc-index.js → docs/doc-index.js} +3 -3
  29. package/dist/{frontmatter-namespace.js → docs/frontmatter-namespace.js} +2 -2
  30. package/dist/{index-command.js → docs/index-command.js} +1 -1
  31. package/dist/docs/template-resolution.js +1 -0
  32. package/dist/{viewpoint-document-kinds-check.js → docs/viewpoint-document-kinds-check.js} +3 -3
  33. package/dist/{yaml-pages-command.js → docs/yaml-pages-command.js} +1 -1
  34. package/dist/{yaml-pages.js → docs/yaml-pages.js} +5 -5
  35. package/dist/{exec-agent-config.js → exec/agent-config.js} +33 -4
  36. package/dist/{exec-agent-git-state.js → exec/agent-git-state.js} +1 -1
  37. package/dist/{exec-agent-protected-config.js → exec/agent-protected-config.js} +1 -1
  38. package/dist/{exec.js → exec/commands.js} +22 -467
  39. package/dist/exec/core.js +457 -0
  40. package/dist/{exec-events.js → exec/events.js} +2 -2
  41. package/dist/{exec-evidence.js → exec/evidence.js} +11 -6
  42. package/dist/exec/exec.js +2 -0
  43. package/dist/exec/format.js +1 -0
  44. package/dist/{exec-handoff.js → exec/handoff.js} +13 -12
  45. package/dist/{exec-limit.js → exec/limit.js} +93 -12
  46. package/dist/{exec-parent-validation.js → exec/parent-validation.js} +4 -4
  47. package/dist/{exec-pipeline-state.js → exec/pipeline-state.js} +16 -2
  48. package/dist/{exec-plans.js → exec/plans-core.js} +97 -468
  49. package/dist/exec/plans-generation.js +249 -0
  50. package/dist/exec/plans-storage.js +131 -0
  51. package/dist/exec/plans.js +3 -0
  52. package/dist/{exec-project.js → exec/project.js} +1 -1
  53. package/dist/{exec-protection-handoff.js → exec/protection-handoff.js} +3 -3
  54. package/dist/{exec-register-resume.js → exec/register-resume.js} +2 -2
  55. package/dist/{exec-register.js → exec/register.js} +92 -9
  56. package/dist/exec/repo-integration-git.js +23 -0
  57. package/dist/exec/repo-integration-sync.js +264 -0
  58. package/dist/{exec-repo-integration.js → exec/repo-integration.js} +13 -287
  59. package/dist/{exec-repo-trace.js → exec/repo-trace.js} +3 -3
  60. package/dist/exec/reporter-output.js +206 -0
  61. package/dist/{exec-reporter.js → exec/reporter.js} +29 -216
  62. package/dist/{exec-results.js → exec/results.js} +277 -36
  63. package/dist/exec/run/agent-pipeline.js +276 -0
  64. package/dist/exec/run/agent.js +583 -0
  65. package/dist/exec/run/in-place.js +570 -0
  66. package/dist/exec/run/job.js +746 -0
  67. package/dist/exec/run/lifecycle-commands.js +530 -0
  68. package/dist/{exec-run-lock.js → exec/run/lock.js} +4 -3
  69. package/dist/exec/run/mode-shared.js +140 -0
  70. package/dist/exec/run/register-command.js +252 -0
  71. package/dist/exec/run/register-core.js +411 -0
  72. package/dist/exec/run/register-mode.js +210 -0
  73. package/dist/exec/run/register-resume.js +398 -0
  74. package/dist/exec/run/register-state.js +325 -0
  75. package/dist/exec/run/register-worktree.js +540 -0
  76. package/dist/exec/run/run.js +11 -0
  77. package/dist/exec/run/schedule-mode.js +294 -0
  78. package/dist/exec/run/schedule-prepare.js +366 -0
  79. package/dist/exec/run/schedule-task.js +599 -0
  80. package/dist/exec/run/shared.js +449 -0
  81. package/dist/{exec-schedule-calendar.js → exec/schedule/calendar.js} +1 -1
  82. package/dist/{exec-schedule-cpm.js → exec/schedule/cpm.js} +2 -2
  83. package/dist/{exec-schedule-gantt-chart-render.js → exec/schedule/gantt-chart-render.js} +2 -2
  84. package/dist/exec/schedule/gantt-chart.js +2 -0
  85. package/dist/{exec-schedule-hash.js → exec/schedule/hash.js} +2 -2
  86. package/dist/exec/schedule/index.js +1 -0
  87. package/dist/{exec-schedule-initial.js → exec/schedule/initial.js} +2 -2
  88. package/dist/{exec-schedule-progress.js → exec/schedule/progress.js} +2 -2
  89. package/dist/{exec-schedule-ready.js → exec/schedule/ready.js} +2 -2
  90. package/dist/{exec-schedule.js → exec/schedule/schedule.js} +11 -11
  91. package/dist/exec/shared.js +63 -0
  92. package/dist/exec/slot-lock.js +1 -0
  93. package/dist/{exec-strategy.js → exec/strategy.js} +2 -2
  94. package/dist/{exec-task-repos.js → exec/task-repos.js} +2 -2
  95. package/dist/{exec-task-view.js → exec/task-view.js} +4 -4
  96. package/dist/{exec-trial.js → exec/trial-commands.js} +23 -388
  97. package/dist/exec/trial-core.js +371 -0
  98. package/dist/exec/trial.js +2 -0
  99. package/dist/{exec-worktree-command.js → exec/worktree-command.js} +25 -23
  100. package/dist/exec/worktree-ops-commit.js +672 -0
  101. package/dist/exec/worktree-ops-lifecycle.js +297 -0
  102. package/dist/exec/worktree-ops-merge.js +344 -0
  103. package/dist/exec/worktree-ops.js +3 -0
  104. package/dist/exec/worktree.js +305 -0
  105. package/dist/grade/apply.js +734 -0
  106. package/dist/grade/command-apply.js +250 -0
  107. package/dist/grade/command-inspect.js +138 -0
  108. package/dist/grade/command-plan.js +101 -0
  109. package/dist/grade/command-shared.js +68 -0
  110. package/dist/grade/core.js +307 -0
  111. package/dist/grade/grade.js +19 -0
  112. package/dist/grade/markdown.js +274 -0
  113. package/dist/grade/pipeline-state.js +184 -0
  114. package/dist/grade/plan.js +507 -0
  115. package/dist/{grade-result.js → grade/result.js} +7 -96
  116. package/dist/grade/target-discovery.js +265 -0
  117. package/dist/grade/targets.js +435 -0
  118. package/dist/{job.js → job/definition.js} +32 -574
  119. package/dist/job/job.js +568 -0
  120. package/dist/{kata-command.js → kata/command.js} +4 -4
  121. package/dist/{kata.js → kata/kata.js} +5 -5
  122. package/dist/register/approach.js +134 -0
  123. package/dist/register/command-types.js +1 -0
  124. package/dist/register/core.js +369 -0
  125. package/dist/register/create-commands.js +352 -0
  126. package/dist/{register-date.js → register/date.js} +1 -1
  127. package/dist/register/derivation.js +163 -0
  128. package/dist/{register-event-merge.js → register/event-merge.js} +32 -3
  129. package/dist/{register-events.js → register/events.js} +12 -6
  130. package/dist/{register-history.js → register/history.js} +7 -6
  131. package/dist/{register-item.js → register/item.js} +28 -10
  132. package/dist/register/lifecycle-lock.js +5 -0
  133. package/dist/register/maintenance-commands.js +193 -0
  134. package/dist/{register-migrate-timestamps.js → register/migrate-timestamps.js} +3 -3
  135. package/dist/register/migration.js +268 -0
  136. package/dist/register/register.js +404 -0
  137. package/dist/register/renumber.js +341 -0
  138. package/dist/register/transition-commands.js +248 -0
  139. package/dist/register/update.js +230 -0
  140. package/dist/register/views.js +296 -0
  141. package/dist/{review-grade.js → review/grade.js} +2 -2
  142. package/dist/{review-plan.js → review/plan.js} +5 -5
  143. package/dist/routine/definition.js +401 -0
  144. package/dist/{routine.js → routine/routine.js} +50 -419
  145. package/dist/{schedule-approach.js → schedule/approach.js} +9 -9
  146. package/dist/{schedule-build.js → schedule/build.js} +7 -4
  147. package/dist/{schedule.js → schedule/schedule.js} +9 -9
  148. package/dist/schedule/strategy-generate-document.js +273 -0
  149. package/dist/schedule/strategy-generate-scope.js +199 -0
  150. package/dist/schedule/strategy-generate.js +348 -0
  151. package/dist/shared/agent-types.js +23 -0
  152. package/dist/shared/artifact-path.js +9 -0
  153. package/dist/{build-if-stale.js → shared/build-if-stale.js} +1 -1
  154. package/dist/shared/catalog-render.js +115 -0
  155. package/dist/{exec-slot-lock.js → shared/cross-process-lock.js} +3 -1
  156. package/dist/shared/fs.js +30 -0
  157. package/dist/shared/git.js +316 -0
  158. package/dist/shared/grade-result.js +94 -0
  159. package/dist/{package-paths.js → shared/package-paths.js} +3 -3
  160. package/dist/shared/plan-templates.js +114 -0
  161. package/dist/{exec-provider-scaffold.js → shared/provider-scaffold.js} +3 -1
  162. package/dist/shared/random.js +4 -0
  163. package/dist/{exec-schedule-index.js → shared/schedule-index.js} +3 -1
  164. package/dist/shared/schedule-paths.js +9 -0
  165. package/dist/{specdojo-config.js → shared/specdojo-config.js} +96 -9
  166. package/dist/{exec-shared.js → shared/text.js} +0 -134
  167. package/dist/shared/time.js +28 -0
  168. package/dist/shared/yaml.js +28 -0
  169. package/dist/specdojo.js +22 -22
  170. package/docs/ja/specdojo/exec-templates/xep-common-conventions-template.md +29 -17
  171. package/docs/ja/specdojo/exec-templates/xep-register-investigate-template.md +1 -2
  172. package/docs/ja/specdojo/exec-templates/xep-register-template.md +1 -2
  173. package/docs/ja/specdojo/exec-templates/xer-template.md +1 -3
  174. package/docs/ja/specdojo/exec-templates/xrp-job-template.md +6 -4
  175. package/docs/ja/specdojo/guides/exec-config-guide.md +97 -22
  176. package/docs/ja/specdojo/guides/exec-operation-guide.md +145 -12
  177. package/docs/ja/specdojo/guides/exec-worktree-guide.md +2 -0
  178. package/docs/ja/specdojo/guides/orchestrator-operation-guide.md +51 -18
  179. package/docs/ja/specdojo/guides/quick-start-guide.md +81 -16
  180. package/docs/ja/specdojo/guides/register-operation-guide.md +2 -1
  181. package/docs/ja/specdojo/guides/remote-host-development-guide.md +10 -1
  182. package/docs/ja/specdojo/guides/review-guide.md +1 -1
  183. package/docs/ja/specdojo/guides/routine-operation-guide.md +6 -6
  184. package/docs/ja/specdojo/guides/use-case-guide.md +1 -1
  185. package/docs/ja/specdojo/references/command-reference.md +52 -28
  186. package/docs/ja/specdojo/rulebooks/pjr-rulebook.md +17 -11
  187. package/docs/ja/specdojo/standards/job-definition-standard.md +20 -18
  188. package/docs/ja/specdojo/standards/rulebook-authoring-standard.md +2 -2
  189. package/docs/ja/specdojo/templates/pjr-derived-items-template.md +22 -0
  190. package/docs/ja/specdojo/templates/pjr-index-template.md +1 -0
  191. package/docs/specdojo/schemas/v1/agent-members.schema.yaml +29 -2
  192. package/docs/specdojo/schemas/v1/exec-defaults.schema.yaml +20 -0
  193. package/docs/specdojo/schemas/v1/exec-evidence.schema.yaml +23 -0
  194. package/docs/specdojo/schemas/v1/job-run.schema.yaml +2 -2
  195. package/docs/specdojo/schemas/v1/job.schema.yaml +7 -0
  196. package/docs/specdojo/schemas/v1/pipeline-state.schema.yaml +26 -0
  197. package/docs/specdojo/schemas/v1/register-events.schema.yaml +3 -0
  198. package/docs/specdojo/schemas/v1/register-item-frontmatter.schema.yaml +70 -7
  199. package/docs/specdojo/schemas/v1/routine-run.schema.yaml +1 -1
  200. package/docs/specdojo/schemas/v1/specdojo-config.schema.yaml +1 -1
  201. package/package.json +4 -5
  202. package/templates/antigravity/README.md +7 -3
  203. package/templates/antigravity/agent-members-snippet.yaml +108 -12
  204. package/templates/antigravity/exec-defaults-snippet.yaml +10 -13
  205. package/templates/claude/README.md +27 -3
  206. package/templates/claude/agents/claude-executor.md +0 -1
  207. package/templates/claude/agents/claude-reporter.md +2 -1
  208. package/templates/claude/agents/claude-review-executor.md +0 -1
  209. package/templates/codex/README.md +23 -4
  210. package/templates/devcontainer/devcontainer.json +2 -2
  211. package/templates/devcontainer/remote-host/specdojo-tmux.sh.sample +69 -0
  212. package/templates/devcontainer/remote-host/ssh-config.sample +16 -0
  213. package/templates/init-agent-members.yaml +75 -25
  214. package/templates/init-exec-defaults.yaml +26 -8
  215. package/templates/opencode/README.md +17 -3
  216. package/templates/opencode/agents/opencode-executor.md +0 -1
  217. package/templates/opencode/agents/opencode-reporter.md +2 -1
  218. package/templates/opencode/agents/opencode-review-executor.md +0 -1
  219. package/dist/exec-run.js +0 -6182
  220. package/dist/exec-schedule-gantt-chart.js +0 -2
  221. package/dist/exec-worktree-ops.js +0 -1292
  222. package/dist/exec-worktree.js +0 -446
  223. package/dist/grade.js +0 -3193
  224. package/dist/register.js +0 -2407
  225. package/dist/schedule-strategy-generate.js +0 -812
  226. package/templates/claude/agents/claude-expert-review-executor.md +0 -14
  227. /package/dist/{catalog-plan-prompt.js → catalog/plan-prompt.js} +0 -0
  228. /package/dist/{catalog-types.js → catalog/types.js} +0 -0
  229. /package/dist/{template-frontmatter.js → docs/template-frontmatter.js} +0 -0
  230. /package/dist/{role-types.js → exec/role-types.js} +0 -0
  231. /package/dist/{exec-schedule-gantt-chart-scope.js → exec/schedule/gantt-chart-scope.js} +0 -0
  232. /package/dist/{exec-types.js → exec/types.js} +0 -0
  233. /package/dist/{review-types.js → review/types.js} +0 -0
  234. /package/dist/{schedule-phase-sets.js → schedule/phase-sets.js} +0 -0
  235. /package/dist/{schedule-strategy-profiles.js → schedule/strategy-profiles.js} +0 -0
  236. /package/dist/{agent-response.js → shared/agent-response.js} +0 -0
  237. /package/dist/{catalog-paths.js → shared/catalog-paths.js} +0 -0
  238. /package/dist/{dist-freshness.js → shared/dist-freshness.js} +0 -0
  239. /package/dist/{git-environment.js → shared/git-environment.js} +0 -0
  240. /package/dist/{exec-format.js → shared/markdown-format.js} +0 -0
  241. /package/dist/{practice-id.js → shared/practice-id.js} +0 -0
  242. /package/dist/{spawn-self.js → shared/spawn-self.js} +0 -0
  243. /package/dist/{specdojo-gitignore.js → shared/specdojo-gitignore.js} +0 -0
  244. /package/dist/{template-resolution.js → shared/template-resolution.js} +0 -0
  245. /package/dist/{yaml-schema-modeline.js → shared/yaml-schema-modeline.js} +0 -0
@@ -68,9 +68,10 @@ Job Definition Standard
68
68
  - 既存 Job Run の retry は保存済みの対象と再開状態を維持するため precondition を再実行しない。`--dry-run` は precondition を実行せず、解決済みコマンドと skip 条件を表示する。
69
69
  - command から対象プロジェクトを指定するときは template 値 `{{project_id}}` を使い、同じ CLI を子プロセスで呼ぶときは `{{specdojo}}` を使う。`specdojo` という PATH 上の別 checkout を直接呼ばない。
70
70
  - script が中断再開用の ID を要求するときは `{{job_run_id}}` を渡す。期間などの `inputs` から再開キーを組み立てない。
71
- - runner は POSIX 環境では `/bin/sh -eu` でコマンドを実行し、終了コードが0以外なら agent を起動せず Run を失敗にする。
71
+ - runner は POSIX 環境では `/bin/sh -eu` でコマンドを実行する。終了コード0は`succeeded`、`task.partial_exit_code`に明示した非0は`partial`、それ以外の非0は`failed`とする。
72
+ - `task.partial_exit_code`は1〜255の単一値とし、完了した処理と再試行可能な失敗が同じ Run に混在してreviewへ委ねる必要がある command Jobだけが指定する。command 内の前処理などが偶然同じ終了コードを返さないように正規化し、汎用的なエラー終了を部分成功へ読み替えてはならない。
72
73
  - runner はコマンド、終了コード、標準出力、標準エラーを bounded・redacted evidence として保存する。stdout / stderr は監査用ログへの参照に加え、analysis reporter が追加のファイル読取なしで判断できるよう evidence 本体にも同じ bounded 内容を含める。
73
- - `task.analysis` は任意である。省略時は終了コードだけで成否を確定し、指定時はコマンド成功後に evidence を reporter agent へ渡す。
74
+ - `task.analysis` は任意である。省略時は終了コードだけで状態を確定し、指定時は`succeeded`または`partial`のコマンド後に evidence を reporter agent へ渡す。
74
75
  - analysis の根拠にする生成ファイルは command が stdout へ出力する。reporter は evidence 本体に埋め込まれた bounded stdout / stderr だけを読み、参照先ログや作業ツリーのファイルを追加で検査しない。
75
76
 
76
77
  ### 3.4. 責務境界と粒度
@@ -102,22 +103,23 @@ Job Definition Standard
102
103
 
103
104
  ## 4. 値制約・判定基準
104
105
 
105
- | 項目 | 必須 | 判定基準 |
106
- | ---------------------- | ---- | ------------------------------------------------------------------------------- |
107
- | `id` | ○ | `job-<slug>` 形式で、ファイル名の拡張子を除いた部分と一致する |
108
- | `task.mode` | ○ | `edit` / `review` / `command` |
109
- | `task.description` | 条件 | `edit` / `review` で必須。決定論的手順の列挙を含まない |
110
- | `task.command` | 条件 | `command` で必須。入力展開後も非空 |
111
- | `task.precondition` | 任意 | `command` と `empty-output` または 0〜255 の終了コードを指定 |
112
- | `task.analysis` | 任意 | command 結果の判断が必要な場合だけ agent と description を指定 |
113
- | `task.targets` `paths` | 条件 | `edit` / `review` はいずれか必須。`command` では任意 |
114
- | `task.agent.executor` | 任意 | `.specdojo/agent-members.yaml` の nickname 書式(`^[a-z0-9][a-z0-9_-]{0,62}$`) |
115
- | `task.agent.reporter` | 任意 | 同上。executor が result を書かない構成では必須 |
116
- | `task.review` | 任意 | mapping。存在すれば統合前 review の宣言。`agent` 以外のキーを持たない |
117
- | `task.review.agent` | 任意 | `executor` 必須・`reporter` 任意。書式は `task.agent` と同じ nickname 書式 |
118
- | `inputs.*.enum` | 任意 | scalar の値または list の各要素に対する非空の許容値集合 |
119
- | `minimum` / `maximum` | 任意 | integer input だけに指定でき、`minimum <= maximum` |
120
- | `run.idempotency_key` | ○ | 空文字へ解決されず、同じ論理実行を一意に判別できる |
106
+ | 項目 | 必須 | 判定基準 |
107
+ | ------------------------ | ---- | ------------------------------------------------------------------------------- |
108
+ | `id` | ○ | `job-<slug>` 形式で、ファイル名の拡張子を除いた部分と一致する |
109
+ | `task.mode` | ○ | `edit` / `review` / `command` |
110
+ | `task.description` | 条件 | `edit` / `review` で必須。決定論的手順の列挙を含まない |
111
+ | `task.command` | 条件 | `command` で必須。入力展開後も非空 |
112
+ | `task.partial_exit_code` | 任意 | `command` だけで使用する1〜255の終了コード。明示した値だけを`partial`とする |
113
+ | `task.precondition` | 任意 | `command` と `empty-output` または 0〜255 の終了コードを指定 |
114
+ | `task.analysis` | 任意 | command 結果の判断が必要な場合だけ agent と description を指定 |
115
+ | `task.targets` `paths` | 条件 | `edit` / `review` はいずれか必須。`command` では任意 |
116
+ | `task.agent.executor` | 任意 | `.specdojo/agent-members.yaml` の nickname 書式(`^[a-z0-9][a-z0-9_-]{0,62}$`) |
117
+ | `task.agent.reporter` | 任意 | 同上。executor が result を書かない構成では必須 |
118
+ | `task.review` | 任意 | mapping。存在すれば統合前 review の宣言。`agent` 以外のキーを持たない |
119
+ | `task.review.agent` | 任意 | `executor` 必須・`reporter` 任意。書式は `task.agent` と同じ nickname 書式 |
120
+ | `inputs.*.enum` | 任意 | scalar の値または list の各要素に対する非空の許容値集合 |
121
+ | `minimum` / `maximum` | 任意 | integer input だけに指定でき、`minimum <= maximum` |
122
+ | `run.idempotency_key` | ○ | 空文字へ解決されず、同じ論理実行を一意に判別できる |
121
123
 
122
124
  ## 5. 記述例
123
125
 
@@ -145,6 +145,6 @@ specdojo:
145
145
  `document_kinds` の `include` / `exclude` を列挙している観点ごとに、新しい rulebook の扱いを判断する。
146
146
  観点を当てはめない場合は `exclude`(`include` の観点では当てはめる場合に `include`)へ、
147
147
  既定の結果のままにする場合は `confirmed_default` へ rulebook ID を追加する。
148
- - 判断の漏れは `src/viewpoint-document-kinds-check.ts` の検証が観点 ID と rulebook ID の組で
148
+ - 判断の漏れは `src/docs/viewpoint-document-kinds-check.ts` の検証が観点 ID と rulebook ID の組で
149
149
  error として報告する。検証は `npm test`(`npm run check` に含まれる)で実行され、
150
- `npx tsx src/viewpoint-document-kinds-check.ts` で単独でも確認できる。
150
+ `npx tsx src/docs/viewpoint-document-kinds-check.ts` で単独でも確認できる。
@@ -0,0 +1,22 @@
1
+ ---
2
+ specdojo:
3
+ id: specdojo:pjr-derived-items-template
4
+ type: template
5
+ status: draft
6
+ frontmatter_template:
7
+ specdojo:
8
+ id: _PROJECT_ID_:pjr-derived-items
9
+ type: project
10
+ status: ready
11
+ rulebook: specdojo:pjr-rulebook
12
+ part_of:
13
+ - _PROJECT_ID_:pjr-index
14
+ ---
15
+
16
+ # 登録項目の派生関係
17
+
18
+ > このファイルは個票の `derived_from` から生成された派生ビューです。正本は個票の Frontmatter であり、このファイルは再生成可能です。
19
+
20
+ ## 1. 元の項目から派生先を辿る
21
+
22
+ <!-- specdojo:view-slot=derived-items -->
@@ -40,6 +40,7 @@ Project Register
40
40
  - [[pjr-views-by-status|台帳ビュー(状態別)]]
41
41
  - [[pjr-views-by-priority|台帳ビュー(優先度別)]]
42
42
  - [[pjr-views-by-owner|台帳ビュー(担当者別)]]
43
+ - [[pjr-derived-items|登録項目の派生関係]]
43
44
 
44
45
  ### 2.2. controls 全体の派生管理ビュー
45
46
 
@@ -13,7 +13,18 @@ properties:
13
13
  items:
14
14
  $ref: "#/$defs/AgentMember"
15
15
  uniqueItems: true
16
+ aliases:
17
+ type: array
18
+ description: >
19
+ Backward-compatible names that refer to concrete members. alias_of may refer to
20
+ another alias, but every chain must terminate at an enabled member.
21
+ items:
22
+ $ref: "#/$defs/AgentAlias"
23
+ uniqueItems: true
16
24
  $defs:
25
+ AgentNickname:
26
+ type: string
27
+ pattern: "^[a-z0-9][a-z0-9_-]{0,62}$"
17
28
  RoleLabel:
18
29
  type: string
19
30
  pattern: "^[A-Z]{2,4}$"
@@ -23,8 +34,7 @@ $defs:
23
34
  required: [nickname, display_name, roles, type, provider, capabilities, proficiency, priority]
24
35
  properties:
25
36
  nickname:
26
- type: string
27
- pattern: "^[a-z0-9][a-z0-9_-]{0,62}$"
37
+ $ref: "#/$defs/AgentNickname"
28
38
  display_name:
29
39
  type: string
30
40
  minLength: 1
@@ -42,6 +52,14 @@ $defs:
42
52
  const: agent
43
53
  provider:
44
54
  enum: [opencode, claude, codex, copilot, antigravity, custom]
55
+ model:
56
+ type: string
57
+ minLength: 1
58
+ description: "Provider model identifier, including its version when applicable."
59
+ effort:
60
+ type: string
61
+ minLength: 1
62
+ description: "Provider-specific reasoning effort passed when the provider supports it."
45
63
  persona:
46
64
  type: string
47
65
  minLength: 1
@@ -74,3 +92,12 @@ $defs:
74
92
  enum: [critical-first, dependency-first, fifo, manual]
75
93
  note:
76
94
  type: string
95
+ AgentAlias:
96
+ type: object
97
+ additionalProperties: false
98
+ required: [nickname, alias_of]
99
+ properties:
100
+ nickname:
101
+ $ref: "#/$defs/AgentNickname"
102
+ alias_of:
103
+ $ref: "#/$defs/AgentNickname"
@@ -262,6 +262,26 @@ $defs:
262
262
  oom:
263
263
  type: number
264
264
  exclusiveMinimum: 0
265
+ pinned:
266
+ type: object
267
+ additionalProperties: false
268
+ description: >
269
+ Recovery for an agent selected by nickname. CLI --on-rate-limit and fallback stage
270
+ flags override these values. Omitted action preserves the historical stop behavior.
271
+ properties:
272
+ action:
273
+ type: string
274
+ enum: [stop, wait, fallback]
275
+ max_wait_seconds:
276
+ type: number
277
+ minimum: 0
278
+ description: Maximum wait for reset/retry-after/cooldown (default 28800 seconds).
279
+ fallback_executor_by:
280
+ type: string
281
+ pattern: "^[a-z0-9][a-z0-9_-]{0,62}$"
282
+ fallback_reporter_by:
283
+ type: string
284
+ pattern: "^[a-z0-9][a-z0-9_-]{0,62}$"
265
285
  on_non_critical:
266
286
  type: object
267
287
  additionalProperties: false
@@ -176,6 +176,29 @@ properties:
176
176
  reason:
177
177
  type: string
178
178
  maxLength: 1000
179
+ rate_limit_events:
180
+ description: Runner-recorded wait/fallback history for a pinned executor.
181
+ type: array
182
+ items:
183
+ type: object
184
+ additionalProperties: false
185
+ required: [action, from_actor, to_actor, resumed_at]
186
+ properties:
187
+ action:
188
+ type: string
189
+ enum: [wait, fallback]
190
+ from_actor:
191
+ type: string
192
+ minLength: 1
193
+ to_actor:
194
+ type: string
195
+ minLength: 1
196
+ resumed_at:
197
+ type: string
198
+ format: date-time
199
+ resume_at:
200
+ type: string
201
+ format: date-time
179
202
  final_message:
180
203
  type: string
181
204
  maxLength: 4000
@@ -46,7 +46,7 @@ properties:
46
46
  type: string
47
47
  format: date-time
48
48
  state:
49
- enum: [running, succeeded, failed, noop]
49
+ enum: [running, succeeded, partial, failed, noop]
50
50
  inputs:
51
51
  type: object
52
52
  task:
@@ -78,7 +78,7 @@ properties:
78
78
  type: string
79
79
  format: date-time
80
80
  status:
81
- enum: [running, succeeded, failed, noop]
81
+ enum: [running, succeeded, partial, failed, noop]
82
82
  result_ref:
83
83
  type: string
84
84
  evidence_ref:
@@ -190,6 +190,13 @@ $defs:
190
190
  command:
191
191
  type: string
192
192
  minLength: 1
193
+ partial_exit_code:
194
+ description: >
195
+ Optional non-zero exit code that records a reviewable partial Job Run. Other non-zero
196
+ exit codes remain failures.
197
+ type: integer
198
+ minimum: 1
199
+ maximum: 255
193
200
  precondition:
194
201
  type: object
195
202
  additionalProperties: false
@@ -57,6 +57,8 @@ $defs:
57
57
  format: date-time
58
58
  artifact_ref:
59
59
  type: [string, "null"]
60
+ rate_limit_events:
61
+ $ref: "#/$defs/rateLimitEvents"
60
62
  # Keys are repository names (`project` for the project repository) in integration order.
61
63
  repos:
62
64
  type: object
@@ -102,3 +104,27 @@ $defs:
102
104
  format: date-time
103
105
  artifact_ref:
104
106
  type: [string, "null"]
107
+ rate_limit_events:
108
+ $ref: "#/$defs/rateLimitEvents"
109
+ rateLimitEvents:
110
+ type: array
111
+ items:
112
+ type: object
113
+ additionalProperties: false
114
+ required: [action, from_actor, to_actor, resumed_at]
115
+ properties:
116
+ action:
117
+ type: string
118
+ enum: [wait, fallback]
119
+ from_actor:
120
+ type: string
121
+ minLength: 1
122
+ to_actor:
123
+ type: string
124
+ minLength: 1
125
+ resumed_at:
126
+ type: string
127
+ format: date-time
128
+ resume_at:
129
+ type: string
130
+ format: date-time
@@ -55,6 +55,9 @@ $defs:
55
55
  - completed
56
56
  - conclusion
57
57
  - block_reason
58
+ - approach
59
+ - targets
60
+ - derived_from
58
61
  from:
59
62
  type: string
60
63
  to:
@@ -7,8 +7,9 @@ description: >
7
7
 
8
8
  The frontmatter is the single source of truth for the structured fields of one
9
9
  register item: classification (item_type), processing status (item_status),
10
- priority, owner, dates, block reason and conclusion. The register list (pjr-index) is a derived
11
- view generated from these files, so the same field is never stored in two places.
10
+ priority, owner, dates, block reason, conclusion and derivation sources. The register list
11
+ (pjr-index) is a derived view generated from these files, so the same field is never stored in
12
+ two places.
12
13
 
13
14
  Conventions:
14
15
  - Undecided values are expressed by omitting the key. Table placeholders such as
@@ -43,6 +44,19 @@ properties:
43
44
  # required と同じ位置で対象プロパティを宣言する。
44
45
  properties:
45
46
  completed_at: true
47
+ - if:
48
+ required:
49
+ - approach
50
+ properties:
51
+ approach: true
52
+ then:
53
+ required:
54
+ - targets
55
+ properties:
56
+ targets:
57
+ type: array
58
+ minItems: 1
59
+ maxItems: 1
46
60
  - type: object
47
61
  required:
48
62
  - rulebook
@@ -143,6 +157,26 @@ properties:
143
157
  rejection. Omit the key while it is undetermined; the details stay in
144
158
  the body (list column: 結論).
145
159
 
160
+ derived_from:
161
+ type: array
162
+ items:
163
+ oneOf:
164
+ - $ref: "#/$defs/LocalRegisterItemRef"
165
+ - $ref: "#/$defs/QualifiedRegisterItemRef"
166
+ minItems: 1
167
+ uniqueItems: true
168
+ description: >
169
+ Register items from which this item was derived. Use PJR-XXXX for an item in the
170
+ same project and <project-id>:PJR-XXXX for an item in another project. Omit the key
171
+ when the item was not derived from another register item.
172
+
173
+ approach:
174
+ $ref: "#/$defs/Approach"
175
+ description: >
176
+ Execution approach for the single target. When present, targets must
177
+ contain exactly one document id whose kind is compatible with the
178
+ approach.
179
+
146
180
  targets:
147
181
  type: array
148
182
  items:
@@ -150,11 +184,13 @@ properties:
150
184
  minLength: 1
151
185
  minItems: 1
152
186
  description: >
153
- Doc ids of documents this register item targets, each resolvable
154
- via the doc index. When present, exec plan generation copies these
155
- into the plan frontmatter so that target coverage validation works
156
- for register-originated plans. Omit the key when the target
157
- documents are unknown or not applicable.
187
+ Doc ids of documents this register item targets. Deliverable targets
188
+ used with an approach are resolved via the project catalog so that
189
+ not-yet-created deliverables can be selected; kata and standalone
190
+ targets are resolved via the doc index. When present, exec plan
191
+ generation copies these into the plan frontmatter so that target
192
+ coverage validation works for register-originated plans. Omit the
193
+ key when the target documents are unknown or not applicable.
158
194
 
159
195
  $defs:
160
196
  ItemType:
@@ -200,6 +236,23 @@ $defs:
200
236
  - low
201
237
  description: "Handling priority of a register item."
202
238
 
239
+ Approach:
240
+ type: string
241
+ enum:
242
+ - fully-guided
243
+ - recipe-guided
244
+ - freeform
245
+ - bootstrap
246
+ - retrofit
247
+ - cross-deliverable-dedup
248
+ - rulebook-maintenance
249
+ - recipe-maintenance
250
+ - sample-maintenance
251
+ - template-maintenance
252
+ - finalize
253
+ - bootstrap-finalize
254
+ description: "Execution approach shared with src/shared/agent-types.ts."
255
+
203
256
  Date:
204
257
  type: string
205
258
  format: date
@@ -215,3 +268,13 @@ $defs:
215
268
  Storing the instant instead of a calendar day keeps the record independent of
216
269
  the display timezone. Write it as a quoted YAML string, because an unquoted
217
270
  date-time is loaded as a timestamp value instead of a string.
271
+
272
+ LocalRegisterItemRef:
273
+ type: string
274
+ pattern: "^PJR-[0-9ABCDEFGHJKMNPQRSTVWXYZ]{4}$"
275
+ description: "Display id of a register item in the same project."
276
+
277
+ QualifiedRegisterItemRef:
278
+ type: string
279
+ pattern: "^[a-z][a-z0-9-]*:PJR-[0-9ABCDEFGHJKMNPQRSTVWXYZ]{4}$"
280
+ description: "Project-qualified display id of a register item in another project."
@@ -27,7 +27,7 @@ properties:
27
27
  type: string
28
28
  format: date-time
29
29
  result:
30
- enum: [success, failure, skipped]
30
+ enum: [success, partial, failure, skipped]
31
31
  job_run_ids:
32
32
  type: array
33
33
  uniqueItems: true
@@ -1,7 +1,7 @@
1
1
  $schema: "https://json-schema.org/draft/2020-12/schema"
2
2
  title: SpecDojo Config (.specdojo/specdojo.config.json)
3
3
  description: >-
4
- Shape of .specdojo/specdojo.config.json. The CLI (src/specdojo-config.ts loadConfig) is the
4
+ Shape of .specdojo/specdojo.config.json. The CLI (src/shared/specdojo-config.ts loadConfig) is the
5
5
  authority for checks that a schema cannot express: repository names that collide with a
6
6
  project id and repository paths that do not exist.
7
7
  type: object
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specdojo",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "A dojo for Spec-Dō, the way of specification: decide with a register, write specs and designs with kata, and keep sharpening them with AI.",
5
5
  "license": "MIT",
6
6
  "author": "naoji3x",
@@ -69,8 +69,8 @@
69
69
  "orch:sol:work": "tools/worktree/open-agent-worktree.sh codex-work codex -m gpt-5.6-sol \"$(cat .agents/specdojo-orchestrator.agent.md)\"",
70
70
  "orch:copilot": "copilot --agent specdojo-orchestrator",
71
71
  "orch:copilot:work": "tools/worktree/open-agent-worktree.sh copilot-work copilot --agent specdojo-orchestrator",
72
- "orch:agy": "agy --add-dir \"$(pwd)\" --model gemini-3.1-pro-high -i \"$(cat .agents/specdojo-orchestrator.agent.md)\"",
73
- "orch:agy:work": "tools/worktree/open-agent-worktree.sh agy-work agy --add-dir \"$(pwd)\" --model gemini-3.1-pro-high -i \"$(cat .agents/specdojo-orchestrator.agent.md)\"",
72
+ "orch:agy": "agy --add-dir \"$(pwd)\" --model gemini-3.8-flash-high -i \"$(cat .agents/specdojo-orchestrator.agent.md)\"",
73
+ "orch:agy:work": "tools/worktree/open-agent-worktree.sh agy-work agy --add-dir \"$(pwd)\" --model gemini-3.8-flash-high -i \"$(cat .agents/specdojo-orchestrator.agent.md)\"",
74
74
  "orch:qwen": "opencode --agent qwen-orchestrator",
75
75
  "orch:qwen:work": "tools/worktree/open-agent-worktree.sh qwen-work opencode --agent qwen-orchestrator",
76
76
  "orch:gemma": "opencode --agent gemma-orchestrator",
@@ -120,7 +120,7 @@
120
120
  "ajv": "^8.20.0",
121
121
  "commander": "^15.0.0",
122
122
  "dotenv": "^18.0.4",
123
- "js-yaml": "^4.3.2",
123
+ "js-yaml": "^5.4.3",
124
124
  "prettier": "^3.8.4",
125
125
  "remark-parse": "^11.0.0",
126
126
  "unified": "^11.0.5"
@@ -128,7 +128,6 @@
128
128
  "devDependencies": {
129
129
  "@commitlint/cli": "^21.0.2",
130
130
  "@commitlint/config-conventional": "^21.0.2",
131
- "@types/js-yaml": "^4.0.9",
132
131
  "@types/node": "^25.9.2",
133
132
  "@typescript-eslint/eslint-plugin": "^8.61.0",
134
133
  "@typescript-eslint/parser": "^8.61.0",
@@ -40,7 +40,7 @@ npx specdojo config scaffold --provider antigravity --global
40
40
  Antigravity CLI(`agy`)はファイル定義の agent を持たないため、`--agent <name>` では起動できません。規範の本文を `-i` で渡します。
41
41
 
42
42
  ```sh
43
- agy --add-dir "$(pwd)" --model gemini-3.1-pro-high -i "$(cat .specdojo/antigravity/orchestrator.md)"
43
+ agy --add-dir "$(pwd)" --model gemini-3.8-flash-high -i "$(cat .specdojo/antigravity/orchestrator.md)"
44
44
  ```
45
45
 
46
46
  `--add-dir "$(pwd)"` を付けないと、作業ディレクトリのファイルを読み書きできず、`AGENTS.md` と `.agents/rules/*.md` も読み込まれません。
@@ -50,11 +50,15 @@ agy --add-dir "$(pwd)" --model gemini-3.1-pro-high -i "$(cat .specdojo/antigravi
50
50
  ```json
51
51
  {
52
52
  "scripts": {
53
- "orch:agy": "agy --add-dir \"$(pwd)\" --model gemini-3.1-pro-high -i \"$(cat .specdojo/antigravity/orchestrator.md)\""
53
+ "orch:agy": "agy --add-dir \"$(pwd)\" --model gemini-3.8-flash-high -i \"$(cat .specdojo/antigravity/orchestrator.md)\""
54
54
  }
55
55
  }
56
56
  ```
57
57
 
58
58
  ## executor / reporter として使う
59
59
 
60
- `exec-defaults-snippet.yaml` を `.specdojo/exec-defaults.yaml` の `providers` へ、`agent-members-snippet.yaml` の member 定義をリポジトリ共通の `.specdojo/agent-members.yaml` の `members` へ写します。agent は project ごとの `pm-members.yaml` へ書きません。モデル ID は推論強度を含むため、`--effort` を併用すると起動に失敗します。headless 実行に必要な command は上記のグローバル permission で許可し、`--dangerously-skip-permissions` は使いません。
60
+ `exec-defaults-snippet.yaml` を `.specdojo/exec-defaults.yaml` の `providers` へ、`agent-members-snippet.yaml` の member 定義をリポジトリ共通の `.specdojo/agent-members.yaml` の `members` へ写します。agent は project ごとの `pm-members.yaml` へ書きません。
61
+
62
+ 名簿は実体と別名の 2 段で書きます。実体(`flash-executor`・`agy-opus-executor` など)は model の系統で名付け、model の ID を `model` に持ちます。従来の名前(`agy-executor`・`agy-claude-executor` など)は `aliases` で実体を指す別名にします。スニペット末尾の `aliases` の例は、向き先の member を有効にしたものだけを写します(別名は無効な member を指せません)。
63
+
64
+ 使えるモデル ID は `agy models` で確認します。モデル ID は推論強度を含むため、`--effort` を併用すると起動に失敗します。headless 実行に必要な command は上記のグローバル permission で許可し、`--dangerously-skip-permissions` は使いません。