specdojo 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/.github/agents/specdojo-orchestrator.md +61 -2
  2. package/CHANGELOG.md +65 -0
  3. package/README.md +8 -7
  4. package/dist/commands/init.js +88 -15
  5. package/dist/commands/night-orchestrator.js +287 -0
  6. package/dist/commands/orchestrator.js +10 -3
  7. package/dist/dashboard/timeline-build.js +4 -151
  8. package/dist/devcontainer/command.js +3 -1
  9. package/dist/devcontainer/scaffold.js +166 -5
  10. package/dist/exec/agent-config.js +60 -2
  11. package/dist/exec/events.js +17 -6
  12. package/dist/exec/parent-validation.js +14 -0
  13. package/dist/exec/pipeline-state.js +13 -0
  14. package/dist/exec/plans-core.js +16 -5
  15. package/dist/exec/plans-storage.js +11 -3
  16. package/dist/exec/register.js +23 -1
  17. package/dist/exec/repo-integration.js +1 -1
  18. package/dist/exec/reporter.js +113 -13
  19. package/dist/exec/results.js +36 -14
  20. package/dist/exec/run/agent-pipeline.js +3 -0
  21. package/dist/exec/run/agent.js +40 -5
  22. package/dist/exec/run/job.js +2 -2
  23. package/dist/exec/run/lifecycle-commands.js +2 -2
  24. package/dist/exec/run/register-command.js +23 -4
  25. package/dist/exec/run/register-core.js +17 -0
  26. package/dist/exec/run/register-mode.js +39 -16
  27. package/dist/exec/run/register-post-review.js +420 -0
  28. package/dist/exec/run/register-resume.js +27 -11
  29. package/dist/exec/run/register-worktree.js +66 -2
  30. package/dist/exec/run/run.js +1 -1
  31. package/dist/exec/run/shared.js +22 -24
  32. package/dist/exec/task-repos.js +102 -15
  33. package/dist/kata/kata.js +1 -1
  34. package/dist/register/core.js +17 -4
  35. package/dist/register/create-commands.js +62 -6
  36. package/dist/register/cross-project.js +134 -0
  37. package/dist/register/derivation.js +28 -7
  38. package/dist/register/event-merge.js +13 -1
  39. package/dist/register/events.js +4 -0
  40. package/dist/register/item.js +35 -5
  41. package/dist/register/migration.js +1 -0
  42. package/dist/register/register.js +47 -30
  43. package/dist/schedule/strategy-generate-scope.js +2 -1
  44. package/dist/shared/catalog-files.js +31 -0
  45. package/dist/shared/git.js +45 -15
  46. package/dist/shared/lefthook-scaffold.js +177 -0
  47. package/dist/shared/provider-scaffold.js +3 -2
  48. package/dist/shared/specdojo-config.js +87 -17
  49. package/dist/shared/text.js +4 -1
  50. package/dist/shared/timeline-index.js +125 -0
  51. package/dist/shared/workspace-scaffold.js +69 -0
  52. package/docs/ja/specdojo/exec-templates/xep-common-conventions-template.md +2 -1
  53. package/docs/ja/specdojo/exec-templates/xep-register-template.md +2 -0
  54. package/docs/ja/specdojo/exec-templates/xrp-register-post-run-template.md +46 -0
  55. package/docs/ja/specdojo/guides/branch-workflow-guide.md +34 -1
  56. package/docs/ja/specdojo/guides/docs-structure-guide.md +2 -0
  57. package/docs/ja/specdojo/guides/exec-config-guide.md +79 -11
  58. package/docs/ja/specdojo/guides/exec-operation-guide.md +39 -1
  59. package/docs/ja/specdojo/guides/orchestrator-operation-guide.md +9 -3
  60. package/docs/ja/specdojo/guides/plan-result-lifecycle-guide.md +4 -2
  61. package/docs/ja/specdojo/guides/quick-start-guide.md +31 -6
  62. package/docs/ja/specdojo/guides/register-operation-guide.md +54 -0
  63. package/docs/ja/specdojo/guides/remote-host-development-guide.md +52 -6
  64. package/docs/ja/specdojo/guides/specdojo-overview-guide.md +1 -1
  65. package/docs/ja/specdojo/guides/waza-guide.md +1 -1
  66. package/docs/ja/specdojo/references/command-reference.md +138 -64
  67. package/docs/ja/specdojo/references/specdojo-config-reference.md +41 -12
  68. package/docs/ja/specdojo/rulebooks/pjr-rulebook.md +5 -2
  69. package/docs/specdojo/schemas/v1/exec-defaults.schema.yaml +92 -18
  70. package/docs/specdojo/schemas/v1/exec-evidence.schema.yaml +6 -1
  71. package/docs/specdojo/schemas/v1/pipeline-state.schema.yaml +12 -0
  72. package/docs/specdojo/schemas/v1/register-events.schema.yaml +2 -0
  73. package/docs/specdojo/schemas/v1/register-item-frontmatter.schema.yaml +21 -0
  74. package/docs/specdojo/schemas/v1/specdojo-config.schema.yaml +40 -0
  75. package/package.json +17 -17
  76. package/templates/antigravity/README.md +1 -1
  77. package/templates/antigravity/orchestrator.md +61 -2
  78. package/templates/claude/agents/specdojo-orchestrator.md +61 -2
  79. package/templates/codex/README.md +17 -0
  80. package/templates/codex/agents/specdojo-orchestrator.toml +61 -2
  81. package/templates/codex/orchestrator.md +61 -2
  82. package/templates/devcontainer/devcontainer.json +3 -0
  83. package/templates/devcontainer/post-create.sh +15 -7
  84. package/templates/devcontainer/remote-host/specdojo-tmux.sh.sample +38 -5
  85. package/templates/devcontainer/remote-host/ssh-config.sample +3 -0
  86. package/templates/devcontainer/vim/vimrc +37 -0
  87. package/templates/init-agent-members.yaml +6 -6
  88. package/templates/init-exec-defaults.yaml +20 -1
  89. package/templates/lefthook/tools/install-lefthook.mjs +46 -0
  90. package/templates/lefthook/tools/specdojo-pre-commit.mjs +207 -0
  91. package/templates/opencode/README.md +6 -1
  92. package/templates/opencode/agents/specdojo-orchestrator.md +62 -3
  93. /package/dist/{shared → kata}/yaml-schema-modeline.js +0 -0
@@ -83,22 +83,47 @@ SpecDojo Configuration Reference
83
83
 
84
84
  ## 4. projectの非パスキー
85
85
 
86
- | キー | 既定値 | 役割・利用箇所 |
87
- | ----------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
88
- | `project_context` | `["prj-overview"]` | edit / review plan へ常に渡す project 共通文書のローカル ID です。空配列 `[]` で無効化できます。`depends_on` や成果物の `based_on` は変更しません。 |
89
- | `run` | `{}` | agent 実行、worktree、登録日の表示に関する project 単位の設定です。 |
90
- | `repos` | なし | project のタスクが変更するプロダクトリポジトリの宣言です。詳細は「`repos`のキー」を参照してください。 |
86
+ | キー | 既定値 | 役割・利用箇所 |
87
+ | -------------------- | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
88
+ | `integration_branch` | `project/<project-id>/develop` | 別 project の作業ツリーから `register add --project <project-id> --commit` で直接記帳する統合ブランチです。 |
89
+ | `project_context` | `["prj-overview"]` | edit / review plan へ常に渡す project 共通文書のローカル ID です。空配列 `[]` で無効化できます。`depends_on` や成果物の `based_on` は変更しません。 |
90
+ | `run` | `{}` | agent 実行、worktree、登録日の表示に関する project 単位の設定です。 |
91
+ | `repos` | なし | project のタスクが変更するプロダクトリポジトリの宣言です。詳細は「`repos`のキー」を参照してください。 |
92
+
93
+ project の `integration_branch` は、`repos[].integration_branch` とは別の設定です。前者は project リポジトリ内の登録簿へ直接記帳するブランチ、後者は exec が各プロダクトリポジトリへ変更を統合するブランチを表します。指定した project の統合ブランチはローカルに存在していなければなりません。
91
94
 
92
95
  ## 5. `run`のキー
93
96
 
94
97
  `projects.<project-id>.run` に指定します。これらのパスは `base_path` の影響を受けず、リポジトリルート基準です。
95
98
 
96
- | キー | 既定値 | 役割・利用箇所 |
97
- | ------------------------ | -------------- | ------------------------------------------------------------------------------------------------------------- |
98
- | `exec_defaults` | なし | provider、権限、リトライなどを定義する exec defaults ファイルです。agent を起動する `exec run` が参照します。 |
99
- | `agent_config` | なし | `exec_defaults` の旧キーです。互換目的でのみ利用し、新しい設定では `exec_defaults` を使います。 |
100
- | `worktree_base` | `../worktrees` | `exec run --worktree` / `--auto` と `exec trial` が作る worktree の親です。リポジトリ外を指定します。 |
101
- | `register_date_timezone` | `UTC` | 登録簿の「登録日」「完了日」を日時から暦日へ変換する IANA タイムゾーン名です。例は `Asia/Tokyo` です。 |
99
+ | キー | 既定値 | 役割・利用箇所 |
100
+ | ------------------------ | -------------- | ---------------------------------------------------------------------------------------------------------------------------- |
101
+ | `exec_defaults` | なし | provider、権限、リトライなどを定義する exec defaults ファイルです。agent を起動する `exec run` が参照します。 |
102
+ | `agent_config` | なし | `exec_defaults` の旧キーです。互換目的でのみ利用し、新しい設定では `exec_defaults` を使います。 |
103
+ | `parent_validations` | `[]` | この project だけで追加する親 runner の検証です。`exec_defaults` の `pipeline.parent_validations` の後ろへ指定順に加えます。 |
104
+ | `worktree_base` | `../worktrees` | `exec run --worktree` / `--auto` と `exec trial` が作る worktree の親です。リポジトリ外を指定します。 |
105
+ | `register_date_timezone` | `UTC` | 登録簿の「登録日」「完了日」を日時から暦日へ変換する IANA タイムゾーン名です。例は `Asia/Tokyo` です。 |
106
+
107
+ `parent_validations` の要素は、共有 defaults と同じく検証 ID、または `{ "id": "<id>", "repo": "<repo>" }` です。共有 defaults を複製せず、プロダクトリポジトリを持つ project だけに検証を追加できます。たとえば `prj-0002` だけで `specdojo-lp` の型と lint を検査する設定は次のとおりです。
108
+
109
+ ```json
110
+ {
111
+ "projects": {
112
+ "prj-0002": {
113
+ "repos": [{ "name": "specdojo-lp", "path": "../specdojo-lp" }],
114
+ "run": {
115
+ "exec_defaults": ".specdojo/exec-defaults.yaml",
116
+ "parent_validations": [
117
+ { "id": "typecheck", "repo": "specdojo-lp" },
118
+ { "id": "lint-ts", "repo": "specdojo-lp" }
119
+ ]
120
+ }
121
+ }
122
+ }
123
+ }
124
+ ```
125
+
126
+ 有効な一覧は「共有 defaults の `pipeline.parent_validations` → project の `run.parent_validations`」の順です。同じ ID と実行先の組が両方にある場合は重複として agent 起動前にエラーになります。`run.parent_validations` を省略した project には共有 defaults だけが適用されるため、`repos` を持たない別 project はプロダクトリポジトリ向けの追加検証に影響されません。許可される ID と実行結果の記録は [[specdojo:exec-config-guide|exec設定ガイド]] を参照してください。
102
127
 
103
128
  `config init` は一般既定の `../worktrees` ではなく、実行したリポジトリのディレクトリ名から作る `../<リポジトリ名>-worktrees` を `worktree_base` へ明示します。例えば `app1-specdojo/` で実行した場合は `../app1-specdojo-worktrees` です。
104
129
 
@@ -115,6 +140,8 @@ SpecDojo Configuration Reference
115
140
  | `integration_branch` | 任意 | そのリポジトリの現在のブランチ | exec が変更を統合する先のブランチです。exec branch もこのブランチの先端から作ります。 |
116
141
  | `setup` | 任意 | 両方 `true` | worktree 作成時の準備の有無です。`install`(依存導入)と `build`(生成物の build)を真偽値で指定します。 |
117
142
 
143
+ register の worktree 実行では、`exec run --integration-branch <repo>=<branch>` により `integration_branch` を run ごとに上書きできます。統合先の優先順位は「run の指定 → `repos[].integration_branch` → そのリポジトリの現在のブランチ」です。指定方法、ローカルブランチの検査、並列実行と再開時の扱いは [[specdojo:command-reference]] を参照してください。
144
+
118
145
  ```json
119
146
  {
120
147
  "base_path": "docs/ja/projects/prj-0001",
@@ -141,7 +168,7 @@ SpecDojo Configuration Reference
141
168
  `repos` を宣言した project の `exec run --worktree` と `exec worktree prepare` は、タスクごとに次の worktree を作ります。宣言の無い project は従来どおり `<worktree_base>/<task-id>/` の直下に 1 つだけ作ります。
142
169
 
143
170
  - `<worktree_base>/<task-id>/project/`: プロジェクトリポジトリの worktree です。agent の作業ディレクトリ(`cwd`)になります。`project` が予約名なのはこのためです。
144
- - `<worktree_base>/<task-id>/<name>/`: 宣言した各リポジトリの worktree です。exec branch は `integration_branch`(省略時は現在のブランチ)の先端から作ります。
171
+ - `<worktree_base>/<task-id>/<name>/`: 宣言した各リポジトリの worktree です。exec branch は run の `--integration-branch`、`integration_branch`、現在のブランチの順で解決した統合先の先端から作ります。
145
172
 
146
173
  agent には、各 worktree の絶対パスを次の環境変数で渡します。
147
174
 
@@ -169,6 +196,8 @@ agent 実行の前後で行う保護設定(`package.json`、CI 設定など)
169
196
 
170
197
  exec worktree の中で設定を読む場合(agent が worktree で `specdojo` を実行する場合など)、`path` の代わりに同じタスクの `<worktree_base>/<task-id>/<name>/` へ解決します。
171
198
 
199
+ `repos` を宣言した project では、`specdojo config scaffold --workspace` を実行すると、リポジトリルートに VS Code のマルチルートワークスペース(`<project-id>.code-workspace`)を生成できます。ワークスペースの `folders` にはプロジェクトリポジトリ(`.`)と宣言した各プロダクトリポジトリ(`repos[].path`)が宣言順に並び、VS Code で 1 つのウィンドウから両リポジトリを同時に操作できます。既存のワークスペースファイルは `--force` を付けない限り上書きしません。
200
+
172
201
  設定の読み込み時に、次の誤りを対象(`projects.<project-id>.repos[<n>]`)と原因を示すエラーにします。誤りは全 project 分をまとめて表示します。
173
202
 
174
203
  - `name` が `[a-z0-9-]` 以外の文字を含む、または同じ project 内で重複している。
@@ -65,6 +65,7 @@ Project Register Documentation Rules
65
65
  | `item_type` | 登録項目の分類 | ○ |
66
66
  | `item_status` | 登録項目の処理状態 | ○ |
67
67
  | `priority` | 対応優先度 | ○ |
68
+ | `difficulty` | agent 振り分け用の作業難易度 | 任意 |
68
69
  | `owner` | 主担当者または役割 | 任意 |
69
70
  | `registered_at` | 起票日時 | 任意 |
70
71
  | `due_on` | 対応期限または判断期限 | 任意 |
@@ -76,7 +77,7 @@ Project Register Documentation Rules
76
77
  | `targets` | 変更対象文書の doc id リスト | 任意 |
77
78
 
78
79
  - `status` は文書成熟度、`item_status` は処理状態であり、同じ状態軸として扱わない。
79
- - `item_type`、`item_status`、`priority` の値は schema の enum だけを使用する。
80
+ - `item_type`、`item_status`、`priority`、`difficulty` の値は schema の enum だけを使用する。`difficulty` は `hard` / `medium` / `easy` のいずれかとし、省略時は従来の agent 自動選択を使う。
80
81
  - `block_reason` は `waiting` 中の直近の待機・失敗理由、`conclusion` は終端時の結論として用途を分ける。`register wait --reason` は前者だけを更新し、`waiting` 以外へ遷移すると現在値から削除する。削除前の理由は項目別イベントログの変更前の値に残す。
81
82
  - Frontmatter の構造化フィールドを本文や生成一覧へ手作業で複製しない。
82
83
  - `derived_from` は同じ project の元項目を `PJR-XXXX`、別 project の元項目を `<project-id>:PJR-XXXX` で記録する。自己参照や存在しない項目は使用しない。別 project が設定にない場合は書式だけを検証し、設定された後に存在確認できるよう project 修飾を維持する。
@@ -144,7 +145,9 @@ Project Register Documentation Rules
144
145
  - 新しい項目は `register add` で作成し、個票の Frontmatter に初期値を書き込む。全 type で個票を省略しない。
145
146
  - 担当・期限・結論・topic・`derived_from`・`approach`・`targets` などを変更するときは `register update`、処理状態を変えるときは状態遷移コマンドを使用する。`register add` と `register update` では、起票元に繰り返し指定できる `--from`、進め方に `--approach`、対象に繰り返し指定できる `--target` を使う。起票元、`approach`、対象を削除するときは、それぞれ `--from -`、`--approach -`、`--target -` を指定する。待機理由は `register wait --reason` で記録し、誤った現在値を手動補正するときは `register update --block-reason -` で削除する。
146
147
  - `register build` は個票を読み取り、一覧・派生ビューを再生成する。`generated/pjr-derived-items.md` では `derived_from` を逆引きし、元の項目から派生先を辿れるようにする。一覧を編集して個票へ反映する経路はない。
147
- - `register add`、状態遷移、`register update`、`register renumber` は現在値を個票へ、イベントを対応する項目別ログへ記録する。`--by` で actor、`--reason` で理由を明示でき、省略時もコマンドが既定値を記録する。
148
+ - `register add`、状態遷移、`register update`、`register renumber` は現在値を個票へ、イベントを対応する項目別ログへ記録する。`--by` で actor、`--reason` で理由を明示でき、省略時は予約 actor の `SpecDojo` を記録する。
149
+ - `--by` に指定できるのは、project の `pm-members.yaml` にある人の nickname、repository の `.specdojo/agent-members.yaml` にある agent の nickname または alias、予約 actor の `SpecDojo`・`specdojo-orchestrator`・`night-orchestrator` に限る。agent の alias は実体の nickname に解決して記録し、名簿にも予約一覧にもない値は書き込み前に拒否する。
150
+ - 決定・承認を記録する actor には、`PO` などの Role code や予約 actor ではなく、決定・承認した人の nickname を使う。`specdojo-orchestrator` は対話型オーケストレーター自身の操作だけに使い、人の判断主体を代替しない。
148
151
  - 同じ現在値へ同じ操作を再実行した場合は、新しいイベントを追加しない。イベント ID と直前イベント参照を保ったまま再実行し、既存イベントの置換や削除で重複を解消しない。
149
152
  - ID の変更は `register renumber` で行い、個票のファイル名・Frontmatter・参照と生成ビューを整合させる。
150
153
  - 主題の変化に伴う `<topic>` の変更は `register update --topic` で行う。個票のファイル名と Frontmatter の文書 ID、他文書中の旧文書 ID 参照を同時に更新し、生成ビューを再生成する。
@@ -5,11 +5,11 @@ description: >
5
5
  Defines global defaults for specdojo exec run.
6
6
  Agent selection requirements are declared on sch-strategy phases; this file only
7
7
  contains runtime defaults shared across tracks, such as parent-run pipeline validations,
8
- agent launch command templates, rate-limit detection, and retry policy.
8
+ agent launch command templates, rate-limit / connection-error detection, and retry policy.
9
9
  Detection signals, exit codes, and wait times differ per agent runtime provider, so the
10
- top-level rate_limit_detection / rate_limit_policy act as global defaults and providers.<name>
11
- supplies per-provider overrides keyed by pm-members[].provider. Launch command templates
12
- are provider-specific and have no global default.
10
+ top-level rate_limit_detection / connection_error_detection / rate_limit_policy act as global
11
+ defaults and providers.<name> supplies per-provider overrides keyed by pm-members[].provider.
12
+ Launch command templates are provider-specific and have no global default.
13
13
  type: object
14
14
  additionalProperties: false
15
15
 
@@ -23,21 +23,36 @@ properties:
23
23
  description: "Defaults for `exec run`, including register execution location and project concurrency."
24
24
 
25
25
  rate_limit_detection:
26
- $ref: "#/$defs/RateLimitDetection"
26
+ $ref: "#/$defs/AgentErrorDetection"
27
27
  description: >
28
28
  Global default signals used to detect agent rate-limit / transient failures.
29
29
  Used for members whose provider has no override under providers.<name>.
30
30
 
31
+ connection_error_detection:
32
+ $ref: "#/$defs/AgentErrorDetection"
33
+ description: >
34
+ Global default signals used to detect agent connection failures. A pinned stage switches
35
+ once to its configured fallback agent when these signals match, independently of
36
+ --on-rate-limit. Used when a provider has no override under providers.<name>.
37
+
31
38
  rate_limit_policy:
32
39
  $ref: "#/$defs/RateLimitPolicy"
33
40
  description: >
34
41
  Global default behavior when an agent hits a rate limit during exec run.
35
42
  Used for members whose provider has no override under providers.<name>.
36
43
 
44
+ routing:
45
+ $ref: "#/$defs/DifficultyRouting"
46
+ description: >
47
+ Register pipeline agents and pinned rate-limit handling selected from the register item's
48
+ difficulty. Explicit CLI stage and recovery options override the matching route. Missing
49
+ difficulty entries preserve the existing priority-based automatic selection.
50
+
37
51
  providers:
38
52
  type: object
39
53
  description: >
40
- Per-provider overrides of rate_limit_detection and rate_limit_policy. The key
54
+ Per-provider overrides of rate_limit_detection, connection_error_detection, and
55
+ rate_limit_policy. The key
41
56
  matches pm-members[].provider (the agent runtime that executes the member command).
42
57
  For a given member, exec run resolves detection and policy from its provider override
43
58
  when present, otherwise from the top-level (global) values. This keeps provider-specific
@@ -49,9 +64,53 @@ properties:
49
64
  $ref: "#/$defs/ProviderOverride"
50
65
 
51
66
  $defs:
67
+ AgentNickname:
68
+ type: string
69
+ pattern: "^[a-z0-9][a-z0-9_-]{0,62}$"
70
+
71
+ DifficultyRouting:
72
+ type: object
73
+ additionalProperties: false
74
+ minProperties: 1
75
+ properties:
76
+ hard:
77
+ $ref: "#/$defs/DifficultyRoute"
78
+ medium:
79
+ $ref: "#/$defs/DifficultyRoute"
80
+ easy:
81
+ $ref: "#/$defs/DifficultyRoute"
82
+
83
+ DifficultyRoute:
84
+ type: object
85
+ additionalProperties: false
86
+ required: [executor_by, reporter_by, on_rate_limit]
87
+ properties:
88
+ executor_by:
89
+ $ref: "#/$defs/AgentNickname"
90
+ reporter_by:
91
+ $ref: "#/$defs/AgentNickname"
92
+ on_rate_limit:
93
+ type: string
94
+ enum: [stop, wait, fallback]
95
+ fallback_executor_by:
96
+ $ref: "#/$defs/AgentNickname"
97
+ fallback_reporter_by:
98
+ $ref: "#/$defs/AgentNickname"
99
+
52
100
  ParentValidationId:
53
101
  type: string
54
- enum: [validate-schema, typecheck, test-unit, test-integration, lint-ts, lint-fm, lint-md]
102
+ enum:
103
+ [
104
+ validate-schema,
105
+ typecheck,
106
+ test-unit,
107
+ test-integration,
108
+ lint-ts,
109
+ lint-fm,
110
+ lint-md,
111
+ build,
112
+ format-check,
113
+ ]
55
114
 
56
115
  PipelineDefaults:
57
116
  type: object
@@ -107,6 +166,14 @@ $defs:
107
166
  Default execution location for `exec run --register`. `--worktree` and `--in-place`
108
167
  override this value. When omitted, the historical `in-place` behavior is retained for
109
168
  compatibility with existing repositories.
169
+ register_post_review:
170
+ type: boolean
171
+ default: false
172
+ description: >
173
+ Whether `exec run --register` performs a read-only completion review after worktree
174
+ integration and automatically closes eligible todo/issue items. `--post-review` enables
175
+ the same behavior for one run. This option requires worktree execution and is disabled
176
+ when omitted.
110
177
  max_concurrent_runs:
111
178
  type: integer
112
179
  minimum: 1
@@ -140,8 +207,13 @@ $defs:
140
207
  Extra template variables resolved by member attributes. Resolution precedence is
141
208
  by_nickname, then by_proficiency, then by_mode.
142
209
  rate_limit_detection:
143
- $ref: "#/$defs/RateLimitDetection"
210
+ $ref: "#/$defs/AgentErrorDetection"
144
211
  description: "Provider-specific failure signals. Prefer stderr_patterns over generic exit_codes."
212
+ connection_error_detection:
213
+ $ref: "#/$defs/AgentErrorDetection"
214
+ description: >
215
+ Provider-specific connection failure signals. Prefer stderr_patterns over generic
216
+ exit_codes so ordinary agent failures are not treated as unavailable providers.
145
217
  rate_limit_policy:
146
218
  $ref: "#/$defs/RateLimitPolicy"
147
219
  description: "Provider-specific retry / fallback / block policy."
@@ -200,18 +272,18 @@ $defs:
200
272
  type: string
201
273
  minLength: 1
202
274
 
203
- RateLimitDetection:
275
+ AgentErrorDetection:
204
276
  type: object
205
277
  additionalProperties: false
206
- description: "Exit codes and stderr patterns that identify rate-limit / transient failures."
278
+ description: "Exit codes and output patterns that identify a configured agent failure class."
207
279
  properties:
208
280
  exit_codes:
209
281
  type: array
210
282
  uniqueItems: true
211
283
  description: >
212
- Exit codes treated as a rate-limit / transient signal. Avoid generic codes such as 1:
213
- most agent CLIs also use exit 1 for ordinary failure and for the agent's own block
214
- signal, so a bare exit 1 cannot be distinguished from a rate limit. Prefer stderr_patterns,
284
+ Exit codes treated as the configured failure signal. Avoid generic codes such as 1:
285
+ most agent CLIs also use exit 1 for ordinary failures and for the agent's own block
286
+ signal, so a bare exit 1 cannot identify one failure class. Prefer stderr_patterns,
215
287
  or set provider-specific codes under providers.<name>.
216
288
  items:
217
289
  type: integer
@@ -224,10 +296,10 @@ $defs:
224
296
  stderr_requires_nonzero_exit:
225
297
  type: boolean
226
298
  description: >
227
- Optional. When true (the default), stderr_patterns only count as a rate-limit
228
- signal if the agent process also exited non-zero. This avoids false positives
229
- where a successful run echoes a pattern phrase (e.g. an agent editing a file that
230
- contains the literal text "rate limit"). Set to false to match regardless of exit code.
299
+ Optional. When true (the default), stderr_patterns only count as the configured
300
+ failure signal if the agent process also exited non-zero. This avoids false positives
301
+ where a successful run echoes a pattern phrase. Set to false to match regardless of
302
+ exit code.
231
303
 
232
304
  RateLimitPolicy:
233
305
  type: object
@@ -267,7 +339,9 @@ $defs:
267
339
  additionalProperties: false
268
340
  description: >
269
341
  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.
342
+ flags override these values. Omitted action preserves the historical rate-limit stop
343
+ behavior. The fallback nicknames also handle configured connection errors independently
344
+ of action.
271
345
  properties:
272
346
  action:
273
347
  type: string
@@ -177,7 +177,9 @@ properties:
177
177
  type: string
178
178
  maxLength: 1000
179
179
  rate_limit_events:
180
- description: Runner-recorded wait/fallback history for a pinned executor.
180
+ description: >
181
+ Runner-recorded rate-limit wait/fallback and connection-error fallback history for a
182
+ pinned executor. The field name is retained for schema compatibility.
181
183
  type: array
182
184
  items:
183
185
  type: object
@@ -187,6 +189,9 @@ properties:
187
189
  action:
188
190
  type: string
189
191
  enum: [wait, fallback]
192
+ trigger:
193
+ type: string
194
+ enum: [rate_limit, connection_error]
190
195
  from_actor:
191
196
  type: string
192
197
  minLength: 1
@@ -19,6 +19,15 @@ properties:
19
19
  updated_at:
20
20
  type: string
21
21
  format: date-time
22
+ # Run-scoped product integration targets given by `exec run --integration-branch <repo>=<branch>`.
23
+ # Only explicit overrides are recorded; resume reuses them instead of repos[].integration_branch.
24
+ integration_branches:
25
+ type: object
26
+ propertyNames:
27
+ pattern: "^[a-z0-9-]+$"
28
+ additionalProperties:
29
+ type: string
30
+ minLength: 1
22
31
  stages:
23
32
  type: object
24
33
  additionalProperties: false
@@ -116,6 +125,9 @@ $defs:
116
125
  action:
117
126
  type: string
118
127
  enum: [wait, fallback]
128
+ trigger:
129
+ type: string
130
+ enum: [rate_limit, connection_error]
119
131
  from_actor:
120
132
  type: string
121
133
  minLength: 1
@@ -49,6 +49,7 @@ $defs:
49
49
  - description
50
50
  - type
51
51
  - priority
52
+ - difficulty
52
53
  - owner
53
54
  - registered
54
55
  - due
@@ -58,6 +59,7 @@ $defs:
58
59
  - approach
59
60
  - targets
60
61
  - derived_from
62
+ - autopilot
61
63
  from:
62
64
  type: string
63
65
  to:
@@ -108,6 +108,12 @@ properties:
108
108
  $ref: "#/$defs/Priority"
109
109
  description: "Handling priority (list column: 優先度)."
110
110
 
111
+ difficulty:
112
+ $ref: "#/$defs/Difficulty"
113
+ description: >
114
+ Work difficulty used to select the register executor/reporter route. Omit it to use
115
+ the existing priority-based automatic agent selection.
116
+
111
117
  owner:
112
118
  type: string
113
119
  minLength: 1
@@ -170,6 +176,13 @@ properties:
170
176
  same project and <project-id>:PJR-XXXX for an item in another project. Omit the key
171
177
  when the item was not derived from another register item.
172
178
 
179
+ autopilot:
180
+ type: string
181
+ const: approved
182
+ description: >
183
+ Human approval that the item's stated completion conditions may be executed by the
184
+ night orchestrator. Omit the key to keep the item out of the approved queue.
185
+
173
186
  approach:
174
187
  $ref: "#/$defs/Approach"
175
188
  description: >
@@ -236,6 +249,14 @@ $defs:
236
249
  - low
237
250
  description: "Handling priority of a register item."
238
251
 
252
+ Difficulty:
253
+ type: string
254
+ enum:
255
+ - hard
256
+ - medium
257
+ - easy
258
+ description: "Work difficulty used for register agent routing."
259
+
239
260
  Approach:
240
261
  type: string
241
262
  enum:
@@ -26,11 +26,42 @@ $defs:
26
26
  NonEmptyString:
27
27
  type: string
28
28
  pattern: "\\S"
29
+ ParentValidationId:
30
+ type: string
31
+ enum:
32
+ [
33
+ validate-schema,
34
+ typecheck,
35
+ test-unit,
36
+ test-integration,
37
+ lint-ts,
38
+ lint-fm,
39
+ lint-md,
40
+ build,
41
+ format-check,
42
+ ]
43
+ ParentValidation:
44
+ oneOf:
45
+ - $ref: "#/$defs/ParentValidationId"
46
+ - type: object
47
+ additionalProperties: false
48
+ required: [id, repo]
49
+ properties:
50
+ id:
51
+ $ref: "#/$defs/ParentValidationId"
52
+ repo:
53
+ type: string
54
+ pattern: "^[a-z0-9-]+$"
29
55
  Project:
30
56
  type: object
31
57
  properties:
32
58
  base_path:
33
59
  type: string
60
+ integration_branch:
61
+ description: >-
62
+ Branch that receives direct project-register commits. Defaults to
63
+ project/<project-id>/develop.
64
+ $ref: "#/$defs/NonEmptyString"
34
65
  catalog_path:
35
66
  type: string
36
67
  schedule_path:
@@ -104,6 +135,15 @@ $defs:
104
135
  type: string
105
136
  agent_config:
106
137
  type: string
138
+ parent_validations:
139
+ description: >-
140
+ Parent-runner validations appended, in order, to pipeline.parent_validations from this
141
+ project's exec_defaults file. A plain ID targets the project repository; { id, repo }
142
+ targets project or a product repository declared by this project.
143
+ type: array
144
+ uniqueItems: true
145
+ items:
146
+ $ref: "#/$defs/ParentValidation"
107
147
  worktree_base:
108
148
  type: string
109
149
  register_date_timezone:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specdojo",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
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",
@@ -59,22 +59,22 @@
59
59
  "vscode:package": "npm --prefix packages/vscode-specdojo run package",
60
60
  "exec:watch-claude-log": "tools/exec/watch-claude-log.sh",
61
61
  "worktree:sync": "tools/worktree/sync.sh",
62
- "orch:sonnet": "claude --agent specdojo-orchestrator --model sonnet",
63
- "orch:sonnet:work": "tools/worktree/open-agent-worktree.sh claude-work claude --agent specdojo-orchestrator --model sonnet",
64
- "orch:opus": "claude --agent specdojo-orchestrator --model opus",
65
- "orch:opus:work": "tools/worktree/open-agent-worktree.sh claude-work claude --agent specdojo-orchestrator --model opus",
66
- "orch:terra": "codex -m gpt-5.6-terra \"$(cat .agents/specdojo-orchestrator.agent.md)\"",
67
- "orch:terra:work": "tools/worktree/open-agent-worktree.sh codex-work codex -m gpt-5.6-terra \"$(cat .agents/specdojo-orchestrator.agent.md)\"",
68
- "orch:sol": "codex -m gpt-5.6-sol \"$(cat .agents/specdojo-orchestrator.agent.md)\"",
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
- "orch:copilot": "copilot --agent specdojo-orchestrator",
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.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
- "orch:qwen": "opencode --agent qwen-orchestrator",
75
- "orch:qwen:work": "tools/worktree/open-agent-worktree.sh qwen-work opencode --agent qwen-orchestrator",
76
- "orch:gemma": "opencode --agent gemma-orchestrator",
77
- "orch:gemma:work": "tools/worktree/open-agent-worktree.sh gemma-work opencode --agent gemma-orchestrator",
62
+ "orch:sonnet": "tsx src/specdojo.ts orchestrator launch --provider claude -- --agent specdojo-orchestrator --model sonnet",
63
+ "orch:sonnet:work": "tools/worktree/open-agent-worktree.sh claude-work tsx src/specdojo.ts orchestrator launch --provider claude -- --agent specdojo-orchestrator --model sonnet",
64
+ "orch:opus": "tsx src/specdojo.ts orchestrator launch --provider claude -- --agent specdojo-orchestrator --model opus",
65
+ "orch:opus:work": "tools/worktree/open-agent-worktree.sh claude-work tsx src/specdojo.ts orchestrator launch --provider claude -- --agent specdojo-orchestrator --model opus",
66
+ "orch:terra": "tsx src/specdojo.ts orchestrator launch --provider codex -- -m gpt-5.6-terra \"$(cat .agents/specdojo-orchestrator.agent.md)\"",
67
+ "orch:terra:work": "tools/worktree/open-agent-worktree.sh codex-work tsx src/specdojo.ts orchestrator launch --provider codex -- -m gpt-5.6-terra \"$(cat .agents/specdojo-orchestrator.agent.md)\"",
68
+ "orch:sol": "tsx src/specdojo.ts orchestrator launch --provider codex -- -m gpt-5.6-sol \"$(cat .agents/specdojo-orchestrator.agent.md)\"",
69
+ "orch:sol:work": "tools/worktree/open-agent-worktree.sh codex-work tsx src/specdojo.ts orchestrator launch --provider codex -- -m gpt-5.6-sol \"$(cat .agents/specdojo-orchestrator.agent.md)\"",
70
+ "orch:copilot": "tsx src/specdojo.ts orchestrator launch --provider copilot -- --agent specdojo-orchestrator",
71
+ "orch:copilot:work": "tools/worktree/open-agent-worktree.sh copilot-work tsx src/specdojo.ts orchestrator launch --provider copilot -- --agent specdojo-orchestrator",
72
+ "orch:flash": "tsx src/specdojo.ts orchestrator launch --provider antigravity -- --add-dir \"$(pwd)\" --model gemini-3.8-flash-high -i \"$(cat .agents/specdojo-orchestrator.agent.md)\"",
73
+ "orch:flash:work": "tools/worktree/open-agent-worktree.sh agy-work tsx src/specdojo.ts orchestrator launch --provider antigravity -- --add-dir . --model gemini-3.8-flash-high -i \"$(cat .agents/specdojo-orchestrator.agent.md)\"",
74
+ "orch:qwen": "tsx src/specdojo.ts orchestrator launch --provider opencode -- --agent qwen-orchestrator",
75
+ "orch:qwen:work": "tools/worktree/open-agent-worktree.sh qwen-work tsx src/specdojo.ts orchestrator launch --provider opencode -- --agent qwen-orchestrator",
76
+ "orch:gemma": "tsx src/specdojo.ts orchestrator launch --provider opencode -- --agent gemma-orchestrator",
77
+ "orch:gemma:work": "tools/worktree/open-agent-worktree.sh gemma-work tsx src/specdojo.ts orchestrator launch --provider opencode -- --agent gemma-orchestrator",
78
78
  "code:red": "tools/vscode/open-worktree-workspace.sh red",
79
79
  "code:blue": "tools/vscode/open-worktree-workspace.sh blue",
80
80
  "code:green": "tools/vscode/open-worktree-workspace.sh green",
@@ -50,7 +50,7 @@ agy --add-dir "$(pwd)" --model gemini-3.8-flash-high -i "$(cat .specdojo/antigra
50
50
  ```json
51
51
  {
52
52
  "scripts": {
53
- "orch:agy": "agy --add-dir \"$(pwd)\" --model gemini-3.8-flash-high -i \"$(cat .specdojo/antigravity/orchestrator.md)\""
53
+ "orch:flash": "specdojo orchestrator launch --provider antigravity -- --add-dir \"$(pwd)\" --model gemini-3.8-flash-high -i \"$(cat .specdojo/antigravity/orchestrator.md)\""
54
54
  }
55
55
  }
56
56
  ```